-
Notifications
You must be signed in to change notification settings - Fork 10
/
Webhook.ts
60 lines (52 loc) · 1.23 KB
/
Webhook.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
import {map, mapArray} from '../common/Mapper';
import BitmovinResource from './BitmovinResource';
import WebhookHttpMethod from './WebhookHttpMethod';
import WebhookSignature from './WebhookSignature';
/**
* @export
* @class Webhook
*/
export class Webhook extends BitmovinResource {
/**
* Webhook URL (required)
* @type {string}
* @memberof Webhook
*/
public url?: string;
/**
* HTTP method used for the webhook
* @type {WebhookHttpMethod}
* @memberof Webhook
*/
public method?: WebhookHttpMethod;
/**
* Skip verification of the SSL certificate
* @type {boolean}
* @memberof Webhook
*/
public insecureSsl?: boolean;
/**
* Signature used for the webhook
* @type {WebhookSignature}
* @memberof Webhook
*/
public signature?: WebhookSignature;
/**
* JSON schema of the webhook payload
* @type {any}
* @memberof Webhook
*/
public schema?: any;
constructor(obj?: Partial<Webhook>) {
super(obj);
if(!obj) {
return;
}
this.url = map(obj.url);
this.method = map(obj.method);
this.insecureSsl = map(obj.insecureSsl);
this.signature = map(obj.signature, WebhookSignature);
this.schema = map(obj.schema);
}
}
export default Webhook;