/* * 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 AddressSuggestion = { addressLine1?: string | undefined; addressLine2?: string | undefined; city?: string | undefined; /** * The number of units at an address. For example the number of apartments or businesses in a building. */ entries?: number | undefined; postalCode?: string | undefined; stateOrProvince?: string | undefined; }; /** @internal */ export const AddressSuggestion$inboundSchema: z.ZodType< AddressSuggestion, z.ZodTypeDef, unknown > = z.object({ addressLine1: z.string().optional(), addressLine2: z.string().optional(), city: z.string().optional(), entries: z.number().int().optional(), postalCode: z.string().optional(), stateOrProvince: z.string().optional(), }); /** @internal */ export type AddressSuggestion$Outbound = { addressLine1?: string | undefined; addressLine2?: string | undefined; city?: string | undefined; entries?: number | undefined; postalCode?: string | undefined; stateOrProvince?: string | undefined; }; /** @internal */ export const AddressSuggestion$outboundSchema: z.ZodType< AddressSuggestion$Outbound, z.ZodTypeDef, AddressSuggestion > = z.object({ addressLine1: z.string().optional(), addressLine2: z.string().optional(), city: z.string().optional(), entries: z.number().int().optional(), postalCode: z.string().optional(), stateOrProvince: z.string().optional(), }); export function addressSuggestionToJSON( addressSuggestion: AddressSuggestion, ): string { return JSON.stringify( AddressSuggestion$outboundSchema.parse(addressSuggestion), ); } export function addressSuggestionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AddressSuggestion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AddressSuggestion' from JSON`, ); }