/* * 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"; export type Target = { alias?: string | undefined; auths?: Array | null | undefined; dnsPortals?: Array | null | undefined; errors?: Array | null | undefined; name?: string | undefined; privatePortals?: Array | null | undefined; publicPortals?: Array | null | undefined; }; /** @internal */ export const Target$inboundSchema: z.ZodType = z .object({ alias: z.string().optional(), auths: z.nullable(z.array(z.string())).optional(), dns_portals: z.nullable(z.array(z.string())).optional(), errors: z.nullable(z.array(z.string())).optional(), name: z.string().optional(), private_portals: z.nullable(z.array(z.string())).optional(), public_portals: z.nullable(z.array(z.string())).optional(), }).transform((v) => { return remap$(v, { "dns_portals": "dnsPortals", "private_portals": "privatePortals", "public_portals": "publicPortals", }); }); export function targetFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Target$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Target' from JSON`, ); }