/* * 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 { lazySchema as lazySchema$ } from "../../lib/schemas.js"; import { Gender, Gender$outboundSchema } from "./gender.js"; export type PersonInput = { /** * The first name of the person. */ firstName?: string | null | undefined; /** * The last name of the person. */ lastName?: string | null | undefined; /** * Middle name of the person. */ middleName?: string | null | undefined; /** * The gender represents the gender identity of a person. */ gender?: Gender | null | undefined; /** * Initials of the person */ initials?: string | null | undefined; /** * Date of birth */ birthday?: Date | null | undefined; /** * Date of death */ deceasedOn?: Date | null | undefined; }; /** @internal */ export type PersonInput$Outbound = { first_name?: string | null | undefined; last_name?: string | null | undefined; middle_name?: string | null | undefined; gender?: string | null | undefined; initials?: string | null | undefined; birthday?: string | null | undefined; deceased_on?: string | null | undefined; }; /** @internal */ export const PersonInput$outboundSchema: z.ZodType< PersonInput$Outbound, z.ZodTypeDef, PersonInput > = /* @__PURE__ */ lazySchema$(() => z.object({ firstName: z.nullable(z.string()).optional(), lastName: z.nullable(z.string()).optional(), middleName: z.nullable(z.string()).optional(), gender: z.nullable(Gender$outboundSchema).optional(), initials: z.nullable(z.string()).optional(), birthday: z.nullable( z.date().transform(v => v.toISOString().slice(0, "YYYY-MM-DD".length)), ).optional(), deceasedOn: z.nullable( z.date().transform(v => v.toISOString().slice(0, "YYYY-MM-DD".length)), ).optional(), }).transform((v) => { return remap$(v, { firstName: "first_name", lastName: "last_name", middleName: "middle_name", deceasedOn: "deceased_on", }); }) ); export function personInputToJSON(personInput: PersonInput): string { return JSON.stringify(PersonInput$outboundSchema.parse(personInput)); }