From 0853e1fa0d0645bd0b09e060a1413b5134095bc8 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 12 Sep 2022 15:22:15 +0000 Subject: [PATCH] Regenerate client from commit dcd92077 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 86 ++++++++ ...-dashboard-with-topology-map-widget.frozen | 1 + ...new-dashboard-with-topology-map-widget.yml | 46 +++++ .../dashboards/CreateDashboard_2652180930.rb | 43 ++++ features/v1/dashboards.feature | 12 ++ .../topology_map_widget.json | 34 +++ lib/datadog_api_client/inflector.rb | 6 + .../models/topology_map_widget_definition.rb | 193 ++++++++++++++++++ .../topology_map_widget_definition_type.rb | 26 +++ .../v1/models/topology_query.rb | 144 +++++++++++++ .../v1/models/topology_query_data_source.rb | 27 +++ .../v1/models/topology_request.rb | 121 +++++++++++ .../v1/models/topology_request_type.rb | 26 +++ .../v1/models/widget_definition.rb | 3 +- 15 files changed, 771 insertions(+), 5 deletions(-) create mode 100644 cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-widget.frozen create mode 100644 cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-widget.yml create mode 100644 examples/v1/dashboards/CreateDashboard_2652180930.rb create mode 100644 features/v1/dashboards_json_payload/topology_map_widget.json create mode 100644 lib/datadog_api_client/v1/models/topology_map_widget_definition.rb create mode 100644 lib/datadog_api_client/v1/models/topology_map_widget_definition_type.rb create mode 100644 lib/datadog_api_client/v1/models/topology_query.rb create mode 100644 lib/datadog_api_client/v1/models/topology_query_data_source.rb create mode 100644 lib/datadog_api_client/v1/models/topology_request.rb create mode 100644 lib/datadog_api_client/v1/models/topology_request_type.rb diff --git a/.apigentools-info b/.apigentools-info index 9b1832594c4f..a8abd5f25dde 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-09 15:07:39.432310", - "spec_repo_commit": "0bdea812" + "regenerated": "2022-09-12 15:21:54.308244", + "spec_repo_commit": "dcd92077" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-09 15:07:39.447908", - "spec_repo_commit": "0bdea812" + "regenerated": "2022-09-12 15:21:54.320601", + "spec_repo_commit": "dcd92077" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index c68593f135f1..d05b721d6954 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -13380,6 +13380,91 @@ components: style: $ref: '#/components/schemas/WidgetRequestStyle' type: object + TopologyMapWidgetDefinition: + description: This widget displays a topology of nodes and edges for different + data sources. It replaces the service map widget. + properties: + custom_links: + description: List of custom links. + items: + $ref: '#/components/schemas/WidgetCustomLink' + type: array + requests: + description: One or more Topology requests. + items: + $ref: '#/components/schemas/TopologyRequest' + minItems: 1 + type: array + title: + description: Title of your widget. + type: string + title_align: + $ref: '#/components/schemas/WidgetTextAlign' + title_size: + description: Size of the title. + type: string + type: + $ref: '#/components/schemas/TopologyMapWidgetDefinitionType' + required: + - type + - requests + type: object + TopologyMapWidgetDefinitionType: + default: topology_map + description: Type of the topology map widget. + enum: + - topology_map + example: topology_map + type: string + x-enum-varnames: + - TOPOLOGY_MAP + TopologyQuery: + description: Query to service-based topology data sources like the service map + or data streams. + properties: + data_source: + $ref: '#/components/schemas/TopologyQueryDataSource' + filters: + description: Your environment and primary tag (or * if enabled for your + account). + example: + - env:prod + - az:us-east + items: + description: Environment or primary tag, generally in a key:value format + type: string + minItems: 1 + type: array + service: + description: Name of the service + example: myService + type: string + type: object + TopologyQueryDataSource: + description: Name of the data source + enum: + - data_streams + - service_map + type: string + x-enum-varnames: + - DATA_STREAMS + - SERVICE_MAP + TopologyRequest: + description: Request that will return nodes and edges to be used by topology + map. + properties: + query: + $ref: '#/components/schemas/TopologyQuery' + request_type: + $ref: '#/components/schemas/TopologyRequestType' + type: object + TopologyRequestType: + description: Widget request type. + enum: + - topology + type: string + x-enum-varnames: + - TOPOLOGY TreeMapColorBy: default: user deprecated: true @@ -16916,6 +17001,7 @@ components: - $ref: '#/components/schemas/TreeMapWidgetDefinition' - $ref: '#/components/schemas/ListStreamWidgetDefinition' - $ref: '#/components/schemas/FunnelWidgetDefinition' + - $ref: '#/components/schemas/TopologyMapWidgetDefinition' type: object WidgetDisplayType: description: Type of display to use for the request. diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-widget.frozen b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-widget.frozen new file mode 100644 index 000000000000..32436c666f0e --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-widget.frozen @@ -0,0 +1 @@ +2022-09-12T15:16:05.847Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-widget.yml b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-widget.yml new file mode 100644 index 000000000000..afd3531cf92d --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-widget.yml @@ -0,0 +1,46 @@ +http_interactions: +- recorded_at: Mon, 12 Sep 2022 15:16:05 GMT + request: + body: + encoding: UTF-8 + string: '{"description":"","is_read_only":false,"layout_type":"free","notify_list":[],"template_variables":[],"title":"Test-Create_a_new_dashboard_with_topology_map_widget-1662995765","widgets":[{"definition":{"requests":[{"query":{"data_source":"service_map","filters":["env:none","environment:*"],"service":""},"request_type":"topology"}],"title":"","title_align":"left","title_size":"16","type":"topology_map"},"layout":{"height":15,"width":47,"x":0,"y":0}}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard + response: + body: + encoding: UTF-8 + string: '{"notify_list":[],"description":"","restricted_roles":[],"author_name":null,"template_variables":[],"is_read_only":false,"id":"8mx-5gx-wjm","title":"Test-Create_a_new_dashboard_with_topology_map_widget-1662995765","url":"/dashboard/8mx-5gx-wjm/test-createanewdashboardwithtopologymapwidget-1662995765","created_at":"2022-09-12T15:16:06.040625+00:00","modified_at":"2022-09-12T15:16:06.040625+00:00","author_handle":"frog@datadoghq.com","widgets":[{"definition":{"type":"topology_map","requests":[{"query":{"data_source":"service_map","service":"","filters":["env:none","environment:*"]},"request_type":"topology"}],"title_align":"left","title_size":"16","title":""},"layout":{"y":0,"width":47,"x":0,"height":15},"id":1383483616434400}],"layout_type":"free"} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Mon, 12 Sep 2022 15:16:05 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/8mx-5gx-wjm + response: + body: + encoding: UTF-8 + string: '{"deleted_dashboard_id":"8mx-5gx-wjm"} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v1/dashboards/CreateDashboard_2652180930.rb b/examples/v1/dashboards/CreateDashboard_2652180930.rb new file mode 100644 index 000000000000..fb75c157fb8a --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_2652180930.rb @@ -0,0 +1,43 @@ +# Create a new dashboard with topology_map widget + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::DashboardsAPI.new + +body = DatadogAPIClient::V1::Dashboard.new({ + title: "Example-Create_a_new_dashboard_with_topology_map_widget", + description: "", + widgets: [ + DatadogAPIClient::V1::Widget.new({ + layout: DatadogAPIClient::V1::WidgetLayout.new({ + x: 0, + y: 0, + width: 47, + height: 15, + }), + definition: DatadogAPIClient::V1::TopologyMapWidgetDefinition.new({ + title: "", + title_size: "16", + title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT, + type: DatadogAPIClient::V1::TopologyMapWidgetDefinitionType::TOPOLOGY_MAP, + requests: [ + DatadogAPIClient::V1::TopologyRequest.new({ + request_type: DatadogAPIClient::V1::TopologyRequestType::TOPOLOGY, + query: DatadogAPIClient::V1::TopologyQuery.new({ + data_source: DatadogAPIClient::V1::TopologyQueryDataSource::SERVICE_MAP, + service: "", + filters: [ + "env:none", + "environment:*", + ], + }), + }), + ], + }), + }), + ], + template_variables: [], + layout_type: DatadogAPIClient::V1::DashboardLayoutType::FREE, + is_read_only: false, + notify_list: [], +}) +p api_instance.create_dashboard(body) diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index f9a90ee42c2b..ef0406843d30 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -432,6 +432,18 @@ Feature: Dashboards Then the response status is 200 OK And the response "widgets[0].definition.type" is equal to "toplist" + @team:DataDog/dashboards + Scenario: Create a new dashboard with topology_map widget + Given new "CreateDashboard" request + And body from file "dashboards_json_payload/topology_map_widget.json" + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "topology_map" + And the response "widgets[0].definition.requests[0].request_type" is equal to "topology" + And the response "widgets[0].definition.requests[0].query.data_source" is equal to "service_map" + And the response "widgets[0].definition.requests[0].query.service" is equal to "" + And the response "widgets[0].definition.requests[0].query.filters" is equal to ["env:none","environment:*"] + @team:DataDog/dashboards Scenario: Create a new dashboard with trace_service widget Given new "CreateDashboard" request diff --git a/features/v1/dashboards_json_payload/topology_map_widget.json b/features/v1/dashboards_json_payload/topology_map_widget.json new file mode 100644 index 000000000000..e3cf88351828 --- /dev/null +++ b/features/v1/dashboards_json_payload/topology_map_widget.json @@ -0,0 +1,34 @@ +{ + "title": "{{ unique }}", + "description": "", + "widgets": [ + { + "layout": { + "x": 0, + "y": 0, + "width": 47, + "height": 15 + }, + "definition": { + "title": "", + "title_size": "16", + "title_align": "left", + "type": "topology_map", + "requests": [ + { + "request_type": "topology", + "query": { + "data_source": "service_map", + "service": "", + "filters": ["env:none", "environment:*"] + } + } + ] + } + } + ], + "template_variables": [], + "layout_type": "free", + "is_read_only": false, + "notify_list": [] +} diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 53111b3890f5..fe7f7c3fa087 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -579,6 +579,12 @@ def overrides "v1.toplist_widget_definition" => "ToplistWidgetDefinition", "v1.toplist_widget_definition_type" => "ToplistWidgetDefinitionType", "v1.toplist_widget_request" => "ToplistWidgetRequest", + "v1.topology_map_widget_definition" => "TopologyMapWidgetDefinition", + "v1.topology_map_widget_definition_type" => "TopologyMapWidgetDefinitionType", + "v1.topology_query" => "TopologyQuery", + "v1.topology_query_data_source" => "TopologyQueryDataSource", + "v1.topology_request" => "TopologyRequest", + "v1.topology_request_type" => "TopologyRequestType", "v1.tree_map_color_by" => "TreeMapColorBy", "v1.tree_map_group_by" => "TreeMapGroupBy", "v1.tree_map_size_by" => "TreeMapSizeBy", diff --git a/lib/datadog_api_client/v1/models/topology_map_widget_definition.rb b/lib/datadog_api_client/v1/models/topology_map_widget_definition.rb new file mode 100644 index 000000000000..e494047d7dac --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_widget_definition.rb @@ -0,0 +1,193 @@ +=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 + # This widget displays a topology of nodes and edges for different data sources. It replaces the service map widget. + class TopologyMapWidgetDefinition + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # List of custom links. + attr_accessor :custom_links + + # One or more Topology requests. + attr_accessor :requests + + # Title of your 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 topology map widget. + attr_accessor :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'custom_links' => :'custom_links', + :'requests' => :'requests', + :'title' => :'title', + :'title_align' => :'title_align', + :'title_size' => :'title_size', + :'type' => :'type' + } + end + + # Returns all the JSON keys this model knows about + # @!visibility private + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'custom_links' => :'Array', + :'requests' => :'Array', + :'title' => :'String', + :'title_align' => :'WidgetTextAlign', + :'title_size' => :'String', + :'type' => :'TopologyMapWidgetDefinitionType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::TopologyMapWidgetDefinition` 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::TopologyMapWidgetDefinition`. 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?(:'custom_links') + if (value = attributes[:'custom_links']).is_a?(Array) + self.custom_links = value + end + end + + if attributes.key?(:'requests') + if (value = attributes[:'requests']).is_a?(Array) + self.requests = value + end + 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'] + else + self.type = 'topology_map' + 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 @requests.length < 1 + 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 + if requests.length < 1 + fail ArgumentError, 'invalid value for "requests", number of items must be greater than or equal to 1.' + 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 + + # 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 && + requests == o.requests && + title == o.title && + title_align == o.title_align && + title_size == o.title_size && + type == o.type + end + + # @see the `==` method + # @param o [Object] Object to be compared + # @!visibility private + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [custom_links, requests, title, title_align, title_size, type].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_widget_definition_type.rb b/lib/datadog_api_client/v1/models/topology_map_widget_definition_type.rb new file mode 100644 index 000000000000..03ceee1304b3 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_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 topology map widget. + class TopologyMapWidgetDefinitionType + include BaseEnumModel + + TOPOLOGY_MAP = "topology_map".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/topology_query.rb b/lib/datadog_api_client/v1/models/topology_query.rb new file mode 100644 index 000000000000..1d187f8b36db --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_query.rb @@ -0,0 +1,144 @@ +=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 to service-based topology data sources like the service map or data streams. + class TopologyQuery + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # Name of the data source + attr_accessor :data_source + + # Your environment and primary tag (or * if enabled for your account). + attr_accessor :filters + + # Name of the service + attr_accessor :service + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_source' => :'data_source', + :'filters' => :'filters', + :'service' => :'service' + } + end + + # Returns all the JSON keys this model knows about + # @!visibility private + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_source' => :'TopologyQueryDataSource', + :'filters' => :'Array', + :'service' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::TopologyQuery` 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::TopologyQuery`. 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?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'filters') + if (value = attributes[:'filters']).is_a?(Array) + self.filters = value + end + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + 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 !@filters.nil? && @filters.length < 1 + true + end + + # Custom attribute writer method with validation + # @param filters [Object] Object to be assigned + # @!visibility private + def filters=(filters) + if !filters.nil? && filters.length < 1 + fail ArgumentError, 'invalid value for "filters", number of items must be greater than or equal to 1.' + end + @filters = filters + 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 && + filters == o.filters && + service == o.service + end + + # @see the `==` method + # @param o [Object] Object to be compared + # @!visibility private + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_source, filters, service].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_query_data_source.rb b/lib/datadog_api_client/v1/models/topology_query_data_source.rb new file mode 100644 index 000000000000..a10175b21452 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_query_data_source.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 + # Name of the data source + class TopologyQueryDataSource + include BaseEnumModel + + DATA_STREAMS = "data_streams".freeze + SERVICE_MAP = "service_map".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/topology_request.rb b/lib/datadog_api_client/v1/models/topology_request.rb new file mode 100644 index 000000000000..810093ef42a6 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_request.rb @@ -0,0 +1,121 @@ +=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 that will return nodes and edges to be used by topology map. + class TopologyRequest + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # Query to service-based topology data sources like the service map or data streams. + attr_accessor :query + + # Widget request type. + attr_accessor :request_type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'query' => :'query', + :'request_type' => :'request_type' + } + end + + # Returns all the JSON keys this model knows about + # @!visibility private + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'query' => :'TopologyQuery', + :'request_type' => :'TopologyRequestType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::TopologyRequest` 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::TopologyRequest`. 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?(:'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? + true + 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 && + query == o.query && + request_type == o.request_type + end + + # @see the `==` method + # @param o [Object] Object to be compared + # @!visibility private + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [query, request_type].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_request_type.rb b/lib/datadog_api_client/v1/models/topology_request_type.rb new file mode 100644 index 000000000000..591f3a4d29ff --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_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 + # Widget request type. + class TopologyRequestType + include BaseEnumModel + + TOPOLOGY = "topology".freeze + 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 ed12f38dc8c2..fdec0b6240d8 100644 --- a/lib/datadog_api_client/v1/models/widget_definition.rb +++ b/lib/datadog_api_client/v1/models/widget_definition.rb @@ -54,7 +54,8 @@ def openapi_one_of :'ToplistWidgetDefinition', :'TreeMapWidgetDefinition', :'ListStreamWidgetDefinition', - :'FunnelWidgetDefinition' + :'FunnelWidgetDefinition', + :'TopologyMapWidgetDefinition' ] end # Builds the object