/* * 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 DNSSECEnabledCode = { DnssecEnabled: "dnssec_enabled", } as const; export type DNSSECEnabledCode = ClosedEnum; /** * The operation cannot be completed because DNSSEC is enabled for the domain. */ export type DNSSECEnabledData = { status: number; code: DNSSECEnabledCode; message: string; }; /** * The operation cannot be completed because DNSSEC is enabled for the domain. */ export class DNSSECEnabled extends VercelError { status: number; code: DNSSECEnabledCode; /** The original data that was passed to this error instance. */ data$: DNSSECEnabledData; constructor( err: DNSSECEnabledData, 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 = "DNSSECEnabled"; } } /** @internal */ export const DNSSECEnabledCode$inboundSchema: z.ZodNativeEnum< typeof DNSSECEnabledCode > = z.nativeEnum(DNSSECEnabledCode); /** @internal */ export const DNSSECEnabledCode$outboundSchema: z.ZodNativeEnum< typeof DNSSECEnabledCode > = DNSSECEnabledCode$inboundSchema; /** @internal */ export const DNSSECEnabled$inboundSchema: z.ZodType< DNSSECEnabled, z.ZodTypeDef, unknown > = z.object({ status: types.number(), code: DNSSECEnabledCode$inboundSchema, message: types.string(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new DNSSECEnabled(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export type DNSSECEnabled$Outbound = { status: number; code: string; message: string; }; /** @internal */ export const DNSSECEnabled$outboundSchema: z.ZodType< DNSSECEnabled$Outbound, z.ZodTypeDef, DNSSECEnabled > = z.instanceof(DNSSECEnabled) .transform(v => v.data$) .pipe(z.object({ status: z.number(), code: DNSSECEnabledCode$outboundSchema, message: z.string(), }));