github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/gc/update_gc_schedule_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package gc
     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  // UpdateGCScheduleReader is a Reader for the UpdateGCSchedule structure.
    19  type UpdateGCScheduleReader struct {
    20  	formats strfmt.Registry
    21  }
    22  
    23  // ReadResponse reads a server response into the received o.
    24  func (o *UpdateGCScheduleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    25  	switch response.Code() {
    26  	case 200:
    27  		result := NewUpdateGCScheduleOK()
    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 := NewUpdateGCScheduleBadRequest()
    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 := NewUpdateGCScheduleUnauthorized()
    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 := NewUpdateGCScheduleForbidden()
    46  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    47  			return nil, err
    48  		}
    49  		return nil, result
    50  	case 500:
    51  		result := NewUpdateGCScheduleInternalServerError()
    52  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    53  			return nil, err
    54  		}
    55  		return nil, result
    56  	default:
    57  		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
    58  	}
    59  }
    60  
    61  // NewUpdateGCScheduleOK creates a UpdateGCScheduleOK with default headers values
    62  func NewUpdateGCScheduleOK() *UpdateGCScheduleOK {
    63  	return &UpdateGCScheduleOK{}
    64  }
    65  
    66  /*
    67  UpdateGCScheduleOK describes a response with status code 200, with default header values.
    68  
    69  Updated gc's schedule successfully.
    70  */
    71  type UpdateGCScheduleOK struct {
    72  }
    73  
    74  // IsSuccess returns true when this update Gc schedule o k response has a 2xx status code
    75  func (o *UpdateGCScheduleOK) IsSuccess() bool {
    76  	return true
    77  }
    78  
    79  // IsRedirect returns true when this update Gc schedule o k response has a 3xx status code
    80  func (o *UpdateGCScheduleOK) IsRedirect() bool {
    81  	return false
    82  }
    83  
    84  // IsClientError returns true when this update Gc schedule o k response has a 4xx status code
    85  func (o *UpdateGCScheduleOK) IsClientError() bool {
    86  	return false
    87  }
    88  
    89  // IsServerError returns true when this update Gc schedule o k response has a 5xx status code
    90  func (o *UpdateGCScheduleOK) IsServerError() bool {
    91  	return false
    92  }
    93  
    94  // IsCode returns true when this update Gc schedule o k response a status code equal to that given
    95  func (o *UpdateGCScheduleOK) IsCode(code int) bool {
    96  	return code == 200
    97  }
    98  
    99  func (o *UpdateGCScheduleOK) Error() string {
   100  	return fmt.Sprintf("[PUT /system/gc/schedule][%d] updateGcScheduleOK ", 200)
   101  }
   102  
   103  func (o *UpdateGCScheduleOK) String() string {
   104  	return fmt.Sprintf("[PUT /system/gc/schedule][%d] updateGcScheduleOK ", 200)
   105  }
   106  
   107  func (o *UpdateGCScheduleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   108  
   109  	return nil
   110  }
   111  
   112  // NewUpdateGCScheduleBadRequest creates a UpdateGCScheduleBadRequest with default headers values
   113  func NewUpdateGCScheduleBadRequest() *UpdateGCScheduleBadRequest {
   114  	return &UpdateGCScheduleBadRequest{}
   115  }
   116  
   117  /*
   118  UpdateGCScheduleBadRequest describes a response with status code 400, with default header values.
   119  
   120  Bad request
   121  */
   122  type UpdateGCScheduleBadRequest struct {
   123  
   124  	/* The ID of the corresponding request for the response
   125  	 */
   126  	XRequestID string
   127  
   128  	Payload *models.Errors
   129  }
   130  
   131  // IsSuccess returns true when this update Gc schedule bad request response has a 2xx status code
   132  func (o *UpdateGCScheduleBadRequest) IsSuccess() bool {
   133  	return false
   134  }
   135  
   136  // IsRedirect returns true when this update Gc schedule bad request response has a 3xx status code
   137  func (o *UpdateGCScheduleBadRequest) IsRedirect() bool {
   138  	return false
   139  }
   140  
   141  // IsClientError returns true when this update Gc schedule bad request response has a 4xx status code
   142  func (o *UpdateGCScheduleBadRequest) IsClientError() bool {
   143  	return true
   144  }
   145  
   146  // IsServerError returns true when this update Gc schedule bad request response has a 5xx status code
   147  func (o *UpdateGCScheduleBadRequest) IsServerError() bool {
   148  	return false
   149  }
   150  
   151  // IsCode returns true when this update Gc schedule bad request response a status code equal to that given
   152  func (o *UpdateGCScheduleBadRequest) IsCode(code int) bool {
   153  	return code == 400
   154  }
   155  
   156  func (o *UpdateGCScheduleBadRequest) Error() string {
   157  	return fmt.Sprintf("[PUT /system/gc/schedule][%d] updateGcScheduleBadRequest  %+v", 400, o.Payload)
   158  }
   159  
   160  func (o *UpdateGCScheduleBadRequest) String() string {
   161  	return fmt.Sprintf("[PUT /system/gc/schedule][%d] updateGcScheduleBadRequest  %+v", 400, o.Payload)
   162  }
   163  
   164  func (o *UpdateGCScheduleBadRequest) GetPayload() *models.Errors {
   165  	return o.Payload
   166  }
   167  
   168  func (o *UpdateGCScheduleBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   169  
   170  	// hydrates response header X-Request-Id
   171  	hdrXRequestID := response.GetHeader("X-Request-Id")
   172  
   173  	if hdrXRequestID != "" {
   174  		o.XRequestID = hdrXRequestID
   175  	}
   176  
   177  	o.Payload = new(models.Errors)
   178  
   179  	// response payload
   180  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   181  		return err
   182  	}
   183  
   184  	return nil
   185  }
   186  
   187  // NewUpdateGCScheduleUnauthorized creates a UpdateGCScheduleUnauthorized with default headers values
   188  func NewUpdateGCScheduleUnauthorized() *UpdateGCScheduleUnauthorized {
   189  	return &UpdateGCScheduleUnauthorized{}
   190  }
   191  
   192  /*
   193  UpdateGCScheduleUnauthorized describes a response with status code 401, with default header values.
   194  
   195  Unauthorized
   196  */
   197  type UpdateGCScheduleUnauthorized struct {
   198  
   199  	/* The ID of the corresponding request for the response
   200  	 */
   201  	XRequestID string
   202  
   203  	Payload *models.Errors
   204  }
   205  
   206  // IsSuccess returns true when this update Gc schedule unauthorized response has a 2xx status code
   207  func (o *UpdateGCScheduleUnauthorized) IsSuccess() bool {
   208  	return false
   209  }
   210  
   211  // IsRedirect returns true when this update Gc schedule unauthorized response has a 3xx status code
   212  func (o *UpdateGCScheduleUnauthorized) IsRedirect() bool {
   213  	return false
   214  }
   215  
   216  // IsClientError returns true when this update Gc schedule unauthorized response has a 4xx status code
   217  func (o *UpdateGCScheduleUnauthorized) IsClientError() bool {
   218  	return true
   219  }
   220  
   221  // IsServerError returns true when this update Gc schedule unauthorized response has a 5xx status code
   222  func (o *UpdateGCScheduleUnauthorized) IsServerError() bool {
   223  	return false
   224  }
   225  
   226  // IsCode returns true when this update Gc schedule unauthorized response a status code equal to that given
   227  func (o *UpdateGCScheduleUnauthorized) IsCode(code int) bool {
   228  	return code == 401
   229  }
   230  
   231  func (o *UpdateGCScheduleUnauthorized) Error() string {
   232  	return fmt.Sprintf("[PUT /system/gc/schedule][%d] updateGcScheduleUnauthorized  %+v", 401, o.Payload)
   233  }
   234  
   235  func (o *UpdateGCScheduleUnauthorized) String() string {
   236  	return fmt.Sprintf("[PUT /system/gc/schedule][%d] updateGcScheduleUnauthorized  %+v", 401, o.Payload)
   237  }
   238  
   239  func (o *UpdateGCScheduleUnauthorized) GetPayload() *models.Errors {
   240  	return o.Payload
   241  }
   242  
   243  func (o *UpdateGCScheduleUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   244  
   245  	// hydrates response header X-Request-Id
   246  	hdrXRequestID := response.GetHeader("X-Request-Id")
   247  
   248  	if hdrXRequestID != "" {
   249  		o.XRequestID = hdrXRequestID
   250  	}
   251  
   252  	o.Payload = new(models.Errors)
   253  
   254  	// response payload
   255  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   256  		return err
   257  	}
   258  
   259  	return nil
   260  }
   261  
   262  // NewUpdateGCScheduleForbidden creates a UpdateGCScheduleForbidden with default headers values
   263  func NewUpdateGCScheduleForbidden() *UpdateGCScheduleForbidden {
   264  	return &UpdateGCScheduleForbidden{}
   265  }
   266  
   267  /*
   268  UpdateGCScheduleForbidden describes a response with status code 403, with default header values.
   269  
   270  Forbidden
   271  */
   272  type UpdateGCScheduleForbidden struct {
   273  
   274  	/* The ID of the corresponding request for the response
   275  	 */
   276  	XRequestID string
   277  
   278  	Payload *models.Errors
   279  }
   280  
   281  // IsSuccess returns true when this update Gc schedule forbidden response has a 2xx status code
   282  func (o *UpdateGCScheduleForbidden) IsSuccess() bool {
   283  	return false
   284  }
   285  
   286  // IsRedirect returns true when this update Gc schedule forbidden response has a 3xx status code
   287  func (o *UpdateGCScheduleForbidden) IsRedirect() bool {
   288  	return false
   289  }
   290  
   291  // IsClientError returns true when this update Gc schedule forbidden response has a 4xx status code
   292  func (o *UpdateGCScheduleForbidden) IsClientError() bool {
   293  	return true
   294  }
   295  
   296  // IsServerError returns true when this update Gc schedule forbidden response has a 5xx status code
   297  func (o *UpdateGCScheduleForbidden) IsServerError() bool {
   298  	return false
   299  }
   300  
   301  // IsCode returns true when this update Gc schedule forbidden response a status code equal to that given
   302  func (o *UpdateGCScheduleForbidden) IsCode(code int) bool {
   303  	return code == 403
   304  }
   305  
   306  func (o *UpdateGCScheduleForbidden) Error() string {
   307  	return fmt.Sprintf("[PUT /system/gc/schedule][%d] updateGcScheduleForbidden  %+v", 403, o.Payload)
   308  }
   309  
   310  func (o *UpdateGCScheduleForbidden) String() string {
   311  	return fmt.Sprintf("[PUT /system/gc/schedule][%d] updateGcScheduleForbidden  %+v", 403, o.Payload)
   312  }
   313  
   314  func (o *UpdateGCScheduleForbidden) GetPayload() *models.Errors {
   315  	return o.Payload
   316  }
   317  
   318  func (o *UpdateGCScheduleForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   319  
   320  	// hydrates response header X-Request-Id
   321  	hdrXRequestID := response.GetHeader("X-Request-Id")
   322  
   323  	if hdrXRequestID != "" {
   324  		o.XRequestID = hdrXRequestID
   325  	}
   326  
   327  	o.Payload = new(models.Errors)
   328  
   329  	// response payload
   330  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   331  		return err
   332  	}
   333  
   334  	return nil
   335  }
   336  
   337  // NewUpdateGCScheduleInternalServerError creates a UpdateGCScheduleInternalServerError with default headers values
   338  func NewUpdateGCScheduleInternalServerError() *UpdateGCScheduleInternalServerError {
   339  	return &UpdateGCScheduleInternalServerError{}
   340  }
   341  
   342  /*
   343  UpdateGCScheduleInternalServerError describes a response with status code 500, with default header values.
   344  
   345  Internal server error
   346  */
   347  type UpdateGCScheduleInternalServerError struct {
   348  
   349  	/* The ID of the corresponding request for the response
   350  	 */
   351  	XRequestID string
   352  
   353  	Payload *models.Errors
   354  }
   355  
   356  // IsSuccess returns true when this update Gc schedule internal server error response has a 2xx status code
   357  func (o *UpdateGCScheduleInternalServerError) IsSuccess() bool {
   358  	return false
   359  }
   360  
   361  // IsRedirect returns true when this update Gc schedule internal server error response has a 3xx status code
   362  func (o *UpdateGCScheduleInternalServerError) IsRedirect() bool {
   363  	return false
   364  }
   365  
   366  // IsClientError returns true when this update Gc schedule internal server error response has a 4xx status code
   367  func (o *UpdateGCScheduleInternalServerError) IsClientError() bool {
   368  	return false
   369  }
   370  
   371  // IsServerError returns true when this update Gc schedule internal server error response has a 5xx status code
   372  func (o *UpdateGCScheduleInternalServerError) IsServerError() bool {
   373  	return true
   374  }
   375  
   376  // IsCode returns true when this update Gc schedule internal server error response a status code equal to that given
   377  func (o *UpdateGCScheduleInternalServerError) IsCode(code int) bool {
   378  	return code == 500
   379  }
   380  
   381  func (o *UpdateGCScheduleInternalServerError) Error() string {
   382  	return fmt.Sprintf("[PUT /system/gc/schedule][%d] updateGcScheduleInternalServerError  %+v", 500, o.Payload)
   383  }
   384  
   385  func (o *UpdateGCScheduleInternalServerError) String() string {
   386  	return fmt.Sprintf("[PUT /system/gc/schedule][%d] updateGcScheduleInternalServerError  %+v", 500, o.Payload)
   387  }
   388  
   389  func (o *UpdateGCScheduleInternalServerError) GetPayload() *models.Errors {
   390  	return o.Payload
   391  }
   392  
   393  func (o *UpdateGCScheduleInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   394  
   395  	// hydrates response header X-Request-Id
   396  	hdrXRequestID := response.GetHeader("X-Request-Id")
   397  
   398  	if hdrXRequestID != "" {
   399  		o.XRequestID = hdrXRequestID
   400  	}
   401  
   402  	o.Payload = new(models.Errors)
   403  
   404  	// response payload
   405  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   406  		return err
   407  	}
   408  
   409  	return nil
   410  }