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