/* * 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 { StunTurnAllocateErrorResponse, StunTurnAllocateErrorResponse$inboundSchema, } from "./stunturnallocateerrorresponse.js"; import { StunTurnAllocateSuccessResponse, StunTurnAllocateSuccessResponse$inboundSchema, } from "./stunturnallocatesuccessresponse.js"; export type StunTurn = { allocateErrorResponse?: StunTurnAllocateErrorResponse | undefined; allocateSuccessResponse?: StunTurnAllocateSuccessResponse | undefined; responseType?: number | undefined; responseTypeName?: string | undefined; }; /** @internal */ export const StunTurn$inboundSchema: z.ZodType< StunTurn, z.ZodTypeDef, unknown > = z.object({ allocate_error_response: StunTurnAllocateErrorResponse$inboundSchema .optional(), allocate_success_response: StunTurnAllocateSuccessResponse$inboundSchema .optional(), response_type: z.number().int().optional(), response_type_name: z.string().optional(), }).transform((v) => { return remap$(v, { "allocate_error_response": "allocateErrorResponse", "allocate_success_response": "allocateSuccessResponse", "response_type": "responseType", "response_type_name": "responseTypeName", }); }); export function stunTurnFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => StunTurn$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StunTurn' from JSON`, ); }