github.com/kubearmor/cilium@v1.6.12/api/v1/client/endpoint/get_endpoint_id_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package endpoint
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"fmt"
    10  	"io"
    11  
    12  	"github.com/go-openapi/runtime"
    13  
    14  	strfmt "github.com/go-openapi/strfmt"
    15  
    16  	models "github.com/cilium/cilium/api/v1/models"
    17  )
    18  
    19  // GetEndpointIDReader is a Reader for the GetEndpointID structure.
    20  type GetEndpointIDReader struct {
    21  	formats strfmt.Registry
    22  }
    23  
    24  // ReadResponse reads a server response into the received o.
    25  func (o *GetEndpointIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    26  	switch response.Code() {
    27  
    28  	case 200:
    29  		result := NewGetEndpointIDOK()
    30  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    31  			return nil, err
    32  		}
    33  		return result, nil
    34  
    35  	case 400:
    36  		result := NewGetEndpointIDInvalid()
    37  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    38  			return nil, err
    39  		}
    40  		return nil, result
    41  
    42  	case 404:
    43  		result := NewGetEndpointIDNotFound()
    44  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    45  			return nil, err
    46  		}
    47  		return nil, result
    48  
    49  	default:
    50  		return nil, runtime.NewAPIError("unknown error", response, response.Code())
    51  	}
    52  }
    53  
    54  // NewGetEndpointIDOK creates a GetEndpointIDOK with default headers values
    55  func NewGetEndpointIDOK() *GetEndpointIDOK {
    56  	return &GetEndpointIDOK{}
    57  }
    58  
    59  /*GetEndpointIDOK handles this case with default header values.
    60  
    61  Success
    62  */
    63  type GetEndpointIDOK struct {
    64  	Payload *models.Endpoint
    65  }
    66  
    67  func (o *GetEndpointIDOK) Error() string {
    68  	return fmt.Sprintf("[GET /endpoint/{id}][%d] getEndpointIdOK  %+v", 200, o.Payload)
    69  }
    70  
    71  func (o *GetEndpointIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
    72  
    73  	o.Payload = new(models.Endpoint)
    74  
    75  	// response payload
    76  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
    77  		return err
    78  	}
    79  
    80  	return nil
    81  }
    82  
    83  // NewGetEndpointIDInvalid creates a GetEndpointIDInvalid with default headers values
    84  func NewGetEndpointIDInvalid() *GetEndpointIDInvalid {
    85  	return &GetEndpointIDInvalid{}
    86  }
    87  
    88  /*GetEndpointIDInvalid handles this case with default header values.
    89  
    90  Invalid endpoint ID format for specified type
    91  */
    92  type GetEndpointIDInvalid struct {
    93  	Payload models.Error
    94  }
    95  
    96  func (o *GetEndpointIDInvalid) Error() string {
    97  	return fmt.Sprintf("[GET /endpoint/{id}][%d] getEndpointIdInvalid  %+v", 400, o.Payload)
    98  }
    99  
   100  func (o *GetEndpointIDInvalid) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   101  
   102  	// response payload
   103  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   104  		return err
   105  	}
   106  
   107  	return nil
   108  }
   109  
   110  // NewGetEndpointIDNotFound creates a GetEndpointIDNotFound with default headers values
   111  func NewGetEndpointIDNotFound() *GetEndpointIDNotFound {
   112  	return &GetEndpointIDNotFound{}
   113  }
   114  
   115  /*GetEndpointIDNotFound handles this case with default header values.
   116  
   117  Endpoint not found
   118  */
   119  type GetEndpointIDNotFound struct {
   120  }
   121  
   122  func (o *GetEndpointIDNotFound) Error() string {
   123  	return fmt.Sprintf("[GET /endpoint/{id}][%d] getEndpointIdNotFound ", 404)
   124  }
   125  
   126  func (o *GetEndpointIDNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   127  
   128  	return nil
   129  }