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