/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; /** * Service Unavailable */ export type ServiceUnavailableData = { description?: any; }; /** * Service Unavailable */ export class ServiceUnavailable extends Error { description?: any; /** The original data that was passed to this error instance. */ data$: ServiceUnavailableData; constructor(err: ServiceUnavailableData) { 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 = "ServiceUnavailable"; } } /** @internal */ export const ServiceUnavailable$inboundSchema: z.ZodType< ServiceUnavailable, z.ZodTypeDef, unknown > = z.object({ description: z.any(), }) .transform((v) => { return new ServiceUnavailable(v); }); /** @internal */ export type ServiceUnavailable$Outbound = { description?: any; }; /** @internal */ export const ServiceUnavailable$outboundSchema: z.ZodType< ServiceUnavailable$Outbound, z.ZodTypeDef, ServiceUnavailable > = z.instanceof(ServiceUnavailable) .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 ServiceUnavailable$ { /** @deprecated use `ServiceUnavailable$inboundSchema` instead. */ export const inboundSchema = ServiceUnavailable$inboundSchema; /** @deprecated use `ServiceUnavailable$outboundSchema` instead. */ export const outboundSchema = ServiceUnavailable$outboundSchema; /** @deprecated use `ServiceUnavailable$Outbound` instead. */ export type Outbound = ServiceUnavailable$Outbound; }