-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_authentication.go
More file actions
334 lines (274 loc) · 7.94 KB
/
model_authentication.go
File metadata and controls
334 lines (274 loc) · 7.94 KB
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
/*
Eduframe - API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package eduframe
import (
"encoding/json"
"time"
"bytes"
"fmt"
)
// checks if the Authentication type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Authentication{}
// Authentication struct for Authentication
type Authentication struct {
// Unique identifier of the authentication.
Id int32 `json:"id"`
// Identifier of the associated User.
UserId int32 `json:"user_id"`
// Unique identifier of the authentication provider
AuthenticationProviderId int32 `json:"authentication_provider_id"`
// Login identifier.
Uid string `json:"uid"`
// Whether or not the user has enabled two factor authentication.
OtpEnabled bool `json:"otp_enabled"`
// Timestamp of last update.
UpdatedAt time.Time `json:"updated_at"`
// Timestamp of creation.
CreatedAt time.Time `json:"created_at"`
}
type _Authentication Authentication
// NewAuthentication instantiates a new Authentication 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 NewAuthentication(id int32, userId int32, authenticationProviderId int32, uid string, otpEnabled bool, updatedAt time.Time, createdAt time.Time) *Authentication {
this := Authentication{}
this.Id = id
this.UserId = userId
this.AuthenticationProviderId = authenticationProviderId
this.Uid = uid
this.OtpEnabled = otpEnabled
this.UpdatedAt = updatedAt
this.CreatedAt = createdAt
return &this
}
// NewAuthenticationWithDefaults instantiates a new Authentication 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 NewAuthenticationWithDefaults() *Authentication {
this := Authentication{}
return &this
}
// GetId returns the Id field value
func (o *Authentication) GetId() int32 {
if o == nil {
var ret int32
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *Authentication) GetIdOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *Authentication) SetId(v int32) {
o.Id = v
}
// GetUserId returns the UserId field value
func (o *Authentication) GetUserId() int32 {
if o == nil {
var ret int32
return ret
}
return o.UserId
}
// GetUserIdOk returns a tuple with the UserId field value
// and a boolean to check if the value has been set.
func (o *Authentication) GetUserIdOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.UserId, true
}
// SetUserId sets field value
func (o *Authentication) SetUserId(v int32) {
o.UserId = v
}
// GetAuthenticationProviderId returns the AuthenticationProviderId field value
func (o *Authentication) GetAuthenticationProviderId() int32 {
if o == nil {
var ret int32
return ret
}
return o.AuthenticationProviderId
}
// GetAuthenticationProviderIdOk returns a tuple with the AuthenticationProviderId field value
// and a boolean to check if the value has been set.
func (o *Authentication) GetAuthenticationProviderIdOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.AuthenticationProviderId, true
}
// SetAuthenticationProviderId sets field value
func (o *Authentication) SetAuthenticationProviderId(v int32) {
o.AuthenticationProviderId = v
}
// GetUid returns the Uid field value
func (o *Authentication) GetUid() string {
if o == nil {
var ret string
return ret
}
return o.Uid
}
// GetUidOk returns a tuple with the Uid field value
// and a boolean to check if the value has been set.
func (o *Authentication) GetUidOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Uid, true
}
// SetUid sets field value
func (o *Authentication) SetUid(v string) {
o.Uid = v
}
// GetOtpEnabled returns the OtpEnabled field value
func (o *Authentication) GetOtpEnabled() bool {
if o == nil {
var ret bool
return ret
}
return o.OtpEnabled
}
// GetOtpEnabledOk returns a tuple with the OtpEnabled field value
// and a boolean to check if the value has been set.
func (o *Authentication) GetOtpEnabledOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.OtpEnabled, true
}
// SetOtpEnabled sets field value
func (o *Authentication) SetOtpEnabled(v bool) {
o.OtpEnabled = v
}
// GetUpdatedAt returns the UpdatedAt field value
func (o *Authentication) GetUpdatedAt() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value
// and a boolean to check if the value has been set.
func (o *Authentication) GetUpdatedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.UpdatedAt, true
}
// SetUpdatedAt sets field value
func (o *Authentication) SetUpdatedAt(v time.Time) {
o.UpdatedAt = v
}
// GetCreatedAt returns the CreatedAt field value
func (o *Authentication) GetCreatedAt() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value
// and a boolean to check if the value has been set.
func (o *Authentication) GetCreatedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.CreatedAt, true
}
// SetCreatedAt sets field value
func (o *Authentication) SetCreatedAt(v time.Time) {
o.CreatedAt = v
}
func (o Authentication) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Authentication) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["user_id"] = o.UserId
toSerialize["authentication_provider_id"] = o.AuthenticationProviderId
toSerialize["uid"] = o.Uid
toSerialize["otp_enabled"] = o.OtpEnabled
toSerialize["updated_at"] = o.UpdatedAt
toSerialize["created_at"] = o.CreatedAt
return toSerialize, nil
}
func (o *Authentication) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"user_id",
"authentication_provider_id",
"uid",
"otp_enabled",
"updated_at",
"created_at",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varAuthentication := _Authentication{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varAuthentication)
if err != nil {
return err
}
*o = Authentication(varAuthentication)
return err
}
type NullableAuthentication struct {
value *Authentication
isSet bool
}
func (v NullableAuthentication) Get() *Authentication {
return v.value
}
func (v *NullableAuthentication) Set(val *Authentication) {
v.value = val
v.isSet = true
}
func (v NullableAuthentication) IsSet() bool {
return v.isSet
}
func (v *NullableAuthentication) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAuthentication(val *Authentication) *NullableAuthentication {
return &NullableAuthentication{value: val, isSet: true}
}
func (v NullableAuthentication) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAuthentication) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}