alert_notifications.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. IsDefault bool `json:"isDefault"`
  12. Settings *simplejson.Json `json:"settings"`
  13. Created time.Time `json:"created"`
  14. Updated time.Time `json:"updated"`
  15. }
  16. type CreateAlertNotificationCommand struct {
  17. Name string `json:"name" binding:"Required"`
  18. Type string `json:"type" binding:"Required"`
  19. IsDefault bool `json:"isDefault"`
  20. Settings *simplejson.Json `json:"settings"`
  21. OrgId int64 `json:"-"`
  22. Result *AlertNotification
  23. }
  24. type UpdateAlertNotificationCommand struct {
  25. Id int64 `json:"id" binding:"Required"`
  26. Name string `json:"name" binding:"Required"`
  27. Type string `json:"type" binding:"Required"`
  28. IsDefault bool `json:"isDefault"`
  29. Settings *simplejson.Json `json:"settings" binding:"Required"`
  30. OrgId int64 `json:"-"`
  31. Result *AlertNotification
  32. }
  33. type DeleteAlertNotificationCommand struct {
  34. Id int64
  35. OrgId int64
  36. }
  37. type GetAlertNotificationsQuery struct {
  38. Name string
  39. Id int64
  40. OrgId int64
  41. Result *AlertNotification
  42. }
  43. type GetAlertNotificationsToSendQuery struct {
  44. Ids []int64
  45. OrgId int64
  46. Result []*AlertNotification
  47. }
  48. type GetAllAlertNotificationsQuery struct {
  49. OrgId int64
  50. Result []*AlertNotification
  51. }