/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; /** * Rate Limit Exceeded */ export type TooManyRequestsData = { description?: any; }; /** * Rate Limit Exceeded */ export class TooManyRequests extends Error { description?: any; /** The original data that was passed to this error instance. */ data$: TooManyRequestsData; constructor(err: TooManyRequestsData) { 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 = "TooManyRequests"; } } /** @internal */ export const TooManyRequests$inboundSchema: z.ZodType< TooManyRequests, z.ZodTypeDef, unknown > = z.object({ description: z.any(), }) .transform((v) => { return new TooManyRequests(v); }); /** @internal */ export type TooManyRequests$Outbound = { description?: any; }; /** @internal */ export const TooManyRequests$outboundSchema: z.ZodType< TooManyRequests$Outbound, z.ZodTypeDef, TooManyRequests > = z.instanceof(TooManyRequests) .transform(v => v.data$) .pipe(z.object({ description: z.any(), })); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TooManyRequests$ { /** @deprecated use `TooManyRequests$inboundSchema` instead. */ export const inboundSchema = TooManyRequests$inboundSchema; /** @deprecated use `TooManyRequests$outboundSchema` instead. */ export const outboundSchema = TooManyRequests$outboundSchema; /** @deprecated use `TooManyRequests$Outbound` instead. */ export type Outbound = TooManyRequests$Outbound; }