Skip to content

Commit bca25ca

Browse files
feat: add notifierId parameter in alert configuration notifications (#516)
1 parent d023c4d commit bca25ca

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

mongodbatlas/alert_configurations.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ type Notification struct {
118118
SMSEnabled *bool `json:"smsEnabled,omitempty"` // Flag indicating if text message notifications should be sent. Populated for ORG, GROUP, and USER notifications types.
119119
TeamID string `json:"teamId,omitempty"` // Unique identifier of a team.
120120
TeamName string `json:"teamName,omitempty"` // Label for the team that receives this notification.
121+
NotifierID string `json:"notifierId,omitempty"` // The notifierId is a system-generated unique identifier assigned to each notification method.
121122
TypeName string `json:"typeName,omitempty"` // Type of alert notification.
122123
Username string `json:"username,omitempty"` // Name of the Atlas user to which to send notifications. Only a user in the project that owns the alert configuration is allowed here. Populated for the USER notifications type.
123124
VictorOpsAPIKey string `json:"victorOpsApiKey,omitempty"` // VictorOps API key. Populated for the VICTOR_OPS notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.

mongodbatlas/alert_configurations_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func TestAlertConfiguration_Create(t *testing.T) {
3636
"notifications": []interface{}{
3737
map[string]interface{}{
3838
"typeName": "GROUP",
39+
"notifierId": "6462742adc47d365036da07c",
3940
"intervalMin": float64(5),
4041
"delayMin": float64(0),
4142
"smsEnabled": false,
@@ -69,6 +70,7 @@ func TestAlertConfiguration_Create(t *testing.T) {
6970
"intervalMin": 5,
7071
"smsEnabled": false,
7172
"typeName": "GROUP",
73+
"notifierId": "6462742adc47d365036da07c",
7274
"roles" : ["GROUP_CHARTS_ADMIN", "GROUP_CLUSTER_MANAGER"]
7375
}
7476
],
@@ -82,6 +84,7 @@ func TestAlertConfiguration_Create(t *testing.T) {
8284
Notifications: []Notification{
8385
{
8486
TypeName: "GROUP",
87+
NotifierID: "6462742adc47d365036da07c",
8588
IntervalMin: 5,
8689
DelayMin: pointer(0),
8790
SMSEnabled: pointer(false),
@@ -111,6 +114,7 @@ func TestAlertConfiguration_Create(t *testing.T) {
111114
IntervalMin: 5,
112115
SMSEnabled: pointer(false),
113116
TypeName: "GROUP",
117+
NotifierID: "6462742adc47d365036da07c",
114118
Roles: []string{"GROUP_CHARTS_ADMIN", "GROUP_CLUSTER_MANAGER"},
115119
},
116120
},
@@ -220,6 +224,7 @@ func TestAlertConfiguration_GetAnAlertConfig(t *testing.T) {
220224
"notifications": [
221225
{
222226
"typeName": "SMS",
227+
"notifierId": "6462742adc47d365036da07c",
223228
"intervalMin": 5,
224229
"delayMin": 0,
225230
"mobileNumber": "2343454567",
@@ -258,6 +263,7 @@ func TestAlertConfiguration_GetAnAlertConfig(t *testing.T) {
258263
Notifications: []Notification{
259264
{
260265
TypeName: "SMS",
266+
NotifierID: "6462742adc47d365036da07c",
261267
IntervalMin: 5,
262268
DelayMin: pointer(0),
263269
MobileNumber: "2343454567",

0 commit comments

Comments
 (0)