/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { PazeDeliveryContactDetails, PazeDeliveryContactDetails$inboundSchema, PazeDeliveryContactDetails$Outbound, PazeDeliveryContactDetails$outboundSchema, } from "./pazedeliverycontactdetails.js"; export type PazeShippingAddress = { /** * Line 1 of the address. */ line1: string; /** * Line 2 of the address. */ line2?: string | null | undefined; /** * Line 3 of the address. */ line3?: string | null | undefined; /** * City. */ city: string; /** * State or region. */ state: string; /** * Postal code. */ zip: string; /** * ISO 3166-1 alpha-2 country code. */ countryCode: string; deliveryContactDetails: PazeDeliveryContactDetails | null; }; /** @internal */ export const PazeShippingAddress$inboundSchema: z.ZodType< PazeShippingAddress, z.ZodTypeDef, unknown > = z.object({ line1: z.string(), line2: z.nullable(z.string()).optional(), line3: z.nullable(z.string()).optional(), city: z.string(), state: z.string(), zip: z.string(), countryCode: z.string(), deliveryContactDetails: z.nullable(PazeDeliveryContactDetails$inboundSchema), }); /** @internal */ export type PazeShippingAddress$Outbound = { line1: string; line2?: string | null | undefined; line3?: string | null | undefined; city: string; state: string; zip: string; countryCode: string; deliveryContactDetails: PazeDeliveryContactDetails$Outbound | null; }; /** @internal */ export const PazeShippingAddress$outboundSchema: z.ZodType< PazeShippingAddress$Outbound, z.ZodTypeDef, PazeShippingAddress > = z.object({ line1: z.string(), line2: z.nullable(z.string()).optional(), line3: z.nullable(z.string()).optional(), city: z.string(), state: z.string(), zip: z.string(), countryCode: z.string(), deliveryContactDetails: z.nullable(PazeDeliveryContactDetails$outboundSchema), }); export function pazeShippingAddressToJSON( pazeShippingAddress: PazeShippingAddress, ): string { return JSON.stringify( PazeShippingAddress$outboundSchema.parse(pazeShippingAddress), ); } export function pazeShippingAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PazeShippingAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PazeShippingAddress' from JSON`, ); }