/* * 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"; import { GetCustomVoiceResponse, GetCustomVoiceResponse$inboundSchema, GetCustomVoiceResponse$Outbound, GetCustomVoiceResponse$outboundSchema, } from "./getcustomvoiceresponse.js"; export type GetCustomVoiceListResponse = { /** * List of custom voice items */ items: Array; /** * Total number of available custom voices */ total: number; /** * Token for fetching the next page of results. A valid non-negative integer string (e.g., "10", "20"). Null if no more pages. */ nextPageToken?: string | null | undefined; }; /** @internal */ export const GetCustomVoiceListResponse$inboundSchema: z.ZodType< GetCustomVoiceListResponse, z.ZodTypeDef, unknown > = z.object({ items: z.array(GetCustomVoiceResponse$inboundSchema), total: z.number(), next_page_token: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "next_page_token": "nextPageToken", }); }); /** @internal */ export type GetCustomVoiceListResponse$Outbound = { items: Array; total: number; next_page_token?: string | null | undefined; }; /** @internal */ export const GetCustomVoiceListResponse$outboundSchema: z.ZodType< GetCustomVoiceListResponse$Outbound, z.ZodTypeDef, GetCustomVoiceListResponse > = z.object({ items: z.array(GetCustomVoiceResponse$outboundSchema), total: z.number(), nextPageToken: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { nextPageToken: "next_page_token", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetCustomVoiceListResponse$ { /** @deprecated use `GetCustomVoiceListResponse$inboundSchema` instead. */ export const inboundSchema = GetCustomVoiceListResponse$inboundSchema; /** @deprecated use `GetCustomVoiceListResponse$outboundSchema` instead. */ export const outboundSchema = GetCustomVoiceListResponse$outboundSchema; /** @deprecated use `GetCustomVoiceListResponse$Outbound` instead. */ export type Outbound = GetCustomVoiceListResponse$Outbound; } export function getCustomVoiceListResponseToJSON( getCustomVoiceListResponse: GetCustomVoiceListResponse, ): string { return JSON.stringify( GetCustomVoiceListResponse$outboundSchema.parse(getCustomVoiceListResponse), ); } export function getCustomVoiceListResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetCustomVoiceListResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetCustomVoiceListResponse' from JSON`, ); }