PutNotificationsSettings modifies the notifications settings, which currently just controls whether all notifications are paused from sending.
(ctx context.Context, settings NotificationsSettings)
| 58 | // PutNotificationsSettings modifies the notifications settings, which currently just controls whether all |
| 59 | // notifications are paused from sending. |
| 60 | func (c *Client) PutNotificationsSettings(ctx context.Context, settings NotificationsSettings) error { |
| 61 | res, err := c.Request(ctx, http.MethodPut, "/api/v2/notifications/settings", settings) |
| 62 | if err != nil { |
| 63 | return err |
| 64 | } |
| 65 | defer res.Body.Close() |
| 66 | |
| 67 | if res.StatusCode == http.StatusNotModified { |
| 68 | return nil |
| 69 | } |
| 70 | if res.StatusCode != http.StatusOK { |
| 71 | return ReadBodyAsError(res) |
| 72 | } |
| 73 | return nil |
| 74 | } |
| 75 | |
| 76 | // UpdateNotificationTemplateMethod modifies a notification template to use a specific notification method, overriding |
| 77 | // the method set in the deployment configuration. |