/* * 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 { AddressUpdate, AddressUpdate$inboundSchema, AddressUpdate$Outbound, AddressUpdate$outboundSchema, } from "./addressupdate.js"; import { BirthDateUpdate, BirthDateUpdate$inboundSchema, BirthDateUpdate$Outbound, BirthDateUpdate$outboundSchema, } from "./birthdateupdate.js"; import { GovernmentID, GovernmentID$inboundSchema, GovernmentID$Outbound, GovernmentID$outboundSchema, } from "./governmentid.js"; import { IndividualNameUpdate, IndividualNameUpdate$inboundSchema, IndividualNameUpdate$Outbound, IndividualNameUpdate$outboundSchema, } from "./individualnameupdate.js"; import { PhoneNumber, PhoneNumber$inboundSchema, PhoneNumber$Outbound, PhoneNumber$outboundSchema, } from "./phonenumber.js"; /** * Describes the fields available when patching an individual. */ export type PatchIndividual = { name?: IndividualNameUpdate | undefined; phone?: PhoneNumber | undefined; email?: string | undefined; address?: AddressUpdate | undefined; birthDate?: BirthDateUpdate | undefined; governmentID?: GovernmentID | undefined; }; /** @internal */ export const PatchIndividual$inboundSchema: z.ZodType< PatchIndividual, z.ZodTypeDef, unknown > = z.object({ name: IndividualNameUpdate$inboundSchema.optional(), phone: PhoneNumber$inboundSchema.optional(), email: z.string().optional(), address: AddressUpdate$inboundSchema.optional(), birthDate: BirthDateUpdate$inboundSchema.optional(), governmentID: GovernmentID$inboundSchema.optional(), }); /** @internal */ export type PatchIndividual$Outbound = { name?: IndividualNameUpdate$Outbound | undefined; phone?: PhoneNumber$Outbound | undefined; email?: string | undefined; address?: AddressUpdate$Outbound | undefined; birthDate?: BirthDateUpdate$Outbound | undefined; governmentID?: GovernmentID$Outbound | undefined; }; /** @internal */ export const PatchIndividual$outboundSchema: z.ZodType< PatchIndividual$Outbound, z.ZodTypeDef, PatchIndividual > = z.object({ name: IndividualNameUpdate$outboundSchema.optional(), phone: PhoneNumber$outboundSchema.optional(), email: z.string().optional(), address: AddressUpdate$outboundSchema.optional(), birthDate: BirthDateUpdate$outboundSchema.optional(), governmentID: GovernmentID$outboundSchema.optional(), }); export function patchIndividualToJSON( patchIndividual: PatchIndividual, ): string { return JSON.stringify(PatchIndividual$outboundSchema.parse(patchIndividual)); } export function patchIndividualFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PatchIndividual$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchIndividual' from JSON`, ); }