github.com/kubearmor/cilium@v1.6.12/api/v1/server/restapi/endpoint/patch_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  // PatchEndpointIDOKCode is the HTTP code returned for type PatchEndpointIDOK
    17  const PatchEndpointIDOKCode int = 200
    18  
    19  /*PatchEndpointIDOK Success
    20  
    21  swagger:response patchEndpointIdOK
    22  */
    23  type PatchEndpointIDOK struct {
    24  }
    25  
    26  // NewPatchEndpointIDOK creates PatchEndpointIDOK with default headers values
    27  func NewPatchEndpointIDOK() *PatchEndpointIDOK {
    28  
    29  	return &PatchEndpointIDOK{}
    30  }
    31  
    32  // WriteResponse to the client
    33  func (o *PatchEndpointIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    34  
    35  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    36  
    37  	rw.WriteHeader(200)
    38  }
    39  
    40  // PatchEndpointIDInvalidCode is the HTTP code returned for type PatchEndpointIDInvalid
    41  const PatchEndpointIDInvalidCode int = 400
    42  
    43  /*PatchEndpointIDInvalid Invalid modify endpoint request
    44  
    45  swagger:response patchEndpointIdInvalid
    46  */
    47  type PatchEndpointIDInvalid struct {
    48  
    49  	/*
    50  	  In: Body
    51  	*/
    52  	Payload models.Error `json:"body,omitempty"`
    53  }
    54  
    55  // NewPatchEndpointIDInvalid creates PatchEndpointIDInvalid with default headers values
    56  func NewPatchEndpointIDInvalid() *PatchEndpointIDInvalid {
    57  
    58  	return &PatchEndpointIDInvalid{}
    59  }
    60  
    61  // WithPayload adds the payload to the patch endpoint Id invalid response
    62  func (o *PatchEndpointIDInvalid) WithPayload(payload models.Error) *PatchEndpointIDInvalid {
    63  	o.Payload = payload
    64  	return o
    65  }
    66  
    67  // SetPayload sets the payload to the patch endpoint Id invalid response
    68  func (o *PatchEndpointIDInvalid) SetPayload(payload models.Error) {
    69  	o.Payload = payload
    70  }
    71  
    72  // WriteResponse to the client
    73  func (o *PatchEndpointIDInvalid) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    74  
    75  	rw.WriteHeader(400)
    76  	payload := o.Payload
    77  	if err := producer.Produce(rw, payload); err != nil {
    78  		panic(err) // let the recovery middleware deal with this
    79  	}
    80  }
    81  
    82  // PatchEndpointIDNotFoundCode is the HTTP code returned for type PatchEndpointIDNotFound
    83  const PatchEndpointIDNotFoundCode int = 404
    84  
    85  /*PatchEndpointIDNotFound Endpoint does not exist
    86  
    87  swagger:response patchEndpointIdNotFound
    88  */
    89  type PatchEndpointIDNotFound struct {
    90  }
    91  
    92  // NewPatchEndpointIDNotFound creates PatchEndpointIDNotFound with default headers values
    93  func NewPatchEndpointIDNotFound() *PatchEndpointIDNotFound {
    94  
    95  	return &PatchEndpointIDNotFound{}
    96  }
    97  
    98  // WriteResponse to the client
    99  func (o *PatchEndpointIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   100  
   101  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
   102  
   103  	rw.WriteHeader(404)
   104  }
   105  
   106  // PatchEndpointIDFailedCode is the HTTP code returned for type PatchEndpointIDFailed
   107  const PatchEndpointIDFailedCode int = 500
   108  
   109  /*PatchEndpointIDFailed Endpoint update failed
   110  
   111  swagger:response patchEndpointIdFailed
   112  */
   113  type PatchEndpointIDFailed struct {
   114  
   115  	/*
   116  	  In: Body
   117  	*/
   118  	Payload models.Error `json:"body,omitempty"`
   119  }
   120  
   121  // NewPatchEndpointIDFailed creates PatchEndpointIDFailed with default headers values
   122  func NewPatchEndpointIDFailed() *PatchEndpointIDFailed {
   123  
   124  	return &PatchEndpointIDFailed{}
   125  }
   126  
   127  // WithPayload adds the payload to the patch endpoint Id failed response
   128  func (o *PatchEndpointIDFailed) WithPayload(payload models.Error) *PatchEndpointIDFailed {
   129  	o.Payload = payload
   130  	return o
   131  }
   132  
   133  // SetPayload sets the payload to the patch endpoint Id failed response
   134  func (o *PatchEndpointIDFailed) SetPayload(payload models.Error) {
   135  	o.Payload = payload
   136  }
   137  
   138  // WriteResponse to the client
   139  func (o *PatchEndpointIDFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   140  
   141  	rw.WriteHeader(500)
   142  	payload := o.Payload
   143  	if err := producer.Produce(rw, payload); err != nil {
   144  		panic(err) // let the recovery middleware deal with this
   145  	}
   146  }