-
Notifications
You must be signed in to change notification settings - Fork 7
/
get_v1_alerts_parameters.go
502 lines (393 loc) · 11.6 KB
/
get_v1_alerts_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
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
// Code generated by go-swagger; DO NOT EDIT.
package alerts
// 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/strfmt"
"github.com/go-openapi/swag"
)
// NewGetV1AlertsParams creates a new GetV1AlertsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetV1AlertsParams() *GetV1AlertsParams {
return &GetV1AlertsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetV1AlertsParamsWithTimeout creates a new GetV1AlertsParams object
// with the ability to set a timeout on a request.
func NewGetV1AlertsParamsWithTimeout(timeout time.Duration) *GetV1AlertsParams {
return &GetV1AlertsParams{
timeout: timeout,
}
}
// NewGetV1AlertsParamsWithContext creates a new GetV1AlertsParams object
// with the ability to set a context for a request.
func NewGetV1AlertsParamsWithContext(ctx context.Context) *GetV1AlertsParams {
return &GetV1AlertsParams{
Context: ctx,
}
}
// NewGetV1AlertsParamsWithHTTPClient creates a new GetV1AlertsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetV1AlertsParamsWithHTTPClient(client *http.Client) *GetV1AlertsParams {
return &GetV1AlertsParams{
HTTPClient: client,
}
}
/*
GetV1AlertsParams contains all the parameters to send to the API endpoint
for the get v1 alerts operation.
Typically these are written to a http.Request.
*/
type GetV1AlertsParams struct {
/* Environments.
A comma separated list of environment IDs. This currently only works for Signals alerts.
*/
Environments *string
/* Functionalities.
A comma separated list of functionality IDs. This currently only works for Signals alerts.
*/
Functionalities *string
// Page.
//
// Format: int32
Page *int32
// PerPage.
//
// Format: int32
PerPage *int32
/* Query.
A text query for alerts
*/
Query *string
/* Services.
A comma separated list of service IDs. This currently only works for Signals alerts.
*/
Services *string
/* SignalRules.
A comma separated list of signals rule IDs. This currently only works for Signals alerts.
*/
SignalRules *string
/* TagMatchStrategy.
The strategy to match tags. `any` will return alerts that have at least one of the supplied tags, `match_all` will return only alerts that have all of the supplied tags, and `exclude` will only return alerts that have none of the supplied tags. This currently only works for Signals alerts.
*/
TagMatchStrategy *string
/* Tags.
A comma separated list of tags. This currently only works for Signals alerts.
*/
Tags *string
/* Teams.
A comma separated list of team IDs. This currently only works for Signals alerts.
*/
Teams *string
/* Users.
A comma separated list of user IDs. This currently only works for Signals alerts.
*/
Users *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get v1 alerts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetV1AlertsParams) WithDefaults() *GetV1AlertsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get v1 alerts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetV1AlertsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get v1 alerts params
func (o *GetV1AlertsParams) WithTimeout(timeout time.Duration) *GetV1AlertsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get v1 alerts params
func (o *GetV1AlertsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get v1 alerts params
func (o *GetV1AlertsParams) WithContext(ctx context.Context) *GetV1AlertsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get v1 alerts params
func (o *GetV1AlertsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get v1 alerts params
func (o *GetV1AlertsParams) WithHTTPClient(client *http.Client) *GetV1AlertsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get v1 alerts params
func (o *GetV1AlertsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithEnvironments adds the environments to the get v1 alerts params
func (o *GetV1AlertsParams) WithEnvironments(environments *string) *GetV1AlertsParams {
o.SetEnvironments(environments)
return o
}
// SetEnvironments adds the environments to the get v1 alerts params
func (o *GetV1AlertsParams) SetEnvironments(environments *string) {
o.Environments = environments
}
// WithFunctionalities adds the functionalities to the get v1 alerts params
func (o *GetV1AlertsParams) WithFunctionalities(functionalities *string) *GetV1AlertsParams {
o.SetFunctionalities(functionalities)
return o
}
// SetFunctionalities adds the functionalities to the get v1 alerts params
func (o *GetV1AlertsParams) SetFunctionalities(functionalities *string) {
o.Functionalities = functionalities
}
// WithPage adds the page to the get v1 alerts params
func (o *GetV1AlertsParams) WithPage(page *int32) *GetV1AlertsParams {
o.SetPage(page)
return o
}
// SetPage adds the page to the get v1 alerts params
func (o *GetV1AlertsParams) SetPage(page *int32) {
o.Page = page
}
// WithPerPage adds the perPage to the get v1 alerts params
func (o *GetV1AlertsParams) WithPerPage(perPage *int32) *GetV1AlertsParams {
o.SetPerPage(perPage)
return o
}
// SetPerPage adds the perPage to the get v1 alerts params
func (o *GetV1AlertsParams) SetPerPage(perPage *int32) {
o.PerPage = perPage
}
// WithQuery adds the query to the get v1 alerts params
func (o *GetV1AlertsParams) WithQuery(query *string) *GetV1AlertsParams {
o.SetQuery(query)
return o
}
// SetQuery adds the query to the get v1 alerts params
func (o *GetV1AlertsParams) SetQuery(query *string) {
o.Query = query
}
// WithServices adds the services to the get v1 alerts params
func (o *GetV1AlertsParams) WithServices(services *string) *GetV1AlertsParams {
o.SetServices(services)
return o
}
// SetServices adds the services to the get v1 alerts params
func (o *GetV1AlertsParams) SetServices(services *string) {
o.Services = services
}
// WithSignalRules adds the signalRules to the get v1 alerts params
func (o *GetV1AlertsParams) WithSignalRules(signalRules *string) *GetV1AlertsParams {
o.SetSignalRules(signalRules)
return o
}
// SetSignalRules adds the signalRules to the get v1 alerts params
func (o *GetV1AlertsParams) SetSignalRules(signalRules *string) {
o.SignalRules = signalRules
}
// WithTagMatchStrategy adds the tagMatchStrategy to the get v1 alerts params
func (o *GetV1AlertsParams) WithTagMatchStrategy(tagMatchStrategy *string) *GetV1AlertsParams {
o.SetTagMatchStrategy(tagMatchStrategy)
return o
}
// SetTagMatchStrategy adds the tagMatchStrategy to the get v1 alerts params
func (o *GetV1AlertsParams) SetTagMatchStrategy(tagMatchStrategy *string) {
o.TagMatchStrategy = tagMatchStrategy
}
// WithTags adds the tags to the get v1 alerts params
func (o *GetV1AlertsParams) WithTags(tags *string) *GetV1AlertsParams {
o.SetTags(tags)
return o
}
// SetTags adds the tags to the get v1 alerts params
func (o *GetV1AlertsParams) SetTags(tags *string) {
o.Tags = tags
}
// WithTeams adds the teams to the get v1 alerts params
func (o *GetV1AlertsParams) WithTeams(teams *string) *GetV1AlertsParams {
o.SetTeams(teams)
return o
}
// SetTeams adds the teams to the get v1 alerts params
func (o *GetV1AlertsParams) SetTeams(teams *string) {
o.Teams = teams
}
// WithUsers adds the users to the get v1 alerts params
func (o *GetV1AlertsParams) WithUsers(users *string) *GetV1AlertsParams {
o.SetUsers(users)
return o
}
// SetUsers adds the users to the get v1 alerts params
func (o *GetV1AlertsParams) SetUsers(users *string) {
o.Users = users
}
// WriteToRequest writes these params to a swagger request
func (o *GetV1AlertsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Environments != nil {
// query param environments
var qrEnvironments string
if o.Environments != nil {
qrEnvironments = *o.Environments
}
qEnvironments := qrEnvironments
if qEnvironments != "" {
if err := r.SetQueryParam("environments", qEnvironments); err != nil {
return err
}
}
}
if o.Functionalities != nil {
// query param functionalities
var qrFunctionalities string
if o.Functionalities != nil {
qrFunctionalities = *o.Functionalities
}
qFunctionalities := qrFunctionalities
if qFunctionalities != "" {
if err := r.SetQueryParam("functionalities", qFunctionalities); err != nil {
return err
}
}
}
if o.Page != nil {
// query param page
var qrPage int32
if o.Page != nil {
qrPage = *o.Page
}
qPage := swag.FormatInt32(qrPage)
if qPage != "" {
if err := r.SetQueryParam("page", qPage); err != nil {
return err
}
}
}
if o.PerPage != nil {
// query param per_page
var qrPerPage int32
if o.PerPage != nil {
qrPerPage = *o.PerPage
}
qPerPage := swag.FormatInt32(qrPerPage)
if qPerPage != "" {
if err := r.SetQueryParam("per_page", qPerPage); err != nil {
return err
}
}
}
if o.Query != nil {
// query param query
var qrQuery string
if o.Query != nil {
qrQuery = *o.Query
}
qQuery := qrQuery
if qQuery != "" {
if err := r.SetQueryParam("query", qQuery); err != nil {
return err
}
}
}
if o.Services != nil {
// query param services
var qrServices string
if o.Services != nil {
qrServices = *o.Services
}
qServices := qrServices
if qServices != "" {
if err := r.SetQueryParam("services", qServices); err != nil {
return err
}
}
}
if o.SignalRules != nil {
// query param signal_rules
var qrSignalRules string
if o.SignalRules != nil {
qrSignalRules = *o.SignalRules
}
qSignalRules := qrSignalRules
if qSignalRules != "" {
if err := r.SetQueryParam("signal_rules", qSignalRules); err != nil {
return err
}
}
}
if o.TagMatchStrategy != nil {
// query param tag_match_strategy
var qrTagMatchStrategy string
if o.TagMatchStrategy != nil {
qrTagMatchStrategy = *o.TagMatchStrategy
}
qTagMatchStrategy := qrTagMatchStrategy
if qTagMatchStrategy != "" {
if err := r.SetQueryParam("tag_match_strategy", qTagMatchStrategy); err != nil {
return err
}
}
}
if o.Tags != nil {
// query param tags
var qrTags string
if o.Tags != nil {
qrTags = *o.Tags
}
qTags := qrTags
if qTags != "" {
if err := r.SetQueryParam("tags", qTags); err != nil {
return err
}
}
}
if o.Teams != nil {
// query param teams
var qrTeams string
if o.Teams != nil {
qrTeams = *o.Teams
}
qTeams := qrTeams
if qTeams != "" {
if err := r.SetQueryParam("teams", qTeams); err != nil {
return err
}
}
}
if o.Users != nil {
// query param users
var qrUsers string
if o.Users != nil {
qrUsers = *o.Users
}
qUsers := qrUsers
if qUsers != "" {
if err := r.SetQueryParam("users", qUsers); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}