/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { PortmapV2Entry, PortmapV2Entry$inboundSchema, } from "./portmapv2entry.js"; import { PortmapV3Entry, PortmapV3Entry$inboundSchema, } from "./portmapv3entry.js"; export type Portmap = { v2Entries?: Array | null | undefined; v3Entries?: Array | null | undefined; }; /** @internal */ export const Portmap$inboundSchema: z.ZodType = z.object({ v2_entries: z.nullable(z.array(PortmapV2Entry$inboundSchema)).optional(), v3_entries: z.nullable(z.array(PortmapV3Entry$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "v2_entries": "v2Entries", "v3_entries": "v3Entries", }); }); export function portmapFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Portmap$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Portmap' from JSON`, ); }