Skip to content

Commit 0b3eeb8

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 346907f of spec repo
1 parent 4c1f6aa commit 0b3eeb8

File tree

7 files changed

+177
-3
lines changed

7 files changed

+177
-3
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "1e6c346",
3-
"generated": "2025-08-25 18:45:37.801"
2+
"spec_repo_commit": "346907f",
3+
"generated": "2025-08-26 19:33:03.419"
44
}

.generator/schemas/v1/openapi.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24591,6 +24591,18 @@ components:
2459124591
- $ref: '#/components/schemas/WidgetLegacyLiveSpan'
2459224592
- $ref: '#/components/schemas/WidgetNewLiveSpan'
2459324593
- $ref: '#/components/schemas/WidgetNewFixedSpan'
24594+
- $ref: '#/components/schemas/WidgetTimeHideIncompleteData'
24595+
WidgetTimeHideIncompleteData:
24596+
additionalProperties: false
24597+
description: Widget time setting with hide incomplete cost data option.
24598+
properties:
24599+
hide_incomplete_cost_data:
24600+
description: Whether to hide incomplete cost data in the widget.
24601+
example: false
24602+
type: boolean
24603+
required:
24604+
- hide_incomplete_cost_data
24605+
type: object
2459424606
WidgetTimeWindows:
2459524607
description: Define a time window.
2459624608
enum:
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Create a new timeseries widget with hide incomplete cost data
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
5+
6+
body = DatadogAPIClient::V1::Dashboard.new({
7+
title: "Example-Dashboard with hide incomplete cost data",
8+
widgets: [
9+
DatadogAPIClient::V1::Widget.new({
10+
definition: DatadogAPIClient::V1::TimeseriesWidgetDefinition.new({
11+
title: "",
12+
show_legend: true,
13+
legend_layout: DatadogAPIClient::V1::TimeseriesWidgetLegendLayout::AUTO,
14+
legend_columns: [
15+
DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::AVG,
16+
DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::MIN,
17+
DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::MAX,
18+
DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::VALUE,
19+
DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::SUM,
20+
],
21+
time: DatadogAPIClient::V1::WidgetTimeHideIncompleteData.new({
22+
hide_incomplete_cost_data: true,
23+
}),
24+
type: DatadogAPIClient::V1::TimeseriesWidgetDefinitionType::TIMESERIES,
25+
requests: [
26+
DatadogAPIClient::V1::TimeseriesWidgetRequest.new({
27+
formulas: [
28+
DatadogAPIClient::V1::WidgetFormula.new({
29+
formula: "query1",
30+
}),
31+
],
32+
queries: [
33+
DatadogAPIClient::V1::FormulaAndFunctionMetricQueryDefinition.new({
34+
data_source: DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource::METRICS,
35+
name: "query1",
36+
query: "avg:system.cpu.user{*}",
37+
}),
38+
],
39+
response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES,
40+
style: DatadogAPIClient::V1::WidgetRequestStyle.new({
41+
palette: "dog_classic",
42+
line_type: DatadogAPIClient::V1::WidgetLineType::SOLID,
43+
line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL,
44+
}),
45+
display_type: DatadogAPIClient::V1::WidgetDisplayType::LINE,
46+
}),
47+
],
48+
}),
49+
}),
50+
],
51+
layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
52+
reflow_type: DatadogAPIClient::V1::DashboardReflowType::AUTO,
53+
})
54+
p api_instance.create_dashboard(body)

features/v1/dashboards.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,14 @@ Feature: Dashboards
910910
And the response "widgets[0].definition.requests[0].queries[0].data_source" is equal to "ci_tests"
911911
And the response "widgets[0].definition.requests[0].queries[0].search.query" is equal to "test_level:test"
912912

913+
@team:DataDog/dashboards-backend
914+
Scenario: Create a new timeseries widget with hide incomplete cost data
915+
Given new "CreateDashboard" request
916+
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"}
917+
When the request is sent
918+
Then the response status is 200 OK
919+
And the response "widgets[0].definition.time.hide_incomplete_cost_data" is equal to true
920+
913921
@team:DataDog/dashboards-backend
914922
Scenario: Create a new timeseries widget with incident_analytics data source
915923
Given new "CreateDashboard" request

lib/datadog_api_client/inflector.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,7 @@ def overrides
938938
"v1.widget_text_align" => "WidgetTextAlign",
939939
"v1.widget_tick_edge" => "WidgetTickEdge",
940940
"v1.widget_time" => "WidgetTime",
941+
"v1.widget_time_hide_incomplete_data" => "WidgetTimeHideIncompleteData",
941942
"v1.widget_time_windows" => "WidgetTimeWindows",
942943
"v1.widget_vertical_align" => "WidgetVerticalAlign",
943944
"v1.widget_view_mode" => "WidgetViewMode",

lib/datadog_api_client/v1/models/widget_time.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def openapi_one_of
2828
[
2929
:'WidgetLegacyLiveSpan',
3030
:'WidgetNewLiveSpan',
31-
:'WidgetNewFixedSpan'
31+
:'WidgetNewFixedSpan',
32+
:'WidgetTimeHideIncompleteData'
3233
]
3334
end
3435
# Builds the object
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
=begin
2+
#Datadog API V1 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V1
20+
# Widget time setting with hide incomplete cost data option.
21+
class WidgetTimeHideIncompleteData
22+
include BaseGenericModel
23+
24+
# Whether to hide incomplete cost data in the widget.
25+
attr_reader :hide_incomplete_cost_data
26+
27+
# Attribute mapping from ruby-style variable name to JSON key.
28+
# @!visibility private
29+
def self.attribute_map
30+
{
31+
:'hide_incomplete_cost_data' => :'hide_incomplete_cost_data'
32+
}
33+
end
34+
35+
# Attribute type mapping.
36+
# @!visibility private
37+
def self.openapi_types
38+
{
39+
:'hide_incomplete_cost_data' => :'Boolean'
40+
}
41+
end
42+
43+
# Initializes the object
44+
# @param attributes [Hash] Model attributes in the form of hash
45+
# @!visibility private
46+
def initialize(attributes = {})
47+
if (!attributes.is_a?(Hash))
48+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::WidgetTimeHideIncompleteData` initialize method"
49+
end
50+
51+
# check to see if the attribute exists and convert string to symbol for hash key
52+
attributes = attributes.each_with_object({}) { |(k, v), h|
53+
if (!self.class.attribute_map.key?(k.to_sym))
54+
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
55+
end
56+
h[k.to_sym] = v
57+
}
58+
59+
if attributes.key?(:'hide_incomplete_cost_data')
60+
self.hide_incomplete_cost_data = attributes[:'hide_incomplete_cost_data']
61+
end
62+
end
63+
64+
# Check to see if the all the properties in the model are valid
65+
# @return true if the model is valid
66+
# @!visibility private
67+
def valid?
68+
return false if @hide_incomplete_cost_data.nil?
69+
true
70+
end
71+
72+
# Custom attribute writer method with validation
73+
# @param hide_incomplete_cost_data [Object] Object to be assigned
74+
# @!visibility private
75+
def hide_incomplete_cost_data=(hide_incomplete_cost_data)
76+
if hide_incomplete_cost_data.nil?
77+
fail ArgumentError, 'invalid value for "hide_incomplete_cost_data", hide_incomplete_cost_data cannot be nil.'
78+
end
79+
@hide_incomplete_cost_data = hide_incomplete_cost_data
80+
end
81+
82+
# Checks equality by comparing each attribute.
83+
# @param o [Object] Object to be compared
84+
# @!visibility private
85+
def ==(o)
86+
return true if self.equal?(o)
87+
self.class == o.class &&
88+
hide_incomplete_cost_data == o.hide_incomplete_cost_data
89+
end
90+
91+
# Calculates hash code according to all attributes.
92+
# @return [Integer] Hash code
93+
# @!visibility private
94+
def hash
95+
[hide_incomplete_cost_data].hash
96+
end
97+
end
98+
end

0 commit comments

Comments
 (0)