-
Notifications
You must be signed in to change notification settings - Fork 52
/
model_dashboard_list_item.go
572 lines (498 loc) · 14.7 KB
/
model_dashboard_list_item.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
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
/*
* 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"
"fmt"
"time"
)
// DashboardListItem A dashboard within a list.
type DashboardListItem struct {
Author *Creator `json:"author,omitempty"`
// Date of creation of the dashboard.
Created *time.Time `json:"created,omitempty"`
// URL to the icon of the dashboard.
Icon *string `json:"icon,omitempty"`
// ID of the dashboard.
Id string `json:"id"`
// Whether or not the dashboard is in the favorites.
IsFavorite *bool `json:"is_favorite,omitempty"`
// Whether or not the dashboard is read only.
IsReadOnly *bool `json:"is_read_only,omitempty"`
// Whether the dashboard is publicly shared or not.
IsShared *bool `json:"is_shared,omitempty"`
// Date of last edition of the dashboard.
Modified *time.Time `json:"modified,omitempty"`
// Popularity of the dashboard.
Popularity *int32 `json:"popularity,omitempty"`
// Title of the dashboard.
Title *string `json:"title,omitempty"`
Type DashboardType `json:"type"`
// URL path to the dashboard.
Url *string `json:"url,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:-`
}
// NewDashboardListItem instantiates a new DashboardListItem 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 NewDashboardListItem(id string, type_ DashboardType) *DashboardListItem {
this := DashboardListItem{}
this.Id = id
this.Type = type_
return &this
}
// NewDashboardListItemWithDefaults instantiates a new DashboardListItem 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 NewDashboardListItemWithDefaults() *DashboardListItem {
this := DashboardListItem{}
return &this
}
// GetAuthor returns the Author field value if set, zero value otherwise.
func (o *DashboardListItem) GetAuthor() Creator {
if o == nil || o.Author == nil {
var ret Creator
return ret
}
return *o.Author
}
// GetAuthorOk returns a tuple with the Author field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DashboardListItem) GetAuthorOk() (*Creator, bool) {
if o == nil || o.Author == nil {
return nil, false
}
return o.Author, true
}
// HasAuthor returns a boolean if a field has been set.
func (o *DashboardListItem) HasAuthor() bool {
if o != nil && o.Author != nil {
return true
}
return false
}
// SetAuthor gets a reference to the given Creator and assigns it to the Author field.
func (o *DashboardListItem) SetAuthor(v Creator) {
o.Author = &v
}
// GetCreated returns the Created field value if set, zero value otherwise.
func (o *DashboardListItem) GetCreated() time.Time {
if o == nil || o.Created == nil {
var ret time.Time
return ret
}
return *o.Created
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DashboardListItem) GetCreatedOk() (*time.Time, bool) {
if o == nil || o.Created == nil {
return nil, false
}
return o.Created, true
}
// HasCreated returns a boolean if a field has been set.
func (o *DashboardListItem) HasCreated() bool {
if o != nil && o.Created != nil {
return true
}
return false
}
// SetCreated gets a reference to the given time.Time and assigns it to the Created field.
func (o *DashboardListItem) SetCreated(v time.Time) {
o.Created = &v
}
// GetIcon returns the Icon field value if set, zero value otherwise.
func (o *DashboardListItem) 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 *DashboardListItem) 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 *DashboardListItem) 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 *DashboardListItem) SetIcon(v string) {
o.Icon = &v
}
// GetId returns the Id field value
func (o *DashboardListItem) GetId() string {
if o == nil {
var ret string
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 *DashboardListItem) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *DashboardListItem) SetId(v string) {
o.Id = v
}
// GetIsFavorite returns the IsFavorite field value if set, zero value otherwise.
func (o *DashboardListItem) GetIsFavorite() bool {
if o == nil || o.IsFavorite == nil {
var ret bool
return ret
}
return *o.IsFavorite
}
// GetIsFavoriteOk returns a tuple with the IsFavorite field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DashboardListItem) GetIsFavoriteOk() (*bool, bool) {
if o == nil || o.IsFavorite == nil {
return nil, false
}
return o.IsFavorite, true
}
// HasIsFavorite returns a boolean if a field has been set.
func (o *DashboardListItem) HasIsFavorite() bool {
if o != nil && o.IsFavorite != nil {
return true
}
return false
}
// SetIsFavorite gets a reference to the given bool and assigns it to the IsFavorite field.
func (o *DashboardListItem) SetIsFavorite(v bool) {
o.IsFavorite = &v
}
// GetIsReadOnly returns the IsReadOnly field value if set, zero value otherwise.
func (o *DashboardListItem) GetIsReadOnly() bool {
if o == nil || o.IsReadOnly == nil {
var ret bool
return ret
}
return *o.IsReadOnly
}
// GetIsReadOnlyOk returns a tuple with the IsReadOnly field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DashboardListItem) GetIsReadOnlyOk() (*bool, bool) {
if o == nil || o.IsReadOnly == nil {
return nil, false
}
return o.IsReadOnly, true
}
// HasIsReadOnly returns a boolean if a field has been set.
func (o *DashboardListItem) HasIsReadOnly() bool {
if o != nil && o.IsReadOnly != nil {
return true
}
return false
}
// SetIsReadOnly gets a reference to the given bool and assigns it to the IsReadOnly field.
func (o *DashboardListItem) SetIsReadOnly(v bool) {
o.IsReadOnly = &v
}
// GetIsShared returns the IsShared field value if set, zero value otherwise.
func (o *DashboardListItem) GetIsShared() bool {
if o == nil || o.IsShared == nil {
var ret bool
return ret
}
return *o.IsShared
}
// GetIsSharedOk returns a tuple with the IsShared field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DashboardListItem) GetIsSharedOk() (*bool, bool) {
if o == nil || o.IsShared == nil {
return nil, false
}
return o.IsShared, true
}
// HasIsShared returns a boolean if a field has been set.
func (o *DashboardListItem) HasIsShared() bool {
if o != nil && o.IsShared != nil {
return true
}
return false
}
// SetIsShared gets a reference to the given bool and assigns it to the IsShared field.
func (o *DashboardListItem) SetIsShared(v bool) {
o.IsShared = &v
}
// GetModified returns the Modified field value if set, zero value otherwise.
func (o *DashboardListItem) GetModified() time.Time {
if o == nil || o.Modified == nil {
var ret time.Time
return ret
}
return *o.Modified
}
// GetModifiedOk returns a tuple with the Modified field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DashboardListItem) GetModifiedOk() (*time.Time, bool) {
if o == nil || o.Modified == nil {
return nil, false
}
return o.Modified, true
}
// HasModified returns a boolean if a field has been set.
func (o *DashboardListItem) HasModified() bool {
if o != nil && o.Modified != nil {
return true
}
return false
}
// SetModified gets a reference to the given time.Time and assigns it to the Modified field.
func (o *DashboardListItem) SetModified(v time.Time) {
o.Modified = &v
}
// GetPopularity returns the Popularity field value if set, zero value otherwise.
func (o *DashboardListItem) GetPopularity() int32 {
if o == nil || o.Popularity == nil {
var ret int32
return ret
}
return *o.Popularity
}
// GetPopularityOk returns a tuple with the Popularity field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DashboardListItem) GetPopularityOk() (*int32, bool) {
if o == nil || o.Popularity == nil {
return nil, false
}
return o.Popularity, true
}
// HasPopularity returns a boolean if a field has been set.
func (o *DashboardListItem) HasPopularity() bool {
if o != nil && o.Popularity != nil {
return true
}
return false
}
// SetPopularity gets a reference to the given int32 and assigns it to the Popularity field.
func (o *DashboardListItem) SetPopularity(v int32) {
o.Popularity = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *DashboardListItem) GetTitle() string {
if o == nil || o.Title == nil {
var ret string
return ret
}
return *o.Title
}
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DashboardListItem) GetTitleOk() (*string, bool) {
if o == nil || o.Title == nil {
return nil, false
}
return o.Title, true
}
// HasTitle returns a boolean if a field has been set.
func (o *DashboardListItem) HasTitle() bool {
if o != nil && o.Title != nil {
return true
}
return false
}
// SetTitle gets a reference to the given string and assigns it to the Title field.
func (o *DashboardListItem) SetTitle(v string) {
o.Title = &v
}
// GetType returns the Type field value
func (o *DashboardListItem) GetType() DashboardType {
if o == nil {
var ret DashboardType
return ret
}
return o.Type
}
// GetTypeOk returns a tuple with the Type field value
// and a boolean to check if the value has been set.
func (o *DashboardListItem) GetTypeOk() (*DashboardType, bool) {
if o == nil {
return nil, false
}
return &o.Type, true
}
// SetType sets field value
func (o *DashboardListItem) SetType(v DashboardType) {
o.Type = v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *DashboardListItem) GetUrl() string {
if o == nil || o.Url == nil {
var ret string
return ret
}
return *o.Url
}
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DashboardListItem) GetUrlOk() (*string, bool) {
if o == nil || o.Url == nil {
return nil, false
}
return o.Url, true
}
// HasUrl returns a boolean if a field has been set.
func (o *DashboardListItem) HasUrl() bool {
if o != nil && o.Url != nil {
return true
}
return false
}
// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *DashboardListItem) SetUrl(v string) {
o.Url = &v
}
func (o DashboardListItem) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return json.Marshal(o.UnparsedObject)
}
if o.Author != nil {
toSerialize["author"] = o.Author
}
if o.Created != nil {
toSerialize["created"] = o.Created
}
if o.Icon != nil {
toSerialize["icon"] = o.Icon
}
if true {
toSerialize["id"] = o.Id
}
if o.IsFavorite != nil {
toSerialize["is_favorite"] = o.IsFavorite
}
if o.IsReadOnly != nil {
toSerialize["is_read_only"] = o.IsReadOnly
}
if o.IsShared != nil {
toSerialize["is_shared"] = o.IsShared
}
if o.Modified != nil {
toSerialize["modified"] = o.Modified
}
if o.Popularity != nil {
toSerialize["popularity"] = o.Popularity
}
if o.Title != nil {
toSerialize["title"] = o.Title
}
if true {
toSerialize["type"] = o.Type
}
if o.Url != nil {
toSerialize["url"] = o.Url
}
return json.Marshal(toSerialize)
}
func (o *DashboardListItem) UnmarshalJSON(bytes []byte) (err error) {
raw := map[string]interface{}{}
required := struct {
Id *string `json:"id"`
Type *DashboardType `json:"type"`
}{}
all := struct {
Author *Creator `json:"author,omitempty"`
Created *time.Time `json:"created,omitempty"`
Icon *string `json:"icon,omitempty"`
Id string `json:"id"`
IsFavorite *bool `json:"is_favorite,omitempty"`
IsReadOnly *bool `json:"is_read_only,omitempty"`
IsShared *bool `json:"is_shared,omitempty"`
Modified *time.Time `json:"modified,omitempty"`
Popularity *int32 `json:"popularity,omitempty"`
Title *string `json:"title,omitempty"`
Type DashboardType `json:"type"`
Url *string `json:"url,omitempty"`
}{}
err = json.Unmarshal(bytes, &required)
if err != nil {
return err
}
if required.Id == nil {
return fmt.Errorf("Required field id missing")
}
if required.Type == nil {
return fmt.Errorf("Required field type missing")
}
err = json.Unmarshal(bytes, &all)
if err != nil {
err = json.Unmarshal(bytes, &raw)
if err != nil {
return err
}
o.UnparsedObject = raw
return nil
}
if v := all.Type; !v.IsValid() {
err = json.Unmarshal(bytes, &raw)
if err != nil {
return err
}
o.UnparsedObject = raw
return nil
}
o.Author = all.Author
o.Created = all.Created
o.Icon = all.Icon
o.Id = all.Id
o.IsFavorite = all.IsFavorite
o.IsReadOnly = all.IsReadOnly
o.IsShared = all.IsShared
o.Modified = all.Modified
o.Popularity = all.Popularity
o.Title = all.Title
o.Type = all.Type
o.Url = all.Url
return nil
}
type NullableDashboardListItem struct {
value *DashboardListItem
isSet bool
}
func (v NullableDashboardListItem) Get() *DashboardListItem {
return v.value
}
func (v *NullableDashboardListItem) Set(val *DashboardListItem) {
v.value = val
v.isSet = true
}
func (v NullableDashboardListItem) IsSet() bool {
return v.isSet
}
func (v *NullableDashboardListItem) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDashboardListItem(val *DashboardListItem) *NullableDashboardListItem {
return &NullableDashboardListItem{value: val, isSet: true}
}
func (v NullableDashboardListItem) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDashboardListItem) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}