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