Skip to content

Commit

Permalink
Dashboards - Toplist widget style - Add palette (#1992)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Sep 6, 2024
1 parent c00f226 commit aea88d5
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 27 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-04 17:12:26.140493",
"spec_repo_commit": "8e0507d2"
"regenerated": "2024-09-06 21:00:12.124581",
"spec_repo_commit": "3dff532a"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-04 17:12:26.158768",
"spec_repo_commit": "8e0507d2"
"regenerated": "2024-09-06 21:00:12.142757",
"spec_repo_commit": "3dff532a"
}
}
}
3 changes: 3 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17115,6 +17115,9 @@ components:
properties:
display:
$ref: '#/components/schemas/ToplistWidgetDisplay'
palette:
description: Color palette to apply to the widget.
type: string
scaling:
$ref: '#/components/schemas/ToplistWidgetScaling'
type: object
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-05-21T14:43:42.680Z
2024-09-06T12:10:50.473Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-05-15T20:07:42.432Z
2024-09-06T12:10:51.099Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/v1/dashboards/CreateDashboard_1213075383.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
legend: DatadogAPIClient::V1::ToplistWidgetLegend::INLINE,
}),
scaling: DatadogAPIClient::V1::ToplistWidgetScaling::RELATIVE,
palette: "dog_classic",
}),
type: DatadogAPIClient::V1::ToplistWidgetDefinitionType::TOPLIST,
requests: [
Expand Down
1 change: 1 addition & 0 deletions examples/v1/dashboards/CreateDashboard_2563642929.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
legend: DatadogAPIClient::V1::ToplistWidgetLegend::INLINE,
}),
scaling: DatadogAPIClient::V1::ToplistWidgetScaling::RELATIVE,
palette: "dog_classic",
}),
type: DatadogAPIClient::V1::ToplistWidgetDefinitionType::TOPLIST,
requests: [
Expand Down
2 changes: 1 addition & 1 deletion features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Feature: Dashboards
@team:DataDog/dashboards-backend
Scenario: Create a new dashboard with a toplist 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"},"type":"toplist","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","is_read_only":false,"notify_list":[]}
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":"toplist","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","is_read_only":false,"notify_list":[]}
When the request is sent
Then the response status is 200 OK
And the response "widgets[0].definition.type" is equal to "toplist"
Expand Down
3 changes: 2 additions & 1 deletion features/v1/dashboards_json_payload/toplist_widget.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"type": "stacked",
"legend": "inline"
},
"scaling": "relative"
"scaling": "relative",
"palette": "dog_classic"
},
"type":"toplist",
"requests":[
Expand Down
12 changes: 11 additions & 1 deletion lib/datadog_api_client/v1/models/toplist_widget_style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class ToplistWidgetStyle
# Top list widget display options.
attr_accessor :display

# Color palette to apply to the widget.
attr_accessor :palette

# Top list widget scaling definition.
attr_accessor :scaling

Expand All @@ -34,6 +37,7 @@ class ToplistWidgetStyle
def self.attribute_map
{
:'display' => :'display',
:'palette' => :'palette',
:'scaling' => :'scaling'
}
end
Expand All @@ -43,6 +47,7 @@ def self.attribute_map
def self.openapi_types
{
:'display' => :'ToplistWidgetDisplay',
:'palette' => :'String',
:'scaling' => :'ToplistWidgetScaling'
}
end
Expand All @@ -69,6 +74,10 @@ def initialize(attributes = {})
self.display = attributes[:'display']
end

if attributes.key?(:'palette')
self.palette = attributes[:'palette']
end

if attributes.key?(:'scaling')
self.scaling = attributes[:'scaling']
end
Expand Down Expand Up @@ -101,6 +110,7 @@ def ==(o)
return true if self.equal?(o)
self.class == o.class &&
display == o.display &&
palette == o.palette &&
scaling == o.scaling
additional_properties == o.additional_properties
end
Expand All @@ -109,7 +119,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[display, scaling].hash
[display, palette, scaling].hash
end
end
end

0 comments on commit aea88d5

Please sign in to comment.