/* * 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 DomainNotFoundCode = { DomainNotFound: "domain_not_found", } as const; export type DomainNotFoundCode = ClosedEnum; /** * The domain was not found in our system. */ export type DomainNotFoundData = { status: number; code: DomainNotFoundCode; message: string; }; /** * The domain was not found in our system. */ export class DomainNotFound extends VercelError { status: number; code: DomainNotFoundCode; /** The original data that was passed to this error instance. */ data$: DomainNotFoundData; constructor( err: DomainNotFoundData, 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 = "DomainNotFound"; } } /** @internal */ export const DomainNotFoundCode$inboundSchema: z.ZodNativeEnum< typeof DomainNotFoundCode > = z.nativeEnum(DomainNotFoundCode); /** @internal */ export const DomainNotFoundCode$outboundSchema: z.ZodNativeEnum< typeof DomainNotFoundCode > = DomainNotFoundCode$inboundSchema; /** @internal */ export const DomainNotFound$inboundSchema: z.ZodType< DomainNotFound, z.ZodTypeDef, unknown > = z.object({ status: types.number(), code: DomainNotFoundCode$inboundSchema, message: types.string(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new DomainNotFound(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export type DomainNotFound$Outbound = { status: number; code: string; message: string; }; /** @internal */ export const DomainNotFound$outboundSchema: z.ZodType< DomainNotFound$Outbound, z.ZodTypeDef, DomainNotFound > = z.instanceof(DomainNotFound) .transform(v => v.data$) .pipe(z.object({ status: z.number(), code: DomainNotFoundCode$outboundSchema, message: z.string(), }));