-
Notifications
You must be signed in to change notification settings - Fork 163
/
collectd_by_pluginid_post_parameters.go
265 lines (213 loc) · 7.37 KB
/
collectd_by_pluginid_post_parameters.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/swag"
strfmt "github.com/go-openapi/strfmt"
)
// NewCollectdByPluginidPostParams creates a new CollectdByPluginidPostParams object
// with the default values initialized.
func NewCollectdByPluginidPostParams() *CollectdByPluginidPostParams {
var ()
return &CollectdByPluginidPostParams{
timeout: cr.DefaultTimeout,
}
}
// NewCollectdByPluginidPostParamsWithTimeout creates a new CollectdByPluginidPostParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewCollectdByPluginidPostParamsWithTimeout(timeout time.Duration) *CollectdByPluginidPostParams {
var ()
return &CollectdByPluginidPostParams{
timeout: timeout,
}
}
// NewCollectdByPluginidPostParamsWithContext creates a new CollectdByPluginidPostParams object
// with the default values initialized, and the ability to set a context for a request
func NewCollectdByPluginidPostParamsWithContext(ctx context.Context) *CollectdByPluginidPostParams {
var ()
return &CollectdByPluginidPostParams{
Context: ctx,
}
}
// NewCollectdByPluginidPostParamsWithHTTPClient creates a new CollectdByPluginidPostParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewCollectdByPluginidPostParamsWithHTTPClient(client *http.Client) *CollectdByPluginidPostParams {
var ()
return &CollectdByPluginidPostParams{
HTTPClient: client,
}
}
/*CollectdByPluginidPostParams contains all the parameters to send to the API endpoint
for the collectd by pluginid post operation typically these are written to a http.Request
*/
type CollectdByPluginidPostParams struct {
/*Enable
set to true to enable all, anything else or omit to disable
*/
Enable *bool
/*Instance
The plugin instance typically #CPU indicating per CPU metric. Regex are supported. Omit for all
*/
Instance *string
/*Pluginid
The plugin ID, describe the component the metric belongs to. Examples are cache, thrift, etc'. Regex are supported.The plugin ID, describe the component the metric belong to. Examples are: cache, thrift etc'. regex are supported
*/
Pluginid string
/*Type
The plugin type, the type of the information. Examples are total_operations, bytes, total_operations, etc'. Regex are supported. Omit for all
*/
Type *string
/*TypeInstance
The plugin type instance, the specific metric. Exampls are total_writes, total_size, zones, etc'. Regex are supported, Omit for all
*/
TypeInstance *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) WithTimeout(timeout time.Duration) *CollectdByPluginidPostParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) WithContext(ctx context.Context) *CollectdByPluginidPostParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) WithHTTPClient(client *http.Client) *CollectdByPluginidPostParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithEnable adds the enable to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) WithEnable(enable *bool) *CollectdByPluginidPostParams {
o.SetEnable(enable)
return o
}
// SetEnable adds the enable to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) SetEnable(enable *bool) {
o.Enable = enable
}
// WithInstance adds the instance to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) WithInstance(instance *string) *CollectdByPluginidPostParams {
o.SetInstance(instance)
return o
}
// SetInstance adds the instance to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) SetInstance(instance *string) {
o.Instance = instance
}
// WithPluginid adds the pluginid to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) WithPluginid(pluginid string) *CollectdByPluginidPostParams {
o.SetPluginid(pluginid)
return o
}
// SetPluginid adds the pluginid to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) SetPluginid(pluginid string) {
o.Pluginid = pluginid
}
// WithType adds the typeVar to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) WithType(typeVar *string) *CollectdByPluginidPostParams {
o.SetType(typeVar)
return o
}
// SetType adds the type to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) SetType(typeVar *string) {
o.Type = typeVar
}
// WithTypeInstance adds the typeInstance to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) WithTypeInstance(typeInstance *string) *CollectdByPluginidPostParams {
o.SetTypeInstance(typeInstance)
return o
}
// SetTypeInstance adds the typeInstance to the collectd by pluginid post params
func (o *CollectdByPluginidPostParams) SetTypeInstance(typeInstance *string) {
o.TypeInstance = typeInstance
}
// WriteToRequest writes these params to a swagger request
func (o *CollectdByPluginidPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Enable != nil {
// query param enable
var qrEnable bool
if o.Enable != nil {
qrEnable = *o.Enable
}
qEnable := swag.FormatBool(qrEnable)
if qEnable != "" {
if err := r.SetQueryParam("enable", qEnable); err != nil {
return err
}
}
}
if o.Instance != nil {
// query param instance
var qrInstance string
if o.Instance != nil {
qrInstance = *o.Instance
}
qInstance := qrInstance
if qInstance != "" {
if err := r.SetQueryParam("instance", qInstance); err != nil {
return err
}
}
}
// path param pluginid
if err := r.SetPathParam("pluginid", o.Pluginid); err != nil {
return err
}
if o.Type != nil {
// query param type
var qrType string
if o.Type != nil {
qrType = *o.Type
}
qType := qrType
if qType != "" {
if err := r.SetQueryParam("type", qType); err != nil {
return err
}
}
}
if o.TypeInstance != nil {
// query param type_instance
var qrTypeInstance string
if o.TypeInstance != nil {
qrTypeInstance = *o.TypeInstance
}
qTypeInstance := qrTypeInstance
if qTypeInstance != "" {
if err := r.SetQueryParam("type_instance", qTypeInstance); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}