/* * 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 GetCustomVoiceResponse = { /** * Unique identifier for the voice */ voiceId: string; /** * Name of the voice */ name: string; /** * Description of the voice */ description?: string | null | undefined; }; /** @internal */ export const GetCustomVoiceResponse$inboundSchema: z.ZodType< GetCustomVoiceResponse, 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 GetCustomVoiceResponse$Outbound = { voice_id: string; name: string; description?: string | null | undefined; }; /** @internal */ export const GetCustomVoiceResponse$outboundSchema: z.ZodType< GetCustomVoiceResponse$Outbound, z.ZodTypeDef, GetCustomVoiceResponse > = 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 GetCustomVoiceResponse$ { /** @deprecated use `GetCustomVoiceResponse$inboundSchema` instead. */ export const inboundSchema = GetCustomVoiceResponse$inboundSchema; /** @deprecated use `GetCustomVoiceResponse$outboundSchema` instead. */ export const outboundSchema = GetCustomVoiceResponse$outboundSchema; /** @deprecated use `GetCustomVoiceResponse$Outbound` instead. */ export type Outbound = GetCustomVoiceResponse$Outbound; } export function getCustomVoiceResponseToJSON( getCustomVoiceResponse: GetCustomVoiceResponse, ): string { return JSON.stringify( GetCustomVoiceResponse$outboundSchema.parse(getCustomVoiceResponse), ); } export function getCustomVoiceResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetCustomVoiceResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetCustomVoiceResponse' from JSON`, ); }