forked from ory/hydra-client-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_o_auth2_token_introspection.go
591 lines (505 loc) · 16.7 KB
/
model_o_auth2_token_introspection.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
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
/*
* Ory Hydra API
*
* Documentation for all of Ory Hydra's APIs.
*
* API version: v1.11.8
* Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package client
import (
"encoding/json"
)
// OAuth2TokenIntrospection https://tools.ietf.org/html/rfc7662
type OAuth2TokenIntrospection struct {
// Active is a boolean indicator of whether or not the presented token is currently active. The specifics of a token's \"active\" state will vary depending on the implementation of the authorization server and the information it keeps about its tokens, but a \"true\" value return for the \"active\" property will generally indicate that a given token has been issued by this authorization server, has not been revoked by the resource owner, and is within its given time window of validity (e.g., after its issuance time and before its expiration time).
Active bool `json:"active"`
// Audience contains a list of the token's intended audiences.
Aud []string `json:"aud,omitempty"`
// ID is aclient identifier for the OAuth 2.0 client that requested this token.
ClientId *string `json:"client_id,omitempty"`
// Expires at is an integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token will expire.
Exp *int64 `json:"exp,omitempty"`
// Extra is arbitrary data set by the session.
Ext map[string]map[string]interface{} `json:"ext,omitempty"`
// Issued at is an integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token was originally issued.
Iat *int64 `json:"iat,omitempty"`
// IssuerURL is a string representing the issuer of this token
Iss *string `json:"iss,omitempty"`
// NotBefore is an integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token is not to be used before.
Nbf *int64 `json:"nbf,omitempty"`
// ObfuscatedSubject is set when the subject identifier algorithm was set to \"pairwise\" during authorization. It is the `sub` value of the ID Token that was issued.
ObfuscatedSubject *string `json:"obfuscated_subject,omitempty"`
// Scope is a JSON string containing a space-separated list of scopes associated with this token.
Scope *string `json:"scope,omitempty"`
// Subject of the token, as defined in JWT [RFC7519]. Usually a machine-readable identifier of the resource owner who authorized this token.
Sub *string `json:"sub,omitempty"`
// TokenType is the introspected token's type, typically `Bearer`.
TokenType *string `json:"token_type,omitempty"`
// TokenUse is the introspected token's use, for example `access_token` or `refresh_token`.
TokenUse *string `json:"token_use,omitempty"`
// Username is a human-readable identifier for the resource owner who authorized this token.
Username *string `json:"username,omitempty"`
}
// NewOAuth2TokenIntrospection instantiates a new OAuth2TokenIntrospection object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewOAuth2TokenIntrospection(active bool) *OAuth2TokenIntrospection {
this := OAuth2TokenIntrospection{}
this.Active = active
return &this
}
// NewOAuth2TokenIntrospectionWithDefaults instantiates a new OAuth2TokenIntrospection object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewOAuth2TokenIntrospectionWithDefaults() *OAuth2TokenIntrospection {
this := OAuth2TokenIntrospection{}
return &this
}
// GetActive returns the Active field value
func (o *OAuth2TokenIntrospection) GetActive() bool {
if o == nil {
var ret bool
return ret
}
return o.Active
}
// GetActiveOk returns a tuple with the Active field value
// and a boolean to check if the value has been set.
func (o *OAuth2TokenIntrospection) GetActiveOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Active, true
}
// SetActive sets field value
func (o *OAuth2TokenIntrospection) SetActive(v bool) {
o.Active = v
}
// GetAud returns the Aud field value if set, zero value otherwise.
func (o *OAuth2TokenIntrospection) GetAud() []string {
if o == nil || o.Aud == nil {
var ret []string
return ret
}
return o.Aud
}
// GetAudOk returns a tuple with the Aud field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2TokenIntrospection) GetAudOk() ([]string, bool) {
if o == nil || o.Aud == nil {
return nil, false
}
return o.Aud, true
}
// HasAud returns a boolean if a field has been set.
func (o *OAuth2TokenIntrospection) HasAud() bool {
if o != nil && o.Aud != nil {
return true
}
return false
}
// SetAud gets a reference to the given []string and assigns it to the Aud field.
func (o *OAuth2TokenIntrospection) SetAud(v []string) {
o.Aud = v
}
// GetClientId returns the ClientId field value if set, zero value otherwise.
func (o *OAuth2TokenIntrospection) GetClientId() string {
if o == nil || o.ClientId == nil {
var ret string
return ret
}
return *o.ClientId
}
// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2TokenIntrospection) GetClientIdOk() (*string, bool) {
if o == nil || o.ClientId == nil {
return nil, false
}
return o.ClientId, true
}
// HasClientId returns a boolean if a field has been set.
func (o *OAuth2TokenIntrospection) HasClientId() bool {
if o != nil && o.ClientId != nil {
return true
}
return false
}
// SetClientId gets a reference to the given string and assigns it to the ClientId field.
func (o *OAuth2TokenIntrospection) SetClientId(v string) {
o.ClientId = &v
}
// GetExp returns the Exp field value if set, zero value otherwise.
func (o *OAuth2TokenIntrospection) GetExp() int64 {
if o == nil || o.Exp == nil {
var ret int64
return ret
}
return *o.Exp
}
// GetExpOk returns a tuple with the Exp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2TokenIntrospection) GetExpOk() (*int64, bool) {
if o == nil || o.Exp == nil {
return nil, false
}
return o.Exp, true
}
// HasExp returns a boolean if a field has been set.
func (o *OAuth2TokenIntrospection) HasExp() bool {
if o != nil && o.Exp != nil {
return true
}
return false
}
// SetExp gets a reference to the given int64 and assigns it to the Exp field.
func (o *OAuth2TokenIntrospection) SetExp(v int64) {
o.Exp = &v
}
// GetExt returns the Ext field value if set, zero value otherwise.
func (o *OAuth2TokenIntrospection) GetExt() map[string]map[string]interface{} {
if o == nil || o.Ext == nil {
var ret map[string]map[string]interface{}
return ret
}
return o.Ext
}
// GetExtOk returns a tuple with the Ext field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2TokenIntrospection) GetExtOk() (map[string]map[string]interface{}, bool) {
if o == nil || o.Ext == nil {
return nil, false
}
return o.Ext, true
}
// HasExt returns a boolean if a field has been set.
func (o *OAuth2TokenIntrospection) HasExt() bool {
if o != nil && o.Ext != nil {
return true
}
return false
}
// SetExt gets a reference to the given map[string]map[string]interface{} and assigns it to the Ext field.
func (o *OAuth2TokenIntrospection) SetExt(v map[string]map[string]interface{}) {
o.Ext = v
}
// GetIat returns the Iat field value if set, zero value otherwise.
func (o *OAuth2TokenIntrospection) GetIat() int64 {
if o == nil || o.Iat == nil {
var ret int64
return ret
}
return *o.Iat
}
// GetIatOk returns a tuple with the Iat field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2TokenIntrospection) GetIatOk() (*int64, bool) {
if o == nil || o.Iat == nil {
return nil, false
}
return o.Iat, true
}
// HasIat returns a boolean if a field has been set.
func (o *OAuth2TokenIntrospection) HasIat() bool {
if o != nil && o.Iat != nil {
return true
}
return false
}
// SetIat gets a reference to the given int64 and assigns it to the Iat field.
func (o *OAuth2TokenIntrospection) SetIat(v int64) {
o.Iat = &v
}
// GetIss returns the Iss field value if set, zero value otherwise.
func (o *OAuth2TokenIntrospection) GetIss() string {
if o == nil || o.Iss == nil {
var ret string
return ret
}
return *o.Iss
}
// GetIssOk returns a tuple with the Iss field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2TokenIntrospection) GetIssOk() (*string, bool) {
if o == nil || o.Iss == nil {
return nil, false
}
return o.Iss, true
}
// HasIss returns a boolean if a field has been set.
func (o *OAuth2TokenIntrospection) HasIss() bool {
if o != nil && o.Iss != nil {
return true
}
return false
}
// SetIss gets a reference to the given string and assigns it to the Iss field.
func (o *OAuth2TokenIntrospection) SetIss(v string) {
o.Iss = &v
}
// GetNbf returns the Nbf field value if set, zero value otherwise.
func (o *OAuth2TokenIntrospection) GetNbf() int64 {
if o == nil || o.Nbf == nil {
var ret int64
return ret
}
return *o.Nbf
}
// GetNbfOk returns a tuple with the Nbf field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2TokenIntrospection) GetNbfOk() (*int64, bool) {
if o == nil || o.Nbf == nil {
return nil, false
}
return o.Nbf, true
}
// HasNbf returns a boolean if a field has been set.
func (o *OAuth2TokenIntrospection) HasNbf() bool {
if o != nil && o.Nbf != nil {
return true
}
return false
}
// SetNbf gets a reference to the given int64 and assigns it to the Nbf field.
func (o *OAuth2TokenIntrospection) SetNbf(v int64) {
o.Nbf = &v
}
// GetObfuscatedSubject returns the ObfuscatedSubject field value if set, zero value otherwise.
func (o *OAuth2TokenIntrospection) GetObfuscatedSubject() string {
if o == nil || o.ObfuscatedSubject == nil {
var ret string
return ret
}
return *o.ObfuscatedSubject
}
// GetObfuscatedSubjectOk returns a tuple with the ObfuscatedSubject field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2TokenIntrospection) GetObfuscatedSubjectOk() (*string, bool) {
if o == nil || o.ObfuscatedSubject == nil {
return nil, false
}
return o.ObfuscatedSubject, true
}
// HasObfuscatedSubject returns a boolean if a field has been set.
func (o *OAuth2TokenIntrospection) HasObfuscatedSubject() bool {
if o != nil && o.ObfuscatedSubject != nil {
return true
}
return false
}
// SetObfuscatedSubject gets a reference to the given string and assigns it to the ObfuscatedSubject field.
func (o *OAuth2TokenIntrospection) SetObfuscatedSubject(v string) {
o.ObfuscatedSubject = &v
}
// GetScope returns the Scope field value if set, zero value otherwise.
func (o *OAuth2TokenIntrospection) GetScope() string {
if o == nil || o.Scope == nil {
var ret string
return ret
}
return *o.Scope
}
// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2TokenIntrospection) GetScopeOk() (*string, bool) {
if o == nil || o.Scope == nil {
return nil, false
}
return o.Scope, true
}
// HasScope returns a boolean if a field has been set.
func (o *OAuth2TokenIntrospection) HasScope() bool {
if o != nil && o.Scope != nil {
return true
}
return false
}
// SetScope gets a reference to the given string and assigns it to the Scope field.
func (o *OAuth2TokenIntrospection) SetScope(v string) {
o.Scope = &v
}
// GetSub returns the Sub field value if set, zero value otherwise.
func (o *OAuth2TokenIntrospection) GetSub() string {
if o == nil || o.Sub == nil {
var ret string
return ret
}
return *o.Sub
}
// GetSubOk returns a tuple with the Sub field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2TokenIntrospection) GetSubOk() (*string, bool) {
if o == nil || o.Sub == nil {
return nil, false
}
return o.Sub, true
}
// HasSub returns a boolean if a field has been set.
func (o *OAuth2TokenIntrospection) HasSub() bool {
if o != nil && o.Sub != nil {
return true
}
return false
}
// SetSub gets a reference to the given string and assigns it to the Sub field.
func (o *OAuth2TokenIntrospection) SetSub(v string) {
o.Sub = &v
}
// GetTokenType returns the TokenType field value if set, zero value otherwise.
func (o *OAuth2TokenIntrospection) GetTokenType() string {
if o == nil || o.TokenType == nil {
var ret string
return ret
}
return *o.TokenType
}
// GetTokenTypeOk returns a tuple with the TokenType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2TokenIntrospection) GetTokenTypeOk() (*string, bool) {
if o == nil || o.TokenType == nil {
return nil, false
}
return o.TokenType, true
}
// HasTokenType returns a boolean if a field has been set.
func (o *OAuth2TokenIntrospection) HasTokenType() bool {
if o != nil && o.TokenType != nil {
return true
}
return false
}
// SetTokenType gets a reference to the given string and assigns it to the TokenType field.
func (o *OAuth2TokenIntrospection) SetTokenType(v string) {
o.TokenType = &v
}
// GetTokenUse returns the TokenUse field value if set, zero value otherwise.
func (o *OAuth2TokenIntrospection) GetTokenUse() string {
if o == nil || o.TokenUse == nil {
var ret string
return ret
}
return *o.TokenUse
}
// GetTokenUseOk returns a tuple with the TokenUse field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2TokenIntrospection) GetTokenUseOk() (*string, bool) {
if o == nil || o.TokenUse == nil {
return nil, false
}
return o.TokenUse, true
}
// HasTokenUse returns a boolean if a field has been set.
func (o *OAuth2TokenIntrospection) HasTokenUse() bool {
if o != nil && o.TokenUse != nil {
return true
}
return false
}
// SetTokenUse gets a reference to the given string and assigns it to the TokenUse field.
func (o *OAuth2TokenIntrospection) SetTokenUse(v string) {
o.TokenUse = &v
}
// GetUsername returns the Username field value if set, zero value otherwise.
func (o *OAuth2TokenIntrospection) GetUsername() string {
if o == nil || o.Username == nil {
var ret string
return ret
}
return *o.Username
}
// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2TokenIntrospection) GetUsernameOk() (*string, bool) {
if o == nil || o.Username == nil {
return nil, false
}
return o.Username, true
}
// HasUsername returns a boolean if a field has been set.
func (o *OAuth2TokenIntrospection) HasUsername() bool {
if o != nil && o.Username != nil {
return true
}
return false
}
// SetUsername gets a reference to the given string and assigns it to the Username field.
func (o *OAuth2TokenIntrospection) SetUsername(v string) {
o.Username = &v
}
func (o OAuth2TokenIntrospection) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["active"] = o.Active
}
if o.Aud != nil {
toSerialize["aud"] = o.Aud
}
if o.ClientId != nil {
toSerialize["client_id"] = o.ClientId
}
if o.Exp != nil {
toSerialize["exp"] = o.Exp
}
if o.Ext != nil {
toSerialize["ext"] = o.Ext
}
if o.Iat != nil {
toSerialize["iat"] = o.Iat
}
if o.Iss != nil {
toSerialize["iss"] = o.Iss
}
if o.Nbf != nil {
toSerialize["nbf"] = o.Nbf
}
if o.ObfuscatedSubject != nil {
toSerialize["obfuscated_subject"] = o.ObfuscatedSubject
}
if o.Scope != nil {
toSerialize["scope"] = o.Scope
}
if o.Sub != nil {
toSerialize["sub"] = o.Sub
}
if o.TokenType != nil {
toSerialize["token_type"] = o.TokenType
}
if o.TokenUse != nil {
toSerialize["token_use"] = o.TokenUse
}
if o.Username != nil {
toSerialize["username"] = o.Username
}
return json.Marshal(toSerialize)
}
type NullableOAuth2TokenIntrospection struct {
value *OAuth2TokenIntrospection
isSet bool
}
func (v NullableOAuth2TokenIntrospection) Get() *OAuth2TokenIntrospection {
return v.value
}
func (v *NullableOAuth2TokenIntrospection) Set(val *OAuth2TokenIntrospection) {
v.value = val
v.isSet = true
}
func (v NullableOAuth2TokenIntrospection) IsSet() bool {
return v.isSet
}
func (v *NullableOAuth2TokenIntrospection) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOAuth2TokenIntrospection(val *OAuth2TokenIntrospection) *NullableOAuth2TokenIntrospection {
return &NullableOAuth2TokenIntrospection{value: val, isSet: true}
}
func (v NullableOAuth2TokenIntrospection) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOAuth2TokenIntrospection) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}