Skip to content

Commit c963ec1

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Extend Widget time schema with support for hide_incomplete_cost_data (#3307)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 8c2c5d9 commit c963ec1

14 files changed

Lines changed: 160 additions & 43 deletions

.generator/schemas/v1/openapi.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24164,6 +24164,9 @@ components:
2416424164
additionalProperties: false
2416524165
description: Wrapper for live span
2416624166
properties:
24167+
hide_incomplete_cost_data:
24168+
description: Whether to hide incomplete cost data in the widget.
24169+
type: boolean
2416724170
live_span:
2416824171
$ref: '#/components/schemas/WidgetLiveSpan'
2416924172
type: object
@@ -24364,6 +24367,9 @@ components:
2436424367
format: int64
2436524368
minimum: 0
2436624369
type: integer
24370+
hide_incomplete_cost_data:
24371+
description: Whether to hide incomplete cost data in the widget.
24372+
type: boolean
2436724373
to:
2436824374
description: End time in seconds since epoch.
2436924375
example: 1712083128
@@ -24388,6 +24394,9 @@ components:
2438824394
WidgetNewLiveSpan:
2438924395
description: Used for arbitrary live span times, such as 17 minutes or 6 hours.
2439024396
properties:
24397+
hide_incomplete_cost_data:
24398+
description: Whether to hide incomplete cost data in the widget.
24399+
type: boolean
2439124400
type:
2439224401
$ref: '#/components/schemas/WidgetNewLiveSpanType'
2439324402
unit:

api/datadogV1/model_widget_legacy_live_span.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010

1111
// WidgetLegacyLiveSpan Wrapper for live span
1212
type WidgetLegacyLiveSpan struct {
13+
// Whether to hide incomplete cost data in the widget.
14+
HideIncompleteCostData *bool `json:"hide_incomplete_cost_data,omitempty"`
1315
// The available timeframes depend on the widget you are using.
1416
LiveSpan *WidgetLiveSpan `json:"live_span,omitempty"`
1517
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
@@ -33,6 +35,34 @@ func NewWidgetLegacyLiveSpanWithDefaults() *WidgetLegacyLiveSpan {
3335
return &this
3436
}
3537

38+
// GetHideIncompleteCostData returns the HideIncompleteCostData field value if set, zero value otherwise.
39+
func (o *WidgetLegacyLiveSpan) GetHideIncompleteCostData() bool {
40+
if o == nil || o.HideIncompleteCostData == nil {
41+
var ret bool
42+
return ret
43+
}
44+
return *o.HideIncompleteCostData
45+
}
46+
47+
// GetHideIncompleteCostDataOk returns a tuple with the HideIncompleteCostData field value if set, nil otherwise
48+
// and a boolean to check if the value has been set.
49+
func (o *WidgetLegacyLiveSpan) GetHideIncompleteCostDataOk() (*bool, bool) {
50+
if o == nil || o.HideIncompleteCostData == nil {
51+
return nil, false
52+
}
53+
return o.HideIncompleteCostData, true
54+
}
55+
56+
// HasHideIncompleteCostData returns a boolean if a field has been set.
57+
func (o *WidgetLegacyLiveSpan) HasHideIncompleteCostData() bool {
58+
return o != nil && o.HideIncompleteCostData != nil
59+
}
60+
61+
// SetHideIncompleteCostData gets a reference to the given bool and assigns it to the HideIncompleteCostData field.
62+
func (o *WidgetLegacyLiveSpan) SetHideIncompleteCostData(v bool) {
63+
o.HideIncompleteCostData = &v
64+
}
65+
3666
// GetLiveSpan returns the LiveSpan field value if set, zero value otherwise.
3767
func (o *WidgetLegacyLiveSpan) GetLiveSpan() WidgetLiveSpan {
3868
if o == nil || o.LiveSpan == nil {
@@ -67,6 +97,9 @@ func (o WidgetLegacyLiveSpan) MarshalJSON() ([]byte, error) {
6797
if o.UnparsedObject != nil {
6898
return datadog.Marshal(o.UnparsedObject)
6999
}
100+
if o.HideIncompleteCostData != nil {
101+
toSerialize["hide_incomplete_cost_data"] = o.HideIncompleteCostData
102+
}
70103
if o.LiveSpan != nil {
71104
toSerialize["live_span"] = o.LiveSpan
72105
}
@@ -76,13 +109,15 @@ func (o WidgetLegacyLiveSpan) MarshalJSON() ([]byte, error) {
76109
// UnmarshalJSON deserializes the given payload.
77110
func (o *WidgetLegacyLiveSpan) UnmarshalJSON(bytes []byte) (err error) {
78111
all := struct {
79-
LiveSpan *WidgetLiveSpan `json:"live_span,omitempty"`
112+
HideIncompleteCostData *bool `json:"hide_incomplete_cost_data,omitempty"`
113+
LiveSpan *WidgetLiveSpan `json:"live_span,omitempty"`
80114
}{}
81115
if err = datadog.Unmarshal(bytes, &all); err != nil {
82116
return datadog.Unmarshal(bytes, &o.UnparsedObject)
83117
}
84118

85119
hasInvalidField := false
120+
o.HideIncompleteCostData = all.HideIncompleteCostData
86121
if all.LiveSpan != nil && !all.LiveSpan.IsValid() {
87122
hasInvalidField = true
88123
} else {

api/datadogV1/model_widget_new_fixed_span.go

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import (
1414
type WidgetNewFixedSpan struct {
1515
// Start time in seconds since epoch.
1616
From int64 `json:"from"`
17+
// Whether to hide incomplete cost data in the widget.
18+
HideIncompleteCostData *bool `json:"hide_incomplete_cost_data,omitempty"`
1719
// End time in seconds since epoch.
1820
To int64 `json:"to"`
1921
// Type "fixed" denotes a fixed span.
@@ -66,6 +68,34 @@ func (o *WidgetNewFixedSpan) SetFrom(v int64) {
6668
o.From = v
6769
}
6870

71+
// GetHideIncompleteCostData returns the HideIncompleteCostData field value if set, zero value otherwise.
72+
func (o *WidgetNewFixedSpan) GetHideIncompleteCostData() bool {
73+
if o == nil || o.HideIncompleteCostData == nil {
74+
var ret bool
75+
return ret
76+
}
77+
return *o.HideIncompleteCostData
78+
}
79+
80+
// GetHideIncompleteCostDataOk returns a tuple with the HideIncompleteCostData field value if set, nil otherwise
81+
// and a boolean to check if the value has been set.
82+
func (o *WidgetNewFixedSpan) GetHideIncompleteCostDataOk() (*bool, bool) {
83+
if o == nil || o.HideIncompleteCostData == nil {
84+
return nil, false
85+
}
86+
return o.HideIncompleteCostData, true
87+
}
88+
89+
// HasHideIncompleteCostData returns a boolean if a field has been set.
90+
func (o *WidgetNewFixedSpan) HasHideIncompleteCostData() bool {
91+
return o != nil && o.HideIncompleteCostData != nil
92+
}
93+
94+
// SetHideIncompleteCostData gets a reference to the given bool and assigns it to the HideIncompleteCostData field.
95+
func (o *WidgetNewFixedSpan) SetHideIncompleteCostData(v bool) {
96+
o.HideIncompleteCostData = &v
97+
}
98+
6999
// GetTo returns the To field value.
70100
func (o *WidgetNewFixedSpan) GetTo() int64 {
71101
if o == nil {
@@ -119,6 +149,9 @@ func (o WidgetNewFixedSpan) MarshalJSON() ([]byte, error) {
119149
return datadog.Marshal(o.UnparsedObject)
120150
}
121151
toSerialize["from"] = o.From
152+
if o.HideIncompleteCostData != nil {
153+
toSerialize["hide_incomplete_cost_data"] = o.HideIncompleteCostData
154+
}
122155
toSerialize["to"] = o.To
123156
toSerialize["type"] = o.Type
124157

@@ -131,9 +164,10 @@ func (o WidgetNewFixedSpan) MarshalJSON() ([]byte, error) {
131164
// UnmarshalJSON deserializes the given payload.
132165
func (o *WidgetNewFixedSpan) UnmarshalJSON(bytes []byte) (err error) {
133166
all := struct {
134-
From *int64 `json:"from"`
135-
To *int64 `json:"to"`
136-
Type *WidgetNewFixedSpanType `json:"type"`
167+
From *int64 `json:"from"`
168+
HideIncompleteCostData *bool `json:"hide_incomplete_cost_data,omitempty"`
169+
To *int64 `json:"to"`
170+
Type *WidgetNewFixedSpanType `json:"type"`
137171
}{}
138172
if err = datadog.Unmarshal(bytes, &all); err != nil {
139173
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -149,13 +183,14 @@ func (o *WidgetNewFixedSpan) UnmarshalJSON(bytes []byte) (err error) {
149183
}
150184
additionalProperties := make(map[string]interface{})
151185
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
152-
datadog.DeleteKeys(additionalProperties, &[]string{"from", "to", "type"})
186+
datadog.DeleteKeys(additionalProperties, &[]string{"from", "hide_incomplete_cost_data", "to", "type"})
153187
} else {
154188
return err
155189
}
156190

157191
hasInvalidField := false
158192
o.From = *all.From
193+
o.HideIncompleteCostData = all.HideIncompleteCostData
159194
o.To = *all.To
160195
if !all.Type.IsValid() {
161196
hasInvalidField = true

api/datadogV1/model_widget_new_live_span.go

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212

1313
// WidgetNewLiveSpan Used for arbitrary live span times, such as 17 minutes or 6 hours.
1414
type WidgetNewLiveSpan struct {
15+
// Whether to hide incomplete cost data in the widget.
16+
HideIncompleteCostData *bool `json:"hide_incomplete_cost_data,omitempty"`
1517
// Type "live" denotes a live span in the new format.
1618
Type WidgetNewLiveSpanType `json:"type"`
1719
// Unit of the time span.
@@ -43,6 +45,34 @@ func NewWidgetNewLiveSpanWithDefaults() *WidgetNewLiveSpan {
4345
return &this
4446
}
4547

48+
// GetHideIncompleteCostData returns the HideIncompleteCostData field value if set, zero value otherwise.
49+
func (o *WidgetNewLiveSpan) GetHideIncompleteCostData() bool {
50+
if o == nil || o.HideIncompleteCostData == nil {
51+
var ret bool
52+
return ret
53+
}
54+
return *o.HideIncompleteCostData
55+
}
56+
57+
// GetHideIncompleteCostDataOk returns a tuple with the HideIncompleteCostData field value if set, nil otherwise
58+
// and a boolean to check if the value has been set.
59+
func (o *WidgetNewLiveSpan) GetHideIncompleteCostDataOk() (*bool, bool) {
60+
if o == nil || o.HideIncompleteCostData == nil {
61+
return nil, false
62+
}
63+
return o.HideIncompleteCostData, true
64+
}
65+
66+
// HasHideIncompleteCostData returns a boolean if a field has been set.
67+
func (o *WidgetNewLiveSpan) HasHideIncompleteCostData() bool {
68+
return o != nil && o.HideIncompleteCostData != nil
69+
}
70+
71+
// SetHideIncompleteCostData gets a reference to the given bool and assigns it to the HideIncompleteCostData field.
72+
func (o *WidgetNewLiveSpan) SetHideIncompleteCostData(v bool) {
73+
o.HideIncompleteCostData = &v
74+
}
75+
4676
// GetType returns the Type field value.
4777
func (o *WidgetNewLiveSpan) GetType() WidgetNewLiveSpanType {
4878
if o == nil {
@@ -118,6 +148,9 @@ func (o WidgetNewLiveSpan) MarshalJSON() ([]byte, error) {
118148
if o.UnparsedObject != nil {
119149
return datadog.Marshal(o.UnparsedObject)
120150
}
151+
if o.HideIncompleteCostData != nil {
152+
toSerialize["hide_incomplete_cost_data"] = o.HideIncompleteCostData
153+
}
121154
toSerialize["type"] = o.Type
122155
toSerialize["unit"] = o.Unit
123156
toSerialize["value"] = o.Value
@@ -131,9 +164,10 @@ func (o WidgetNewLiveSpan) MarshalJSON() ([]byte, error) {
131164
// UnmarshalJSON deserializes the given payload.
132165
func (o *WidgetNewLiveSpan) UnmarshalJSON(bytes []byte) (err error) {
133166
all := struct {
134-
Type *WidgetNewLiveSpanType `json:"type"`
135-
Unit *WidgetLiveSpanUnit `json:"unit"`
136-
Value *int64 `json:"value"`
167+
HideIncompleteCostData *bool `json:"hide_incomplete_cost_data,omitempty"`
168+
Type *WidgetNewLiveSpanType `json:"type"`
169+
Unit *WidgetLiveSpanUnit `json:"unit"`
170+
Value *int64 `json:"value"`
137171
}{}
138172
if err = datadog.Unmarshal(bytes, &all); err != nil {
139173
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -149,12 +183,13 @@ func (o *WidgetNewLiveSpan) UnmarshalJSON(bytes []byte) (err error) {
149183
}
150184
additionalProperties := make(map[string]interface{})
151185
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
152-
datadog.DeleteKeys(additionalProperties, &[]string{"type", "unit", "value"})
186+
datadog.DeleteKeys(additionalProperties, &[]string{"hide_incomplete_cost_data", "type", "unit", "value"})
153187
} else {
154188
return err
155189
}
156190

157191
hasInvalidField := false
192+
o.HideIncompleteCostData = all.HideIncompleteCostData
158193
if !all.Type.IsValid() {
159194
hasInvalidField = true
160195
} else {

examples/v1/dashboards/CreateDashboard_3066042014.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ func main() {
3131
},
3232
Time: &datadogV1.WidgetTime{
3333
WidgetNewLiveSpan: &datadogV1.WidgetNewLiveSpan{
34-
Type: datadogV1.WIDGETNEWLIVESPANTYPE_LIVE,
35-
Unit: datadogV1.WIDGETLIVESPANUNIT_MINUTE,
36-
Value: 8,
34+
Type: datadogV1.WIDGETNEWLIVESPANTYPE_LIVE,
35+
Unit: datadogV1.WIDGETLIVESPANUNIT_MINUTE,
36+
Value: 8,
37+
HideIncompleteCostData: datadog.PtrBool(true),
3738
}},
3839
Type: datadogV1.TIMESERIESWIDGETDEFINITIONTYPE_TIMESERIES,
3940
Requests: []datadogV1.TimeseriesWidgetRequest{

examples/v1/dashboards/CreateDashboard_3451918078.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ func main() {
3131
},
3232
Time: &datadogV1.WidgetTime{
3333
WidgetNewFixedSpan: &datadogV1.WidgetNewFixedSpan{
34-
Type: datadogV1.WIDGETNEWFIXEDSPANTYPE_FIXED,
35-
From: 1712080128,
36-
To: 1712083128,
34+
Type: datadogV1.WIDGETNEWFIXEDSPANTYPE_FIXED,
35+
From: 1712080128,
36+
To: 1712083128,
37+
HideIncompleteCostData: datadog.PtrBool(true),
3738
}},
3839
Type: datadogV1.TIMESERIESWIDGETDEFINITIONTYPE_TIMESERIES,
3940
Requests: []datadogV1.TimeseriesWidgetRequest{

examples/v1/dashboards/CreateDashboard_4262729673.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ func main() {
3131
},
3232
Time: &datadogV1.WidgetTime{
3333
WidgetLegacyLiveSpan: &datadogV1.WidgetLegacyLiveSpan{
34-
LiveSpan: datadogV1.WIDGETLIVESPAN_PAST_FIVE_MINUTES.Ptr(),
34+
LiveSpan: datadogV1.WIDGETLIVESPAN_PAST_FIVE_MINUTES.Ptr(),
35+
HideIncompleteCostData: datadog.PtrBool(true),
3536
}},
3637
Type: datadogV1.TIMESERIESWIDGETDEFINITIONTYPE_TIMESERIES,
3738
Requests: []datadogV1.TimeseriesWidgetRequest{
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-11-15T19:33:02.539Z
1+
2025-08-26T19:47:58.449Z

tests/scenarios/cassettes/TestScenarios/v1/Feature_Dashboards/Scenario_Create_a_new_timeseries_widget_with_legacy_live_span_time_format.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: |
4-
{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1731699182 with legacy live span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"live_span":"5m"},"title":"","type":"timeseries"}}]}
4+
{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1756237678 with legacy live span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"hide_incomplete_cost_data":true,"live_span":"5m"},"title":"","type":"timeseries"}}]}
55
form: {}
66
headers:
77
Accept:
@@ -12,10 +12,9 @@ interactions:
1212
method: POST
1313
url: https://api.datadoghq.com/api/v1/dashboard
1414
response:
15-
body: '{"id":"3zr-n9a-dfd","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1731699182
16-
with legacy live span time","description":null,"author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/3zr-n9a-dfd/test-createanewtimeserieswidgetwithlegacylivespantimeformat-1731699182-with-lega","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"live_span":"5m"},"title":"","type":"timeseries"},"id":5376392318113781}],"notify_list":null,"created_at":"2024-11-15T19:33:02.697929+00:00","modified_at":"2024-11-15T19:33:02.697929+00:00","reflow_type":"auto","restricted_roles":[]}
17-
18-
'
15+
body: '{"id":"wek-eci-qnn","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1756237678
16+
with legacy live span time","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI
17+
Account","layout_type":"ordered","url":"/dashboard/wek-eci-qnn/test-createanewtimeserieswidgetwithlegacylivespantimeformat-1756237678-with-lega","template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"hide_incomplete_cost_data":true,"live_span":"5m"},"title":"","type":"timeseries"},"id":3088384387119347}],"notify_list":null,"created_at":"2025-08-26T19:47:58.616519+00:00","modified_at":"2025-08-26T19:47:58.616519+00:00","reflow_type":"auto","restricted_roles":[]}'
1918
code: 200
2019
duration: 0ms
2120
headers:
@@ -30,9 +29,9 @@ interactions:
3029
- application/json
3130
id: 1
3231
method: DELETE
33-
url: https://api.datadoghq.com/api/v1/dashboard/3zr-n9a-dfd
32+
url: https://api.datadoghq.com/api/v1/dashboard/wek-eci-qnn
3433
response:
35-
body: '{"deleted_dashboard_id":"3zr-n9a-dfd"}
34+
body: '{"deleted_dashboard_id":"wek-eci-qnn"}
3635
3736
'
3837
code: 200
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-11-15T19:33:02.942Z
1+
2025-08-26T19:47:58.908Z

0 commit comments

Comments
 (0)