Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit 79d5345

Browse files
committed
Better type constraints for the settings object
1 parent f60b8ce commit 79d5345

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

alerting_contact_point.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import (
88

99
// ContactPoint represents a Grafana Alerting contact point.
1010
type ContactPoint struct {
11-
UID string `json:"uid"`
12-
Name string `json:"name"`
13-
Type string `json:"type"`
14-
Settings interface{} `json:"settings"`
15-
DisableResolveMessage bool `json:"disableResolveMessage"`
16-
Provenance string `json:"provenance"`
11+
UID string `json:"uid"`
12+
Name string `json:"name"`
13+
Type string `json:"type"`
14+
Settings map[string]interface{} `json:"settings"`
15+
DisableResolveMessage bool `json:"disableResolveMessage"`
16+
Provenance string `json:"provenance"`
1717
}
1818

1919
// ContactPoints fetches all contact points.

alerting_contact_point_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func createContactPoint() ContactPoint {
100100
Name: "slack-receiver-123",
101101
Type: "slack",
102102
DisableResolveMessage: false,
103-
Settings: map[string]string{
103+
Settings: map[string]interface{}{
104104
"recipient": "@zxcv",
105105
"token": "test-token",
106106
"url": "https://test-url",

0 commit comments

Comments
 (0)