/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { MoovError } from "./mooverror.js"; export type BankAccountValidationErrorData = { account?: string | undefined; plaid?: string | undefined; plaidLink?: string | undefined; mx?: string | undefined; error?: string | undefined; }; export class BankAccountValidationError extends MoovError { account?: string | undefined; plaid?: string | undefined; plaidLink?: string | undefined; mx?: string | undefined; error?: string | undefined; /** The original data that was passed to this error instance. */ data$: BankAccountValidationErrorData; constructor( err: BankAccountValidationErrorData, 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.account != null) this.account = err.account; if (err.plaid != null) this.plaid = err.plaid; if (err.plaidLink != null) this.plaidLink = err.plaidLink; if (err.mx != null) this.mx = err.mx; if (err.error != null) this.error = err.error; this.name = "BankAccountValidationError"; } } /** @internal */ export const BankAccountValidationError$inboundSchema: z.ZodType< BankAccountValidationError, z.ZodTypeDef, unknown > = z.object({ account: z.string().optional(), plaid: z.string().optional(), plaidLink: z.string().optional(), mx: z.string().optional(), error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new BankAccountValidationError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export type BankAccountValidationError$Outbound = { account?: string | undefined; plaid?: string | undefined; plaidLink?: string | undefined; mx?: string | undefined; error?: string | undefined; }; /** @internal */ export const BankAccountValidationError$outboundSchema: z.ZodType< BankAccountValidationError$Outbound, z.ZodTypeDef, BankAccountValidationError > = z.instanceof(BankAccountValidationError) .transform(v => v.data$) .pipe(z.object({ account: z.string().optional(), plaid: z.string().optional(), plaidLink: z.string().optional(), mx: z.string().optional(), error: z.string().optional(), }));