/* * 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"; import { BirthDateError, BirthDateError$inboundSchema, BirthDateError$Outbound, BirthDateError$outboundSchema, } from "./birthdateerror.js"; export type CreateAuthorizedUserError = { firstName?: string | undefined; lastName?: string | undefined; birthDate?: BirthDateError | undefined; }; /** @internal */ export const CreateAuthorizedUserError$inboundSchema: z.ZodType< CreateAuthorizedUserError, z.ZodTypeDef, unknown > = z.object({ firstName: z.string().optional(), lastName: z.string().optional(), birthDate: BirthDateError$inboundSchema.optional(), }); /** @internal */ export type CreateAuthorizedUserError$Outbound = { firstName?: string | undefined; lastName?: string | undefined; birthDate?: BirthDateError$Outbound | undefined; }; /** @internal */ export const CreateAuthorizedUserError$outboundSchema: z.ZodType< CreateAuthorizedUserError$Outbound, z.ZodTypeDef, CreateAuthorizedUserError > = z.object({ firstName: z.string().optional(), lastName: z.string().optional(), birthDate: BirthDateError$outboundSchema.optional(), }); export function createAuthorizedUserErrorToJSON( createAuthorizedUserError: CreateAuthorizedUserError, ): string { return JSON.stringify( CreateAuthorizedUserError$outboundSchema.parse(createAuthorizedUserError), ); } export function createAuthorizedUserErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateAuthorizedUserError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateAuthorizedUserError' from JSON`, ); }