/* * 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 EmployeeAddress = { /** * The UUID of the employee address */ uuid: string; /** * The UUID of the employee */ employeeUuid?: string | undefined; /** * The date the employee started living at the address. */ effectiveDate?: RFCDate | undefined; /** * Determines if home taxes should be withheld and paid for employee. */ courtesyWithholding?: boolean | undefined; street1?: string | undefined; street2?: string | null | undefined; city?: string | undefined; state?: string | undefined; zip?: string | undefined; country: string; /** * The status of the location. Inactive locations have been deleted, but may still have historical data associated with them. */ active?: boolean | undefined; /** * The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field. */ version: string; }; /** @internal */ export const EmployeeAddress$inboundSchema: z.ZodType< EmployeeAddress, z.ZodTypeDef, unknown > = z.object({ uuid: z.string(), employee_uuid: z.string().optional(), effective_date: z.string().transform(v => new RFCDate(v)).optional(), courtesy_withholding: z.boolean().optional(), street_1: z.string().optional(), street_2: z.nullable(z.string()).optional(), city: z.string().optional(), state: z.string().optional(), zip: z.string().optional(), country: z.string().default("USA"), active: z.boolean().optional(), version: z.string(), }).transform((v) => { return remap$(v, { "employee_uuid": "employeeUuid", "effective_date": "effectiveDate", "courtesy_withholding": "courtesyWithholding", "street_1": "street1", "street_2": "street2", }); }); export function employeeAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmployeeAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployeeAddress' from JSON`, ); }