-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathphone-call-alert-channel.ts
More file actions
56 lines (52 loc) · 1.45 KB
/
phone-call-alert-channel.ts
File metadata and controls
56 lines (52 loc) · 1.45 KB
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
import { AlertChannel, AlertChannelProps } from './alert-channel'
import { Session } from './project'
export interface PhoneCallAlertChannelProps extends AlertChannelProps {
/**
* The phone number where to send the alert notifications.
*/
phoneNumber: string
/**
* The name of the alert channel.
*/
name?: string
}
/**
* Creates a Phone Call Alert Channel
*
* @remarks
*
* This class make use of the Alert Channel endpoints.
*/
export class PhoneCallAlertChannel extends AlertChannel {
phoneNumber: string
name?: string
/**
* Constructs the Phone Call Alert Channel instance
*
* @param logicalId unique project-scoped resource name identification
* @param props Phone Call alert channel configuration properties
*
* {@link https://www.checklyhq.com/docs/constructs/phone-call-alert-channel/ Read more in the docs}
* {@link https://www.checklyhq.com/docs/integrations/alerts/phone-calls/#supported-countries-and-regions
* List of supported countries}
*/
constructor (logicalId: string, props: PhoneCallAlertChannelProps) {
super(logicalId, props)
this.phoneNumber = props.phoneNumber
this.name = props.name
Session.registerConstruct(this)
}
describe (): string {
return `PhoneCallAlertChannel:${this.logicalId}`
}
synthesize () {
return {
...super.synthesize(),
type: 'CALL',
config: {
number: this.phoneNumber,
name: this.name,
},
}
}
}