-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathslack-alert-channel.ts
More file actions
48 lines (44 loc) · 1.14 KB
/
slack-alert-channel.ts
File metadata and controls
48 lines (44 loc) · 1.14 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
import { AlertChannel, AlertChannelProps } from './alert-channel'
import { Session } from './project'
export interface SlackAlertChannelProps extends AlertChannelProps {
url: URL | string
channel?: string
}
/**
* Creates an Slack Alert Channel
*
* @remarks
*
* This class make use of the Alert Channel endpoints.
*/
export class SlackAlertChannel extends AlertChannel {
url: URL | string
channel?: string
/**
* Constructs the Slack Alert Channel instance
*
* @param logicalId unique project-scoped resource name identification
* @param props Slack alert channel configuration properties
*
* {@link https://www.checklyhq.com/docs/constructs/slack-alert-channel/ Read more in the docs}
*/
constructor (logicalId: string, props: SlackAlertChannelProps) {
super(logicalId, props)
this.url = props.url
this.channel = props.channel
Session.registerConstruct(this)
}
describe (): string {
return `SlackAlertChannel:${this.logicalId}`
}
synthesize () {
return {
...super.synthesize(),
type: 'SLACK',
config: {
url: this.url,
channel: this.channel,
},
}
}
}