github.com/cilium/cilium@v1.16.2/api/v1/client/endpoint/patch_endpoint_id_labels_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  // PatchEndpointIDLabelsReader is a Reader for the PatchEndpointIDLabels structure.
    22  type PatchEndpointIDLabelsReader struct {
    23  	formats strfmt.Registry
    24  }
    25  
    26  // ReadResponse reads a server response into the received o.
    27  func (o *PatchEndpointIDLabelsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    28  	switch response.Code() {
    29  	case 200:
    30  		result := NewPatchEndpointIDLabelsOK()
    31  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    32  			return nil, err
    33  		}
    34  		return result, nil
    35  	case 403:
    36  		result := NewPatchEndpointIDLabelsForbidden()
    37  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    38  			return nil, err
    39  		}
    40  		return nil, result
    41  	case 404:
    42  		result := NewPatchEndpointIDLabelsNotFound()
    43  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    44  			return nil, err
    45  		}
    46  		return nil, result
    47  	case 429:
    48  		result := NewPatchEndpointIDLabelsTooManyRequests()
    49  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    50  			return nil, err
    51  		}
    52  		return nil, result
    53  	case 500:
    54  		result := NewPatchEndpointIDLabelsUpdateFailed()
    55  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    56  			return nil, err
    57  		}
    58  		return nil, result
    59  	default:
    60  		return nil, runtime.NewAPIError("[PATCH /endpoint/{id}/labels] PatchEndpointIDLabels", response, response.Code())
    61  	}
    62  }
    63  
    64  // NewPatchEndpointIDLabelsOK creates a PatchEndpointIDLabelsOK with default headers values
    65  func NewPatchEndpointIDLabelsOK() *PatchEndpointIDLabelsOK {
    66  	return &PatchEndpointIDLabelsOK{}
    67  }
    68  
    69  /*
    70  PatchEndpointIDLabelsOK describes a response with status code 200, with default header values.
    71  
    72  Success
    73  */
    74  type PatchEndpointIDLabelsOK struct {
    75  }
    76  
    77  // IsSuccess returns true when this patch endpoint Id labels o k response has a 2xx status code
    78  func (o *PatchEndpointIDLabelsOK) IsSuccess() bool {
    79  	return true
    80  }
    81  
    82  // IsRedirect returns true when this patch endpoint Id labels o k response has a 3xx status code
    83  func (o *PatchEndpointIDLabelsOK) IsRedirect() bool {
    84  	return false
    85  }
    86  
    87  // IsClientError returns true when this patch endpoint Id labels o k response has a 4xx status code
    88  func (o *PatchEndpointIDLabelsOK) IsClientError() bool {
    89  	return false
    90  }
    91  
    92  // IsServerError returns true when this patch endpoint Id labels o k response has a 5xx status code
    93  func (o *PatchEndpointIDLabelsOK) IsServerError() bool {
    94  	return false
    95  }
    96  
    97  // IsCode returns true when this patch endpoint Id labels o k response a status code equal to that given
    98  func (o *PatchEndpointIDLabelsOK) IsCode(code int) bool {
    99  	return code == 200
   100  }
   101  
   102  // Code gets the status code for the patch endpoint Id labels o k response
   103  func (o *PatchEndpointIDLabelsOK) Code() int {
   104  	return 200
   105  }
   106  
   107  func (o *PatchEndpointIDLabelsOK) Error() string {
   108  	return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsOK ", 200)
   109  }
   110  
   111  func (o *PatchEndpointIDLabelsOK) String() string {
   112  	return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsOK ", 200)
   113  }
   114  
   115  func (o *PatchEndpointIDLabelsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   116  
   117  	return nil
   118  }
   119  
   120  // NewPatchEndpointIDLabelsForbidden creates a PatchEndpointIDLabelsForbidden with default headers values
   121  func NewPatchEndpointIDLabelsForbidden() *PatchEndpointIDLabelsForbidden {
   122  	return &PatchEndpointIDLabelsForbidden{}
   123  }
   124  
   125  /*
   126  PatchEndpointIDLabelsForbidden describes a response with status code 403, with default header values.
   127  
   128  Forbidden
   129  */
   130  type PatchEndpointIDLabelsForbidden struct {
   131  }
   132  
   133  // IsSuccess returns true when this patch endpoint Id labels forbidden response has a 2xx status code
   134  func (o *PatchEndpointIDLabelsForbidden) IsSuccess() bool {
   135  	return false
   136  }
   137  
   138  // IsRedirect returns true when this patch endpoint Id labels forbidden response has a 3xx status code
   139  func (o *PatchEndpointIDLabelsForbidden) IsRedirect() bool {
   140  	return false
   141  }
   142  
   143  // IsClientError returns true when this patch endpoint Id labels forbidden response has a 4xx status code
   144  func (o *PatchEndpointIDLabelsForbidden) IsClientError() bool {
   145  	return true
   146  }
   147  
   148  // IsServerError returns true when this patch endpoint Id labels forbidden response has a 5xx status code
   149  func (o *PatchEndpointIDLabelsForbidden) IsServerError() bool {
   150  	return false
   151  }
   152  
   153  // IsCode returns true when this patch endpoint Id labels forbidden response a status code equal to that given
   154  func (o *PatchEndpointIDLabelsForbidden) IsCode(code int) bool {
   155  	return code == 403
   156  }
   157  
   158  // Code gets the status code for the patch endpoint Id labels forbidden response
   159  func (o *PatchEndpointIDLabelsForbidden) Code() int {
   160  	return 403
   161  }
   162  
   163  func (o *PatchEndpointIDLabelsForbidden) Error() string {
   164  	return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsForbidden ", 403)
   165  }
   166  
   167  func (o *PatchEndpointIDLabelsForbidden) String() string {
   168  	return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsForbidden ", 403)
   169  }
   170  
   171  func (o *PatchEndpointIDLabelsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   172  
   173  	return nil
   174  }
   175  
   176  // NewPatchEndpointIDLabelsNotFound creates a PatchEndpointIDLabelsNotFound with default headers values
   177  func NewPatchEndpointIDLabelsNotFound() *PatchEndpointIDLabelsNotFound {
   178  	return &PatchEndpointIDLabelsNotFound{}
   179  }
   180  
   181  /*
   182  PatchEndpointIDLabelsNotFound describes a response with status code 404, with default header values.
   183  
   184  Endpoint not found
   185  */
   186  type PatchEndpointIDLabelsNotFound struct {
   187  }
   188  
   189  // IsSuccess returns true when this patch endpoint Id labels not found response has a 2xx status code
   190  func (o *PatchEndpointIDLabelsNotFound) IsSuccess() bool {
   191  	return false
   192  }
   193  
   194  // IsRedirect returns true when this patch endpoint Id labels not found response has a 3xx status code
   195  func (o *PatchEndpointIDLabelsNotFound) IsRedirect() bool {
   196  	return false
   197  }
   198  
   199  // IsClientError returns true when this patch endpoint Id labels not found response has a 4xx status code
   200  func (o *PatchEndpointIDLabelsNotFound) IsClientError() bool {
   201  	return true
   202  }
   203  
   204  // IsServerError returns true when this patch endpoint Id labels not found response has a 5xx status code
   205  func (o *PatchEndpointIDLabelsNotFound) IsServerError() bool {
   206  	return false
   207  }
   208  
   209  // IsCode returns true when this patch endpoint Id labels not found response a status code equal to that given
   210  func (o *PatchEndpointIDLabelsNotFound) IsCode(code int) bool {
   211  	return code == 404
   212  }
   213  
   214  // Code gets the status code for the patch endpoint Id labels not found response
   215  func (o *PatchEndpointIDLabelsNotFound) Code() int {
   216  	return 404
   217  }
   218  
   219  func (o *PatchEndpointIDLabelsNotFound) Error() string {
   220  	return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsNotFound ", 404)
   221  }
   222  
   223  func (o *PatchEndpointIDLabelsNotFound) String() string {
   224  	return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsNotFound ", 404)
   225  }
   226  
   227  func (o *PatchEndpointIDLabelsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   228  
   229  	return nil
   230  }
   231  
   232  // NewPatchEndpointIDLabelsTooManyRequests creates a PatchEndpointIDLabelsTooManyRequests with default headers values
   233  func NewPatchEndpointIDLabelsTooManyRequests() *PatchEndpointIDLabelsTooManyRequests {
   234  	return &PatchEndpointIDLabelsTooManyRequests{}
   235  }
   236  
   237  /*
   238  PatchEndpointIDLabelsTooManyRequests describes a response with status code 429, with default header values.
   239  
   240  Rate-limiting too many requests in the given time frame
   241  */
   242  type PatchEndpointIDLabelsTooManyRequests struct {
   243  }
   244  
   245  // IsSuccess returns true when this patch endpoint Id labels too many requests response has a 2xx status code
   246  func (o *PatchEndpointIDLabelsTooManyRequests) IsSuccess() bool {
   247  	return false
   248  }
   249  
   250  // IsRedirect returns true when this patch endpoint Id labels too many requests response has a 3xx status code
   251  func (o *PatchEndpointIDLabelsTooManyRequests) IsRedirect() bool {
   252  	return false
   253  }
   254  
   255  // IsClientError returns true when this patch endpoint Id labels too many requests response has a 4xx status code
   256  func (o *PatchEndpointIDLabelsTooManyRequests) IsClientError() bool {
   257  	return true
   258  }
   259  
   260  // IsServerError returns true when this patch endpoint Id labels too many requests response has a 5xx status code
   261  func (o *PatchEndpointIDLabelsTooManyRequests) IsServerError() bool {
   262  	return false
   263  }
   264  
   265  // IsCode returns true when this patch endpoint Id labels too many requests response a status code equal to that given
   266  func (o *PatchEndpointIDLabelsTooManyRequests) IsCode(code int) bool {
   267  	return code == 429
   268  }
   269  
   270  // Code gets the status code for the patch endpoint Id labels too many requests response
   271  func (o *PatchEndpointIDLabelsTooManyRequests) Code() int {
   272  	return 429
   273  }
   274  
   275  func (o *PatchEndpointIDLabelsTooManyRequests) Error() string {
   276  	return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsTooManyRequests ", 429)
   277  }
   278  
   279  func (o *PatchEndpointIDLabelsTooManyRequests) String() string {
   280  	return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsTooManyRequests ", 429)
   281  }
   282  
   283  func (o *PatchEndpointIDLabelsTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   284  
   285  	return nil
   286  }
   287  
   288  // NewPatchEndpointIDLabelsUpdateFailed creates a PatchEndpointIDLabelsUpdateFailed with default headers values
   289  func NewPatchEndpointIDLabelsUpdateFailed() *PatchEndpointIDLabelsUpdateFailed {
   290  	return &PatchEndpointIDLabelsUpdateFailed{}
   291  }
   292  
   293  /*
   294  PatchEndpointIDLabelsUpdateFailed describes a response with status code 500, with default header values.
   295  
   296  Error while updating labels
   297  */
   298  type PatchEndpointIDLabelsUpdateFailed struct {
   299  	Payload models.Error
   300  }
   301  
   302  // IsSuccess returns true when this patch endpoint Id labels update failed response has a 2xx status code
   303  func (o *PatchEndpointIDLabelsUpdateFailed) IsSuccess() bool {
   304  	return false
   305  }
   306  
   307  // IsRedirect returns true when this patch endpoint Id labels update failed response has a 3xx status code
   308  func (o *PatchEndpointIDLabelsUpdateFailed) IsRedirect() bool {
   309  	return false
   310  }
   311  
   312  // IsClientError returns true when this patch endpoint Id labels update failed response has a 4xx status code
   313  func (o *PatchEndpointIDLabelsUpdateFailed) IsClientError() bool {
   314  	return false
   315  }
   316  
   317  // IsServerError returns true when this patch endpoint Id labels update failed response has a 5xx status code
   318  func (o *PatchEndpointIDLabelsUpdateFailed) IsServerError() bool {
   319  	return true
   320  }
   321  
   322  // IsCode returns true when this patch endpoint Id labels update failed response a status code equal to that given
   323  func (o *PatchEndpointIDLabelsUpdateFailed) IsCode(code int) bool {
   324  	return code == 500
   325  }
   326  
   327  // Code gets the status code for the patch endpoint Id labels update failed response
   328  func (o *PatchEndpointIDLabelsUpdateFailed) Code() int {
   329  	return 500
   330  }
   331  
   332  func (o *PatchEndpointIDLabelsUpdateFailed) Error() string {
   333  	return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsUpdateFailed  %+v", 500, o.Payload)
   334  }
   335  
   336  func (o *PatchEndpointIDLabelsUpdateFailed) String() string {
   337  	return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsUpdateFailed  %+v", 500, o.Payload)
   338  }
   339  
   340  func (o *PatchEndpointIDLabelsUpdateFailed) GetPayload() models.Error {
   341  	return o.Payload
   342  }
   343  
   344  func (o *PatchEndpointIDLabelsUpdateFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   345  
   346  	// response payload
   347  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   348  		return err
   349  	}
   350  
   351  	return nil
   352  }