github.com/kubearmor/cilium@v1.6.12/api/v1/server/restapi/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  	"net/http"
    10  
    11  	"github.com/go-openapi/runtime"
    12  
    13  	models "github.com/cilium/cilium/api/v1/models"
    14  )
    15  
    16  // GetEndpointIDOKCode is the HTTP code returned for type GetEndpointIDOK
    17  const GetEndpointIDOKCode int = 200
    18  
    19  /*GetEndpointIDOK Success
    20  
    21  swagger:response getEndpointIdOK
    22  */
    23  type GetEndpointIDOK struct {
    24  
    25  	/*
    26  	  In: Body
    27  	*/
    28  	Payload *models.Endpoint `json:"body,omitempty"`
    29  }
    30  
    31  // NewGetEndpointIDOK creates GetEndpointIDOK with default headers values
    32  func NewGetEndpointIDOK() *GetEndpointIDOK {
    33  
    34  	return &GetEndpointIDOK{}
    35  }
    36  
    37  // WithPayload adds the payload to the get endpoint Id o k response
    38  func (o *GetEndpointIDOK) WithPayload(payload *models.Endpoint) *GetEndpointIDOK {
    39  	o.Payload = payload
    40  	return o
    41  }
    42  
    43  // SetPayload sets the payload to the get endpoint Id o k response
    44  func (o *GetEndpointIDOK) SetPayload(payload *models.Endpoint) {
    45  	o.Payload = payload
    46  }
    47  
    48  // WriteResponse to the client
    49  func (o *GetEndpointIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    50  
    51  	rw.WriteHeader(200)
    52  	if o.Payload != nil {
    53  		payload := o.Payload
    54  		if err := producer.Produce(rw, payload); err != nil {
    55  			panic(err) // let the recovery middleware deal with this
    56  		}
    57  	}
    58  }
    59  
    60  // GetEndpointIDInvalidCode is the HTTP code returned for type GetEndpointIDInvalid
    61  const GetEndpointIDInvalidCode int = 400
    62  
    63  /*GetEndpointIDInvalid Invalid endpoint ID format for specified type
    64  
    65  swagger:response getEndpointIdInvalid
    66  */
    67  type GetEndpointIDInvalid struct {
    68  
    69  	/*
    70  	  In: Body
    71  	*/
    72  	Payload models.Error `json:"body,omitempty"`
    73  }
    74  
    75  // NewGetEndpointIDInvalid creates GetEndpointIDInvalid with default headers values
    76  func NewGetEndpointIDInvalid() *GetEndpointIDInvalid {
    77  
    78  	return &GetEndpointIDInvalid{}
    79  }
    80  
    81  // WithPayload adds the payload to the get endpoint Id invalid response
    82  func (o *GetEndpointIDInvalid) WithPayload(payload models.Error) *GetEndpointIDInvalid {
    83  	o.Payload = payload
    84  	return o
    85  }
    86  
    87  // SetPayload sets the payload to the get endpoint Id invalid response
    88  func (o *GetEndpointIDInvalid) SetPayload(payload models.Error) {
    89  	o.Payload = payload
    90  }
    91  
    92  // WriteResponse to the client
    93  func (o *GetEndpointIDInvalid) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    94  
    95  	rw.WriteHeader(400)
    96  	payload := o.Payload
    97  	if err := producer.Produce(rw, payload); err != nil {
    98  		panic(err) // let the recovery middleware deal with this
    99  	}
   100  }
   101  
   102  // GetEndpointIDNotFoundCode is the HTTP code returned for type GetEndpointIDNotFound
   103  const GetEndpointIDNotFoundCode int = 404
   104  
   105  /*GetEndpointIDNotFound Endpoint not found
   106  
   107  swagger:response getEndpointIdNotFound
   108  */
   109  type GetEndpointIDNotFound struct {
   110  }
   111  
   112  // NewGetEndpointIDNotFound creates GetEndpointIDNotFound with default headers values
   113  func NewGetEndpointIDNotFound() *GetEndpointIDNotFound {
   114  
   115  	return &GetEndpointIDNotFound{}
   116  }
   117  
   118  // WriteResponse to the client
   119  func (o *GetEndpointIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   120  
   121  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
   122  
   123  	rw.WriteHeader(404)
   124  }