-
Notifications
You must be signed in to change notification settings - Fork 3
/
web-integrations.d.ts
274 lines (272 loc) · 9.09 KB
/
web-integrations.d.ts
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
import { A as ApiCallOptions } from './invoke-fetch-types-0Dw3a71T.js';
import './auth-types-PkN9CAF_.js';
/**
* An error object describing the error.
*/
type Error = {
/** The error code. */
code: string;
/** A human-readable explanation specific to this occurrence of the error. */
detail?: string;
/** Additional properties relating to the error. */
meta?: unknown;
/** References to the source of the error. */
source?: {
/** The URI query parameter that caused the error. */
parameter?: string;
/** A JSON Pointer to the property that caused the error. */
pointer?: string;
};
/** The HTTP status code. */
status: string;
/** Summary of the problem. */
title: string;
};
/**
* The error response object describing the error from the handling of an HTTP request.
*/
type Errors = {
/** An array of errors related to the operation. */
errors?: Error[];
/** A unique identifier for tracing the error. */
traceId?: string;
};
/**
* A web integration object.
*/
type WebIntegration = {
/** The time the web integration was created. */
readonly created?: string;
/** The user that created the web integration. */
readonly createdBy?: string;
/** The unique web integration identifier. */
readonly id?: string;
/** The time the web integration was last updated. */
readonly lastUpdated?: string;
/** The name of the web integration. */
name?: string;
/** The tenant that the web integration belongs to. */
tenantId?: string;
/** The origins that are allowed to make requests to the tenant. */
validOrigins?: string[];
};
/**
* A JSON Patch document as defined in http://tools.ietf.org/html/rfc6902.
*/
type WebIntegrationPatch = {
/** The operation to be performed. */
op: "replace";
/** A JSON Pointer. */
path: "/name" | "/validOrigins";
/** New value to be used for this operation. */
value: string;
};
type WebIntegrationPatchSchema = WebIntegrationPatch[];
/**
* The creation of a web integration response.
*/
type WebIntegrationPost = {
/** The time the web integration was created. */
readonly created?: string;
/** The user that created the web integration. */
readonly createdBy?: string;
/** The unique web integration identifier. */
readonly id?: string;
/** The time the web integration was last updated. */
readonly lastUpdated?: string;
/** Pagination links */
links?: {
/** Link information for current page. */
self: {
/** URL to the current page of records. */
href: string;
};
};
/** The name of the newly created web integration. */
name?: string;
/** The tenant that the web integration belongs to. */
tenantId?: string;
/** The origins that are allowed to make requests to the tenant. */
validOrigins?: string[];
};
type WebIntegrationPostSchema = {
/** The name of the web integration to create. */
name: string;
/** The origins that are allowed to make requests to the tenant. */
validOrigins?: string[];
};
/**
* An array of web integration objects.
*/
type WebIntegrations = {
/** Properties of web integrations in a given tenant. */
data?: WebIntegration[];
/** Pagination links */
links?: {
/** Link information for next page. */
next?: {
/** URL to the next page of records. */
href: string;
};
/** Link information for previous page. */
prev?: {
/** URL to the previous page of records. */
href: string;
};
/** Link information for current page. */
self: {
/** URL to the current page of records. */
href: string;
};
};
};
/**
* Retrieves web integrations matching the query.
*
* @param query an object with query parameters
* @throws GetWebIntegrationsHttpError
*/
declare const getWebIntegrations: (query: {
/** The target web integration ID to start looking before for web integrations. Cannot be used in conjunction with startingAfter. */
endingBefore?: string;
/** The number of web integration entries to retrieve. */
limit?: number;
/** The field to sort by. Prefix with +/- to indicate ascending/descending order. */
sort?: "name" | "+name" | "-name";
/** The target web integration ID to start looking after for web integrations. Cannot be used in conjunction with endingBefore. */
startingAfter?: string;
/** The tenant ID to filter by. */
tenantId?: string;
}, options?: ApiCallOptions) => Promise<GetWebIntegrationsHttpResponse>;
type GetWebIntegrationsHttpResponse = {
data: WebIntegrations;
headers: Headers;
status: number;
prev?: (options?: ApiCallOptions) => Promise<GetWebIntegrationsHttpResponse>;
next?: (options?: ApiCallOptions) => Promise<GetWebIntegrationsHttpResponse>;
};
type GetWebIntegrationsHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Creates a web integration.
*
* @param body an object with the body content
* @throws CreateWebIntegrationHttpError
*/
declare const createWebIntegration: (body: WebIntegrationPostSchema, options?: ApiCallOptions) => Promise<CreateWebIntegrationHttpResponse>;
type CreateWebIntegrationHttpResponse = {
data: WebIntegrationPost;
headers: Headers;
status: number;
};
type CreateWebIntegrationHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Deletes a single web integration by ID.
*
* @param id The ID of the web integration to delete.
* @throws DeleteWebIntegrationHttpError
*/
declare const deleteWebIntegration: (id: string, options?: ApiCallOptions) => Promise<DeleteWebIntegrationHttpResponse>;
type DeleteWebIntegrationHttpResponse = {
data: void;
headers: Headers;
status: number;
};
type DeleteWebIntegrationHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Retrieves a single web integration by ID.
*
* @param id The ID of the web integration to retrieve.
* @throws GetWebIntegrationHttpError
*/
declare const getWebIntegration: (id: string, options?: ApiCallOptions) => Promise<GetWebIntegrationHttpResponse>;
type GetWebIntegrationHttpResponse = {
data: WebIntegration;
headers: Headers;
status: number;
};
type GetWebIntegrationHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Updates a single web integration by ID.
*
* @param id The ID of the web integration to update.
* @param body an object with the body content
* @throws PatchWebIntegrationHttpError
*/
declare const patchWebIntegration: (id: string, body: WebIntegrationPatchSchema, options?: ApiCallOptions) => Promise<PatchWebIntegrationHttpResponse>;
type PatchWebIntegrationHttpResponse = {
data: void;
headers: Headers;
status: number;
};
type PatchWebIntegrationHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Clears the cache for web-integrations api requests.
*/
declare function clearCache(): void;
interface WebIntegrationsAPI {
/**
* Retrieves web integrations matching the query.
*
* @param query an object with query parameters
* @throws GetWebIntegrationsHttpError
*/
getWebIntegrations: typeof getWebIntegrations;
/**
* Creates a web integration.
*
* @param body an object with the body content
* @throws CreateWebIntegrationHttpError
*/
createWebIntegration: typeof createWebIntegration;
/**
* Deletes a single web integration by ID.
*
* @param id The ID of the web integration to delete.
* @throws DeleteWebIntegrationHttpError
*/
deleteWebIntegration: typeof deleteWebIntegration;
/**
* Retrieves a single web integration by ID.
*
* @param id The ID of the web integration to retrieve.
* @throws GetWebIntegrationHttpError
*/
getWebIntegration: typeof getWebIntegration;
/**
* Updates a single web integration by ID.
*
* @param id The ID of the web integration to update.
* @param body an object with the body content
* @throws PatchWebIntegrationHttpError
*/
patchWebIntegration: typeof patchWebIntegration;
/**
* Clears the cache for web-integrations api requests.
*/
clearCache: typeof clearCache;
}
/**
* Functions for the web-integrations api
*/
declare const webIntegrationsExport: WebIntegrationsAPI;
export { type CreateWebIntegrationHttpError, type CreateWebIntegrationHttpResponse, type DeleteWebIntegrationHttpError, type DeleteWebIntegrationHttpResponse, type Error, type Errors, type GetWebIntegrationHttpError, type GetWebIntegrationHttpResponse, type GetWebIntegrationsHttpError, type GetWebIntegrationsHttpResponse, type PatchWebIntegrationHttpError, type PatchWebIntegrationHttpResponse, type WebIntegration, type WebIntegrationPatch, type WebIntegrationPatchSchema, type WebIntegrationPost, type WebIntegrationPostSchema, type WebIntegrations, type WebIntegrationsAPI, clearCache, createWebIntegration, webIntegrationsExport as default, deleteWebIntegration, getWebIntegration, getWebIntegrations, patchWebIntegration };