-
Notifications
You must be signed in to change notification settings - Fork 54
/
model_ci_app_aggregate_bucket_value_timeseries.go
63 lines (53 loc) · 2.3 KB
/
model_ci_app_aggregate_bucket_value_timeseries.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
// 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 (
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)
// CIAppAggregateBucketValueTimeseries A timeseries array.
type CIAppAggregateBucketValueTimeseries struct {
Items []CIAppAggregateBucketValueTimeseriesPoint
// UnparsedObject contains the raw value of the array if there was an error when deserializing into the struct
UnparsedObject []interface{} `json:"-"`
}
// NewCIAppAggregateBucketValueTimeseries instantiates a new CIAppAggregateBucketValueTimeseries 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 NewCIAppAggregateBucketValueTimeseries() *CIAppAggregateBucketValueTimeseries {
this := CIAppAggregateBucketValueTimeseries{}
return &this
}
// NewCIAppAggregateBucketValueTimeseriesWithDefaults instantiates a new CIAppAggregateBucketValueTimeseries 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 NewCIAppAggregateBucketValueTimeseriesWithDefaults() *CIAppAggregateBucketValueTimeseries {
this := CIAppAggregateBucketValueTimeseries{}
return &this
}
// MarshalJSON serializes the struct using spec logic.
func (o CIAppAggregateBucketValueTimeseries) MarshalJSON() ([]byte, error) {
toSerialize := make([]interface{}, len(o.Items))
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
for i, item := range o.Items {
toSerialize[i] = item
}
return datadog.Marshal(toSerialize)
}
// UnmarshalJSON deserializes the given payload.
func (o *CIAppAggregateBucketValueTimeseries) UnmarshalJSON(bytes []byte) (err error) {
if err = datadog.Unmarshal(bytes, &o.Items); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
if o.Items != nil && len(o.Items) > 0 {
for _, v := range o.Items {
if v.UnparsedObject != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
}
}
return nil
}