github.com/cilium/cilium@v1.16.2/api/v1/client/ipam/delete_ipam_ip_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 ipam 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 "fmt" 13 "io" 14 15 "github.com/go-openapi/runtime" 16 "github.com/go-openapi/strfmt" 17 18 "github.com/cilium/cilium/api/v1/models" 19 ) 20 21 // DeleteIpamIPReader is a Reader for the DeleteIpamIP structure. 22 type DeleteIpamIPReader struct { 23 formats strfmt.Registry 24 } 25 26 // ReadResponse reads a server response into the received o. 27 func (o *DeleteIpamIPReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 28 switch response.Code() { 29 case 200: 30 result := NewDeleteIpamIPOK() 31 if err := result.readResponse(response, consumer, o.formats); err != nil { 32 return nil, err 33 } 34 return result, nil 35 case 400: 36 result := NewDeleteIpamIPInvalid() 37 if err := result.readResponse(response, consumer, o.formats); err != nil { 38 return nil, err 39 } 40 return nil, result 41 case 403: 42 result := NewDeleteIpamIPForbidden() 43 if err := result.readResponse(response, consumer, o.formats); err != nil { 44 return nil, err 45 } 46 return nil, result 47 case 404: 48 result := NewDeleteIpamIPNotFound() 49 if err := result.readResponse(response, consumer, o.formats); err != nil { 50 return nil, err 51 } 52 return nil, result 53 case 500: 54 result := NewDeleteIpamIPFailure() 55 if err := result.readResponse(response, consumer, o.formats); err != nil { 56 return nil, err 57 } 58 return nil, result 59 case 501: 60 result := NewDeleteIpamIPDisabled() 61 if err := result.readResponse(response, consumer, o.formats); err != nil { 62 return nil, err 63 } 64 return nil, result 65 default: 66 return nil, runtime.NewAPIError("[DELETE /ipam/{ip}] DeleteIpamIP", response, response.Code()) 67 } 68 } 69 70 // NewDeleteIpamIPOK creates a DeleteIpamIPOK with default headers values 71 func NewDeleteIpamIPOK() *DeleteIpamIPOK { 72 return &DeleteIpamIPOK{} 73 } 74 75 /* 76 DeleteIpamIPOK describes a response with status code 200, with default header values. 77 78 Success 79 */ 80 type DeleteIpamIPOK struct { 81 } 82 83 // IsSuccess returns true when this delete ipam Ip o k response has a 2xx status code 84 func (o *DeleteIpamIPOK) IsSuccess() bool { 85 return true 86 } 87 88 // IsRedirect returns true when this delete ipam Ip o k response has a 3xx status code 89 func (o *DeleteIpamIPOK) IsRedirect() bool { 90 return false 91 } 92 93 // IsClientError returns true when this delete ipam Ip o k response has a 4xx status code 94 func (o *DeleteIpamIPOK) IsClientError() bool { 95 return false 96 } 97 98 // IsServerError returns true when this delete ipam Ip o k response has a 5xx status code 99 func (o *DeleteIpamIPOK) IsServerError() bool { 100 return false 101 } 102 103 // IsCode returns true when this delete ipam Ip o k response a status code equal to that given 104 func (o *DeleteIpamIPOK) IsCode(code int) bool { 105 return code == 200 106 } 107 108 // Code gets the status code for the delete ipam Ip o k response 109 func (o *DeleteIpamIPOK) Code() int { 110 return 200 111 } 112 113 func (o *DeleteIpamIPOK) Error() string { 114 return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpOK ", 200) 115 } 116 117 func (o *DeleteIpamIPOK) String() string { 118 return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpOK ", 200) 119 } 120 121 func (o *DeleteIpamIPOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 122 123 return nil 124 } 125 126 // NewDeleteIpamIPInvalid creates a DeleteIpamIPInvalid with default headers values 127 func NewDeleteIpamIPInvalid() *DeleteIpamIPInvalid { 128 return &DeleteIpamIPInvalid{} 129 } 130 131 /* 132 DeleteIpamIPInvalid describes a response with status code 400, with default header values. 133 134 Invalid IP address 135 */ 136 type DeleteIpamIPInvalid struct { 137 } 138 139 // IsSuccess returns true when this delete ipam Ip invalid response has a 2xx status code 140 func (o *DeleteIpamIPInvalid) IsSuccess() bool { 141 return false 142 } 143 144 // IsRedirect returns true when this delete ipam Ip invalid response has a 3xx status code 145 func (o *DeleteIpamIPInvalid) IsRedirect() bool { 146 return false 147 } 148 149 // IsClientError returns true when this delete ipam Ip invalid response has a 4xx status code 150 func (o *DeleteIpamIPInvalid) IsClientError() bool { 151 return true 152 } 153 154 // IsServerError returns true when this delete ipam Ip invalid response has a 5xx status code 155 func (o *DeleteIpamIPInvalid) IsServerError() bool { 156 return false 157 } 158 159 // IsCode returns true when this delete ipam Ip invalid response a status code equal to that given 160 func (o *DeleteIpamIPInvalid) IsCode(code int) bool { 161 return code == 400 162 } 163 164 // Code gets the status code for the delete ipam Ip invalid response 165 func (o *DeleteIpamIPInvalid) Code() int { 166 return 400 167 } 168 169 func (o *DeleteIpamIPInvalid) Error() string { 170 return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpInvalid ", 400) 171 } 172 173 func (o *DeleteIpamIPInvalid) String() string { 174 return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpInvalid ", 400) 175 } 176 177 func (o *DeleteIpamIPInvalid) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 178 179 return nil 180 } 181 182 // NewDeleteIpamIPForbidden creates a DeleteIpamIPForbidden with default headers values 183 func NewDeleteIpamIPForbidden() *DeleteIpamIPForbidden { 184 return &DeleteIpamIPForbidden{} 185 } 186 187 /* 188 DeleteIpamIPForbidden describes a response with status code 403, with default header values. 189 190 Forbidden 191 */ 192 type DeleteIpamIPForbidden struct { 193 } 194 195 // IsSuccess returns true when this delete ipam Ip forbidden response has a 2xx status code 196 func (o *DeleteIpamIPForbidden) IsSuccess() bool { 197 return false 198 } 199 200 // IsRedirect returns true when this delete ipam Ip forbidden response has a 3xx status code 201 func (o *DeleteIpamIPForbidden) IsRedirect() bool { 202 return false 203 } 204 205 // IsClientError returns true when this delete ipam Ip forbidden response has a 4xx status code 206 func (o *DeleteIpamIPForbidden) IsClientError() bool { 207 return true 208 } 209 210 // IsServerError returns true when this delete ipam Ip forbidden response has a 5xx status code 211 func (o *DeleteIpamIPForbidden) IsServerError() bool { 212 return false 213 } 214 215 // IsCode returns true when this delete ipam Ip forbidden response a status code equal to that given 216 func (o *DeleteIpamIPForbidden) IsCode(code int) bool { 217 return code == 403 218 } 219 220 // Code gets the status code for the delete ipam Ip forbidden response 221 func (o *DeleteIpamIPForbidden) Code() int { 222 return 403 223 } 224 225 func (o *DeleteIpamIPForbidden) Error() string { 226 return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpForbidden ", 403) 227 } 228 229 func (o *DeleteIpamIPForbidden) String() string { 230 return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpForbidden ", 403) 231 } 232 233 func (o *DeleteIpamIPForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 234 235 return nil 236 } 237 238 // NewDeleteIpamIPNotFound creates a DeleteIpamIPNotFound with default headers values 239 func NewDeleteIpamIPNotFound() *DeleteIpamIPNotFound { 240 return &DeleteIpamIPNotFound{} 241 } 242 243 /* 244 DeleteIpamIPNotFound describes a response with status code 404, with default header values. 245 246 IP address not found 247 */ 248 type DeleteIpamIPNotFound struct { 249 } 250 251 // IsSuccess returns true when this delete ipam Ip not found response has a 2xx status code 252 func (o *DeleteIpamIPNotFound) IsSuccess() bool { 253 return false 254 } 255 256 // IsRedirect returns true when this delete ipam Ip not found response has a 3xx status code 257 func (o *DeleteIpamIPNotFound) IsRedirect() bool { 258 return false 259 } 260 261 // IsClientError returns true when this delete ipam Ip not found response has a 4xx status code 262 func (o *DeleteIpamIPNotFound) IsClientError() bool { 263 return true 264 } 265 266 // IsServerError returns true when this delete ipam Ip not found response has a 5xx status code 267 func (o *DeleteIpamIPNotFound) IsServerError() bool { 268 return false 269 } 270 271 // IsCode returns true when this delete ipam Ip not found response a status code equal to that given 272 func (o *DeleteIpamIPNotFound) IsCode(code int) bool { 273 return code == 404 274 } 275 276 // Code gets the status code for the delete ipam Ip not found response 277 func (o *DeleteIpamIPNotFound) Code() int { 278 return 404 279 } 280 281 func (o *DeleteIpamIPNotFound) Error() string { 282 return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpNotFound ", 404) 283 } 284 285 func (o *DeleteIpamIPNotFound) String() string { 286 return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpNotFound ", 404) 287 } 288 289 func (o *DeleteIpamIPNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 290 291 return nil 292 } 293 294 // NewDeleteIpamIPFailure creates a DeleteIpamIPFailure with default headers values 295 func NewDeleteIpamIPFailure() *DeleteIpamIPFailure { 296 return &DeleteIpamIPFailure{} 297 } 298 299 /* 300 DeleteIpamIPFailure describes a response with status code 500, with default header values. 301 302 Address release failure 303 */ 304 type DeleteIpamIPFailure struct { 305 Payload models.Error 306 } 307 308 // IsSuccess returns true when this delete ipam Ip failure response has a 2xx status code 309 func (o *DeleteIpamIPFailure) IsSuccess() bool { 310 return false 311 } 312 313 // IsRedirect returns true when this delete ipam Ip failure response has a 3xx status code 314 func (o *DeleteIpamIPFailure) IsRedirect() bool { 315 return false 316 } 317 318 // IsClientError returns true when this delete ipam Ip failure response has a 4xx status code 319 func (o *DeleteIpamIPFailure) IsClientError() bool { 320 return false 321 } 322 323 // IsServerError returns true when this delete ipam Ip failure response has a 5xx status code 324 func (o *DeleteIpamIPFailure) IsServerError() bool { 325 return true 326 } 327 328 // IsCode returns true when this delete ipam Ip failure response a status code equal to that given 329 func (o *DeleteIpamIPFailure) IsCode(code int) bool { 330 return code == 500 331 } 332 333 // Code gets the status code for the delete ipam Ip failure response 334 func (o *DeleteIpamIPFailure) Code() int { 335 return 500 336 } 337 338 func (o *DeleteIpamIPFailure) Error() string { 339 return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpFailure %+v", 500, o.Payload) 340 } 341 342 func (o *DeleteIpamIPFailure) String() string { 343 return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpFailure %+v", 500, o.Payload) 344 } 345 346 func (o *DeleteIpamIPFailure) GetPayload() models.Error { 347 return o.Payload 348 } 349 350 func (o *DeleteIpamIPFailure) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 351 352 // response payload 353 if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { 354 return err 355 } 356 357 return nil 358 } 359 360 // NewDeleteIpamIPDisabled creates a DeleteIpamIPDisabled with default headers values 361 func NewDeleteIpamIPDisabled() *DeleteIpamIPDisabled { 362 return &DeleteIpamIPDisabled{} 363 } 364 365 /* 366 DeleteIpamIPDisabled describes a response with status code 501, with default header values. 367 368 Allocation for address family disabled 369 */ 370 type DeleteIpamIPDisabled struct { 371 } 372 373 // IsSuccess returns true when this delete ipam Ip disabled response has a 2xx status code 374 func (o *DeleteIpamIPDisabled) IsSuccess() bool { 375 return false 376 } 377 378 // IsRedirect returns true when this delete ipam Ip disabled response has a 3xx status code 379 func (o *DeleteIpamIPDisabled) IsRedirect() bool { 380 return false 381 } 382 383 // IsClientError returns true when this delete ipam Ip disabled response has a 4xx status code 384 func (o *DeleteIpamIPDisabled) IsClientError() bool { 385 return false 386 } 387 388 // IsServerError returns true when this delete ipam Ip disabled response has a 5xx status code 389 func (o *DeleteIpamIPDisabled) IsServerError() bool { 390 return true 391 } 392 393 // IsCode returns true when this delete ipam Ip disabled response a status code equal to that given 394 func (o *DeleteIpamIPDisabled) IsCode(code int) bool { 395 return code == 501 396 } 397 398 // Code gets the status code for the delete ipam Ip disabled response 399 func (o *DeleteIpamIPDisabled) Code() int { 400 return 501 401 } 402 403 func (o *DeleteIpamIPDisabled) Error() string { 404 return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpDisabled ", 501) 405 } 406 407 func (o *DeleteIpamIPDisabled) String() string { 408 return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpDisabled ", 501) 409 } 410 411 func (o *DeleteIpamIPDisabled) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 412 413 return nil 414 }