/* * 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 CaptureInteractiveGeoLocationResponseItem = { /** * An address id to pass to the Retrieve endpoint. */ id?: string | undefined; /** * This will always be Address. */ type?: string | undefined; /** * The highest level address details for the returned address; usually either an organisation name/description if available (i.e. the contents of the Company field), otherwise the first line of an address (i.e. Line1). */ text?: string | undefined; /** * Additional details for the returned address, comprised of the contents of the City and Postcode fields. */ description?: string | undefined; /** * The latitude of the returned address. */ latitude?: string | undefined; /** * The longitude of the returned address. */ longitude?: string | undefined; }; export type CaptureInteractiveGeoLocationResponse = { items?: Array | undefined; }; /** @internal */ export const CaptureInteractiveGeoLocationResponseItem$inboundSchema: z.ZodType< CaptureInteractiveGeoLocationResponseItem, z.ZodTypeDef, unknown > = z.object({ Id: z.string().optional(), Type: z.string().optional(), Text: z.string().optional(), Description: z.string().optional(), Latitude: z.string().optional(), Longitude: z.string().optional(), }).transform((v) => { return remap$(v, { "Id": "id", "Type": "type", "Text": "text", "Description": "description", "Latitude": "latitude", "Longitude": "longitude", }); }); export function captureInteractiveGeoLocationResponseItemFromJSON( jsonString: string, ): SafeParseResult< CaptureInteractiveGeoLocationResponseItem, SDKValidationError > { return safeParse( jsonString, (x) => CaptureInteractiveGeoLocationResponseItem$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CaptureInteractiveGeoLocationResponseItem' from JSON`, ); } /** @internal */ export const CaptureInteractiveGeoLocationResponse$inboundSchema: z.ZodType< CaptureInteractiveGeoLocationResponse, z.ZodTypeDef, unknown > = z.object({ Items: z.array( z.lazy(() => CaptureInteractiveGeoLocationResponseItem$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "Items": "items", }); }); export function captureInteractiveGeoLocationResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CaptureInteractiveGeoLocationResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CaptureInteractiveGeoLocationResponse' from JSON`, ); }