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