diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index d9bb88a10f27..a0b2429945a6 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -895,6 +895,174 @@ components: items: $ref: '#/components/schemas/AzureAccount' type: array + BarChartWidgetDefinition: + description: The bar chart visualization displays categorical data using vertical + bars, allowing you to compare values across different groups. + properties: + custom_links: + description: List of custom links. + items: + $ref: '#/components/schemas/WidgetCustomLink' + type: array + requests: + description: List of bar chart widget requests. + example: + - q: system.load.1 + items: + $ref: '#/components/schemas/BarChartWidgetRequest' + maxItems: 1 + minItems: 1 + type: array + style: + $ref: '#/components/schemas/BarChartWidgetStyle' + time: + $ref: '#/components/schemas/WidgetTime' + title: + description: Title of your widget. + type: string + title_align: + $ref: '#/components/schemas/WidgetTextAlign' + title_size: + description: Size of the title. + type: string + type: + $ref: '#/components/schemas/BarChartWidgetDefinitionType' + required: + - type + - requests + type: object + BarChartWidgetDefinitionType: + default: bar_chart + description: Type of the bar chart widget. + enum: + - bar_chart + example: bar_chart + type: string + x-enum-varnames: + - BAR_CHART + BarChartWidgetDisplay: + description: Bar chart widget display options. + oneOf: + - $ref: '#/components/schemas/BarChartWidgetStacked' + - $ref: '#/components/schemas/BarChartWidgetFlat' + BarChartWidgetFlat: + description: Bar chart widget flat display. + properties: + type: + $ref: '#/components/schemas/BarChartWidgetFlatType' + required: + - type + type: object + BarChartWidgetFlatType: + default: flat + description: Bar chart widget flat display type. + enum: + - flat + example: flat + type: string + x-enum-varnames: + - FLAT + BarChartWidgetLegend: + description: Bar chart widget stacked legend behavior. + enum: + - automatic + - inline + - none + example: automatic + type: string + x-enum-varnames: + - AUTOMATIC + - INLINE + - NONE + BarChartWidgetRequest: + description: Updated bar chart widget. + properties: + apm_query: + $ref: '#/components/schemas/LogQueryDefinition' + audit_query: + $ref: '#/components/schemas/LogQueryDefinition' + conditional_formats: + description: List of conditional formats. + example: + - comparator: '>=' + palette: blue + value: 1.0 + items: + $ref: '#/components/schemas/WidgetConditionalFormat' + type: array + event_query: + $ref: '#/components/schemas/LogQueryDefinition' + formulas: + description: List of formulas that operate on queries. + items: + $ref: '#/components/schemas/WidgetFormula' + type: array + log_query: + $ref: '#/components/schemas/LogQueryDefinition' + network_query: + $ref: '#/components/schemas/LogQueryDefinition' + process_query: + $ref: '#/components/schemas/ProcessQueryDefinition' + profile_metrics_query: + $ref: '#/components/schemas/LogQueryDefinition' + q: + description: Widget query. + type: string + queries: + description: List of queries that can be returned directly or used in formulas. + items: + $ref: '#/components/schemas/FormulaAndFunctionQueryDefinition' + type: array + response_format: + $ref: '#/components/schemas/FormulaAndFunctionResponseFormat' + rum_query: + $ref: '#/components/schemas/LogQueryDefinition' + security_query: + $ref: '#/components/schemas/LogQueryDefinition' + sort: + $ref: '#/components/schemas/WidgetSortBy' + style: + $ref: '#/components/schemas/WidgetRequestStyle' + type: object + BarChartWidgetScaling: + description: Bar chart widget scaling definition. + enum: + - absolute + - relative + type: string + x-enum-varnames: + - ABSOLUTE + - RELATIVE + BarChartWidgetStacked: + description: Bar chart widget stacked display options. + properties: + legend: + $ref: '#/components/schemas/BarChartWidgetLegend' + type: + $ref: '#/components/schemas/BarChartWidgetStackedType' + required: + - type + type: object + BarChartWidgetStackedType: + default: stacked + description: Bar chart widget stacked display type. + enum: + - stacked + example: stacked + type: string + x-enum-varnames: + - STACKED + BarChartWidgetStyle: + description: Style customization for a bar chart widget. + properties: + display: + $ref: '#/components/schemas/BarChartWidgetDisplay' + palette: + description: Color palette to apply to the widget. + type: string + scaling: + $ref: '#/components/schemas/BarChartWidgetScaling' + type: object CancelDowntimesByScopeRequest: description: Cancel downtimes according to scope. properties: @@ -14338,6 +14506,7 @@ components: SplitGraphSourceWidgetDefinition: description: The original widget we are splitting on. oneOf: + - $ref: '#/components/schemas/BarChartWidgetDefinition' - $ref: '#/components/schemas/ChangeWidgetDefinition' - $ref: '#/components/schemas/GeomapWidgetDefinition' - $ref: '#/components/schemas/QueryValueWidgetDefinition' @@ -24829,6 +24998,7 @@ components: oneOf: - $ref: '#/components/schemas/AlertGraphWidgetDefinition' - $ref: '#/components/schemas/AlertValueWidgetDefinition' + - $ref: '#/components/schemas/BarChartWidgetDefinition' - $ref: '#/components/schemas/ChangeWidgetDefinition' - $ref: '#/components/schemas/CheckStatusWidgetDefinition' - $ref: '#/components/schemas/DistributionWidgetDefinition' diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-a-bar_chart-widget-with-stacked-type-and-no-legend-specified_2717837903/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-a-bar_chart-widget-with-stacked-type-and-no-legend-specified_2717837903/frozen.json new file mode 100644 index 000000000000..a4d7e1fa7fad --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-a-bar_chart-widget-with-stacked-type-and-no-legend-specified_2717837903/frozen.json @@ -0,0 +1 @@ +"2025-12-15T21:25:35.069Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-a-bar_chart-widget-with-stacked-type-and-no-legend-specified_2717837903/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-a-bar_chart-widget-with-stacked-type-and-no-legend-specified_2717837903/recording.har new file mode 100644 index 000000000000..a5b388d5e5e3 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-a-bar_chart-widget-with-stacked-type-and-no-legend-specified_2717837903/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "Dashboards/Create a new dashboard with a bar_chart widget with stacked type and no legend specified", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "95489bd99bbf69f24e3f086db12e9591", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 709, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 559, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"description\":\"\",\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_a_bar_chart_widget_with_stacked_type_and_no_legend_specified-1765833935\",\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {service}\"}],\"response_format\":\"scalar\",\"sort\":{\"count\":10,\"order_by\":[{\"name\":\"service\",\"order\":\"asc\",\"type\":\"group\"}]}}],\"style\":{\"display\":{\"type\":\"stacked\"},\"palette\":\"dog_classic\",\"scaling\":\"relative\"},\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"bar_chart\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0}}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard" + }, + "response": { + "bodySize": 1064, + "content": { + "mimeType": "application/json", + "size": 1064, + "text": "{\"id\":\"6yv-ayr-nyv\",\"title\":\"Test-Create_a_new_dashboard_with_a_bar_chart_widget_with_stacked_type_and_no_legend_specified-1765833935\",\"description\":\"\",\"author_handle\":\"jessica.sylvester@datadoghq.com\",\"author_name\":\"Jessica Sylvester\",\"layout_type\":\"free\",\"url\":\"/dashboard/6yv-ayr-nyv/test-createanewdashboardwithabarchartwidgetwithstackedtypeandnolegendspecified-1\",\"template_variables\":[],\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {service}\"}],\"response_format\":\"scalar\",\"sort\":{\"count\":10,\"order_by\":[{\"name\":\"service\",\"order\":\"asc\",\"type\":\"group\"}]}}],\"style\":{\"display\":{\"type\":\"stacked\"},\"palette\":\"dog_classic\",\"scaling\":\"relative\"},\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"bar_chart\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0},\"id\":747608743840054}],\"notify_list\":[],\"created_at\":\"2025-12-15T21:25:35.211465+00:00\",\"modified_at\":\"2025-12-15T21:25:35.211465+00:00\",\"restricted_roles\":[]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 381, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-12-15T21:25:35.076Z", + "time": 202 + }, + { + "_id": "15d53983ac641591b7110cf6a232a55f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 520, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard/6yv-ayr-nyv" + }, + "response": { + "bodySize": 38, + "content": { + "mimeType": "application/json", + "size": 38, + "text": "{\"deleted_dashboard_id\":\"6yv-ayr-nyv\"}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 379, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-12-15T21:25:35.284Z", + "time": 435 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-bar_chart-widget-sorted-by-group_3707824259/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-bar_chart-widget-sorted-by-group_3707824259/frozen.json new file mode 100644 index 000000000000..8aa1bce7cf64 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-bar_chart-widget-sorted-by-group_3707824259/frozen.json @@ -0,0 +1 @@ +"2025-12-15T21:26:29.455Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-bar_chart-widget-sorted-by-group_3707824259/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-bar_chart-widget-sorted-by-group_3707824259/recording.har new file mode 100644 index 000000000000..0c063cd0536f --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-bar_chart-widget-sorted-by-group_3707824259/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "Dashboards/Create a new dashboard with bar_chart widget sorted by group", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "d33120afc0f7838930358d1dfdc8f76d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 699, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 559, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"description\":\"\",\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_bar_chart_widget_sorted_by_group-1765833989\",\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {service}\"}],\"response_format\":\"scalar\",\"sort\":{\"count\":10,\"order_by\":[{\"name\":\"service\",\"order\":\"asc\",\"type\":\"group\"}]}}],\"style\":{\"display\":{\"legend\":\"inline\",\"type\":\"stacked\"},\"palette\":\"dog_classic\",\"scaling\":\"relative\"},\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"bar_chart\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0}}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard" + }, + "response": { + "bodySize": 1041, + "content": { + "mimeType": "application/json", + "size": 1041, + "text": "{\"id\":\"d7t-dfe-vuh\",\"title\":\"Test-Create_a_new_dashboard_with_bar_chart_widget_sorted_by_group-1765833989\",\"description\":\"\",\"author_handle\":\"jessica.sylvester@datadoghq.com\",\"author_name\":\"Jessica Sylvester\",\"layout_type\":\"free\",\"url\":\"/dashboard/d7t-dfe-vuh/test-createanewdashboardwithbarchartwidgetsortedbygroup-1765833989\",\"template_variables\":[],\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {service}\"}],\"response_format\":\"scalar\",\"sort\":{\"count\":10,\"order_by\":[{\"name\":\"service\",\"order\":\"asc\",\"type\":\"group\"}]}}],\"style\":{\"display\":{\"legend\":\"inline\",\"type\":\"stacked\"},\"palette\":\"dog_classic\",\"scaling\":\"relative\"},\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"bar_chart\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0},\"id\":3540992741229512}],\"notify_list\":[],\"created_at\":\"2025-12-15T21:26:29.666161+00:00\",\"modified_at\":\"2025-12-15T21:26:29.666161+00:00\",\"restricted_roles\":[]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 381, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-12-15T21:26:29.462Z", + "time": 274 + }, + { + "_id": "9230fbb6eb549cf9f40ca7ae4037a7b0", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 520, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard/d7t-dfe-vuh" + }, + "response": { + "bodySize": 38, + "content": { + "mimeType": "application/json", + "size": 38, + "text": "{\"deleted_dashboard_id\":\"d7t-dfe-vuh\"}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 379, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-12-15T21:26:29.749Z", + "time": 382 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-bar_chart-widget_1489026846/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-bar_chart-widget_1489026846/frozen.json new file mode 100644 index 000000000000..e7052480dda5 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-bar_chart-widget_1489026846/frozen.json @@ -0,0 +1 @@ +"2025-12-15T21:26:18.139Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-bar_chart-widget_1489026846/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-bar_chart-widget_1489026846/recording.har new file mode 100644 index 000000000000..2108c1122b2b --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-bar_chart-widget_1489026846/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "Dashboards/Create a new dashboard with bar_chart widget", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "74d124e3c0424c73813a3f4e33dda1ff", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 679, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 559, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"description\":\"\",\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_bar_chart_widget-1765833978\",\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {service}\"}],\"response_format\":\"scalar\",\"sort\":{\"count\":10,\"order_by\":[{\"index\":0,\"order\":\"desc\",\"type\":\"formula\"}]}}],\"style\":{\"display\":{\"legend\":\"inline\",\"type\":\"stacked\"},\"palette\":\"dog_classic\",\"scaling\":\"relative\"},\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"bar_chart\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0}}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard" + }, + "response": { + "bodySize": 1008, + "content": { + "mimeType": "application/json", + "size": 1008, + "text": "{\"id\":\"jnt-fik-esx\",\"title\":\"Test-Create_a_new_dashboard_with_bar_chart_widget-1765833978\",\"description\":\"\",\"author_handle\":\"jessica.sylvester@datadoghq.com\",\"author_name\":\"Jessica Sylvester\",\"layout_type\":\"free\",\"url\":\"/dashboard/jnt-fik-esx/test-createanewdashboardwithbarchartwidget-1765833978\",\"template_variables\":[],\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {service}\"}],\"response_format\":\"scalar\",\"sort\":{\"count\":10,\"order_by\":[{\"index\":0,\"order\":\"desc\",\"type\":\"formula\"}]}}],\"style\":{\"display\":{\"legend\":\"inline\",\"type\":\"stacked\"},\"palette\":\"dog_classic\",\"scaling\":\"relative\"},\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"bar_chart\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0},\"id\":4318878693632821}],\"notify_list\":[],\"created_at\":\"2025-12-15T21:26:18.283708+00:00\",\"modified_at\":\"2025-12-15T21:26:18.283708+00:00\",\"restricted_roles\":[]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 381, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-12-15T21:26:18.146Z", + "time": 211 + }, + { + "_id": "94ec246c57b6fd164507263c42db9f19", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 520, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard/jnt-fik-esx" + }, + "response": { + "bodySize": 38, + "content": { + "mimeType": "application/json", + "size": 38, + "text": "{\"deleted_dashboard_id\":\"jnt-fik-esx\"}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 379, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-12-15T21:26:18.366Z", + "time": 608 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v1/dashboards/CreateDashboard_1712853070.ts b/examples/v1/dashboards/CreateDashboard_1712853070.ts new file mode 100644 index 000000000000..8b15b289fb65 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_1712853070.ts @@ -0,0 +1,80 @@ +/** + * Create a new dashboard with bar_chart widget + */ + +import { client, v1 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v1.DashboardsApi(configuration); + +const params: v1.DashboardsApiCreateDashboardRequest = { + body: { + title: "Example-Dashboard", + description: "", + widgets: [ + { + layout: { + x: 0, + y: 0, + width: 47, + height: 15, + }, + definition: { + title: "", + titleSize: "16", + titleAlign: "left", + time: {}, + style: { + display: { + type: "stacked", + legend: "inline", + }, + scaling: "relative", + palette: "dog_classic", + }, + type: "bar_chart", + requests: [ + { + queries: [ + { + dataSource: "metrics", + name: "query1", + query: "avg:system.cpu.user{*} by {service}", + aggregator: "avg", + }, + ], + formulas: [ + { + formula: "query1", + }, + ], + sort: { + count: 10, + orderBy: [ + { + type: "formula", + index: 0, + order: "desc", + }, + ], + }, + responseFormat: "scalar", + }, + ], + }, + }, + ], + templateVariables: [], + layoutType: "free", + notifyList: [], + }, +}; + +apiInstance + .createDashboard(params) + .then((data: v1.Dashboard) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v1/dashboards/CreateDashboard_2345541687.ts b/examples/v1/dashboards/CreateDashboard_2345541687.ts new file mode 100644 index 000000000000..dc7c59636135 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_2345541687.ts @@ -0,0 +1,79 @@ +/** + * Create a new dashboard with a bar_chart widget with stacked type and no legend specified + */ + +import { client, v1 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v1.DashboardsApi(configuration); + +const params: v1.DashboardsApiCreateDashboardRequest = { + body: { + title: "Example-Dashboard", + description: "", + widgets: [ + { + layout: { + x: 0, + y: 0, + width: 47, + height: 15, + }, + definition: { + title: "", + titleSize: "16", + titleAlign: "left", + time: {}, + style: { + display: { + type: "stacked", + }, + scaling: "relative", + palette: "dog_classic", + }, + type: "bar_chart", + requests: [ + { + queries: [ + { + dataSource: "metrics", + name: "query1", + query: "avg:system.cpu.user{*} by {service}", + aggregator: "avg", + }, + ], + formulas: [ + { + formula: "query1", + }, + ], + sort: { + count: 10, + orderBy: [ + { + type: "group", + name: "service", + order: "asc", + }, + ], + }, + responseFormat: "scalar", + }, + ], + }, + }, + ], + templateVariables: [], + layoutType: "free", + notifyList: [], + }, +}; + +apiInstance + .createDashboard(params) + .then((data: v1.Dashboard) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v1/dashboards/CreateDashboard_2617251399.ts b/examples/v1/dashboards/CreateDashboard_2617251399.ts new file mode 100644 index 000000000000..29bea93e107c --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_2617251399.ts @@ -0,0 +1,80 @@ +/** + * Create a new dashboard with bar_chart widget sorted by group + */ + +import { client, v1 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v1.DashboardsApi(configuration); + +const params: v1.DashboardsApiCreateDashboardRequest = { + body: { + title: "Example-Dashboard", + description: "", + widgets: [ + { + layout: { + x: 0, + y: 0, + width: 47, + height: 15, + }, + definition: { + title: "", + titleSize: "16", + titleAlign: "left", + time: {}, + style: { + display: { + type: "stacked", + legend: "inline", + }, + scaling: "relative", + palette: "dog_classic", + }, + type: "bar_chart", + requests: [ + { + queries: [ + { + dataSource: "metrics", + name: "query1", + query: "avg:system.cpu.user{*} by {service}", + aggregator: "avg", + }, + ], + formulas: [ + { + formula: "query1", + }, + ], + sort: { + count: 10, + orderBy: [ + { + type: "group", + name: "service", + order: "asc", + }, + ], + }, + responseFormat: "scalar", + }, + ], + }, + }, + ], + templateVariables: [], + layoutType: "free", + notifyList: [], + }, +}; + +apiInstance + .createDashboard(params) + .then((data: v1.Dashboard) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index 588c609ceddb..43640d8a82c2 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -106,6 +106,19 @@ Feature: Dashboards And the response "widgets[0].definition.requests[0].profile_metrics_query.compute.facet" is equal to "@prof_core_cpu_cores" And the response "widgets[0].definition.requests[0].profile_metrics_query.compute.aggregation" is equal to "sum" + @skip-terraform-config @skip-typescript @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with a bar_chart widget with stacked type and no legend specified + Given new "CreateDashboard" request + And body with value {"title":"{{ unique }}","description":"","widgets":[{"layout":{"x":0,"y":0,"width":47,"height":15},"definition":{"title":"","title_size":"16","title_align":"left","time":{},"style":{"display": {"type": "stacked"},"scaling": "relative","palette": "dog_classic"},"type":"bar_chart","requests":[{"queries":[{"data_source":"metrics","name":"query1","query":"avg:system.cpu.user{*} by {service}","aggregator":"avg"}],"formulas":[{"formula":"query1"}],"sort":{"count":10,"order_by":[{"type":"group","name":"service","order":"asc"}]},"response_format":"scalar"}]}}],"template_variables":[],"layout_type":"free","notify_list":[]} + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "bar_chart" + And the response "widgets[0].definition.requests[0].sort.order_by[0].order" is equal to "asc" + And the response "widgets[0].definition.requests[0].sort.order_by[0].type" is equal to "group" + And the response "widgets[0].definition.requests[0].sort.order_by[0].name" is equal to "service" + And the response "widgets[0].definition.style.display.type" is equal to "stacked" + And the response "widgets[0].definition.style.display" does not have field "legend" + @team:DataDog/dashboards-backend Scenario: Create a new dashboard with a change widget using formulas and functions slo query Given there is a valid "slo" in the system @@ -336,6 +349,28 @@ Feature: Dashboards And the response "widgets[0].definition.requests[0].columns[0].width" is equal to "auto" And the response "widgets[0].definition.requests[0].query.data_source" is equal to "apm_issue_stream" + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with bar_chart widget + Given new "CreateDashboard" request + And body from file "dashboards_json_payload/bar_chart_widget.json" + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "bar_chart" + And the response "widgets[0].definition.requests[0].sort.order_by[0].order" is equal to "desc" + And the response "widgets[0].definition.requests[0].sort.order_by[0].type" is equal to "formula" + And the response "widgets[0].definition.requests[0].sort.order_by[0].index" is equal to 0 + + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with bar_chart widget sorted by group + Given new "CreateDashboard" request + And body with value {"title":"{{ unique }}","description":"","widgets":[{"layout":{"x":0,"y":0,"width":47,"height":15},"definition":{"title":"","title_size":"16","title_align":"left","time":{},"style":{"display": {"type": "stacked","legend": "inline"},"scaling": "relative","palette": "dog_classic"},"type":"bar_chart","requests":[{"queries":[{"data_source":"metrics","name":"query1","query":"avg:system.cpu.user{*} by {service}","aggregator":"avg"}],"formulas":[{"formula":"query1"}],"sort":{"count":10,"order_by":[{"type":"group","name":"service","order":"asc"}]},"response_format":"scalar"}]}}],"template_variables":[],"layout_type":"free","notify_list":[]} + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "bar_chart" + And the response "widgets[0].definition.requests[0].sort.order_by[0].order" is equal to "asc" + And the response "widgets[0].definition.requests[0].sort.order_by[0].type" is equal to "group" + And the response "widgets[0].definition.requests[0].sort.order_by[0].name" is equal to "service" + @team:DataDog/dashboards-backend Scenario: Create a new dashboard with check_status widget Given new "CreateDashboard" request diff --git a/features/v1/dashboards_json_payload/bar_chart_widget.json b/features/v1/dashboards_json_payload/bar_chart_widget.json new file mode 100644 index 000000000000..0fac4d091bf4 --- /dev/null +++ b/features/v1/dashboards_json_payload/bar_chart_widget.json @@ -0,0 +1,66 @@ +{ + "title":"{{ unique }}", + "description":"", + "widgets":[ + { + "layout":{ + "x":0, + "y":0, + "width":47, + "height":15 + }, + "definition":{ + "title":"", + "title_size":"16", + "title_align":"left", + "time":{ + + }, + "style":{ + "display": { + "type": "stacked", + "legend": "inline" + }, + "scaling": "relative", + "palette": "dog_classic" + }, + "type":"bar_chart", + "requests":[ + { + "queries":[ + { + "data_source":"metrics", + "name":"query1", + "query":"avg:system.cpu.user{*} by {service}", + "aggregator":"avg" + } + ], + "formulas":[ + { + "formula":"query1" + } + ], + "sort": { + "count":10, + "order_by":[ + { + "type":"formula", + "index":0, + "order":"desc" + } + ] + }, + "response_format":"scalar" + } + ] + } + } + ], + "template_variables":[ + + ], + "layout_type":"free", + "notify_list":[ + + ] +} diff --git a/packages/datadog-api-client-v1/index.ts b/packages/datadog-api-client-v1/index.ts index de7810e2a7cc..4a143c2581e9 100644 --- a/packages/datadog-api-client-v1/index.ts +++ b/packages/datadog-api-client-v1/index.ts @@ -376,6 +376,17 @@ export { AWSTagFilterCreateRequest } from "./models/AWSTagFilterCreateRequest"; export { AWSTagFilterDeleteRequest } from "./models/AWSTagFilterDeleteRequest"; export { AWSTagFilterListResponse } from "./models/AWSTagFilterListResponse"; export { AzureAccount } from "./models/AzureAccount"; +export { BarChartWidgetDefinition } from "./models/BarChartWidgetDefinition"; +export { BarChartWidgetDefinitionType } from "./models/BarChartWidgetDefinitionType"; +export { BarChartWidgetDisplay } from "./models/BarChartWidgetDisplay"; +export { BarChartWidgetFlat } from "./models/BarChartWidgetFlat"; +export { BarChartWidgetFlatType } from "./models/BarChartWidgetFlatType"; +export { BarChartWidgetLegend } from "./models/BarChartWidgetLegend"; +export { BarChartWidgetRequest } from "./models/BarChartWidgetRequest"; +export { BarChartWidgetScaling } from "./models/BarChartWidgetScaling"; +export { BarChartWidgetStacked } from "./models/BarChartWidgetStacked"; +export { BarChartWidgetStackedType } from "./models/BarChartWidgetStackedType"; +export { BarChartWidgetStyle } from "./models/BarChartWidgetStyle"; export { CancelDowntimesByScopeRequest } from "./models/CancelDowntimesByScopeRequest"; export { CanceledDowntimesIds } from "./models/CanceledDowntimesIds"; export { ChangeWidgetDefinition } from "./models/ChangeWidgetDefinition"; diff --git a/packages/datadog-api-client-v1/models/BarChartWidgetDefinition.ts b/packages/datadog-api-client-v1/models/BarChartWidgetDefinition.ts new file mode 100644 index 000000000000..7afc643c3633 --- /dev/null +++ b/packages/datadog-api-client-v1/models/BarChartWidgetDefinition.ts @@ -0,0 +1,116 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { BarChartWidgetDefinitionType } from "./BarChartWidgetDefinitionType"; +import { BarChartWidgetRequest } from "./BarChartWidgetRequest"; +import { BarChartWidgetStyle } from "./BarChartWidgetStyle"; +import { WidgetCustomLink } from "./WidgetCustomLink"; +import { WidgetTextAlign } from "./WidgetTextAlign"; +import { WidgetTime } from "./WidgetTime"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The bar chart visualization displays categorical data using vertical bars, allowing you to compare values across different groups. + */ +export class BarChartWidgetDefinition { + /** + * List of custom links. + */ + "customLinks"?: Array; + /** + * List of bar chart widget requests. + */ + "requests": [BarChartWidgetRequest]; + /** + * Style customization for a bar chart widget. + */ + "style"?: BarChartWidgetStyle; + /** + * Time setting for the widget. + */ + "time"?: WidgetTime; + /** + * Title of your widget. + */ + "title"?: string; + /** + * How to align the text on the widget. + */ + "titleAlign"?: WidgetTextAlign; + /** + * Size of the title. + */ + "titleSize"?: string; + /** + * Type of the bar chart widget. + */ + "type": BarChartWidgetDefinitionType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + customLinks: { + baseName: "custom_links", + type: "Array", + }, + requests: { + baseName: "requests", + type: "[BarChartWidgetRequest]", + required: true, + }, + style: { + baseName: "style", + type: "BarChartWidgetStyle", + }, + time: { + baseName: "time", + type: "WidgetTime", + }, + title: { + baseName: "title", + type: "string", + }, + titleAlign: { + baseName: "title_align", + type: "WidgetTextAlign", + }, + titleSize: { + baseName: "title_size", + type: "string", + }, + type: { + baseName: "type", + type: "BarChartWidgetDefinitionType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return BarChartWidgetDefinition.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/BarChartWidgetDefinitionType.ts b/packages/datadog-api-client-v1/models/BarChartWidgetDefinitionType.ts new file mode 100644 index 000000000000..1aa049489068 --- /dev/null +++ b/packages/datadog-api-client-v1/models/BarChartWidgetDefinitionType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of the bar chart widget. + */ + +export type BarChartWidgetDefinitionType = typeof BAR_CHART | UnparsedObject; +export const BAR_CHART = "bar_chart"; diff --git a/packages/datadog-api-client-v1/models/BarChartWidgetDisplay.ts b/packages/datadog-api-client-v1/models/BarChartWidgetDisplay.ts new file mode 100644 index 000000000000..89b3977a018a --- /dev/null +++ b/packages/datadog-api-client-v1/models/BarChartWidgetDisplay.ts @@ -0,0 +1,18 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { BarChartWidgetFlat } from "./BarChartWidgetFlat"; +import { BarChartWidgetStacked } from "./BarChartWidgetStacked"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Bar chart widget display options. + */ + +export type BarChartWidgetDisplay = + | BarChartWidgetStacked + | BarChartWidgetFlat + | UnparsedObject; diff --git a/packages/datadog-api-client-v1/models/BarChartWidgetFlat.ts b/packages/datadog-api-client-v1/models/BarChartWidgetFlat.ts new file mode 100644 index 000000000000..94c91bea1b6f --- /dev/null +++ b/packages/datadog-api-client-v1/models/BarChartWidgetFlat.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { BarChartWidgetFlatType } from "./BarChartWidgetFlatType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Bar chart widget flat display. + */ +export class BarChartWidgetFlat { + /** + * Bar chart widget flat display type. + */ + "type": BarChartWidgetFlatType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + type: { + baseName: "type", + type: "BarChartWidgetFlatType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return BarChartWidgetFlat.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/BarChartWidgetFlatType.ts b/packages/datadog-api-client-v1/models/BarChartWidgetFlatType.ts new file mode 100644 index 000000000000..b66cb3c8e7e8 --- /dev/null +++ b/packages/datadog-api-client-v1/models/BarChartWidgetFlatType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Bar chart widget flat display type. + */ + +export type BarChartWidgetFlatType = typeof FLAT | UnparsedObject; +export const FLAT = "flat"; diff --git a/packages/datadog-api-client-v1/models/BarChartWidgetLegend.ts b/packages/datadog-api-client-v1/models/BarChartWidgetLegend.ts new file mode 100644 index 000000000000..52f42278825c --- /dev/null +++ b/packages/datadog-api-client-v1/models/BarChartWidgetLegend.ts @@ -0,0 +1,20 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Bar chart widget stacked legend behavior. + */ + +export type BarChartWidgetLegend = + | typeof AUTOMATIC + | typeof INLINE + | typeof NONE + | UnparsedObject; +export const AUTOMATIC = "automatic"; +export const INLINE = "inline"; +export const NONE = "none"; diff --git a/packages/datadog-api-client-v1/models/BarChartWidgetRequest.ts b/packages/datadog-api-client-v1/models/BarChartWidgetRequest.ts new file mode 100644 index 000000000000..3b22163c40c6 --- /dev/null +++ b/packages/datadog-api-client-v1/models/BarChartWidgetRequest.ts @@ -0,0 +1,180 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { FormulaAndFunctionQueryDefinition } from "./FormulaAndFunctionQueryDefinition"; +import { FormulaAndFunctionResponseFormat } from "./FormulaAndFunctionResponseFormat"; +import { LogQueryDefinition } from "./LogQueryDefinition"; +import { ProcessQueryDefinition } from "./ProcessQueryDefinition"; +import { WidgetConditionalFormat } from "./WidgetConditionalFormat"; +import { WidgetFormula } from "./WidgetFormula"; +import { WidgetRequestStyle } from "./WidgetRequestStyle"; +import { WidgetSortBy } from "./WidgetSortBy"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Updated bar chart widget. + */ +export class BarChartWidgetRequest { + /** + * The log query. + */ + "apmQuery"?: LogQueryDefinition; + /** + * The log query. + */ + "auditQuery"?: LogQueryDefinition; + /** + * List of conditional formats. + */ + "conditionalFormats"?: Array; + /** + * The log query. + */ + "eventQuery"?: LogQueryDefinition; + /** + * List of formulas that operate on queries. + */ + "formulas"?: Array; + /** + * The log query. + */ + "logQuery"?: LogQueryDefinition; + /** + * The log query. + */ + "networkQuery"?: LogQueryDefinition; + /** + * The process query to use in the widget. + */ + "processQuery"?: ProcessQueryDefinition; + /** + * The log query. + */ + "profileMetricsQuery"?: LogQueryDefinition; + /** + * Widget query. + */ + "q"?: string; + /** + * List of queries that can be returned directly or used in formulas. + */ + "queries"?: Array; + /** + * Timeseries, scalar, or event list response. Event list response formats are supported by Geomap widgets. + */ + "responseFormat"?: FormulaAndFunctionResponseFormat; + /** + * The log query. + */ + "rumQuery"?: LogQueryDefinition; + /** + * The log query. + */ + "securityQuery"?: LogQueryDefinition; + /** + * The controls for sorting the widget. + */ + "sort"?: WidgetSortBy; + /** + * Define request widget style. + */ + "style"?: WidgetRequestStyle; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + apmQuery: { + baseName: "apm_query", + type: "LogQueryDefinition", + }, + auditQuery: { + baseName: "audit_query", + type: "LogQueryDefinition", + }, + conditionalFormats: { + baseName: "conditional_formats", + type: "Array", + }, + eventQuery: { + baseName: "event_query", + type: "LogQueryDefinition", + }, + formulas: { + baseName: "formulas", + type: "Array", + }, + logQuery: { + baseName: "log_query", + type: "LogQueryDefinition", + }, + networkQuery: { + baseName: "network_query", + type: "LogQueryDefinition", + }, + processQuery: { + baseName: "process_query", + type: "ProcessQueryDefinition", + }, + profileMetricsQuery: { + baseName: "profile_metrics_query", + type: "LogQueryDefinition", + }, + q: { + baseName: "q", + type: "string", + }, + queries: { + baseName: "queries", + type: "Array", + }, + responseFormat: { + baseName: "response_format", + type: "FormulaAndFunctionResponseFormat", + }, + rumQuery: { + baseName: "rum_query", + type: "LogQueryDefinition", + }, + securityQuery: { + baseName: "security_query", + type: "LogQueryDefinition", + }, + sort: { + baseName: "sort", + type: "WidgetSortBy", + }, + style: { + baseName: "style", + type: "WidgetRequestStyle", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return BarChartWidgetRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/BarChartWidgetScaling.ts b/packages/datadog-api-client-v1/models/BarChartWidgetScaling.ts new file mode 100644 index 000000000000..e1ddd1ca3f44 --- /dev/null +++ b/packages/datadog-api-client-v1/models/BarChartWidgetScaling.ts @@ -0,0 +1,18 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Bar chart widget scaling definition. + */ + +export type BarChartWidgetScaling = + | typeof ABSOLUTE + | typeof RELATIVE + | UnparsedObject; +export const ABSOLUTE = "absolute"; +export const RELATIVE = "relative"; diff --git a/packages/datadog-api-client-v1/models/BarChartWidgetStacked.ts b/packages/datadog-api-client-v1/models/BarChartWidgetStacked.ts new file mode 100644 index 000000000000..14e164d92c8b --- /dev/null +++ b/packages/datadog-api-client-v1/models/BarChartWidgetStacked.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { BarChartWidgetLegend } from "./BarChartWidgetLegend"; +import { BarChartWidgetStackedType } from "./BarChartWidgetStackedType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Bar chart widget stacked display options. + */ +export class BarChartWidgetStacked { + /** + * Bar chart widget stacked legend behavior. + */ + "legend"?: BarChartWidgetLegend; + /** + * Bar chart widget stacked display type. + */ + "type": BarChartWidgetStackedType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + legend: { + baseName: "legend", + type: "BarChartWidgetLegend", + }, + type: { + baseName: "type", + type: "BarChartWidgetStackedType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return BarChartWidgetStacked.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/BarChartWidgetStackedType.ts b/packages/datadog-api-client-v1/models/BarChartWidgetStackedType.ts new file mode 100644 index 000000000000..8e444a420883 --- /dev/null +++ b/packages/datadog-api-client-v1/models/BarChartWidgetStackedType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Bar chart widget stacked display type. + */ + +export type BarChartWidgetStackedType = typeof STACKED | UnparsedObject; +export const STACKED = "stacked"; diff --git a/packages/datadog-api-client-v1/models/BarChartWidgetStyle.ts b/packages/datadog-api-client-v1/models/BarChartWidgetStyle.ts new file mode 100644 index 000000000000..b13d41e29f01 --- /dev/null +++ b/packages/datadog-api-client-v1/models/BarChartWidgetStyle.ts @@ -0,0 +1,70 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { BarChartWidgetDisplay } from "./BarChartWidgetDisplay"; +import { BarChartWidgetScaling } from "./BarChartWidgetScaling"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Style customization for a bar chart widget. + */ +export class BarChartWidgetStyle { + /** + * Bar chart widget display options. + */ + "display"?: BarChartWidgetDisplay; + /** + * Color palette to apply to the widget. + */ + "palette"?: string; + /** + * Bar chart widget scaling definition. + */ + "scaling"?: BarChartWidgetScaling; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + display: { + baseName: "display", + type: "BarChartWidgetDisplay", + }, + palette: { + baseName: "palette", + type: "string", + }, + scaling: { + baseName: "scaling", + type: "BarChartWidgetScaling", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return BarChartWidgetStyle.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index 353dc1d85e2b..6efdf508699b 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -34,6 +34,11 @@ import { ApplicationKeyListResponse } from "./ApplicationKeyListResponse"; import { ApplicationKeyResponse } from "./ApplicationKeyResponse"; import { AuthenticationValidationResponse } from "./AuthenticationValidationResponse"; import { AzureAccount } from "./AzureAccount"; +import { BarChartWidgetDefinition } from "./BarChartWidgetDefinition"; +import { BarChartWidgetFlat } from "./BarChartWidgetFlat"; +import { BarChartWidgetRequest } from "./BarChartWidgetRequest"; +import { BarChartWidgetStacked } from "./BarChartWidgetStacked"; +import { BarChartWidgetStyle } from "./BarChartWidgetStyle"; import { CancelDowntimesByScopeRequest } from "./CancelDowntimesByScopeRequest"; import { CanceledDowntimesIds } from "./CanceledDowntimesIds"; import { ChangeWidgetDefinition } from "./ChangeWidgetDefinition"; @@ -696,6 +701,11 @@ const enumsMap: { [key: string]: any[] } = { AlertGraphWidgetDefinitionType: ["alert_graph"], AlertValueWidgetDefinitionType: ["alert_value"], ApmStatsQueryRowType: ["service", "resource", "span"], + BarChartWidgetDefinitionType: ["bar_chart"], + BarChartWidgetFlatType: ["flat"], + BarChartWidgetLegend: ["automatic", "inline", "none"], + BarChartWidgetScaling: ["absolute", "relative"], + BarChartWidgetStackedType: ["stacked"], ChangeWidgetDefinitionType: ["change"], CheckStatusWidgetDefinitionType: ["check_status"], ContentEncoding: ["gzip", "deflate"], @@ -1765,6 +1775,11 @@ const typeMap: { [index: string]: any } = { ApplicationKeyResponse: ApplicationKeyResponse, AuthenticationValidationResponse: AuthenticationValidationResponse, AzureAccount: AzureAccount, + BarChartWidgetDefinition: BarChartWidgetDefinition, + BarChartWidgetFlat: BarChartWidgetFlat, + BarChartWidgetRequest: BarChartWidgetRequest, + BarChartWidgetStacked: BarChartWidgetStacked, + BarChartWidgetStyle: BarChartWidgetStyle, CancelDowntimesByScopeRequest: CancelDowntimesByScopeRequest, CanceledDowntimesIds: CanceledDowntimesIds, ChangeWidgetDefinition: ChangeWidgetDefinition, @@ -2433,6 +2448,7 @@ const typeMap: { [index: string]: any } = { }; const oneOfMap: { [index: string]: string[] } = { + BarChartWidgetDisplay: ["BarChartWidgetStacked", "BarChartWidgetFlat"], DistributionPointItem: ["number", "Array"], DistributionWidgetHistogramRequestQuery: [ "FormulaAndFunctionMetricQueryDefinition", @@ -2518,6 +2534,7 @@ const oneOfMap: { [index: string]: string[] } = { "Array", ], SplitGraphSourceWidgetDefinition: [ + "BarChartWidgetDefinition", "ChangeWidgetDefinition", "GeomapWidgetDefinition", "QueryValueWidgetDefinition", @@ -2561,6 +2578,7 @@ const oneOfMap: { [index: string]: string[] } = { WidgetDefinition: [ "AlertGraphWidgetDefinition", "AlertValueWidgetDefinition", + "BarChartWidgetDefinition", "ChangeWidgetDefinition", "CheckStatusWidgetDefinition", "DistributionWidgetDefinition", diff --git a/packages/datadog-api-client-v1/models/SplitGraphSourceWidgetDefinition.ts b/packages/datadog-api-client-v1/models/SplitGraphSourceWidgetDefinition.ts index bd8a20d891ea..fce0dfc443f6 100644 --- a/packages/datadog-api-client-v1/models/SplitGraphSourceWidgetDefinition.ts +++ b/packages/datadog-api-client-v1/models/SplitGraphSourceWidgetDefinition.ts @@ -3,6 +3,7 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ +import { BarChartWidgetDefinition } from "./BarChartWidgetDefinition"; import { ChangeWidgetDefinition } from "./ChangeWidgetDefinition"; import { GeomapWidgetDefinition } from "./GeomapWidgetDefinition"; import { QueryValueWidgetDefinition } from "./QueryValueWidgetDefinition"; @@ -20,6 +21,7 @@ import { UnparsedObject } from "../../datadog-api-client-common/util"; */ export type SplitGraphSourceWidgetDefinition = + | BarChartWidgetDefinition | ChangeWidgetDefinition | GeomapWidgetDefinition | QueryValueWidgetDefinition diff --git a/packages/datadog-api-client-v1/models/WidgetDefinition.ts b/packages/datadog-api-client-v1/models/WidgetDefinition.ts index 79f1d078cd2e..8be9dbef5fd6 100644 --- a/packages/datadog-api-client-v1/models/WidgetDefinition.ts +++ b/packages/datadog-api-client-v1/models/WidgetDefinition.ts @@ -5,6 +5,7 @@ */ import { AlertGraphWidgetDefinition } from "./AlertGraphWidgetDefinition"; import { AlertValueWidgetDefinition } from "./AlertValueWidgetDefinition"; +import { BarChartWidgetDefinition } from "./BarChartWidgetDefinition"; import { ChangeWidgetDefinition } from "./ChangeWidgetDefinition"; import { CheckStatusWidgetDefinition } from "./CheckStatusWidgetDefinition"; import { DistributionWidgetDefinition } from "./DistributionWidgetDefinition"; @@ -47,6 +48,7 @@ import { UnparsedObject } from "../../datadog-api-client-common/util"; export type WidgetDefinition = | AlertGraphWidgetDefinition | AlertValueWidgetDefinition + | BarChartWidgetDefinition | ChangeWidgetDefinition | CheckStatusWidgetDefinition | DistributionWidgetDefinition