/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type BusinessAddress = { address?: string | undefined; city?: string | undefined; extendedAddress?: string | undefined; region?: string | undefined; zipCode?: string | undefined; }; /** @internal */ export const BusinessAddress$inboundSchema: z.ZodType< BusinessAddress, z.ZodTypeDef, unknown > = z.object({ address: z.string().optional(), city: z.string().optional(), extendedAddress: z.string().optional(), region: z.string().optional(), zipCode: z.string().optional(), }); /** @internal */ export type BusinessAddress$Outbound = { address?: string | undefined; city?: string | undefined; extendedAddress?: string | undefined; region?: string | undefined; zipCode?: string | undefined; }; /** @internal */ export const BusinessAddress$outboundSchema: z.ZodType< BusinessAddress$Outbound, z.ZodTypeDef, BusinessAddress > = z.object({ address: z.string().optional(), city: z.string().optional(), extendedAddress: z.string().optional(), region: z.string().optional(), zipCode: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace BusinessAddress$ { /** @deprecated use `BusinessAddress$inboundSchema` instead. */ export const inboundSchema = BusinessAddress$inboundSchema; /** @deprecated use `BusinessAddress$outboundSchema` instead. */ export const outboundSchema = BusinessAddress$outboundSchema; /** @deprecated use `BusinessAddress$Outbound` instead. */ export type Outbound = BusinessAddress$Outbound; } export function businessAddressToJSON( businessAddress: BusinessAddress, ): string { return JSON.stringify(BusinessAddress$outboundSchema.parse(businessAddress)); } export function businessAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BusinessAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BusinessAddress' from JSON`, ); }