diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 909939582950..e5aa089658c2 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -19536,6 +19536,23 @@ components: x-enum-varnames: - BARS - AREA + TimeseriesRequestStyle: + description: Define request widget style for timeseries widgets. + properties: + has_value_labels: + description: If true, the value is displayed as a label relative to the + data point. + type: boolean + line_type: + $ref: '#/components/schemas/WidgetLineType' + line_width: + $ref: '#/components/schemas/WidgetLineWidth' + order_by: + $ref: '#/components/schemas/WidgetStyleOrderBy' + palette: + description: Color palette to apply to the widget. + type: string + type: object TimeseriesWidgetDefinition: description: The timeseries visualization allows you to display the evolution of one or more metrics, log events, or Indexed Spans over time. @@ -19711,7 +19728,7 @@ components: deprecated: true description: Deprecated - Use `queries` and `formulas` instead. style: - $ref: '#/components/schemas/WidgetRequestStyle' + $ref: '#/components/schemas/TimeseriesRequestStyle' type: object ToplistWidgetDefinition: description: The top list visualization enables you to display a list of Tag diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-timeseries-widget-using-has-value-labels.frozen b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-timeseries-widget-using-has-value-labels.frozen new file mode 100644 index 000000000000..5065c0390ef0 --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-timeseries-widget-using-has-value-labels.frozen @@ -0,0 +1 @@ +2026-03-02T17:38:31.339Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-timeseries-widget-using-has-value-labels.yml b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-timeseries-widget-using-has-value-labels.yml new file mode 100644 index 000000000000..3dc0c49deaa6 --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-timeseries-widget-using-has-value-labels.yml @@ -0,0 +1,47 @@ +http_interactions: +- recorded_at: Mon, 02 Mar 2026 17:38:31 GMT + request: + body: + encoding: UTF-8 + string: '{"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_timeseries_widget_using_has_value_labels-1772473111 + with has_value_labels","widgets":[{"definition":{"requests":[{"display_type":"line","q":"avg:system.cpu.user{*} + by {host}","style":{"has_value_labels":true,"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"type":"timeseries"}}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard + response: + body: + encoding: UTF-8 + string: '{"id":"ue9-kuc-ix2","title":"Test-Create_a_new_dashboard_with_timeseries_widget_using_has_value_labels-1772473111 + with has_value_labels","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"ordered","url":"/dashboard/ue9-kuc-ix2/test-createanewdashboardwithtimeserieswidgetusinghasvaluelabels-1772473111-with","template_variables":null,"widgets":[{"definition":{"requests":[{"display_type":"line","q":"avg:system.cpu.user{*} + by {host}","style":{"has_value_labels":true,"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"type":"timeseries"},"id":3800027122356131}],"notify_list":null,"created_at":"2026-03-02T17:38:31.488630+00:00","modified_at":"2026-03-02T17:38:31.488630+00:00","restricted_roles":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Mon, 02 Mar 2026 17:38:31 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/ue9-kuc-ix2 + response: + body: + encoding: UTF-8 + string: '{"deleted_dashboard_id":"ue9-kuc-ix2"}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v1/dashboards/CreateDashboard_1259346254.rb b/examples/v1/dashboards/CreateDashboard_1259346254.rb index 32bb6e24ca10..f7bfe8f11e71 100644 --- a/examples/v1/dashboards/CreateDashboard_1259346254.rb +++ b/examples/v1/dashboards/CreateDashboard_1259346254.rb @@ -13,7 +13,7 @@ requests: [ DatadogAPIClient::V1::TimeseriesWidgetRequest.new({ q: "avg:system.cpu.user{*} by {host}", - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "warm", order_by: DatadogAPIClient::V1::WidgetStyleOrderBy::VALUES, }), diff --git a/examples/v1/dashboards/CreateDashboard_1284514532.rb b/examples/v1/dashboards/CreateDashboard_1284514532.rb index 5033e32c26ac..0cefdd689004 100644 --- a/examples/v1/dashboards/CreateDashboard_1284514532.rb +++ b/examples/v1/dashboards/CreateDashboard_1284514532.rb @@ -27,7 +27,7 @@ }), ], response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES, - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "dog_classic", line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, diff --git a/examples/v1/dashboards/CreateDashboard_1307120899.rb b/examples/v1/dashboards/CreateDashboard_1307120899.rb index 4d8e036e9427..6ca3346b9e35 100644 --- a/examples/v1/dashboards/CreateDashboard_1307120899.rb +++ b/examples/v1/dashboards/CreateDashboard_1307120899.rb @@ -43,7 +43,7 @@ }), ], response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES, - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "dog_classic", line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, diff --git a/examples/v1/dashboards/CreateDashboard_1433408735.rb b/examples/v1/dashboards/CreateDashboard_1433408735.rb index 2c08522c4303..5fe09c49a7cf 100644 --- a/examples/v1/dashboards/CreateDashboard_1433408735.rb +++ b/examples/v1/dashboards/CreateDashboard_1433408735.rb @@ -27,7 +27,7 @@ }), ], response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES, - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "dog_classic", line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, diff --git a/examples/v1/dashboards/CreateDashboard_1705253330.rb b/examples/v1/dashboards/CreateDashboard_1705253330.rb new file mode 100644 index 000000000000..73a0f6dd8522 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_1705253330.rb @@ -0,0 +1,29 @@ +# Create a new dashboard with timeseries widget using has_value_labels + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::DashboardsAPI.new + +body = DatadogAPIClient::V1::Dashboard.new({ + layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED, + title: "Example-Dashboard with has_value_labels", + widgets: [ + DatadogAPIClient::V1::Widget.new({ + definition: DatadogAPIClient::V1::TimeseriesWidgetDefinition.new({ + type: DatadogAPIClient::V1::TimeseriesWidgetDefinitionType::TIMESERIES, + requests: [ + DatadogAPIClient::V1::TimeseriesWidgetRequest.new({ + q: "avg:system.cpu.user{*} by {host}", + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ + palette: "dog_classic", + line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, + line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, + has_value_labels: true, + }), + display_type: DatadogAPIClient::V1::WidgetDisplayType::LINE, + }), + ], + }), + }), + ], +}) +p api_instance.create_dashboard(body) diff --git a/examples/v1/dashboards/CreateDashboard_2261785072.rb b/examples/v1/dashboards/CreateDashboard_2261785072.rb index d1b48ad12090..7e88d8e52743 100644 --- a/examples/v1/dashboards/CreateDashboard_2261785072.rb +++ b/examples/v1/dashboards/CreateDashboard_2261785072.rb @@ -32,7 +32,7 @@ query: "avg:system.cpu.user{*}", }), ], - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "purple", line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, diff --git a/examples/v1/dashboards/CreateDashboard_2278756614.rb b/examples/v1/dashboards/CreateDashboard_2278756614.rb index 09ee4b1a55b8..c18eb98db092 100644 --- a/examples/v1/dashboards/CreateDashboard_2278756614.rb +++ b/examples/v1/dashboards/CreateDashboard_2278756614.rb @@ -32,7 +32,7 @@ query: "avg:system.cpu.user{*}", }), ], - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "dog_classic", line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, diff --git a/examples/v1/dashboards/CreateDashboard_2800096921.rb b/examples/v1/dashboards/CreateDashboard_2800096921.rb index eaba81921537..efc6bee63dac 100644 --- a/examples/v1/dashboards/CreateDashboard_2800096921.rb +++ b/examples/v1/dashboards/CreateDashboard_2800096921.rb @@ -44,7 +44,7 @@ }), ], response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES, - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "dog_classic", line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, diff --git a/examples/v1/dashboards/CreateDashboard_3066042014.rb b/examples/v1/dashboards/CreateDashboard_3066042014.rb index aed5bf607f9c..460a22155288 100644 --- a/examples/v1/dashboards/CreateDashboard_3066042014.rb +++ b/examples/v1/dashboards/CreateDashboard_3066042014.rb @@ -49,7 +49,7 @@ }), ], response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES, - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "dog_classic", line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, diff --git a/examples/v1/dashboards/CreateDashboard_3451918078.rb b/examples/v1/dashboards/CreateDashboard_3451918078.rb index ab8b06b7e405..ea0470d56df3 100644 --- a/examples/v1/dashboards/CreateDashboard_3451918078.rb +++ b/examples/v1/dashboards/CreateDashboard_3451918078.rb @@ -49,7 +49,7 @@ }), ], response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES, - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "dog_classic", line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, diff --git a/examples/v1/dashboards/CreateDashboard_3631423980.rb b/examples/v1/dashboards/CreateDashboard_3631423980.rb index 30be6a702a9a..4f31f99a280b 100644 --- a/examples/v1/dashboards/CreateDashboard_3631423980.rb +++ b/examples/v1/dashboards/CreateDashboard_3631423980.rb @@ -13,7 +13,7 @@ requests: [ DatadogAPIClient::V1::TimeseriesWidgetRequest.new({ q: "avg:system.cpu.user{*} by {host}", - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "dog_classic", line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, diff --git a/examples/v1/dashboards/CreateDashboard_3982498788.rb b/examples/v1/dashboards/CreateDashboard_3982498788.rb index a253eeb42425..a63b82184dcc 100644 --- a/examples/v1/dashboards/CreateDashboard_3982498788.rb +++ b/examples/v1/dashboards/CreateDashboard_3982498788.rb @@ -14,7 +14,7 @@ DatadogAPIClient::V1::TimeseriesWidgetRequest.new({ q: "sum:trace.test.errors{env:prod,service:datadog-api-spec} by {resource_name}.as_count()", on_right_yaxis: false, - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "warm", line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, diff --git a/examples/v1/dashboards/CreateDashboard_41622531.rb b/examples/v1/dashboards/CreateDashboard_41622531.rb index 7f776edcd3f1..516342d8d6c1 100644 --- a/examples/v1/dashboards/CreateDashboard_41622531.rb +++ b/examples/v1/dashboards/CreateDashboard_41622531.rb @@ -39,7 +39,7 @@ }), ], response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES, - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "dog_classic", line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, diff --git a/examples/v1/dashboards/CreateDashboard_416487533.rb b/examples/v1/dashboards/CreateDashboard_416487533.rb index 2be098d89f6f..3c61b6e41289 100644 --- a/examples/v1/dashboards/CreateDashboard_416487533.rb +++ b/examples/v1/dashboards/CreateDashboard_416487533.rb @@ -13,7 +13,7 @@ requests: [ DatadogAPIClient::V1::TimeseriesWidgetRequest.new({ q: "avg:system.cpu.user{*} by {host}", - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "dog_classic", order_by: DatadogAPIClient::V1::WidgetStyleOrderBy::TAGS, }), diff --git a/examples/v1/dashboards/CreateDashboard_4262729673.rb b/examples/v1/dashboards/CreateDashboard_4262729673.rb index 782f576337c4..ae8effc9cf2e 100644 --- a/examples/v1/dashboards/CreateDashboard_4262729673.rb +++ b/examples/v1/dashboards/CreateDashboard_4262729673.rb @@ -47,7 +47,7 @@ }), ], response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES, - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "dog_classic", line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, diff --git a/examples/v1/dashboards/CreateDashboard_607525069.rb b/examples/v1/dashboards/CreateDashboard_607525069.rb index 308437ddba10..ad923bf24c6f 100644 --- a/examples/v1/dashboards/CreateDashboard_607525069.rb +++ b/examples/v1/dashboards/CreateDashboard_607525069.rb @@ -43,7 +43,7 @@ }), ], response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES, - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "dog_classic", line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, diff --git a/examples/v1/dashboards/CreateDashboard_985012506.rb b/examples/v1/dashboards/CreateDashboard_985012506.rb index b915d5c0fa5c..38ee270fede0 100644 --- a/examples/v1/dashboards/CreateDashboard_985012506.rb +++ b/examples/v1/dashboards/CreateDashboard_985012506.rb @@ -43,7 +43,7 @@ }), ], response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES, - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ palette: "dog_classic", line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, diff --git a/examples/v1/notebooks/CreateNotebook.rb b/examples/v1/notebooks/CreateNotebook.rb index 8b9ed30788a5..d914d926e3e8 100644 --- a/examples/v1/notebooks/CreateNotebook.rb +++ b/examples/v1/notebooks/CreateNotebook.rb @@ -23,7 +23,7 @@ DatadogAPIClient::V1::TimeseriesWidgetRequest.new({ display_type: DatadogAPIClient::V1::WidgetDisplayType::LINE, q: "avg:system.load.1{*}", - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, palette: "dog_classic", diff --git a/examples/v1/notebooks/UpdateNotebook.rb b/examples/v1/notebooks/UpdateNotebook.rb index af14e2f8d4ef..555bcdde9da5 100644 --- a/examples/v1/notebooks/UpdateNotebook.rb +++ b/examples/v1/notebooks/UpdateNotebook.rb @@ -26,7 +26,7 @@ DatadogAPIClient::V1::TimeseriesWidgetRequest.new({ display_type: DatadogAPIClient::V1::WidgetDisplayType::LINE, q: "avg:system.load.1{*}", - style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + style: DatadogAPIClient::V1::TimeseriesRequestStyle.new({ line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, palette: "dog_classic", diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index 5a243eb4bebd..e8c10d7cc5fe 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -966,6 +966,17 @@ Feature: Dashboards And the response "widgets[0].definition.requests[0].display_type" is equal to "bars" And the response "widgets[0].definition.requests[0].q" is equal to "sum:trace.test.errors{env:prod,service:datadog-api-spec} by {resource_name}.as_count()" + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with timeseries widget using has_value_labels + Given new "CreateDashboard" request + And body with value {"layout_type": "ordered", "title": "{{ unique }} with has_value_labels","widgets": [{"definition": {"type": "timeseries","requests": [{"q": "avg:system.cpu.user{*} by {host}","style": {"palette": "dog_classic","line_type": "solid","line_width": "normal","has_value_labels": true},"display_type": "line"}]}}]} + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.requests[0].style.has_value_labels" is equal to true + And the response "widgets[0].definition.requests[0].style.palette" is equal to "dog_classic" + And the response "widgets[0].definition.requests[0].style.line_type" is equal to "solid" + And the response "widgets[0].definition.requests[0].style.line_width" is equal to "normal" + @team:DataDog/dashboards-backend Scenario: Create a new dashboard with timeseries widget using order_by tags Given new "CreateDashboard" request diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index a71819e11456..5ec964f5e563 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -799,6 +799,7 @@ def overrides "v1.target_format_type" => "TargetFormatType", "v1.timeseries_background" => "TimeseriesBackground", "v1.timeseries_background_type" => "TimeseriesBackgroundType", + "v1.timeseries_request_style" => "TimeseriesRequestStyle", "v1.timeseries_widget_definition" => "TimeseriesWidgetDefinition", "v1.timeseries_widget_definition_type" => "TimeseriesWidgetDefinitionType", "v1.timeseries_widget_expression_alias" => "TimeseriesWidgetExpressionAlias", diff --git a/lib/datadog_api_client/v1/models/timeseries_request_style.rb b/lib/datadog_api_client/v1/models/timeseries_request_style.rb new file mode 100644 index 000000000000..3a0c1a0c4872 --- /dev/null +++ b/lib/datadog_api_client/v1/models/timeseries_request_style.rb @@ -0,0 +1,147 @@ +=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 + # Define request widget style for timeseries widgets. + class TimeseriesRequestStyle + include BaseGenericModel + + # If true, the value is displayed as a label relative to the data point. + attr_accessor :has_value_labels + + # Type of lines displayed. + attr_accessor :line_type + + # Width of line displayed. + attr_accessor :line_width + + # How to order series in timeseries visualizations. + # - `tags`: Order series alphabetically by tag name (default behavior) + # - `values`: Order series by their current metric values (typically descending) + attr_accessor :order_by + + # Color palette to apply to the widget. + attr_accessor :palette + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'has_value_labels' => :'has_value_labels', + :'line_type' => :'line_type', + :'line_width' => :'line_width', + :'order_by' => :'order_by', + :'palette' => :'palette' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'has_value_labels' => :'Boolean', + :'line_type' => :'WidgetLineType', + :'line_width' => :'WidgetLineWidth', + :'order_by' => :'WidgetStyleOrderBy', + :'palette' => :'String' + } + 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::TimeseriesRequestStyle` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'has_value_labels') + self.has_value_labels = attributes[:'has_value_labels'] + end + + if attributes.key?(:'line_type') + self.line_type = attributes[:'line_type'] + end + + if attributes.key?(:'line_width') + self.line_width = attributes[:'line_width'] + end + + if attributes.key?(:'order_by') + self.order_by = attributes[:'order_by'] + end + + if attributes.key?(:'palette') + self.palette = attributes[:'palette'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + has_value_labels == o.has_value_labels && + line_type == o.line_type && + line_width == o.line_width && + order_by == o.order_by && + palette == o.palette && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [has_value_labels, line_type, line_width, order_by, palette, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/timeseries_widget_request.rb b/lib/datadog_api_client/v1/models/timeseries_widget_request.rb index 93ae984bcea3..c09b451258a7 100644 --- a/lib/datadog_api_client/v1/models/timeseries_widget_request.rb +++ b/lib/datadog_api_client/v1/models/timeseries_widget_request.rb @@ -69,7 +69,7 @@ class TimeseriesWidgetRequest # The log query. attr_accessor :security_query - # Define request widget style. + # Define request widget style for timeseries widgets. attr_accessor :style attr_accessor :additional_properties @@ -118,7 +118,7 @@ def self.openapi_types :'response_format' => :'FormulaAndFunctionResponseFormat', :'rum_query' => :'LogQueryDefinition', :'security_query' => :'LogQueryDefinition', - :'style' => :'WidgetRequestStyle' + :'style' => :'TimeseriesRequestStyle' } end