/* * 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 GeocodingInternationalGeocodeResponseItem = { /** * The name of the location found. */ name?: string | undefined; /** * The WGS84 latitude of the found location. For example: '34.1075'. */ latitude?: number | undefined; /** * The WGS84 longitude of the found location. For example: '-118.4165'. */ longitude?: number | undefined; }; export type GeocodingInternationalGeocodeResponse = { items?: Array | undefined; }; /** @internal */ export const GeocodingInternationalGeocodeResponseItem$inboundSchema: z.ZodType< GeocodingInternationalGeocodeResponseItem, z.ZodTypeDef, unknown > = z.object({ Name: z.string().optional(), Latitude: z.number().optional(), Longitude: z.number().optional(), }).transform((v) => { return remap$(v, { "Name": "name", "Latitude": "latitude", "Longitude": "longitude", }); }); export function geocodingInternationalGeocodeResponseItemFromJSON( jsonString: string, ): SafeParseResult< GeocodingInternationalGeocodeResponseItem, SDKValidationError > { return safeParse( jsonString, (x) => GeocodingInternationalGeocodeResponseItem$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GeocodingInternationalGeocodeResponseItem' from JSON`, ); } /** @internal */ export const GeocodingInternationalGeocodeResponse$inboundSchema: z.ZodType< GeocodingInternationalGeocodeResponse, z.ZodTypeDef, unknown > = z.object({ Items: z.array( z.lazy(() => GeocodingInternationalGeocodeResponseItem$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "Items": "items", }); }); export function geocodingInternationalGeocodeResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GeocodingInternationalGeocodeResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GeocodingInternationalGeocodeResponse' from JSON`, ); }