/* * 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"; export type AddressError = { addressLine1?: string | undefined; addressLine2?: string | undefined; city?: string | undefined; stateOrProvince?: string | undefined; postalCode?: string | undefined; country?: string | undefined; }; /** @internal */ export const AddressError$inboundSchema: z.ZodType< AddressError, z.ZodTypeDef, unknown > = z.object({ addressLine1: z.string().optional(), addressLine2: z.string().optional(), city: z.string().optional(), stateOrProvince: z.string().optional(), postalCode: z.string().optional(), country: z.string().optional(), }); /** @internal */ export type AddressError$Outbound = { addressLine1?: string | undefined; addressLine2?: string | undefined; city?: string | undefined; stateOrProvince?: string | undefined; postalCode?: string | undefined; country?: string | undefined; }; /** @internal */ export const AddressError$outboundSchema: z.ZodType< AddressError$Outbound, z.ZodTypeDef, AddressError > = z.object({ addressLine1: z.string().optional(), addressLine2: z.string().optional(), city: z.string().optional(), stateOrProvince: z.string().optional(), postalCode: z.string().optional(), country: z.string().optional(), }); export function addressErrorToJSON(addressError: AddressError): string { return JSON.stringify(AddressError$outboundSchema.parse(addressError)); } export function addressErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AddressError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AddressError' from JSON`, ); }