-
Notifications
You must be signed in to change notification settings - Fork 10
/
Message.ts
68 lines (59 loc) · 1.37 KB
/
Message.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
import {map, mapArray} from '../common/Mapper';
import BitmovinResponse from './BitmovinResponse';
import Link from './Link';
import MessageType from './MessageType';
/**
* @export
* @class Message
*/
export class Message extends BitmovinResponse {
/**
* Message type giving a hint on the importance of the message (log level) (required)
* @type {MessageType}
* @memberof Message
*/
public type?: MessageType;
/**
* Message text (required)
* @type {string}
* @memberof Message
*/
public text?: string;
/**
* Name of the field to which the message is referring to
* @type {string}
* @memberof Message
*/
public field?: string;
/**
* collection of links to webpages containing further information on the topic
* @type {Link[]}
* @memberof Message
*/
public links?: Link[];
/**
* Service-specific information
* @type {any}
* @memberof Message
*/
public more?: any;
/**
* Timestamp when the message occurred
* @type {Date}
* @memberof Message
*/
public date?: Date;
constructor(obj?: Partial<Message>) {
super(obj);
if(!obj) {
return;
}
this.type = map(obj.type);
this.text = map(obj.text);
this.field = map(obj.field);
this.links = mapArray(obj.links, Link);
this.more = map(obj.more);
this.date = map(obj.date, Date);
}
}
export default Message;