/
get_all_using_get8_parameters.go
372 lines (290 loc) · 9.13 KB
/
get_all_using_get8_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
// Code generated by go-swagger; DO NOT EDIT.
package triggers
// 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"
)
// NewGetAllUsingGET8Params creates a new GetAllUsingGET8Params 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 NewGetAllUsingGET8Params() *GetAllUsingGET8Params {
return &GetAllUsingGET8Params{
timeout: cr.DefaultTimeout,
}
}
// NewGetAllUsingGET8ParamsWithTimeout creates a new GetAllUsingGET8Params object
// with the ability to set a timeout on a request.
func NewGetAllUsingGET8ParamsWithTimeout(timeout time.Duration) *GetAllUsingGET8Params {
return &GetAllUsingGET8Params{
timeout: timeout,
}
}
// NewGetAllUsingGET8ParamsWithContext creates a new GetAllUsingGET8Params object
// with the ability to set a context for a request.
func NewGetAllUsingGET8ParamsWithContext(ctx context.Context) *GetAllUsingGET8Params {
return &GetAllUsingGET8Params{
Context: ctx,
}
}
// NewGetAllUsingGET8ParamsWithHTTPClient creates a new GetAllUsingGET8Params object
// with the ability to set a custom HTTPClient for a request.
func NewGetAllUsingGET8ParamsWithHTTPClient(client *http.Client) *GetAllUsingGET8Params {
return &GetAllUsingGET8Params{
HTTPClient: client,
}
}
/* GetAllUsingGET8Params contains all the parameters to send to the API endpoint
for the get all using g e t 8 operation.
Typically these are written to a http.Request.
*/
type GetAllUsingGET8Params struct {
/* DollarFilter.
To list Git Webhooks with OData like filter
*/
DollarFilter *string
/* DollarOrderby.
Order by attribute
Default: "name desc"
*/
DollarOrderby *string
/* DollarSkip.
To skip 'n' Git Webhooks for listing
Default: "0"
*/
DollarSkip *string
/* DollarTop.
To list top 'n' Git Webhooks for listing
Default: "25"
*/
DollarTop *string
/* Authorization.
Bearer token
*/
Authorization string
/* APIVersion.
The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /codestream/api/about
*/
APIVersion string
/* Page.
To select 'n'th page for listing
Default: "0"
*/
Page *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get all using g e t 8 params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAllUsingGET8Params) WithDefaults() *GetAllUsingGET8Params {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get all using g e t 8 params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAllUsingGET8Params) SetDefaults() {
var (
dollarOrderbyDefault = string("name desc")
dollarSkipDefault = string("0")
dollarTopDefault = string("25")
pageDefault = string("0")
)
val := GetAllUsingGET8Params{
DollarOrderby: &dollarOrderbyDefault,
DollarSkip: &dollarSkipDefault,
DollarTop: &dollarTopDefault,
Page: &pageDefault,
}
val.timeout = o.timeout
val.Context = o.Context
val.HTTPClient = o.HTTPClient
*o = val
}
// WithTimeout adds the timeout to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) WithTimeout(timeout time.Duration) *GetAllUsingGET8Params {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) WithContext(ctx context.Context) *GetAllUsingGET8Params {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) WithHTTPClient(client *http.Client) *GetAllUsingGET8Params {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithDollarFilter adds the dollarFilter to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) WithDollarFilter(dollarFilter *string) *GetAllUsingGET8Params {
o.SetDollarFilter(dollarFilter)
return o
}
// SetDollarFilter adds the dollarFilter to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) SetDollarFilter(dollarFilter *string) {
o.DollarFilter = dollarFilter
}
// WithDollarOrderby adds the dollarOrderby to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) WithDollarOrderby(dollarOrderby *string) *GetAllUsingGET8Params {
o.SetDollarOrderby(dollarOrderby)
return o
}
// SetDollarOrderby adds the dollarOrderby to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) SetDollarOrderby(dollarOrderby *string) {
o.DollarOrderby = dollarOrderby
}
// WithDollarSkip adds the dollarSkip to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) WithDollarSkip(dollarSkip *string) *GetAllUsingGET8Params {
o.SetDollarSkip(dollarSkip)
return o
}
// SetDollarSkip adds the dollarSkip to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) SetDollarSkip(dollarSkip *string) {
o.DollarSkip = dollarSkip
}
// WithDollarTop adds the dollarTop to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) WithDollarTop(dollarTop *string) *GetAllUsingGET8Params {
o.SetDollarTop(dollarTop)
return o
}
// SetDollarTop adds the dollarTop to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) SetDollarTop(dollarTop *string) {
o.DollarTop = dollarTop
}
// WithAuthorization adds the authorization to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) WithAuthorization(authorization string) *GetAllUsingGET8Params {
o.SetAuthorization(authorization)
return o
}
// SetAuthorization adds the authorization to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) SetAuthorization(authorization string) {
o.Authorization = authorization
}
// WithAPIVersion adds the aPIVersion to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) WithAPIVersion(aPIVersion string) *GetAllUsingGET8Params {
o.SetAPIVersion(aPIVersion)
return o
}
// SetAPIVersion adds the apiVersion to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) SetAPIVersion(aPIVersion string) {
o.APIVersion = aPIVersion
}
// WithPage adds the page to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) WithPage(page *string) *GetAllUsingGET8Params {
o.SetPage(page)
return o
}
// SetPage adds the page to the get all using g e t 8 params
func (o *GetAllUsingGET8Params) SetPage(page *string) {
o.Page = page
}
// WriteToRequest writes these params to a swagger request
func (o *GetAllUsingGET8Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.DollarFilter != nil {
// query param $filter
var qrDollarFilter string
if o.DollarFilter != nil {
qrDollarFilter = *o.DollarFilter
}
qDollarFilter := qrDollarFilter
if qDollarFilter != "" {
if err := r.SetQueryParam("$filter", qDollarFilter); err != nil {
return err
}
}
}
if o.DollarOrderby != nil {
// query param $orderby
var qrDollarOrderby string
if o.DollarOrderby != nil {
qrDollarOrderby = *o.DollarOrderby
}
qDollarOrderby := qrDollarOrderby
if qDollarOrderby != "" {
if err := r.SetQueryParam("$orderby", qDollarOrderby); err != nil {
return err
}
}
}
if o.DollarSkip != nil {
// query param $skip
var qrDollarSkip string
if o.DollarSkip != nil {
qrDollarSkip = *o.DollarSkip
}
qDollarSkip := qrDollarSkip
if qDollarSkip != "" {
if err := r.SetQueryParam("$skip", qDollarSkip); err != nil {
return err
}
}
}
if o.DollarTop != nil {
// query param $top
var qrDollarTop string
if o.DollarTop != nil {
qrDollarTop = *o.DollarTop
}
qDollarTop := qrDollarTop
if qDollarTop != "" {
if err := r.SetQueryParam("$top", qDollarTop); err != nil {
return err
}
}
}
// header param Authorization
if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil {
return err
}
// query param apiVersion
qrAPIVersion := o.APIVersion
qAPIVersion := qrAPIVersion
if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil {
return err
}
if o.Page != nil {
// query param page
var qrPage string
if o.Page != nil {
qrPage = *o.Page
}
qPage := qrPage
if qPage != "" {
if err := r.SetQueryParam("page", qPage); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}