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