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