/* * 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 GeocodingUKFindResponseItem = { /** * The ID of this location, use with the Retrieve service to get the coordinates. */ id?: string | undefined; /** * The name of the location found. */ location?: string | undefined; /** * The type of location listed. */ type?: string | undefined; }; export type GeocodingUKFindResponse = { items?: Array | undefined; }; /** @internal */ export const GeocodingUKFindResponseItem$inboundSchema: z.ZodType< GeocodingUKFindResponseItem, z.ZodTypeDef, unknown > = z.object({ Id: z.string().optional(), Location: z.string().optional(), Type: z.string().optional(), }).transform((v) => { return remap$(v, { "Id": "id", "Location": "location", "Type": "type", }); }); export function geocodingUKFindResponseItemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GeocodingUKFindResponseItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GeocodingUKFindResponseItem' from JSON`, ); } /** @internal */ export const GeocodingUKFindResponse$inboundSchema: z.ZodType< GeocodingUKFindResponse, z.ZodTypeDef, unknown > = z.object({ Items: z.array(z.lazy(() => GeocodingUKFindResponseItem$inboundSchema)) .optional(), }).transform((v) => { return remap$(v, { "Items": "items", }); }); export function geocodingUKFindResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GeocodingUKFindResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GeocodingUKFindResponse' from JSON`, ); }