/* * 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 * as models from "../index.js"; import { LoqateError } from "./loqateerror.js"; export type StoreFinderInteractiveFindPlaceNamesErrorData = { items?: | Array | undefined; }; export class StoreFinderInteractiveFindPlaceNamesError extends LoqateError { items?: | Array | undefined; /** The original data that was passed to this error instance. */ data$: StoreFinderInteractiveFindPlaceNamesErrorData; constructor( err: StoreFinderInteractiveFindPlaceNamesErrorData, httpMeta: { response: Response; request: Request; body: string }, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message, httpMeta); this.data$ = err; if (err.items != null) this.items = err.items; this.name = "StoreFinderInteractiveFindPlaceNamesError"; } } /** @internal */ export const StoreFinderInteractiveFindPlaceNamesError$inboundSchema: z.ZodType< StoreFinderInteractiveFindPlaceNamesError, z.ZodTypeDef, unknown > = z.object({ Items: z.array( z.lazy(() => models.StoreFinderInteractiveFindPlaceNamesErrorItem$inboundSchema ), ).optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { const remapped = remap$(v, { "Items": "items", }); return new StoreFinderInteractiveFindPlaceNamesError(remapped, { request: v.request$, response: v.response$, body: v.body$, }); });