/* * 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 Network = { allocationType?: string | undefined; /** * A set of CIDRs describing the range. */ cidrs?: Array | null | undefined; created?: string | undefined; handle?: string | undefined; name?: string | undefined; updated?: string | undefined; }; /** @internal */ export const Network$inboundSchema: z.ZodType = z.object({ allocation_type: z.string().optional(), cidrs: z.nullable(z.array(z.string())).optional(), created: z.string().optional(), handle: z.string().optional(), name: z.string().optional(), updated: z.string().optional(), }).transform((v) => { return remap$(v, { "allocation_type": "allocationType", }); }); export function networkFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Network$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Network' from JSON`, ); }