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