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