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