1 Star 0 Fork 0

pengchengduan / goharbor-client

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
get_gc_responses.go 6.22 KB
一键复制 编辑 原始数据 按行查看 历史
pengchengduan 提交于 2024-02-01 17:28 . first commit
// Code generated by go-swagger; DO NOT EDIT.
package gc
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/mittwald/goharbor-client/v5/apiv2/model"
)
// GetGCReader is a Reader for the GetGC structure.
type GetGCReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetGCReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetGCOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetGCUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetGCForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetGCNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetGCInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetGCOK creates a GetGCOK with default headers values
func NewGetGCOK() *GetGCOK {
return &GetGCOK{}
}
/*GetGCOK handles this case with default header values.
Get gc results successfully.
*/
type GetGCOK struct {
Payload *model.GCHistory
}
func (o *GetGCOK) Error() string {
return fmt.Sprintf("[GET /system/gc/{gc_id}][%d] getGcOK %+v", 200, o.Payload)
}
func (o *GetGCOK) GetPayload() *model.GCHistory {
return o.Payload
}
func (o *GetGCOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(model.GCHistory)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetGCUnauthorized creates a GetGCUnauthorized with default headers values
func NewGetGCUnauthorized() *GetGCUnauthorized {
return &GetGCUnauthorized{}
}
/*GetGCUnauthorized handles this case with default header values.
Unauthorized
*/
type GetGCUnauthorized struct {
/*The ID of the corresponding request for the response
*/
XRequestID string
Payload *model.Errors
}
func (o *GetGCUnauthorized) Error() string {
return fmt.Sprintf("[GET /system/gc/{gc_id}][%d] getGcUnauthorized %+v", 401, o.Payload)
}
func (o *GetGCUnauthorized) GetPayload() *model.Errors {
return o.Payload
}
func (o *GetGCUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header X-Request-Id
o.XRequestID = response.GetHeader("X-Request-Id")
o.Payload = new(model.Errors)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetGCForbidden creates a GetGCForbidden with default headers values
func NewGetGCForbidden() *GetGCForbidden {
return &GetGCForbidden{}
}
/*GetGCForbidden handles this case with default header values.
Forbidden
*/
type GetGCForbidden struct {
/*The ID of the corresponding request for the response
*/
XRequestID string
Payload *model.Errors
}
func (o *GetGCForbidden) Error() string {
return fmt.Sprintf("[GET /system/gc/{gc_id}][%d] getGcForbidden %+v", 403, o.Payload)
}
func (o *GetGCForbidden) GetPayload() *model.Errors {
return o.Payload
}
func (o *GetGCForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header X-Request-Id
o.XRequestID = response.GetHeader("X-Request-Id")
o.Payload = new(model.Errors)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetGCNotFound creates a GetGCNotFound with default headers values
func NewGetGCNotFound() *GetGCNotFound {
return &GetGCNotFound{}
}
/*GetGCNotFound handles this case with default header values.
Not found
*/
type GetGCNotFound struct {
/*The ID of the corresponding request for the response
*/
XRequestID string
Payload *model.Errors
}
func (o *GetGCNotFound) Error() string {
return fmt.Sprintf("[GET /system/gc/{gc_id}][%d] getGcNotFound %+v", 404, o.Payload)
}
func (o *GetGCNotFound) GetPayload() *model.Errors {
return o.Payload
}
func (o *GetGCNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header X-Request-Id
o.XRequestID = response.GetHeader("X-Request-Id")
o.Payload = new(model.Errors)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetGCInternalServerError creates a GetGCInternalServerError with default headers values
func NewGetGCInternalServerError() *GetGCInternalServerError {
return &GetGCInternalServerError{}
}
/*GetGCInternalServerError handles this case with default header values.
Internal server error
*/
type GetGCInternalServerError struct {
/*The ID of the corresponding request for the response
*/
XRequestID string
Payload *model.Errors
}
func (o *GetGCInternalServerError) Error() string {
return fmt.Sprintf("[GET /system/gc/{gc_id}][%d] getGcInternalServerError %+v", 500, o.Payload)
}
func (o *GetGCInternalServerError) GetPayload() *model.Errors {
return o.Payload
}
func (o *GetGCInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header X-Request-Id
o.XRequestID = response.GetHeader("X-Request-Id")
o.Payload = new(model.Errors)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
1
https://gitee.com/pengchengduan/goharbor-client.git
git@gitee.com:pengchengduan/goharbor-client.git
pengchengduan
goharbor-client
goharbor-client
41c6882efe91

搜索帮助