-
Notifications
You must be signed in to change notification settings - Fork 51
/
model_team_attributes.go
536 lines (471 loc) · 16.7 KB
/
model_team_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
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
// 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.
package datadogV2
import (
"fmt"
"time"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)
// TeamAttributes Team attributes
type TeamAttributes struct {
// Unicode representation of the avatar for the team, limited to a single grapheme
Avatar datadog.NullableString `json:"avatar,omitempty"`
// Banner selection for the team
Banner datadog.NullableInt64 `json:"banner,omitempty"`
// Creation date of the team
CreatedAt *time.Time `json:"created_at,omitempty"`
// Free-form markdown description/content for the team's homepage
Description datadog.NullableString `json:"description,omitempty"`
// The team's identifier
Handle string `json:"handle"`
// Collection of hidden modules for the team
HiddenModules []string `json:"hidden_modules,omitempty"`
// The number of links belonging to the team
LinkCount *int32 `json:"link_count,omitempty"`
// Modification date of the team
ModifiedAt *time.Time `json:"modified_at,omitempty"`
// The name of the team
Name string `json:"name"`
// A brief summary of the team, derived from the `description`
Summary datadog.NullableString `json:"summary,omitempty"`
// The number of users belonging to the team
UserCount *int32 `json:"user_count,omitempty"`
// Collection of visible modules for the team
VisibleModules []string `json:"visible_modules,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
AdditionalProperties map[string]interface{}
}
// NewTeamAttributes instantiates a new TeamAttributes 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 NewTeamAttributes(handle string, name string) *TeamAttributes {
this := TeamAttributes{}
this.Handle = handle
this.Name = name
return &this
}
// NewTeamAttributesWithDefaults instantiates a new TeamAttributes 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 NewTeamAttributesWithDefaults() *TeamAttributes {
this := TeamAttributes{}
return &this
}
// GetAvatar returns the Avatar field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TeamAttributes) GetAvatar() string {
if o == nil || o.Avatar.Get() == nil {
var ret string
return ret
}
return *o.Avatar.Get()
}
// GetAvatarOk returns a tuple with the Avatar 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 *TeamAttributes) GetAvatarOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Avatar.Get(), o.Avatar.IsSet()
}
// HasAvatar returns a boolean if a field has been set.
func (o *TeamAttributes) HasAvatar() bool {
return o != nil && o.Avatar.IsSet()
}
// SetAvatar gets a reference to the given datadog.NullableString and assigns it to the Avatar field.
func (o *TeamAttributes) SetAvatar(v string) {
o.Avatar.Set(&v)
}
// SetAvatarNil sets the value for Avatar to be an explicit nil.
func (o *TeamAttributes) SetAvatarNil() {
o.Avatar.Set(nil)
}
// UnsetAvatar ensures that no value is present for Avatar, not even an explicit nil.
func (o *TeamAttributes) UnsetAvatar() {
o.Avatar.Unset()
}
// GetBanner returns the Banner field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TeamAttributes) GetBanner() int64 {
if o == nil || o.Banner.Get() == nil {
var ret int64
return ret
}
return *o.Banner.Get()
}
// GetBannerOk returns a tuple with the Banner 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 *TeamAttributes) GetBannerOk() (*int64, bool) {
if o == nil {
return nil, false
}
return o.Banner.Get(), o.Banner.IsSet()
}
// HasBanner returns a boolean if a field has been set.
func (o *TeamAttributes) HasBanner() bool {
return o != nil && o.Banner.IsSet()
}
// SetBanner gets a reference to the given datadog.NullableInt64 and assigns it to the Banner field.
func (o *TeamAttributes) SetBanner(v int64) {
o.Banner.Set(&v)
}
// SetBannerNil sets the value for Banner to be an explicit nil.
func (o *TeamAttributes) SetBannerNil() {
o.Banner.Set(nil)
}
// UnsetBanner ensures that no value is present for Banner, not even an explicit nil.
func (o *TeamAttributes) UnsetBanner() {
o.Banner.Unset()
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *TeamAttributes) 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 *TeamAttributes) 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 *TeamAttributes) HasCreatedAt() bool {
return o != nil && o.CreatedAt != nil
}
// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
func (o *TeamAttributes) SetCreatedAt(v time.Time) {
o.CreatedAt = &v
}
// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TeamAttributes) GetDescription() string {
if o == nil || o.Description.Get() == nil {
var ret string
return ret
}
return *o.Description.Get()
}
// GetDescriptionOk returns a tuple with the Description 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 *TeamAttributes) GetDescriptionOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Description.Get(), o.Description.IsSet()
}
// HasDescription returns a boolean if a field has been set.
func (o *TeamAttributes) HasDescription() bool {
return o != nil && o.Description.IsSet()
}
// SetDescription gets a reference to the given datadog.NullableString and assigns it to the Description field.
func (o *TeamAttributes) SetDescription(v string) {
o.Description.Set(&v)
}
// SetDescriptionNil sets the value for Description to be an explicit nil.
func (o *TeamAttributes) SetDescriptionNil() {
o.Description.Set(nil)
}
// UnsetDescription ensures that no value is present for Description, not even an explicit nil.
func (o *TeamAttributes) UnsetDescription() {
o.Description.Unset()
}
// GetHandle returns the Handle field value.
func (o *TeamAttributes) GetHandle() string {
if o == nil {
var ret string
return ret
}
return o.Handle
}
// GetHandleOk returns a tuple with the Handle field value
// and a boolean to check if the value has been set.
func (o *TeamAttributes) GetHandleOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Handle, true
}
// SetHandle sets field value.
func (o *TeamAttributes) SetHandle(v string) {
o.Handle = v
}
// GetHiddenModules returns the HiddenModules field value if set, zero value otherwise.
func (o *TeamAttributes) GetHiddenModules() []string {
if o == nil || o.HiddenModules == nil {
var ret []string
return ret
}
return o.HiddenModules
}
// GetHiddenModulesOk returns a tuple with the HiddenModules field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamAttributes) GetHiddenModulesOk() (*[]string, bool) {
if o == nil || o.HiddenModules == nil {
return nil, false
}
return &o.HiddenModules, true
}
// HasHiddenModules returns a boolean if a field has been set.
func (o *TeamAttributes) HasHiddenModules() bool {
return o != nil && o.HiddenModules != nil
}
// SetHiddenModules gets a reference to the given []string and assigns it to the HiddenModules field.
func (o *TeamAttributes) SetHiddenModules(v []string) {
o.HiddenModules = v
}
// GetLinkCount returns the LinkCount field value if set, zero value otherwise.
func (o *TeamAttributes) GetLinkCount() int32 {
if o == nil || o.LinkCount == nil {
var ret int32
return ret
}
return *o.LinkCount
}
// GetLinkCountOk returns a tuple with the LinkCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamAttributes) GetLinkCountOk() (*int32, bool) {
if o == nil || o.LinkCount == nil {
return nil, false
}
return o.LinkCount, true
}
// HasLinkCount returns a boolean if a field has been set.
func (o *TeamAttributes) HasLinkCount() bool {
return o != nil && o.LinkCount != nil
}
// SetLinkCount gets a reference to the given int32 and assigns it to the LinkCount field.
func (o *TeamAttributes) SetLinkCount(v int32) {
o.LinkCount = &v
}
// GetModifiedAt returns the ModifiedAt field value if set, zero value otherwise.
func (o *TeamAttributes) 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 *TeamAttributes) 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 *TeamAttributes) HasModifiedAt() bool {
return o != nil && o.ModifiedAt != nil
}
// SetModifiedAt gets a reference to the given time.Time and assigns it to the ModifiedAt field.
func (o *TeamAttributes) SetModifiedAt(v time.Time) {
o.ModifiedAt = &v
}
// GetName returns the Name field value.
func (o *TeamAttributes) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *TeamAttributes) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value.
func (o *TeamAttributes) SetName(v string) {
o.Name = v
}
// GetSummary returns the Summary field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TeamAttributes) GetSummary() string {
if o == nil || o.Summary.Get() == nil {
var ret string
return ret
}
return *o.Summary.Get()
}
// GetSummaryOk returns a tuple with the Summary 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 *TeamAttributes) GetSummaryOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Summary.Get(), o.Summary.IsSet()
}
// HasSummary returns a boolean if a field has been set.
func (o *TeamAttributes) HasSummary() bool {
return o != nil && o.Summary.IsSet()
}
// SetSummary gets a reference to the given datadog.NullableString and assigns it to the Summary field.
func (o *TeamAttributes) SetSummary(v string) {
o.Summary.Set(&v)
}
// SetSummaryNil sets the value for Summary to be an explicit nil.
func (o *TeamAttributes) SetSummaryNil() {
o.Summary.Set(nil)
}
// UnsetSummary ensures that no value is present for Summary, not even an explicit nil.
func (o *TeamAttributes) UnsetSummary() {
o.Summary.Unset()
}
// GetUserCount returns the UserCount field value if set, zero value otherwise.
func (o *TeamAttributes) GetUserCount() int32 {
if o == nil || o.UserCount == nil {
var ret int32
return ret
}
return *o.UserCount
}
// GetUserCountOk returns a tuple with the UserCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamAttributes) GetUserCountOk() (*int32, bool) {
if o == nil || o.UserCount == nil {
return nil, false
}
return o.UserCount, true
}
// HasUserCount returns a boolean if a field has been set.
func (o *TeamAttributes) HasUserCount() bool {
return o != nil && o.UserCount != nil
}
// SetUserCount gets a reference to the given int32 and assigns it to the UserCount field.
func (o *TeamAttributes) SetUserCount(v int32) {
o.UserCount = &v
}
// GetVisibleModules returns the VisibleModules field value if set, zero value otherwise.
func (o *TeamAttributes) GetVisibleModules() []string {
if o == nil || o.VisibleModules == nil {
var ret []string
return ret
}
return o.VisibleModules
}
// GetVisibleModulesOk returns a tuple with the VisibleModules field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamAttributes) GetVisibleModulesOk() (*[]string, bool) {
if o == nil || o.VisibleModules == nil {
return nil, false
}
return &o.VisibleModules, true
}
// HasVisibleModules returns a boolean if a field has been set.
func (o *TeamAttributes) HasVisibleModules() bool {
return o != nil && o.VisibleModules != nil
}
// SetVisibleModules gets a reference to the given []string and assigns it to the VisibleModules field.
func (o *TeamAttributes) SetVisibleModules(v []string) {
o.VisibleModules = v
}
// MarshalJSON serializes the struct using spec logic.
func (o TeamAttributes) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Avatar.IsSet() {
toSerialize["avatar"] = o.Avatar.Get()
}
if o.Banner.IsSet() {
toSerialize["banner"] = o.Banner.Get()
}
if o.CreatedAt != nil {
if o.CreatedAt.Nanosecond() == 0 {
toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00")
} else {
toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00")
}
}
if o.Description.IsSet() {
toSerialize["description"] = o.Description.Get()
}
toSerialize["handle"] = o.Handle
if o.HiddenModules != nil {
toSerialize["hidden_modules"] = o.HiddenModules
}
if o.LinkCount != nil {
toSerialize["link_count"] = o.LinkCount
}
if o.ModifiedAt != nil {
if o.ModifiedAt.Nanosecond() == 0 {
toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05Z07:00")
} else {
toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05.000Z07:00")
}
}
toSerialize["name"] = o.Name
if o.Summary.IsSet() {
toSerialize["summary"] = o.Summary.Get()
}
if o.UserCount != nil {
toSerialize["user_count"] = o.UserCount
}
if o.VisibleModules != nil {
toSerialize["visible_modules"] = o.VisibleModules
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}
// UnmarshalJSON deserializes the given payload.
func (o *TeamAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Avatar datadog.NullableString `json:"avatar,omitempty"`
Banner datadog.NullableInt64 `json:"banner,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
Description datadog.NullableString `json:"description,omitempty"`
Handle *string `json:"handle"`
HiddenModules []string `json:"hidden_modules,omitempty"`
LinkCount *int32 `json:"link_count,omitempty"`
ModifiedAt *time.Time `json:"modified_at,omitempty"`
Name *string `json:"name"`
Summary datadog.NullableString `json:"summary,omitempty"`
UserCount *int32 `json:"user_count,omitempty"`
VisibleModules []string `json:"visible_modules,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
if all.Handle == nil {
return fmt.Errorf("required field handle missing")
}
if all.Name == nil {
return fmt.Errorf("required field name missing")
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"avatar", "banner", "created_at", "description", "handle", "hidden_modules", "link_count", "modified_at", "name", "summary", "user_count", "visible_modules"})
} else {
return err
}
o.Avatar = all.Avatar
o.Banner = all.Banner
o.CreatedAt = all.CreatedAt
o.Description = all.Description
o.Handle = *all.Handle
o.HiddenModules = all.HiddenModules
o.LinkCount = all.LinkCount
o.ModifiedAt = all.ModifiedAt
o.Name = *all.Name
o.Summary = all.Summary
o.UserCount = all.UserCount
o.VisibleModules = all.VisibleModules
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}
return nil
}