/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; /** * Unauthorized */ export type UnauthorizedData = { description?: string; }; /** * Unauthorized */ export class Unauthorized extends Error { description?: string; /** The original data that was passed to this error instance. */ data$: UnauthorizedData; constructor(err: UnauthorizedData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; if (err.description != null) this.description = err.description; this.name = "Unauthorized"; } } /** @internal */ export const Unauthorized$inboundSchema: z.ZodType< Unauthorized, z.ZodTypeDef, unknown > = z.object({ description: z.string().default("Unauthorized"), }) .transform((v) => { return new Unauthorized(v); }); /** @internal */ export type Unauthorized$Outbound = { description?: string; }; /** @internal */ export const Unauthorized$outboundSchema: z.ZodType< Unauthorized$Outbound, z.ZodTypeDef, Unauthorized > = z.instanceof(Unauthorized) .transform(v => v.data$) .pipe(z.object({ description: z.string().default("Unauthorized"), })); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Unauthorized$ { /** @deprecated use `Unauthorized$inboundSchema` instead. */ export const inboundSchema = Unauthorized$inboundSchema; /** @deprecated use `Unauthorized$outboundSchema` instead. */ export const outboundSchema = Unauthorized$outboundSchema; /** @deprecated use `Unauthorized$Outbound` instead. */ export type Outbound = Unauthorized$Outbound; }