/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: f37a685950ba */ import * as z from "zod/v4"; 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"; /** * Schema for voice response */ export type VoiceResponse = { name: string; slug?: string | null | undefined; languages?: Array | undefined; gender?: string | null | undefined; age?: number | null | undefined; tags?: Array | null | undefined; color?: string | null | undefined; retentionNotice: number; id: string; createdAt: Date; userId: string | null; }; /** @internal */ export const VoiceResponse$inboundSchema: z.ZodType = z .object({ name: z.string(), slug: z.nullable(z.string()).optional(), languages: z.array(z.string()).optional(), gender: z.nullable(z.string()).optional(), age: z.nullable(z.int()).optional(), tags: z.nullable(z.array(z.string())).optional(), color: z.nullable(z.string()).optional(), retention_notice: z.int().default(30), id: z.string(), created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)), user_id: z.nullable(z.string()), }).transform((v) => { return remap$(v, { "retention_notice": "retentionNotice", "created_at": "createdAt", "user_id": "userId", }); }); export function voiceResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VoiceResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VoiceResponse' from JSON`, ); }