/* * 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 LocationServicesGeocodingGlobalExternalGeocodingItemResponse = { /** * This field contains the alphanumeric code identifying an individual location, should one exist. */ premise?: string | undefined; /** * This field holds the most common street or block data element within a country. */ thoroughfare?: string | undefined; /** * This field holds the most common population center data element within a country. */ locality?: string | undefined; /** * This field holds the most common geographic data element within a country. */ administrativeArea?: string | undefined; /** * This field contains the complete postal code, should such information be able to be determined. */ postalCode?: string | undefined; /** * This field holds the ISO2 country code. */ country?: string | undefined; /** * This field holds the WGS 84 latitude in decimal degrees format. */ latitude?: string | undefined; /** * This field holds the WGS 84 longitude in decimal degrees format. */ longitude?: string | undefined; /** * This field holds the radius of accuracy in meters, giving an indication of the likely maximum distance between the geocode and the physical location. Please note that this field is derived from and therefore dependent on the accuracy and coverage of the underlying reference data. */ geoDistance?: string | undefined; /** * This field is made up of the geocoding status and geocoding level. For more information on this please see [here](/api-reference/store-finder/geoaccuracy). When looking for a geocoding result it's important to look for this field, as if we return U0 it means we have been unable to geocode that input. */ geoAccuracy?: string | undefined; /** * This field identifies the level we have validated a given address or co-ordinates to. E.g. if we cannot identify a premise number we may only validate to Thoroughfare level. */ locationType?: string | undefined; }; /** @internal */ export const LocationServicesGeocodingGlobalExternalGeocodingItemResponse$inboundSchema: z.ZodType< LocationServicesGeocodingGlobalExternalGeocodingItemResponse, z.ZodTypeDef, unknown > = z.object({ Premise: z.string().optional(), Thoroughfare: z.string().optional(), Locality: z.string().optional(), AdministrativeArea: z.string().optional(), PostalCode: z.string().optional(), Country: z.string().optional(), Latitude: z.string().optional(), Longitude: z.string().optional(), GeoDistance: z.string().optional(), GeoAccuracy: z.string().optional(), LocationType: z.string().optional(), }).transform((v) => { return remap$(v, { "Premise": "premise", "Thoroughfare": "thoroughfare", "Locality": "locality", "AdministrativeArea": "administrativeArea", "PostalCode": "postalCode", "Country": "country", "Latitude": "latitude", "Longitude": "longitude", "GeoDistance": "geoDistance", "GeoAccuracy": "geoAccuracy", "LocationType": "locationType", }); }); export function locationServicesGeocodingGlobalExternalGeocodingItemResponseFromJSON( jsonString: string, ): SafeParseResult< LocationServicesGeocodingGlobalExternalGeocodingItemResponse, SDKValidationError > { return safeParse( jsonString, (x) => LocationServicesGeocodingGlobalExternalGeocodingItemResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'LocationServicesGeocodingGlobalExternalGeocodingItemResponse' from JSON`, ); }