/* * 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 CaptureInteractiveFindResponseItem = { /** * This can be an address Id or a container Id for further results. */ id?: string | undefined; /** * If the Type is 'Address' then the Id can be passed to the Retrieve service. Any other Id should be passed as the Container to a further Find request to get more results. */ type?: string | undefined; /** * The name of the result. */ text?: string | undefined; /** * A list of number ranges identifying the matched characters in the Text and Description. */ highlight?: string | undefined; /** * Descriptive information about the result. */ description?: string | undefined; }; export type CaptureInteractiveFindResponse = { items?: Array | undefined; }; /** @internal */ export const CaptureInteractiveFindResponseItem$inboundSchema: z.ZodType< CaptureInteractiveFindResponseItem, z.ZodTypeDef, unknown > = z.object({ Id: z.string().optional(), Type: z.string().optional(), Text: z.string().optional(), Highlight: z.string().optional(), Description: z.string().optional(), }).transform((v) => { return remap$(v, { "Id": "id", "Type": "type", "Text": "text", "Highlight": "highlight", "Description": "description", }); }); export function captureInteractiveFindResponseItemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CaptureInteractiveFindResponseItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CaptureInteractiveFindResponseItem' from JSON`, ); } /** @internal */ export const CaptureInteractiveFindResponse$inboundSchema: z.ZodType< CaptureInteractiveFindResponse, z.ZodTypeDef, unknown > = z.object({ Items: z.array(z.lazy(() => CaptureInteractiveFindResponseItem$inboundSchema)) .optional(), }).transform((v) => { return remap$(v, { "Items": "items", }); }); export function captureInteractiveFindResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CaptureInteractiveFindResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CaptureInteractiveFindResponse' from JSON`, ); }