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