/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { HttpRepeatedHeaders, HttpRepeatedHeaders$inboundSchema, } from "./httprepeatedheaders.js"; import { UpnpDevice, UpnpDevice$inboundSchema } from "./upnpdevice.js"; import { UpnpSpecVersion, UpnpSpecVersion$inboundSchema, } from "./upnpspecversion.js"; export type Upnp = { devices?: Array | null | undefined; endpoint?: string | undefined; headers?: { [k: string]: HttpRepeatedHeaders } | undefined; spec?: UpnpSpecVersion | undefined; }; /** @internal */ export const Upnp$inboundSchema: z.ZodType = z .object({ devices: z.nullable(z.array(UpnpDevice$inboundSchema)).optional(), endpoint: z.string().optional(), headers: z.record(HttpRepeatedHeaders$inboundSchema).optional(), spec: UpnpSpecVersion$inboundSchema.optional(), }); export function upnpFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Upnp$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Upnp' from JSON`, ); }