Skip to content

Commit a60a078

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 0895ae7 of spec repo (#4135)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 23c80be commit a60a078

10 files changed

Lines changed: 810 additions & 40 deletions

.generator/schemas/v1/openapi.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,50 @@ components:
13451345
type: string
13461346
x-enum-varnames:
13471347
- COHORT
1348+
ComparisonCustomTimeframe:
1349+
description: Fixed time range for a `custom_timeframe` comparison.
1350+
properties:
1351+
from:
1352+
description: Start time in milliseconds since epoch.
1353+
example: 1779290190000
1354+
format: int64
1355+
type: integer
1356+
to:
1357+
description: End time in milliseconds since epoch.
1358+
example: 1779894990000
1359+
format: int64
1360+
type: integer
1361+
required:
1362+
- from
1363+
- to
1364+
type: object
1365+
ComparisonDuration:
1366+
description: The comparison period. Use a preset `type` value or set `type` to `custom_timeframe` and provide `custom_timeframe` with explicit millisecond epoch bounds.
1367+
properties:
1368+
custom_timeframe:
1369+
$ref: "#/components/schemas/ComparisonCustomTimeframe"
1370+
description: Required when `type` is `custom_timeframe`. Fixed time range to compare against.
1371+
type:
1372+
$ref: "#/components/schemas/ComparisonDurationType"
1373+
required:
1374+
- type
1375+
type: object
1376+
ComparisonDurationType:
1377+
description: "The comparison window type."
1378+
enum:
1379+
- previous_timeframe
1380+
- custom_timeframe
1381+
- previous_day
1382+
- previous_week
1383+
- previous_month
1384+
example: previous_timeframe
1385+
type: string
1386+
x-enum-varnames:
1387+
- PREVIOUS_TIMEFRAME
1388+
- CUSTOM_TIMEFRAME
1389+
- PREVIOUS_DAY
1390+
- PREVIOUS_WEEK
1391+
- PREVIOUS_MONTH
13481392
ContentEncoding:
13491393
description: HTTP header used to compress the media-type.
13501394
enum:
@@ -12064,6 +12108,43 @@ components:
1206412108
x-enum-varnames:
1206512109
- ASC
1206612110
- DESC
12111+
QueryValueWidgetComparison:
12112+
description: A change indicator that compares the current value to a historical period.
12113+
properties:
12114+
directionality:
12115+
$ref: "#/components/schemas/QueryValueWidgetComparisonDirectionality"
12116+
description: Which direction of change is considered an improvement, determining the indicator color.
12117+
duration:
12118+
$ref: "#/components/schemas/ComparisonDuration"
12119+
type:
12120+
$ref: "#/components/schemas/QueryValueWidgetComparisonType"
12121+
required:
12122+
- duration
12123+
type: object
12124+
QueryValueWidgetComparisonDirectionality:
12125+
default: neutral
12126+
description: "Color-coding direction: `increase_better` (green on rise), `decrease_better` (green on drop), or `neutral` (no color)."
12127+
enum:
12128+
- increase_better
12129+
- decrease_better
12130+
- neutral
12131+
type: string
12132+
x-enum-varnames:
12133+
- INCREASE_BETTER
12134+
- DECREASE_BETTER
12135+
- NEUTRAL
12136+
QueryValueWidgetComparisonType:
12137+
default: absolute
12138+
description: "How the delta is expressed: `absolute` (raw difference), `relative` (percentage), or `both`."
12139+
enum:
12140+
- absolute
12141+
- relative
12142+
- both
12143+
type: string
12144+
x-enum-varnames:
12145+
- ABSOLUTE
12146+
- RELATIVE
12147+
- BOTH
1206712148
QueryValueWidgetDefinition:
1206812149
description: Query values display the current value of a given metric, APM, or log query.
1206912150
properties:
@@ -12135,6 +12216,9 @@ components:
1213512216
$ref: "#/components/schemas/LogQueryDefinition"
1213612217
deprecated: true
1213712218
description: Deprecated - Use `queries` and `formulas` instead.
12219+
comparison:
12220+
$ref: "#/components/schemas/QueryValueWidgetComparison"
12221+
description: Displays a change indicator showing a delta against a historical baseline.
1213812222
conditional_formats:
1213912223
description: List of conditional formats.
1214012224
items:

.generator/schemas/v2/openapi.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66681,9 +66681,6 @@ components:
6668166681
filter:
6668266682
description: Filter expression applied to the recommendations.
6668366683
type: string
66684-
scope:
66685-
description: Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both.
66686-
type: string
6668766684
sort:
6668866685
description: Ordered list of sort clauses applied to the result set.
6668966686
items:
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV1
6+
7+
import (
8+
"fmt"
9+
10+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
11+
)
12+
13+
// ComparisonCustomTimeframe Fixed time range for a `custom_timeframe` comparison.
14+
type ComparisonCustomTimeframe struct {
15+
// Start time in milliseconds since epoch.
16+
From int64 `json:"from"`
17+
// End time in milliseconds since epoch.
18+
To int64 `json:"to"`
19+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
20+
UnparsedObject map[string]interface{} `json:"-"`
21+
AdditionalProperties map[string]interface{} `json:"-"`
22+
}
23+
24+
// NewComparisonCustomTimeframe instantiates a new ComparisonCustomTimeframe object.
25+
// This constructor will assign default values to properties that have it defined,
26+
// and makes sure properties required by API are set, but the set of arguments
27+
// will change when the set of required properties is changed.
28+
func NewComparisonCustomTimeframe(from int64, to int64) *ComparisonCustomTimeframe {
29+
this := ComparisonCustomTimeframe{}
30+
this.From = from
31+
this.To = to
32+
return &this
33+
}
34+
35+
// NewComparisonCustomTimeframeWithDefaults instantiates a new ComparisonCustomTimeframe object.
36+
// This constructor will only assign default values to properties that have it defined,
37+
// but it doesn't guarantee that properties required by API are set.
38+
func NewComparisonCustomTimeframeWithDefaults() *ComparisonCustomTimeframe {
39+
this := ComparisonCustomTimeframe{}
40+
return &this
41+
}
42+
43+
// GetFrom returns the From field value.
44+
func (o *ComparisonCustomTimeframe) GetFrom() int64 {
45+
if o == nil {
46+
var ret int64
47+
return ret
48+
}
49+
return o.From
50+
}
51+
52+
// GetFromOk returns a tuple with the From field value
53+
// and a boolean to check if the value has been set.
54+
func (o *ComparisonCustomTimeframe) GetFromOk() (*int64, bool) {
55+
if o == nil {
56+
return nil, false
57+
}
58+
return &o.From, true
59+
}
60+
61+
// SetFrom sets field value.
62+
func (o *ComparisonCustomTimeframe) SetFrom(v int64) {
63+
o.From = v
64+
}
65+
66+
// GetTo returns the To field value.
67+
func (o *ComparisonCustomTimeframe) GetTo() int64 {
68+
if o == nil {
69+
var ret int64
70+
return ret
71+
}
72+
return o.To
73+
}
74+
75+
// GetToOk returns a tuple with the To field value
76+
// and a boolean to check if the value has been set.
77+
func (o *ComparisonCustomTimeframe) GetToOk() (*int64, bool) {
78+
if o == nil {
79+
return nil, false
80+
}
81+
return &o.To, true
82+
}
83+
84+
// SetTo sets field value.
85+
func (o *ComparisonCustomTimeframe) SetTo(v int64) {
86+
o.To = v
87+
}
88+
89+
// MarshalJSON serializes the struct using spec logic.
90+
func (o ComparisonCustomTimeframe) MarshalJSON() ([]byte, error) {
91+
toSerialize := map[string]interface{}{}
92+
if o.UnparsedObject != nil {
93+
return datadog.Marshal(o.UnparsedObject)
94+
}
95+
toSerialize["from"] = o.From
96+
toSerialize["to"] = o.To
97+
98+
for key, value := range o.AdditionalProperties {
99+
toSerialize[key] = value
100+
}
101+
return datadog.Marshal(toSerialize)
102+
}
103+
104+
// UnmarshalJSON deserializes the given payload.
105+
func (o *ComparisonCustomTimeframe) UnmarshalJSON(bytes []byte) (err error) {
106+
all := struct {
107+
From *int64 `json:"from"`
108+
To *int64 `json:"to"`
109+
}{}
110+
if err = datadog.Unmarshal(bytes, &all); err != nil {
111+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
112+
}
113+
if all.From == nil {
114+
return fmt.Errorf("required field from missing")
115+
}
116+
if all.To == nil {
117+
return fmt.Errorf("required field to missing")
118+
}
119+
additionalProperties := make(map[string]interface{})
120+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
121+
datadog.DeleteKeys(additionalProperties, &[]string{"from", "to"})
122+
} else {
123+
return err
124+
}
125+
o.From = *all.From
126+
o.To = *all.To
127+
128+
if len(additionalProperties) > 0 {
129+
o.AdditionalProperties = additionalProperties
130+
}
131+
132+
return nil
133+
}
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV1
6+
7+
import (
8+
"fmt"
9+
10+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
11+
)
12+
13+
// ComparisonDuration The comparison period. Use a preset `type` value or set `type` to `custom_timeframe` and provide `custom_timeframe` with explicit millisecond epoch bounds.
14+
type ComparisonDuration struct {
15+
// Fixed time range for a `custom_timeframe` comparison.
16+
CustomTimeframe *ComparisonCustomTimeframe `json:"custom_timeframe,omitempty"`
17+
// The comparison window type.
18+
Type ComparisonDurationType `json:"type"`
19+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
20+
UnparsedObject map[string]interface{} `json:"-"`
21+
AdditionalProperties map[string]interface{} `json:"-"`
22+
}
23+
24+
// NewComparisonDuration instantiates a new ComparisonDuration object.
25+
// This constructor will assign default values to properties that have it defined,
26+
// and makes sure properties required by API are set, but the set of arguments
27+
// will change when the set of required properties is changed.
28+
func NewComparisonDuration(typeVar ComparisonDurationType) *ComparisonDuration {
29+
this := ComparisonDuration{}
30+
this.Type = typeVar
31+
return &this
32+
}
33+
34+
// NewComparisonDurationWithDefaults instantiates a new ComparisonDuration object.
35+
// This constructor will only assign default values to properties that have it defined,
36+
// but it doesn't guarantee that properties required by API are set.
37+
func NewComparisonDurationWithDefaults() *ComparisonDuration {
38+
this := ComparisonDuration{}
39+
return &this
40+
}
41+
42+
// GetCustomTimeframe returns the CustomTimeframe field value if set, zero value otherwise.
43+
func (o *ComparisonDuration) GetCustomTimeframe() ComparisonCustomTimeframe {
44+
if o == nil || o.CustomTimeframe == nil {
45+
var ret ComparisonCustomTimeframe
46+
return ret
47+
}
48+
return *o.CustomTimeframe
49+
}
50+
51+
// GetCustomTimeframeOk returns a tuple with the CustomTimeframe field value if set, nil otherwise
52+
// and a boolean to check if the value has been set.
53+
func (o *ComparisonDuration) GetCustomTimeframeOk() (*ComparisonCustomTimeframe, bool) {
54+
if o == nil || o.CustomTimeframe == nil {
55+
return nil, false
56+
}
57+
return o.CustomTimeframe, true
58+
}
59+
60+
// HasCustomTimeframe returns a boolean if a field has been set.
61+
func (o *ComparisonDuration) HasCustomTimeframe() bool {
62+
return o != nil && o.CustomTimeframe != nil
63+
}
64+
65+
// SetCustomTimeframe gets a reference to the given ComparisonCustomTimeframe and assigns it to the CustomTimeframe field.
66+
func (o *ComparisonDuration) SetCustomTimeframe(v ComparisonCustomTimeframe) {
67+
o.CustomTimeframe = &v
68+
}
69+
70+
// GetType returns the Type field value.
71+
func (o *ComparisonDuration) GetType() ComparisonDurationType {
72+
if o == nil {
73+
var ret ComparisonDurationType
74+
return ret
75+
}
76+
return o.Type
77+
}
78+
79+
// GetTypeOk returns a tuple with the Type field value
80+
// and a boolean to check if the value has been set.
81+
func (o *ComparisonDuration) GetTypeOk() (*ComparisonDurationType, bool) {
82+
if o == nil {
83+
return nil, false
84+
}
85+
return &o.Type, true
86+
}
87+
88+
// SetType sets field value.
89+
func (o *ComparisonDuration) SetType(v ComparisonDurationType) {
90+
o.Type = v
91+
}
92+
93+
// MarshalJSON serializes the struct using spec logic.
94+
func (o ComparisonDuration) MarshalJSON() ([]byte, error) {
95+
toSerialize := map[string]interface{}{}
96+
if o.UnparsedObject != nil {
97+
return datadog.Marshal(o.UnparsedObject)
98+
}
99+
if o.CustomTimeframe != nil {
100+
toSerialize["custom_timeframe"] = o.CustomTimeframe
101+
}
102+
toSerialize["type"] = o.Type
103+
104+
for key, value := range o.AdditionalProperties {
105+
toSerialize[key] = value
106+
}
107+
return datadog.Marshal(toSerialize)
108+
}
109+
110+
// UnmarshalJSON deserializes the given payload.
111+
func (o *ComparisonDuration) UnmarshalJSON(bytes []byte) (err error) {
112+
all := struct {
113+
CustomTimeframe *ComparisonCustomTimeframe `json:"custom_timeframe,omitempty"`
114+
Type *ComparisonDurationType `json:"type"`
115+
}{}
116+
if err = datadog.Unmarshal(bytes, &all); err != nil {
117+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
118+
}
119+
if all.Type == nil {
120+
return fmt.Errorf("required field type missing")
121+
}
122+
additionalProperties := make(map[string]interface{})
123+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
124+
datadog.DeleteKeys(additionalProperties, &[]string{"custom_timeframe", "type"})
125+
} else {
126+
return err
127+
}
128+
129+
hasInvalidField := false
130+
if all.CustomTimeframe != nil && all.CustomTimeframe.UnparsedObject != nil && o.UnparsedObject == nil {
131+
hasInvalidField = true
132+
}
133+
o.CustomTimeframe = all.CustomTimeframe
134+
if !all.Type.IsValid() {
135+
hasInvalidField = true
136+
} else {
137+
o.Type = *all.Type
138+
}
139+
140+
if len(additionalProperties) > 0 {
141+
o.AdditionalProperties = additionalProperties
142+
}
143+
144+
if hasInvalidField {
145+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
146+
}
147+
148+
return nil
149+
}

0 commit comments

Comments
 (0)