diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 008c85ab912f..cc1febc8c75c 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -1828,6 +1828,38 @@ components: x-enum-varnames: - CUSTOM_TIMEBOARD - CUSTOM_SCREENBOARD + DataProjectionQuery: + description: Query configuration for a data projection request. + properties: + data_source: + description: Data source for the query. + example: logs + type: string + indexes: + description: List of indexes to query. + items: + description: Index name. + type: string + type: array + query_string: + description: The query string to filter events. + example: "service:web-store" + type: string + storage: + description: Storage location for the query. + type: string + required: + - query_string + - data_source + type: object + DataProjectionRequestType: + description: Type of a data projection request. + enum: + - data_projection + example: data_projection + type: string + x-enum-varnames: + - DATA_PROJECTION DeleteSharedDashboardResponse: description: Response containing token of deleted shared dashboard. properties: @@ -11343,6 +11375,150 @@ components: maxItems: 2 minItems: 2 type: array + PointPlotDimension: + description: Dimension of the point plot. + enum: + - group + - time + - y + - radius + example: y + type: string + x-enum-varnames: + - GROUP + - TIME + - Y + - RADIUS + PointPlotProjection: + description: Projection configuration for the point plot widget. + properties: + dimensions: + description: List of dimension mappings for the projection. + items: + $ref: "#/components/schemas/PointPlotProjectionDimension" + type: array + extra_columns: + description: Additional columns to include in the projection. + items: + description: Column name. + type: string + type: array + type: + $ref: "#/components/schemas/PointPlotProjectionType" + required: + - type + - dimensions + type: object + PointPlotProjectionDimension: + description: Dimension mapping for the point plot projection. + properties: + alias: + description: Alias for the column. + type: string + column: + description: Source column name from the dataset. + example: duration + type: string + dimension: + $ref: "#/components/schemas/PointPlotDimension" + required: + - column + - dimension + type: object + PointPlotProjectionType: + description: Type of the projection. + enum: + - point_plot + example: point_plot + type: string + x-enum-varnames: + - POINT_PLOT + PointPlotWidgetDefinition: + description: The point plot displays individual data points over time. + properties: + custom_links: + description: List of custom links. + items: + $ref: "#/components/schemas/WidgetCustomLink" + type: array + description: + description: The description of the widget. + type: string + legend: + $ref: "#/components/schemas/PointPlotWidgetLegend" + markers: + description: List of markers for the widget. + items: + $ref: "#/components/schemas/WidgetMarker" + type: array + requests: + description: List of request configurations for the widget. + items: + $ref: "#/components/schemas/PointPlotWidgetRequest" + type: array + time: + $ref: "#/components/schemas/WidgetTime" + title: + description: Title of the widget. + type: string + title_align: + $ref: "#/components/schemas/WidgetTextAlign" + title_size: + description: Size of the title. + type: string + type: + $ref: "#/components/schemas/PointPlotWidgetDefinitionType" + yaxis: + $ref: "#/components/schemas/WidgetAxis" + required: + - type + - requests + type: object + PointPlotWidgetDefinitionType: + default: point_plot + description: Type of the point plot widget. + enum: + - point_plot + example: point_plot + type: string + x-enum-varnames: + - POINT_PLOT + PointPlotWidgetLegend: + description: Legend configuration for the point plot widget. + properties: + type: + $ref: "#/components/schemas/PointPlotWidgetLegendType" + required: + - type + type: object + PointPlotWidgetLegendType: + description: Type of legend to show for the point plot widget. + enum: + - automatic + - none + example: automatic + type: string + x-enum-varnames: + - AUTOMATIC + - NONE + PointPlotWidgetRequest: + description: Request configuration for the point plot widget. + properties: + limit: + description: Maximum number of data points to return. + format: int64 + type: integer + projection: + $ref: "#/components/schemas/PointPlotProjection" + query: + $ref: "#/components/schemas/DataProjectionQuery" + request_type: + $ref: "#/components/schemas/DataProjectionRequestType" + required: + - request_type + - query + - projection + type: object PowerpackTemplateVariableContents: description: Powerpack template variable contents. properties: @@ -25615,6 +25791,7 @@ components: - $ref: "#/components/schemas/MonitorSummaryWidgetDefinition" - $ref: "#/components/schemas/NoteWidgetDefinition" - $ref: "#/components/schemas/PowerpackWidgetDefinition" + - $ref: "#/components/schemas/PointPlotWidgetDefinition" - $ref: "#/components/schemas/QueryValueWidgetDefinition" - $ref: "#/components/schemas/RetentionCurveWidgetDefinition" - $ref: "#/components/schemas/RunWorkflowWidgetDefinition" diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-point-plot-widget.frozen b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-point-plot-widget.frozen new file mode 100644 index 000000000000..8f6732ce1241 --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-point-plot-widget.frozen @@ -0,0 +1 @@ +2026-04-30T15:58:43.378Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-point-plot-widget.yml b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-point-plot-widget.yml new file mode 100644 index 000000000000..8b6740280588 --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-point-plot-widget.yml @@ -0,0 +1,43 @@ +http_interactions: +- recorded_at: Thu, 30 Apr 2026 15:58:43 GMT + request: + body: + encoding: UTF-8 + string: '{"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_point_plot_widget-1777564723","widgets":[{"definition":{"requests":[{"projection":{"dimensions":[{"column":"host","dimension":"group"},{"column":"@duration","dimension":"y"}],"type":"point_plot"},"query":{"data_source":"logs","query_string":"service:web-store"},"request_type":"data_projection"}],"title":"","title_align":"left","title_size":"16","type":"point_plot"}}]}' + 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":"w8g-9wi-uav","title":"Test-Create_a_new_dashboard_with_point_plot_widget-1777564723","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"ordered","url":"/dashboard/w8g-9wi-uav/test-createanewdashboardwithpointplotwidget-1777564723","template_variables":null,"widgets":[{"definition":{"requests":[{"projection":{"dimensions":[{"column":"host","dimension":"group"},{"column":"@duration","dimension":"y"}],"type":"point_plot"},"query":{"data_source":"logs","query_string":"service:web-store"},"request_type":"data_projection"}],"title":"","title_align":"left","title_size":"16","type":"point_plot"},"id":1386353259406476}],"notify_list":null,"created_at":"2026-04-30T15:58:43.645158+00:00","modified_at":"2026-04-30T15:58:43.645158+00:00","restricted_roles":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Thu, 30 Apr 2026 15:58:43 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/w8g-9wi-uav + response: + body: + encoding: UTF-8 + string: '{"deleted_dashboard_id":"w8g-9wi-uav"}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v1/dashboards/CreateDashboard_2049446128.rb b/examples/v1/dashboards/CreateDashboard_2049446128.rb new file mode 100644 index 000000000000..80ad61d5ca9f --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_2049446128.rb @@ -0,0 +1,42 @@ +# Create a new dashboard with point_plot widget + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::DashboardsAPI.new + +body = DatadogAPIClient::V1::Dashboard.new({ + title: "Example-Dashboard", + layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED, + widgets: [ + DatadogAPIClient::V1::Widget.new({ + definition: DatadogAPIClient::V1::PointPlotWidgetDefinition.new({ + title: "", + title_size: "16", + title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT, + type: DatadogAPIClient::V1::PointPlotWidgetDefinitionType::POINT_PLOT, + requests: [ + DatadogAPIClient::V1::PointPlotWidgetRequest.new({ + request_type: DatadogAPIClient::V1::DataProjectionRequestType::DATA_PROJECTION, + query: DatadogAPIClient::V1::DataProjectionQuery.new({ + query_string: "service:web-store", + data_source: "logs", + }), + projection: DatadogAPIClient::V1::PointPlotProjection.new({ + type: DatadogAPIClient::V1::PointPlotProjectionType::POINT_PLOT, + dimensions: [ + DatadogAPIClient::V1::PointPlotProjectionDimension.new({ + column: "host", + dimension: DatadogAPIClient::V1::PointPlotDimension::GROUP, + }), + DatadogAPIClient::V1::PointPlotProjectionDimension.new({ + column: "@duration", + dimension: DatadogAPIClient::V1::PointPlotDimension::Y, + }), + ], + }), + }), + ], + }), + }), + ], +}) +p api_instance.create_dashboard(body) diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index 2541faab2d19..655b599b89b5 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -739,6 +739,18 @@ Feature: Dashboards And the response "widgets[0].definition.type" is equal to "note" And the response "widgets[0].definition.content" is equal to "# Example Note" + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with point_plot widget + Given new "CreateDashboard" request + And body from file "dashboards_json_payload/point_plot_widget.json" + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "point_plot" + And the response "widgets[0].definition.requests[0].request_type" is equal to "data_projection" + And the response "widgets[0].definition.requests[0].projection.type" is equal to "point_plot" + And the response "widgets[0].definition.requests[0].projection.dimensions[0].dimension" is equal to "group" + And the response "widgets[0].definition.requests[0].projection.dimensions[1].dimension" is equal to "y" + @team:DataDog/dashboards-backend Scenario: Create a new dashboard with powerpack widget Given new "CreateDashboard" request diff --git a/features/v1/dashboards_json_payload/point_plot_widget.json b/features/v1/dashboards_json_payload/point_plot_widget.json new file mode 100644 index 000000000000..c8e340c70789 --- /dev/null +++ b/features/v1/dashboards_json_payload/point_plot_widget.json @@ -0,0 +1,36 @@ +{ + "title": "{{ unique }}", + "layout_type": "ordered", + "widgets": [ + { + "definition": { + "title": "", + "title_size": "16", + "title_align": "left", + "type": "point_plot", + "requests": [ + { + "request_type": "data_projection", + "query": { + "query_string": "service:web-store", + "data_source": "logs" + }, + "projection": { + "type": "point_plot", + "dimensions": [ + { + "column": "host", + "dimension": "group" + }, + { + "column": "@duration", + "dimension": "y" + } + ] + } + } + ] + } + } + ] +} diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 79c15e6cf5e6..40df1dd11ec0 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -103,6 +103,8 @@ def overrides "v1.dashboard_template_variable_preset" => "DashboardTemplateVariablePreset", "v1.dashboard_template_variable_preset_value" => "DashboardTemplateVariablePresetValue", "v1.dashboard_type" => "DashboardType", + "v1.data_projection_query" => "DataProjectionQuery", + "v1.data_projection_request_type" => "DataProjectionRequestType", "v1.deleted_monitor" => "DeletedMonitor", "v1.delete_shared_dashboard_response" => "DeleteSharedDashboardResponse", "v1.distribution_point_item" => "DistributionPointItem", @@ -493,6 +495,15 @@ def overrides "v1.pager_duty_service_key" => "PagerDutyServiceKey", "v1.pager_duty_service_name" => "PagerDutyServiceName", "v1.pagination" => "Pagination", + "v1.point_plot_dimension" => "PointPlotDimension", + "v1.point_plot_projection" => "PointPlotProjection", + "v1.point_plot_projection_dimension" => "PointPlotProjectionDimension", + "v1.point_plot_projection_type" => "PointPlotProjectionType", + "v1.point_plot_widget_definition" => "PointPlotWidgetDefinition", + "v1.point_plot_widget_definition_type" => "PointPlotWidgetDefinitionType", + "v1.point_plot_widget_legend" => "PointPlotWidgetLegend", + "v1.point_plot_widget_legend_type" => "PointPlotWidgetLegendType", + "v1.point_plot_widget_request" => "PointPlotWidgetRequest", "v1.powerpack_template_variable_contents" => "PowerpackTemplateVariableContents", "v1.powerpack_template_variables" => "PowerpackTemplateVariables", "v1.powerpack_widget_definition" => "PowerpackWidgetDefinition", diff --git a/lib/datadog_api_client/v1/models/data_projection_query.rb b/lib/datadog_api_client/v1/models/data_projection_query.rb new file mode 100644 index 000000000000..839cc971fc22 --- /dev/null +++ b/lib/datadog_api_client/v1/models/data_projection_query.rb @@ -0,0 +1,166 @@ +=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 + # Query configuration for a data projection request. + class DataProjectionQuery + include BaseGenericModel + + # Data source for the query. + attr_reader :data_source + + # List of indexes to query. + attr_accessor :indexes + + # The query string to filter events. + attr_reader :query_string + + # Storage location for the query. + attr_accessor :storage + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_source' => :'data_source', + :'indexes' => :'indexes', + :'query_string' => :'query_string', + :'storage' => :'storage' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_source' => :'String', + :'indexes' => :'Array', + :'query_string' => :'String', + :'storage' => :'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::DataProjectionQuery` 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?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'indexes') + if (value = attributes[:'indexes']).is_a?(Array) + self.indexes = value + end + end + + if attributes.key?(:'query_string') + self.query_string = attributes[:'query_string'] + end + + if attributes.key?(:'storage') + self.storage = attributes[:'storage'] + 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 @data_source.nil? + return false if @query_string.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param query_string [Object] Object to be assigned + # @!visibility private + def query_string=(query_string) + if query_string.nil? + fail ArgumentError, 'invalid value for "query_string", query_string cannot be nil.' + end + @query_string = query_string + 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 && + data_source == o.data_source && + indexes == o.indexes && + query_string == o.query_string && + storage == o.storage && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_source, indexes, query_string, storage, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/data_projection_request_type.rb b/lib/datadog_api_client/v1/models/data_projection_request_type.rb new file mode 100644 index 000000000000..aaa61a45d0b3 --- /dev/null +++ b/lib/datadog_api_client/v1/models/data_projection_request_type.rb @@ -0,0 +1,26 @@ +=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 + # Type of a data projection request. + class DataProjectionRequestType + include BaseEnumModel + + DATA_PROJECTION = "data_projection".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/point_plot_dimension.rb b/lib/datadog_api_client/v1/models/point_plot_dimension.rb new file mode 100644 index 000000000000..3bbb51ba9686 --- /dev/null +++ b/lib/datadog_api_client/v1/models/point_plot_dimension.rb @@ -0,0 +1,29 @@ +=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 + # Dimension of the point plot. + class PointPlotDimension + include BaseEnumModel + + GROUP = "group".freeze + TIME = "time".freeze + Y = "y".freeze + RADIUS = "radius".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/point_plot_projection.rb b/lib/datadog_api_client/v1/models/point_plot_projection.rb new file mode 100644 index 000000000000..cd799de3cafb --- /dev/null +++ b/lib/datadog_api_client/v1/models/point_plot_projection.rb @@ -0,0 +1,158 @@ +=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 + # Projection configuration for the point plot widget. + class PointPlotProjection + include BaseGenericModel + + # List of dimension mappings for the projection. + attr_reader :dimensions + + # Additional columns to include in the projection. + attr_accessor :extra_columns + + # Type of the projection. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dimensions' => :'dimensions', + :'extra_columns' => :'extra_columns', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dimensions' => :'Array', + :'extra_columns' => :'Array', + :'type' => :'PointPlotProjectionType' + } + 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::PointPlotProjection` 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?(:'dimensions') + if (value = attributes[:'dimensions']).is_a?(Array) + self.dimensions = value + end + end + + if attributes.key?(:'extra_columns') + if (value = attributes[:'extra_columns']).is_a?(Array) + self.extra_columns = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @dimensions.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param dimensions [Object] Object to be assigned + # @!visibility private + def dimensions=(dimensions) + if dimensions.nil? + fail ArgumentError, 'invalid value for "dimensions", dimensions cannot be nil.' + end + @dimensions = dimensions + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + 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 && + dimensions == o.dimensions && + extra_columns == o.extra_columns && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dimensions, extra_columns, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/point_plot_projection_dimension.rb b/lib/datadog_api_client/v1/models/point_plot_projection_dimension.rb new file mode 100644 index 000000000000..c50b9ddc450e --- /dev/null +++ b/lib/datadog_api_client/v1/models/point_plot_projection_dimension.rb @@ -0,0 +1,154 @@ +=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 + # Dimension mapping for the point plot projection. + class PointPlotProjectionDimension + include BaseGenericModel + + # Alias for the column. + attr_accessor :_alias + + # Source column name from the dataset. + attr_reader :column + + # Dimension of the point plot. + attr_reader :dimension + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_alias' => :'alias', + :'column' => :'column', + :'dimension' => :'dimension' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_alias' => :'String', + :'column' => :'String', + :'dimension' => :'PointPlotDimension' + } + 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::PointPlotProjectionDimension` 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?(:'_alias') + self._alias = attributes[:'_alias'] + end + + if attributes.key?(:'column') + self.column = attributes[:'column'] + end + + if attributes.key?(:'dimension') + self.dimension = attributes[:'dimension'] + 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 @column.nil? + return false if @dimension.nil? + true + end + + # Custom attribute writer method with validation + # @param column [Object] Object to be assigned + # @!visibility private + def column=(column) + if column.nil? + fail ArgumentError, 'invalid value for "column", column cannot be nil.' + end + @column = column + end + + # Custom attribute writer method with validation + # @param dimension [Object] Object to be assigned + # @!visibility private + def dimension=(dimension) + if dimension.nil? + fail ArgumentError, 'invalid value for "dimension", dimension cannot be nil.' + end + @dimension = dimension + 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 && + _alias == o._alias && + column == o.column && + dimension == o.dimension && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_alias, column, dimension, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/point_plot_projection_type.rb b/lib/datadog_api_client/v1/models/point_plot_projection_type.rb new file mode 100644 index 000000000000..5095365be490 --- /dev/null +++ b/lib/datadog_api_client/v1/models/point_plot_projection_type.rb @@ -0,0 +1,26 @@ +=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 + # Type of the projection. + class PointPlotProjectionType + include BaseEnumModel + + POINT_PLOT = "point_plot".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/point_plot_widget_definition.rb b/lib/datadog_api_client/v1/models/point_plot_widget_definition.rb new file mode 100644 index 000000000000..21f2542ba4db --- /dev/null +++ b/lib/datadog_api_client/v1/models/point_plot_widget_definition.rb @@ -0,0 +1,240 @@ +=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 + # The point plot displays individual data points over time. + class PointPlotWidgetDefinition + include BaseGenericModel + + # List of custom links. + attr_accessor :custom_links + + # The description of the widget. + attr_accessor :description + + # Legend configuration for the point plot widget. + attr_accessor :legend + + # List of markers for the widget. + attr_accessor :markers + + # List of request configurations for the widget. + attr_reader :requests + + # Time setting for the widget. + attr_accessor :time + + # Title of the widget. + attr_accessor :title + + # How to align the text on the widget. + attr_accessor :title_align + + # Size of the title. + attr_accessor :title_size + + # Type of the point plot widget. + attr_reader :type + + # Axis controls for the widget. + attr_accessor :yaxis + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'custom_links' => :'custom_links', + :'description' => :'description', + :'legend' => :'legend', + :'markers' => :'markers', + :'requests' => :'requests', + :'time' => :'time', + :'title' => :'title', + :'title_align' => :'title_align', + :'title_size' => :'title_size', + :'type' => :'type', + :'yaxis' => :'yaxis' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'custom_links' => :'Array', + :'description' => :'String', + :'legend' => :'PointPlotWidgetLegend', + :'markers' => :'Array', + :'requests' => :'Array', + :'time' => :'WidgetTime', + :'title' => :'String', + :'title_align' => :'WidgetTextAlign', + :'title_size' => :'String', + :'type' => :'PointPlotWidgetDefinitionType', + :'yaxis' => :'WidgetAxis' + } + 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::PointPlotWidgetDefinition` 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?(:'custom_links') + if (value = attributes[:'custom_links']).is_a?(Array) + self.custom_links = value + end + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'legend') + self.legend = attributes[:'legend'] + end + + if attributes.key?(:'markers') + if (value = attributes[:'markers']).is_a?(Array) + self.markers = value + end + end + + if attributes.key?(:'requests') + if (value = attributes[:'requests']).is_a?(Array) + self.requests = value + end + end + + if attributes.key?(:'time') + self.time = attributes[:'time'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'title_align') + self.title_align = attributes[:'title_align'] + end + + if attributes.key?(:'title_size') + self.title_size = attributes[:'title_size'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'yaxis') + self.yaxis = attributes[:'yaxis'] + 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 @requests.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param requests [Object] Object to be assigned + # @!visibility private + def requests=(requests) + if requests.nil? + fail ArgumentError, 'invalid value for "requests", requests cannot be nil.' + end + @requests = requests + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + 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 && + custom_links == o.custom_links && + description == o.description && + legend == o.legend && + markers == o.markers && + requests == o.requests && + time == o.time && + title == o.title && + title_align == o.title_align && + title_size == o.title_size && + type == o.type && + yaxis == o.yaxis && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [custom_links, description, legend, markers, requests, time, title, title_align, title_size, type, yaxis, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/point_plot_widget_definition_type.rb b/lib/datadog_api_client/v1/models/point_plot_widget_definition_type.rb new file mode 100644 index 000000000000..0a21d6f7d6b5 --- /dev/null +++ b/lib/datadog_api_client/v1/models/point_plot_widget_definition_type.rb @@ -0,0 +1,26 @@ +=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 + # Type of the point plot widget. + class PointPlotWidgetDefinitionType + include BaseEnumModel + + POINT_PLOT = "point_plot".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/point_plot_widget_legend.rb b/lib/datadog_api_client/v1/models/point_plot_widget_legend.rb new file mode 100644 index 000000000000..161fdc5fbc38 --- /dev/null +++ b/lib/datadog_api_client/v1/models/point_plot_widget_legend.rb @@ -0,0 +1,123 @@ +=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 + # Legend configuration for the point plot widget. + class PointPlotWidgetLegend + include BaseGenericModel + + # Type of legend to show for the point plot widget. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'type' => :'PointPlotWidgetLegendType' + } + 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::PointPlotWidgetLegend` 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?(:'type') + self.type = attributes[:'type'] + 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + 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 && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/point_plot_widget_legend_type.rb b/lib/datadog_api_client/v1/models/point_plot_widget_legend_type.rb new file mode 100644 index 000000000000..1463df62a281 --- /dev/null +++ b/lib/datadog_api_client/v1/models/point_plot_widget_legend_type.rb @@ -0,0 +1,27 @@ +=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 + # Type of legend to show for the point plot widget. + class PointPlotWidgetLegendType + include BaseEnumModel + + AUTOMATIC = "automatic".freeze + NONE = "none".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/point_plot_widget_request.rb b/lib/datadog_api_client/v1/models/point_plot_widget_request.rb new file mode 100644 index 000000000000..4e72a9cbc7ba --- /dev/null +++ b/lib/datadog_api_client/v1/models/point_plot_widget_request.rb @@ -0,0 +1,175 @@ +=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 + # Request configuration for the point plot widget. + class PointPlotWidgetRequest + include BaseGenericModel + + # Maximum number of data points to return. + attr_accessor :limit + + # Projection configuration for the point plot widget. + attr_reader :projection + + # Query configuration for a data projection request. + attr_reader :query + + # Type of a data projection request. + attr_reader :request_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'limit' => :'limit', + :'projection' => :'projection', + :'query' => :'query', + :'request_type' => :'request_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'limit' => :'Integer', + :'projection' => :'PointPlotProjection', + :'query' => :'DataProjectionQuery', + :'request_type' => :'DataProjectionRequestType' + } + 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::PointPlotWidgetRequest` 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?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'projection') + self.projection = attributes[:'projection'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + 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 @projection.nil? + return false if @query.nil? + return false if @request_type.nil? + true + end + + # Custom attribute writer method with validation + # @param projection [Object] Object to be assigned + # @!visibility private + def projection=(projection) + if projection.nil? + fail ArgumentError, 'invalid value for "projection", projection cannot be nil.' + end + @projection = projection + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Custom attribute writer method with validation + # @param request_type [Object] Object to be assigned + # @!visibility private + def request_type=(request_type) + if request_type.nil? + fail ArgumentError, 'invalid value for "request_type", request_type cannot be nil.' + end + @request_type = request_type + 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 && + limit == o.limit && + projection == o.projection && + query == o.query && + request_type == o.request_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [limit, projection, query, request_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/widget_definition.rb b/lib/datadog_api_client/v1/models/widget_definition.rb index e72c14a8a531..89775bb92640 100644 --- a/lib/datadog_api_client/v1/models/widget_definition.rb +++ b/lib/datadog_api_client/v1/models/widget_definition.rb @@ -49,6 +49,7 @@ def openapi_one_of :'MonitorSummaryWidgetDefinition', :'NoteWidgetDefinition', :'PowerpackWidgetDefinition', + :'PointPlotWidgetDefinition', :'QueryValueWidgetDefinition', :'RetentionCurveWidgetDefinition', :'RunWorkflowWidgetDefinition',