2017-04-12 08:27:57 -04:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
2019-11-29 06:59:40 -05:00
|
|
|
// See LICENSE.txt for license information.
|
2017-02-28 20:19:19 -05:00
|
|
|
|
|
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
const (
|
2021-07-12 14:05:36 -04:00
|
|
|
PushStatus = "status"
|
|
|
|
|
PushStatusOk = "OK"
|
|
|
|
|
PushStatusFail = "FAIL"
|
|
|
|
|
PushStatusRemove = "REMOVE"
|
|
|
|
|
PushStatusErrorMsg = "error"
|
2017-02-28 20:19:19 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type PushResponse map[string]string
|
|
|
|
|
|
|
|
|
|
func NewOkPushResponse() PushResponse {
|
|
|
|
|
m := make(map[string]string)
|
2021-07-12 14:05:36 -04:00
|
|
|
m[PushStatus] = PushStatusOk
|
2017-02-28 20:19:19 -05:00
|
|
|
return m
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewRemovePushResponse() PushResponse {
|
|
|
|
|
m := make(map[string]string)
|
2021-07-12 14:05:36 -04:00
|
|
|
m[PushStatus] = PushStatusRemove
|
2017-02-28 20:19:19 -05:00
|
|
|
return m
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewErrorPushResponse(message string) PushResponse {
|
|
|
|
|
m := make(map[string]string)
|
2021-07-12 14:05:36 -04:00
|
|
|
m[PushStatus] = PushStatusFail
|
|
|
|
|
m[PushStatusErrorMsg] = message
|
2017-02-28 20:19:19 -05:00
|
|
|
return m
|
|
|
|
|
}
|