From 0fb81487db3a52e299d83dd66a01598b3c4a21c1 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:30:39 +0000 Subject: [PATCH] Remove unnecessary field in list stream column config (#424) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 ++++---- .generator/schemas/v1/openapi.yaml | 5 ----- ...v1_dashboards_CreateDashboard_1039800684.rs | 3 +-- .../model/model_list_stream_column.rs | 18 ------------------ ...gs-pattern-stream-list-stream-widget.frozen | 2 +- ...logs-pattern-stream-list-stream-widget.json | 12 ++++++------ tests/scenarios/features/v1/dashboards.feature | 2 +- 7 files changed, 13 insertions(+), 37 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index 55e7548e6..2ffdcbbe0 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-12 14:27:14.493663", - "spec_repo_commit": "3ebe762b" + "regenerated": "2024-12-12 15:23:50.266080", + "spec_repo_commit": "222e1f81" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-12 14:27:14.513351", - "spec_repo_commit": "3ebe762b" + "regenerated": "2024-12-12 15:23:50.285587", + "spec_repo_commit": "222e1f81" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 6537e0340..fd1644703 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -4654,11 +4654,6 @@ components: description: Widget column field. example: content type: string - is_clustering_pattern_field_path: - description: Identifies the clustering pattern field column, usable only - with logs_pattern_stream. - example: true - type: boolean width: $ref: '#/components/schemas/ListStreamColumnWidth' required: diff --git a/examples/v1_dashboards_CreateDashboard_1039800684.rs b/examples/v1_dashboards_CreateDashboard_1039800684.rs index 01ed77e8a..8ad874fcf 100644 --- a/examples/v1_dashboards_CreateDashboard_1039800684.rs +++ b/examples/v1_dashboards_CreateDashboard_1039800684.rs @@ -25,8 +25,7 @@ async fn main() { vec![ListStreamWidgetRequest::new( vec![ ListStreamColumn::new("timestamp".to_string(), ListStreamColumnWidth::AUTO), - ListStreamColumn::new("message".to_string(), ListStreamColumnWidth::AUTO) - .is_clustering_pattern_field_path(true), + ListStreamColumn::new("message".to_string(), ListStreamColumnWidth::AUTO), ], ListStreamQuery::new(ListStreamSource::LOGS_PATTERN_STREAM, "".to_string()) .clustering_pattern_field_path("message".to_string()) diff --git a/src/datadogV1/model/model_list_stream_column.rs b/src/datadogV1/model/model_list_stream_column.rs index f466bfe46..aabdd1e81 100644 --- a/src/datadogV1/model/model_list_stream_column.rs +++ b/src/datadogV1/model/model_list_stream_column.rs @@ -14,9 +14,6 @@ pub struct ListStreamColumn { /// Widget column field. #[serde(rename = "field")] pub field: String, - /// Identifies the clustering pattern field column, usable only with logs_pattern_stream. - #[serde(rename = "is_clustering_pattern_field_path")] - pub is_clustering_pattern_field_path: Option, /// Widget column width. #[serde(rename = "width")] pub width: crate::datadogV1::model::ListStreamColumnWidth, @@ -34,18 +31,12 @@ impl ListStreamColumn { ) -> ListStreamColumn { ListStreamColumn { field, - is_clustering_pattern_field_path: None, width, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } } - pub fn is_clustering_pattern_field_path(mut self, value: bool) -> Self { - self.is_clustering_pattern_field_path = Some(value); - self - } - pub fn additional_properties( mut self, value: std::collections::BTreeMap, @@ -73,7 +64,6 @@ impl<'de> Deserialize<'de> for ListStreamColumn { M: MapAccess<'a>, { let mut field: Option = None; - let mut is_clustering_pattern_field_path: Option = None; let mut width: Option = None; let mut additional_properties: std::collections::BTreeMap< String, @@ -86,13 +76,6 @@ impl<'de> Deserialize<'de> for ListStreamColumn { "field" => { field = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } - "is_clustering_pattern_field_path" => { - if v.is_null() { - continue; - } - is_clustering_pattern_field_path = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } "width" => { width = Some(serde_json::from_value(v).map_err(M::Error::custom)?); if let Some(ref _width) = width { @@ -116,7 +99,6 @@ impl<'de> Deserialize<'de> for ListStreamColumn { let content = ListStreamColumn { field, - is_clustering_pattern_field_path, width, additional_properties, _unparsed, diff --git a/tests/scenarios/cassettes/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.frozen b/tests/scenarios/cassettes/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.frozen index f275079fe..7adcfc719 100644 --- a/tests/scenarios/cassettes/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.frozen +++ b/tests/scenarios/cassettes/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.frozen @@ -1 +1 @@ -2024-11-20T19:43:46.485Z \ No newline at end of file +2024-12-11T19:18:02.796Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.json b/tests/scenarios/cassettes/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.json index 544c77978..7185305b4 100644 --- a/tests/scenarios/cassettes/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.json +++ b/tests/scenarios/cassettes/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.json @@ -3,7 +3,7 @@ { "request": { "body": { - "string": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget-1732131826 with list_stream widget\",\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"},{\"field\":\"message\",\"is_clustering_pattern_field_path\":true,\"width\":\"auto\"}],\"query\":{\"clustering_pattern_field_path\":\"message\",\"data_source\":\"logs_pattern_stream\",\"group_by\":[{\"facet\":\"service\"}],\"query_string\":\"\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"}}]}", + "string": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget-1733944682 with list_stream widget\",\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"},{\"field\":\"message\",\"width\":\"auto\"}],\"query\":{\"clustering_pattern_field_path\":\"message\",\"data_source\":\"logs_pattern_stream\",\"group_by\":[{\"facet\":\"service\"}],\"query_string\":\"\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"}}]}", "encoding": null }, "headers": { @@ -19,7 +19,7 @@ }, "response": { "body": { - "string": "{\"id\":\"r75-hd7-sd9\",\"title\":\"Test-Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget-1732131826 with list_stream widget\",\"description\":null,\"author_handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"author_name\":\"CI Account\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/r75-hd7-sd9/test-createanewdashboardwithlogspatternstreamliststreamwidget-1732131826-with-li\",\"is_read_only\":false,\"template_variables\":null,\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"},{\"field\":\"message\",\"is_clustering_pattern_field_path\":true,\"width\":\"auto\"}],\"query\":{\"clustering_pattern_field_path\":\"message\",\"data_source\":\"logs_pattern_stream\",\"group_by\":[{\"facet\":\"service\"}],\"query_string\":\"\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"},\"id\":6154246442450384}],\"notify_list\":null,\"created_at\":\"2024-11-20T19:43:46.871965+00:00\",\"modified_at\":\"2024-11-20T19:43:46.871965+00:00\",\"restricted_roles\":[]}\n", + "string": "{\"id\":\"fue-7tr-ubw\",\"title\":\"Test-Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget-1733944682 with list_stream widget\",\"description\":null,\"author_handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"author_name\":\"CI Account\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/fue-7tr-ubw/test-createanewdashboardwithlogspatternstreamliststreamwidget-1733944682-with-li\",\"is_read_only\":false,\"template_variables\":null,\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"},{\"field\":\"message\",\"width\":\"auto\"}],\"query\":{\"clustering_pattern_field_path\":\"message\",\"data_source\":\"logs_pattern_stream\",\"group_by\":[{\"facet\":\"service\"}],\"query_string\":\"\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"},\"id\":4674889262305585}],\"notify_list\":null,\"created_at\":\"2024-12-11T19:18:03.039937+00:00\",\"modified_at\":\"2024-12-11T19:18:03.039937+00:00\",\"restricted_roles\":[]}\n", "encoding": null }, "headers": { @@ -32,7 +32,7 @@ "message": "OK" } }, - "recorded_at": "Wed, 20 Nov 2024 19:43:46 GMT" + "recorded_at": "Wed, 11 Dec 2024 19:18:02 GMT" }, { "request": { @@ -43,11 +43,11 @@ ] }, "method": "delete", - "uri": "https://api.datadoghq.com/api/v1/dashboard/r75-hd7-sd9" + "uri": "https://api.datadoghq.com/api/v1/dashboard/fue-7tr-ubw" }, "response": { "body": { - "string": "{\"deleted_dashboard_id\":\"r75-hd7-sd9\"}\n", + "string": "{\"deleted_dashboard_id\":\"fue-7tr-ubw\"}\n", "encoding": null }, "headers": { @@ -60,7 +60,7 @@ "message": "OK" } }, - "recorded_at": "Wed, 20 Nov 2024 19:43:46 GMT" + "recorded_at": "Wed, 11 Dec 2024 19:18:02 GMT" } ], "recorded_with": "VCR 6.0.0" diff --git a/tests/scenarios/features/v1/dashboards.feature b/tests/scenarios/features/v1/dashboards.feature index 208a4dd39..ebcfc7a25 100644 --- a/tests/scenarios/features/v1/dashboards.feature +++ b/tests/scenarios/features/v1/dashboards.feature @@ -534,7 +534,7 @@ Feature: Dashboards @team:DataDog/dashboards-backend Scenario: Create a new dashboard with logs_pattern_stream list_stream widget Given new "CreateDashboard" request - And body with value {"layout_type": "ordered", "title": "{{ unique }} with list_stream widget","widgets": [{"definition": {"type": "list_stream","requests": [{"columns":[{"width":"auto","field":"timestamp"},{"width":"auto","field":"message", "is_clustering_pattern_field_path": true}],"query":{"data_source":"logs_pattern_stream","query_string":"","clustering_pattern_field_path":"message","group_by":[{"facet":"service"}]}, "response_format":"event_list"}]}}]} + And body with value {"layout_type": "ordered", "title": "{{ unique }} with list_stream widget","widgets": [{"definition": {"type": "list_stream","requests": [{"columns":[{"width":"auto","field":"timestamp"},{"width":"auto","field":"message"}],"query":{"data_source":"logs_pattern_stream","query_string":"","clustering_pattern_field_path":"message","group_by":[{"facet":"service"}]}, "response_format":"event_list"}]}}]} When the request is sent Then the response status is 200 OK And the response "widgets[0].definition.requests[0].query.data_source" is equal to "logs_pattern_stream"