Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -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"
}
12 changes: 12 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
54 changes: 54 additions & 0 deletions examples/v1/dashboards/CreateDashboard_3120240311.rb
Original file line number Diff line number Diff line change
@@ -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)
8 changes: 8 additions & 0 deletions features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion lib/datadog_api_client/v1/models/widget_time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def openapi_one_of
[
:'WidgetLegacyLiveSpan',
:'WidgetNewLiveSpan',
:'WidgetNewFixedSpan'
:'WidgetNewFixedSpan',
:'WidgetTimeHideIncompleteData'
]
end
# Builds the object
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Loading