github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/endpoint/patch_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 // PatchEndpointIDOKCode is the HTTP code returned for type PatchEndpointIDOK 20 const PatchEndpointIDOKCode int = 200 21 22 /* 23 PatchEndpointIDOK Success 24 25 swagger:response patchEndpointIdOK 26 */ 27 type PatchEndpointIDOK struct { 28 } 29 30 // NewPatchEndpointIDOK creates PatchEndpointIDOK with default headers values 31 func NewPatchEndpointIDOK() *PatchEndpointIDOK { 32 33 return &PatchEndpointIDOK{} 34 } 35 36 // WriteResponse to the client 37 func (o *PatchEndpointIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 38 39 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 40 41 rw.WriteHeader(200) 42 } 43 44 // PatchEndpointIDInvalidCode is the HTTP code returned for type PatchEndpointIDInvalid 45 const PatchEndpointIDInvalidCode int = 400 46 47 /* 48 PatchEndpointIDInvalid Invalid modify endpoint request 49 50 swagger:response patchEndpointIdInvalid 51 */ 52 type PatchEndpointIDInvalid struct { 53 54 /* 55 In: Body 56 */ 57 Payload models.Error `json:"body,omitempty"` 58 } 59 60 // NewPatchEndpointIDInvalid creates PatchEndpointIDInvalid with default headers values 61 func NewPatchEndpointIDInvalid() *PatchEndpointIDInvalid { 62 63 return &PatchEndpointIDInvalid{} 64 } 65 66 // WithPayload adds the payload to the patch endpoint Id invalid response 67 func (o *PatchEndpointIDInvalid) WithPayload(payload models.Error) *PatchEndpointIDInvalid { 68 o.Payload = payload 69 return o 70 } 71 72 // SetPayload sets the payload to the patch endpoint Id invalid response 73 func (o *PatchEndpointIDInvalid) SetPayload(payload models.Error) { 74 o.Payload = payload 75 } 76 77 // WriteResponse to the client 78 func (o *PatchEndpointIDInvalid) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 79 80 rw.WriteHeader(400) 81 payload := o.Payload 82 if err := producer.Produce(rw, payload); err != nil { 83 panic(err) // let the recovery middleware deal with this 84 } 85 } 86 87 // PatchEndpointIDForbiddenCode is the HTTP code returned for type PatchEndpointIDForbidden 88 const PatchEndpointIDForbiddenCode int = 403 89 90 /* 91 PatchEndpointIDForbidden Forbidden 92 93 swagger:response patchEndpointIdForbidden 94 */ 95 type PatchEndpointIDForbidden struct { 96 } 97 98 // NewPatchEndpointIDForbidden creates PatchEndpointIDForbidden with default headers values 99 func NewPatchEndpointIDForbidden() *PatchEndpointIDForbidden { 100 101 return &PatchEndpointIDForbidden{} 102 } 103 104 // WriteResponse to the client 105 func (o *PatchEndpointIDForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 106 107 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 108 109 rw.WriteHeader(403) 110 } 111 112 // PatchEndpointIDNotFoundCode is the HTTP code returned for type PatchEndpointIDNotFound 113 const PatchEndpointIDNotFoundCode int = 404 114 115 /* 116 PatchEndpointIDNotFound Endpoint does not exist 117 118 swagger:response patchEndpointIdNotFound 119 */ 120 type PatchEndpointIDNotFound struct { 121 } 122 123 // NewPatchEndpointIDNotFound creates PatchEndpointIDNotFound with default headers values 124 func NewPatchEndpointIDNotFound() *PatchEndpointIDNotFound { 125 126 return &PatchEndpointIDNotFound{} 127 } 128 129 // WriteResponse to the client 130 func (o *PatchEndpointIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 131 132 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 133 134 rw.WriteHeader(404) 135 } 136 137 // PatchEndpointIDTooManyRequestsCode is the HTTP code returned for type PatchEndpointIDTooManyRequests 138 const PatchEndpointIDTooManyRequestsCode int = 429 139 140 /* 141 PatchEndpointIDTooManyRequests Rate-limiting too many requests in the given time frame 142 143 swagger:response patchEndpointIdTooManyRequests 144 */ 145 type PatchEndpointIDTooManyRequests struct { 146 } 147 148 // NewPatchEndpointIDTooManyRequests creates PatchEndpointIDTooManyRequests with default headers values 149 func NewPatchEndpointIDTooManyRequests() *PatchEndpointIDTooManyRequests { 150 151 return &PatchEndpointIDTooManyRequests{} 152 } 153 154 // WriteResponse to the client 155 func (o *PatchEndpointIDTooManyRequests) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 156 157 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 158 159 rw.WriteHeader(429) 160 } 161 162 // PatchEndpointIDFailedCode is the HTTP code returned for type PatchEndpointIDFailed 163 const PatchEndpointIDFailedCode int = 500 164 165 /* 166 PatchEndpointIDFailed Endpoint update failed 167 168 swagger:response patchEndpointIdFailed 169 */ 170 type PatchEndpointIDFailed struct { 171 172 /* 173 In: Body 174 */ 175 Payload models.Error `json:"body,omitempty"` 176 } 177 178 // NewPatchEndpointIDFailed creates PatchEndpointIDFailed with default headers values 179 func NewPatchEndpointIDFailed() *PatchEndpointIDFailed { 180 181 return &PatchEndpointIDFailed{} 182 } 183 184 // WithPayload adds the payload to the patch endpoint Id failed response 185 func (o *PatchEndpointIDFailed) WithPayload(payload models.Error) *PatchEndpointIDFailed { 186 o.Payload = payload 187 return o 188 } 189 190 // SetPayload sets the payload to the patch endpoint Id failed response 191 func (o *PatchEndpointIDFailed) SetPayload(payload models.Error) { 192 o.Payload = payload 193 } 194 195 // WriteResponse to the client 196 func (o *PatchEndpointIDFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 197 198 rw.WriteHeader(500) 199 payload := o.Payload 200 if err := producer.Produce(rw, payload); err != nil { 201 panic(err) // let the recovery middleware deal with this 202 } 203 }