-
Notifications
You must be signed in to change notification settings - Fork 57
/
model_user_attributes.go
512 lines (445 loc) · 13.8 KB
/
model_user_attributes.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
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2019-Present Datadog, Inc.
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package datadog
import (
"encoding/json"
"time"
)
// UserAttributes Attributes of user object returned by the API.
type UserAttributes struct {
// Creation time of the user.
CreatedAt *time.Time `json:"created_at,omitempty"`
// Whether the user is disabled.
Disabled *bool `json:"disabled,omitempty"`
// Email of the user.
Email *string `json:"email,omitempty"`
// Handle of the user.
Handle *string `json:"handle,omitempty"`
// URL of the user's icon.
Icon *string `json:"icon,omitempty"`
// Time that the user was last modified.
ModifiedAt *time.Time `json:"modified_at,omitempty"`
// Name of the user.
Name NullableString `json:"name,omitempty"`
// Whether the user is a service account.
ServiceAccount *bool `json:"service_account,omitempty"`
// Status of the user.
Status *string `json:"status,omitempty"`
// Title of the user.
Title NullableString `json:"title,omitempty"`
// Whether the user is verified.
Verified *bool `json:"verified,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:-`
}
// NewUserAttributes instantiates a new UserAttributes 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 NewUserAttributes() *UserAttributes {
this := UserAttributes{}
return &this
}
// NewUserAttributesWithDefaults instantiates a new UserAttributes 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 NewUserAttributesWithDefaults() *UserAttributes {
this := UserAttributes{}
return &this
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *UserAttributes) GetCreatedAt() time.Time {
if o == nil || o.CreatedAt == nil {
var ret time.Time
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 *UserAttributes) GetCreatedAtOk() (*time.Time, bool) {
if o == nil || o.CreatedAt == nil {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *UserAttributes) HasCreatedAt() bool {
if o != nil && o.CreatedAt != nil {
return true
}
return false
}
// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
func (o *UserAttributes) SetCreatedAt(v time.Time) {
o.CreatedAt = &v
}
// GetDisabled returns the Disabled field value if set, zero value otherwise.
func (o *UserAttributes) GetDisabled() bool {
if o == nil || o.Disabled == nil {
var ret bool
return ret
}
return *o.Disabled
}
// GetDisabledOk returns a tuple with the Disabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAttributes) GetDisabledOk() (*bool, bool) {
if o == nil || o.Disabled == nil {
return nil, false
}
return o.Disabled, true
}
// HasDisabled returns a boolean if a field has been set.
func (o *UserAttributes) HasDisabled() bool {
if o != nil && o.Disabled != nil {
return true
}
return false
}
// SetDisabled gets a reference to the given bool and assigns it to the Disabled field.
func (o *UserAttributes) SetDisabled(v bool) {
o.Disabled = &v
}
// GetEmail returns the Email field value if set, zero value otherwise.
func (o *UserAttributes) GetEmail() string {
if o == nil || o.Email == nil {
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 *UserAttributes) GetEmailOk() (*string, bool) {
if o == nil || o.Email == nil {
return nil, false
}
return o.Email, true
}
// HasEmail returns a boolean if a field has been set.
func (o *UserAttributes) HasEmail() bool {
if o != nil && o.Email != nil {
return true
}
return false
}
// SetEmail gets a reference to the given string and assigns it to the Email field.
func (o *UserAttributes) SetEmail(v string) {
o.Email = &v
}
// GetHandle returns the Handle field value if set, zero value otherwise.
func (o *UserAttributes) GetHandle() string {
if o == nil || o.Handle == nil {
var ret string
return ret
}
return *o.Handle
}
// GetHandleOk returns a tuple with the Handle field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAttributes) GetHandleOk() (*string, bool) {
if o == nil || o.Handle == nil {
return nil, false
}
return o.Handle, true
}
// HasHandle returns a boolean if a field has been set.
func (o *UserAttributes) HasHandle() bool {
if o != nil && o.Handle != nil {
return true
}
return false
}
// SetHandle gets a reference to the given string and assigns it to the Handle field.
func (o *UserAttributes) SetHandle(v string) {
o.Handle = &v
}
// GetIcon returns the Icon field value if set, zero value otherwise.
func (o *UserAttributes) GetIcon() string {
if o == nil || o.Icon == nil {
var ret string
return ret
}
return *o.Icon
}
// GetIconOk returns a tuple with the Icon field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAttributes) GetIconOk() (*string, bool) {
if o == nil || o.Icon == nil {
return nil, false
}
return o.Icon, true
}
// HasIcon returns a boolean if a field has been set.
func (o *UserAttributes) HasIcon() bool {
if o != nil && o.Icon != nil {
return true
}
return false
}
// SetIcon gets a reference to the given string and assigns it to the Icon field.
func (o *UserAttributes) SetIcon(v string) {
o.Icon = &v
}
// GetModifiedAt returns the ModifiedAt field value if set, zero value otherwise.
func (o *UserAttributes) GetModifiedAt() time.Time {
if o == nil || o.ModifiedAt == nil {
var ret time.Time
return ret
}
return *o.ModifiedAt
}
// GetModifiedAtOk returns a tuple with the ModifiedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAttributes) GetModifiedAtOk() (*time.Time, bool) {
if o == nil || o.ModifiedAt == nil {
return nil, false
}
return o.ModifiedAt, true
}
// HasModifiedAt returns a boolean if a field has been set.
func (o *UserAttributes) HasModifiedAt() bool {
if o != nil && o.ModifiedAt != nil {
return true
}
return false
}
// SetModifiedAt gets a reference to the given time.Time and assigns it to the ModifiedAt field.
func (o *UserAttributes) SetModifiedAt(v time.Time) {
o.ModifiedAt = &v
}
// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UserAttributes) GetName() string {
if o == nil || o.Name.Get() == nil {
var ret string
return ret
}
return *o.Name.Get()
}
// GetNameOk returns a tuple with the Name 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 *UserAttributes) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Name.Get(), o.Name.IsSet()
}
// HasName returns a boolean if a field has been set.
func (o *UserAttributes) HasName() bool {
if o != nil && o.Name.IsSet() {
return true
}
return false
}
// SetName gets a reference to the given NullableString and assigns it to the Name field.
func (o *UserAttributes) SetName(v string) {
o.Name.Set(&v)
}
// SetNameNil sets the value for Name to be an explicit nil
func (o *UserAttributes) SetNameNil() {
o.Name.Set(nil)
}
// UnsetName ensures that no value is present for Name, not even an explicit nil
func (o *UserAttributes) UnsetName() {
o.Name.Unset()
}
// GetServiceAccount returns the ServiceAccount field value if set, zero value otherwise.
func (o *UserAttributes) GetServiceAccount() bool {
if o == nil || o.ServiceAccount == nil {
var ret bool
return ret
}
return *o.ServiceAccount
}
// GetServiceAccountOk returns a tuple with the ServiceAccount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAttributes) GetServiceAccountOk() (*bool, bool) {
if o == nil || o.ServiceAccount == nil {
return nil, false
}
return o.ServiceAccount, true
}
// HasServiceAccount returns a boolean if a field has been set.
func (o *UserAttributes) HasServiceAccount() bool {
if o != nil && o.ServiceAccount != nil {
return true
}
return false
}
// SetServiceAccount gets a reference to the given bool and assigns it to the ServiceAccount field.
func (o *UserAttributes) SetServiceAccount(v bool) {
o.ServiceAccount = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *UserAttributes) GetStatus() string {
if o == nil || o.Status == nil {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAttributes) GetStatusOk() (*string, bool) {
if o == nil || o.Status == nil {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *UserAttributes) HasStatus() bool {
if o != nil && o.Status != nil {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *UserAttributes) SetStatus(v string) {
o.Status = &v
}
// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UserAttributes) GetTitle() string {
if o == nil || o.Title.Get() == nil {
var ret string
return ret
}
return *o.Title.Get()
}
// GetTitleOk returns a tuple with the Title 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 *UserAttributes) GetTitleOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Title.Get(), o.Title.IsSet()
}
// HasTitle returns a boolean if a field has been set.
func (o *UserAttributes) HasTitle() bool {
if o != nil && o.Title.IsSet() {
return true
}
return false
}
// SetTitle gets a reference to the given NullableString and assigns it to the Title field.
func (o *UserAttributes) SetTitle(v string) {
o.Title.Set(&v)
}
// SetTitleNil sets the value for Title to be an explicit nil
func (o *UserAttributes) SetTitleNil() {
o.Title.Set(nil)
}
// UnsetTitle ensures that no value is present for Title, not even an explicit nil
func (o *UserAttributes) UnsetTitle() {
o.Title.Unset()
}
// GetVerified returns the Verified field value if set, zero value otherwise.
func (o *UserAttributes) GetVerified() bool {
if o == nil || o.Verified == nil {
var ret bool
return ret
}
return *o.Verified
}
// GetVerifiedOk returns a tuple with the Verified field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAttributes) GetVerifiedOk() (*bool, bool) {
if o == nil || o.Verified == nil {
return nil, false
}
return o.Verified, true
}
// HasVerified returns a boolean if a field has been set.
func (o *UserAttributes) HasVerified() bool {
if o != nil && o.Verified != nil {
return true
}
return false
}
// SetVerified gets a reference to the given bool and assigns it to the Verified field.
func (o *UserAttributes) SetVerified(v bool) {
o.Verified = &v
}
func (o UserAttributes) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return json.Marshal(o.UnparsedObject)
}
if o.CreatedAt != nil {
toSerialize["created_at"] = o.CreatedAt
}
if o.Disabled != nil {
toSerialize["disabled"] = o.Disabled
}
if o.Email != nil {
toSerialize["email"] = o.Email
}
if o.Handle != nil {
toSerialize["handle"] = o.Handle
}
if o.Icon != nil {
toSerialize["icon"] = o.Icon
}
if o.ModifiedAt != nil {
toSerialize["modified_at"] = o.ModifiedAt
}
if o.Name.IsSet() {
toSerialize["name"] = o.Name.Get()
}
if o.ServiceAccount != nil {
toSerialize["service_account"] = o.ServiceAccount
}
if o.Status != nil {
toSerialize["status"] = o.Status
}
if o.Title.IsSet() {
toSerialize["title"] = o.Title.Get()
}
if o.Verified != nil {
toSerialize["verified"] = o.Verified
}
return json.Marshal(toSerialize)
}
func (o *UserAttributes) UnmarshalJSON(bytes []byte) (err error) {
raw := map[string]interface{}{}
all := struct {
CreatedAt *time.Time `json:"created_at,omitempty"`
Disabled *bool `json:"disabled,omitempty"`
Email *string `json:"email,omitempty"`
Handle *string `json:"handle,omitempty"`
Icon *string `json:"icon,omitempty"`
ModifiedAt *time.Time `json:"modified_at,omitempty"`
Name NullableString `json:"name,omitempty"`
ServiceAccount *bool `json:"service_account,omitempty"`
Status *string `json:"status,omitempty"`
Title NullableString `json:"title,omitempty"`
Verified *bool `json:"verified,omitempty"`
}{}
err = json.Unmarshal(bytes, &all)
if err != nil {
err = json.Unmarshal(bytes, &raw)
if err != nil {
return err
}
o.UnparsedObject = raw
return nil
}
o.CreatedAt = all.CreatedAt
o.Disabled = all.Disabled
o.Email = all.Email
o.Handle = all.Handle
o.Icon = all.Icon
o.ModifiedAt = all.ModifiedAt
o.Name = all.Name
o.ServiceAccount = all.ServiceAccount
o.Status = all.Status
o.Title = all.Title
o.Verified = all.Verified
return nil
}