github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/endpoint/put_endpoint_id_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 // Copyright Authors of Cilium 4 // SPDX-License-Identifier: Apache-2.0 5 6 package endpoint 7 8 // This file was generated by the swagger tool. 9 // Editing this file might prove futile when you re-run the swagger generate command 10 11 import ( 12 "net/http" 13 14 "github.com/go-openapi/runtime" 15 16 "github.com/cilium/cilium/api/v1/models" 17 ) 18 19 // PutEndpointIDCreatedCode is the HTTP code returned for type PutEndpointIDCreated 20 const PutEndpointIDCreatedCode int = 201 21 22 /* 23 PutEndpointIDCreated Created 24 25 swagger:response putEndpointIdCreated 26 */ 27 type PutEndpointIDCreated struct { 28 29 /* 30 In: Body 31 */ 32 Payload *models.Endpoint `json:"body,omitempty"` 33 } 34 35 // NewPutEndpointIDCreated creates PutEndpointIDCreated with default headers values 36 func NewPutEndpointIDCreated() *PutEndpointIDCreated { 37 38 return &PutEndpointIDCreated{} 39 } 40 41 // WithPayload adds the payload to the put endpoint Id created response 42 func (o *PutEndpointIDCreated) WithPayload(payload *models.Endpoint) *PutEndpointIDCreated { 43 o.Payload = payload 44 return o 45 } 46 47 // SetPayload sets the payload to the put endpoint Id created response 48 func (o *PutEndpointIDCreated) SetPayload(payload *models.Endpoint) { 49 o.Payload = payload 50 } 51 52 // WriteResponse to the client 53 func (o *PutEndpointIDCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 54 55 rw.WriteHeader(201) 56 if o.Payload != nil { 57 payload := o.Payload 58 if err := producer.Produce(rw, payload); err != nil { 59 panic(err) // let the recovery middleware deal with this 60 } 61 } 62 } 63 64 // PutEndpointIDInvalidCode is the HTTP code returned for type PutEndpointIDInvalid 65 const PutEndpointIDInvalidCode int = 400 66 67 /* 68 PutEndpointIDInvalid Invalid endpoint in request 69 70 swagger:response putEndpointIdInvalid 71 */ 72 type PutEndpointIDInvalid struct { 73 74 /* 75 In: Body 76 */ 77 Payload models.Error `json:"body,omitempty"` 78 } 79 80 // NewPutEndpointIDInvalid creates PutEndpointIDInvalid with default headers values 81 func NewPutEndpointIDInvalid() *PutEndpointIDInvalid { 82 83 return &PutEndpointIDInvalid{} 84 } 85 86 // WithPayload adds the payload to the put endpoint Id invalid response 87 func (o *PutEndpointIDInvalid) WithPayload(payload models.Error) *PutEndpointIDInvalid { 88 o.Payload = payload 89 return o 90 } 91 92 // SetPayload sets the payload to the put endpoint Id invalid response 93 func (o *PutEndpointIDInvalid) SetPayload(payload models.Error) { 94 o.Payload = payload 95 } 96 97 // WriteResponse to the client 98 func (o *PutEndpointIDInvalid) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 99 100 rw.WriteHeader(400) 101 payload := o.Payload 102 if err := producer.Produce(rw, payload); err != nil { 103 panic(err) // let the recovery middleware deal with this 104 } 105 } 106 107 // PutEndpointIDForbiddenCode is the HTTP code returned for type PutEndpointIDForbidden 108 const PutEndpointIDForbiddenCode int = 403 109 110 /* 111 PutEndpointIDForbidden Forbidden 112 113 swagger:response putEndpointIdForbidden 114 */ 115 type PutEndpointIDForbidden struct { 116 } 117 118 // NewPutEndpointIDForbidden creates PutEndpointIDForbidden with default headers values 119 func NewPutEndpointIDForbidden() *PutEndpointIDForbidden { 120 121 return &PutEndpointIDForbidden{} 122 } 123 124 // WriteResponse to the client 125 func (o *PutEndpointIDForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 126 127 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 128 129 rw.WriteHeader(403) 130 } 131 132 // PutEndpointIDExistsCode is the HTTP code returned for type PutEndpointIDExists 133 const PutEndpointIDExistsCode int = 409 134 135 /* 136 PutEndpointIDExists Endpoint already exists 137 138 swagger:response putEndpointIdExists 139 */ 140 type PutEndpointIDExists struct { 141 } 142 143 // NewPutEndpointIDExists creates PutEndpointIDExists with default headers values 144 func NewPutEndpointIDExists() *PutEndpointIDExists { 145 146 return &PutEndpointIDExists{} 147 } 148 149 // WriteResponse to the client 150 func (o *PutEndpointIDExists) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 151 152 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 153 154 rw.WriteHeader(409) 155 } 156 157 // PutEndpointIDTooManyRequestsCode is the HTTP code returned for type PutEndpointIDTooManyRequests 158 const PutEndpointIDTooManyRequestsCode int = 429 159 160 /* 161 PutEndpointIDTooManyRequests Rate-limiting too many requests in the given time frame 162 163 swagger:response putEndpointIdTooManyRequests 164 */ 165 type PutEndpointIDTooManyRequests struct { 166 } 167 168 // NewPutEndpointIDTooManyRequests creates PutEndpointIDTooManyRequests with default headers values 169 func NewPutEndpointIDTooManyRequests() *PutEndpointIDTooManyRequests { 170 171 return &PutEndpointIDTooManyRequests{} 172 } 173 174 // WriteResponse to the client 175 func (o *PutEndpointIDTooManyRequests) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 176 177 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 178 179 rw.WriteHeader(429) 180 } 181 182 // PutEndpointIDFailedCode is the HTTP code returned for type PutEndpointIDFailed 183 const PutEndpointIDFailedCode int = 500 184 185 /* 186 PutEndpointIDFailed Endpoint creation failed 187 188 swagger:response putEndpointIdFailed 189 */ 190 type PutEndpointIDFailed struct { 191 192 /* 193 In: Body 194 */ 195 Payload models.Error `json:"body,omitempty"` 196 } 197 198 // NewPutEndpointIDFailed creates PutEndpointIDFailed with default headers values 199 func NewPutEndpointIDFailed() *PutEndpointIDFailed { 200 201 return &PutEndpointIDFailed{} 202 } 203 204 // WithPayload adds the payload to the put endpoint Id failed response 205 func (o *PutEndpointIDFailed) WithPayload(payload models.Error) *PutEndpointIDFailed { 206 o.Payload = payload 207 return o 208 } 209 210 // SetPayload sets the payload to the put endpoint Id failed response 211 func (o *PutEndpointIDFailed) SetPayload(payload models.Error) { 212 o.Payload = payload 213 } 214 215 // WriteResponse to the client 216 func (o *PutEndpointIDFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 217 218 rw.WriteHeader(500) 219 payload := o.Payload 220 if err := producer.Produce(rw, payload); err != nil { 221 panic(err) // let the recovery middleware deal with this 222 } 223 }