-
Notifications
You must be signed in to change notification settings - Fork 10
/
Subtask.ts
108 lines (94 loc) · 2.96 KB
/
Subtask.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
import {map, mapArray} from '../common/Mapper';
import BitmovinResponse from './BitmovinResponse';
import Message from './Message';
import Status from './Status';
/**
* @export
* @class Subtask
*/
export class Subtask extends BitmovinResponse {
/**
* Current status (required)
* @type {Status}
* @memberof Subtask
*/
public status?: Status;
/**
* Progress in percent
* @type {number}
* @memberof Subtask
*/
public progress?: number;
/**
* Name of the subtask (required)
* @type {string}
* @memberof Subtask
*/
public name?: string;
/**
* Task specific messages
* @type {Message[]}
* @memberof Subtask
*/
public messages?: Message[];
/**
* Timestamp when the subtask was created, returned as UTC expressed in ISO 8601 format: YYYY-MM-DDThh:mm:ssZ
* @type {Date}
* @memberof Subtask
*/
public createdAt?: Date;
/**
* Timestamp when the subtask was last updated, returned as UTC expressed in ISO 8601 format: YYYY-MM-DDThh:mm:ssZ
* @type {Date}
* @memberof Subtask
*/
public updatedAt?: Date;
/**
* Timestamp when the subtask was started, returned as UTC expressed in ISO 8601 format: YYYY-MM-DDThh:mm:ssZ
* @type {Date}
* @memberof Subtask
*/
public startedAt?: Date;
/**
* Timestamp when the subtask status changed to 'QUEUED', returned as UTC expressed in ISO 8601 format: YYYY-MM-DDThh:mm:ssZ
* @type {Date}
* @memberof Subtask
*/
public queuedAt?: Date;
/**
* Timestamp when the subtask status changed to 'RUNNING', returned as UTC expressed in ISO 8601 format: YYYY-MM-DDThh:mm:ssZ
* @type {Date}
* @memberof Subtask
*/
public runningAt?: Date;
/**
* Timestamp when the subtask status changed to a final state like 'FINISHED', 'ERROR', 'CANCELED', returned as UTC expressed in ISO 8601 format: YYYY-MM-DDThh:mm:ssZ Note that this timestamp might be inaccurate for subtasks which ran prior to the [1.50.0 REST API release](https://bitmovin.com/docs/encoding/changelogs/rest).
* @type {Date}
* @memberof Subtask
*/
public finishedAt?: Date;
/**
* Timestamp when the subtask status changed to 'ERROR', returned as UTC expressed in ISO 8601 format: YYYY-MM-DDThh:mm:ssZ Note that this timestamp is deprecated and is equivalent to finishedAt in case of an 'ERROR'.
* @type {Date}
* @memberof Subtask
*/
public errorAt?: Date;
constructor(obj?: Partial<Subtask>) {
super(obj);
if(!obj) {
return;
}
this.status = map(obj.status);
this.progress = map(obj.progress);
this.name = map(obj.name);
this.messages = mapArray(obj.messages, Message);
this.createdAt = map(obj.createdAt, Date);
this.updatedAt = map(obj.updatedAt, Date);
this.startedAt = map(obj.startedAt, Date);
this.queuedAt = map(obj.queuedAt, Date);
this.runningAt = map(obj.runningAt, Date);
this.finishedAt = map(obj.finishedAt, Date);
this.errorAt = map(obj.errorAt, Date);
}
}
export default Subtask;