-
Notifications
You must be signed in to change notification settings - Fork 54
/
model_metrics_query_metadata.go
536 lines (472 loc) · 16.5 KB
/
model_metrics_query_metadata.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 datadogV1
import (
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)
// MetricsQueryMetadata Object containing all metric names returned and their associated metadata.
type MetricsQueryMetadata struct {
// Aggregation type.
Aggr datadog.NullableString `json:"aggr,omitempty"`
// Display name of the metric.
DisplayName *string `json:"display_name,omitempty"`
// End of the time window, milliseconds since Unix epoch.
End *int64 `json:"end,omitempty"`
// Metric expression.
Expression *string `json:"expression,omitempty"`
// Number of milliseconds between data samples.
Interval *int64 `json:"interval,omitempty"`
// Number of data samples.
Length *int64 `json:"length,omitempty"`
// Metric name.
Metric *string `json:"metric,omitempty"`
// List of points of the timeseries in milliseconds.
Pointlist [][]*float64 `json:"pointlist,omitempty"`
// The index of the series' query within the request.
QueryIndex *int64 `json:"query_index,omitempty"`
// Metric scope, comma separated list of tags.
Scope *string `json:"scope,omitempty"`
// Start of the time window, milliseconds since Unix epoch.
Start *int64 `json:"start,omitempty"`
// Unique tags identifying this series.
TagSet []string `json:"tag_set,omitempty"`
// Detailed information about the metric unit.
// The first element describes the "primary unit" (for example, `bytes` in `bytes per second`).
// The second element describes the "per unit" (for example, `second` in `bytes per second`).
// If the second element is not present, the API returns null.
Unit []MetricsQueryUnit `json:"unit,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{}
}
// NewMetricsQueryMetadata instantiates a new MetricsQueryMetadata 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 NewMetricsQueryMetadata() *MetricsQueryMetadata {
this := MetricsQueryMetadata{}
return &this
}
// NewMetricsQueryMetadataWithDefaults instantiates a new MetricsQueryMetadata 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 NewMetricsQueryMetadataWithDefaults() *MetricsQueryMetadata {
this := MetricsQueryMetadata{}
return &this
}
// GetAggr returns the Aggr field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MetricsQueryMetadata) GetAggr() string {
if o == nil || o.Aggr.Get() == nil {
var ret string
return ret
}
return *o.Aggr.Get()
}
// GetAggrOk returns a tuple with the Aggr 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 *MetricsQueryMetadata) GetAggrOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Aggr.Get(), o.Aggr.IsSet()
}
// HasAggr returns a boolean if a field has been set.
func (o *MetricsQueryMetadata) HasAggr() bool {
return o != nil && o.Aggr.IsSet()
}
// SetAggr gets a reference to the given datadog.NullableString and assigns it to the Aggr field.
func (o *MetricsQueryMetadata) SetAggr(v string) {
o.Aggr.Set(&v)
}
// SetAggrNil sets the value for Aggr to be an explicit nil.
func (o *MetricsQueryMetadata) SetAggrNil() {
o.Aggr.Set(nil)
}
// UnsetAggr ensures that no value is present for Aggr, not even an explicit nil.
func (o *MetricsQueryMetadata) UnsetAggr() {
o.Aggr.Unset()
}
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *MetricsQueryMetadata) GetDisplayName() string {
if o == nil || o.DisplayName == nil {
var ret string
return ret
}
return *o.DisplayName
}
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsQueryMetadata) GetDisplayNameOk() (*string, bool) {
if o == nil || o.DisplayName == nil {
return nil, false
}
return o.DisplayName, true
}
// HasDisplayName returns a boolean if a field has been set.
func (o *MetricsQueryMetadata) HasDisplayName() bool {
return o != nil && o.DisplayName != nil
}
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
func (o *MetricsQueryMetadata) SetDisplayName(v string) {
o.DisplayName = &v
}
// GetEnd returns the End field value if set, zero value otherwise.
func (o *MetricsQueryMetadata) GetEnd() int64 {
if o == nil || o.End == nil {
var ret int64
return ret
}
return *o.End
}
// GetEndOk returns a tuple with the End field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsQueryMetadata) GetEndOk() (*int64, bool) {
if o == nil || o.End == nil {
return nil, false
}
return o.End, true
}
// HasEnd returns a boolean if a field has been set.
func (o *MetricsQueryMetadata) HasEnd() bool {
return o != nil && o.End != nil
}
// SetEnd gets a reference to the given int64 and assigns it to the End field.
func (o *MetricsQueryMetadata) SetEnd(v int64) {
o.End = &v
}
// GetExpression returns the Expression field value if set, zero value otherwise.
func (o *MetricsQueryMetadata) GetExpression() string {
if o == nil || o.Expression == nil {
var ret string
return ret
}
return *o.Expression
}
// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsQueryMetadata) GetExpressionOk() (*string, bool) {
if o == nil || o.Expression == nil {
return nil, false
}
return o.Expression, true
}
// HasExpression returns a boolean if a field has been set.
func (o *MetricsQueryMetadata) HasExpression() bool {
return o != nil && o.Expression != nil
}
// SetExpression gets a reference to the given string and assigns it to the Expression field.
func (o *MetricsQueryMetadata) SetExpression(v string) {
o.Expression = &v
}
// GetInterval returns the Interval field value if set, zero value otherwise.
func (o *MetricsQueryMetadata) GetInterval() int64 {
if o == nil || o.Interval == nil {
var ret int64
return ret
}
return *o.Interval
}
// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsQueryMetadata) GetIntervalOk() (*int64, bool) {
if o == nil || o.Interval == nil {
return nil, false
}
return o.Interval, true
}
// HasInterval returns a boolean if a field has been set.
func (o *MetricsQueryMetadata) HasInterval() bool {
return o != nil && o.Interval != nil
}
// SetInterval gets a reference to the given int64 and assigns it to the Interval field.
func (o *MetricsQueryMetadata) SetInterval(v int64) {
o.Interval = &v
}
// GetLength returns the Length field value if set, zero value otherwise.
func (o *MetricsQueryMetadata) GetLength() int64 {
if o == nil || o.Length == nil {
var ret int64
return ret
}
return *o.Length
}
// GetLengthOk returns a tuple with the Length field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsQueryMetadata) GetLengthOk() (*int64, bool) {
if o == nil || o.Length == nil {
return nil, false
}
return o.Length, true
}
// HasLength returns a boolean if a field has been set.
func (o *MetricsQueryMetadata) HasLength() bool {
return o != nil && o.Length != nil
}
// SetLength gets a reference to the given int64 and assigns it to the Length field.
func (o *MetricsQueryMetadata) SetLength(v int64) {
o.Length = &v
}
// GetMetric returns the Metric field value if set, zero value otherwise.
func (o *MetricsQueryMetadata) GetMetric() string {
if o == nil || o.Metric == nil {
var ret string
return ret
}
return *o.Metric
}
// GetMetricOk returns a tuple with the Metric field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsQueryMetadata) GetMetricOk() (*string, bool) {
if o == nil || o.Metric == nil {
return nil, false
}
return o.Metric, true
}
// HasMetric returns a boolean if a field has been set.
func (o *MetricsQueryMetadata) HasMetric() bool {
return o != nil && o.Metric != nil
}
// SetMetric gets a reference to the given string and assigns it to the Metric field.
func (o *MetricsQueryMetadata) SetMetric(v string) {
o.Metric = &v
}
// GetPointlist returns the Pointlist field value if set, zero value otherwise.
func (o *MetricsQueryMetadata) GetPointlist() [][]*float64 {
if o == nil || o.Pointlist == nil {
var ret [][]*float64
return ret
}
return o.Pointlist
}
// GetPointlistOk returns a tuple with the Pointlist field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsQueryMetadata) GetPointlistOk() (*[][]*float64, bool) {
if o == nil || o.Pointlist == nil {
return nil, false
}
return &o.Pointlist, true
}
// HasPointlist returns a boolean if a field has been set.
func (o *MetricsQueryMetadata) HasPointlist() bool {
return o != nil && o.Pointlist != nil
}
// SetPointlist gets a reference to the given [][]*float64 and assigns it to the Pointlist field.
func (o *MetricsQueryMetadata) SetPointlist(v [][]*float64) {
o.Pointlist = v
}
// GetQueryIndex returns the QueryIndex field value if set, zero value otherwise.
func (o *MetricsQueryMetadata) GetQueryIndex() int64 {
if o == nil || o.QueryIndex == nil {
var ret int64
return ret
}
return *o.QueryIndex
}
// GetQueryIndexOk returns a tuple with the QueryIndex field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsQueryMetadata) GetQueryIndexOk() (*int64, bool) {
if o == nil || o.QueryIndex == nil {
return nil, false
}
return o.QueryIndex, true
}
// HasQueryIndex returns a boolean if a field has been set.
func (o *MetricsQueryMetadata) HasQueryIndex() bool {
return o != nil && o.QueryIndex != nil
}
// SetQueryIndex gets a reference to the given int64 and assigns it to the QueryIndex field.
func (o *MetricsQueryMetadata) SetQueryIndex(v int64) {
o.QueryIndex = &v
}
// GetScope returns the Scope field value if set, zero value otherwise.
func (o *MetricsQueryMetadata) GetScope() string {
if o == nil || o.Scope == nil {
var ret string
return ret
}
return *o.Scope
}
// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsQueryMetadata) GetScopeOk() (*string, bool) {
if o == nil || o.Scope == nil {
return nil, false
}
return o.Scope, true
}
// HasScope returns a boolean if a field has been set.
func (o *MetricsQueryMetadata) HasScope() bool {
return o != nil && o.Scope != nil
}
// SetScope gets a reference to the given string and assigns it to the Scope field.
func (o *MetricsQueryMetadata) SetScope(v string) {
o.Scope = &v
}
// GetStart returns the Start field value if set, zero value otherwise.
func (o *MetricsQueryMetadata) GetStart() int64 {
if o == nil || o.Start == nil {
var ret int64
return ret
}
return *o.Start
}
// GetStartOk returns a tuple with the Start field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsQueryMetadata) GetStartOk() (*int64, bool) {
if o == nil || o.Start == nil {
return nil, false
}
return o.Start, true
}
// HasStart returns a boolean if a field has been set.
func (o *MetricsQueryMetadata) HasStart() bool {
return o != nil && o.Start != nil
}
// SetStart gets a reference to the given int64 and assigns it to the Start field.
func (o *MetricsQueryMetadata) SetStart(v int64) {
o.Start = &v
}
// GetTagSet returns the TagSet field value if set, zero value otherwise.
func (o *MetricsQueryMetadata) GetTagSet() []string {
if o == nil || o.TagSet == nil {
var ret []string
return ret
}
return o.TagSet
}
// GetTagSetOk returns a tuple with the TagSet field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsQueryMetadata) GetTagSetOk() (*[]string, bool) {
if o == nil || o.TagSet == nil {
return nil, false
}
return &o.TagSet, true
}
// HasTagSet returns a boolean if a field has been set.
func (o *MetricsQueryMetadata) HasTagSet() bool {
return o != nil && o.TagSet != nil
}
// SetTagSet gets a reference to the given []string and assigns it to the TagSet field.
func (o *MetricsQueryMetadata) SetTagSet(v []string) {
o.TagSet = v
}
// GetUnit returns the Unit field value if set, zero value otherwise.
func (o *MetricsQueryMetadata) GetUnit() []MetricsQueryUnit {
if o == nil || o.Unit == nil {
var ret []MetricsQueryUnit
return ret
}
return o.Unit
}
// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsQueryMetadata) GetUnitOk() (*[]MetricsQueryUnit, bool) {
if o == nil || o.Unit == nil {
return nil, false
}
return &o.Unit, true
}
// HasUnit returns a boolean if a field has been set.
func (o *MetricsQueryMetadata) HasUnit() bool {
return o != nil && o.Unit != nil
}
// SetUnit gets a reference to the given []MetricsQueryUnit and assigns it to the Unit field.
func (o *MetricsQueryMetadata) SetUnit(v []MetricsQueryUnit) {
o.Unit = v
}
// MarshalJSON serializes the struct using spec logic.
func (o MetricsQueryMetadata) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Aggr.IsSet() {
toSerialize["aggr"] = o.Aggr.Get()
}
if o.DisplayName != nil {
toSerialize["display_name"] = o.DisplayName
}
if o.End != nil {
toSerialize["end"] = o.End
}
if o.Expression != nil {
toSerialize["expression"] = o.Expression
}
if o.Interval != nil {
toSerialize["interval"] = o.Interval
}
if o.Length != nil {
toSerialize["length"] = o.Length
}
if o.Metric != nil {
toSerialize["metric"] = o.Metric
}
if o.Pointlist != nil {
toSerialize["pointlist"] = o.Pointlist
}
if o.QueryIndex != nil {
toSerialize["query_index"] = o.QueryIndex
}
if o.Scope != nil {
toSerialize["scope"] = o.Scope
}
if o.Start != nil {
toSerialize["start"] = o.Start
}
if o.TagSet != nil {
toSerialize["tag_set"] = o.TagSet
}
if o.Unit != nil {
toSerialize["unit"] = o.Unit
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}
// UnmarshalJSON deserializes the given payload.
func (o *MetricsQueryMetadata) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Aggr datadog.NullableString `json:"aggr,omitempty"`
DisplayName *string `json:"display_name,omitempty"`
End *int64 `json:"end,omitempty"`
Expression *string `json:"expression,omitempty"`
Interval *int64 `json:"interval,omitempty"`
Length *int64 `json:"length,omitempty"`
Metric *string `json:"metric,omitempty"`
Pointlist [][]*float64 `json:"pointlist,omitempty"`
QueryIndex *int64 `json:"query_index,omitempty"`
Scope *string `json:"scope,omitempty"`
Start *int64 `json:"start,omitempty"`
TagSet []string `json:"tag_set,omitempty"`
Unit []MetricsQueryUnit `json:"unit,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"aggr", "display_name", "end", "expression", "interval", "length", "metric", "pointlist", "query_index", "scope", "start", "tag_set", "unit"})
} else {
return err
}
o.Aggr = all.Aggr
o.DisplayName = all.DisplayName
o.End = all.End
o.Expression = all.Expression
o.Interval = all.Interval
o.Length = all.Length
o.Metric = all.Metric
o.Pointlist = all.Pointlist
o.QueryIndex = all.QueryIndex
o.Scope = all.Scope
o.Start = all.Start
o.TagSet = all.TagSet
o.Unit = all.Unit
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}
return nil
}