-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_added_put_user_200.go
454 lines (385 loc) · 15.8 KB
/
model_added_put_user_200.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
/*
Linode API
[Read the API documentation](https://techdocs.akamai.com/linode-api/reference/api).
API version: 4.189.2
Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
"time"
)
// checks if the AddedPutUser200 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AddedPutUser200{}
// AddedPutUser200 struct for AddedPutUser200
type AddedPutUser200 struct {
// The email address for the User. Linode sends emails to this address for account management communications. May be used for other communications as configured.
Email *string `json:"email,omitempty"`
LastLogin NullableAddedGetUser200AllOfLastLogin `json:"last_login,omitempty"`
// The date and time when this User's current password was created. User passwords are first created during the Account sign-up process, and updated using the [Reset Password](https://login.linode.com/forgot/password) webpage. `null` if this User has not created a password yet.
PasswordCreated NullableTime `json:"password_created,omitempty"`
// If true, the User must be granted access to perform actions or access entities on this Account. Run [List a user's grants](https://techdocs.akamai.com/linode-api/reference/get-user-grants) for details on how to configure grants for a restricted User.
Restricted *bool `json:"restricted,omitempty"`
// A list of SSH Key labels added by this User. Users can add keys with the [Add an SSH key](https://techdocs.akamai.com/linode-api/reference/post-add-ssh-key) operation. These keys are deployed when this User is included in the `authorized_users` field of the following requests: - [Create a Linode](https://techdocs.akamai.com/linode-api/reference/post-linode-instance) - [Rebuild a Linode](https://techdocs.akamai.com/linode-api/reference/post-rebuild-linode-instance) - [Create a disk](https://techdocs.akamai.com/linode-api/reference/post-add-linode-disk)
SshKeys []string `json:"ssh_keys,omitempty"`
// A boolean value indicating if the User has Two Factor Authentication (TFA) enabled. Run the [Create a two factor secret](https://techdocs.akamai.com/linode-api/reference/post-tfa-enable) operation to enable TFA.
TfaEnabled *bool `json:"tfa_enabled,omitempty"`
// The User's username. This is used for logging in, and may also be displayed alongside actions the User performs (for example, in Events or public StackScripts).
Username *string `json:"username,omitempty" validate:"regexp=^[a-zA-Z0-9]((?![_-]{2,})[a-zA-Z0-9-_])+[a-zA-Z0-9]$"`
// The phone number verified for this User Profile with the [Verify a phone number](https://techdocs.akamai.com/linode-api/reference/post-profile-phone-number-verify) operation. `null` if this User Profile has no verified phone number.
VerifiedPhoneNumber NullableString `json:"verified_phone_number,omitempty"`
// If the user belongs to a [parent or child account](https://www.linode.com/docs/guides/parent-child-accounts/) relationship, this defines the user type in the respective account. Possible values include: - `parent`. This is a user in an Akamai partner account. Akamai partners have a contractural relationship with their end customers, to sell Akamai services. This user can either have full access (a parent account admin user) or limited access. Limited users don't have access to manage child accounts, but they can be granted this access by an admin user. - `child`. This is an Akamai partner's end customer user, in a child account. A child user can have either full or limited access. Full access lets the user manage other child users and the proxy user in a child account. - `proxy`. This is a user on a child account that gives parent account users access to that child account. A parent account user with the `child_account_access` grant can [Create a proxy user token](https://techdocs.akamai.com/linode-api/reference/post-child-account-token) from the parent account. The parent user can use this token to run API operations from the child account, as if they were a child user. - `default`. This applies to all regular, non-parent-child account users.
UserType *string `json:"user_type,omitempty"`
}
// NewAddedPutUser200 instantiates a new AddedPutUser200 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 NewAddedPutUser200() *AddedPutUser200 {
this := AddedPutUser200{}
return &this
}
// NewAddedPutUser200WithDefaults instantiates a new AddedPutUser200 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 NewAddedPutUser200WithDefaults() *AddedPutUser200 {
this := AddedPutUser200{}
return &this
}
// GetEmail returns the Email field value if set, zero value otherwise.
func (o *AddedPutUser200) GetEmail() string {
if o == nil || IsNil(o.Email) {
var ret string
return ret
}
return *o.Email
}
// GetEmailOk returns a tuple with the Email field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AddedPutUser200) GetEmailOk() (*string, bool) {
if o == nil || IsNil(o.Email) {
return nil, false
}
return o.Email, true
}
// HasEmail returns a boolean if a field has been set.
func (o *AddedPutUser200) HasEmail() bool {
if o != nil && !IsNil(o.Email) {
return true
}
return false
}
// SetEmail gets a reference to the given string and assigns it to the Email field.
func (o *AddedPutUser200) SetEmail(v string) {
o.Email = &v
}
// GetLastLogin returns the LastLogin field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AddedPutUser200) GetLastLogin() AddedGetUser200AllOfLastLogin {
if o == nil || IsNil(o.LastLogin.Get()) {
var ret AddedGetUser200AllOfLastLogin
return ret
}
return *o.LastLogin.Get()
}
// GetLastLoginOk returns a tuple with the LastLogin field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AddedPutUser200) GetLastLoginOk() (*AddedGetUser200AllOfLastLogin, bool) {
if o == nil {
return nil, false
}
return o.LastLogin.Get(), o.LastLogin.IsSet()
}
// HasLastLogin returns a boolean if a field has been set.
func (o *AddedPutUser200) HasLastLogin() bool {
if o != nil && o.LastLogin.IsSet() {
return true
}
return false
}
// SetLastLogin gets a reference to the given NullableAddedGetUser200AllOfLastLogin and assigns it to the LastLogin field.
func (o *AddedPutUser200) SetLastLogin(v AddedGetUser200AllOfLastLogin) {
o.LastLogin.Set(&v)
}
// SetLastLoginNil sets the value for LastLogin to be an explicit nil
func (o *AddedPutUser200) SetLastLoginNil() {
o.LastLogin.Set(nil)
}
// UnsetLastLogin ensures that no value is present for LastLogin, not even an explicit nil
func (o *AddedPutUser200) UnsetLastLogin() {
o.LastLogin.Unset()
}
// GetPasswordCreated returns the PasswordCreated field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AddedPutUser200) GetPasswordCreated() time.Time {
if o == nil || IsNil(o.PasswordCreated.Get()) {
var ret time.Time
return ret
}
return *o.PasswordCreated.Get()
}
// GetPasswordCreatedOk returns a tuple with the PasswordCreated field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AddedPutUser200) GetPasswordCreatedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.PasswordCreated.Get(), o.PasswordCreated.IsSet()
}
// HasPasswordCreated returns a boolean if a field has been set.
func (o *AddedPutUser200) HasPasswordCreated() bool {
if o != nil && o.PasswordCreated.IsSet() {
return true
}
return false
}
// SetPasswordCreated gets a reference to the given NullableTime and assigns it to the PasswordCreated field.
func (o *AddedPutUser200) SetPasswordCreated(v time.Time) {
o.PasswordCreated.Set(&v)
}
// SetPasswordCreatedNil sets the value for PasswordCreated to be an explicit nil
func (o *AddedPutUser200) SetPasswordCreatedNil() {
o.PasswordCreated.Set(nil)
}
// UnsetPasswordCreated ensures that no value is present for PasswordCreated, not even an explicit nil
func (o *AddedPutUser200) UnsetPasswordCreated() {
o.PasswordCreated.Unset()
}
// GetRestricted returns the Restricted field value if set, zero value otherwise.
func (o *AddedPutUser200) GetRestricted() bool {
if o == nil || IsNil(o.Restricted) {
var ret bool
return ret
}
return *o.Restricted
}
// GetRestrictedOk returns a tuple with the Restricted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AddedPutUser200) GetRestrictedOk() (*bool, bool) {
if o == nil || IsNil(o.Restricted) {
return nil, false
}
return o.Restricted, true
}
// HasRestricted returns a boolean if a field has been set.
func (o *AddedPutUser200) HasRestricted() bool {
if o != nil && !IsNil(o.Restricted) {
return true
}
return false
}
// SetRestricted gets a reference to the given bool and assigns it to the Restricted field.
func (o *AddedPutUser200) SetRestricted(v bool) {
o.Restricted = &v
}
// GetSshKeys returns the SshKeys field value if set, zero value otherwise.
func (o *AddedPutUser200) GetSshKeys() []string {
if o == nil || IsNil(o.SshKeys) {
var ret []string
return ret
}
return o.SshKeys
}
// GetSshKeysOk returns a tuple with the SshKeys field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AddedPutUser200) GetSshKeysOk() ([]string, bool) {
if o == nil || IsNil(o.SshKeys) {
return nil, false
}
return o.SshKeys, true
}
// HasSshKeys returns a boolean if a field has been set.
func (o *AddedPutUser200) HasSshKeys() bool {
if o != nil && !IsNil(o.SshKeys) {
return true
}
return false
}
// SetSshKeys gets a reference to the given []string and assigns it to the SshKeys field.
func (o *AddedPutUser200) SetSshKeys(v []string) {
o.SshKeys = v
}
// GetTfaEnabled returns the TfaEnabled field value if set, zero value otherwise.
func (o *AddedPutUser200) GetTfaEnabled() bool {
if o == nil || IsNil(o.TfaEnabled) {
var ret bool
return ret
}
return *o.TfaEnabled
}
// GetTfaEnabledOk returns a tuple with the TfaEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AddedPutUser200) GetTfaEnabledOk() (*bool, bool) {
if o == nil || IsNil(o.TfaEnabled) {
return nil, false
}
return o.TfaEnabled, true
}
// HasTfaEnabled returns a boolean if a field has been set.
func (o *AddedPutUser200) HasTfaEnabled() bool {
if o != nil && !IsNil(o.TfaEnabled) {
return true
}
return false
}
// SetTfaEnabled gets a reference to the given bool and assigns it to the TfaEnabled field.
func (o *AddedPutUser200) SetTfaEnabled(v bool) {
o.TfaEnabled = &v
}
// GetUsername returns the Username field value if set, zero value otherwise.
func (o *AddedPutUser200) GetUsername() string {
if o == nil || IsNil(o.Username) {
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 *AddedPutUser200) GetUsernameOk() (*string, bool) {
if o == nil || IsNil(o.Username) {
return nil, false
}
return o.Username, true
}
// HasUsername returns a boolean if a field has been set.
func (o *AddedPutUser200) HasUsername() bool {
if o != nil && !IsNil(o.Username) {
return true
}
return false
}
// SetUsername gets a reference to the given string and assigns it to the Username field.
func (o *AddedPutUser200) SetUsername(v string) {
o.Username = &v
}
// GetVerifiedPhoneNumber returns the VerifiedPhoneNumber field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AddedPutUser200) GetVerifiedPhoneNumber() string {
if o == nil || IsNil(o.VerifiedPhoneNumber.Get()) {
var ret string
return ret
}
return *o.VerifiedPhoneNumber.Get()
}
// GetVerifiedPhoneNumberOk returns a tuple with the VerifiedPhoneNumber field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AddedPutUser200) GetVerifiedPhoneNumberOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.VerifiedPhoneNumber.Get(), o.VerifiedPhoneNumber.IsSet()
}
// HasVerifiedPhoneNumber returns a boolean if a field has been set.
func (o *AddedPutUser200) HasVerifiedPhoneNumber() bool {
if o != nil && o.VerifiedPhoneNumber.IsSet() {
return true
}
return false
}
// SetVerifiedPhoneNumber gets a reference to the given NullableString and assigns it to the VerifiedPhoneNumber field.
func (o *AddedPutUser200) SetVerifiedPhoneNumber(v string) {
o.VerifiedPhoneNumber.Set(&v)
}
// SetVerifiedPhoneNumberNil sets the value for VerifiedPhoneNumber to be an explicit nil
func (o *AddedPutUser200) SetVerifiedPhoneNumberNil() {
o.VerifiedPhoneNumber.Set(nil)
}
// UnsetVerifiedPhoneNumber ensures that no value is present for VerifiedPhoneNumber, not even an explicit nil
func (o *AddedPutUser200) UnsetVerifiedPhoneNumber() {
o.VerifiedPhoneNumber.Unset()
}
// GetUserType returns the UserType field value if set, zero value otherwise.
func (o *AddedPutUser200) GetUserType() string {
if o == nil || IsNil(o.UserType) {
var ret string
return ret
}
return *o.UserType
}
// GetUserTypeOk returns a tuple with the UserType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AddedPutUser200) GetUserTypeOk() (*string, bool) {
if o == nil || IsNil(o.UserType) {
return nil, false
}
return o.UserType, true
}
// HasUserType returns a boolean if a field has been set.
func (o *AddedPutUser200) HasUserType() bool {
if o != nil && !IsNil(o.UserType) {
return true
}
return false
}
// SetUserType gets a reference to the given string and assigns it to the UserType field.
func (o *AddedPutUser200) SetUserType(v string) {
o.UserType = &v
}
func (o AddedPutUser200) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AddedPutUser200) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Email) {
toSerialize["email"] = o.Email
}
if o.LastLogin.IsSet() {
toSerialize["last_login"] = o.LastLogin.Get()
}
if o.PasswordCreated.IsSet() {
toSerialize["password_created"] = o.PasswordCreated.Get()
}
if !IsNil(o.Restricted) {
toSerialize["restricted"] = o.Restricted
}
if !IsNil(o.SshKeys) {
toSerialize["ssh_keys"] = o.SshKeys
}
if !IsNil(o.TfaEnabled) {
toSerialize["tfa_enabled"] = o.TfaEnabled
}
if !IsNil(o.Username) {
toSerialize["username"] = o.Username
}
if o.VerifiedPhoneNumber.IsSet() {
toSerialize["verified_phone_number"] = o.VerifiedPhoneNumber.Get()
}
if !IsNil(o.UserType) {
toSerialize["user_type"] = o.UserType
}
return toSerialize, nil
}
type NullableAddedPutUser200 struct {
value *AddedPutUser200
isSet bool
}
func (v NullableAddedPutUser200) Get() *AddedPutUser200 {
return v.value
}
func (v *NullableAddedPutUser200) Set(val *AddedPutUser200) {
v.value = val
v.isSet = true
}
func (v NullableAddedPutUser200) IsSet() bool {
return v.isSet
}
func (v *NullableAddedPutUser200) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAddedPutUser200(val *AddedPutUser200) *NullableAddedPutUser200 {
return &NullableAddedPutUser200{value: val, isSet: true}
}
func (v NullableAddedPutUser200) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAddedPutUser200) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}