/
patch_config_responses.go
153 lines (111 loc) · 3.77 KB
/
patch_config_responses.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
// Code generated by go-swagger; DO NOT EDIT.
// Copyright Authors of Cilium
// SPDX-License-Identifier: Apache-2.0
package daemon
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
"github.com/cilium/cilium/api/v1/models"
)
// PatchConfigOKCode is the HTTP code returned for type PatchConfigOK
const PatchConfigOKCode int = 200
/*
PatchConfigOK Success
swagger:response patchConfigOK
*/
type PatchConfigOK struct {
}
// NewPatchConfigOK creates PatchConfigOK with default headers values
func NewPatchConfigOK() *PatchConfigOK {
return &PatchConfigOK{}
}
// WriteResponse to the client
func (o *PatchConfigOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(200)
}
// PatchConfigBadRequestCode is the HTTP code returned for type PatchConfigBadRequest
const PatchConfigBadRequestCode int = 400
/*
PatchConfigBadRequest Bad configuration parameters
swagger:response patchConfigBadRequest
*/
type PatchConfigBadRequest struct {
/*
In: Body
*/
Payload models.Error `json:"body,omitempty"`
}
// NewPatchConfigBadRequest creates PatchConfigBadRequest with default headers values
func NewPatchConfigBadRequest() *PatchConfigBadRequest {
return &PatchConfigBadRequest{}
}
// WithPayload adds the payload to the patch config bad request response
func (o *PatchConfigBadRequest) WithPayload(payload models.Error) *PatchConfigBadRequest {
o.Payload = payload
return o
}
// SetPayload sets the payload to the patch config bad request response
func (o *PatchConfigBadRequest) SetPayload(payload models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *PatchConfigBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(400)
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
// PatchConfigForbiddenCode is the HTTP code returned for type PatchConfigForbidden
const PatchConfigForbiddenCode int = 403
/*
PatchConfigForbidden Forbidden
swagger:response patchConfigForbidden
*/
type PatchConfigForbidden struct {
}
// NewPatchConfigForbidden creates PatchConfigForbidden with default headers values
func NewPatchConfigForbidden() *PatchConfigForbidden {
return &PatchConfigForbidden{}
}
// WriteResponse to the client
func (o *PatchConfigForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(403)
}
// PatchConfigFailureCode is the HTTP code returned for type PatchConfigFailure
const PatchConfigFailureCode int = 500
/*
PatchConfigFailure Recompilation failed
swagger:response patchConfigFailure
*/
type PatchConfigFailure struct {
/*
In: Body
*/
Payload models.Error `json:"body,omitempty"`
}
// NewPatchConfigFailure creates PatchConfigFailure with default headers values
func NewPatchConfigFailure() *PatchConfigFailure {
return &PatchConfigFailure{}
}
// WithPayload adds the payload to the patch config failure response
func (o *PatchConfigFailure) WithPayload(payload models.Error) *PatchConfigFailure {
o.Payload = payload
return o
}
// SetPayload sets the payload to the patch config failure response
func (o *PatchConfigFailure) SetPayload(payload models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *PatchConfigFailure) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(500)
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}