/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { RFCDate } from "../../types/rfcdate.js"; export type SignatoryUpdateRequestHomeAddress = { street1?: string | undefined; street2?: string | undefined; city?: string | undefined; state?: string | undefined; zip?: string | undefined; country?: string | undefined; }; /** * Request body for updating a signatory. Email cannot be updated. */ export type SignatoryUpdateRequest = { /** * Current version of the signatory (required for optimistic concurrency). */ version: string; firstName?: string | undefined; middleInitial?: string | undefined; lastName?: string | undefined; title?: string | undefined; phone?: string | undefined; birthday?: RFCDate | undefined; /** * The signatory's SSN. */ ssn?: string | undefined; homeAddress?: SignatoryUpdateRequestHomeAddress | undefined; }; /** @internal */ export type SignatoryUpdateRequestHomeAddress$Outbound = { street_1?: string | undefined; street_2?: string | undefined; city?: string | undefined; state?: string | undefined; zip?: string | undefined; country?: string | undefined; }; /** @internal */ export const SignatoryUpdateRequestHomeAddress$outboundSchema: z.ZodType< SignatoryUpdateRequestHomeAddress$Outbound, z.ZodTypeDef, SignatoryUpdateRequestHomeAddress > = z.object({ street1: z.string().optional(), street2: z.string().optional(), city: z.string().optional(), state: z.string().optional(), zip: z.string().optional(), country: z.string().optional(), }).transform((v) => { return remap$(v, { street1: "street_1", street2: "street_2", }); }); export function signatoryUpdateRequestHomeAddressToJSON( signatoryUpdateRequestHomeAddress: SignatoryUpdateRequestHomeAddress, ): string { return JSON.stringify( SignatoryUpdateRequestHomeAddress$outboundSchema.parse( signatoryUpdateRequestHomeAddress, ), ); } /** @internal */ export type SignatoryUpdateRequest$Outbound = { version: string; first_name?: string | undefined; middle_initial?: string | undefined; last_name?: string | undefined; title?: string | undefined; phone?: string | undefined; birthday?: string | undefined; ssn?: string | undefined; home_address?: SignatoryUpdateRequestHomeAddress$Outbound | undefined; }; /** @internal */ export const SignatoryUpdateRequest$outboundSchema: z.ZodType< SignatoryUpdateRequest$Outbound, z.ZodTypeDef, SignatoryUpdateRequest > = z.object({ version: z.string(), firstName: z.string().optional(), middleInitial: z.string().optional(), lastName: z.string().optional(), title: z.string().optional(), phone: z.string().optional(), birthday: z.instanceof(RFCDate).transform(v => v.toString()).optional(), ssn: z.string().optional(), homeAddress: z.lazy(() => SignatoryUpdateRequestHomeAddress$outboundSchema) .optional(), }).transform((v) => { return remap$(v, { firstName: "first_name", middleInitial: "middle_initial", lastName: "last_name", homeAddress: "home_address", }); }); export function signatoryUpdateRequestToJSON( signatoryUpdateRequest: SignatoryUpdateRequest, ): string { return JSON.stringify( SignatoryUpdateRequest$outboundSchema.parse(signatoryUpdateRequest), ); }