/* * 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 { APISampleData, APISampleData$inboundSchema, APISampleData$Outbound, APISampleData$outboundSchema, } from "./apisampledata.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type GetCharacterByIdResponse = { /** * Unique identifier for the voice */ voiceId: string; /** * Name of the voice */ name: string; /** * Description of the voice */ description?: string | null | undefined; /** * Age of the voice */ age: string; /** * Gender of the voice */ gender: string; /** * Use case of the voice */ useCase: string; /** * Use cases of the voice (array) */ useCases: Array; /** * Languages supported by the voice */ language: Array; /** * Styles available for the voice */ styles: Array; /** * Models available for the voice */ models: Array; /** * URL to the sample audio file for the voice */ samples?: Array | undefined; /** * URL to the thumbnail image for the voice */ thumbnailImageUrl?: string | undefined; }; /** @internal */ export const GetCharacterByIdResponse$inboundSchema: z.ZodType< GetCharacterByIdResponse, z.ZodTypeDef, unknown > = z.object({ voice_id: z.string(), name: z.string(), description: z.nullable(z.string()).optional(), age: z.string(), gender: z.string(), use_case: z.string(), use_cases: z.array(z.string()), language: z.array(z.string()), styles: z.array(z.string()), models: z.array(z.string()), samples: z.array(APISampleData$inboundSchema).optional(), thumbnail_image_url: z.string().optional(), }).transform((v) => { return remap$(v, { "voice_id": "voiceId", "use_case": "useCase", "use_cases": "useCases", "thumbnail_image_url": "thumbnailImageUrl", }); }); /** @internal */ export type GetCharacterByIdResponse$Outbound = { voice_id: string; name: string; description?: string | null | undefined; age: string; gender: string; use_case: string; use_cases: Array; language: Array; styles: Array; models: Array; samples?: Array | undefined; thumbnail_image_url?: string | undefined; }; /** @internal */ export const GetCharacterByIdResponse$outboundSchema: z.ZodType< GetCharacterByIdResponse$Outbound, z.ZodTypeDef, GetCharacterByIdResponse > = z.object({ voiceId: z.string(), name: z.string(), description: z.nullable(z.string()).optional(), age: z.string(), gender: z.string(), useCase: z.string(), useCases: z.array(z.string()), language: z.array(z.string()), styles: z.array(z.string()), models: z.array(z.string()), samples: z.array(APISampleData$outboundSchema).optional(), thumbnailImageUrl: z.string().optional(), }).transform((v) => { return remap$(v, { voiceId: "voice_id", useCase: "use_case", useCases: "use_cases", thumbnailImageUrl: "thumbnail_image_url", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetCharacterByIdResponse$ { /** @deprecated use `GetCharacterByIdResponse$inboundSchema` instead. */ export const inboundSchema = GetCharacterByIdResponse$inboundSchema; /** @deprecated use `GetCharacterByIdResponse$outboundSchema` instead. */ export const outboundSchema = GetCharacterByIdResponse$outboundSchema; /** @deprecated use `GetCharacterByIdResponse$Outbound` instead. */ export type Outbound = GetCharacterByIdResponse$Outbound; } export function getCharacterByIdResponseToJSON( getCharacterByIdResponse: GetCharacterByIdResponse, ): string { return JSON.stringify( GetCharacterByIdResponse$outboundSchema.parse(getCharacterByIdResponse), ); } export function getCharacterByIdResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetCharacterByIdResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetCharacterByIdResponse' from JSON`, ); }