2016-06-13 09:39:00 -05:00
|
|
|
package models
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/components/simplejson"
|
|
|
|
)
|
|
|
|
|
|
|
|
type AlertNotification struct {
|
2016-09-05 14:33:05 -05:00
|
|
|
Id int64 `json:"id"`
|
|
|
|
OrgId int64 `json:"-"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
IsDefault bool `json:"isDefault"`
|
|
|
|
Settings *simplejson.Json `json:"settings"`
|
|
|
|
Created time.Time `json:"created"`
|
|
|
|
Updated time.Time `json:"updated"`
|
2016-06-13 09:39:00 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type CreateAlertNotificationCommand struct {
|
2016-09-05 14:33:05 -05:00
|
|
|
Name string `json:"name" binding:"Required"`
|
|
|
|
Type string `json:"type" binding:"Required"`
|
|
|
|
IsDefault bool `json:"isDefault"`
|
|
|
|
Settings *simplejson.Json `json:"settings"`
|
2016-06-13 09:39:00 -05:00
|
|
|
|
2016-07-22 09:45:17 -05:00
|
|
|
OrgId int64 `json:"-"`
|
2016-06-13 09:39:00 -05:00
|
|
|
Result *AlertNotification
|
|
|
|
}
|
|
|
|
|
|
|
|
type UpdateAlertNotificationCommand struct {
|
2016-09-05 14:33:05 -05:00
|
|
|
Id int64 `json:"id" binding:"Required"`
|
|
|
|
Name string `json:"name" binding:"Required"`
|
|
|
|
Type string `json:"type" binding:"Required"`
|
|
|
|
IsDefault bool `json:"isDefault"`
|
|
|
|
Settings *simplejson.Json `json:"settings" binding:"Required"`
|
2016-06-13 09:39:00 -05:00
|
|
|
|
2016-07-22 09:45:17 -05:00
|
|
|
OrgId int64 `json:"-"`
|
2016-06-13 09:39:00 -05:00
|
|
|
Result *AlertNotification
|
|
|
|
}
|
|
|
|
|
2016-06-16 08:21:44 -05:00
|
|
|
type DeleteAlertNotificationCommand struct {
|
|
|
|
Id int64
|
|
|
|
OrgId int64
|
|
|
|
}
|
|
|
|
|
2016-07-22 09:45:17 -05:00
|
|
|
type GetAlertNotificationsQuery struct {
|
|
|
|
Name string
|
|
|
|
Id int64
|
|
|
|
Ids []int64
|
|
|
|
OrgId int64
|
2016-06-13 09:39:00 -05:00
|
|
|
|
|
|
|
Result []*AlertNotification
|
|
|
|
}
|