/* * 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 { AddressSuggestion, AddressSuggestion$inboundSchema, AddressSuggestion$Outbound, AddressSuggestion$outboundSchema, } from "./addresssuggestion.js"; export type EnrichedAddressResponse = { suggestions: Array; }; /** @internal */ export const EnrichedAddressResponse$inboundSchema: z.ZodType< EnrichedAddressResponse, z.ZodTypeDef, unknown > = z.object({ suggestions: z.array(AddressSuggestion$inboundSchema), }); /** @internal */ export type EnrichedAddressResponse$Outbound = { suggestions: Array; }; /** @internal */ export const EnrichedAddressResponse$outboundSchema: z.ZodType< EnrichedAddressResponse$Outbound, z.ZodTypeDef, EnrichedAddressResponse > = z.object({ suggestions: z.array(AddressSuggestion$outboundSchema), }); export function enrichedAddressResponseToJSON( enrichedAddressResponse: EnrichedAddressResponse, ): string { return JSON.stringify( EnrichedAddressResponse$outboundSchema.parse(enrichedAddressResponse), ); } export function enrichedAddressResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EnrichedAddressResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnrichedAddressResponse' from JSON`, ); }