/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const RepresentativeInfoReason = { Unknown: "", ProtocolPortCount: "protocol_port_count", Incapsula: "incapsula", Zscaler: "zscaler", } as const; export type RepresentativeInfoReason = OpenEnum< typeof RepresentativeInfoReason >; export type RepresentativeInfo = { excludedPorts?: Array | null | undefined; reason?: RepresentativeInfoReason | undefined; representedPorts?: Array | null | undefined; sampledPort?: number | undefined; }; /** @internal */ export const RepresentativeInfoReason$inboundSchema: z.ZodType< RepresentativeInfoReason, z.ZodTypeDef, unknown > = openEnums.inboundSchema(RepresentativeInfoReason); /** @internal */ export const RepresentativeInfo$inboundSchema: z.ZodType< RepresentativeInfo, z.ZodTypeDef, unknown > = z.object({ excluded_ports: z.nullable(z.array(z.number().int())).optional(), reason: RepresentativeInfoReason$inboundSchema.optional(), represented_ports: z.nullable(z.array(z.number().int())).optional(), sampled_port: z.number().int().optional(), }).transform((v) => { return remap$(v, { "excluded_ports": "excludedPorts", "represented_ports": "representedPorts", "sampled_port": "sampledPort", }); }); export function representativeInfoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RepresentativeInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RepresentativeInfo' from JSON`, ); }