/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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 UpdateCustomVoiceResponse = { /** * Unique identifier for the voice */ voiceId: string; /** * Name of the voice */ name: string; /** * Description of the voice */ description?: string | null | undefined; }; /** @internal */ export const UpdateCustomVoiceResponse$inboundSchema: z.ZodType< UpdateCustomVoiceResponse, z.ZodTypeDef, unknown > = z.object({ voice_id: z.string(), name: z.string(), description: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "voice_id": "voiceId", }); }); /** @internal */ export type UpdateCustomVoiceResponse$Outbound = { voice_id: string; name: string; description?: string | null | undefined; }; /** @internal */ export const UpdateCustomVoiceResponse$outboundSchema: z.ZodType< UpdateCustomVoiceResponse$Outbound, z.ZodTypeDef, UpdateCustomVoiceResponse > = z.object({ voiceId: z.string(), name: z.string(), description: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { voiceId: "voice_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UpdateCustomVoiceResponse$ { /** @deprecated use `UpdateCustomVoiceResponse$inboundSchema` instead. */ export const inboundSchema = UpdateCustomVoiceResponse$inboundSchema; /** @deprecated use `UpdateCustomVoiceResponse$outboundSchema` instead. */ export const outboundSchema = UpdateCustomVoiceResponse$outboundSchema; /** @deprecated use `UpdateCustomVoiceResponse$Outbound` instead. */ export type Outbound = UpdateCustomVoiceResponse$Outbound; } export function updateCustomVoiceResponseToJSON( updateCustomVoiceResponse: UpdateCustomVoiceResponse, ): string { return JSON.stringify( UpdateCustomVoiceResponse$outboundSchema.parse(updateCustomVoiceResponse), ); } export function updateCustomVoiceResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateCustomVoiceResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateCustomVoiceResponse' from JSON`, ); }