/* * 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 SearchVoicesRequest = { /** * Number of items per page (default: 20, min: 10, max: 100) */ pageSize?: number | undefined; /** * Token for pagination (obtained from the previous page's response) */ nextPageToken?: string | undefined; /** * Search across name. Space separated. */ name?: string | undefined; /** * Search across description. Space separated. */ description?: string | undefined; /** * Filter by language (comma-separated) */ language?: string | undefined; /** * Filter by gender (comma-separated) */ gender?: string | undefined; /** * Filter by age (comma-separated) */ age?: string | undefined; /** * Filter by use case (comma-separated) */ useCase?: string | undefined; /** * Filter by use cases array (comma-separated for OR logic) */ useCases?: string | undefined; /** * Filter by style (comma-separated for OR, semicolon-separated for AND). Mixing comma and semicolon is invalid and will result in 400. Note: AND semantics apply across styles on a single character; cloned voices have a single style and will only match AND when exactly one style is requested and equals the cloned voice style. */ style?: string | undefined; /** * Filter by model (comma-separated) */ model?: string | undefined; }; /** @internal */ export const SearchVoicesRequest$inboundSchema: z.ZodType< SearchVoicesRequest, z.ZodTypeDef, unknown > = z.object({ page_size: z.number().optional(), next_page_token: z.string().optional(), name: z.string().optional(), description: z.string().optional(), language: z.string().optional(), gender: z.string().optional(), age: z.string().optional(), use_case: z.string().optional(), use_cases: z.string().optional(), style: z.string().optional(), model: z.string().optional(), }).transform((v) => { return remap$(v, { "page_size": "pageSize", "next_page_token": "nextPageToken", "use_case": "useCase", "use_cases": "useCases", }); }); /** @internal */ export type SearchVoicesRequest$Outbound = { page_size?: number | undefined; next_page_token?: string | undefined; name?: string | undefined; description?: string | undefined; language?: string | undefined; gender?: string | undefined; age?: string | undefined; use_case?: string | undefined; use_cases?: string | undefined; style?: string | undefined; model?: string | undefined; }; /** @internal */ export const SearchVoicesRequest$outboundSchema: z.ZodType< SearchVoicesRequest$Outbound, z.ZodTypeDef, SearchVoicesRequest > = z.object({ pageSize: z.number().optional(), nextPageToken: z.string().optional(), name: z.string().optional(), description: z.string().optional(), language: z.string().optional(), gender: z.string().optional(), age: z.string().optional(), useCase: z.string().optional(), useCases: z.string().optional(), style: z.string().optional(), model: z.string().optional(), }).transform((v) => { return remap$(v, { pageSize: "page_size", nextPageToken: "next_page_token", useCase: "use_case", useCases: "use_cases", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SearchVoicesRequest$ { /** @deprecated use `SearchVoicesRequest$inboundSchema` instead. */ export const inboundSchema = SearchVoicesRequest$inboundSchema; /** @deprecated use `SearchVoicesRequest$outboundSchema` instead. */ export const outboundSchema = SearchVoicesRequest$outboundSchema; /** @deprecated use `SearchVoicesRequest$Outbound` instead. */ export type Outbound = SearchVoicesRequest$Outbound; } export function searchVoicesRequestToJSON( searchVoicesRequest: SearchVoicesRequest, ): string { return JSON.stringify( SearchVoicesRequest$outboundSchema.parse(searchVoicesRequest), ); } export function searchVoicesRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SearchVoicesRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SearchVoicesRequest' from JSON`, ); }