Skip to content

Commit 6be8718

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add show_year option for event stream widget (#1468)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent cda0198 commit 6be8718

File tree

9 files changed

+31
-10
lines changed

9 files changed

+31
-10
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.4",
7-
"regenerated": "2023-05-17 20:57:57.889792",
8-
"spec_repo_commit": "d8186149"
7+
"regenerated": "2023-05-19 14:45:10.283637",
8+
"spec_repo_commit": "937a9438"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2023-05-17 20:57:57.901737",
13-
"spec_repo_commit": "d8186149"
12+
"regenerated": "2023-05-19 14:45:10.295797",
13+
"spec_repo_commit": "937a9438"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,6 +2234,9 @@ components:
22342234
description: Query to filter the event stream with.
22352235
example: ''
22362236
type: string
2237+
show_year:
2238+
description: Option to display the year in the date column.
2239+
type: boolean
22372240
tags_execution:
22382241
description: The execution method for multi-value filters. Can be either
22392242
and or or.

examples/v1/dashboards/CreateDashboard_2634813877.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
query="example-query",
3333
tags_execution="and",
3434
event_size=WidgetEventSize.SMALL,
35+
show_year=True,
3536
),
3637
),
3738
],

src/datadog_api_client/v1/model/event_stream_widget_definition.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def openapi_types(_):
3131
return {
3232
"event_size": (WidgetEventSize,),
3333
"query": (str,),
34+
"show_year": (bool,),
3435
"tags_execution": (str,),
3536
"time": (WidgetTime,),
3637
"title": (str,),
@@ -42,6 +43,7 @@ def openapi_types(_):
4243
attribute_map = {
4344
"event_size": "event_size",
4445
"query": "query",
46+
"show_year": "show_year",
4547
"tags_execution": "tags_execution",
4648
"time": "time",
4749
"title": "title",
@@ -55,6 +57,7 @@ def __init__(
5557
query: str,
5658
type: EventStreamWidgetDefinitionType,
5759
event_size: Union[WidgetEventSize, UnsetType] = unset,
60+
show_year: Union[bool, UnsetType] = unset,
5861
tags_execution: Union[str, UnsetType] = unset,
5962
time: Union[WidgetTime, UnsetType] = unset,
6063
title: Union[str, UnsetType] = unset,
@@ -72,6 +75,9 @@ def __init__(
7275
:param query: Query to filter the event stream with.
7376
:type query: str
7477
78+
:param show_year: Option to display the year in the date column.
79+
:type show_year: bool, optional
80+
7581
:param tags_execution: The execution method for multi-value filters. Can be either and or or.
7682
:type tags_execution: str, optional
7783
@@ -92,6 +98,8 @@ def __init__(
9298
"""
9399
if event_size is not unset:
94100
kwargs["event_size"] = event_size
101+
if show_year is not unset:
102+
kwargs["show_year"] = show_year
95103
if tags_execution is not unset:
96104
kwargs["tags_execution"] = tags_execution
97105
if time is not unset:

src/datadog_api_client/v1/model/widget_definition.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ def __init__(self, **kwargs):
9090
:param query: Query to filter the event stream with.
9191
:type query: str
9292
93+
:param show_year: Option to display the year in the date column.
94+
:type show_year: bool, optional
95+
9396
:param tags_execution: The execution method for multi-value filters. Can be either and or or.
9497
:type tags_execution: str, optional
9598
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-01-06T00:50:30.857Z
1+
2023-05-19T14:24:41.183Z

tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_event_stream_widget.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"description":"","is_read_only":false,"layout_type":"free","notify_list":[],"template_variables":[],"title":"Test-Create_a_new_dashboard_with_event_stream_widget-1641430230","widgets":[{"definition":{"event_size":"s","query":"example-query","tags_execution":"and","title":"","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":38,"width":47,"x":0,"y":0}}]}'
3+
body: '{"description":"","is_read_only":false,"layout_type":"free","notify_list":[],"template_variables":[],"title":"Test-Create_a_new_dashboard_with_event_stream_widget-1684506281","widgets":[{"definition":{"event_size":"s","query":"example-query","show_year":true,"tags_execution":"and","title":"","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":38,"width":47,"x":0,"y":0}}]}'
44
headers:
55
accept:
66
- application/json
@@ -10,7 +10,9 @@ interactions:
1010
uri: https://api.datadoghq.com/api/v1/dashboard
1111
response:
1212
body:
13-
string: '{"notify_list":[],"description":"","restricted_roles":[],"author_name":null,"template_variables":[],"is_read_only":false,"id":"2dc-bzm-gzi","title":"Test-Create_a_new_dashboard_with_event_stream_widget-1641430230","url":"/dashboard/2dc-bzm-gzi/test-createanewdashboardwitheventstreamwidget-1641430230","created_at":"2022-01-06T00:50:31.037679+00:00","modified_at":"2022-01-06T00:50:31.037679+00:00","author_handle":"[email protected]","widgets":[{"definition":{"title_size":"16","title":"","title_align":"left","tags_execution":"and","query":"example-query","type":"event_stream","event_size":"s"},"layout":{"y":0,"width":47,"x":0,"height":38},"id":5676594590872385}],"layout_type":"free"}'
13+
string: '{"id":"6fx-j89-9ip","title":"Test-Create_a_new_dashboard_with_event_stream_widget-1684506281","description":"","author_handle":"[email protected]","author_name":null,"layout_type":"free","url":"/dashboard/6fx-j89-9ip/test-createanewdashboardwitheventstreamwidget-1684506281","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"s","query":"example-query","show_year":true,"tags_execution":"and","title":"","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":38,"width":47,"x":0,"y":0},"id":4666982916800865}],"notify_list":[],"created_at":"2023-05-19T14:24:41.495188+00:00","modified_at":"2023-05-19T14:24:41.495188+00:00","restricted_roles":[]}
14+
15+
'
1416
headers:
1517
content-type:
1618
- application/json
@@ -23,10 +25,12 @@ interactions:
2325
accept:
2426
- application/json
2527
method: DELETE
26-
uri: https://api.datadoghq.com/api/v1/dashboard/2dc-bzm-gzi
28+
uri: https://api.datadoghq.com/api/v1/dashboard/6fx-j89-9ip
2729
response:
2830
body:
29-
string: '{"deleted_dashboard_id":"2dc-bzm-gzi"}'
31+
string: '{"deleted_dashboard_id":"6fx-j89-9ip"}
32+
33+
'
3034
headers:
3135
content-type:
3236
- application/json

tests/v1/features/dashboards.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ Feature: Dashboards
277277
Then the response status is 200 OK
278278
And the response "widgets[0].definition.type" is equal to "event_stream"
279279
And the response "widgets[0].definition.query" is equal to "example-query"
280+
And the response "widgets[0].definition.show_year" is equal to true
280281

281282
@team:DataDog/dashboards-backend
282283
Scenario: Create a new dashboard with event_timeline widget

tests/v1/features/dashboards_json_payload/event_stream_widget.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"type":"event_stream",
1717
"query":"example-query",
1818
"tags_execution":"and",
19-
"event_size":"s"
19+
"event_size":"s",
20+
"show_year": true
2021
}
2122
}
2223
],

0 commit comments

Comments
 (0)