/* * 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 CreateCustomVoiceResponse = { /** * Unique identifier for the created voice */ voiceId: string; }; /** @internal */ export const CreateCustomVoiceResponse$inboundSchema: z.ZodType< CreateCustomVoiceResponse, z.ZodTypeDef, unknown > = z.object({ voice_id: z.string(), }).transform((v) => { return remap$(v, { "voice_id": "voiceId", }); }); /** @internal */ export type CreateCustomVoiceResponse$Outbound = { voice_id: string; }; /** @internal */ export const CreateCustomVoiceResponse$outboundSchema: z.ZodType< CreateCustomVoiceResponse$Outbound, z.ZodTypeDef, CreateCustomVoiceResponse > = z.object({ voiceId: z.string(), }).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 CreateCustomVoiceResponse$ { /** @deprecated use `CreateCustomVoiceResponse$inboundSchema` instead. */ export const inboundSchema = CreateCustomVoiceResponse$inboundSchema; /** @deprecated use `CreateCustomVoiceResponse$outboundSchema` instead. */ export const outboundSchema = CreateCustomVoiceResponse$outboundSchema; /** @deprecated use `CreateCustomVoiceResponse$Outbound` instead. */ export type Outbound = CreateCustomVoiceResponse$Outbound; } export function createCustomVoiceResponseToJSON( createCustomVoiceResponse: CreateCustomVoiceResponse, ): string { return JSON.stringify( CreateCustomVoiceResponse$outboundSchema.parse(createCustomVoiceResponse), ); } export function createCustomVoiceResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateCustomVoiceResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateCustomVoiceResponse' from JSON`, ); }