From cb9f4fb935f505415b113f34eaf4b95e2e95b821 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 1 Aug 2023 16:20:40 +0000 Subject: [PATCH] Regenerate client from commit 87a5a9d8 of spec repo --- .apigentools-info | 8 ++--- .generator/schemas/v1/openapi.yaml | 5 +++ .../frozen.json | 2 +- .../recording.har | 36 +++++++++---------- .../dashboards/CreateDashboard_252716965.ts | 6 ++++ features/v1/dashboards.feature | 3 +- .../models/DistributionWidgetDefinition.ts | 9 +++++ 7 files changed, 45 insertions(+), 24 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index b28b43a03594..201aa4c5fa90 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.5", - "regenerated": "2023-08-01 14:52:18.981128", - "spec_repo_commit": "279094e1" + "regenerated": "2023-08-01 16:18:45.943422", + "spec_repo_commit": "87a5a9d8" }, "v2": { "apigentools_version": "1.6.5", - "regenerated": "2023-08-01 14:52:19.002286", - "spec_repo_commit": "279094e1" + "regenerated": "2023-08-01 16:18:45.962045", + "spec_repo_commit": "87a5a9d8" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 9d9240bda936..72ee8e0bae10 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -1496,6 +1496,11 @@ components: across one or several tags, such as hosts.\nUnlike the heat map, a distribution graph\u2019s x-axis is quantity rather than time." properties: + custom_links: + description: A list of custom links. + items: + $ref: '#/components/schemas/WidgetCustomLink' + type: array legend_size: deprecated: true description: (Deprecated) The widget legend was replaced by a tooltip and diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-distribution-widget-using-a-histogram-request-containing-a-formulas-and-function_3661940883/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-distribution-widget-using-a-histogram-request-containing-a-formulas-and-function_3661940883/frozen.json index 0dbb2c042b5d..c71f094147fa 100644 --- a/cassettes/v1/Dashboards_1335235736/Create-a-distribution-widget-using-a-histogram-request-containing-a-formulas-and-function_3661940883/frozen.json +++ b/cassettes/v1/Dashboards_1335235736/Create-a-distribution-widget-using-a-histogram-request-containing-a-formulas-and-function_3661940883/frozen.json @@ -1 +1 @@ -"2022-06-03T14:40:32.372Z" +"2023-08-01T15:16:44.506Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-distribution-widget-using-a-histogram-request-containing-a-formulas-and-function_3661940883/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-distribution-widget-using-a-histogram-request-containing-a-formulas-and-function_3661940883/recording.har index 1457967e68e5..9c555d2ae36b 100644 --- a/cassettes/v1/Dashboards_1335235736/Create-a-distribution-widget-using-a-histogram-request-containing-a-formulas-and-function_3661940883/recording.har +++ b/cassettes/v1/Dashboards_1335235736/Create-a-distribution-widget-using-a-histogram-request-containing-a-formulas-and-function_3661940883/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "740963bc6d6e0f0cd12c4ac2cf50f5e5", + "_id": "f7984f12f97fda28ade36ae75d3e477a", "_order": 0, "cache": {}, "request": { - "bodySize": 634, + "bodySize": 701, "cookies": [], "headers": [ { @@ -32,17 +32,17 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_distribution_widget_using_a_histogram_request_containing_a_formulas_and_functions_metrics_q-1654267232\",\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"histogram:trace.Load{*}\"},\"request_type\":\"histogram\",\"style\":{\"palette\":\"dog_classic\"}}],\"show_legend\":false,\"title\":\"Metrics HOP\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"distribution\",\"xaxis\":{\"include_zero\":true,\"max\":\"auto\",\"min\":\"auto\",\"scale\":\"linear\"},\"yaxis\":{\"include_zero\":true,\"max\":\"auto\",\"min\":\"auto\",\"scale\":\"linear\"}},\"layout\":{\"height\":2,\"width\":4,\"x\":0,\"y\":0}}]}" + "text": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_distribution_widget_using_a_histogram_request_containing_a_formulas_and_functions_metrics_q-1690903004\",\"widgets\":[{\"definition\":{\"custom_links\":[{\"label\":\"Example\",\"link\":\"https://example.org/\"}],\"requests\":[{\"query\":{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"histogram:trace.Load{*}\"},\"request_type\":\"histogram\",\"style\":{\"palette\":\"dog_classic\"}}],\"show_legend\":false,\"title\":\"Metrics HOP\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"distribution\",\"xaxis\":{\"include_zero\":true,\"max\":\"auto\",\"min\":\"auto\",\"scale\":\"linear\"},\"yaxis\":{\"include_zero\":true,\"max\":\"auto\",\"min\":\"auto\",\"scale\":\"linear\"}},\"layout\":{\"height\":2,\"width\":4,\"x\":0,\"y\":0}}]}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/dashboard" }, "response": { - "bodySize": 1047, + "bodySize": 1115, "content": { "mimeType": "application/json", - "size": 1047, - "text": "{\"notify_list\":null,\"description\":null,\"restricted_roles\":[],\"author_name\":null,\"template_variables\":null,\"is_read_only\":false,\"id\":\"gb2-e78-emw\",\"title\":\"Test-Create_a_distribution_widget_using_a_histogram_request_containing_a_formulas_and_functions_metrics_q-1654267232\",\"url\":\"/dashboard/gb2-e78-emw/test-createadistributionwidgetusingahistogramrequestcontainingaformulasandfuncti\",\"created_at\":\"2022-06-03T14:40:32.735409+00:00\",\"modified_at\":\"2022-06-03T14:40:32.735409+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"title_size\":\"16\",\"title\":\"Metrics HOP\",\"title_align\":\"left\",\"yaxis\":{\"include_zero\":true,\"scale\":\"linear\",\"min\":\"auto\",\"max\":\"auto\"},\"show_legend\":false,\"xaxis\":{\"include_zero\":true,\"scale\":\"linear\",\"min\":\"auto\",\"max\":\"auto\"},\"requests\":[{\"query\":{\"query\":\"histogram:trace.Load{*}\",\"data_source\":\"metrics\",\"name\":\"query1\"},\"request_type\":\"histogram\",\"style\":{\"palette\":\"dog_classic\"}}],\"type\":\"distribution\"},\"layout\":{\"y\":0,\"width\":4,\"x\":0,\"height\":2},\"id\":3096166427221540}],\"layout_type\":\"ordered\"}" + "size": 1115, + "text": "{\"id\":\"uts-6em-2su\",\"title\":\"Test-Create_a_distribution_widget_using_a_histogram_request_containing_a_formulas_and_functions_metrics_q-1690903004\",\"description\":null,\"author_handle\":\"frog@datadoghq.com\",\"author_name\":null,\"layout_type\":\"ordered\",\"url\":\"/dashboard/uts-6em-2su/test-createadistributionwidgetusingahistogramrequestcontainingaformulasandfuncti\",\"is_read_only\":false,\"template_variables\":null,\"widgets\":[{\"definition\":{\"custom_links\":[{\"label\":\"Example\",\"link\":\"https://example.org/\"}],\"requests\":[{\"query\":{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"histogram:trace.Load{*}\"},\"request_type\":\"histogram\",\"style\":{\"palette\":\"dog_classic\"}}],\"show_legend\":false,\"title\":\"Metrics HOP\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"distribution\",\"xaxis\":{\"include_zero\":true,\"max\":\"auto\",\"min\":\"auto\",\"scale\":\"linear\"},\"yaxis\":{\"include_zero\":true,\"max\":\"auto\",\"min\":\"auto\",\"scale\":\"linear\"}},\"layout\":{\"height\":2,\"width\":4,\"x\":0,\"y\":0},\"id\":4570406064684725}],\"notify_list\":null,\"created_at\":\"2023-08-01T15:16:44.785380+00:00\",\"modified_at\":\"2023-08-01T15:16:44.785380+00:00\",\"restricted_roles\":[]}\n" }, "cookies": [], "headers": [ @@ -51,17 +51,17 @@ "value": "application/json" } ], - "headersSize": 637, + "headersSize": 518, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-06-03T14:40:32.376Z", - "time": 438 + "startedDateTime": "2023-08-01T15:16:44.517Z", + "time": 298 }, { - "_id": "54dd620c2ec389a1992bbd279b6a6b9c", + "_id": "7638967a65387095de2bf2971833f07b", "_order": 0, "cache": {}, "request": { @@ -74,18 +74,18 @@ "value": "application/json" } ], - "headersSize": 518, + "headersSize": 520, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/dashboard/gb2-e78-emw" + "url": "https://api.datadoghq.com/api/v1/dashboard/uts-6em-2su" }, "response": { - "bodySize": 38, + "bodySize": 39, "content": { "mimeType": "application/json", - "size": 38, - "text": "{\"deleted_dashboard_id\":\"gb2-e78-emw\"}" + "size": 39, + "text": "{\"deleted_dashboard_id\":\"uts-6em-2su\"}\n" }, "cookies": [], "headers": [ @@ -94,14 +94,14 @@ "value": "application/json" } ], - "headersSize": 635, + "headersSize": 516, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-06-03T14:40:32.820Z", - "time": 444 + "startedDateTime": "2023-08-01T15:16:44.839Z", + "time": 174 } ], "pages": [], diff --git a/examples/v1/dashboards/CreateDashboard_252716965.ts b/examples/v1/dashboards/CreateDashboard_252716965.ts index 5d46bb5ce05c..108d5e9430f7 100644 --- a/examples/v1/dashboards/CreateDashboard_252716965.ts +++ b/examples/v1/dashboards/CreateDashboard_252716965.ts @@ -18,6 +18,12 @@ const params: v1.DashboardsApiCreateDashboardRequest = { titleAlign: "left", showLegend: false, type: "distribution", + customLinks: [ + { + label: "Example", + link: "https://example.org/", + }, + ], xaxis: { max: "auto", includeZero: true, diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index 76f1e5e5f41f..a7ccd5e677d5 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -45,7 +45,7 @@ Feature: Dashboards @team:DataDog/dashboards-backend Scenario: Create a distribution widget using a histogram request containing a formulas and functions metrics query Given new "CreateDashboard" request - And body with value { "title": "{{ unique }}", "widgets": [ { "definition": { "title": "Metrics HOP", "title_size": "16", "title_align": "left", "show_legend": false, "type": "distribution", "xaxis": { "max": "auto", "include_zero": true, "scale": "linear", "min": "auto" }, "yaxis": { "max": "auto", "include_zero": true, "scale": "linear", "min": "auto" }, "requests": [ { "query": { "query": "histogram:trace.Load{*}", "data_source": "metrics", "name": "query1" }, "request_type": "histogram", "style": { "palette": "dog_classic" } } ] }, "layout": { "x": 0, "y": 0, "width": 4, "height": 2 } } ], "layout_type": "ordered" } + And body with value {"title":"{{ unique }}","widgets":[{"definition":{"title":"Metrics HOP","title_size":"16","title_align":"left","show_legend":false,"type":"distribution","custom_links":[{"label":"Example","link":"https://example.org/"}],"xaxis":{"max":"auto","include_zero":true,"scale":"linear","min":"auto"},"yaxis":{"max":"auto","include_zero":true,"scale":"linear","min":"auto"},"requests":[{"query":{"query":"histogram:trace.Load{*}","data_source":"metrics","name":"query1"},"request_type":"histogram","style":{"palette":"dog_classic"}}]},"layout":{"x":0,"y":0,"width":4,"height":2}}],"layout_type":"ordered"} When the request is sent Then the response status is 200 OK And the response "widgets[0].definition.requests[0].request_type" is equal to "histogram" @@ -53,6 +53,7 @@ Feature: Dashboards And the response "widgets[0].definition.requests[0].query.query" is equal to "histogram:trace.Load{*}" And the response "widgets[0].definition.requests[0].query.data_source" is equal to "metrics" And the response "widgets[0].definition.requests[0].query.name" is equal to "query1" + And the response "widgets[0].definition.custom_links" has item with field "label" with value "Example" @team:DataDog/dashboards-backend Scenario: Create a geomap widget using an event_list request diff --git a/packages/datadog-api-client-v1/models/DistributionWidgetDefinition.ts b/packages/datadog-api-client-v1/models/DistributionWidgetDefinition.ts index a431e41c9303..06bda65b44d1 100644 --- a/packages/datadog-api-client-v1/models/DistributionWidgetDefinition.ts +++ b/packages/datadog-api-client-v1/models/DistributionWidgetDefinition.ts @@ -7,6 +7,7 @@ import { DistributionWidgetDefinitionType } from "./DistributionWidgetDefinition import { DistributionWidgetRequest } from "./DistributionWidgetRequest"; import { DistributionWidgetXAxis } from "./DistributionWidgetXAxis"; import { DistributionWidgetYAxis } from "./DistributionWidgetYAxis"; +import { WidgetCustomLink } from "./WidgetCustomLink"; import { WidgetMarker } from "./WidgetMarker"; import { WidgetTextAlign } from "./WidgetTextAlign"; import { WidgetTime } from "./WidgetTime"; @@ -19,6 +20,10 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; * Unlike the heat map, a distribution graph’s x-axis is quantity rather than time. */ export class DistributionWidgetDefinition { + /** + * A list of custom links. + */ + "customLinks"?: Array; /** * (Deprecated) The widget legend was replaced by a tooltip and sidebar. */ @@ -76,6 +81,10 @@ export class DistributionWidgetDefinition { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + customLinks: { + baseName: "custom_links", + type: "Array", + }, legendSize: { baseName: "legend_size", type: "string",