-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodel_access_token.go
496 lines (420 loc) · 13.7 KB
/
model_access_token.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
/*
Authlete API
Authlete API Document.
API version: 2.3.12
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package authlete
import (
"encoding/json"
)
// checks if the AccessToken type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AccessToken{}
// AccessToken struct for AccessToken
type AccessToken struct {
// The hash of the access token.
AccessTokenHash *string `json:"accessTokenHash,omitempty"`
// The timestamp at which the access token will expire.
AccessTokenExpiresAt *int64 `json:"accessTokenExpiresAt,omitempty"`
// The hash of the refresh token.
RefreshTokenHash *string `json:"refreshTokenHash,omitempty"`
// The timestamp at which the refresh token will expire.
RefreshTokenExpiresAt *int64 `json:"refreshTokenExpiresAt,omitempty"`
// The timestamp at which the access token was first created.
CreatedAt *int64 `json:"createdAt,omitempty"`
// The timestamp at which the access token was last refreshed using the refresh token.
LastRefreshedAt *int64 `json:"lastRefreshedAt,omitempty"`
// The ID of the client associated with the access token.
ClientId *int64 `json:"clientId,omitempty"`
// The subject (= unique user ID) associated with the access token.
Subject *string `json:"subject,omitempty"`
GrantType *GrantType `json:"grantType,omitempty"`
// The scopes associated with the access token.
Scopes []string `json:"scopes,omitempty"`
// The properties associated with the access token.
Properties []Property `json:"properties,omitempty"`
}
// NewAccessToken instantiates a new AccessToken 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 NewAccessToken() *AccessToken {
this := AccessToken{}
return &this
}
// NewAccessTokenWithDefaults instantiates a new AccessToken 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 NewAccessTokenWithDefaults() *AccessToken {
this := AccessToken{}
return &this
}
// GetAccessTokenHash returns the AccessTokenHash field value if set, zero value otherwise.
func (o *AccessToken) GetAccessTokenHash() string {
if o == nil || isNil(o.AccessTokenHash) {
var ret string
return ret
}
return *o.AccessTokenHash
}
// GetAccessTokenHashOk returns a tuple with the AccessTokenHash field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccessToken) GetAccessTokenHashOk() (*string, bool) {
if o == nil || isNil(o.AccessTokenHash) {
return nil, false
}
return o.AccessTokenHash, true
}
// HasAccessTokenHash returns a boolean if a field has been set.
func (o *AccessToken) HasAccessTokenHash() bool {
if o != nil && !isNil(o.AccessTokenHash) {
return true
}
return false
}
// SetAccessTokenHash gets a reference to the given string and assigns it to the AccessTokenHash field.
func (o *AccessToken) SetAccessTokenHash(v string) {
o.AccessTokenHash = &v
}
// GetAccessTokenExpiresAt returns the AccessTokenExpiresAt field value if set, zero value otherwise.
func (o *AccessToken) GetAccessTokenExpiresAt() int64 {
if o == nil || isNil(o.AccessTokenExpiresAt) {
var ret int64
return ret
}
return *o.AccessTokenExpiresAt
}
// GetAccessTokenExpiresAtOk returns a tuple with the AccessTokenExpiresAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccessToken) GetAccessTokenExpiresAtOk() (*int64, bool) {
if o == nil || isNil(o.AccessTokenExpiresAt) {
return nil, false
}
return o.AccessTokenExpiresAt, true
}
// HasAccessTokenExpiresAt returns a boolean if a field has been set.
func (o *AccessToken) HasAccessTokenExpiresAt() bool {
if o != nil && !isNil(o.AccessTokenExpiresAt) {
return true
}
return false
}
// SetAccessTokenExpiresAt gets a reference to the given int64 and assigns it to the AccessTokenExpiresAt field.
func (o *AccessToken) SetAccessTokenExpiresAt(v int64) {
o.AccessTokenExpiresAt = &v
}
// GetRefreshTokenHash returns the RefreshTokenHash field value if set, zero value otherwise.
func (o *AccessToken) GetRefreshTokenHash() string {
if o == nil || isNil(o.RefreshTokenHash) {
var ret string
return ret
}
return *o.RefreshTokenHash
}
// GetRefreshTokenHashOk returns a tuple with the RefreshTokenHash field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccessToken) GetRefreshTokenHashOk() (*string, bool) {
if o == nil || isNil(o.RefreshTokenHash) {
return nil, false
}
return o.RefreshTokenHash, true
}
// HasRefreshTokenHash returns a boolean if a field has been set.
func (o *AccessToken) HasRefreshTokenHash() bool {
if o != nil && !isNil(o.RefreshTokenHash) {
return true
}
return false
}
// SetRefreshTokenHash gets a reference to the given string and assigns it to the RefreshTokenHash field.
func (o *AccessToken) SetRefreshTokenHash(v string) {
o.RefreshTokenHash = &v
}
// GetRefreshTokenExpiresAt returns the RefreshTokenExpiresAt field value if set, zero value otherwise.
func (o *AccessToken) GetRefreshTokenExpiresAt() int64 {
if o == nil || isNil(o.RefreshTokenExpiresAt) {
var ret int64
return ret
}
return *o.RefreshTokenExpiresAt
}
// GetRefreshTokenExpiresAtOk returns a tuple with the RefreshTokenExpiresAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccessToken) GetRefreshTokenExpiresAtOk() (*int64, bool) {
if o == nil || isNil(o.RefreshTokenExpiresAt) {
return nil, false
}
return o.RefreshTokenExpiresAt, true
}
// HasRefreshTokenExpiresAt returns a boolean if a field has been set.
func (o *AccessToken) HasRefreshTokenExpiresAt() bool {
if o != nil && !isNil(o.RefreshTokenExpiresAt) {
return true
}
return false
}
// SetRefreshTokenExpiresAt gets a reference to the given int64 and assigns it to the RefreshTokenExpiresAt field.
func (o *AccessToken) SetRefreshTokenExpiresAt(v int64) {
o.RefreshTokenExpiresAt = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *AccessToken) GetCreatedAt() int64 {
if o == nil || isNil(o.CreatedAt) {
var ret int64
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccessToken) GetCreatedAtOk() (*int64, bool) {
if o == nil || isNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *AccessToken) HasCreatedAt() bool {
if o != nil && !isNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given int64 and assigns it to the CreatedAt field.
func (o *AccessToken) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetLastRefreshedAt returns the LastRefreshedAt field value if set, zero value otherwise.
func (o *AccessToken) GetLastRefreshedAt() int64 {
if o == nil || isNil(o.LastRefreshedAt) {
var ret int64
return ret
}
return *o.LastRefreshedAt
}
// GetLastRefreshedAtOk returns a tuple with the LastRefreshedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccessToken) GetLastRefreshedAtOk() (*int64, bool) {
if o == nil || isNil(o.LastRefreshedAt) {
return nil, false
}
return o.LastRefreshedAt, true
}
// HasLastRefreshedAt returns a boolean if a field has been set.
func (o *AccessToken) HasLastRefreshedAt() bool {
if o != nil && !isNil(o.LastRefreshedAt) {
return true
}
return false
}
// SetLastRefreshedAt gets a reference to the given int64 and assigns it to the LastRefreshedAt field.
func (o *AccessToken) SetLastRefreshedAt(v int64) {
o.LastRefreshedAt = &v
}
// GetClientId returns the ClientId field value if set, zero value otherwise.
func (o *AccessToken) GetClientId() int64 {
if o == nil || isNil(o.ClientId) {
var ret int64
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 *AccessToken) GetClientIdOk() (*int64, bool) {
if o == nil || isNil(o.ClientId) {
return nil, false
}
return o.ClientId, true
}
// HasClientId returns a boolean if a field has been set.
func (o *AccessToken) HasClientId() bool {
if o != nil && !isNil(o.ClientId) {
return true
}
return false
}
// SetClientId gets a reference to the given int64 and assigns it to the ClientId field.
func (o *AccessToken) SetClientId(v int64) {
o.ClientId = &v
}
// GetSubject returns the Subject field value if set, zero value otherwise.
func (o *AccessToken) GetSubject() string {
if o == nil || isNil(o.Subject) {
var ret string
return ret
}
return *o.Subject
}
// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccessToken) GetSubjectOk() (*string, bool) {
if o == nil || isNil(o.Subject) {
return nil, false
}
return o.Subject, true
}
// HasSubject returns a boolean if a field has been set.
func (o *AccessToken) HasSubject() bool {
if o != nil && !isNil(o.Subject) {
return true
}
return false
}
// SetSubject gets a reference to the given string and assigns it to the Subject field.
func (o *AccessToken) SetSubject(v string) {
o.Subject = &v
}
// GetGrantType returns the GrantType field value if set, zero value otherwise.
func (o *AccessToken) GetGrantType() GrantType {
if o == nil || isNil(o.GrantType) {
var ret GrantType
return ret
}
return *o.GrantType
}
// GetGrantTypeOk returns a tuple with the GrantType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccessToken) GetGrantTypeOk() (*GrantType, bool) {
if o == nil || isNil(o.GrantType) {
return nil, false
}
return o.GrantType, true
}
// HasGrantType returns a boolean if a field has been set.
func (o *AccessToken) HasGrantType() bool {
if o != nil && !isNil(o.GrantType) {
return true
}
return false
}
// SetGrantType gets a reference to the given GrantType and assigns it to the GrantType field.
func (o *AccessToken) SetGrantType(v GrantType) {
o.GrantType = &v
}
// GetScopes returns the Scopes field value if set, zero value otherwise.
func (o *AccessToken) GetScopes() []string {
if o == nil || isNil(o.Scopes) {
var ret []string
return ret
}
return o.Scopes
}
// GetScopesOk returns a tuple with the Scopes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccessToken) GetScopesOk() ([]string, bool) {
if o == nil || isNil(o.Scopes) {
return nil, false
}
return o.Scopes, true
}
// HasScopes returns a boolean if a field has been set.
func (o *AccessToken) HasScopes() bool {
if o != nil && !isNil(o.Scopes) {
return true
}
return false
}
// SetScopes gets a reference to the given []string and assigns it to the Scopes field.
func (o *AccessToken) SetScopes(v []string) {
o.Scopes = v
}
// GetProperties returns the Properties field value if set, zero value otherwise.
func (o *AccessToken) GetProperties() []Property {
if o == nil || isNil(o.Properties) {
var ret []Property
return ret
}
return o.Properties
}
// GetPropertiesOk returns a tuple with the Properties field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccessToken) GetPropertiesOk() ([]Property, bool) {
if o == nil || isNil(o.Properties) {
return nil, false
}
return o.Properties, true
}
// HasProperties returns a boolean if a field has been set.
func (o *AccessToken) HasProperties() bool {
if o != nil && !isNil(o.Properties) {
return true
}
return false
}
// SetProperties gets a reference to the given []Property and assigns it to the Properties field.
func (o *AccessToken) SetProperties(v []Property) {
o.Properties = v
}
func (o AccessToken) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AccessToken) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !isNil(o.AccessTokenHash) {
toSerialize["accessTokenHash"] = o.AccessTokenHash
}
if !isNil(o.AccessTokenExpiresAt) {
toSerialize["accessTokenExpiresAt"] = o.AccessTokenExpiresAt
}
if !isNil(o.RefreshTokenHash) {
toSerialize["refreshTokenHash"] = o.RefreshTokenHash
}
if !isNil(o.RefreshTokenExpiresAt) {
toSerialize["refreshTokenExpiresAt"] = o.RefreshTokenExpiresAt
}
if !isNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !isNil(o.LastRefreshedAt) {
toSerialize["lastRefreshedAt"] = o.LastRefreshedAt
}
if !isNil(o.ClientId) {
toSerialize["clientId"] = o.ClientId
}
if !isNil(o.Subject) {
toSerialize["subject"] = o.Subject
}
if !isNil(o.GrantType) {
toSerialize["grantType"] = o.GrantType
}
if !isNil(o.Scopes) {
toSerialize["scopes"] = o.Scopes
}
if !isNil(o.Properties) {
toSerialize["properties"] = o.Properties
}
return toSerialize, nil
}
type NullableAccessToken struct {
value *AccessToken
isSet bool
}
func (v NullableAccessToken) Get() *AccessToken {
return v.value
}
func (v *NullableAccessToken) Set(val *AccessToken) {
v.value = val
v.isSet = true
}
func (v NullableAccessToken) IsSet() bool {
return v.isSet
}
func (v *NullableAccessToken) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAccessToken(val *AccessToken) *NullableAccessToken {
return &NullableAccessToken{value: val, isSet: true}
}
func (v NullableAccessToken) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAccessToken) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}