/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import * as components from "../components/index.js"; import { SDKBaseError } from "./sdkbaseerror.js"; export type AuthenticationErrorData = { error?: components.AuthenticationErrorDetail | undefined; }; export class AuthenticationError extends SDKBaseError { error?: components.AuthenticationErrorDetail | undefined; /** The original data that was passed to this error instance. */ data$: AuthenticationErrorData; constructor( err: AuthenticationErrorData, httpMeta: { response: Response; request: Request; body: string }, ) { const message = err.error?.message || `API error occurred: ${JSON.stringify(err)}`; super(message, httpMeta); this.data$ = err; if (err.error != null) this.error = err.error; this.name = "AuthenticationError"; } } /** @internal */ export const AuthenticationError$inboundSchema: z.ZodType< AuthenticationError, z.ZodTypeDef, unknown > = z.object({ error: components.AuthenticationErrorDetail$inboundSchema.optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new AuthenticationError(v, { request: v.request$, response: v.response$, body: v.body$, }); });