/* * 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"; /** * The representation of a company's address in Gusto. */ export type CompanyAddress = { 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. */ inactive?: boolean | undefined; /** * The status of the location. Inactive locations have been deleted, but may still have historical data associated with them. */ active?: boolean | undefined; }; /** @internal */ export const CompanyAddress$inboundSchema: z.ZodType< CompanyAddress, z.ZodTypeDef, unknown > = z.object({ 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"), inactive: z.boolean().optional(), active: z.boolean().optional(), }).transform((v) => { return remap$(v, { "street_1": "street1", "street_2": "street2", }); }); export function companyAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CompanyAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompanyAddress' from JSON`, ); }