| package router |
|
|
| import ( |
| "net/http" |
|
|
| "github.com/openmeterio/openmeter/api" |
| ) |
|
|
| |
| |
| func (a *Router) ListNotificationChannels(w http.ResponseWriter, r *http.Request, params api.ListNotificationChannelsParams) { |
| a.notificationHandler.ListChannels().With(params).ServeHTTP(w, r) |
| } |
|
|
| |
| |
| func (a *Router) CreateNotificationChannel(w http.ResponseWriter, r *http.Request) { |
| a.notificationHandler.CreateChannel().ServeHTTP(w, r) |
| } |
|
|
| |
| |
| func (a *Router) DeleteNotificationChannel(w http.ResponseWriter, r *http.Request, channelID string) { |
| a.notificationHandler.DeleteChannel().With(channelID).ServeHTTP(w, r) |
| } |
|
|
| |
| |
| func (a *Router) GetNotificationChannel(w http.ResponseWriter, r *http.Request, channelID string) { |
| a.notificationHandler.GetChannel().With(channelID).ServeHTTP(w, r) |
| } |
|
|
| |
| |
| func (a *Router) UpdateNotificationChannel(w http.ResponseWriter, r *http.Request, channelID string) { |
| a.notificationHandler.UpdateChannel().With(channelID).ServeHTTP(w, r) |
| } |
|
|
| |
| |
| func (a *Router) ListNotificationEvents(w http.ResponseWriter, r *http.Request, params api.ListNotificationEventsParams) { |
| a.notificationHandler.ListEvents().With(params).ServeHTTP(w, r) |
| } |
|
|
| |
| |
| func (a *Router) GetNotificationEvent(w http.ResponseWriter, r *http.Request, eventID string) { |
| a.notificationHandler.GetEvent().With(eventID).ServeHTTP(w, r) |
| } |
|
|
| |
| |
| func (a *Router) ResendNotificationEvent(w http.ResponseWriter, r *http.Request, eventID string) { |
| a.notificationHandler.ResendEvent().With(eventID).ServeHTTP(w, r) |
| } |
|
|
| |
| |
| func (a *Router) ListNotificationRules(w http.ResponseWriter, r *http.Request, params api.ListNotificationRulesParams) { |
| a.notificationHandler.ListRules().With(params).ServeHTTP(w, r) |
| } |
|
|
| |
| |
| func (a *Router) CreateNotificationRule(w http.ResponseWriter, r *http.Request) { |
| a.notificationHandler.CreateRule().ServeHTTP(w, r) |
| } |
|
|
| |
| |
| func (a *Router) DeleteNotificationRule(w http.ResponseWriter, r *http.Request, ruleID string) { |
| a.notificationHandler.DeleteRule().With(ruleID).ServeHTTP(w, r) |
| } |
|
|
| |
| |
| func (a *Router) GetNotificationRule(w http.ResponseWriter, r *http.Request, ruleID string) { |
| a.notificationHandler.GetRule().With(ruleID).ServeHTTP(w, r) |
| } |
|
|
| |
| |
| func (a *Router) UpdateNotificationRule(w http.ResponseWriter, r *http.Request, ruleID string) { |
| a.notificationHandler.UpdateRule().With(ruleID).ServeHTTP(w, r) |
| } |
|
|
| |
| |
| func (a *Router) TestNotificationRule(w http.ResponseWriter, r *http.Request, ruleID string) { |
| a.notificationHandler.TestRule().With(ruleID).ServeHTTP(w, r) |
| } |
|
|