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