-
Notifications
You must be signed in to change notification settings - Fork 2
/
authorize_parameters.go
561 lines (439 loc) · 12.7 KB
/
authorize_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
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
// Code generated by go-swagger; DO NOT EDIT.
package oauth2
// 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"
)
// NewAuthorizeParams creates a new AuthorizeParams 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 NewAuthorizeParams() *AuthorizeParams {
return &AuthorizeParams{
timeout: cr.DefaultTimeout,
}
}
// NewAuthorizeParamsWithTimeout creates a new AuthorizeParams object
// with the ability to set a timeout on a request.
func NewAuthorizeParamsWithTimeout(timeout time.Duration) *AuthorizeParams {
return &AuthorizeParams{
timeout: timeout,
}
}
// NewAuthorizeParamsWithContext creates a new AuthorizeParams object
// with the ability to set a context for a request.
func NewAuthorizeParamsWithContext(ctx context.Context) *AuthorizeParams {
return &AuthorizeParams{
Context: ctx,
}
}
// NewAuthorizeParamsWithHTTPClient creates a new AuthorizeParams object
// with the ability to set a custom HTTPClient for a request.
func NewAuthorizeParamsWithHTTPClient(client *http.Client) *AuthorizeParams {
return &AuthorizeParams{
HTTPClient: client,
}
}
/*
AuthorizeParams contains all the parameters to send to the API endpoint
for the authorize operation.
Typically these are written to a http.Request.
*/
type AuthorizeParams struct {
/* AuthorizationCorrelationID.
Authorization correlation ID
*/
AuthorizationCorrelationID *string
// Claims.
Claims *string
/* ClientID.
Client application identifier
You can find the `client_id` value on the Settings page of the required client application.
*/
ClientID string
// CodeChallenge.
CodeChallenge *string
// CodeChallengeMethod.
CodeChallengeMethod *string
/* DpopJkt.
Thumbprint of the DPoP public key
*/
DpopJkt *string
// IdpHint.
IdpHint *string
// Nonce.
Nonce *string
// RedirectURI.
RedirectURI *string
// Request.
Request *string
// RequestURI.
RequestURI *string
// ResponseType.
ResponseType string
// Scope.
Scope *string
// State.
State *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the authorize params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AuthorizeParams) WithDefaults() *AuthorizeParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the authorize params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AuthorizeParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the authorize params
func (o *AuthorizeParams) WithTimeout(timeout time.Duration) *AuthorizeParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the authorize params
func (o *AuthorizeParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the authorize params
func (o *AuthorizeParams) WithContext(ctx context.Context) *AuthorizeParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the authorize params
func (o *AuthorizeParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the authorize params
func (o *AuthorizeParams) WithHTTPClient(client *http.Client) *AuthorizeParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the authorize params
func (o *AuthorizeParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAuthorizationCorrelationID adds the authorizationCorrelationID to the authorize params
func (o *AuthorizeParams) WithAuthorizationCorrelationID(authorizationCorrelationID *string) *AuthorizeParams {
o.SetAuthorizationCorrelationID(authorizationCorrelationID)
return o
}
// SetAuthorizationCorrelationID adds the authorizationCorrelationId to the authorize params
func (o *AuthorizeParams) SetAuthorizationCorrelationID(authorizationCorrelationID *string) {
o.AuthorizationCorrelationID = authorizationCorrelationID
}
// WithClaims adds the claims to the authorize params
func (o *AuthorizeParams) WithClaims(claims *string) *AuthorizeParams {
o.SetClaims(claims)
return o
}
// SetClaims adds the claims to the authorize params
func (o *AuthorizeParams) SetClaims(claims *string) {
o.Claims = claims
}
// WithClientID adds the clientID to the authorize params
func (o *AuthorizeParams) WithClientID(clientID string) *AuthorizeParams {
o.SetClientID(clientID)
return o
}
// SetClientID adds the clientId to the authorize params
func (o *AuthorizeParams) SetClientID(clientID string) {
o.ClientID = clientID
}
// WithCodeChallenge adds the codeChallenge to the authorize params
func (o *AuthorizeParams) WithCodeChallenge(codeChallenge *string) *AuthorizeParams {
o.SetCodeChallenge(codeChallenge)
return o
}
// SetCodeChallenge adds the codeChallenge to the authorize params
func (o *AuthorizeParams) SetCodeChallenge(codeChallenge *string) {
o.CodeChallenge = codeChallenge
}
// WithCodeChallengeMethod adds the codeChallengeMethod to the authorize params
func (o *AuthorizeParams) WithCodeChallengeMethod(codeChallengeMethod *string) *AuthorizeParams {
o.SetCodeChallengeMethod(codeChallengeMethod)
return o
}
// SetCodeChallengeMethod adds the codeChallengeMethod to the authorize params
func (o *AuthorizeParams) SetCodeChallengeMethod(codeChallengeMethod *string) {
o.CodeChallengeMethod = codeChallengeMethod
}
// WithDpopJkt adds the dpopJkt to the authorize params
func (o *AuthorizeParams) WithDpopJkt(dpopJkt *string) *AuthorizeParams {
o.SetDpopJkt(dpopJkt)
return o
}
// SetDpopJkt adds the dpopJkt to the authorize params
func (o *AuthorizeParams) SetDpopJkt(dpopJkt *string) {
o.DpopJkt = dpopJkt
}
// WithIdpHint adds the idpHint to the authorize params
func (o *AuthorizeParams) WithIdpHint(idpHint *string) *AuthorizeParams {
o.SetIdpHint(idpHint)
return o
}
// SetIdpHint adds the idpHint to the authorize params
func (o *AuthorizeParams) SetIdpHint(idpHint *string) {
o.IdpHint = idpHint
}
// WithNonce adds the nonce to the authorize params
func (o *AuthorizeParams) WithNonce(nonce *string) *AuthorizeParams {
o.SetNonce(nonce)
return o
}
// SetNonce adds the nonce to the authorize params
func (o *AuthorizeParams) SetNonce(nonce *string) {
o.Nonce = nonce
}
// WithRedirectURI adds the redirectURI to the authorize params
func (o *AuthorizeParams) WithRedirectURI(redirectURI *string) *AuthorizeParams {
o.SetRedirectURI(redirectURI)
return o
}
// SetRedirectURI adds the redirectUri to the authorize params
func (o *AuthorizeParams) SetRedirectURI(redirectURI *string) {
o.RedirectURI = redirectURI
}
// WithRequest adds the request to the authorize params
func (o *AuthorizeParams) WithRequest(request *string) *AuthorizeParams {
o.SetRequest(request)
return o
}
// SetRequest adds the request to the authorize params
func (o *AuthorizeParams) SetRequest(request *string) {
o.Request = request
}
// WithRequestURI adds the requestURI to the authorize params
func (o *AuthorizeParams) WithRequestURI(requestURI *string) *AuthorizeParams {
o.SetRequestURI(requestURI)
return o
}
// SetRequestURI adds the requestUri to the authorize params
func (o *AuthorizeParams) SetRequestURI(requestURI *string) {
o.RequestURI = requestURI
}
// WithResponseType adds the responseType to the authorize params
func (o *AuthorizeParams) WithResponseType(responseType string) *AuthorizeParams {
o.SetResponseType(responseType)
return o
}
// SetResponseType adds the responseType to the authorize params
func (o *AuthorizeParams) SetResponseType(responseType string) {
o.ResponseType = responseType
}
// WithScope adds the scope to the authorize params
func (o *AuthorizeParams) WithScope(scope *string) *AuthorizeParams {
o.SetScope(scope)
return o
}
// SetScope adds the scope to the authorize params
func (o *AuthorizeParams) SetScope(scope *string) {
o.Scope = scope
}
// WithState adds the state to the authorize params
func (o *AuthorizeParams) WithState(state *string) *AuthorizeParams {
o.SetState(state)
return o
}
// SetState adds the state to the authorize params
func (o *AuthorizeParams) SetState(state *string) {
o.State = state
}
// WriteToRequest writes these params to a swagger request
func (o *AuthorizeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.AuthorizationCorrelationID != nil {
// query param authorization_correlation_id
var qrAuthorizationCorrelationID string
if o.AuthorizationCorrelationID != nil {
qrAuthorizationCorrelationID = *o.AuthorizationCorrelationID
}
qAuthorizationCorrelationID := qrAuthorizationCorrelationID
if qAuthorizationCorrelationID != "" {
if err := r.SetQueryParam("authorization_correlation_id", qAuthorizationCorrelationID); err != nil {
return err
}
}
}
if o.Claims != nil {
// query param claims
var qrClaims string
if o.Claims != nil {
qrClaims = *o.Claims
}
qClaims := qrClaims
if qClaims != "" {
if err := r.SetQueryParam("claims", qClaims); err != nil {
return err
}
}
}
// query param client_id
qrClientID := o.ClientID
qClientID := qrClientID
if qClientID != "" {
if err := r.SetQueryParam("client_id", qClientID); err != nil {
return err
}
}
if o.CodeChallenge != nil {
// query param code_challenge
var qrCodeChallenge string
if o.CodeChallenge != nil {
qrCodeChallenge = *o.CodeChallenge
}
qCodeChallenge := qrCodeChallenge
if qCodeChallenge != "" {
if err := r.SetQueryParam("code_challenge", qCodeChallenge); err != nil {
return err
}
}
}
if o.CodeChallengeMethod != nil {
// query param code_challenge_method
var qrCodeChallengeMethod string
if o.CodeChallengeMethod != nil {
qrCodeChallengeMethod = *o.CodeChallengeMethod
}
qCodeChallengeMethod := qrCodeChallengeMethod
if qCodeChallengeMethod != "" {
if err := r.SetQueryParam("code_challenge_method", qCodeChallengeMethod); err != nil {
return err
}
}
}
if o.DpopJkt != nil {
// query param dpop_jkt
var qrDpopJkt string
if o.DpopJkt != nil {
qrDpopJkt = *o.DpopJkt
}
qDpopJkt := qrDpopJkt
if qDpopJkt != "" {
if err := r.SetQueryParam("dpop_jkt", qDpopJkt); err != nil {
return err
}
}
}
if o.IdpHint != nil {
// query param idp_hint
var qrIdpHint string
if o.IdpHint != nil {
qrIdpHint = *o.IdpHint
}
qIdpHint := qrIdpHint
if qIdpHint != "" {
if err := r.SetQueryParam("idp_hint", qIdpHint); err != nil {
return err
}
}
}
if o.Nonce != nil {
// query param nonce
var qrNonce string
if o.Nonce != nil {
qrNonce = *o.Nonce
}
qNonce := qrNonce
if qNonce != "" {
if err := r.SetQueryParam("nonce", qNonce); err != nil {
return err
}
}
}
if o.RedirectURI != nil {
// query param redirect_uri
var qrRedirectURI string
if o.RedirectURI != nil {
qrRedirectURI = *o.RedirectURI
}
qRedirectURI := qrRedirectURI
if qRedirectURI != "" {
if err := r.SetQueryParam("redirect_uri", qRedirectURI); err != nil {
return err
}
}
}
if o.Request != nil {
// query param request
var qrRequest string
if o.Request != nil {
qrRequest = *o.Request
}
qRequest := qrRequest
if qRequest != "" {
if err := r.SetQueryParam("request", qRequest); err != nil {
return err
}
}
}
if o.RequestURI != nil {
// query param request_uri
var qrRequestURI string
if o.RequestURI != nil {
qrRequestURI = *o.RequestURI
}
qRequestURI := qrRequestURI
if qRequestURI != "" {
if err := r.SetQueryParam("request_uri", qRequestURI); err != nil {
return err
}
}
}
// query param response_type
qrResponseType := o.ResponseType
qResponseType := qrResponseType
if qResponseType != "" {
if err := r.SetQueryParam("response_type", qResponseType); err != nil {
return err
}
}
if o.Scope != nil {
// query param scope
var qrScope string
if o.Scope != nil {
qrScope = *o.Scope
}
qScope := qrScope
if qScope != "" {
if err := r.SetQueryParam("scope", qScope); err != nil {
return err
}
}
}
if o.State != nil {
// query param state
var qrState string
if o.State != nil {
qrState = *o.State
}
qState := qrState
if qState != "" {
if err := r.SetQueryParam("state", qState); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}