-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathmodel_dashboard.go
More file actions
589 lines (505 loc) · 16.3 KB
/
model_dashboard.go
File metadata and controls
589 lines (505 loc) · 16.3 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
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
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
/*
* 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"
)
// Dashboard A dashboard is Datadog’s tool for visually tracking, analyzing, and displaying key performance metrics, which enable you to monitor the health of your infrastructure.
type Dashboard struct {
// Identifier of the dashboard author.
AuthorHandle *string `json:"author_handle,omitempty"`
// Creation date of the dashboard.
CreatedAt *time.Time `json:"created_at,omitempty"`
// Description of the dashboard.
Description NullableString `json:"description,omitempty"`
// ID of the dashboard.
Id *string `json:"id,omitempty"`
// Whether this dashboard is read-only. If True, only the author and admins can make changes to it.
IsReadOnly *bool `json:"is_read_only,omitempty"`
LayoutType DashboardLayoutType `json:"layout_type"`
// Modification date of the dashboard.
ModifiedAt *time.Time `json:"modified_at,omitempty"`
// List of handles of users to notify when changes are made to this dashboard.
NotifyList []string `json:"notify_list,omitempty"`
ReflowType *DashboardReflowType `json:"reflow_type,omitempty"`
// Array of template variables saved views.
TemplateVariablePresets []DashboardTemplateVariablePreset `json:"template_variable_presets,omitempty"`
// List of template variables for this dashboard.
TemplateVariables []DashboardTemplateVariable `json:"template_variables,omitempty"`
// Title of the dashboard.
Title string `json:"title"`
// The URL of the dashboard.
Url *string `json:"url,omitempty"`
// List of widgets to display on the dashboard.
Widgets []Widget `json:"widgets"`
}
// NewDashboard instantiates a new Dashboard 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 NewDashboard(layoutType DashboardLayoutType, title string, widgets []Widget) *Dashboard {
this := Dashboard{}
var isReadOnly bool = false
this.IsReadOnly = &isReadOnly
this.LayoutType = layoutType
this.Title = title
this.Widgets = widgets
return &this
}
// NewDashboardWithDefaults instantiates a new Dashboard 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 NewDashboardWithDefaults() *Dashboard {
this := Dashboard{}
var isReadOnly bool = false
this.IsReadOnly = &isReadOnly
return &this
}
// GetAuthorHandle returns the AuthorHandle field value if set, zero value otherwise.
func (o *Dashboard) GetAuthorHandle() string {
if o == nil || o.AuthorHandle == nil {
var ret string
return ret
}
return *o.AuthorHandle
}
// GetAuthorHandleOk returns a tuple with the AuthorHandle field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Dashboard) GetAuthorHandleOk() (*string, bool) {
if o == nil || o.AuthorHandle == nil {
return nil, false
}
return o.AuthorHandle, true
}
// HasAuthorHandle returns a boolean if a field has been set.
func (o *Dashboard) HasAuthorHandle() bool {
if o != nil && o.AuthorHandle != nil {
return true
}
return false
}
// SetAuthorHandle gets a reference to the given string and assigns it to the AuthorHandle field.
func (o *Dashboard) SetAuthorHandle(v string) {
o.AuthorHandle = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *Dashboard) 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 *Dashboard) 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 *Dashboard) 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 *Dashboard) 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 *Dashboard) 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 *Dashboard) 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 *Dashboard) HasDescription() bool {
if o != nil && o.Description.IsSet() {
return true
}
return false
}
// SetDescription gets a reference to the given NullableString and assigns it to the Description field.
func (o *Dashboard) SetDescription(v string) {
o.Description.Set(&v)
}
// SetDescriptionNil sets the value for Description to be an explicit nil
func (o *Dashboard) SetDescriptionNil() {
o.Description.Set(nil)
}
// UnsetDescription ensures that no value is present for Description, not even an explicit nil
func (o *Dashboard) UnsetDescription() {
o.Description.Unset()
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *Dashboard) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Dashboard) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *Dashboard) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *Dashboard) SetId(v string) {
o.Id = &v
}
// GetIsReadOnly returns the IsReadOnly field value if set, zero value otherwise.
func (o *Dashboard) 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 *Dashboard) 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 *Dashboard) 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 *Dashboard) SetIsReadOnly(v bool) {
o.IsReadOnly = &v
}
// GetLayoutType returns the LayoutType field value
func (o *Dashboard) GetLayoutType() DashboardLayoutType {
if o == nil {
var ret DashboardLayoutType
return ret
}
return o.LayoutType
}
// GetLayoutTypeOk returns a tuple with the LayoutType field value
// and a boolean to check if the value has been set.
func (o *Dashboard) GetLayoutTypeOk() (*DashboardLayoutType, bool) {
if o == nil {
return nil, false
}
return &o.LayoutType, true
}
// SetLayoutType sets field value
func (o *Dashboard) SetLayoutType(v DashboardLayoutType) {
o.LayoutType = v
}
// GetModifiedAt returns the ModifiedAt field value if set, zero value otherwise.
func (o *Dashboard) 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 *Dashboard) 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 *Dashboard) 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 *Dashboard) SetModifiedAt(v time.Time) {
o.ModifiedAt = &v
}
// GetNotifyList returns the NotifyList field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Dashboard) GetNotifyList() []string {
if o == nil {
var ret []string
return ret
}
return o.NotifyList
}
// GetNotifyListOk returns a tuple with the NotifyList 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 *Dashboard) GetNotifyListOk() (*[]string, bool) {
if o == nil || o.NotifyList == nil {
return nil, false
}
return &o.NotifyList, true
}
// HasNotifyList returns a boolean if a field has been set.
func (o *Dashboard) HasNotifyList() bool {
if o != nil && o.NotifyList != nil {
return true
}
return false
}
// SetNotifyList gets a reference to the given []string and assigns it to the NotifyList field.
func (o *Dashboard) SetNotifyList(v []string) {
o.NotifyList = v
}
// GetReflowType returns the ReflowType field value if set, zero value otherwise.
func (o *Dashboard) GetReflowType() DashboardReflowType {
if o == nil || o.ReflowType == nil {
var ret DashboardReflowType
return ret
}
return *o.ReflowType
}
// GetReflowTypeOk returns a tuple with the ReflowType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Dashboard) GetReflowTypeOk() (*DashboardReflowType, bool) {
if o == nil || o.ReflowType == nil {
return nil, false
}
return o.ReflowType, true
}
// HasReflowType returns a boolean if a field has been set.
func (o *Dashboard) HasReflowType() bool {
if o != nil && o.ReflowType != nil {
return true
}
return false
}
// SetReflowType gets a reference to the given DashboardReflowType and assigns it to the ReflowType field.
func (o *Dashboard) SetReflowType(v DashboardReflowType) {
o.ReflowType = &v
}
// GetTemplateVariablePresets returns the TemplateVariablePresets field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Dashboard) GetTemplateVariablePresets() []DashboardTemplateVariablePreset {
if o == nil {
var ret []DashboardTemplateVariablePreset
return ret
}
return o.TemplateVariablePresets
}
// GetTemplateVariablePresetsOk returns a tuple with the TemplateVariablePresets 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 *Dashboard) GetTemplateVariablePresetsOk() (*[]DashboardTemplateVariablePreset, bool) {
if o == nil || o.TemplateVariablePresets == nil {
return nil, false
}
return &o.TemplateVariablePresets, true
}
// HasTemplateVariablePresets returns a boolean if a field has been set.
func (o *Dashboard) HasTemplateVariablePresets() bool {
if o != nil && o.TemplateVariablePresets != nil {
return true
}
return false
}
// SetTemplateVariablePresets gets a reference to the given []DashboardTemplateVariablePreset and assigns it to the TemplateVariablePresets field.
func (o *Dashboard) SetTemplateVariablePresets(v []DashboardTemplateVariablePreset) {
o.TemplateVariablePresets = v
}
// GetTemplateVariables returns the TemplateVariables field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Dashboard) GetTemplateVariables() []DashboardTemplateVariable {
if o == nil {
var ret []DashboardTemplateVariable
return ret
}
return o.TemplateVariables
}
// GetTemplateVariablesOk returns a tuple with the TemplateVariables 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 *Dashboard) GetTemplateVariablesOk() (*[]DashboardTemplateVariable, bool) {
if o == nil || o.TemplateVariables == nil {
return nil, false
}
return &o.TemplateVariables, true
}
// HasTemplateVariables returns a boolean if a field has been set.
func (o *Dashboard) HasTemplateVariables() bool {
if o != nil && o.TemplateVariables != nil {
return true
}
return false
}
// SetTemplateVariables gets a reference to the given []DashboardTemplateVariable and assigns it to the TemplateVariables field.
func (o *Dashboard) SetTemplateVariables(v []DashboardTemplateVariable) {
o.TemplateVariables = v
}
// GetTitle returns the Title field value
func (o *Dashboard) GetTitle() string {
if o == nil {
var ret string
return ret
}
return o.Title
}
// GetTitleOk returns a tuple with the Title field value
// and a boolean to check if the value has been set.
func (o *Dashboard) GetTitleOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Title, true
}
// SetTitle sets field value
func (o *Dashboard) SetTitle(v string) {
o.Title = v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *Dashboard) 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 *Dashboard) 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 *Dashboard) 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 *Dashboard) SetUrl(v string) {
o.Url = &v
}
// GetWidgets returns the Widgets field value
func (o *Dashboard) GetWidgets() []Widget {
if o == nil {
var ret []Widget
return ret
}
return o.Widgets
}
// GetWidgetsOk returns a tuple with the Widgets field value
// and a boolean to check if the value has been set.
func (o *Dashboard) GetWidgetsOk() (*[]Widget, bool) {
if o == nil {
return nil, false
}
return &o.Widgets, true
}
// SetWidgets sets field value
func (o *Dashboard) SetWidgets(v []Widget) {
o.Widgets = v
}
func (o Dashboard) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.AuthorHandle != nil {
toSerialize["author_handle"] = o.AuthorHandle
}
if o.CreatedAt != nil {
toSerialize["created_at"] = o.CreatedAt
}
if o.Description.IsSet() {
toSerialize["description"] = o.Description.Get()
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.IsReadOnly != nil {
toSerialize["is_read_only"] = o.IsReadOnly
}
if true {
toSerialize["layout_type"] = o.LayoutType
}
if o.ModifiedAt != nil {
toSerialize["modified_at"] = o.ModifiedAt
}
if o.NotifyList != nil {
toSerialize["notify_list"] = o.NotifyList
}
if o.ReflowType != nil {
toSerialize["reflow_type"] = o.ReflowType
}
if o.TemplateVariablePresets != nil {
toSerialize["template_variable_presets"] = o.TemplateVariablePresets
}
if o.TemplateVariables != nil {
toSerialize["template_variables"] = o.TemplateVariables
}
if true {
toSerialize["title"] = o.Title
}
if o.Url != nil {
toSerialize["url"] = o.Url
}
if true {
toSerialize["widgets"] = o.Widgets
}
return json.Marshal(toSerialize)
}
type NullableDashboard struct {
value *Dashboard
isSet bool
}
func (v NullableDashboard) Get() *Dashboard {
return v.value
}
func (v *NullableDashboard) Set(val *Dashboard) {
v.value = val
v.isSet = true
}
func (v NullableDashboard) IsSet() bool {
return v.isSet
}
func (v *NullableDashboard) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDashboard(val *Dashboard) *NullableDashboard {
return &NullableDashboard{value: val, isSet: true}
}
func (v NullableDashboard) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDashboard) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}