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