/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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 data structure containing attributes describing the location of an underlying entity. */ export type AddressCreate = { /** * Required: Describes the city in which the entity is located. */ city?: string | undefined; /** * Required: The country code used for geolocation, identity verification, and/or mail delivery purposes. */ country?: string | undefined; /** * Required: The postal code used for geolocation, identity verification, and/or mail delivery purposes. */ postalCode?: string | undefined; /** * Required: The state code used for geolocation, identity verification, and/or mail delivery purposes. */ state?: string | undefined; /** * The street name and number relating to a party's legal or mailing address. */ streetAddress?: Array | undefined; }; /** @internal */ export const AddressCreate$inboundSchema: z.ZodType< AddressCreate, z.ZodTypeDef, unknown > = z.object({ city: z.string().optional(), country: z.string().optional(), postal_code: z.string().optional(), state: z.string().optional(), streetAddress: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { "postal_code": "postalCode", }); }); /** @internal */ export type AddressCreate$Outbound = { city?: string | undefined; country?: string | undefined; postal_code?: string | undefined; state?: string | undefined; streetAddress?: Array | undefined; }; /** @internal */ export const AddressCreate$outboundSchema: z.ZodType< AddressCreate$Outbound, z.ZodTypeDef, AddressCreate > = z.object({ city: z.string().optional(), country: z.string().optional(), postalCode: z.string().optional(), state: z.string().optional(), streetAddress: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { postalCode: "postal_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AddressCreate$ { /** @deprecated use `AddressCreate$inboundSchema` instead. */ export const inboundSchema = AddressCreate$inboundSchema; /** @deprecated use `AddressCreate$outboundSchema` instead. */ export const outboundSchema = AddressCreate$outboundSchema; /** @deprecated use `AddressCreate$Outbound` instead. */ export type Outbound = AddressCreate$Outbound; } export function addressCreateToJSON(addressCreate: AddressCreate): string { return JSON.stringify(AddressCreate$outboundSchema.parse(addressCreate)); } export function addressCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AddressCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AddressCreate' from JSON`, ); }