/* * 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 SearchCustomVoicesRequest = { /** * 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; }; /** @internal */ export const SearchCustomVoicesRequest$inboundSchema: z.ZodType< SearchCustomVoicesRequest, z.ZodTypeDef, unknown > = z.object({ page_size: z.number().optional(), next_page_token: z.string().optional(), name: z.string().optional(), description: z.string().optional(), }).transform((v) => { return remap$(v, { "page_size": "pageSize", "next_page_token": "nextPageToken", }); }); /** @internal */ export type SearchCustomVoicesRequest$Outbound = { page_size?: number | undefined; next_page_token?: string | undefined; name?: string | undefined; description?: string | undefined; }; /** @internal */ export const SearchCustomVoicesRequest$outboundSchema: z.ZodType< SearchCustomVoicesRequest$Outbound, z.ZodTypeDef, SearchCustomVoicesRequest > = z.object({ pageSize: z.number().optional(), nextPageToken: z.string().optional(), name: z.string().optional(), description: z.string().optional(), }).transform((v) => { return remap$(v, { pageSize: "page_size", 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 SearchCustomVoicesRequest$ { /** @deprecated use `SearchCustomVoicesRequest$inboundSchema` instead. */ export const inboundSchema = SearchCustomVoicesRequest$inboundSchema; /** @deprecated use `SearchCustomVoicesRequest$outboundSchema` instead. */ export const outboundSchema = SearchCustomVoicesRequest$outboundSchema; /** @deprecated use `SearchCustomVoicesRequest$Outbound` instead. */ export type Outbound = SearchCustomVoicesRequest$Outbound; } export function searchCustomVoicesRequestToJSON( searchCustomVoicesRequest: SearchCustomVoicesRequest, ): string { return JSON.stringify( SearchCustomVoicesRequest$outboundSchema.parse(searchCustomVoicesRequest), ); } export function searchCustomVoicesRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SearchCustomVoicesRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SearchCustomVoicesRequest' from JSON`, ); }