/* * 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 TransportProtocol = { Unknown: "", Tcp: "tcp", Udp: "udp", Icmp: "icmp", Quic: "quic", } as const; export type TransportProtocol = OpenEnum; export type MatchedService = { port?: number | undefined; protocol?: string | undefined; transportProtocol?: TransportProtocol | undefined; }; /** @internal */ export const TransportProtocol$inboundSchema: z.ZodType< TransportProtocol, z.ZodTypeDef, unknown > = openEnums.inboundSchema(TransportProtocol); /** @internal */ export const MatchedService$inboundSchema: z.ZodType< MatchedService, z.ZodTypeDef, unknown > = z.object({ port: z.number().int().optional(), protocol: z.string().optional(), transport_protocol: TransportProtocol$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "transport_protocol": "transportProtocol", }); }); export function matchedServiceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MatchedService$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MatchedService' from JSON`, ); }