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