-
Notifications
You must be signed in to change notification settings - Fork 10
/
WebhookNotification.ts
52 lines (45 loc) · 1.2 KB
/
WebhookNotification.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
import {map, mapArray} from '../common/Mapper';
import Notification from './Notification';
import WebhookHttpMethod from './WebhookHttpMethod';
import WebhookSignature from './WebhookSignature';
/**
* @export
* @class WebhookNotification
*/
export class WebhookNotification extends Notification {
/**
* The destination URL where the webhook data is send to (required)
* @type {string}
* @memberof WebhookNotification
*/
public url?: string;
/**
* HTTP method used for the webhook
* @type {WebhookHttpMethod}
* @memberof WebhookNotification
*/
public method?: WebhookHttpMethod;
/**
* Skip verification of the SSL certificate
* @type {boolean}
* @memberof WebhookNotification
*/
public insecureSsl?: boolean;
/**
* Signature used for the webhook
* @type {WebhookSignature}
* @memberof WebhookNotification
*/
public signature?: WebhookSignature;
constructor(obj?: Partial<WebhookNotification>) {
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);
}
}
export default WebhookNotification;