github.com/kubearmor/cilium@v1.6.12/api/v1/server/restapi/policy/delete_policy_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package policy 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "net/http" 10 11 "github.com/go-openapi/runtime" 12 13 models "github.com/cilium/cilium/api/v1/models" 14 ) 15 16 // DeletePolicyOKCode is the HTTP code returned for type DeletePolicyOK 17 const DeletePolicyOKCode int = 200 18 19 /*DeletePolicyOK Success 20 21 swagger:response deletePolicyOK 22 */ 23 type DeletePolicyOK struct { 24 25 /* 26 In: Body 27 */ 28 Payload *models.Policy `json:"body,omitempty"` 29 } 30 31 // NewDeletePolicyOK creates DeletePolicyOK with default headers values 32 func NewDeletePolicyOK() *DeletePolicyOK { 33 34 return &DeletePolicyOK{} 35 } 36 37 // WithPayload adds the payload to the delete policy o k response 38 func (o *DeletePolicyOK) WithPayload(payload *models.Policy) *DeletePolicyOK { 39 o.Payload = payload 40 return o 41 } 42 43 // SetPayload sets the payload to the delete policy o k response 44 func (o *DeletePolicyOK) SetPayload(payload *models.Policy) { 45 o.Payload = payload 46 } 47 48 // WriteResponse to the client 49 func (o *DeletePolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 50 51 rw.WriteHeader(200) 52 if o.Payload != nil { 53 payload := o.Payload 54 if err := producer.Produce(rw, payload); err != nil { 55 panic(err) // let the recovery middleware deal with this 56 } 57 } 58 } 59 60 // DeletePolicyInvalidCode is the HTTP code returned for type DeletePolicyInvalid 61 const DeletePolicyInvalidCode int = 400 62 63 /*DeletePolicyInvalid Invalid request 64 65 swagger:response deletePolicyInvalid 66 */ 67 type DeletePolicyInvalid struct { 68 69 /* 70 In: Body 71 */ 72 Payload models.Error `json:"body,omitempty"` 73 } 74 75 // NewDeletePolicyInvalid creates DeletePolicyInvalid with default headers values 76 func NewDeletePolicyInvalid() *DeletePolicyInvalid { 77 78 return &DeletePolicyInvalid{} 79 } 80 81 // WithPayload adds the payload to the delete policy invalid response 82 func (o *DeletePolicyInvalid) WithPayload(payload models.Error) *DeletePolicyInvalid { 83 o.Payload = payload 84 return o 85 } 86 87 // SetPayload sets the payload to the delete policy invalid response 88 func (o *DeletePolicyInvalid) SetPayload(payload models.Error) { 89 o.Payload = payload 90 } 91 92 // WriteResponse to the client 93 func (o *DeletePolicyInvalid) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 94 95 rw.WriteHeader(400) 96 payload := o.Payload 97 if err := producer.Produce(rw, payload); err != nil { 98 panic(err) // let the recovery middleware deal with this 99 } 100 } 101 102 // DeletePolicyNotFoundCode is the HTTP code returned for type DeletePolicyNotFound 103 const DeletePolicyNotFoundCode int = 404 104 105 /*DeletePolicyNotFound Policy not found 106 107 swagger:response deletePolicyNotFound 108 */ 109 type DeletePolicyNotFound struct { 110 } 111 112 // NewDeletePolicyNotFound creates DeletePolicyNotFound with default headers values 113 func NewDeletePolicyNotFound() *DeletePolicyNotFound { 114 115 return &DeletePolicyNotFound{} 116 } 117 118 // WriteResponse to the client 119 func (o *DeletePolicyNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 120 121 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 122 123 rw.WriteHeader(404) 124 } 125 126 // DeletePolicyFailureCode is the HTTP code returned for type DeletePolicyFailure 127 const DeletePolicyFailureCode int = 500 128 129 /*DeletePolicyFailure Error while deleting policy 130 131 swagger:response deletePolicyFailure 132 */ 133 type DeletePolicyFailure struct { 134 135 /* 136 In: Body 137 */ 138 Payload models.Error `json:"body,omitempty"` 139 } 140 141 // NewDeletePolicyFailure creates DeletePolicyFailure with default headers values 142 func NewDeletePolicyFailure() *DeletePolicyFailure { 143 144 return &DeletePolicyFailure{} 145 } 146 147 // WithPayload adds the payload to the delete policy failure response 148 func (o *DeletePolicyFailure) WithPayload(payload models.Error) *DeletePolicyFailure { 149 o.Payload = payload 150 return o 151 } 152 153 // SetPayload sets the payload to the delete policy failure response 154 func (o *DeletePolicyFailure) SetPayload(payload models.Error) { 155 o.Payload = payload 156 } 157 158 // WriteResponse to the client 159 func (o *DeletePolicyFailure) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 160 161 rw.WriteHeader(500) 162 payload := o.Payload 163 if err := producer.Produce(rw, payload); err != nil { 164 panic(err) // let the recovery middleware deal with this 165 } 166 }