-
Notifications
You must be signed in to change notification settings - Fork 3
/
task.ts
58 lines (53 loc) · 1.38 KB
/
task.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
import { SubscriptionPricing } from "./responses/subscription";
/**
* Task object
* @param taskId The id of the task
* @param status The status of the task
* @param description The description of the task
* @param timestamp The timestamp of the task
* @param response The response of the task
*/
export type TaskObject = {
taskId: string,
status: TaskStatus,
description: string,
timestamp: string,
response: TaskResponse,
[key: string]: any
}
/**
* Task response object
* @param resourceId The resource id
* @param error The error of the task
* @param resource The resource of the task (Returned when dryRun = true)
*/
export type TaskResponse = {
resourceId: number,
error?: ErrorResponse,
resource?: {
pricing?: SubscriptionPricing[],
cidr_ips?: string[],
security_group_ids?: string[],
errors?: any[],
[key: string]: any
},
[key: string]: any
}
/**
* Task error response
* @param type The type of the error
* @param status The status of the error
* @param description The description of the error
*/
export type ErrorResponse = {
type?: string,
status?: string,
description?: string,
[key: string]: any
}
/**
* The task status
* @param processing-completed Completed status
* @param processing-error Error status
*/
export type TaskStatus = 'processing-completed' | 'processing-error';