github.com/cilium/cilium@v1.16.2/api/v1/client/endpoint/get_endpoint_id_healthz_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  // GetEndpointIDHealthzReader is a Reader for the GetEndpointIDHealthz structure.
    22  type GetEndpointIDHealthzReader struct {
    23  	formats strfmt.Registry
    24  }
    25  
    26  // ReadResponse reads a server response into the received o.
    27  func (o *GetEndpointIDHealthzReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    28  	switch response.Code() {
    29  	case 200:
    30  		result := NewGetEndpointIDHealthzOK()
    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 := NewGetEndpointIDHealthzInvalid()
    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 := NewGetEndpointIDHealthzNotFound()
    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 := NewGetEndpointIDHealthzTooManyRequests()
    49  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    50  			return nil, err
    51  		}
    52  		return nil, result
    53  	default:
    54  		return nil, runtime.NewAPIError("[GET /endpoint/{id}/healthz] GetEndpointIDHealthz", response, response.Code())
    55  	}
    56  }
    57  
    58  // NewGetEndpointIDHealthzOK creates a GetEndpointIDHealthzOK with default headers values
    59  func NewGetEndpointIDHealthzOK() *GetEndpointIDHealthzOK {
    60  	return &GetEndpointIDHealthzOK{}
    61  }
    62  
    63  /*
    64  GetEndpointIDHealthzOK describes a response with status code 200, with default header values.
    65  
    66  Success
    67  */
    68  type GetEndpointIDHealthzOK struct {
    69  	Payload *models.EndpointHealth
    70  }
    71  
    72  // IsSuccess returns true when this get endpoint Id healthz o k response has a 2xx status code
    73  func (o *GetEndpointIDHealthzOK) IsSuccess() bool {
    74  	return true
    75  }
    76  
    77  // IsRedirect returns true when this get endpoint Id healthz o k response has a 3xx status code
    78  func (o *GetEndpointIDHealthzOK) IsRedirect() bool {
    79  	return false
    80  }
    81  
    82  // IsClientError returns true when this get endpoint Id healthz o k response has a 4xx status code
    83  func (o *GetEndpointIDHealthzOK) IsClientError() bool {
    84  	return false
    85  }
    86  
    87  // IsServerError returns true when this get endpoint Id healthz o k response has a 5xx status code
    88  func (o *GetEndpointIDHealthzOK) IsServerError() bool {
    89  	return false
    90  }
    91  
    92  // IsCode returns true when this get endpoint Id healthz o k response a status code equal to that given
    93  func (o *GetEndpointIDHealthzOK) IsCode(code int) bool {
    94  	return code == 200
    95  }
    96  
    97  // Code gets the status code for the get endpoint Id healthz o k response
    98  func (o *GetEndpointIDHealthzOK) Code() int {
    99  	return 200
   100  }
   101  
   102  func (o *GetEndpointIDHealthzOK) Error() string {
   103  	return fmt.Sprintf("[GET /endpoint/{id}/healthz][%d] getEndpointIdHealthzOK  %+v", 200, o.Payload)
   104  }
   105  
   106  func (o *GetEndpointIDHealthzOK) String() string {
   107  	return fmt.Sprintf("[GET /endpoint/{id}/healthz][%d] getEndpointIdHealthzOK  %+v", 200, o.Payload)
   108  }
   109  
   110  func (o *GetEndpointIDHealthzOK) GetPayload() *models.EndpointHealth {
   111  	return o.Payload
   112  }
   113  
   114  func (o *GetEndpointIDHealthzOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   115  
   116  	o.Payload = new(models.EndpointHealth)
   117  
   118  	// response payload
   119  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   120  		return err
   121  	}
   122  
   123  	return nil
   124  }
   125  
   126  // NewGetEndpointIDHealthzInvalid creates a GetEndpointIDHealthzInvalid with default headers values
   127  func NewGetEndpointIDHealthzInvalid() *GetEndpointIDHealthzInvalid {
   128  	return &GetEndpointIDHealthzInvalid{}
   129  }
   130  
   131  /*
   132  GetEndpointIDHealthzInvalid describes a response with status code 400, with default header values.
   133  
   134  Invalid identity provided
   135  */
   136  type GetEndpointIDHealthzInvalid struct {
   137  }
   138  
   139  // IsSuccess returns true when this get endpoint Id healthz invalid response has a 2xx status code
   140  func (o *GetEndpointIDHealthzInvalid) IsSuccess() bool {
   141  	return false
   142  }
   143  
   144  // IsRedirect returns true when this get endpoint Id healthz invalid response has a 3xx status code
   145  func (o *GetEndpointIDHealthzInvalid) IsRedirect() bool {
   146  	return false
   147  }
   148  
   149  // IsClientError returns true when this get endpoint Id healthz invalid response has a 4xx status code
   150  func (o *GetEndpointIDHealthzInvalid) IsClientError() bool {
   151  	return true
   152  }
   153  
   154  // IsServerError returns true when this get endpoint Id healthz invalid response has a 5xx status code
   155  func (o *GetEndpointIDHealthzInvalid) IsServerError() bool {
   156  	return false
   157  }
   158  
   159  // IsCode returns true when this get endpoint Id healthz invalid response a status code equal to that given
   160  func (o *GetEndpointIDHealthzInvalid) IsCode(code int) bool {
   161  	return code == 400
   162  }
   163  
   164  // Code gets the status code for the get endpoint Id healthz invalid response
   165  func (o *GetEndpointIDHealthzInvalid) Code() int {
   166  	return 400
   167  }
   168  
   169  func (o *GetEndpointIDHealthzInvalid) Error() string {
   170  	return fmt.Sprintf("[GET /endpoint/{id}/healthz][%d] getEndpointIdHealthzInvalid ", 400)
   171  }
   172  
   173  func (o *GetEndpointIDHealthzInvalid) String() string {
   174  	return fmt.Sprintf("[GET /endpoint/{id}/healthz][%d] getEndpointIdHealthzInvalid ", 400)
   175  }
   176  
   177  func (o *GetEndpointIDHealthzInvalid) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   178  
   179  	return nil
   180  }
   181  
   182  // NewGetEndpointIDHealthzNotFound creates a GetEndpointIDHealthzNotFound with default headers values
   183  func NewGetEndpointIDHealthzNotFound() *GetEndpointIDHealthzNotFound {
   184  	return &GetEndpointIDHealthzNotFound{}
   185  }
   186  
   187  /*
   188  GetEndpointIDHealthzNotFound describes a response with status code 404, with default header values.
   189  
   190  Endpoint not found
   191  */
   192  type GetEndpointIDHealthzNotFound struct {
   193  }
   194  
   195  // IsSuccess returns true when this get endpoint Id healthz not found response has a 2xx status code
   196  func (o *GetEndpointIDHealthzNotFound) IsSuccess() bool {
   197  	return false
   198  }
   199  
   200  // IsRedirect returns true when this get endpoint Id healthz not found response has a 3xx status code
   201  func (o *GetEndpointIDHealthzNotFound) IsRedirect() bool {
   202  	return false
   203  }
   204  
   205  // IsClientError returns true when this get endpoint Id healthz not found response has a 4xx status code
   206  func (o *GetEndpointIDHealthzNotFound) IsClientError() bool {
   207  	return true
   208  }
   209  
   210  // IsServerError returns true when this get endpoint Id healthz not found response has a 5xx status code
   211  func (o *GetEndpointIDHealthzNotFound) IsServerError() bool {
   212  	return false
   213  }
   214  
   215  // IsCode returns true when this get endpoint Id healthz not found response a status code equal to that given
   216  func (o *GetEndpointIDHealthzNotFound) IsCode(code int) bool {
   217  	return code == 404
   218  }
   219  
   220  // Code gets the status code for the get endpoint Id healthz not found response
   221  func (o *GetEndpointIDHealthzNotFound) Code() int {
   222  	return 404
   223  }
   224  
   225  func (o *GetEndpointIDHealthzNotFound) Error() string {
   226  	return fmt.Sprintf("[GET /endpoint/{id}/healthz][%d] getEndpointIdHealthzNotFound ", 404)
   227  }
   228  
   229  func (o *GetEndpointIDHealthzNotFound) String() string {
   230  	return fmt.Sprintf("[GET /endpoint/{id}/healthz][%d] getEndpointIdHealthzNotFound ", 404)
   231  }
   232  
   233  func (o *GetEndpointIDHealthzNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   234  
   235  	return nil
   236  }
   237  
   238  // NewGetEndpointIDHealthzTooManyRequests creates a GetEndpointIDHealthzTooManyRequests with default headers values
   239  func NewGetEndpointIDHealthzTooManyRequests() *GetEndpointIDHealthzTooManyRequests {
   240  	return &GetEndpointIDHealthzTooManyRequests{}
   241  }
   242  
   243  /*
   244  GetEndpointIDHealthzTooManyRequests describes a response with status code 429, with default header values.
   245  
   246  Rate-limiting too many requests in the given time frame
   247  */
   248  type GetEndpointIDHealthzTooManyRequests struct {
   249  }
   250  
   251  // IsSuccess returns true when this get endpoint Id healthz too many requests response has a 2xx status code
   252  func (o *GetEndpointIDHealthzTooManyRequests) IsSuccess() bool {
   253  	return false
   254  }
   255  
   256  // IsRedirect returns true when this get endpoint Id healthz too many requests response has a 3xx status code
   257  func (o *GetEndpointIDHealthzTooManyRequests) IsRedirect() bool {
   258  	return false
   259  }
   260  
   261  // IsClientError returns true when this get endpoint Id healthz too many requests response has a 4xx status code
   262  func (o *GetEndpointIDHealthzTooManyRequests) IsClientError() bool {
   263  	return true
   264  }
   265  
   266  // IsServerError returns true when this get endpoint Id healthz too many requests response has a 5xx status code
   267  func (o *GetEndpointIDHealthzTooManyRequests) IsServerError() bool {
   268  	return false
   269  }
   270  
   271  // IsCode returns true when this get endpoint Id healthz too many requests response a status code equal to that given
   272  func (o *GetEndpointIDHealthzTooManyRequests) IsCode(code int) bool {
   273  	return code == 429
   274  }
   275  
   276  // Code gets the status code for the get endpoint Id healthz too many requests response
   277  func (o *GetEndpointIDHealthzTooManyRequests) Code() int {
   278  	return 429
   279  }
   280  
   281  func (o *GetEndpointIDHealthzTooManyRequests) Error() string {
   282  	return fmt.Sprintf("[GET /endpoint/{id}/healthz][%d] getEndpointIdHealthzTooManyRequests ", 429)
   283  }
   284  
   285  func (o *GetEndpointIDHealthzTooManyRequests) String() string {
   286  	return fmt.Sprintf("[GET /endpoint/{id}/healthz][%d] getEndpointIdHealthzTooManyRequests ", 429)
   287  }
   288  
   289  func (o *GetEndpointIDHealthzTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   290  
   291  	return nil
   292  }