github.com/kubearmor/cilium@v1.6.12/api/v1/server/restapi/daemon/patch_config_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package daemon 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 // PatchConfigOKCode is the HTTP code returned for type PatchConfigOK 17 const PatchConfigOKCode int = 200 18 19 /*PatchConfigOK Success 20 21 swagger:response patchConfigOK 22 */ 23 type PatchConfigOK struct { 24 } 25 26 // NewPatchConfigOK creates PatchConfigOK with default headers values 27 func NewPatchConfigOK() *PatchConfigOK { 28 29 return &PatchConfigOK{} 30 } 31 32 // WriteResponse to the client 33 func (o *PatchConfigOK) 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 // PatchConfigBadRequestCode is the HTTP code returned for type PatchConfigBadRequest 41 const PatchConfigBadRequestCode int = 400 42 43 /*PatchConfigBadRequest Bad configuration parameters 44 45 swagger:response patchConfigBadRequest 46 */ 47 type PatchConfigBadRequest struct { 48 49 /* 50 In: Body 51 */ 52 Payload models.Error `json:"body,omitempty"` 53 } 54 55 // NewPatchConfigBadRequest creates PatchConfigBadRequest with default headers values 56 func NewPatchConfigBadRequest() *PatchConfigBadRequest { 57 58 return &PatchConfigBadRequest{} 59 } 60 61 // WithPayload adds the payload to the patch config bad request response 62 func (o *PatchConfigBadRequest) WithPayload(payload models.Error) *PatchConfigBadRequest { 63 o.Payload = payload 64 return o 65 } 66 67 // SetPayload sets the payload to the patch config bad request response 68 func (o *PatchConfigBadRequest) SetPayload(payload models.Error) { 69 o.Payload = payload 70 } 71 72 // WriteResponse to the client 73 func (o *PatchConfigBadRequest) 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 // PatchConfigFailureCode is the HTTP code returned for type PatchConfigFailure 83 const PatchConfigFailureCode int = 500 84 85 /*PatchConfigFailure Recompilation failed 86 87 swagger:response patchConfigFailure 88 */ 89 type PatchConfigFailure struct { 90 91 /* 92 In: Body 93 */ 94 Payload models.Error `json:"body,omitempty"` 95 } 96 97 // NewPatchConfigFailure creates PatchConfigFailure with default headers values 98 func NewPatchConfigFailure() *PatchConfigFailure { 99 100 return &PatchConfigFailure{} 101 } 102 103 // WithPayload adds the payload to the patch config failure response 104 func (o *PatchConfigFailure) WithPayload(payload models.Error) *PatchConfigFailure { 105 o.Payload = payload 106 return o 107 } 108 109 // SetPayload sets the payload to the patch config failure response 110 func (o *PatchConfigFailure) SetPayload(payload models.Error) { 111 o.Payload = payload 112 } 113 114 // WriteResponse to the client 115 func (o *PatchConfigFailure) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 116 117 rw.WriteHeader(500) 118 payload := o.Payload 119 if err := producer.Produce(rw, payload); err != nil { 120 panic(err) // let the recovery middleware deal with this 121 } 122 }