/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type EmployeeWorkAddress = { /** * The unique identifier of this work address. */ uuid: string; /** * The date the employee began working at this location. */ effectiveDate?: string | undefined; /** * Signifies if this address is the active work address for the current date */ active?: boolean | undefined; /** * UUID reference to the company location for this work address. */ locationUuid?: string | undefined; /** * UUID reference to the employee for this work address. */ employeeUuid?: string | 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; street1?: string | undefined; street2?: string | null | undefined; city?: string | undefined; state?: string | undefined; zip?: string | undefined; country: string; }; /** @internal */ export const EmployeeWorkAddress$inboundSchema: z.ZodType< EmployeeWorkAddress, z.ZodTypeDef, unknown > = z.object({ uuid: z.string(), effective_date: z.string().optional(), active: z.boolean().optional(), location_uuid: z.string().optional(), employee_uuid: z.string().optional(), version: z.string(), 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"), }).transform((v) => { return remap$(v, { "effective_date": "effectiveDate", "location_uuid": "locationUuid", "employee_uuid": "employeeUuid", "street_1": "street1", "street_2": "street2", }); }); export function employeeWorkAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmployeeWorkAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployeeWorkAddress' from JSON`, ); }