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