github.com/cilium/cilium@v1.16.2/api/v1/client/endpoint/patch_endpoint_id_config_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // Copyright Authors of Cilium
     4  // SPDX-License-Identifier: Apache-2.0
     5  
     6  package endpoint
     7  
     8  // This file was generated by the swagger tool.
     9  // Editing this file might prove futile when you re-run the swagger generate command
    10  
    11  import (
    12  	"fmt"
    13  	"io"
    14  
    15  	"github.com/go-openapi/runtime"
    16  	"github.com/go-openapi/strfmt"
    17  
    18  	"github.com/cilium/cilium/api/v1/models"
    19  )
    20  
    21  // PatchEndpointIDConfigReader is a Reader for the PatchEndpointIDConfig structure.
    22  type PatchEndpointIDConfigReader struct {
    23  	formats strfmt.Registry
    24  }
    25  
    26  // ReadResponse reads a server response into the received o.
    27  func (o *PatchEndpointIDConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    28  	switch response.Code() {
    29  	case 200:
    30  		result := NewPatchEndpointIDConfigOK()
    31  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    32  			return nil, err
    33  		}
    34  		return result, nil
    35  	case 400:
    36  		result := NewPatchEndpointIDConfigInvalid()
    37  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    38  			return nil, err
    39  		}
    40  		return nil, result
    41  	case 403:
    42  		result := NewPatchEndpointIDConfigForbidden()
    43  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    44  			return nil, err
    45  		}
    46  		return nil, result
    47  	case 404:
    48  		result := NewPatchEndpointIDConfigNotFound()
    49  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    50  			return nil, err
    51  		}
    52  		return nil, result
    53  	case 429:
    54  		result := NewPatchEndpointIDConfigTooManyRequests()
    55  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    56  			return nil, err
    57  		}
    58  		return nil, result
    59  	case 500:
    60  		result := NewPatchEndpointIDConfigFailed()
    61  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    62  			return nil, err
    63  		}
    64  		return nil, result
    65  	default:
    66  		return nil, runtime.NewAPIError("[PATCH /endpoint/{id}/config] PatchEndpointIDConfig", response, response.Code())
    67  	}
    68  }
    69  
    70  // NewPatchEndpointIDConfigOK creates a PatchEndpointIDConfigOK with default headers values
    71  func NewPatchEndpointIDConfigOK() *PatchEndpointIDConfigOK {
    72  	return &PatchEndpointIDConfigOK{}
    73  }
    74  
    75  /*
    76  PatchEndpointIDConfigOK describes a response with status code 200, with default header values.
    77  
    78  Success
    79  */
    80  type PatchEndpointIDConfigOK struct {
    81  }
    82  
    83  // IsSuccess returns true when this patch endpoint Id config o k response has a 2xx status code
    84  func (o *PatchEndpointIDConfigOK) IsSuccess() bool {
    85  	return true
    86  }
    87  
    88  // IsRedirect returns true when this patch endpoint Id config o k response has a 3xx status code
    89  func (o *PatchEndpointIDConfigOK) IsRedirect() bool {
    90  	return false
    91  }
    92  
    93  // IsClientError returns true when this patch endpoint Id config o k response has a 4xx status code
    94  func (o *PatchEndpointIDConfigOK) IsClientError() bool {
    95  	return false
    96  }
    97  
    98  // IsServerError returns true when this patch endpoint Id config o k response has a 5xx status code
    99  func (o *PatchEndpointIDConfigOK) IsServerError() bool {
   100  	return false
   101  }
   102  
   103  // IsCode returns true when this patch endpoint Id config o k response a status code equal to that given
   104  func (o *PatchEndpointIDConfigOK) IsCode(code int) bool {
   105  	return code == 200
   106  }
   107  
   108  // Code gets the status code for the patch endpoint Id config o k response
   109  func (o *PatchEndpointIDConfigOK) Code() int {
   110  	return 200
   111  }
   112  
   113  func (o *PatchEndpointIDConfigOK) Error() string {
   114  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigOK ", 200)
   115  }
   116  
   117  func (o *PatchEndpointIDConfigOK) String() string {
   118  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigOK ", 200)
   119  }
   120  
   121  func (o *PatchEndpointIDConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   122  
   123  	return nil
   124  }
   125  
   126  // NewPatchEndpointIDConfigInvalid creates a PatchEndpointIDConfigInvalid with default headers values
   127  func NewPatchEndpointIDConfigInvalid() *PatchEndpointIDConfigInvalid {
   128  	return &PatchEndpointIDConfigInvalid{}
   129  }
   130  
   131  /*
   132  PatchEndpointIDConfigInvalid describes a response with status code 400, with default header values.
   133  
   134  Invalid configuration request
   135  */
   136  type PatchEndpointIDConfigInvalid struct {
   137  }
   138  
   139  // IsSuccess returns true when this patch endpoint Id config invalid response has a 2xx status code
   140  func (o *PatchEndpointIDConfigInvalid) IsSuccess() bool {
   141  	return false
   142  }
   143  
   144  // IsRedirect returns true when this patch endpoint Id config invalid response has a 3xx status code
   145  func (o *PatchEndpointIDConfigInvalid) IsRedirect() bool {
   146  	return false
   147  }
   148  
   149  // IsClientError returns true when this patch endpoint Id config invalid response has a 4xx status code
   150  func (o *PatchEndpointIDConfigInvalid) IsClientError() bool {
   151  	return true
   152  }
   153  
   154  // IsServerError returns true when this patch endpoint Id config invalid response has a 5xx status code
   155  func (o *PatchEndpointIDConfigInvalid) IsServerError() bool {
   156  	return false
   157  }
   158  
   159  // IsCode returns true when this patch endpoint Id config invalid response a status code equal to that given
   160  func (o *PatchEndpointIDConfigInvalid) IsCode(code int) bool {
   161  	return code == 400
   162  }
   163  
   164  // Code gets the status code for the patch endpoint Id config invalid response
   165  func (o *PatchEndpointIDConfigInvalid) Code() int {
   166  	return 400
   167  }
   168  
   169  func (o *PatchEndpointIDConfigInvalid) Error() string {
   170  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigInvalid ", 400)
   171  }
   172  
   173  func (o *PatchEndpointIDConfigInvalid) String() string {
   174  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigInvalid ", 400)
   175  }
   176  
   177  func (o *PatchEndpointIDConfigInvalid) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   178  
   179  	return nil
   180  }
   181  
   182  // NewPatchEndpointIDConfigForbidden creates a PatchEndpointIDConfigForbidden with default headers values
   183  func NewPatchEndpointIDConfigForbidden() *PatchEndpointIDConfigForbidden {
   184  	return &PatchEndpointIDConfigForbidden{}
   185  }
   186  
   187  /*
   188  PatchEndpointIDConfigForbidden describes a response with status code 403, with default header values.
   189  
   190  Forbidden
   191  */
   192  type PatchEndpointIDConfigForbidden struct {
   193  }
   194  
   195  // IsSuccess returns true when this patch endpoint Id config forbidden response has a 2xx status code
   196  func (o *PatchEndpointIDConfigForbidden) IsSuccess() bool {
   197  	return false
   198  }
   199  
   200  // IsRedirect returns true when this patch endpoint Id config forbidden response has a 3xx status code
   201  func (o *PatchEndpointIDConfigForbidden) IsRedirect() bool {
   202  	return false
   203  }
   204  
   205  // IsClientError returns true when this patch endpoint Id config forbidden response has a 4xx status code
   206  func (o *PatchEndpointIDConfigForbidden) IsClientError() bool {
   207  	return true
   208  }
   209  
   210  // IsServerError returns true when this patch endpoint Id config forbidden response has a 5xx status code
   211  func (o *PatchEndpointIDConfigForbidden) IsServerError() bool {
   212  	return false
   213  }
   214  
   215  // IsCode returns true when this patch endpoint Id config forbidden response a status code equal to that given
   216  func (o *PatchEndpointIDConfigForbidden) IsCode(code int) bool {
   217  	return code == 403
   218  }
   219  
   220  // Code gets the status code for the patch endpoint Id config forbidden response
   221  func (o *PatchEndpointIDConfigForbidden) Code() int {
   222  	return 403
   223  }
   224  
   225  func (o *PatchEndpointIDConfigForbidden) Error() string {
   226  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigForbidden ", 403)
   227  }
   228  
   229  func (o *PatchEndpointIDConfigForbidden) String() string {
   230  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigForbidden ", 403)
   231  }
   232  
   233  func (o *PatchEndpointIDConfigForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   234  
   235  	return nil
   236  }
   237  
   238  // NewPatchEndpointIDConfigNotFound creates a PatchEndpointIDConfigNotFound with default headers values
   239  func NewPatchEndpointIDConfigNotFound() *PatchEndpointIDConfigNotFound {
   240  	return &PatchEndpointIDConfigNotFound{}
   241  }
   242  
   243  /*
   244  PatchEndpointIDConfigNotFound describes a response with status code 404, with default header values.
   245  
   246  Endpoint not found
   247  */
   248  type PatchEndpointIDConfigNotFound struct {
   249  }
   250  
   251  // IsSuccess returns true when this patch endpoint Id config not found response has a 2xx status code
   252  func (o *PatchEndpointIDConfigNotFound) IsSuccess() bool {
   253  	return false
   254  }
   255  
   256  // IsRedirect returns true when this patch endpoint Id config not found response has a 3xx status code
   257  func (o *PatchEndpointIDConfigNotFound) IsRedirect() bool {
   258  	return false
   259  }
   260  
   261  // IsClientError returns true when this patch endpoint Id config not found response has a 4xx status code
   262  func (o *PatchEndpointIDConfigNotFound) IsClientError() bool {
   263  	return true
   264  }
   265  
   266  // IsServerError returns true when this patch endpoint Id config not found response has a 5xx status code
   267  func (o *PatchEndpointIDConfigNotFound) IsServerError() bool {
   268  	return false
   269  }
   270  
   271  // IsCode returns true when this patch endpoint Id config not found response a status code equal to that given
   272  func (o *PatchEndpointIDConfigNotFound) IsCode(code int) bool {
   273  	return code == 404
   274  }
   275  
   276  // Code gets the status code for the patch endpoint Id config not found response
   277  func (o *PatchEndpointIDConfigNotFound) Code() int {
   278  	return 404
   279  }
   280  
   281  func (o *PatchEndpointIDConfigNotFound) Error() string {
   282  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigNotFound ", 404)
   283  }
   284  
   285  func (o *PatchEndpointIDConfigNotFound) String() string {
   286  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigNotFound ", 404)
   287  }
   288  
   289  func (o *PatchEndpointIDConfigNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   290  
   291  	return nil
   292  }
   293  
   294  // NewPatchEndpointIDConfigTooManyRequests creates a PatchEndpointIDConfigTooManyRequests with default headers values
   295  func NewPatchEndpointIDConfigTooManyRequests() *PatchEndpointIDConfigTooManyRequests {
   296  	return &PatchEndpointIDConfigTooManyRequests{}
   297  }
   298  
   299  /*
   300  PatchEndpointIDConfigTooManyRequests describes a response with status code 429, with default header values.
   301  
   302  Rate-limiting too many requests in the given time frame
   303  */
   304  type PatchEndpointIDConfigTooManyRequests struct {
   305  }
   306  
   307  // IsSuccess returns true when this patch endpoint Id config too many requests response has a 2xx status code
   308  func (o *PatchEndpointIDConfigTooManyRequests) IsSuccess() bool {
   309  	return false
   310  }
   311  
   312  // IsRedirect returns true when this patch endpoint Id config too many requests response has a 3xx status code
   313  func (o *PatchEndpointIDConfigTooManyRequests) IsRedirect() bool {
   314  	return false
   315  }
   316  
   317  // IsClientError returns true when this patch endpoint Id config too many requests response has a 4xx status code
   318  func (o *PatchEndpointIDConfigTooManyRequests) IsClientError() bool {
   319  	return true
   320  }
   321  
   322  // IsServerError returns true when this patch endpoint Id config too many requests response has a 5xx status code
   323  func (o *PatchEndpointIDConfigTooManyRequests) IsServerError() bool {
   324  	return false
   325  }
   326  
   327  // IsCode returns true when this patch endpoint Id config too many requests response a status code equal to that given
   328  func (o *PatchEndpointIDConfigTooManyRequests) IsCode(code int) bool {
   329  	return code == 429
   330  }
   331  
   332  // Code gets the status code for the patch endpoint Id config too many requests response
   333  func (o *PatchEndpointIDConfigTooManyRequests) Code() int {
   334  	return 429
   335  }
   336  
   337  func (o *PatchEndpointIDConfigTooManyRequests) Error() string {
   338  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigTooManyRequests ", 429)
   339  }
   340  
   341  func (o *PatchEndpointIDConfigTooManyRequests) String() string {
   342  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigTooManyRequests ", 429)
   343  }
   344  
   345  func (o *PatchEndpointIDConfigTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   346  
   347  	return nil
   348  }
   349  
   350  // NewPatchEndpointIDConfigFailed creates a PatchEndpointIDConfigFailed with default headers values
   351  func NewPatchEndpointIDConfigFailed() *PatchEndpointIDConfigFailed {
   352  	return &PatchEndpointIDConfigFailed{}
   353  }
   354  
   355  /*
   356  PatchEndpointIDConfigFailed describes a response with status code 500, with default header values.
   357  
   358  Update failed. Details in message.
   359  */
   360  type PatchEndpointIDConfigFailed struct {
   361  	Payload models.Error
   362  }
   363  
   364  // IsSuccess returns true when this patch endpoint Id config failed response has a 2xx status code
   365  func (o *PatchEndpointIDConfigFailed) IsSuccess() bool {
   366  	return false
   367  }
   368  
   369  // IsRedirect returns true when this patch endpoint Id config failed response has a 3xx status code
   370  func (o *PatchEndpointIDConfigFailed) IsRedirect() bool {
   371  	return false
   372  }
   373  
   374  // IsClientError returns true when this patch endpoint Id config failed response has a 4xx status code
   375  func (o *PatchEndpointIDConfigFailed) IsClientError() bool {
   376  	return false
   377  }
   378  
   379  // IsServerError returns true when this patch endpoint Id config failed response has a 5xx status code
   380  func (o *PatchEndpointIDConfigFailed) IsServerError() bool {
   381  	return true
   382  }
   383  
   384  // IsCode returns true when this patch endpoint Id config failed response a status code equal to that given
   385  func (o *PatchEndpointIDConfigFailed) IsCode(code int) bool {
   386  	return code == 500
   387  }
   388  
   389  // Code gets the status code for the patch endpoint Id config failed response
   390  func (o *PatchEndpointIDConfigFailed) Code() int {
   391  	return 500
   392  }
   393  
   394  func (o *PatchEndpointIDConfigFailed) Error() string {
   395  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigFailed  %+v", 500, o.Payload)
   396  }
   397  
   398  func (o *PatchEndpointIDConfigFailed) String() string {
   399  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigFailed  %+v", 500, o.Payload)
   400  }
   401  
   402  func (o *PatchEndpointIDConfigFailed) GetPayload() models.Error {
   403  	return o.Payload
   404  }
   405  
   406  func (o *PatchEndpointIDConfigFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   407  
   408  	// response payload
   409  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   410  		return err
   411  	}
   412  
   413  	return nil
   414  }