MCPcopy Index your code
hub / github.com/coder/coder / PutNotificationsSettings

Method PutNotificationsSettings

codersdk/notifications.go:60–74  ·  view source on GitHub ↗

PutNotificationsSettings modifies the notifications settings, which currently just controls whether all notifications are paused from sending.

(ctx context.Context, settings NotificationsSettings)

Source from the content-addressed store, hash-verified

58// PutNotificationsSettings modifies the notifications settings, which currently just controls whether all
59// notifications are paused from sending.
60func (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.

Callers 3

pauseNotificationsMethod · 0.80
resumeNotificationsMethod · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 1