1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-05-08 19:29:17 +08:00
Burak Sekili 3042d6b40b
MF-1489 - Add API for deleting policies (#1491)
* MF-1489 - Add API for deleting policies

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* update request and decoder naming

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* update swagger doc summary for the endpoint

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2021-11-08 14:45:38 +01:00

48 lines
717 B
Go

package policies
import "net/http"
type createPolicyRes struct {
created bool
}
func (res createPolicyRes) Code() int {
if res.created {
return http.StatusCreated
}
return http.StatusOK
}
func (res createPolicyRes) Headers() map[string]string {
return map[string]string{}
}
func (res createPolicyRes) Empty() bool {
return false
}
type deletePoliciesRes struct {
deleted bool
}
func (res deletePoliciesRes) Code() int {
if res.deleted {
return http.StatusNoContent
}
return http.StatusOK
}
func (res deletePoliciesRes) Headers() map[string]string {
return map[string]string{}
}
func (res deletePoliciesRes) Empty() bool {
return false
}
type errorRes struct {
Err string `json:"error"`
}