github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/robotv1/delete_robot_v1_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package robotv1 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 "fmt" 10 "io" 11 12 "github.com/go-openapi/runtime" 13 "github.com/go-openapi/strfmt" 14 15 "github.com/goharbor/go-client/pkg/sdk/v2.0/models" 16 ) 17 18 // DeleteRobotV1Reader is a Reader for the DeleteRobotV1 structure. 19 type DeleteRobotV1Reader struct { 20 formats strfmt.Registry 21 } 22 23 // ReadResponse reads a server response into the received o. 24 func (o *DeleteRobotV1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 switch response.Code() { 26 case 200: 27 result := NewDeleteRobotV1OK() 28 if err := result.readResponse(response, consumer, o.formats); err != nil { 29 return nil, err 30 } 31 return result, nil 32 case 400: 33 result := NewDeleteRobotV1BadRequest() 34 if err := result.readResponse(response, consumer, o.formats); err != nil { 35 return nil, err 36 } 37 return nil, result 38 case 401: 39 result := NewDeleteRobotV1Unauthorized() 40 if err := result.readResponse(response, consumer, o.formats); err != nil { 41 return nil, err 42 } 43 return nil, result 44 case 403: 45 result := NewDeleteRobotV1Forbidden() 46 if err := result.readResponse(response, consumer, o.formats); err != nil { 47 return nil, err 48 } 49 return nil, result 50 case 404: 51 result := NewDeleteRobotV1NotFound() 52 if err := result.readResponse(response, consumer, o.formats); err != nil { 53 return nil, err 54 } 55 return nil, result 56 case 500: 57 result := NewDeleteRobotV1InternalServerError() 58 if err := result.readResponse(response, consumer, o.formats); err != nil { 59 return nil, err 60 } 61 return nil, result 62 default: 63 return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 64 } 65 } 66 67 // NewDeleteRobotV1OK creates a DeleteRobotV1OK with default headers values 68 func NewDeleteRobotV1OK() *DeleteRobotV1OK { 69 return &DeleteRobotV1OK{} 70 } 71 72 /* 73 DeleteRobotV1OK describes a response with status code 200, with default header values. 74 75 Success 76 */ 77 type DeleteRobotV1OK struct { 78 79 /* The ID of the corresponding request for the response 80 */ 81 XRequestID string 82 } 83 84 // IsSuccess returns true when this delete robot v1 o k response has a 2xx status code 85 func (o *DeleteRobotV1OK) IsSuccess() bool { 86 return true 87 } 88 89 // IsRedirect returns true when this delete robot v1 o k response has a 3xx status code 90 func (o *DeleteRobotV1OK) IsRedirect() bool { 91 return false 92 } 93 94 // IsClientError returns true when this delete robot v1 o k response has a 4xx status code 95 func (o *DeleteRobotV1OK) IsClientError() bool { 96 return false 97 } 98 99 // IsServerError returns true when this delete robot v1 o k response has a 5xx status code 100 func (o *DeleteRobotV1OK) IsServerError() bool { 101 return false 102 } 103 104 // IsCode returns true when this delete robot v1 o k response a status code equal to that given 105 func (o *DeleteRobotV1OK) IsCode(code int) bool { 106 return code == 200 107 } 108 109 func (o *DeleteRobotV1OK) Error() string { 110 return fmt.Sprintf("[DELETE /projects/{project_name_or_id}/robots/{robot_id}][%d] deleteRobotV1OK ", 200) 111 } 112 113 func (o *DeleteRobotV1OK) String() string { 114 return fmt.Sprintf("[DELETE /projects/{project_name_or_id}/robots/{robot_id}][%d] deleteRobotV1OK ", 200) 115 } 116 117 func (o *DeleteRobotV1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 118 119 // hydrates response header X-Request-Id 120 hdrXRequestID := response.GetHeader("X-Request-Id") 121 122 if hdrXRequestID != "" { 123 o.XRequestID = hdrXRequestID 124 } 125 126 return nil 127 } 128 129 // NewDeleteRobotV1BadRequest creates a DeleteRobotV1BadRequest with default headers values 130 func NewDeleteRobotV1BadRequest() *DeleteRobotV1BadRequest { 131 return &DeleteRobotV1BadRequest{} 132 } 133 134 /* 135 DeleteRobotV1BadRequest describes a response with status code 400, with default header values. 136 137 Bad request 138 */ 139 type DeleteRobotV1BadRequest struct { 140 141 /* The ID of the corresponding request for the response 142 */ 143 XRequestID string 144 145 Payload *models.Errors 146 } 147 148 // IsSuccess returns true when this delete robot v1 bad request response has a 2xx status code 149 func (o *DeleteRobotV1BadRequest) IsSuccess() bool { 150 return false 151 } 152 153 // IsRedirect returns true when this delete robot v1 bad request response has a 3xx status code 154 func (o *DeleteRobotV1BadRequest) IsRedirect() bool { 155 return false 156 } 157 158 // IsClientError returns true when this delete robot v1 bad request response has a 4xx status code 159 func (o *DeleteRobotV1BadRequest) IsClientError() bool { 160 return true 161 } 162 163 // IsServerError returns true when this delete robot v1 bad request response has a 5xx status code 164 func (o *DeleteRobotV1BadRequest) IsServerError() bool { 165 return false 166 } 167 168 // IsCode returns true when this delete robot v1 bad request response a status code equal to that given 169 func (o *DeleteRobotV1BadRequest) IsCode(code int) bool { 170 return code == 400 171 } 172 173 func (o *DeleteRobotV1BadRequest) Error() string { 174 return fmt.Sprintf("[DELETE /projects/{project_name_or_id}/robots/{robot_id}][%d] deleteRobotV1BadRequest %+v", 400, o.Payload) 175 } 176 177 func (o *DeleteRobotV1BadRequest) String() string { 178 return fmt.Sprintf("[DELETE /projects/{project_name_or_id}/robots/{robot_id}][%d] deleteRobotV1BadRequest %+v", 400, o.Payload) 179 } 180 181 func (o *DeleteRobotV1BadRequest) GetPayload() *models.Errors { 182 return o.Payload 183 } 184 185 func (o *DeleteRobotV1BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 186 187 // hydrates response header X-Request-Id 188 hdrXRequestID := response.GetHeader("X-Request-Id") 189 190 if hdrXRequestID != "" { 191 o.XRequestID = hdrXRequestID 192 } 193 194 o.Payload = new(models.Errors) 195 196 // response payload 197 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 198 return err 199 } 200 201 return nil 202 } 203 204 // NewDeleteRobotV1Unauthorized creates a DeleteRobotV1Unauthorized with default headers values 205 func NewDeleteRobotV1Unauthorized() *DeleteRobotV1Unauthorized { 206 return &DeleteRobotV1Unauthorized{} 207 } 208 209 /* 210 DeleteRobotV1Unauthorized describes a response with status code 401, with default header values. 211 212 Unauthorized 213 */ 214 type DeleteRobotV1Unauthorized struct { 215 216 /* The ID of the corresponding request for the response 217 */ 218 XRequestID string 219 220 Payload *models.Errors 221 } 222 223 // IsSuccess returns true when this delete robot v1 unauthorized response has a 2xx status code 224 func (o *DeleteRobotV1Unauthorized) IsSuccess() bool { 225 return false 226 } 227 228 // IsRedirect returns true when this delete robot v1 unauthorized response has a 3xx status code 229 func (o *DeleteRobotV1Unauthorized) IsRedirect() bool { 230 return false 231 } 232 233 // IsClientError returns true when this delete robot v1 unauthorized response has a 4xx status code 234 func (o *DeleteRobotV1Unauthorized) IsClientError() bool { 235 return true 236 } 237 238 // IsServerError returns true when this delete robot v1 unauthorized response has a 5xx status code 239 func (o *DeleteRobotV1Unauthorized) IsServerError() bool { 240 return false 241 } 242 243 // IsCode returns true when this delete robot v1 unauthorized response a status code equal to that given 244 func (o *DeleteRobotV1Unauthorized) IsCode(code int) bool { 245 return code == 401 246 } 247 248 func (o *DeleteRobotV1Unauthorized) Error() string { 249 return fmt.Sprintf("[DELETE /projects/{project_name_or_id}/robots/{robot_id}][%d] deleteRobotV1Unauthorized %+v", 401, o.Payload) 250 } 251 252 func (o *DeleteRobotV1Unauthorized) String() string { 253 return fmt.Sprintf("[DELETE /projects/{project_name_or_id}/robots/{robot_id}][%d] deleteRobotV1Unauthorized %+v", 401, o.Payload) 254 } 255 256 func (o *DeleteRobotV1Unauthorized) GetPayload() *models.Errors { 257 return o.Payload 258 } 259 260 func (o *DeleteRobotV1Unauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 261 262 // hydrates response header X-Request-Id 263 hdrXRequestID := response.GetHeader("X-Request-Id") 264 265 if hdrXRequestID != "" { 266 o.XRequestID = hdrXRequestID 267 } 268 269 o.Payload = new(models.Errors) 270 271 // response payload 272 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 273 return err 274 } 275 276 return nil 277 } 278 279 // NewDeleteRobotV1Forbidden creates a DeleteRobotV1Forbidden with default headers values 280 func NewDeleteRobotV1Forbidden() *DeleteRobotV1Forbidden { 281 return &DeleteRobotV1Forbidden{} 282 } 283 284 /* 285 DeleteRobotV1Forbidden describes a response with status code 403, with default header values. 286 287 Forbidden 288 */ 289 type DeleteRobotV1Forbidden struct { 290 291 /* The ID of the corresponding request for the response 292 */ 293 XRequestID string 294 295 Payload *models.Errors 296 } 297 298 // IsSuccess returns true when this delete robot v1 forbidden response has a 2xx status code 299 func (o *DeleteRobotV1Forbidden) IsSuccess() bool { 300 return false 301 } 302 303 // IsRedirect returns true when this delete robot v1 forbidden response has a 3xx status code 304 func (o *DeleteRobotV1Forbidden) IsRedirect() bool { 305 return false 306 } 307 308 // IsClientError returns true when this delete robot v1 forbidden response has a 4xx status code 309 func (o *DeleteRobotV1Forbidden) IsClientError() bool { 310 return true 311 } 312 313 // IsServerError returns true when this delete robot v1 forbidden response has a 5xx status code 314 func (o *DeleteRobotV1Forbidden) IsServerError() bool { 315 return false 316 } 317 318 // IsCode returns true when this delete robot v1 forbidden response a status code equal to that given 319 func (o *DeleteRobotV1Forbidden) IsCode(code int) bool { 320 return code == 403 321 } 322 323 func (o *DeleteRobotV1Forbidden) Error() string { 324 return fmt.Sprintf("[DELETE /projects/{project_name_or_id}/robots/{robot_id}][%d] deleteRobotV1Forbidden %+v", 403, o.Payload) 325 } 326 327 func (o *DeleteRobotV1Forbidden) String() string { 328 return fmt.Sprintf("[DELETE /projects/{project_name_or_id}/robots/{robot_id}][%d] deleteRobotV1Forbidden %+v", 403, o.Payload) 329 } 330 331 func (o *DeleteRobotV1Forbidden) GetPayload() *models.Errors { 332 return o.Payload 333 } 334 335 func (o *DeleteRobotV1Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 336 337 // hydrates response header X-Request-Id 338 hdrXRequestID := response.GetHeader("X-Request-Id") 339 340 if hdrXRequestID != "" { 341 o.XRequestID = hdrXRequestID 342 } 343 344 o.Payload = new(models.Errors) 345 346 // response payload 347 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 348 return err 349 } 350 351 return nil 352 } 353 354 // NewDeleteRobotV1NotFound creates a DeleteRobotV1NotFound with default headers values 355 func NewDeleteRobotV1NotFound() *DeleteRobotV1NotFound { 356 return &DeleteRobotV1NotFound{} 357 } 358 359 /* 360 DeleteRobotV1NotFound describes a response with status code 404, with default header values. 361 362 Not found 363 */ 364 type DeleteRobotV1NotFound struct { 365 366 /* The ID of the corresponding request for the response 367 */ 368 XRequestID string 369 370 Payload *models.Errors 371 } 372 373 // IsSuccess returns true when this delete robot v1 not found response has a 2xx status code 374 func (o *DeleteRobotV1NotFound) IsSuccess() bool { 375 return false 376 } 377 378 // IsRedirect returns true when this delete robot v1 not found response has a 3xx status code 379 func (o *DeleteRobotV1NotFound) IsRedirect() bool { 380 return false 381 } 382 383 // IsClientError returns true when this delete robot v1 not found response has a 4xx status code 384 func (o *DeleteRobotV1NotFound) IsClientError() bool { 385 return true 386 } 387 388 // IsServerError returns true when this delete robot v1 not found response has a 5xx status code 389 func (o *DeleteRobotV1NotFound) IsServerError() bool { 390 return false 391 } 392 393 // IsCode returns true when this delete robot v1 not found response a status code equal to that given 394 func (o *DeleteRobotV1NotFound) IsCode(code int) bool { 395 return code == 404 396 } 397 398 func (o *DeleteRobotV1NotFound) Error() string { 399 return fmt.Sprintf("[DELETE /projects/{project_name_or_id}/robots/{robot_id}][%d] deleteRobotV1NotFound %+v", 404, o.Payload) 400 } 401 402 func (o *DeleteRobotV1NotFound) String() string { 403 return fmt.Sprintf("[DELETE /projects/{project_name_or_id}/robots/{robot_id}][%d] deleteRobotV1NotFound %+v", 404, o.Payload) 404 } 405 406 func (o *DeleteRobotV1NotFound) GetPayload() *models.Errors { 407 return o.Payload 408 } 409 410 func (o *DeleteRobotV1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 411 412 // hydrates response header X-Request-Id 413 hdrXRequestID := response.GetHeader("X-Request-Id") 414 415 if hdrXRequestID != "" { 416 o.XRequestID = hdrXRequestID 417 } 418 419 o.Payload = new(models.Errors) 420 421 // response payload 422 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 423 return err 424 } 425 426 return nil 427 } 428 429 // NewDeleteRobotV1InternalServerError creates a DeleteRobotV1InternalServerError with default headers values 430 func NewDeleteRobotV1InternalServerError() *DeleteRobotV1InternalServerError { 431 return &DeleteRobotV1InternalServerError{} 432 } 433 434 /* 435 DeleteRobotV1InternalServerError describes a response with status code 500, with default header values. 436 437 Internal server error 438 */ 439 type DeleteRobotV1InternalServerError struct { 440 441 /* The ID of the corresponding request for the response 442 */ 443 XRequestID string 444 445 Payload *models.Errors 446 } 447 448 // IsSuccess returns true when this delete robot v1 internal server error response has a 2xx status code 449 func (o *DeleteRobotV1InternalServerError) IsSuccess() bool { 450 return false 451 } 452 453 // IsRedirect returns true when this delete robot v1 internal server error response has a 3xx status code 454 func (o *DeleteRobotV1InternalServerError) IsRedirect() bool { 455 return false 456 } 457 458 // IsClientError returns true when this delete robot v1 internal server error response has a 4xx status code 459 func (o *DeleteRobotV1InternalServerError) IsClientError() bool { 460 return false 461 } 462 463 // IsServerError returns true when this delete robot v1 internal server error response has a 5xx status code 464 func (o *DeleteRobotV1InternalServerError) IsServerError() bool { 465 return true 466 } 467 468 // IsCode returns true when this delete robot v1 internal server error response a status code equal to that given 469 func (o *DeleteRobotV1InternalServerError) IsCode(code int) bool { 470 return code == 500 471 } 472 473 func (o *DeleteRobotV1InternalServerError) Error() string { 474 return fmt.Sprintf("[DELETE /projects/{project_name_or_id}/robots/{robot_id}][%d] deleteRobotV1InternalServerError %+v", 500, o.Payload) 475 } 476 477 func (o *DeleteRobotV1InternalServerError) String() string { 478 return fmt.Sprintf("[DELETE /projects/{project_name_or_id}/robots/{robot_id}][%d] deleteRobotV1InternalServerError %+v", 500, o.Payload) 479 } 480 481 func (o *DeleteRobotV1InternalServerError) GetPayload() *models.Errors { 482 return o.Payload 483 } 484 485 func (o *DeleteRobotV1InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 486 487 // hydrates response header X-Request-Id 488 hdrXRequestID := response.GetHeader("X-Request-Id") 489 490 if hdrXRequestID != "" { 491 o.XRequestID = hdrXRequestID 492 } 493 494 o.Payload = new(models.Errors) 495 496 // response payload 497 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 498 return err 499 } 500 501 return nil 502 }