/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type BirthDateError = { day?: string | undefined; month?: string | undefined; year?: string | undefined; }; /** @internal */ export const BirthDateError$inboundSchema: z.ZodType< BirthDateError, z.ZodTypeDef, unknown > = z.object({ day: z.string().optional(), month: z.string().optional(), year: z.string().optional(), }); /** @internal */ export type BirthDateError$Outbound = { day?: string | undefined; month?: string | undefined; year?: string | undefined; }; /** @internal */ export const BirthDateError$outboundSchema: z.ZodType< BirthDateError$Outbound, z.ZodTypeDef, BirthDateError > = z.object({ day: z.string().optional(), month: z.string().optional(), year: z.string().optional(), }); export function birthDateErrorToJSON(birthDateError: BirthDateError): string { return JSON.stringify(BirthDateError$outboundSchema.parse(birthDateError)); } export function birthDateErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BirthDateError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BirthDateError' from JSON`, ); }