/* * 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 GeocodingInternationalPositionToCountryResponseItem = { /** * The full name of the country the address is in, as per the ISO 3166-1 standard. */ countryName?: string | undefined; /** * The two character ISO code for the country in the address. For example, the CountryIso2 for the United Kingdom is "GB". */ countryIso2?: string | undefined; /** * The three character ISO code for the country in the address. For example, the CountryIso3 for the United Kingdom is "GBR". */ countryIso3?: string | undefined; /** * The ISO numeric code for the country in the address. For example, the CountryIsoNumber for the United Kingdom is "826". */ countryIsoNumber?: number | undefined; }; export type GeocodingInternationalPositionToCountryResponse = { items?: | Array | undefined; }; /** @internal */ export const GeocodingInternationalPositionToCountryResponseItem$inboundSchema: z.ZodType< GeocodingInternationalPositionToCountryResponseItem, z.ZodTypeDef, unknown > = z.object({ CountryName: z.string().optional(), CountryIso2: z.string().optional(), CountryIso3: z.string().optional(), CountryIsoNumber: z.number().int().optional(), }).transform((v) => { return remap$(v, { "CountryName": "countryName", "CountryIso2": "countryIso2", "CountryIso3": "countryIso3", "CountryIsoNumber": "countryIsoNumber", }); }); export function geocodingInternationalPositionToCountryResponseItemFromJSON( jsonString: string, ): SafeParseResult< GeocodingInternationalPositionToCountryResponseItem, SDKValidationError > { return safeParse( jsonString, (x) => GeocodingInternationalPositionToCountryResponseItem$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GeocodingInternationalPositionToCountryResponseItem' from JSON`, ); } /** @internal */ export const GeocodingInternationalPositionToCountryResponse$inboundSchema: z.ZodType< GeocodingInternationalPositionToCountryResponse, z.ZodTypeDef, unknown > = z.object({ Items: z.array( z.lazy(() => GeocodingInternationalPositionToCountryResponseItem$inboundSchema ), ).optional(), }).transform((v) => { return remap$(v, { "Items": "items", }); }); export function geocodingInternationalPositionToCountryResponseFromJSON( jsonString: string, ): SafeParseResult< GeocodingInternationalPositionToCountryResponse, SDKValidationError > { return safeParse( jsonString, (x) => GeocodingInternationalPositionToCountryResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GeocodingInternationalPositionToCountryResponse' from JSON`, ); }