/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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"; export type GeocodingInternationalReverseGeocodeResponseItem = { /** * The building number on the street. */ streetNumber?: string | undefined; /** * The name of the street. */ streetName?: string | undefined; /** * The of the city/town/municipality. */ city?: string | undefined; /** * The name of the state/province. */ province?: string | undefined; /** * The postal code/zip. */ postalCode?: string | undefined; /** * The country code. */ countryCode?: string | undefined; /** * The distance in KM from the CentrePoint to this record. */ distance?: number | undefined; /** * The WGS84 latitude coordinate of the location. */ latitude?: number | undefined; /** * The WGS84 longitude coordinate of the location. */ longitude?: number | undefined; }; export type GeocodingInternationalReverseGeocodeResponse = { items?: Array | undefined; }; /** @internal */ export const GeocodingInternationalReverseGeocodeResponseItem$inboundSchema: z.ZodType< GeocodingInternationalReverseGeocodeResponseItem, z.ZodTypeDef, unknown > = z.object({ StreetNumber: z.string().optional(), StreetName: z.string().optional(), City: z.string().optional(), Province: z.string().optional(), PostalCode: z.string().optional(), CountryCode: z.string().optional(), Distance: z.number().optional(), Latitude: z.number().optional(), Longitude: z.number().optional(), }).transform((v) => { return remap$(v, { "StreetNumber": "streetNumber", "StreetName": "streetName", "City": "city", "Province": "province", "PostalCode": "postalCode", "CountryCode": "countryCode", "Distance": "distance", "Latitude": "latitude", "Longitude": "longitude", }); }); export function geocodingInternationalReverseGeocodeResponseItemFromJSON( jsonString: string, ): SafeParseResult< GeocodingInternationalReverseGeocodeResponseItem, SDKValidationError > { return safeParse( jsonString, (x) => GeocodingInternationalReverseGeocodeResponseItem$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GeocodingInternationalReverseGeocodeResponseItem' from JSON`, ); } /** @internal */ export const GeocodingInternationalReverseGeocodeResponse$inboundSchema: z.ZodType< GeocodingInternationalReverseGeocodeResponse, z.ZodTypeDef, unknown > = z.object({ Items: z.array( z.lazy(() => GeocodingInternationalReverseGeocodeResponseItem$inboundSchema ), ).optional(), }).transform((v) => { return remap$(v, { "Items": "items", }); }); export function geocodingInternationalReverseGeocodeResponseFromJSON( jsonString: string, ): SafeParseResult< GeocodingInternationalReverseGeocodeResponse, SDKValidationError > { return safeParse( jsonString, (x) => GeocodingInternationalReverseGeocodeResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GeocodingInternationalReverseGeocodeResponse' from JSON`, ); }