Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/src/publish/netlify/api/services/HookService.ts
6464 views
1
/* istanbul ignore file */
2
/* tslint:disable */
3
/* eslint-disable */
4
import type { CancelablePromise } from "../core/CancelablePromise.ts";
5
import type { BaseHttpRequest } from "../core/BaseHttpRequest.ts";
6
7
export class HookService {
8
constructor(public readonly httpRequest: BaseHttpRequest) {}
9
10
/**
11
* @returns any OK
12
* @throws ApiError
13
*/
14
public listHooksBySiteId({
15
siteId,
16
}: {
17
siteId: string;
18
}): CancelablePromise<
19
Array<{
20
id?: string;
21
site_id?: string;
22
type?: string;
23
event?: string;
24
data?: any;
25
created_at?: string;
26
updated_at?: string;
27
disabled?: boolean;
28
}>
29
> {
30
return this.httpRequest.request({
31
method: "GET",
32
url: "/hooks",
33
query: {
34
"site_id": siteId,
35
},
36
});
37
}
38
39
/**
40
* @returns any error
41
* @throws ApiError
42
*/
43
public createHookBySiteId({
44
siteId,
45
hook,
46
}: {
47
siteId: string;
48
hook: {
49
id?: string;
50
site_id?: string;
51
type?: string;
52
event?: string;
53
data?: any;
54
created_at?: string;
55
updated_at?: string;
56
disabled?: boolean;
57
};
58
}): CancelablePromise<{
59
code?: number;
60
message: string;
61
}> {
62
return this.httpRequest.request({
63
method: "POST",
64
url: "/hooks",
65
query: {
66
"site_id": siteId,
67
},
68
body: hook,
69
});
70
}
71
72
/**
73
* @returns any OK
74
* @throws ApiError
75
*/
76
public getHook({
77
hookId,
78
}: {
79
hookId: string;
80
}): CancelablePromise<{
81
id?: string;
82
site_id?: string;
83
type?: string;
84
event?: string;
85
data?: any;
86
created_at?: string;
87
updated_at?: string;
88
disabled?: boolean;
89
}> {
90
return this.httpRequest.request({
91
method: "GET",
92
url: "/hooks/{hook_id}",
93
path: {
94
"hook_id": hookId,
95
},
96
});
97
}
98
99
/**
100
* @returns any OK
101
* @throws ApiError
102
*/
103
public updateHook({
104
hookId,
105
hook,
106
}: {
107
hookId: string;
108
hook: {
109
id?: string;
110
site_id?: string;
111
type?: string;
112
event?: string;
113
data?: any;
114
created_at?: string;
115
updated_at?: string;
116
disabled?: boolean;
117
};
118
}): CancelablePromise<{
119
id?: string;
120
site_id?: string;
121
type?: string;
122
event?: string;
123
data?: any;
124
created_at?: string;
125
updated_at?: string;
126
disabled?: boolean;
127
}> {
128
return this.httpRequest.request({
129
method: "PUT",
130
url: "/hooks/{hook_id}",
131
path: {
132
"hook_id": hookId,
133
},
134
body: hook,
135
});
136
}
137
138
/**
139
* @returns void
140
* @throws ApiError
141
*/
142
public deleteHook({
143
hookId,
144
}: {
145
hookId: string;
146
}): CancelablePromise<void> {
147
return this.httpRequest.request({
148
method: "DELETE",
149
url: "/hooks/{hook_id}",
150
path: {
151
"hook_id": hookId,
152
},
153
});
154
}
155
156
/**
157
* @returns any OK
158
* @throws ApiError
159
*/
160
public enableHook({
161
hookId,
162
}: {
163
hookId: string;
164
}): CancelablePromise<{
165
id?: string;
166
site_id?: string;
167
type?: string;
168
event?: string;
169
data?: any;
170
created_at?: string;
171
updated_at?: string;
172
disabled?: boolean;
173
}> {
174
return this.httpRequest.request({
175
method: "POST",
176
url: "/hooks/{hook_id}/enable",
177
path: {
178
"hook_id": hookId,
179
},
180
});
181
}
182
}
183
184