github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/daemon/patch_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 daemon
     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  // PatchConfigOKCode is the HTTP code returned for type PatchConfigOK
    20  const PatchConfigOKCode int = 200
    21  
    22  /*
    23  PatchConfigOK Success
    24  
    25  swagger:response patchConfigOK
    26  */
    27  type PatchConfigOK struct {
    28  }
    29  
    30  // NewPatchConfigOK creates PatchConfigOK with default headers values
    31  func NewPatchConfigOK() *PatchConfigOK {
    32  
    33  	return &PatchConfigOK{}
    34  }
    35  
    36  // WriteResponse to the client
    37  func (o *PatchConfigOK) 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  // PatchConfigBadRequestCode is the HTTP code returned for type PatchConfigBadRequest
    45  const PatchConfigBadRequestCode int = 400
    46  
    47  /*
    48  PatchConfigBadRequest Bad configuration parameters
    49  
    50  swagger:response patchConfigBadRequest
    51  */
    52  type PatchConfigBadRequest struct {
    53  
    54  	/*
    55  	  In: Body
    56  	*/
    57  	Payload models.Error `json:"body,omitempty"`
    58  }
    59  
    60  // NewPatchConfigBadRequest creates PatchConfigBadRequest with default headers values
    61  func NewPatchConfigBadRequest() *PatchConfigBadRequest {
    62  
    63  	return &PatchConfigBadRequest{}
    64  }
    65  
    66  // WithPayload adds the payload to the patch config bad request response
    67  func (o *PatchConfigBadRequest) WithPayload(payload models.Error) *PatchConfigBadRequest {
    68  	o.Payload = payload
    69  	return o
    70  }
    71  
    72  // SetPayload sets the payload to the patch config bad request response
    73  func (o *PatchConfigBadRequest) SetPayload(payload models.Error) {
    74  	o.Payload = payload
    75  }
    76  
    77  // WriteResponse to the client
    78  func (o *PatchConfigBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    79  
    80  	rw.WriteHeader(400)
    81  	payload := o.Payload
    82  	if err := producer.Produce(rw, payload); err != nil {
    83  		panic(err) // let the recovery middleware deal with this
    84  	}
    85  }
    86  
    87  // PatchConfigForbiddenCode is the HTTP code returned for type PatchConfigForbidden
    88  const PatchConfigForbiddenCode int = 403
    89  
    90  /*
    91  PatchConfigForbidden Forbidden
    92  
    93  swagger:response patchConfigForbidden
    94  */
    95  type PatchConfigForbidden struct {
    96  }
    97  
    98  // NewPatchConfigForbidden creates PatchConfigForbidden with default headers values
    99  func NewPatchConfigForbidden() *PatchConfigForbidden {
   100  
   101  	return &PatchConfigForbidden{}
   102  }
   103  
   104  // WriteResponse to the client
   105  func (o *PatchConfigForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   106  
   107  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
   108  
   109  	rw.WriteHeader(403)
   110  }
   111  
   112  // PatchConfigFailureCode is the HTTP code returned for type PatchConfigFailure
   113  const PatchConfigFailureCode int = 500
   114  
   115  /*
   116  PatchConfigFailure Recompilation failed
   117  
   118  swagger:response patchConfigFailure
   119  */
   120  type PatchConfigFailure struct {
   121  
   122  	/*
   123  	  In: Body
   124  	*/
   125  	Payload models.Error `json:"body,omitempty"`
   126  }
   127  
   128  // NewPatchConfigFailure creates PatchConfigFailure with default headers values
   129  func NewPatchConfigFailure() *PatchConfigFailure {
   130  
   131  	return &PatchConfigFailure{}
   132  }
   133  
   134  // WithPayload adds the payload to the patch config failure response
   135  func (o *PatchConfigFailure) WithPayload(payload models.Error) *PatchConfigFailure {
   136  	o.Payload = payload
   137  	return o
   138  }
   139  
   140  // SetPayload sets the payload to the patch config failure response
   141  func (o *PatchConfigFailure) SetPayload(payload models.Error) {
   142  	o.Payload = payload
   143  }
   144  
   145  // WriteResponse to the client
   146  func (o *PatchConfigFailure) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   147  
   148  	rw.WriteHeader(500)
   149  	payload := o.Payload
   150  	if err := producer.Produce(rw, payload); err != nil {
   151  		panic(err) // let the recovery middleware deal with this
   152  	}
   153  }