mirror of
https://github.com/absmach/supermq.git
synced 2026-06-23 04:20:17 +00:00
7066101996
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
47 lines
731 B
Go
47 lines
731 B
Go
// Copyright (c) Magistrala
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
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 true
|
|
}
|