/* * 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 GeocodingUKRetrieveResponseItem = { /** * The name of the location found. */ location?: string | undefined; /** * The easting coordinate of the location. Represents a distance in meters east from the most south westerly position of the GB mapping grid. */ easting?: number | undefined; /** * The northing coordinate of the location. Represents a distance in meters north from the most south westerly position of the GB mapping grid. */ northing?: number | undefined; /** * The WGS84 latitude coordinate of the location. */ latitude?: number | undefined; /** * The WGS84 longitude coordinate of the location. */ longitude?: number | undefined; }; export type GeocodingUKRetrieveResponse = { items?: Array | undefined; }; /** @internal */ export const GeocodingUKRetrieveResponseItem$inboundSchema: z.ZodType< GeocodingUKRetrieveResponseItem, z.ZodTypeDef, unknown > = z.object({ Location: z.string().optional(), Easting: z.number().int().optional(), Northing: z.number().int().optional(), Latitude: z.number().optional(), Longitude: z.number().optional(), }).transform((v) => { return remap$(v, { "Location": "location", "Easting": "easting", "Northing": "northing", "Latitude": "latitude", "Longitude": "longitude", }); }); export function geocodingUKRetrieveResponseItemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GeocodingUKRetrieveResponseItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GeocodingUKRetrieveResponseItem' from JSON`, ); } /** @internal */ export const GeocodingUKRetrieveResponse$inboundSchema: z.ZodType< GeocodingUKRetrieveResponse, z.ZodTypeDef, unknown > = z.object({ Items: z.array(z.lazy(() => GeocodingUKRetrieveResponseItem$inboundSchema)) .optional(), }).transform((v) => { return remap$(v, { "Items": "items", }); }); export function geocodingUKRetrieveResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GeocodingUKRetrieveResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GeocodingUKRetrieveResponse' from JSON`, ); }