/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; import * as z from "zod"; export const ConsoleV1MetricValuesControllerGenListMetricValuesStatus = { FourHundredAndOne: 401, } as const; export type ConsoleV1MetricValuesControllerGenListMetricValuesStatus = ClosedEnum< typeof ConsoleV1MetricValuesControllerGenListMetricValuesStatus >; /** * This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx */ export type ConsoleV1MetricValuesControllerGenListMetricValuesResponseBodyData = { status: ConsoleV1MetricValuesControllerGenListMetricValuesStatus; message: string; }; /** * This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx */ export class ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody extends Error { status: ConsoleV1MetricValuesControllerGenListMetricValuesStatus; /** The original data that was passed to this error instance. */ data$: ConsoleV1MetricValuesControllerGenListMetricValuesResponseBodyData; constructor(err: ConsoleV1MetricValuesControllerGenListMetricValuesResponseBodyData) { 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 = "ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody"; } } /** @internal */ export const ConsoleV1MetricValuesControllerGenListMetricValuesStatus$inboundSchema: z.ZodNativeEnum< typeof ConsoleV1MetricValuesControllerGenListMetricValuesStatus > = z.nativeEnum(ConsoleV1MetricValuesControllerGenListMetricValuesStatus); /** @internal */ export const ConsoleV1MetricValuesControllerGenListMetricValuesStatus$outboundSchema: z.ZodNativeEnum< typeof ConsoleV1MetricValuesControllerGenListMetricValuesStatus > = ConsoleV1MetricValuesControllerGenListMetricValuesStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ConsoleV1MetricValuesControllerGenListMetricValuesStatus$ { /** @deprecated use `ConsoleV1MetricValuesControllerGenListMetricValuesStatus$inboundSchema` instead. */ export const inboundSchema = ConsoleV1MetricValuesControllerGenListMetricValuesStatus$inboundSchema; /** @deprecated use `ConsoleV1MetricValuesControllerGenListMetricValuesStatus$outboundSchema` instead. */ export const outboundSchema = ConsoleV1MetricValuesControllerGenListMetricValuesStatus$outboundSchema; } /** @internal */ export const ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody$inboundSchema: z.ZodType< ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody, z.ZodTypeDef, unknown > = z .object({ status: ConsoleV1MetricValuesControllerGenListMetricValuesStatus$inboundSchema, message: z.string(), }) .transform((v) => { return new ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody(v); }); /** @internal */ export type ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody$Outbound = { status: number; message: string; }; /** @internal */ export const ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody$outboundSchema: z.ZodType< ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody$Outbound, z.ZodTypeDef, ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody > = z .instanceof(ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody) .transform((v) => v.data$) .pipe( z.object({ status: ConsoleV1MetricValuesControllerGenListMetricValuesStatus$outboundSchema, message: z.string(), }) ); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody$ { /** @deprecated use `ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody$inboundSchema` instead. */ export const inboundSchema = ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody$inboundSchema; /** @deprecated use `ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody$outboundSchema` instead. */ export const outboundSchema = ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody$outboundSchema; /** @deprecated use `ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody$Outbound` instead. */ export type Outbound = ConsoleV1MetricValuesControllerGenListMetricValuesResponseBody$Outbound; }