-
Notifications
You must be signed in to change notification settings - Fork 3
/
reload-tasks.d.ts
227 lines (225 loc) · 8.2 KB
/
reload-tasks.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
import { A as ApiCallOptions } from './global.types-BU2Yugjm.js';
import './auth-types-BU5EGt_9.js';
type Error = {
code: string;
detail?: string;
title: string;
};
type Errors = {
errors?: Error[];
traceId?: string;
};
type Href = {
href: string;
};
type PaginationLinks = SelfLink & {
next?: Href;
prev?: Href;
};
type PostTaskBody = TaskBase & {
/** @deprecated
* Type of task being created - only contains the "scheduled_reload" value. Type value is not used for creating a schedule reload. It has been deprecated since 2022-04-05. */
type?: "scheduled_reload";
};
type PutTaskBody = TaskBase & {
/** Toggle for enabling and disabling the reload task */
state?: "Enabled" | "Disabled" | "Completed";
};
type SelfLink = {
self: Href;
};
type Task = TaskBase & {
/** The reason why the task was disabled. */
disabledCode?: "MANUALLY" | "CONSECUTIVE-FAILURES" | "OWNER-DELETED" | "OWNER-DISABLED";
/** @deprecated
* The fortress ID of the application */
fortressId?: string;
/** The ID of the task. */
id: string;
/** The last time the task executed. */
lastExecutionTime?: string;
links: SelfLink;
/** @deprecated
* The reason why the task was disabled. */
log?: string;
/** The next time the task will execute. */
nextExecutionTime?: string;
/** The space ID of the application */
spaceId?: string;
/** Toggle for enabling and disabling the reload task */
state: "Enabled" | "Disabled" | "Completed";
/** The ID of the tenant who owns the task. */
tenantId: string;
/** The ID of the user who owns the task. */
userId: string;
};
type TaskBase = {
/** The ID of the app. */
appId?: string;
/** A flag that indicates whether a reload is triggered when data of the app is changed */
autoReload?: boolean;
/** A flag that indicates whether it is a partial reload or not for the auto reload */
autoReloadPartial?: boolean;
/** The time that the task will stop recurring. If the time zone is missing, this is a combined date-time value expressing a time with a fixed UTC offset (formatted according to RFC3339). If a time zone is given, the zone offset must be omitted. */
endDateTime?: string;
/** The task is partial reload or not */
partial?: boolean;
/** List of RECUR lines for a recurring event, as specified in RFC5545. Note that DTSTART and DTEND lines are not allowed in this field; event start and end times are specified in the start and end fields. This field is omitted for single events or instances of recurring events */
recurrence?: string[];
/** The time that the task execution start recurring. If the time zone is missing, this is a combined date-time value expressing a time with a fixed UTC offset (formatted according to RFC3339). If a time zone is given, the zone offset must be omitted. Field startDateTime should not be before the Unix epoch 00:00:00 UTC on 1 January 1970. Note that the empty string value with the empty recurrence array indicates the scheduled job is not set. */
startDateTime?: string;
/** The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. Europe/Zurich.) This field specifies the time zone in which the event start/end are expanded. If missing the start/end fields must specify a UTC offset in RFC3339 format. */
timeZone?: string;
};
type Tasks = {
data: Task[];
links: PaginationLinks;
};
/**
* Finds and returns the tasks that the user has access to.
*
* @param query an object with query parameters
* @throws GetReloadTasksHttpError
*/
declare const getReloadTasks: (query: {
/** The case sensitive string used to search for a task by app ID. */
appId?: string;
/** The maximum number of resources to return for a request. The limit must be an integer between 1 and 100 (inclusive). */
limit?: number;
/** The cursor to the next page of resources. Provide either the next or prev cursor, but not both. */
next?: string;
/** The boolean value used to search for a task is partial or not */
partial?: boolean;
/** The cursor to the previous page of resources. Provide either the next or prev cursor, but not both. */
prev?: string;
}, options?: ApiCallOptions) => Promise<GetReloadTasksHttpResponse>;
type GetReloadTasksHttpResponse = {
data: Tasks;
headers: Headers;
status: number;
};
type GetReloadTasksHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Creates a task for a specified app.
*
* @param body an object with the body content
* @throws CreateReloadTaskHttpError
*/
declare const createReloadTask: (body: PostTaskBody, options?: ApiCallOptions) => Promise<CreateReloadTaskHttpResponse>;
type CreateReloadTaskHttpResponse = {
data: Task;
headers: Headers;
status: number;
};
type CreateReloadTaskHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Deletes a task
*
* @param taskId The unique identifier of the task.
* @throws DeleteReloadTaskHttpError
*/
declare const deleteReloadTask: (taskId: string, options?: ApiCallOptions) => Promise<DeleteReloadTaskHttpResponse>;
type DeleteReloadTaskHttpResponse = {
data: void;
headers: Headers;
status: number;
};
type DeleteReloadTaskHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Finds and returns a task.
*
* @param taskId The unique identifier of the task.
* @throws GetReloadTaskHttpError
*/
declare const getReloadTask: (taskId: string, options?: ApiCallOptions) => Promise<GetReloadTaskHttpResponse>;
type GetReloadTaskHttpResponse = {
data: Task;
headers: Headers;
status: number;
};
type GetReloadTaskHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Updates an existing task
*
* @param taskId The unique identifier of the task.
* @param body an object with the body content
* @throws UpdateReloadTaskHttpError
*/
declare const updateReloadTask: (taskId: string, body: PutTaskBody, options?: ApiCallOptions) => Promise<UpdateReloadTaskHttpResponse>;
type UpdateReloadTaskHttpResponse = {
data: Task;
headers: Headers;
status: number;
};
type UpdateReloadTaskHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Clears the cache for reload-tasks api requests.
*/
declare function clearCache(): void;
interface ReloadTasksAPI {
/**
* Finds and returns the tasks that the user has access to.
*
* @param query an object with query parameters
* @throws GetReloadTasksHttpError
*/
getReloadTasks: typeof getReloadTasks;
/**
* Creates a task for a specified app.
*
* @param body an object with the body content
* @throws CreateReloadTaskHttpError
*/
createReloadTask: typeof createReloadTask;
/**
* Deletes a task
*
* @param taskId The unique identifier of the task.
* @throws DeleteReloadTaskHttpError
*/
deleteReloadTask: typeof deleteReloadTask;
/**
* Finds and returns a task.
*
* @param taskId The unique identifier of the task.
* @throws GetReloadTaskHttpError
*/
getReloadTask: typeof getReloadTask;
/**
* Updates an existing task
*
* @param taskId The unique identifier of the task.
* @param body an object with the body content
* @throws UpdateReloadTaskHttpError
*/
updateReloadTask: typeof updateReloadTask;
/**
* Clears the cache for reload-tasks api requests.
*/
clearCache: typeof clearCache;
}
/**
* Functions for the reload-tasks api
*/
declare const reloadTasksExport: ReloadTasksAPI;
export { type CreateReloadTaskHttpError, type CreateReloadTaskHttpResponse, type DeleteReloadTaskHttpError, type DeleteReloadTaskHttpResponse, type Error, type Errors, type GetReloadTaskHttpError, type GetReloadTaskHttpResponse, type GetReloadTasksHttpError, type GetReloadTasksHttpResponse, type Href, type PaginationLinks, type PostTaskBody, type PutTaskBody, type ReloadTasksAPI, type SelfLink, type Task, type TaskBase, type Tasks, type UpdateReloadTaskHttpError, type UpdateReloadTaskHttpResponse, clearCache, createReloadTask, reloadTasksExport as default, deleteReloadTask, getReloadTask, getReloadTasks, updateReloadTask };