-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit fe8637d0 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Sep 24, 2024
1 parent
160f34a
commit 664903f
Showing
5 changed files
with
129 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
""" | ||
Clients deserialize a dashboard with a empty time object | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v1.api.dashboards_api import DashboardsApi | ||
from datadog_api_client.v1.model.dashboard import Dashboard | ||
from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType | ||
from datadog_api_client.v1.model.formula_and_function_cloud_cost_data_source import ( | ||
FormulaAndFunctionCloudCostDataSource, | ||
) | ||
from datadog_api_client.v1.model.formula_and_function_cloud_cost_query_definition import ( | ||
FormulaAndFunctionCloudCostQueryDefinition, | ||
) | ||
from datadog_api_client.v1.model.formula_and_function_response_format import FormulaAndFunctionResponseFormat | ||
from datadog_api_client.v1.model.timeseries_widget_definition import TimeseriesWidgetDefinition | ||
from datadog_api_client.v1.model.timeseries_widget_definition_type import TimeseriesWidgetDefinitionType | ||
from datadog_api_client.v1.model.timeseries_widget_request import TimeseriesWidgetRequest | ||
from datadog_api_client.v1.model.widget import Widget | ||
from datadog_api_client.v1.model.widget_display_type import WidgetDisplayType | ||
from datadog_api_client.v1.model.widget_formula import WidgetFormula | ||
from datadog_api_client.v1.model.widget_legacy_live_span import WidgetLegacyLiveSpan | ||
from datadog_api_client.v1.model.widget_line_type import WidgetLineType | ||
from datadog_api_client.v1.model.widget_line_width import WidgetLineWidth | ||
from datadog_api_client.v1.model.widget_request_style import WidgetRequestStyle | ||
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign | ||
|
||
body = Dashboard( | ||
title="Example-Dashboard", | ||
widgets=[ | ||
Widget( | ||
definition=TimeseriesWidgetDefinition( | ||
title="Example Cloud Cost Query", | ||
title_size="16", | ||
title_align=WidgetTextAlign.LEFT, | ||
type=TimeseriesWidgetDefinitionType.TIMESERIES, | ||
requests=[ | ||
TimeseriesWidgetRequest( | ||
formulas=[ | ||
WidgetFormula( | ||
formula="query1", | ||
), | ||
], | ||
queries=[ | ||
FormulaAndFunctionCloudCostQueryDefinition( | ||
data_source=FormulaAndFunctionCloudCostDataSource.CLOUD_COST, | ||
name="query1", | ||
query="sum:aws.cost.amortized{*} by {aws_product}.rollup(sum, monthly)", | ||
), | ||
], | ||
response_format=FormulaAndFunctionResponseFormat.TIMESERIES, | ||
style=WidgetRequestStyle( | ||
palette="dog_classic", | ||
line_type=WidgetLineType.SOLID, | ||
line_width=WidgetLineWidth.NORMAL, | ||
), | ||
display_type=WidgetDisplayType.BARS, | ||
), | ||
], | ||
time=WidgetLegacyLiveSpan(), | ||
), | ||
), | ||
], | ||
layout_type=DashboardLayoutType.ORDERED, | ||
) | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = DashboardsApi(api_client) | ||
response = api_instance.create_dashboard(body=body) | ||
|
||
print(response) |
1 change: 1 addition & 0 deletions
1
...ettes/test_scenarios/test_clients_deserialize_a_dashboard_with_a_empty_time_object.frozen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2024-09-24T19:19:31.807Z |
44 changes: 44 additions & 0 deletions
44
...ssettes/test_scenarios/test_clients_deserialize_a_dashboard_with_a_empty_time_object.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
interactions: | ||
- request: | ||
body: '{"layout_type":"ordered","title":"Test-Clients_deserialize_a_dashboard_with_a_empty_time_object-1727205571","widgets":[{"definition":{"requests":[{"display_type":"bars","formulas":[{"formula":"query1"}],"queries":[{"data_source":"cloud_cost","name":"query1","query":"sum:aws.cost.amortized{*} | ||
by {aws_product}.rollup(sum, monthly)"}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"time":{},"title":"Example | ||
Cloud Cost Query","title_align":"left","title_size":"16","type":"timeseries"}}]}' | ||
headers: | ||
accept: | ||
- application/json | ||
content-type: | ||
- application/json | ||
method: POST | ||
uri: https://api.datadoghq.com/api/v1/dashboard | ||
response: | ||
body: | ||
string: '{"id":"han-5zg-c32","title":"Test-Clients_deserialize_a_dashboard_with_a_empty_time_object-1727205571","description":null,"author_handle":"[email protected]","author_name":null,"layout_type":"ordered","url":"/dashboard/han-5zg-c32/test-clientsdeserializeadashboardwithaemptytimeobject-1727205571","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"requests":[{"display_type":"bars","formulas":[{"formula":"query1"}],"queries":[{"data_source":"cloud_cost","name":"query1","query":"sum:aws.cost.amortized{*} | ||
by {aws_product}.rollup(sum, monthly)"}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"time":{},"title":"Example | ||
Cloud Cost Query","title_align":"left","title_size":"16","type":"timeseries"},"id":4274057372149908}],"notify_list":null,"created_at":"2024-09-24T19:19:32.071328+00:00","modified_at":"2024-09-24T19:19:32.071328+00:00","experience_type":"default","restricted_roles":[]} | ||
' | ||
headers: | ||
content-type: | ||
- application/json | ||
status: | ||
code: 200 | ||
message: OK | ||
- request: | ||
body: null | ||
headers: | ||
accept: | ||
- application/json | ||
method: DELETE | ||
uri: https://api.datadoghq.com/api/v1/dashboard/han-5zg-c32 | ||
response: | ||
body: | ||
string: '{"deleted_dashboard_id":"han-5zg-c32"} | ||
' | ||
headers: | ||
content-type: | ||
- application/json | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters