github.com/cilium/cilium@v1.16.2/api/v1/client/endpoint/get_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  // GetEndpointIDLabelsReader is a Reader for the GetEndpointIDLabels structure.
    22  type GetEndpointIDLabelsReader struct {
    23  	formats strfmt.Registry
    24  }
    25  
    26  // ReadResponse reads a server response into the received o.
    27  func (o *GetEndpointIDLabelsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    28  	switch response.Code() {
    29  	case 200:
    30  		result := NewGetEndpointIDLabelsOK()
    31  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    32  			return nil, err
    33  		}
    34  		return result, nil
    35  	case 404:
    36  		result := NewGetEndpointIDLabelsNotFound()
    37  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    38  			return nil, err
    39  		}
    40  		return nil, result
    41  	case 429:
    42  		result := NewGetEndpointIDLabelsTooManyRequests()
    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("[GET /endpoint/{id}/labels] GetEndpointIDLabels", response, response.Code())
    49  	}
    50  }
    51  
    52  // NewGetEndpointIDLabelsOK creates a GetEndpointIDLabelsOK with default headers values
    53  func NewGetEndpointIDLabelsOK() *GetEndpointIDLabelsOK {
    54  	return &GetEndpointIDLabelsOK{}
    55  }
    56  
    57  /*
    58  GetEndpointIDLabelsOK describes a response with status code 200, with default header values.
    59  
    60  Success
    61  */
    62  type GetEndpointIDLabelsOK struct {
    63  	Payload *models.LabelConfiguration
    64  }
    65  
    66  // IsSuccess returns true when this get endpoint Id labels o k response has a 2xx status code
    67  func (o *GetEndpointIDLabelsOK) IsSuccess() bool {
    68  	return true
    69  }
    70  
    71  // IsRedirect returns true when this get endpoint Id labels o k response has a 3xx status code
    72  func (o *GetEndpointIDLabelsOK) IsRedirect() bool {
    73  	return false
    74  }
    75  
    76  // IsClientError returns true when this get endpoint Id labels o k response has a 4xx status code
    77  func (o *GetEndpointIDLabelsOK) IsClientError() bool {
    78  	return false
    79  }
    80  
    81  // IsServerError returns true when this get endpoint Id labels o k response has a 5xx status code
    82  func (o *GetEndpointIDLabelsOK) IsServerError() bool {
    83  	return false
    84  }
    85  
    86  // IsCode returns true when this get endpoint Id labels o k response a status code equal to that given
    87  func (o *GetEndpointIDLabelsOK) IsCode(code int) bool {
    88  	return code == 200
    89  }
    90  
    91  // Code gets the status code for the get endpoint Id labels o k response
    92  func (o *GetEndpointIDLabelsOK) Code() int {
    93  	return 200
    94  }
    95  
    96  func (o *GetEndpointIDLabelsOK) Error() string {
    97  	return fmt.Sprintf("[GET /endpoint/{id}/labels][%d] getEndpointIdLabelsOK  %+v", 200, o.Payload)
    98  }
    99  
   100  func (o *GetEndpointIDLabelsOK) String() string {
   101  	return fmt.Sprintf("[GET /endpoint/{id}/labels][%d] getEndpointIdLabelsOK  %+v", 200, o.Payload)
   102  }
   103  
   104  func (o *GetEndpointIDLabelsOK) GetPayload() *models.LabelConfiguration {
   105  	return o.Payload
   106  }
   107  
   108  func (o *GetEndpointIDLabelsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   109  
   110  	o.Payload = new(models.LabelConfiguration)
   111  
   112  	// response payload
   113  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   114  		return err
   115  	}
   116  
   117  	return nil
   118  }
   119  
   120  // NewGetEndpointIDLabelsNotFound creates a GetEndpointIDLabelsNotFound with default headers values
   121  func NewGetEndpointIDLabelsNotFound() *GetEndpointIDLabelsNotFound {
   122  	return &GetEndpointIDLabelsNotFound{}
   123  }
   124  
   125  /*
   126  GetEndpointIDLabelsNotFound describes a response with status code 404, with default header values.
   127  
   128  Endpoint not found
   129  */
   130  type GetEndpointIDLabelsNotFound struct {
   131  }
   132  
   133  // IsSuccess returns true when this get endpoint Id labels not found response has a 2xx status code
   134  func (o *GetEndpointIDLabelsNotFound) IsSuccess() bool {
   135  	return false
   136  }
   137  
   138  // IsRedirect returns true when this get endpoint Id labels not found response has a 3xx status code
   139  func (o *GetEndpointIDLabelsNotFound) IsRedirect() bool {
   140  	return false
   141  }
   142  
   143  // IsClientError returns true when this get endpoint Id labels not found response has a 4xx status code
   144  func (o *GetEndpointIDLabelsNotFound) IsClientError() bool {
   145  	return true
   146  }
   147  
   148  // IsServerError returns true when this get endpoint Id labels not found response has a 5xx status code
   149  func (o *GetEndpointIDLabelsNotFound) IsServerError() bool {
   150  	return false
   151  }
   152  
   153  // IsCode returns true when this get endpoint Id labels not found response a status code equal to that given
   154  func (o *GetEndpointIDLabelsNotFound) IsCode(code int) bool {
   155  	return code == 404
   156  }
   157  
   158  // Code gets the status code for the get endpoint Id labels not found response
   159  func (o *GetEndpointIDLabelsNotFound) Code() int {
   160  	return 404
   161  }
   162  
   163  func (o *GetEndpointIDLabelsNotFound) Error() string {
   164  	return fmt.Sprintf("[GET /endpoint/{id}/labels][%d] getEndpointIdLabelsNotFound ", 404)
   165  }
   166  
   167  func (o *GetEndpointIDLabelsNotFound) String() string {
   168  	return fmt.Sprintf("[GET /endpoint/{id}/labels][%d] getEndpointIdLabelsNotFound ", 404)
   169  }
   170  
   171  func (o *GetEndpointIDLabelsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   172  
   173  	return nil
   174  }
   175  
   176  // NewGetEndpointIDLabelsTooManyRequests creates a GetEndpointIDLabelsTooManyRequests with default headers values
   177  func NewGetEndpointIDLabelsTooManyRequests() *GetEndpointIDLabelsTooManyRequests {
   178  	return &GetEndpointIDLabelsTooManyRequests{}
   179  }
   180  
   181  /*
   182  GetEndpointIDLabelsTooManyRequests describes a response with status code 429, with default header values.
   183  
   184  Rate-limiting too many requests in the given time frame
   185  */
   186  type GetEndpointIDLabelsTooManyRequests struct {
   187  }
   188  
   189  // IsSuccess returns true when this get endpoint Id labels too many requests response has a 2xx status code
   190  func (o *GetEndpointIDLabelsTooManyRequests) IsSuccess() bool {
   191  	return false
   192  }
   193  
   194  // IsRedirect returns true when this get endpoint Id labels too many requests response has a 3xx status code
   195  func (o *GetEndpointIDLabelsTooManyRequests) IsRedirect() bool {
   196  	return false
   197  }
   198  
   199  // IsClientError returns true when this get endpoint Id labels too many requests response has a 4xx status code
   200  func (o *GetEndpointIDLabelsTooManyRequests) IsClientError() bool {
   201  	return true
   202  }
   203  
   204  // IsServerError returns true when this get endpoint Id labels too many requests response has a 5xx status code
   205  func (o *GetEndpointIDLabelsTooManyRequests) IsServerError() bool {
   206  	return false
   207  }
   208  
   209  // IsCode returns true when this get endpoint Id labels too many requests response a status code equal to that given
   210  func (o *GetEndpointIDLabelsTooManyRequests) IsCode(code int) bool {
   211  	return code == 429
   212  }
   213  
   214  // Code gets the status code for the get endpoint Id labels too many requests response
   215  func (o *GetEndpointIDLabelsTooManyRequests) Code() int {
   216  	return 429
   217  }
   218  
   219  func (o *GetEndpointIDLabelsTooManyRequests) Error() string {
   220  	return fmt.Sprintf("[GET /endpoint/{id}/labels][%d] getEndpointIdLabelsTooManyRequests ", 429)
   221  }
   222  
   223  func (o *GetEndpointIDLabelsTooManyRequests) String() string {
   224  	return fmt.Sprintf("[GET /endpoint/{id}/labels][%d] getEndpointIdLabelsTooManyRequests ", 429)
   225  }
   226  
   227  func (o *GetEndpointIDLabelsTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   228  
   229  	return nil
   230  }