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

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package configure
     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  
    11  	"github.com/go-openapi/runtime"
    12  	"github.com/go-openapi/strfmt"
    13  )
    14  
    15  // UpdateConfigurationsReader is a Reader for the UpdateConfigurations structure.
    16  type UpdateConfigurationsReader struct {
    17  	formats strfmt.Registry
    18  }
    19  
    20  // ReadResponse reads a server response into the received o.
    21  func (o *UpdateConfigurationsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    22  	switch response.Code() {
    23  	case 200:
    24  		result := NewUpdateConfigurationsOK()
    25  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    26  			return nil, err
    27  		}
    28  		return result, nil
    29  	case 401:
    30  		result := NewUpdateConfigurationsUnauthorized()
    31  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    32  			return nil, err
    33  		}
    34  		return nil, result
    35  	case 403:
    36  		result := NewUpdateConfigurationsForbidden()
    37  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    38  			return nil, err
    39  		}
    40  		return nil, result
    41  	case 500:
    42  		result := NewUpdateConfigurationsInternalServerError()
    43  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    44  			return nil, err
    45  		}
    46  		return nil, result
    47  	default:
    48  		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
    49  	}
    50  }
    51  
    52  // NewUpdateConfigurationsOK creates a UpdateConfigurationsOK with default headers values
    53  func NewUpdateConfigurationsOK() *UpdateConfigurationsOK {
    54  	return &UpdateConfigurationsOK{}
    55  }
    56  
    57  /*
    58  UpdateConfigurationsOK describes a response with status code 200, with default header values.
    59  
    60  Modify system configurations successfully.
    61  */
    62  type UpdateConfigurationsOK struct {
    63  }
    64  
    65  // IsSuccess returns true when this update configurations o k response has a 2xx status code
    66  func (o *UpdateConfigurationsOK) IsSuccess() bool {
    67  	return true
    68  }
    69  
    70  // IsRedirect returns true when this update configurations o k response has a 3xx status code
    71  func (o *UpdateConfigurationsOK) IsRedirect() bool {
    72  	return false
    73  }
    74  
    75  // IsClientError returns true when this update configurations o k response has a 4xx status code
    76  func (o *UpdateConfigurationsOK) IsClientError() bool {
    77  	return false
    78  }
    79  
    80  // IsServerError returns true when this update configurations o k response has a 5xx status code
    81  func (o *UpdateConfigurationsOK) IsServerError() bool {
    82  	return false
    83  }
    84  
    85  // IsCode returns true when this update configurations o k response a status code equal to that given
    86  func (o *UpdateConfigurationsOK) IsCode(code int) bool {
    87  	return code == 200
    88  }
    89  
    90  func (o *UpdateConfigurationsOK) Error() string {
    91  	return fmt.Sprintf("[PUT /configurations][%d] updateConfigurationsOK ", 200)
    92  }
    93  
    94  func (o *UpdateConfigurationsOK) String() string {
    95  	return fmt.Sprintf("[PUT /configurations][%d] updateConfigurationsOK ", 200)
    96  }
    97  
    98  func (o *UpdateConfigurationsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
    99  
   100  	return nil
   101  }
   102  
   103  // NewUpdateConfigurationsUnauthorized creates a UpdateConfigurationsUnauthorized with default headers values
   104  func NewUpdateConfigurationsUnauthorized() *UpdateConfigurationsUnauthorized {
   105  	return &UpdateConfigurationsUnauthorized{}
   106  }
   107  
   108  /*
   109  UpdateConfigurationsUnauthorized describes a response with status code 401, with default header values.
   110  
   111  User need to log in first.
   112  */
   113  type UpdateConfigurationsUnauthorized struct {
   114  }
   115  
   116  // IsSuccess returns true when this update configurations unauthorized response has a 2xx status code
   117  func (o *UpdateConfigurationsUnauthorized) IsSuccess() bool {
   118  	return false
   119  }
   120  
   121  // IsRedirect returns true when this update configurations unauthorized response has a 3xx status code
   122  func (o *UpdateConfigurationsUnauthorized) IsRedirect() bool {
   123  	return false
   124  }
   125  
   126  // IsClientError returns true when this update configurations unauthorized response has a 4xx status code
   127  func (o *UpdateConfigurationsUnauthorized) IsClientError() bool {
   128  	return true
   129  }
   130  
   131  // IsServerError returns true when this update configurations unauthorized response has a 5xx status code
   132  func (o *UpdateConfigurationsUnauthorized) IsServerError() bool {
   133  	return false
   134  }
   135  
   136  // IsCode returns true when this update configurations unauthorized response a status code equal to that given
   137  func (o *UpdateConfigurationsUnauthorized) IsCode(code int) bool {
   138  	return code == 401
   139  }
   140  
   141  func (o *UpdateConfigurationsUnauthorized) Error() string {
   142  	return fmt.Sprintf("[PUT /configurations][%d] updateConfigurationsUnauthorized ", 401)
   143  }
   144  
   145  func (o *UpdateConfigurationsUnauthorized) String() string {
   146  	return fmt.Sprintf("[PUT /configurations][%d] updateConfigurationsUnauthorized ", 401)
   147  }
   148  
   149  func (o *UpdateConfigurationsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   150  
   151  	return nil
   152  }
   153  
   154  // NewUpdateConfigurationsForbidden creates a UpdateConfigurationsForbidden with default headers values
   155  func NewUpdateConfigurationsForbidden() *UpdateConfigurationsForbidden {
   156  	return &UpdateConfigurationsForbidden{}
   157  }
   158  
   159  /*
   160  UpdateConfigurationsForbidden describes a response with status code 403, with default header values.
   161  
   162  User does not have permission of admin role.
   163  */
   164  type UpdateConfigurationsForbidden struct {
   165  }
   166  
   167  // IsSuccess returns true when this update configurations forbidden response has a 2xx status code
   168  func (o *UpdateConfigurationsForbidden) IsSuccess() bool {
   169  	return false
   170  }
   171  
   172  // IsRedirect returns true when this update configurations forbidden response has a 3xx status code
   173  func (o *UpdateConfigurationsForbidden) IsRedirect() bool {
   174  	return false
   175  }
   176  
   177  // IsClientError returns true when this update configurations forbidden response has a 4xx status code
   178  func (o *UpdateConfigurationsForbidden) IsClientError() bool {
   179  	return true
   180  }
   181  
   182  // IsServerError returns true when this update configurations forbidden response has a 5xx status code
   183  func (o *UpdateConfigurationsForbidden) IsServerError() bool {
   184  	return false
   185  }
   186  
   187  // IsCode returns true when this update configurations forbidden response a status code equal to that given
   188  func (o *UpdateConfigurationsForbidden) IsCode(code int) bool {
   189  	return code == 403
   190  }
   191  
   192  func (o *UpdateConfigurationsForbidden) Error() string {
   193  	return fmt.Sprintf("[PUT /configurations][%d] updateConfigurationsForbidden ", 403)
   194  }
   195  
   196  func (o *UpdateConfigurationsForbidden) String() string {
   197  	return fmt.Sprintf("[PUT /configurations][%d] updateConfigurationsForbidden ", 403)
   198  }
   199  
   200  func (o *UpdateConfigurationsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   201  
   202  	return nil
   203  }
   204  
   205  // NewUpdateConfigurationsInternalServerError creates a UpdateConfigurationsInternalServerError with default headers values
   206  func NewUpdateConfigurationsInternalServerError() *UpdateConfigurationsInternalServerError {
   207  	return &UpdateConfigurationsInternalServerError{}
   208  }
   209  
   210  /*
   211  UpdateConfigurationsInternalServerError describes a response with status code 500, with default header values.
   212  
   213  Unexpected internal errors.
   214  */
   215  type UpdateConfigurationsInternalServerError struct {
   216  }
   217  
   218  // IsSuccess returns true when this update configurations internal server error response has a 2xx status code
   219  func (o *UpdateConfigurationsInternalServerError) IsSuccess() bool {
   220  	return false
   221  }
   222  
   223  // IsRedirect returns true when this update configurations internal server error response has a 3xx status code
   224  func (o *UpdateConfigurationsInternalServerError) IsRedirect() bool {
   225  	return false
   226  }
   227  
   228  // IsClientError returns true when this update configurations internal server error response has a 4xx status code
   229  func (o *UpdateConfigurationsInternalServerError) IsClientError() bool {
   230  	return false
   231  }
   232  
   233  // IsServerError returns true when this update configurations internal server error response has a 5xx status code
   234  func (o *UpdateConfigurationsInternalServerError) IsServerError() bool {
   235  	return true
   236  }
   237  
   238  // IsCode returns true when this update configurations internal server error response a status code equal to that given
   239  func (o *UpdateConfigurationsInternalServerError) IsCode(code int) bool {
   240  	return code == 500
   241  }
   242  
   243  func (o *UpdateConfigurationsInternalServerError) Error() string {
   244  	return fmt.Sprintf("[PUT /configurations][%d] updateConfigurationsInternalServerError ", 500)
   245  }
   246  
   247  func (o *UpdateConfigurationsInternalServerError) String() string {
   248  	return fmt.Sprintf("[PUT /configurations][%d] updateConfigurationsInternalServerError ", 500)
   249  }
   250  
   251  func (o *UpdateConfigurationsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   252  
   253  	return nil
   254  }