/* * 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 Address = { address?: string | undefined; city?: string | undefined; extendedAddress?: string | undefined; region?: string | undefined; zipCode?: string | undefined; }; /** @internal */ export const Address$inboundSchema: z.ZodType = 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 Address$Outbound = { address?: string | undefined; city?: string | undefined; extendedAddress?: string | undefined; region?: string | undefined; zipCode?: string | undefined; }; /** @internal */ export const Address$outboundSchema: z.ZodType< Address$Outbound, z.ZodTypeDef, Address > = 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 Address$ { /** @deprecated use `Address$inboundSchema` instead. */ export const inboundSchema = Address$inboundSchema; /** @deprecated use `Address$outboundSchema` instead. */ export const outboundSchema = Address$outboundSchema; /** @deprecated use `Address$Outbound` instead. */ export type Outbound = Address$Outbound; } export function addressToJSON(address: Address): string { return JSON.stringify(Address$outboundSchema.parse(address)); } export function addressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Address$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Address' from JSON`, ); }