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

Method notificationDispatchMethods

coderd/notifications.go:176–191  ·  view source on GitHub ↗

@Summary Get notification dispatch methods @ID get-notification-dispatch-methods @Security CoderSessionToken @Produce json @Tags Notifications @Success 200 {array} codersdk.NotificationMethodsResponse @Router /api/v2/notifications/dispatch-methods [get]

(rw http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

174// @Success 200 {array} codersdk.NotificationMethodsResponse
175// @Router /api/v2/notifications/dispatch-methods [get]
176func (api *API) notificationDispatchMethods(rw http.ResponseWriter, r *http.Request) {
177 var methods []string
178 for _, nm := range database.AllNotificationMethodValues() {
179 // Skip inbox method as for now this is an implicit delivery target and should not appear
180 // anywhere in the Web UI.
181 if nm == database.NotificationMethodInbox {
182 continue
183 }
184 methods = append(methods, string(nm))
185 }
186
187 httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.NotificationMethodsResponse{
188 AvailableNotificationMethods: methods,
189 DefaultNotificationMethod: api.DeploymentValues.Notifications.Method.Value(),
190 })
191}
192
193// @Summary Send a test notification
194// @ID send-a-test-notification

Callers

nothing calls this directly

Calls 4

WriteFunction · 0.92
ContextMethod · 0.65
ValueMethod · 0.45

Tested by

no test coverage detected