From d13df238c459dd19d47d0fd162968c7837d366f2 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 9 Jul 2026 19:04:45 +0000 Subject: [PATCH] Regenerate client from commit 2a28cbe of spec repo --- .generator/schemas/v1/openapi.yaml | 121 ++++++++-- ...th-topology-map-data-streams-widget.frozen | 1 + ...-with-topology-map-data-streams-widget.yml | 43 ++++ .../dashboards/CreateDashboard_2652180930.rb | 8 +- .../dashboards/CreateDashboard_2815497946.rb | 42 ++++ features/v1/dashboards.feature | 13 ++ .../topology_map_widget_data_streams.json | 34 +++ lib/datadog_api_client/inflector.rb | 11 +- .../models/topology_map_widget_definition.rb | 211 +++--------------- ...logy_map_widget_definition_data_streams.rb | 187 ++++++++++++++++ ...ology_map_widget_definition_service_map.rb | 187 ++++++++++++++++ .../v1/models/topology_query_data_streams.rb | 156 +++++++++++++ ...opology_query_data_streams_data_source.rb} | 5 +- .../v1/models/topology_query_service_map.rb | 156 +++++++++++++ .../topology_query_service_map_data_source.rb | 26 +++ ...ry.rb => topology_request_data_streams.rb} | 66 ++---- ...est.rb => topology_request_service_map.rb} | 10 +- 17 files changed, 1025 insertions(+), 252 deletions(-) create mode 100644 cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-data-streams-widget.frozen create mode 100644 cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-data-streams-widget.yml create mode 100644 examples/v1/dashboards/CreateDashboard_2815497946.rb create mode 100644 features/v1/dashboards_json_payload/topology_map_widget_data_streams.json create mode 100644 lib/datadog_api_client/v1/models/topology_map_widget_definition_data_streams.rb create mode 100644 lib/datadog_api_client/v1/models/topology_map_widget_definition_service_map.rb create mode 100644 lib/datadog_api_client/v1/models/topology_query_data_streams.rb rename lib/datadog_api_client/v1/models/{topology_query_data_source.rb => topology_query_data_streams_data_source.rb} (86%) create mode 100644 lib/datadog_api_client/v1/models/topology_query_service_map.rb create mode 100644 lib/datadog_api_client/v1/models/topology_query_service_map_data_source.rb rename lib/datadog_api_client/v1/models/{topology_query.rb => topology_request_data_streams.rb} (60%) rename lib/datadog_api_client/v1/models/{topology_request.rb => topology_request_service_map.rb} (91%) diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 455b80b93a70..1c8fca287a40 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -21724,6 +21724,46 @@ components: type: object TopologyMapWidgetDefinition: description: This widget displays a topology of nodes and edges for different data sources. It replaces the service map widget. + oneOf: + - $ref: "#/components/schemas/TopologyMapWidgetDefinitionDataStreams" + - $ref: "#/components/schemas/TopologyMapWidgetDefinitionServiceMap" + TopologyMapWidgetDefinitionDataStreams: + additionalProperties: false + description: Topology map widget backed by the data streams data source. + properties: + custom_links: + description: List of custom links. + items: + $ref: "#/components/schemas/WidgetCustomLink" + type: array + description: + description: The description of the widget. + type: string + requests: + description: One Topology request. + items: + $ref: "#/components/schemas/TopologyRequestDataStreams" + minItems: 1 + type: array + time: + $ref: "#/components/schemas/WidgetTime" + 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 + TopologyMapWidgetDefinitionServiceMap: + additionalProperties: false + description: Topology map widget backed by the service map data source. properties: custom_links: description: List of custom links. @@ -21734,11 +21774,13 @@ components: description: The description of the widget. type: string requests: - description: One or more Topology requests. + description: One Topology request. items: - $ref: "#/components/schemas/TopologyRequest" + $ref: "#/components/schemas/TopologyRequestServiceMap" minItems: 1 type: array + time: + $ref: "#/components/schemas/WidgetTime" title: description: Title of your widget. type: string @@ -21762,38 +21804,89 @@ components: type: string x-enum-varnames: - TOPOLOGY_MAP - TopologyQuery: - description: Query to service-based topology data sources like the service map or data streams. + TopologyQueryDataStreams: + additionalProperties: false + description: Query to the data streams topology data source. properties: data_source: - $ref: "#/components/schemas/TopologyQueryDataSource" + $ref: "#/components/schemas/TopologyQueryDataStreamsDataSource" 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 + description: Environment or primary tag, generally in a key:value format. type: string minItems: 1 type: array + query_string: + description: A search string for filtering services. When set, this replaces the `service` field. + example: "service:myservice" + type: string service: - description: Name of the service - example: myService + description: (deprecated) Name of the service. Leave this empty and use query_string instead. + example: myservice type: string + required: + - data_source + - filters + - service type: object - TopologyQueryDataSource: - description: Name of the data source + TopologyQueryDataStreamsDataSource: + description: Name of the data source. enum: - data_streams - - service_map + example: data_streams type: string x-enum-varnames: - DATA_STREAMS + TopologyQueryServiceMap: + additionalProperties: false + description: Query to the service map topology data source. + properties: + data_source: + $ref: "#/components/schemas/TopologyQueryServiceMapDataSource" + 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 + query_string: + description: A search string for filtering services. When set, this replaces the `service` field. + example: "service:myservice" + type: string + service: + description: (deprecated) Name of the service. Leave this empty and use query_string instead. + example: myservice + type: string + required: + - data_source + - filters + - service + type: object + TopologyQueryServiceMapDataSource: + description: Name of the data source. + enum: + - service_map + example: service_map + type: string + x-enum-varnames: - SERVICE_MAP - TopologyRequest: - description: Request that will return nodes and edges to be used by topology map. + TopologyRequestDataStreams: + description: Request that returns nodes and edges from the data streams data source. + properties: + query: + $ref: "#/components/schemas/TopologyQueryDataStreams" + request_type: + $ref: "#/components/schemas/TopologyRequestType" + type: object + TopologyRequestServiceMap: + description: Request that returns nodes and edges from the service map data source. properties: query: - $ref: "#/components/schemas/TopologyQuery" + $ref: "#/components/schemas/TopologyQueryServiceMap" request_type: $ref: "#/components/schemas/TopologyRequestType" type: object diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-data-streams-widget.frozen b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-data-streams-widget.frozen new file mode 100644 index 000000000000..21a59912fa38 --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-data-streams-widget.frozen @@ -0,0 +1 @@ +2026-03-20T18:16:51.929Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-data-streams-widget.yml b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-data-streams-widget.yml new file mode 100644 index 000000000000..a3b11a66d08d --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-topology-map-data-streams-widget.yml @@ -0,0 +1,43 @@ +http_interactions: +- recorded_at: Fri, 20 Mar 2026 18:16:51 GMT + request: + body: + encoding: UTF-8 + string: '{"description":"","layout_type":"free","notify_list":[],"template_variables":[],"title":"Test-Create_a_new_dashboard_with_topology_map_data_streams_widget-1774030611","widgets":[{"definition":{"requests":[{"query":{"data_source":"data_streams","filters":["env:prod"],"query_string":"service:myservice","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: '{"id":"whr-253-7we","title":"Test-Create_a_new_dashboard_with_topology_map_data_streams_widget-1774030611","description":"","author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"free","url":"/dashboard/whr-253-7we/test-createanewdashboardwithtopologymapdatastreamswidget-1774030611","template_variables":[],"widgets":[{"definition":{"requests":[{"query":{"data_source":"data_streams","filters":["env:prod"],"query_string":"service:myservice","service":""},"request_type":"topology"}],"title":"","title_align":"left","title_size":"16","type":"topology_map"},"layout":{"height":15,"width":47,"x":0,"y":0},"id":1843670487553482}],"notify_list":[],"created_at":"2026-03-20T18:16:52.209473+00:00","modified_at":"2026-03-20T18:16:52.209473+00:00","restricted_roles":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Fri, 20 Mar 2026 18:16:51 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/whr-253-7we + response: + body: + encoding: UTF-8 + string: '{"deleted_dashboard_id":"whr-253-7we"}' + 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 index 964876583be3..e22eb2ab6e43 100644 --- a/examples/v1/dashboards/CreateDashboard_2652180930.rb +++ b/examples/v1/dashboards/CreateDashboard_2652180930.rb @@ -14,16 +14,16 @@ width: 47, height: 15, }), - definition: DatadogAPIClient::V1::TopologyMapWidgetDefinition.new({ + definition: DatadogAPIClient::V1::TopologyMapWidgetDefinitionServiceMap.new({ title: "", title_size: "16", title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT, type: DatadogAPIClient::V1::TopologyMapWidgetDefinitionType::TOPOLOGY_MAP, requests: [ - DatadogAPIClient::V1::TopologyRequest.new({ + DatadogAPIClient::V1::TopologyRequestServiceMap.new({ request_type: DatadogAPIClient::V1::TopologyRequestType::TOPOLOGY, - query: DatadogAPIClient::V1::TopologyQuery.new({ - data_source: DatadogAPIClient::V1::TopologyQueryDataSource::SERVICE_MAP, + query: DatadogAPIClient::V1::TopologyQueryServiceMap.new({ + data_source: DatadogAPIClient::V1::TopologyQueryServiceMapDataSource::SERVICE_MAP, service: "", filters: [ "env:none", diff --git a/examples/v1/dashboards/CreateDashboard_2815497946.rb b/examples/v1/dashboards/CreateDashboard_2815497946.rb new file mode 100644 index 000000000000..3c40cb495aa5 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_2815497946.rb @@ -0,0 +1,42 @@ +# Create a new dashboard with topology_map data_streams widget + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::DashboardsAPI.new + +body = DatadogAPIClient::V1::Dashboard.new({ + title: "Example-Dashboard", + description: "", + widgets: [ + DatadogAPIClient::V1::Widget.new({ + layout: DatadogAPIClient::V1::WidgetLayout.new({ + x: 0, + y: 0, + width: 47, + height: 15, + }), + definition: DatadogAPIClient::V1::TopologyMapWidgetDefinitionDataStreams.new({ + title: "", + title_size: "16", + title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT, + type: DatadogAPIClient::V1::TopologyMapWidgetDefinitionType::TOPOLOGY_MAP, + requests: [ + DatadogAPIClient::V1::TopologyRequestDataStreams.new({ + request_type: DatadogAPIClient::V1::TopologyRequestType::TOPOLOGY, + query: DatadogAPIClient::V1::TopologyQueryDataStreams.new({ + data_source: DatadogAPIClient::V1::TopologyQueryDataStreamsDataSource::DATA_STREAMS, + service: "", + filters: [ + "env:prod", + ], + query_string: "service:myservice", + }), + }), + ], + }), + }), + ], + template_variables: [], + layout_type: DatadogAPIClient::V1::DashboardLayoutType::FREE, + notify_list: [], +}) +p api_instance.create_dashboard(body) diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index 28e57ec5e2a7..984a718679bb 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -1128,6 +1128,19 @@ Feature: Dashboards And the response "widgets[0].definition.requests[0].sort.order_by[0].type" is equal to "formula" And the response "widgets[0].definition.requests[0].sort.order_by[0].index" is equal to 0 + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with topology_map data_streams widget + Given new "CreateDashboard" request + And body from file "dashboards_json_payload/topology_map_widget_data_streams.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 "data_streams" + 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:prod"] + And the response "widgets[0].definition.requests[0].query.query_string" is equal to "service:myservice" + @team:DataDog/dashboards-backend Scenario: Create a new dashboard with topology_map widget Given new "CreateDashboard" request diff --git a/features/v1/dashboards_json_payload/topology_map_widget_data_streams.json b/features/v1/dashboards_json_payload/topology_map_widget_data_streams.json new file mode 100644 index 000000000000..f454b974e6be --- /dev/null +++ b/features/v1/dashboards_json_payload/topology_map_widget_data_streams.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": "data_streams", + "service": "", + "filters": ["env:prod"], + "query_string": "service:myservice" + } + } + ] + } + } + ], + "template_variables": [], + "layout_type": "free", + "notify_list": [] +} diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index bb489f2e6b16..93f67579af89 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -981,10 +981,15 @@ def overrides "v1.toplist_widget_stacked_type" => "ToplistWidgetStackedType", "v1.toplist_widget_style" => "ToplistWidgetStyle", "v1.topology_map_widget_definition" => "TopologyMapWidgetDefinition", + "v1.topology_map_widget_definition_data_streams" => "TopologyMapWidgetDefinitionDataStreams", + "v1.topology_map_widget_definition_service_map" => "TopologyMapWidgetDefinitionServiceMap", "v1.topology_map_widget_definition_type" => "TopologyMapWidgetDefinitionType", - "v1.topology_query" => "TopologyQuery", - "v1.topology_query_data_source" => "TopologyQueryDataSource", - "v1.topology_request" => "TopologyRequest", + "v1.topology_query_data_streams" => "TopologyQueryDataStreams", + "v1.topology_query_data_streams_data_source" => "TopologyQueryDataStreamsDataSource", + "v1.topology_query_service_map" => "TopologyQueryServiceMap", + "v1.topology_query_service_map_data_source" => "TopologyQueryServiceMapDataSource", + "v1.topology_request_data_streams" => "TopologyRequestDataStreams", + "v1.topology_request_service_map" => "TopologyRequestServiceMap", "v1.topology_request_type" => "TopologyRequestType", "v1.tree_map_color_by" => "TreeMapColorBy", "v1.tree_map_group_by" => "TreeMapGroupBy", 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 index 316d2d835d30..ac0c2916adc7 100644 --- a/lib/datadog_api_client/v1/models/topology_map_widget_definition.rb +++ b/lib/datadog_api_client/v1/models/topology_map_widget_definition.rb @@ -18,185 +18,46 @@ 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 - - # List of custom links. - attr_accessor :custom_links - - # The description of the widget. - attr_accessor :description - - # One or more Topology requests. - attr_reader :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_reader :type - - 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', - :'requests' => :'requests', - :'title' => :'title', - :'title_align' => :'title_align', - :'title_size' => :'title_size', - :'type' => :'type' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'custom_links' => :'Array', - :'description' => :'String', - :'requests' => :'Array', - :'title' => :'String', - :'title_align' => :'WidgetTextAlign', - :'title_size' => :'String', - :'type' => :'TopologyMapWidgetDefinitionType' - } - 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 - - 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?(:'requests') - if (value = attributes[:'requests']).is_a?(Array) - self.requests = value + module TopologyMapWidgetDefinition + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'TopologyMapWidgetDefinitionDataStreams', + :'TopologyMapWidgetDefinitionServiceMap' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end 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'] - 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 - - # 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}")) + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) 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 && - requests == o.requests && - title == o.title && - title_align == o.title_align && - title_size == o.title_size && - type == o.type && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [custom_links, description, requests, title, title_align, title_size, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v1/models/topology_map_widget_definition_data_streams.rb b/lib/datadog_api_client/v1/models/topology_map_widget_definition_data_streams.rb new file mode 100644 index 000000000000..04758facd88b --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_widget_definition_data_streams.rb @@ -0,0 +1,187 @@ +=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 + # Topology map widget backed by the data streams data source. + class TopologyMapWidgetDefinitionDataStreams + include BaseGenericModel + + # List of custom links. + attr_accessor :custom_links + + # The description of the widget. + attr_accessor :description + + # One Topology request. + attr_reader :requests + + # Time setting for the widget. + attr_accessor :time + + # 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_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'custom_links' => :'custom_links', + :'description' => :'description', + :'requests' => :'requests', + :'time' => :'time', + :'title' => :'title', + :'title_align' => :'title_align', + :'title_size' => :'title_size', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'custom_links' => :'Array', + :'description' => :'String', + :'requests' => :'Array', + :'time' => :'WidgetTime', + :'title' => :'String', + :'title_align' => :'WidgetTextAlign', + :'title_size' => :'String', + :'type' => :'TopologyMapWidgetDefinitionType' + } + 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::TopologyMapWidgetDefinitionDataStreams` 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::TopologyMapWidgetDefinitionDataStreams`. 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?(:'description') + self.description = attributes[:'description'] + 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 + 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 && + description == o.description && + requests == o.requests && + time == o.time && + title == o.title && + title_align == o.title_align && + title_size == o.title_size && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [custom_links, description, requests, time, title, title_align, title_size, type].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_widget_definition_service_map.rb b/lib/datadog_api_client/v1/models/topology_map_widget_definition_service_map.rb new file mode 100644 index 000000000000..1ee689203636 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_widget_definition_service_map.rb @@ -0,0 +1,187 @@ +=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 + # Topology map widget backed by the service map data source. + class TopologyMapWidgetDefinitionServiceMap + include BaseGenericModel + + # List of custom links. + attr_accessor :custom_links + + # The description of the widget. + attr_accessor :description + + # One Topology request. + attr_reader :requests + + # Time setting for the widget. + attr_accessor :time + + # 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_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'custom_links' => :'custom_links', + :'description' => :'description', + :'requests' => :'requests', + :'time' => :'time', + :'title' => :'title', + :'title_align' => :'title_align', + :'title_size' => :'title_size', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'custom_links' => :'Array', + :'description' => :'String', + :'requests' => :'Array', + :'time' => :'WidgetTime', + :'title' => :'String', + :'title_align' => :'WidgetTextAlign', + :'title_size' => :'String', + :'type' => :'TopologyMapWidgetDefinitionType' + } + 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::TopologyMapWidgetDefinitionServiceMap` 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::TopologyMapWidgetDefinitionServiceMap`. 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?(:'description') + self.description = attributes[:'description'] + 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 + 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 && + description == o.description && + requests == o.requests && + time == o.time && + title == o.title && + title_align == o.title_align && + title_size == o.title_size && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [custom_links, description, requests, time, title, title_align, title_size, type].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_query_data_streams.rb b/lib/datadog_api_client/v1/models/topology_query_data_streams.rb new file mode 100644 index 000000000000..26edba53bb02 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_query_data_streams.rb @@ -0,0 +1,156 @@ +=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 the data streams topology data source. + class TopologyQueryDataStreams + include BaseGenericModel + + # Name of the data source. + attr_reader :data_source + + # Your environment and primary tag (or * if enabled for your account). + attr_reader :filters + + # A search string for filtering services. When set, this replaces the `service` field. + attr_accessor :query_string + + # (deprecated) Name of the service. Leave this empty and use query_string instead. + attr_reader :service + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_source' => :'data_source', + :'filters' => :'filters', + :'query_string' => :'query_string', + :'service' => :'service' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_source' => :'TopologyQueryDataStreamsDataSource', + :'filters' => :'Array', + :'query_string' => :'String', + :'service' => :'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::TopologyQueryDataStreams` 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::TopologyQueryDataStreams`. 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?(:'query_string') + self.query_string = attributes[:'query_string'] + 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 @data_source.nil? + return false if @filters.nil? + return false if @filters.length < 1 + return false if @service.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 filters [Object] Object to be assigned + # @!visibility private + def filters=(filters) + if filters.nil? + fail ArgumentError, 'invalid value for "filters", filters cannot be nil.' + end + if filters.length < 1 + fail ArgumentError, 'invalid value for "filters", number of items must be greater than or equal to 1.' + end + @filters = filters + end + + # Custom attribute writer method with validation + # @param service [Object] Object to be assigned + # @!visibility private + def service=(service) + if service.nil? + fail ArgumentError, 'invalid value for "service", service cannot be nil.' + end + @service = service + 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 && + query_string == o.query_string && + service == o.service + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_source, filters, query_string, 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_streams_data_source.rb similarity index 86% rename from lib/datadog_api_client/v1/models/topology_query_data_source.rb rename to lib/datadog_api_client/v1/models/topology_query_data_streams_data_source.rb index a10175b21452..aabdcc243509 100644 --- a/lib/datadog_api_client/v1/models/topology_query_data_source.rb +++ b/lib/datadog_api_client/v1/models/topology_query_data_streams_data_source.rb @@ -17,11 +17,10 @@ require 'time' module DatadogAPIClient::V1 - # Name of the data source - class TopologyQueryDataSource + # Name of the data source. + class TopologyQueryDataStreamsDataSource include BaseEnumModel DATA_STREAMS = "data_streams".freeze - SERVICE_MAP = "service_map".freeze end end diff --git a/lib/datadog_api_client/v1/models/topology_query_service_map.rb b/lib/datadog_api_client/v1/models/topology_query_service_map.rb new file mode 100644 index 000000000000..9572c748461f --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_query_service_map.rb @@ -0,0 +1,156 @@ +=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 the service map topology data source. + class TopologyQueryServiceMap + include BaseGenericModel + + # Name of the data source. + attr_reader :data_source + + # Your environment and primary tag (or * if enabled for your account). + attr_reader :filters + + # A search string for filtering services. When set, this replaces the `service` field. + attr_accessor :query_string + + # (deprecated) Name of the service. Leave this empty and use query_string instead. + attr_reader :service + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_source' => :'data_source', + :'filters' => :'filters', + :'query_string' => :'query_string', + :'service' => :'service' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_source' => :'TopologyQueryServiceMapDataSource', + :'filters' => :'Array', + :'query_string' => :'String', + :'service' => :'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::TopologyQueryServiceMap` 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::TopologyQueryServiceMap`. 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?(:'query_string') + self.query_string = attributes[:'query_string'] + 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 @data_source.nil? + return false if @filters.nil? + return false if @filters.length < 1 + return false if @service.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 filters [Object] Object to be assigned + # @!visibility private + def filters=(filters) + if filters.nil? + fail ArgumentError, 'invalid value for "filters", filters cannot be nil.' + end + if filters.length < 1 + fail ArgumentError, 'invalid value for "filters", number of items must be greater than or equal to 1.' + end + @filters = filters + end + + # Custom attribute writer method with validation + # @param service [Object] Object to be assigned + # @!visibility private + def service=(service) + if service.nil? + fail ArgumentError, 'invalid value for "service", service cannot be nil.' + end + @service = service + 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 && + query_string == o.query_string && + service == o.service + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_source, filters, query_string, service].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_query_service_map_data_source.rb b/lib/datadog_api_client/v1/models/topology_query_service_map_data_source.rb new file mode 100644 index 000000000000..7f06567f51a6 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_query_service_map_data_source.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 + # Name of the data source. + class TopologyQueryServiceMapDataSource + include BaseEnumModel + + SERVICE_MAP = "service_map".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/topology_query.rb b/lib/datadog_api_client/v1/models/topology_request_data_streams.rb similarity index 60% rename from lib/datadog_api_client/v1/models/topology_query.rb rename to lib/datadog_api_client/v1/models/topology_request_data_streams.rb index c0e025798220..6896acac09ea 100644 --- a/lib/datadog_api_client/v1/models/topology_query.rb +++ b/lib/datadog_api_client/v1/models/topology_request_data_streams.rb @@ -17,18 +17,15 @@ require 'time' module DatadogAPIClient::V1 - # Query to service-based topology data sources like the service map or data streams. - class TopologyQuery + # Request that returns nodes and edges from the data streams data source. + class TopologyRequestDataStreams include BaseGenericModel - # Name of the data source - attr_accessor :data_source + # Query to the data streams topology data source. + attr_accessor :query - # Your environment and primary tag (or * if enabled for your account). - attr_reader :filters - - # Name of the service - attr_accessor :service + # Widget request type. + attr_accessor :request_type attr_accessor :additional_properties @@ -36,9 +33,8 @@ class TopologyQuery # @!visibility private def self.attribute_map { - :'data_source' => :'data_source', - :'filters' => :'filters', - :'service' => :'service' + :'query' => :'query', + :'request_type' => :'request_type' } end @@ -46,9 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data_source' => :'TopologyQueryDataSource', - :'filters' => :'Array', - :'service' => :'String' + :'query' => :'TopologyQueryDataStreams', + :'request_type' => :'TopologyRequestType' } end @@ -57,7 +52,7 @@ def self.openapi_types # @!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" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::TopologyRequestDataStreams` initialize method" end self.additional_properties = {} @@ -70,37 +65,13 @@ def initialize(attributes = {}) end } - 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 + if attributes.key?(:'query') + self.query = attributes[:'query'] 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.' + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] end - @filters = filters end # Returns the object in the form of hash, with additionalProperties support. @@ -129,9 +100,8 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - data_source == o.data_source && - filters == o.filters && - service == o.service && + query == o.query && + request_type == o.request_type && additional_properties == o.additional_properties end @@ -139,7 +109,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [data_source, filters, service, additional_properties].hash + [query, request_type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v1/models/topology_request.rb b/lib/datadog_api_client/v1/models/topology_request_service_map.rb similarity index 91% rename from lib/datadog_api_client/v1/models/topology_request.rb rename to lib/datadog_api_client/v1/models/topology_request_service_map.rb index def430e23f6a..a62a785cc893 100644 --- a/lib/datadog_api_client/v1/models/topology_request.rb +++ b/lib/datadog_api_client/v1/models/topology_request_service_map.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V1 - # Request that will return nodes and edges to be used by topology map. - class TopologyRequest + # Request that returns nodes and edges from the service map data source. + class TopologyRequestServiceMap include BaseGenericModel - # Query to service-based topology data sources like the service map or data streams. + # Query to the service map topology data source. attr_accessor :query # Widget request type. @@ -42,7 +42,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'query' => :'TopologyQuery', + :'query' => :'TopologyQueryServiceMap', :'request_type' => :'TopologyRequestType' } end @@ -52,7 +52,7 @@ def self.openapi_types # @!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" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::TopologyRequestServiceMap` initialize method" end self.additional_properties = {}