/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { ClosedEnum } from "../types/enums.js"; import * as types from "../types/primitives.js"; import { VercelError } from "./vercelerror.js"; export const DomainNotRegisteredCode = { DomainNotRegistered: "domain_not_registered", } as const; export type DomainNotRegisteredCode = ClosedEnum< typeof DomainNotRegisteredCode >; /** * The domain is not registered with Vercel. */ export type DomainNotRegisteredData = { status: number; code: DomainNotRegisteredCode; message: string; }; /** * The domain is not registered with Vercel. */ export class DomainNotRegistered extends VercelError { status: number; code: DomainNotRegisteredCode; /** The original data that was passed to this error instance. */ data$: DomainNotRegisteredData; constructor( err: DomainNotRegisteredData, httpMeta: { response: Response; request: Request; body: string }, ) { const message = err.message || `API error occurred: ${JSON.stringify(err)}`; super(message, httpMeta); this.data$ = err; this.status = err.status; this.code = err.code; this.name = "DomainNotRegistered"; } } /** @internal */ export const DomainNotRegisteredCode$inboundSchema: z.ZodNativeEnum< typeof DomainNotRegisteredCode > = z.nativeEnum(DomainNotRegisteredCode); /** @internal */ export const DomainNotRegisteredCode$outboundSchema: z.ZodNativeEnum< typeof DomainNotRegisteredCode > = DomainNotRegisteredCode$inboundSchema; /** @internal */ export const DomainNotRegistered$inboundSchema: z.ZodType< DomainNotRegistered, z.ZodTypeDef, unknown > = z.object({ status: types.number(), code: DomainNotRegisteredCode$inboundSchema, message: types.string(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new DomainNotRegistered(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export type DomainNotRegistered$Outbound = { status: number; code: string; message: string; }; /** @internal */ export const DomainNotRegistered$outboundSchema: z.ZodType< DomainNotRegistered$Outbound, z.ZodTypeDef, DomainNotRegistered > = z.instanceof(DomainNotRegistered) .transform(v => v.data$) .pipe(z.object({ status: z.number(), code: DomainNotRegisteredCode$outboundSchema, message: z.string(), }));