/
service_logs_parameters.go
425 lines (352 loc) · 9.96 KB
/
service_logs_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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
// Code generated by go-swagger; DO NOT EDIT.
package service
// 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"
"time"
"golang.org/x/net/context"
"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"
)
// NewServiceLogsParams creates a new ServiceLogsParams object
// with the default values initialized.
func NewServiceLogsParams() *ServiceLogsParams {
var (
detailsDefault = bool(false)
followDefault = bool(false)
sinceDefault = int64(0)
stderrDefault = bool(false)
stdoutDefault = bool(false)
tailDefault = string("all")
timestampsDefault = bool(false)
)
return &ServiceLogsParams{
Details: &detailsDefault,
Follow: &followDefault,
Since: &sinceDefault,
Stderr: &stderrDefault,
Stdout: &stdoutDefault,
Tail: &tailDefault,
Timestamps: ×tampsDefault,
timeout: cr.DefaultTimeout,
}
}
// NewServiceLogsParamsWithTimeout creates a new ServiceLogsParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewServiceLogsParamsWithTimeout(timeout time.Duration) *ServiceLogsParams {
var (
detailsDefault = bool(false)
followDefault = bool(false)
sinceDefault = int64(0)
stderrDefault = bool(false)
stdoutDefault = bool(false)
tailDefault = string("all")
timestampsDefault = bool(false)
)
return &ServiceLogsParams{
Details: &detailsDefault,
Follow: &followDefault,
Since: &sinceDefault,
Stderr: &stderrDefault,
Stdout: &stdoutDefault,
Tail: &tailDefault,
Timestamps: ×tampsDefault,
timeout: timeout,
}
}
// NewServiceLogsParamsWithContext creates a new ServiceLogsParams object
// with the default values initialized, and the ability to set a context for a request
func NewServiceLogsParamsWithContext(ctx context.Context) *ServiceLogsParams {
var (
detailsDefault = bool(false)
followDefault = bool(false)
sinceDefault = int64(0)
stderrDefault = bool(false)
stdoutDefault = bool(false)
tailDefault = string("all")
timestampsDefault = bool(false)
)
return &ServiceLogsParams{
Details: &detailsDefault,
Follow: &followDefault,
Since: &sinceDefault,
Stderr: &stderrDefault,
Stdout: &stdoutDefault,
Tail: &tailDefault,
Timestamps: ×tampsDefault,
Context: ctx,
}
}
// NewServiceLogsParamsWithHTTPClient creates a new ServiceLogsParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewServiceLogsParamsWithHTTPClient(client *http.Client) *ServiceLogsParams {
var (
detailsDefault = bool(false)
followDefault = bool(false)
sinceDefault = int64(0)
stderrDefault = bool(false)
stdoutDefault = bool(false)
tailDefault = string("all")
timestampsDefault = bool(false)
)
return &ServiceLogsParams{
Details: &detailsDefault,
Follow: &followDefault,
Since: &sinceDefault,
Stderr: &stderrDefault,
Stdout: &stdoutDefault,
Tail: &tailDefault,
Timestamps: ×tampsDefault,
HTTPClient: client,
}
}
/*ServiceLogsParams contains all the parameters to send to the API endpoint
for the service logs operation typically these are written to a http.Request
*/
type ServiceLogsParams struct {
/*Details
Show service context and extra details provided to logs.
*/
Details *bool
/*Follow
Return the logs as a stream.
This will return a `101` HTTP response with a `Connection: upgrade` header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach).
*/
Follow *bool
/*ID
ID or name of the service
*/
ID string
/*Since
Only return logs since this time, as a UNIX timestamp
*/
Since *int64
/*Stderr
Return logs from `stderr`
*/
Stderr *bool
/*Stdout
Return logs from `stdout`
*/
Stdout *bool
/*Tail
Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines.
*/
Tail *string
/*Timestamps
Add timestamps to every log line
*/
Timestamps *bool
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the service logs params
func (o *ServiceLogsParams) WithTimeout(timeout time.Duration) *ServiceLogsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the service logs params
func (o *ServiceLogsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the service logs params
func (o *ServiceLogsParams) WithContext(ctx context.Context) *ServiceLogsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the service logs params
func (o *ServiceLogsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the service logs params
func (o *ServiceLogsParams) WithHTTPClient(client *http.Client) *ServiceLogsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the service logs params
func (o *ServiceLogsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithDetails adds the details to the service logs params
func (o *ServiceLogsParams) WithDetails(details *bool) *ServiceLogsParams {
o.SetDetails(details)
return o
}
// SetDetails adds the details to the service logs params
func (o *ServiceLogsParams) SetDetails(details *bool) {
o.Details = details
}
// WithFollow adds the follow to the service logs params
func (o *ServiceLogsParams) WithFollow(follow *bool) *ServiceLogsParams {
o.SetFollow(follow)
return o
}
// SetFollow adds the follow to the service logs params
func (o *ServiceLogsParams) SetFollow(follow *bool) {
o.Follow = follow
}
// WithID adds the id to the service logs params
func (o *ServiceLogsParams) WithID(id string) *ServiceLogsParams {
o.SetID(id)
return o
}
// SetID adds the id to the service logs params
func (o *ServiceLogsParams) SetID(id string) {
o.ID = id
}
// WithSince adds the since to the service logs params
func (o *ServiceLogsParams) WithSince(since *int64) *ServiceLogsParams {
o.SetSince(since)
return o
}
// SetSince adds the since to the service logs params
func (o *ServiceLogsParams) SetSince(since *int64) {
o.Since = since
}
// WithStderr adds the stderr to the service logs params
func (o *ServiceLogsParams) WithStderr(stderr *bool) *ServiceLogsParams {
o.SetStderr(stderr)
return o
}
// SetStderr adds the stderr to the service logs params
func (o *ServiceLogsParams) SetStderr(stderr *bool) {
o.Stderr = stderr
}
// WithStdout adds the stdout to the service logs params
func (o *ServiceLogsParams) WithStdout(stdout *bool) *ServiceLogsParams {
o.SetStdout(stdout)
return o
}
// SetStdout adds the stdout to the service logs params
func (o *ServiceLogsParams) SetStdout(stdout *bool) {
o.Stdout = stdout
}
// WithTail adds the tail to the service logs params
func (o *ServiceLogsParams) WithTail(tail *string) *ServiceLogsParams {
o.SetTail(tail)
return o
}
// SetTail adds the tail to the service logs params
func (o *ServiceLogsParams) SetTail(tail *string) {
o.Tail = tail
}
// WithTimestamps adds the timestamps to the service logs params
func (o *ServiceLogsParams) WithTimestamps(timestamps *bool) *ServiceLogsParams {
o.SetTimestamps(timestamps)
return o
}
// SetTimestamps adds the timestamps to the service logs params
func (o *ServiceLogsParams) SetTimestamps(timestamps *bool) {
o.Timestamps = timestamps
}
// WriteToRequest writes these params to a swagger request
func (o *ServiceLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Details != nil {
// query param details
var qrDetails bool
if o.Details != nil {
qrDetails = *o.Details
}
qDetails := swag.FormatBool(qrDetails)
if qDetails != "" {
if err := r.SetQueryParam("details", qDetails); err != nil {
return err
}
}
}
if o.Follow != nil {
// query param follow
var qrFollow bool
if o.Follow != nil {
qrFollow = *o.Follow
}
qFollow := swag.FormatBool(qrFollow)
if qFollow != "" {
if err := r.SetQueryParam("follow", qFollow); err != nil {
return err
}
}
}
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if o.Since != nil {
// query param since
var qrSince int64
if o.Since != nil {
qrSince = *o.Since
}
qSince := swag.FormatInt64(qrSince)
if qSince != "" {
if err := r.SetQueryParam("since", qSince); err != nil {
return err
}
}
}
if o.Stderr != nil {
// query param stderr
var qrStderr bool
if o.Stderr != nil {
qrStderr = *o.Stderr
}
qStderr := swag.FormatBool(qrStderr)
if qStderr != "" {
if err := r.SetQueryParam("stderr", qStderr); err != nil {
return err
}
}
}
if o.Stdout != nil {
// query param stdout
var qrStdout bool
if o.Stdout != nil {
qrStdout = *o.Stdout
}
qStdout := swag.FormatBool(qrStdout)
if qStdout != "" {
if err := r.SetQueryParam("stdout", qStdout); err != nil {
return err
}
}
}
if o.Tail != nil {
// query param tail
var qrTail string
if o.Tail != nil {
qrTail = *o.Tail
}
qTail := qrTail
if qTail != "" {
if err := r.SetQueryParam("tail", qTail); err != nil {
return err
}
}
}
if o.Timestamps != nil {
// query param timestamps
var qrTimestamps bool
if o.Timestamps != nil {
qrTimestamps = *o.Timestamps
}
qTimestamps := swag.FormatBool(qrTimestamps)
if qTimestamps != "" {
if err := r.SetQueryParam("timestamps", qTimestamps); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}