2021-10-27 00:38:28 +02:00
|
|
|
package policies
|
|
|
|
|
|
|
|
import "net/http"
|
|
|
|
|
2021-11-08 16:45:38 +03:00
|
|
|
type createPolicyRes struct {
|
2021-10-27 00:38:28 +02:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2021-11-08 16:45:38 +03:00
|
|
|
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 {
|
2022-02-12 19:07:48 +01:00
|
|
|
return true
|
2021-11-08 16:45:38 +03:00
|
|
|
}
|