Skip to content

Commit 0b4a0db

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Extend Widget time schema with support for hide_incomplete_cost_data (#2793)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 758771e commit 0b4a0db

15 files changed

+94
-35
lines changed

.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:

examples/v1/dashboards/CreateDashboard_3066042014.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
type=WidgetNewLiveSpanType.LIVE,
5454
unit=WidgetLiveSpanUnit.MINUTE,
5555
value=8,
56+
hide_incomplete_cost_data=True,
5657
),
5758
type=TimeseriesWidgetDefinitionType.TIMESERIES,
5859
requests=[

examples/v1/dashboards/CreateDashboard_3451918078.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
type=WidgetNewFixedSpanType.FIXED,
5353
_from=1712080128,
5454
to=1712083128,
55+
hide_incomplete_cost_data=True,
5556
),
5657
type=TimeseriesWidgetDefinitionType.TIMESERIES,
5758
requests=[

examples/v1/dashboards/CreateDashboard_4262729673.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
],
5151
time=WidgetLegacyLiveSpan(
5252
live_span=WidgetLiveSpan.PAST_FIVE_MINUTES,
53+
hide_incomplete_cost_data=True,
5354
),
5455
type=TimeseriesWidgetDefinitionType.TIMESERIES,
5556
requests=[

src/datadog_api_client/v1/model/widget_legacy_live_span.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,32 @@ def openapi_types(_):
2727
from datadog_api_client.v1.model.widget_live_span import WidgetLiveSpan
2828

2929
return {
30+
"hide_incomplete_cost_data": (bool,),
3031
"live_span": (WidgetLiveSpan,),
3132
}
3233

3334
attribute_map = {
35+
"hide_incomplete_cost_data": "hide_incomplete_cost_data",
3436
"live_span": "live_span",
3537
}
3638

37-
def __init__(self_, live_span: Union[WidgetLiveSpan, UnsetType] = unset, **kwargs):
39+
def __init__(
40+
self_,
41+
hide_incomplete_cost_data: Union[bool, UnsetType] = unset,
42+
live_span: Union[WidgetLiveSpan, UnsetType] = unset,
43+
**kwargs,
44+
):
3845
"""
3946
Wrapper for live span
4047
48+
:param hide_incomplete_cost_data: Whether to hide incomplete cost data in the widget.
49+
:type hide_incomplete_cost_data: bool, optional
50+
4151
:param live_span: The available timeframes depend on the widget you are using.
4252
:type live_span: WidgetLiveSpan, optional
4353
"""
54+
if hide_incomplete_cost_data is not unset:
55+
kwargs["hide_incomplete_cost_data"] = hide_incomplete_cost_data
4456
if live_span is not unset:
4557
kwargs["live_span"] = live_span
4658
super().__init__(kwargs)

src/datadog_api_client/v1/model/widget_new_fixed_span.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import TYPE_CHECKING
6+
from typing import Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
1010
cached_property,
11+
unset,
12+
UnsetType,
1113
)
1214

1315

@@ -31,29 +33,43 @@ def openapi_types(_):
3133

3234
return {
3335
"_from": (int,),
36+
"hide_incomplete_cost_data": (bool,),
3437
"to": (int,),
3538
"type": (WidgetNewFixedSpanType,),
3639
}
3740

3841
attribute_map = {
3942
"_from": "from",
43+
"hide_incomplete_cost_data": "hide_incomplete_cost_data",
4044
"to": "to",
4145
"type": "type",
4246
}
4347

44-
def __init__(self_, _from: int, to: int, type: WidgetNewFixedSpanType, **kwargs):
48+
def __init__(
49+
self_,
50+
_from: int,
51+
to: int,
52+
type: WidgetNewFixedSpanType,
53+
hide_incomplete_cost_data: Union[bool, UnsetType] = unset,
54+
**kwargs,
55+
):
4556
"""
4657
Used for fixed span times, such as 'March 1 to March 7'.
4758
4859
:param _from: Start time in seconds since epoch.
4960
:type _from: int
5061
62+
:param hide_incomplete_cost_data: Whether to hide incomplete cost data in the widget.
63+
:type hide_incomplete_cost_data: bool, optional
64+
5165
:param to: End time in seconds since epoch.
5266
:type to: int
5367
5468
:param type: Type "fixed" denotes a fixed span.
5569
:type type: WidgetNewFixedSpanType
5670
"""
71+
if hide_incomplete_cost_data is not unset:
72+
kwargs["hide_incomplete_cost_data"] = hide_incomplete_cost_data
5773
super().__init__(kwargs)
5874

5975
self_._from = _from

src/datadog_api_client/v1/model/widget_new_live_span.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import TYPE_CHECKING
6+
from typing import Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
1010
cached_property,
11+
unset,
12+
UnsetType,
1113
)
1214

1315

@@ -29,21 +31,33 @@ def openapi_types(_):
2931
from datadog_api_client.v1.model.widget_live_span_unit import WidgetLiveSpanUnit
3032

3133
return {
34+
"hide_incomplete_cost_data": (bool,),
3235
"type": (WidgetNewLiveSpanType,),
3336
"unit": (WidgetLiveSpanUnit,),
3437
"value": (int,),
3538
}
3639

3740
attribute_map = {
41+
"hide_incomplete_cost_data": "hide_incomplete_cost_data",
3842
"type": "type",
3943
"unit": "unit",
4044
"value": "value",
4145
}
4246

43-
def __init__(self_, type: WidgetNewLiveSpanType, unit: WidgetLiveSpanUnit, value: int, **kwargs):
47+
def __init__(
48+
self_,
49+
type: WidgetNewLiveSpanType,
50+
unit: WidgetLiveSpanUnit,
51+
value: int,
52+
hide_incomplete_cost_data: Union[bool, UnsetType] = unset,
53+
**kwargs,
54+
):
4455
"""
4556
Used for arbitrary live span times, such as 17 minutes or 6 hours.
4657
58+
:param hide_incomplete_cost_data: Whether to hide incomplete cost data in the widget.
59+
:type hide_incomplete_cost_data: bool, optional
60+
4761
:param type: Type "live" denotes a live span in the new format.
4862
:type type: WidgetNewLiveSpanType
4963
@@ -53,6 +67,8 @@ def __init__(self_, type: WidgetNewLiveSpanType, unit: WidgetLiveSpanUnit, value
5367
:param value: Value of the time span.
5468
:type value: int
5569
"""
70+
if hide_incomplete_cost_data is not unset:
71+
kwargs["hide_incomplete_cost_data"] = hide_incomplete_cost_data
5672
super().__init__(kwargs)
5773

5874
self_.type = type

src/datadog_api_client/v1/model/widget_time.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ def __init__(self, **kwargs):
1515
"""
1616
Time setting for the widget.
1717
18+
:param hide_incomplete_cost_data: Whether to hide incomplete cost data in the widget.
19+
:type hide_incomplete_cost_data: bool, optional
20+
1821
:param live_span: The available timeframes depend on the widget you are using.
1922
:type live_span: WidgetLiveSpan, optional
2023
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/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_legacy_live_span_time_format.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
3-
body: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1731699182
4-
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"}}]}'
3+
body: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1756237678
4+
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
headers:
66
accept:
77
- application/json
@@ -11,10 +11,9 @@ interactions:
1111
uri: https://api.datadoghq.com/api/v1/dashboard
1212
response:
1313
body:
14-
string: '{"id":"3zr-n9a-dfd","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1731699182
15-
with legacy live span time","description":null,"author_handle":"[email protected]","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":[]}
16-
17-
'
14+
string: '{"id":"wek-eci-qnn","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1756237678
15+
with legacy live span time","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI
16+
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":[]}'
1817
headers:
1918
content-type:
2019
- application/json
@@ -27,10 +26,10 @@ interactions:
2726
accept:
2827
- application/json
2928
method: DELETE
30-
uri: https://api.datadoghq.com/api/v1/dashboard/3zr-n9a-dfd
29+
uri: https://api.datadoghq.com/api/v1/dashboard/wek-eci-qnn
3130
response:
3231
body:
33-
string: '{"deleted_dashboard_id":"3zr-n9a-dfd"}
32+
string: '{"deleted_dashboard_id":"wek-eci-qnn"}
3433
3534
'
3635
headers:

0 commit comments

Comments
 (0)