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