/* * 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 BankAccountValidationBatchValidateErrorData = { items?: Array | undefined; }; export class BankAccountValidationBatchValidateError extends LoqateError { items?: Array | undefined; /** The original data that was passed to this error instance. */ data$: BankAccountValidationBatchValidateErrorData; constructor( err: BankAccountValidationBatchValidateErrorData, 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 = "BankAccountValidationBatchValidateError"; } } /** @internal */ export const BankAccountValidationBatchValidateError$inboundSchema: z.ZodType< BankAccountValidationBatchValidateError, z.ZodTypeDef, unknown > = z.object({ Items: z.array( z.lazy(() => models.BankAccountValidationBatchValidateErrorItem$inboundSchema ), ).optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { const remapped = remap$(v, { "Items": "items", }); return new BankAccountValidationBatchValidateError(remapped, { request: v.request$, response: v.response$, body: v.body$, }); });