Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33935,6 +33935,21 @@ components:
format: int64
type: integer
type: object
DeviceTagsBySource:
description: Tags associated with a device from a specific source.
properties:
source:
description: The source of the tags.
example: user
type: string
tags:
description: The list of tags for the source.
example: ["tag:test", "tag:testbis"]
items:
description: A tag string in `key:value` format.
type: string
type: array
type: object
DevicesListData:
description: The devices list data
properties:
Expand Down Expand Up @@ -63468,6 +63483,12 @@ components:
ListTagsResponseDataAttributes:
description: The definition of ListTagsResponseDataAttributes object.
properties:
by_source:
description: The list of device tags grouped by source.
items:
$ref: "#/components/schemas/DeviceTagsBySource"
readOnly: true
type: array
tags:
description: The list of tags
example: ["tag:test", "tag:testbis"]
Expand Down Expand Up @@ -173995,6 +174016,20 @@ paths:
content:
application/json:
examples:
by_source:
value:
data:
attributes:
by_source:
- source: user
tags:
- "tag:test"
- "tag:testbis"
- source: snmp
tags:
- "device_ip:1.2.3.4"
id: foiwf7rgw38fh
type: tags
default:
value:
data:
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3036,6 +3036,7 @@ def overrides
"v2.device_attributes" => "DeviceAttributes",
"v2.device_attributes_interface_statuses" => "DeviceAttributesInterfaceStatuses",
"v2.devices_list_data" => "DevicesListData",
"v2.device_tags_by_source" => "DeviceTagsBySource",
"v2.dns_metric_key" => "DnsMetricKey",
"v2.domain_allowlist" => "DomainAllowlist",
"v2.domain_allowlist_attributes" => "DomainAllowlistAttributes",
Expand Down
117 changes: 117 additions & 0 deletions lib/datadog_api_client/v2/models/device_tags_by_source.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
=begin
#Datadog API V2 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::V2
# Tags associated with a device from a specific source.
class DeviceTagsBySource
include BaseGenericModel

# The source of the tags.
attr_accessor :source

# The list of tags for the source.
attr_accessor :tags

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'source' => :'source',
:'tags' => :'tags'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'source' => :'String',
:'tags' => :'Array<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::V2::DeviceTagsBySource` 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?(:'source')
self.source = attributes[:'source']
end

if attributes.key?(:'tags')
if (value = attributes[:'tags']).is_a?(Array)
self.tags = value
end
end
end

# Returns the object in the form of hash, with additionalProperties support.
# @return [Hash] Returns the object in the form of hash
# @!visibility private
def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
if value.nil?
is_nullable = self.class.openapi_nullable.include?(attr)
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
end

hash[param] = _to_hash(value)
end
self.additional_properties.each_pair do |attr, value|
hash[attr] = value
end
hash
end

# Checks equality by comparing each attribute.
# @param o [Object] Object to be compared
# @!visibility private
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
source == o.source &&
tags == o.tags &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[source, tags, additional_properties].hash
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ module DatadogAPIClient::V2
class ListTagsResponseDataAttributes
include BaseGenericModel

# The list of device tags grouped by source.
attr_accessor :by_source

# The list of tags
attr_accessor :tags

Expand All @@ -30,6 +33,7 @@ class ListTagsResponseDataAttributes
# @!visibility private
def self.attribute_map
{
:'by_source' => :'by_source',
:'tags' => :'tags'
}
end
Expand All @@ -38,6 +42,7 @@ def self.attribute_map
# @!visibility private
def self.openapi_types
{
:'by_source' => :'Array<DeviceTagsBySource>',
:'tags' => :'Array<String>'
}
end
Expand All @@ -60,6 +65,12 @@ def initialize(attributes = {})
end
}

if attributes.key?(:'by_source')
if (value = attributes[:'by_source']).is_a?(Array)
self.by_source = value
end
end

if attributes.key?(:'tags')
if (value = attributes[:'tags']).is_a?(Array)
self.tags = value
Expand Down Expand Up @@ -93,6 +104,7 @@ def to_hash
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
by_source == o.by_source &&
tags == o.tags &&
additional_properties == o.additional_properties
end
Expand All @@ -101,7 +113,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[tags, additional_properties].hash
[by_source, tags, additional_properties].hash
end
end
end
Loading