/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { RFCDate } from "../../types/rfcdate.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type EmployeeHomeAddress = { street1?: string | null | undefined; street2?: string | null | undefined; city?: string | null | undefined; state?: string | null | undefined; zip?: string | null | undefined; country: string | null; /** * The status of the location. Inactive locations have been deleted, but may still have historical data associated with them. */ active?: boolean | undefined; /** * Unique identifier for this address. */ uuid?: string | undefined; /** * The internal ID of the address. */ id?: number | undefined; /** * The date the address became effective. */ effectiveFrom?: RFCDate | undefined; /** * The date the address became inactive. */ effectiveTo?: RFCDate | undefined; /** * The date the address became effective. */ effectiveDate?: RFCDate | undefined; }; /** @internal */ export const EmployeeHomeAddress$inboundSchema: z.ZodType< EmployeeHomeAddress, z.ZodTypeDef, unknown > = z.object({ street_1: z.nullable(z.string()).optional(), street_2: z.nullable(z.string()).optional(), city: z.nullable(z.string()).optional(), state: z.nullable(z.string()).optional(), zip: z.nullable(z.string()).optional(), country: z.nullable(z.string().default("USA")), active: z.boolean().optional(), uuid: z.string().optional(), id: z.number().int().optional(), effective_from: z.string().transform(v => new RFCDate(v)).optional(), effective_to: z.string().transform(v => new RFCDate(v)).optional(), effective_date: z.string().transform(v => new RFCDate(v)).optional(), }).transform((v) => { return remap$(v, { "street_1": "street1", "street_2": "street2", "effective_from": "effectiveFrom", "effective_to": "effectiveTo", "effective_date": "effectiveDate", }); }); export function employeeHomeAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmployeeHomeAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployeeHomeAddress' from JSON`, ); }