/* * 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 { BirthDate, BirthDate$inboundSchema, BirthDate$Outbound, BirthDate$outboundSchema, } from "./birthdate.js"; /** * Fields for identifying an authorized individual. */ export type CreateAuthorizedUser = { firstName: string; lastName: string; birthDate?: BirthDate | undefined; }; /** @internal */ export const CreateAuthorizedUser$inboundSchema: z.ZodType< CreateAuthorizedUser, z.ZodTypeDef, unknown > = z.object({ firstName: z.string(), lastName: z.string(), birthDate: BirthDate$inboundSchema.optional(), }); /** @internal */ export type CreateAuthorizedUser$Outbound = { firstName: string; lastName: string; birthDate?: BirthDate$Outbound | undefined; }; /** @internal */ export const CreateAuthorizedUser$outboundSchema: z.ZodType< CreateAuthorizedUser$Outbound, z.ZodTypeDef, CreateAuthorizedUser > = z.object({ firstName: z.string(), lastName: z.string(), birthDate: BirthDate$outboundSchema.optional(), }); export function createAuthorizedUserToJSON( createAuthorizedUser: CreateAuthorizedUser, ): string { return JSON.stringify( CreateAuthorizedUser$outboundSchema.parse(createAuthorizedUser), ); } export function createAuthorizedUserFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateAuthorizedUser$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateAuthorizedUser' from JSON`, ); }