@vercel/sdk
Version:
<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>
76 lines (66 loc) • 2.18 kB
text/typescript
/*
* 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 DomainCannotBeTransferedOutUntilCode = {
DomainCannotBeTransferedOutUntil: "domain_cannot_be_transfered_out_until",
} as const;
export type DomainCannotBeTransferedOutUntilCode = ClosedEnum<
typeof DomainCannotBeTransferedOutUntilCode
>;
/**
* The domain cannot be transfered out until the specified date.
*/
export type DomainCannotBeTransferedOutUntilData = {
status: number;
code: DomainCannotBeTransferedOutUntilCode;
message: string;
};
/**
* The domain cannot be transfered out until the specified date.
*/
export class DomainCannotBeTransferedOutUntil extends VercelError {
status: number;
code: DomainCannotBeTransferedOutUntilCode;
/** The original data that was passed to this error instance. */
data$: DomainCannotBeTransferedOutUntilData;
constructor(
err: DomainCannotBeTransferedOutUntilData,
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 = "DomainCannotBeTransferedOutUntil";
}
}
/** @internal */
export const DomainCannotBeTransferedOutUntilCode$inboundSchema:
z.ZodNativeEnum<typeof DomainCannotBeTransferedOutUntilCode> = z.nativeEnum(
DomainCannotBeTransferedOutUntilCode,
);
/** @internal */
export const DomainCannotBeTransferedOutUntil$inboundSchema: z.ZodType<
DomainCannotBeTransferedOutUntil,
z.ZodTypeDef,
unknown
> = z.object({
status: types.number(),
code: DomainCannotBeTransferedOutUntilCode$inboundSchema,
message: types.string(),
request$: z.instanceof(Request),
response$: z.instanceof(Response),
body$: z.string(),
})
.transform((v) => {
return new DomainCannotBeTransferedOutUntil(v, {
request: v.request$,
response: v.response$,
body: v.body$,
});
});