From 0b3eeb81258a7f23793f773301694a4a968a39de Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 26 Aug 2025 19:33:03 +0000 Subject: [PATCH] Regenerate client from commit 346907f of spec repo --- .generated-info | 4 +- .generator/schemas/v1/openapi.yaml | 12 +++ .../dashboards/CreateDashboard_3120240311.rb | 54 ++++++++++ features/v1/dashboards.feature | 8 ++ lib/datadog_api_client/inflector.rb | 1 + .../v1/models/widget_time.rb | 3 +- .../widget_time_hide_incomplete_data.rb | 98 +++++++++++++++++++ 7 files changed, 177 insertions(+), 3 deletions(-) create mode 100644 examples/v1/dashboards/CreateDashboard_3120240311.rb create mode 100644 lib/datadog_api_client/v1/models/widget_time_hide_incomplete_data.rb diff --git a/.generated-info b/.generated-info index ecf00039e30e..b9ec231235ec 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "1e6c346", - "generated": "2025-08-25 18:45:37.801" + "spec_repo_commit": "346907f", + "generated": "2025-08-26 19:33:03.419" } diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index dacd4a02b1d9..efa99e4d63ab 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -24591,6 +24591,18 @@ components: - $ref: '#/components/schemas/WidgetLegacyLiveSpan' - $ref: '#/components/schemas/WidgetNewLiveSpan' - $ref: '#/components/schemas/WidgetNewFixedSpan' + - $ref: '#/components/schemas/WidgetTimeHideIncompleteData' + WidgetTimeHideIncompleteData: + additionalProperties: false + description: Widget time setting with hide incomplete cost data option. + properties: + hide_incomplete_cost_data: + description: Whether to hide incomplete cost data in the widget. + example: false + type: boolean + required: + - hide_incomplete_cost_data + type: object WidgetTimeWindows: description: Define a time window. enum: diff --git a/examples/v1/dashboards/CreateDashboard_3120240311.rb b/examples/v1/dashboards/CreateDashboard_3120240311.rb new file mode 100644 index 000000000000..4585fe6b3d3a --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_3120240311.rb @@ -0,0 +1,54 @@ +# Create a new timeseries widget with hide incomplete cost data + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::DashboardsAPI.new + +body = DatadogAPIClient::V1::Dashboard.new({ + title: "Example-Dashboard with hide incomplete cost data", + widgets: [ + DatadogAPIClient::V1::Widget.new({ + definition: DatadogAPIClient::V1::TimeseriesWidgetDefinition.new({ + title: "", + show_legend: true, + legend_layout: DatadogAPIClient::V1::TimeseriesWidgetLegendLayout::AUTO, + legend_columns: [ + DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::AVG, + DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::MIN, + DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::MAX, + DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::VALUE, + DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::SUM, + ], + time: DatadogAPIClient::V1::WidgetTimeHideIncompleteData.new({ + hide_incomplete_cost_data: true, + }), + type: DatadogAPIClient::V1::TimeseriesWidgetDefinitionType::TIMESERIES, + requests: [ + DatadogAPIClient::V1::TimeseriesWidgetRequest.new({ + formulas: [ + DatadogAPIClient::V1::WidgetFormula.new({ + formula: "query1", + }), + ], + queries: [ + DatadogAPIClient::V1::FormulaAndFunctionMetricQueryDefinition.new({ + data_source: DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource::METRICS, + name: "query1", + query: "avg:system.cpu.user{*}", + }), + ], + response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES, + style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + palette: "dog_classic", + line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, + line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, + }), + display_type: DatadogAPIClient::V1::WidgetDisplayType::LINE, + }), + ], + }), + }), + ], + layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED, + reflow_type: DatadogAPIClient::V1::DashboardReflowType::AUTO, +}) +p api_instance.create_dashboard(body) diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index 47794c745f44..afc1334f1ca8 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -910,6 +910,14 @@ Feature: Dashboards And the response "widgets[0].definition.requests[0].queries[0].data_source" is equal to "ci_tests" And the response "widgets[0].definition.requests[0].queries[0].search.query" is equal to "test_level:test" + @team:DataDog/dashboards-backend + Scenario: Create a new timeseries widget with hide incomplete cost data + Given new "CreateDashboard" request + And body with value {"title":"{{ unique }} with hide incomplete cost data","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{"hide_incomplete_cost_data": true},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"avg:system.cpu.user{*}"}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"} + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.time.hide_incomplete_cost_data" is equal to true + @team:DataDog/dashboards-backend Scenario: Create a new timeseries widget with incident_analytics data source Given new "CreateDashboard" request diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 7d7d1985f89c..ed9f1ba22087 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -938,6 +938,7 @@ def overrides "v1.widget_text_align" => "WidgetTextAlign", "v1.widget_tick_edge" => "WidgetTickEdge", "v1.widget_time" => "WidgetTime", + "v1.widget_time_hide_incomplete_data" => "WidgetTimeHideIncompleteData", "v1.widget_time_windows" => "WidgetTimeWindows", "v1.widget_vertical_align" => "WidgetVerticalAlign", "v1.widget_view_mode" => "WidgetViewMode", diff --git a/lib/datadog_api_client/v1/models/widget_time.rb b/lib/datadog_api_client/v1/models/widget_time.rb index 47d268b3d81e..491045d283ec 100644 --- a/lib/datadog_api_client/v1/models/widget_time.rb +++ b/lib/datadog_api_client/v1/models/widget_time.rb @@ -28,7 +28,8 @@ def openapi_one_of [ :'WidgetLegacyLiveSpan', :'WidgetNewLiveSpan', - :'WidgetNewFixedSpan' + :'WidgetNewFixedSpan', + :'WidgetTimeHideIncompleteData' ] end # Builds the object diff --git a/lib/datadog_api_client/v1/models/widget_time_hide_incomplete_data.rb b/lib/datadog_api_client/v1/models/widget_time_hide_incomplete_data.rb new file mode 100644 index 000000000000..d6900ff473da --- /dev/null +++ b/lib/datadog_api_client/v1/models/widget_time_hide_incomplete_data.rb @@ -0,0 +1,98 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Widget time setting with hide incomplete cost data option. + class WidgetTimeHideIncompleteData + include BaseGenericModel + + # Whether to hide incomplete cost data in the widget. + attr_reader :hide_incomplete_cost_data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'hide_incomplete_cost_data' => :'hide_incomplete_cost_data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'hide_incomplete_cost_data' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::WidgetTimeHideIncompleteData` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::WidgetTimeHideIncompleteData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'hide_incomplete_cost_data') + self.hide_incomplete_cost_data = attributes[:'hide_incomplete_cost_data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @hide_incomplete_cost_data.nil? + true + end + + # Custom attribute writer method with validation + # @param hide_incomplete_cost_data [Object] Object to be assigned + # @!visibility private + def hide_incomplete_cost_data=(hide_incomplete_cost_data) + if hide_incomplete_cost_data.nil? + fail ArgumentError, 'invalid value for "hide_incomplete_cost_data", hide_incomplete_cost_data cannot be nil.' + end + @hide_incomplete_cost_data = hide_incomplete_cost_data + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + hide_incomplete_cost_data == o.hide_incomplete_cost_data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [hide_incomplete_cost_data].hash + end + end +end