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

Commit 9f89d2e

Browse files
committed
Policy -> PolicyTree
1 parent 9b46930 commit 9f89d2e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

alerting_notification_policy.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,21 @@ func (m Matchers) MarshalJSON() ([]byte, error) {
104104
}
105105

106106
// NotificationPolicy fetches the notification policy tree.
107-
func (c *Client) NotificationPolicy() (NotificationPolicy, error) {
107+
func (c *Client) NotificationPolicyTree() (NotificationPolicy, error) {
108108
np := NotificationPolicy{}
109109
err := c.request("GET", "/api/v1/provisioning/policies", nil, nil, &np)
110110
return np, err
111111
}
112112

113113
// SetNotificationPolicy sets the notification policy tree.
114-
func (c *Client) SetNotificationPolicy(np *NotificationPolicy) error {
114+
func (c *Client) SetNotificationPolicyTree(np *NotificationPolicy) error {
115115
req, err := json.Marshal(np)
116116
if err != nil {
117117
return err
118118
}
119119
return c.request("PUT", "/api/v1/provisioning/policies", nil, bytes.NewBuffer(req), nil)
120120
}
121121

122-
func (c *Client) ResetNotificationPolicy() error {
122+
func (c *Client) ResetNotificationPolicyTree() error {
123123
return c.request("DELETE", "/api/v1/provisioning/policies", nil, nil, nil)
124124
}

alerting_notification_policy_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func TestNotificationPolicies(t *testing.T) {
1111
server, client := gapiTestTools(t, 200, notificationPolicyJSON)
1212
defer server.Close()
1313

14-
np, err := client.NotificationPolicy()
14+
np, err := client.NotificationPolicyTree()
1515

1616
if err != nil {
1717
t.Error(err)
@@ -30,7 +30,7 @@ func TestNotificationPolicies(t *testing.T) {
3030
defer server.Close()
3131
np := createNotificationPolicy()
3232

33-
err := client.SetNotificationPolicy(&np)
33+
err := client.SetNotificationPolicyTree(&np)
3434

3535
if err != nil {
3636
t.Error(err)
@@ -41,7 +41,7 @@ func TestNotificationPolicies(t *testing.T) {
4141
server, client := gapiTestTools(t, 200, notificationPolicyJSON)
4242
defer server.Close()
4343

44-
err := client.ResetNotificationPolicy()
44+
err := client.ResetNotificationPolicyTree()
4545

4646
if err != nil {
4747
t.Error(err)

0 commit comments

Comments
 (0)