github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/endpoint/patch_endpoint_id_config_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  	"net/http"
    13  
    14  	"github.com/go-openapi/runtime"
    15  
    16  	"github.com/cilium/cilium/api/v1/models"
    17  )
    18  
    19  // PatchEndpointIDConfigOKCode is the HTTP code returned for type PatchEndpointIDConfigOK
    20  const PatchEndpointIDConfigOKCode int = 200
    21  
    22  /*
    23  PatchEndpointIDConfigOK Success
    24  
    25  swagger:response patchEndpointIdConfigOK
    26  */
    27  type PatchEndpointIDConfigOK struct {
    28  }
    29  
    30  // NewPatchEndpointIDConfigOK creates PatchEndpointIDConfigOK with default headers values
    31  func NewPatchEndpointIDConfigOK() *PatchEndpointIDConfigOK {
    32  
    33  	return &PatchEndpointIDConfigOK{}
    34  }
    35  
    36  // WriteResponse to the client
    37  func (o *PatchEndpointIDConfigOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    38  
    39  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    40  
    41  	rw.WriteHeader(200)
    42  }
    43  
    44  // PatchEndpointIDConfigInvalidCode is the HTTP code returned for type PatchEndpointIDConfigInvalid
    45  const PatchEndpointIDConfigInvalidCode int = 400
    46  
    47  /*
    48  PatchEndpointIDConfigInvalid Invalid configuration request
    49  
    50  swagger:response patchEndpointIdConfigInvalid
    51  */
    52  type PatchEndpointIDConfigInvalid struct {
    53  }
    54  
    55  // NewPatchEndpointIDConfigInvalid creates PatchEndpointIDConfigInvalid with default headers values
    56  func NewPatchEndpointIDConfigInvalid() *PatchEndpointIDConfigInvalid {
    57  
    58  	return &PatchEndpointIDConfigInvalid{}
    59  }
    60  
    61  // WriteResponse to the client
    62  func (o *PatchEndpointIDConfigInvalid) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    63  
    64  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    65  
    66  	rw.WriteHeader(400)
    67  }
    68  
    69  // PatchEndpointIDConfigForbiddenCode is the HTTP code returned for type PatchEndpointIDConfigForbidden
    70  const PatchEndpointIDConfigForbiddenCode int = 403
    71  
    72  /*
    73  PatchEndpointIDConfigForbidden Forbidden
    74  
    75  swagger:response patchEndpointIdConfigForbidden
    76  */
    77  type PatchEndpointIDConfigForbidden struct {
    78  }
    79  
    80  // NewPatchEndpointIDConfigForbidden creates PatchEndpointIDConfigForbidden with default headers values
    81  func NewPatchEndpointIDConfigForbidden() *PatchEndpointIDConfigForbidden {
    82  
    83  	return &PatchEndpointIDConfigForbidden{}
    84  }
    85  
    86  // WriteResponse to the client
    87  func (o *PatchEndpointIDConfigForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    88  
    89  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    90  
    91  	rw.WriteHeader(403)
    92  }
    93  
    94  // PatchEndpointIDConfigNotFoundCode is the HTTP code returned for type PatchEndpointIDConfigNotFound
    95  const PatchEndpointIDConfigNotFoundCode int = 404
    96  
    97  /*
    98  PatchEndpointIDConfigNotFound Endpoint not found
    99  
   100  swagger:response patchEndpointIdConfigNotFound
   101  */
   102  type PatchEndpointIDConfigNotFound struct {
   103  }
   104  
   105  // NewPatchEndpointIDConfigNotFound creates PatchEndpointIDConfigNotFound with default headers values
   106  func NewPatchEndpointIDConfigNotFound() *PatchEndpointIDConfigNotFound {
   107  
   108  	return &PatchEndpointIDConfigNotFound{}
   109  }
   110  
   111  // WriteResponse to the client
   112  func (o *PatchEndpointIDConfigNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   113  
   114  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
   115  
   116  	rw.WriteHeader(404)
   117  }
   118  
   119  // PatchEndpointIDConfigTooManyRequestsCode is the HTTP code returned for type PatchEndpointIDConfigTooManyRequests
   120  const PatchEndpointIDConfigTooManyRequestsCode int = 429
   121  
   122  /*
   123  PatchEndpointIDConfigTooManyRequests Rate-limiting too many requests in the given time frame
   124  
   125  swagger:response patchEndpointIdConfigTooManyRequests
   126  */
   127  type PatchEndpointIDConfigTooManyRequests struct {
   128  }
   129  
   130  // NewPatchEndpointIDConfigTooManyRequests creates PatchEndpointIDConfigTooManyRequests with default headers values
   131  func NewPatchEndpointIDConfigTooManyRequests() *PatchEndpointIDConfigTooManyRequests {
   132  
   133  	return &PatchEndpointIDConfigTooManyRequests{}
   134  }
   135  
   136  // WriteResponse to the client
   137  func (o *PatchEndpointIDConfigTooManyRequests) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   138  
   139  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
   140  
   141  	rw.WriteHeader(429)
   142  }
   143  
   144  // PatchEndpointIDConfigFailedCode is the HTTP code returned for type PatchEndpointIDConfigFailed
   145  const PatchEndpointIDConfigFailedCode int = 500
   146  
   147  /*
   148  PatchEndpointIDConfigFailed Update failed. Details in message.
   149  
   150  swagger:response patchEndpointIdConfigFailed
   151  */
   152  type PatchEndpointIDConfigFailed struct {
   153  
   154  	/*
   155  	  In: Body
   156  	*/
   157  	Payload models.Error `json:"body,omitempty"`
   158  }
   159  
   160  // NewPatchEndpointIDConfigFailed creates PatchEndpointIDConfigFailed with default headers values
   161  func NewPatchEndpointIDConfigFailed() *PatchEndpointIDConfigFailed {
   162  
   163  	return &PatchEndpointIDConfigFailed{}
   164  }
   165  
   166  // WithPayload adds the payload to the patch endpoint Id config failed response
   167  func (o *PatchEndpointIDConfigFailed) WithPayload(payload models.Error) *PatchEndpointIDConfigFailed {
   168  	o.Payload = payload
   169  	return o
   170  }
   171  
   172  // SetPayload sets the payload to the patch endpoint Id config failed response
   173  func (o *PatchEndpointIDConfigFailed) SetPayload(payload models.Error) {
   174  	o.Payload = payload
   175  }
   176  
   177  // WriteResponse to the client
   178  func (o *PatchEndpointIDConfigFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   179  
   180  	rw.WriteHeader(500)
   181  	payload := o.Payload
   182  	if err := producer.Produce(rw, payload); err != nil {
   183  		panic(err) // let the recovery middleware deal with this
   184  	}
   185  }