github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/project_metadata/update_project_metadata_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package project_metadata 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 // UpdateProjectMetadataReader is a Reader for the UpdateProjectMetadata structure. 19 type UpdateProjectMetadataReader struct { 20 formats strfmt.Registry 21 } 22 23 // ReadResponse reads a server response into the received o. 24 func (o *UpdateProjectMetadataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 switch response.Code() { 26 case 200: 27 result := NewUpdateProjectMetadataOK() 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 := NewUpdateProjectMetadataBadRequest() 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 := NewUpdateProjectMetadataUnauthorized() 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 := NewUpdateProjectMetadataForbidden() 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 := NewUpdateProjectMetadataNotFound() 52 if err := result.readResponse(response, consumer, o.formats); err != nil { 53 return nil, err 54 } 55 return nil, result 56 case 409: 57 result := NewUpdateProjectMetadataConflict() 58 if err := result.readResponse(response, consumer, o.formats); err != nil { 59 return nil, err 60 } 61 return nil, result 62 case 500: 63 result := NewUpdateProjectMetadataInternalServerError() 64 if err := result.readResponse(response, consumer, o.formats); err != nil { 65 return nil, err 66 } 67 return nil, result 68 default: 69 return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 70 } 71 } 72 73 // NewUpdateProjectMetadataOK creates a UpdateProjectMetadataOK with default headers values 74 func NewUpdateProjectMetadataOK() *UpdateProjectMetadataOK { 75 return &UpdateProjectMetadataOK{} 76 } 77 78 /* 79 UpdateProjectMetadataOK describes a response with status code 200, with default header values. 80 81 Success 82 */ 83 type UpdateProjectMetadataOK struct { 84 85 /* The ID of the corresponding request for the response 86 */ 87 XRequestID string 88 } 89 90 // IsSuccess returns true when this update project metadata o k response has a 2xx status code 91 func (o *UpdateProjectMetadataOK) IsSuccess() bool { 92 return true 93 } 94 95 // IsRedirect returns true when this update project metadata o k response has a 3xx status code 96 func (o *UpdateProjectMetadataOK) IsRedirect() bool { 97 return false 98 } 99 100 // IsClientError returns true when this update project metadata o k response has a 4xx status code 101 func (o *UpdateProjectMetadataOK) IsClientError() bool { 102 return false 103 } 104 105 // IsServerError returns true when this update project metadata o k response has a 5xx status code 106 func (o *UpdateProjectMetadataOK) IsServerError() bool { 107 return false 108 } 109 110 // IsCode returns true when this update project metadata o k response a status code equal to that given 111 func (o *UpdateProjectMetadataOK) IsCode(code int) bool { 112 return code == 200 113 } 114 115 func (o *UpdateProjectMetadataOK) Error() string { 116 return fmt.Sprintf("[PUT /projects/{project_name_or_id}/metadatas/{meta_name}][%d] updateProjectMetadataOK ", 200) 117 } 118 119 func (o *UpdateProjectMetadataOK) String() string { 120 return fmt.Sprintf("[PUT /projects/{project_name_or_id}/metadatas/{meta_name}][%d] updateProjectMetadataOK ", 200) 121 } 122 123 func (o *UpdateProjectMetadataOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 124 125 // hydrates response header X-Request-Id 126 hdrXRequestID := response.GetHeader("X-Request-Id") 127 128 if hdrXRequestID != "" { 129 o.XRequestID = hdrXRequestID 130 } 131 132 return nil 133 } 134 135 // NewUpdateProjectMetadataBadRequest creates a UpdateProjectMetadataBadRequest with default headers values 136 func NewUpdateProjectMetadataBadRequest() *UpdateProjectMetadataBadRequest { 137 return &UpdateProjectMetadataBadRequest{} 138 } 139 140 /* 141 UpdateProjectMetadataBadRequest describes a response with status code 400, with default header values. 142 143 Bad request 144 */ 145 type UpdateProjectMetadataBadRequest struct { 146 147 /* The ID of the corresponding request for the response 148 */ 149 XRequestID string 150 151 Payload *models.Errors 152 } 153 154 // IsSuccess returns true when this update project metadata bad request response has a 2xx status code 155 func (o *UpdateProjectMetadataBadRequest) IsSuccess() bool { 156 return false 157 } 158 159 // IsRedirect returns true when this update project metadata bad request response has a 3xx status code 160 func (o *UpdateProjectMetadataBadRequest) IsRedirect() bool { 161 return false 162 } 163 164 // IsClientError returns true when this update project metadata bad request response has a 4xx status code 165 func (o *UpdateProjectMetadataBadRequest) IsClientError() bool { 166 return true 167 } 168 169 // IsServerError returns true when this update project metadata bad request response has a 5xx status code 170 func (o *UpdateProjectMetadataBadRequest) IsServerError() bool { 171 return false 172 } 173 174 // IsCode returns true when this update project metadata bad request response a status code equal to that given 175 func (o *UpdateProjectMetadataBadRequest) IsCode(code int) bool { 176 return code == 400 177 } 178 179 func (o *UpdateProjectMetadataBadRequest) Error() string { 180 return fmt.Sprintf("[PUT /projects/{project_name_or_id}/metadatas/{meta_name}][%d] updateProjectMetadataBadRequest %+v", 400, o.Payload) 181 } 182 183 func (o *UpdateProjectMetadataBadRequest) String() string { 184 return fmt.Sprintf("[PUT /projects/{project_name_or_id}/metadatas/{meta_name}][%d] updateProjectMetadataBadRequest %+v", 400, o.Payload) 185 } 186 187 func (o *UpdateProjectMetadataBadRequest) GetPayload() *models.Errors { 188 return o.Payload 189 } 190 191 func (o *UpdateProjectMetadataBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 192 193 // hydrates response header X-Request-Id 194 hdrXRequestID := response.GetHeader("X-Request-Id") 195 196 if hdrXRequestID != "" { 197 o.XRequestID = hdrXRequestID 198 } 199 200 o.Payload = new(models.Errors) 201 202 // response payload 203 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 204 return err 205 } 206 207 return nil 208 } 209 210 // NewUpdateProjectMetadataUnauthorized creates a UpdateProjectMetadataUnauthorized with default headers values 211 func NewUpdateProjectMetadataUnauthorized() *UpdateProjectMetadataUnauthorized { 212 return &UpdateProjectMetadataUnauthorized{} 213 } 214 215 /* 216 UpdateProjectMetadataUnauthorized describes a response with status code 401, with default header values. 217 218 Unauthorized 219 */ 220 type UpdateProjectMetadataUnauthorized struct { 221 222 /* The ID of the corresponding request for the response 223 */ 224 XRequestID string 225 226 Payload *models.Errors 227 } 228 229 // IsSuccess returns true when this update project metadata unauthorized response has a 2xx status code 230 func (o *UpdateProjectMetadataUnauthorized) IsSuccess() bool { 231 return false 232 } 233 234 // IsRedirect returns true when this update project metadata unauthorized response has a 3xx status code 235 func (o *UpdateProjectMetadataUnauthorized) IsRedirect() bool { 236 return false 237 } 238 239 // IsClientError returns true when this update project metadata unauthorized response has a 4xx status code 240 func (o *UpdateProjectMetadataUnauthorized) IsClientError() bool { 241 return true 242 } 243 244 // IsServerError returns true when this update project metadata unauthorized response has a 5xx status code 245 func (o *UpdateProjectMetadataUnauthorized) IsServerError() bool { 246 return false 247 } 248 249 // IsCode returns true when this update project metadata unauthorized response a status code equal to that given 250 func (o *UpdateProjectMetadataUnauthorized) IsCode(code int) bool { 251 return code == 401 252 } 253 254 func (o *UpdateProjectMetadataUnauthorized) Error() string { 255 return fmt.Sprintf("[PUT /projects/{project_name_or_id}/metadatas/{meta_name}][%d] updateProjectMetadataUnauthorized %+v", 401, o.Payload) 256 } 257 258 func (o *UpdateProjectMetadataUnauthorized) String() string { 259 return fmt.Sprintf("[PUT /projects/{project_name_or_id}/metadatas/{meta_name}][%d] updateProjectMetadataUnauthorized %+v", 401, o.Payload) 260 } 261 262 func (o *UpdateProjectMetadataUnauthorized) GetPayload() *models.Errors { 263 return o.Payload 264 } 265 266 func (o *UpdateProjectMetadataUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 267 268 // hydrates response header X-Request-Id 269 hdrXRequestID := response.GetHeader("X-Request-Id") 270 271 if hdrXRequestID != "" { 272 o.XRequestID = hdrXRequestID 273 } 274 275 o.Payload = new(models.Errors) 276 277 // response payload 278 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 279 return err 280 } 281 282 return nil 283 } 284 285 // NewUpdateProjectMetadataForbidden creates a UpdateProjectMetadataForbidden with default headers values 286 func NewUpdateProjectMetadataForbidden() *UpdateProjectMetadataForbidden { 287 return &UpdateProjectMetadataForbidden{} 288 } 289 290 /* 291 UpdateProjectMetadataForbidden describes a response with status code 403, with default header values. 292 293 Forbidden 294 */ 295 type UpdateProjectMetadataForbidden struct { 296 297 /* The ID of the corresponding request for the response 298 */ 299 XRequestID string 300 301 Payload *models.Errors 302 } 303 304 // IsSuccess returns true when this update project metadata forbidden response has a 2xx status code 305 func (o *UpdateProjectMetadataForbidden) IsSuccess() bool { 306 return false 307 } 308 309 // IsRedirect returns true when this update project metadata forbidden response has a 3xx status code 310 func (o *UpdateProjectMetadataForbidden) IsRedirect() bool { 311 return false 312 } 313 314 // IsClientError returns true when this update project metadata forbidden response has a 4xx status code 315 func (o *UpdateProjectMetadataForbidden) IsClientError() bool { 316 return true 317 } 318 319 // IsServerError returns true when this update project metadata forbidden response has a 5xx status code 320 func (o *UpdateProjectMetadataForbidden) IsServerError() bool { 321 return false 322 } 323 324 // IsCode returns true when this update project metadata forbidden response a status code equal to that given 325 func (o *UpdateProjectMetadataForbidden) IsCode(code int) bool { 326 return code == 403 327 } 328 329 func (o *UpdateProjectMetadataForbidden) Error() string { 330 return fmt.Sprintf("[PUT /projects/{project_name_or_id}/metadatas/{meta_name}][%d] updateProjectMetadataForbidden %+v", 403, o.Payload) 331 } 332 333 func (o *UpdateProjectMetadataForbidden) String() string { 334 return fmt.Sprintf("[PUT /projects/{project_name_or_id}/metadatas/{meta_name}][%d] updateProjectMetadataForbidden %+v", 403, o.Payload) 335 } 336 337 func (o *UpdateProjectMetadataForbidden) GetPayload() *models.Errors { 338 return o.Payload 339 } 340 341 func (o *UpdateProjectMetadataForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 342 343 // hydrates response header X-Request-Id 344 hdrXRequestID := response.GetHeader("X-Request-Id") 345 346 if hdrXRequestID != "" { 347 o.XRequestID = hdrXRequestID 348 } 349 350 o.Payload = new(models.Errors) 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 // NewUpdateProjectMetadataNotFound creates a UpdateProjectMetadataNotFound with default headers values 361 func NewUpdateProjectMetadataNotFound() *UpdateProjectMetadataNotFound { 362 return &UpdateProjectMetadataNotFound{} 363 } 364 365 /* 366 UpdateProjectMetadataNotFound describes a response with status code 404, with default header values. 367 368 Not found 369 */ 370 type UpdateProjectMetadataNotFound struct { 371 372 /* The ID of the corresponding request for the response 373 */ 374 XRequestID string 375 376 Payload *models.Errors 377 } 378 379 // IsSuccess returns true when this update project metadata not found response has a 2xx status code 380 func (o *UpdateProjectMetadataNotFound) IsSuccess() bool { 381 return false 382 } 383 384 // IsRedirect returns true when this update project metadata not found response has a 3xx status code 385 func (o *UpdateProjectMetadataNotFound) IsRedirect() bool { 386 return false 387 } 388 389 // IsClientError returns true when this update project metadata not found response has a 4xx status code 390 func (o *UpdateProjectMetadataNotFound) IsClientError() bool { 391 return true 392 } 393 394 // IsServerError returns true when this update project metadata not found response has a 5xx status code 395 func (o *UpdateProjectMetadataNotFound) IsServerError() bool { 396 return false 397 } 398 399 // IsCode returns true when this update project metadata not found response a status code equal to that given 400 func (o *UpdateProjectMetadataNotFound) IsCode(code int) bool { 401 return code == 404 402 } 403 404 func (o *UpdateProjectMetadataNotFound) Error() string { 405 return fmt.Sprintf("[PUT /projects/{project_name_or_id}/metadatas/{meta_name}][%d] updateProjectMetadataNotFound %+v", 404, o.Payload) 406 } 407 408 func (o *UpdateProjectMetadataNotFound) String() string { 409 return fmt.Sprintf("[PUT /projects/{project_name_or_id}/metadatas/{meta_name}][%d] updateProjectMetadataNotFound %+v", 404, o.Payload) 410 } 411 412 func (o *UpdateProjectMetadataNotFound) GetPayload() *models.Errors { 413 return o.Payload 414 } 415 416 func (o *UpdateProjectMetadataNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 417 418 // hydrates response header X-Request-Id 419 hdrXRequestID := response.GetHeader("X-Request-Id") 420 421 if hdrXRequestID != "" { 422 o.XRequestID = hdrXRequestID 423 } 424 425 o.Payload = new(models.Errors) 426 427 // response payload 428 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 429 return err 430 } 431 432 return nil 433 } 434 435 // NewUpdateProjectMetadataConflict creates a UpdateProjectMetadataConflict with default headers values 436 func NewUpdateProjectMetadataConflict() *UpdateProjectMetadataConflict { 437 return &UpdateProjectMetadataConflict{} 438 } 439 440 /* 441 UpdateProjectMetadataConflict describes a response with status code 409, with default header values. 442 443 Conflict 444 */ 445 type UpdateProjectMetadataConflict struct { 446 447 /* The ID of the corresponding request for the response 448 */ 449 XRequestID string 450 451 Payload *models.Errors 452 } 453 454 // IsSuccess returns true when this update project metadata conflict response has a 2xx status code 455 func (o *UpdateProjectMetadataConflict) IsSuccess() bool { 456 return false 457 } 458 459 // IsRedirect returns true when this update project metadata conflict response has a 3xx status code 460 func (o *UpdateProjectMetadataConflict) IsRedirect() bool { 461 return false 462 } 463 464 // IsClientError returns true when this update project metadata conflict response has a 4xx status code 465 func (o *UpdateProjectMetadataConflict) IsClientError() bool { 466 return true 467 } 468 469 // IsServerError returns true when this update project metadata conflict response has a 5xx status code 470 func (o *UpdateProjectMetadataConflict) IsServerError() bool { 471 return false 472 } 473 474 // IsCode returns true when this update project metadata conflict response a status code equal to that given 475 func (o *UpdateProjectMetadataConflict) IsCode(code int) bool { 476 return code == 409 477 } 478 479 func (o *UpdateProjectMetadataConflict) Error() string { 480 return fmt.Sprintf("[PUT /projects/{project_name_or_id}/metadatas/{meta_name}][%d] updateProjectMetadataConflict %+v", 409, o.Payload) 481 } 482 483 func (o *UpdateProjectMetadataConflict) String() string { 484 return fmt.Sprintf("[PUT /projects/{project_name_or_id}/metadatas/{meta_name}][%d] updateProjectMetadataConflict %+v", 409, o.Payload) 485 } 486 487 func (o *UpdateProjectMetadataConflict) GetPayload() *models.Errors { 488 return o.Payload 489 } 490 491 func (o *UpdateProjectMetadataConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 492 493 // hydrates response header X-Request-Id 494 hdrXRequestID := response.GetHeader("X-Request-Id") 495 496 if hdrXRequestID != "" { 497 o.XRequestID = hdrXRequestID 498 } 499 500 o.Payload = new(models.Errors) 501 502 // response payload 503 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 504 return err 505 } 506 507 return nil 508 } 509 510 // NewUpdateProjectMetadataInternalServerError creates a UpdateProjectMetadataInternalServerError with default headers values 511 func NewUpdateProjectMetadataInternalServerError() *UpdateProjectMetadataInternalServerError { 512 return &UpdateProjectMetadataInternalServerError{} 513 } 514 515 /* 516 UpdateProjectMetadataInternalServerError describes a response with status code 500, with default header values. 517 518 Internal server error 519 */ 520 type UpdateProjectMetadataInternalServerError struct { 521 522 /* The ID of the corresponding request for the response 523 */ 524 XRequestID string 525 526 Payload *models.Errors 527 } 528 529 // IsSuccess returns true when this update project metadata internal server error response has a 2xx status code 530 func (o *UpdateProjectMetadataInternalServerError) IsSuccess() bool { 531 return false 532 } 533 534 // IsRedirect returns true when this update project metadata internal server error response has a 3xx status code 535 func (o *UpdateProjectMetadataInternalServerError) IsRedirect() bool { 536 return false 537 } 538 539 // IsClientError returns true when this update project metadata internal server error response has a 4xx status code 540 func (o *UpdateProjectMetadataInternalServerError) IsClientError() bool { 541 return false 542 } 543 544 // IsServerError returns true when this update project metadata internal server error response has a 5xx status code 545 func (o *UpdateProjectMetadataInternalServerError) IsServerError() bool { 546 return true 547 } 548 549 // IsCode returns true when this update project metadata internal server error response a status code equal to that given 550 func (o *UpdateProjectMetadataInternalServerError) IsCode(code int) bool { 551 return code == 500 552 } 553 554 func (o *UpdateProjectMetadataInternalServerError) Error() string { 555 return fmt.Sprintf("[PUT /projects/{project_name_or_id}/metadatas/{meta_name}][%d] updateProjectMetadataInternalServerError %+v", 500, o.Payload) 556 } 557 558 func (o *UpdateProjectMetadataInternalServerError) String() string { 559 return fmt.Sprintf("[PUT /projects/{project_name_or_id}/metadatas/{meta_name}][%d] updateProjectMetadataInternalServerError %+v", 500, o.Payload) 560 } 561 562 func (o *UpdateProjectMetadataInternalServerError) GetPayload() *models.Errors { 563 return o.Payload 564 } 565 566 func (o *UpdateProjectMetadataInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 567 568 // hydrates response header X-Request-Id 569 hdrXRequestID := response.GetHeader("X-Request-Id") 570 571 if hdrXRequestID != "" { 572 o.XRequestID = hdrXRequestID 573 } 574 575 o.Payload = new(models.Errors) 576 577 // response payload 578 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 579 return err 580 } 581 582 return nil 583 }