/* * 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 ContractorAddress = { /** * The UUID of the contractor */ contractorUuid?: string | undefined; 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; /** * 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 | undefined; }; /** @internal */ export const ContractorAddress$inboundSchema: z.ZodType< ContractorAddress, z.ZodTypeDef, unknown > = z.object({ contractor_uuid: z.string().optional(), 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(), version: z.string().optional(), }).transform((v) => { return remap$(v, { "contractor_uuid": "contractorUuid", "street_1": "street1", "street_2": "street2", }); }); export function contractorAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ContractorAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContractorAddress' from JSON`, ); }