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