-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathboughttoorecently.ts
More file actions
72 lines (63 loc) · 1.85 KB
/
Copy pathboughttoorecently.ts
File metadata and controls
72 lines (63 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* 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 BoughtTooRecentlyCode = {
BoughtTooRecently: "bought_too_recently",
} as const;
export type BoughtTooRecentlyCode = ClosedEnum<typeof BoughtTooRecentlyCode>;
/**
* The domain was bought too recently to determine verification status.
*/
export type BoughtTooRecentlyData = {
status: number;
code: BoughtTooRecentlyCode;
message: string;
};
/**
* The domain was bought too recently to determine verification status.
*/
export class BoughtTooRecently extends VercelError {
status: number;
code: BoughtTooRecentlyCode;
/** The original data that was passed to this error instance. */
data$: BoughtTooRecentlyData;
constructor(
err: BoughtTooRecentlyData,
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 = "BoughtTooRecently";
}
}
/** @internal */
export const BoughtTooRecentlyCode$inboundSchema: z.ZodNativeEnum<
typeof BoughtTooRecentlyCode
> = z.nativeEnum(BoughtTooRecentlyCode);
/** @internal */
export const BoughtTooRecently$inboundSchema: z.ZodType<
BoughtTooRecently,
z.ZodTypeDef,
unknown
> = z.object({
status: types.number(),
code: BoughtTooRecentlyCode$inboundSchema,
message: types.string(),
request$: z.instanceof(Request),
response$: z.instanceof(Response),
body$: z.string(),
})
.transform((v) => {
return new BoughtTooRecently(v, {
request: v.request$,
response: v.response$,
body: v.body$,
});
});