alert_notifications.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package models
  2. import (
  3. "time"
  4. "github.com/grafana/grafana/pkg/components/simplejson"
  5. )
  6. type AlertNotification struct {
  7. Id int64 `json:"id"`
  8. OrgId int64 `json:"-"`
  9. Name string `json:"name"`
  10. Type string `json:"type"`
  11. Settings *simplejson.Json `json:"settings"`
  12. Created time.Time `json:"created"`
  13. Updated time.Time `json:"updated"`
  14. }
  15. type CreateAlertNotificationCommand struct {
  16. Name string `json:"name" binding:"Required"`
  17. Type string `json:"type" binding:"Required"`
  18. Settings *simplejson.Json `json:"settings"`
  19. OrgId int64 `json:"-"`
  20. Result *AlertNotification
  21. }
  22. type UpdateAlertNotificationCommand struct {
  23. Id int64 `json:"id" binding:"Required"`
  24. Name string `json:"name" binding:"Required"`
  25. Type string `json:"type" binding:"Required"`
  26. Settings *simplejson.Json `json:"settings" binding:"Required"`
  27. OrgId int64 `json:"-"`
  28. Result *AlertNotification
  29. }
  30. type DeleteAlertNotificationCommand struct {
  31. Id int64
  32. OrgId int64
  33. }
  34. type GetAlertNotificationsQuery struct {
  35. Name string
  36. Id int64
  37. Ids []int64
  38. OrgId int64
  39. Result []*AlertNotification
  40. }