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