diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4dd4eb9c3140..e665398f2cad 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -58798,13 +58798,15 @@ components: - token type: object Metric: - description: Object for a single metric tag configuration. + description: Object for a single metric. example: id: metric.foo.bar type: metrics properties: id: $ref: "#/components/schemas/MetricName" + relationships: + $ref: "#/components/schemas/MetricRelationships" type: $ref: "#/components/schemas/MetricType" type: object @@ -59341,12 +59343,12 @@ components: description: Object containing the definition of a metric's ingested and indexed volume. properties: indexed_volume: - description: Indexed volume for the given metric. + description: Estimated average hourly number of indexed time series for the given metric over the last hour. For organizations on Metric Name Pricing, this represents the estimated sum of indexed data points over the last hour. example: 10 format: int64 type: integer ingested_volume: - description: Ingested volume for the given metric. + description: Estimated average hourly number of ingested time series for the given metric over the last hour. This value is 0 for metrics not configured with Metrics Without Limits. For organizations on Metric Name Pricing, this represents the estimated sum of ingested data points over the last hour. example: 20 format: int64 type: integer @@ -59523,6 +59525,12 @@ components: format: double type: number type: object + MetricRelationships: + description: Relationships for a metric. + properties: + metric_volumes: + $ref: "#/components/schemas/MetricVolumesRelationship" + type: object MetricResource: description: Metric resource. example: {name: "dummyhost", type: "host"} @@ -59715,6 +59723,8 @@ components: $ref: "#/components/schemas/MetricTagConfigurationAttributes" id: $ref: "#/components/schemas/MetricName" + relationships: + $ref: "#/components/schemas/MetricRelationships" type: $ref: "#/components/schemas/MetricTagConfigurationType" type: object @@ -59927,6 +59937,20 @@ components: oneOf: - $ref: "#/components/schemas/MetricDistinctVolume" - $ref: "#/components/schemas/MetricIngestedIndexedVolume" + MetricVolumesRelationship: + description: Relationship to a metric volume included in the response. + properties: + data: + $ref: "#/components/schemas/MetricVolumesRelationshipData" + type: object + MetricVolumesRelationshipData: + description: Relationship data for a metric volume. + properties: + id: + $ref: "#/components/schemas/MetricName" + type: + $ref: "#/components/schemas/MetricIngestedIndexedVolumeType" + type: object MetricVolumesResponse: description: Response object which includes a single metric's volume. properties: @@ -59972,6 +59996,11 @@ components: items: $ref: "#/components/schemas/MetricsAndMetricTagConfigurations" type: array + included: + description: Array of metric volume resources included when requested with `include=metric_volumes`. + items: + $ref: "#/components/schemas/MetricIngestedIndexedVolume" + type: array links: $ref: "#/components/schemas/MetricsListResponseLinks" meta: @@ -152116,13 +152145,20 @@ paths: Query parameters use bracket notation (for example, `filter[tags]`, `filter[queried][window][seconds]`). Pass them as standard URL query strings, URL-encoding the brackets if your client does not handle them. For example: `GET /api/v2/metrics?filter[tags]=env:prod&window[seconds]=86400&page[size]=500`. operationId: ListTagConfigurations parameters: - - description: Only return custom metrics that have been configured with Metrics Without Limits. + - description: Only return custom metrics that have been configured (`true`) or not configured (`false`) with Metrics Without Limits. example: true in: query name: filter[configured] required: false schema: type: boolean + - description: Only return metrics that are eligible (`true`) or ineligible (`false`) for configuration with Metrics Without Limits. + example: true + in: query + name: filter[is_configurable] + required: false + schema: + type: boolean - description: Only return metrics that have the given tag key(s) in their Metrics Without Limits configuration (included or excluded). example: "app,env" in: query @@ -152180,6 +152216,20 @@ paths: required: false schema: type: boolean + - description: Include related resources in the response. Set to `metric_volumes` to include indexed and ingested volume counts for each metric. + example: metric_volumes + in: query + name: include + required: false + schema: + type: string + - description: "Sort results by metric volume. Prefix a key with `-` for descending order. Supported keys: `metric_volumes.indexed_volume`, `metric_volumes.ingested_volume`, `metric_volumes.indexed_volume_delta`, `metric_volumes.ingested_volume_delta`. Requires a paginated request (`page[size]` or `page[cursor]`)." + example: "-metric_volumes.indexed_volume" + in: query + name: sort + required: false + schema: + type: string - description: |- Only return metrics that have been actively reporting in the specified window. The default value is 3600 seconds (1 hour), the maximum value is 2,592,000 seconds (30 days), and the minimum value is 1 second. example: 3600 @@ -152221,6 +152271,34 @@ paths: meta: pagination: next_cursor: + with_metric_volumes: + value: + data: + - id: user.custom.cpu.usage + relationships: + metric_volumes: + data: + id: user.custom.cpu.usage + type: metric_volumes + type: metrics + - id: user.custom.mem.usage + relationships: + metric_volumes: + data: + id: user.custom.mem.usage + type: metric_volumes + type: metrics + included: + - attributes: + indexed_volume: 1000 + ingested_volume: 456 + id: user.custom.cpu.usage + type: metric_volumes + - attributes: + indexed_volume: 250 + ingested_volume: 1011 + id: user.custom.mem.usage + type: metric_volumes schema: $ref: "#/components/schemas/MetricsAndMetricTagConfigurationsResponse" description: Success diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 662beec37ec5..d1f30a45893c 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4099,6 +4099,7 @@ }, "v2.ListTagConfigurations" => { "filter_configured" => "Boolean", + "filter_is_configurable" => "Boolean", "filter_tags_configured" => "String", "filter_metric_type" => "MetricTagConfigurationMetricTypeCategory", "filter_include_percentiles" => "Boolean", @@ -4106,6 +4107,8 @@ "filter_queried_window_seconds" => "Integer", "filter_tags" => "String", "filter_related_assets" => "Boolean", + "include" => "String", + "sort" => "String", "window_seconds" => "Integer", "page_size" => "Integer", "page_cursor" => "String", diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index e81f7f5f7e86..51b7bbb795ab 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4632,6 +4632,7 @@ def overrides "v2.metric_pagination_meta" => "MetricPaginationMeta", "v2.metric_payload" => "MetricPayload", "v2.metric_point" => "MetricPoint", + "v2.metric_relationships" => "MetricRelationships", "v2.metric_resource" => "MetricResource", "v2.metrics_aggregator" => "MetricsAggregator", "v2.metrics_and_metric_tag_configurations" => "MetricsAndMetricTagConfigurations", @@ -4664,6 +4665,8 @@ def overrides "v2.metric_tag_configuration_update_request" => "MetricTagConfigurationUpdateRequest", "v2.metric_type" => "MetricType", "v2.metric_volumes" => "MetricVolumes", + "v2.metric_volumes_relationship" => "MetricVolumesRelationship", + "v2.metric_volumes_relationship_data" => "MetricVolumesRelationshipData", "v2.metric_volumes_response" => "MetricVolumesResponse", "v2.microsoft_sentinel_destination" => "MicrosoftSentinelDestination", "v2.microsoft_sentinel_destination_type" => "MicrosoftSentinelDestinationType", diff --git a/lib/datadog_api_client/v2/api/metrics_api.rb b/lib/datadog_api_client/v2/api/metrics_api.rb index 7195d0e3ee11..dee128ad4ffc 100644 --- a/lib/datadog_api_client/v2/api/metrics_api.rb +++ b/lib/datadog_api_client/v2/api/metrics_api.rb @@ -1092,7 +1092,8 @@ def list_tag_configurations(opts = {}) # Query parameters use bracket notation (for example, `filter[tags]`, `filter[queried][window][seconds]`). Pass them as standard URL query strings, URL-encoding the brackets if your client does not handle them. For example: `GET /api/v2/metrics?filter[tags]=env:prod&window[seconds]=86400&page[size]=500`. # # @param opts [Hash] the optional parameters - # @option opts [Boolean] :filter_configured Only return custom metrics that have been configured with Metrics Without Limits. + # @option opts [Boolean] :filter_configured Only return custom metrics that have been configured (`true`) or not configured (`false`) with Metrics Without Limits. + # @option opts [Boolean] :filter_is_configurable Only return metrics that are eligible (`true`) or ineligible (`false`) for configuration with Metrics Without Limits. # @option opts [String] :filter_tags_configured Only return metrics that have the given tag key(s) in their Metrics Without Limits configuration (included or excluded). # @option opts [MetricTagConfigurationMetricTypeCategory] :filter_metric_type Only return metrics of the given metric type. # @option opts [Boolean] :filter_include_percentiles Only return distribution metrics that have percentile aggregations enabled (true) or disabled (false). @@ -1100,6 +1101,8 @@ def list_tag_configurations(opts = {}) # @option opts [Integer] :filter_queried_window_seconds This parameter has no effect unless `filter[queried]` is also set. Only return metrics that have been queried or not queried in the specified window. The default value is 2,592,000 seconds (30 days), the maximum value is 15,552,000 seconds (180 days), and the minimum value is 1 second. For example: `filter[queried]=true&filter[queried][window][seconds]=604800`. # @option opts [String] :filter_tags Only return metrics that were submitted with tags matching this expression. You can use AND, OR, IN, and wildcards. For example: `filter[tags]=env IN (staging,test) AND service:web*`. # @option opts [Boolean] :filter_related_assets Only return metrics that are used in at least one dashboard, monitor, notebook, or SLO. + # @option opts [String] :include Include related resources in the response. Set to `metric_volumes` to include indexed and ingested volume counts for each metric. + # @option opts [String] :sort Sort results by metric volume. Prefix a key with `-` for descending order. Supported keys: `metric_volumes.indexed_volume`, `metric_volumes.ingested_volume`, `metric_volumes.indexed_volume_delta`, `metric_volumes.ingested_volume_delta`. Requires a paginated request (`page[size]` or `page[cursor]`). # @option opts [Integer] :window_seconds Only return metrics that have been actively reporting in the specified window. The default value is 3600 seconds (1 hour), the maximum value is 2,592,000 seconds (30 days), and the minimum value is 1 second. # @option opts [Integer] :page_size Maximum number of results per page. Send `page[size]` on the first request to opt in to pagination. On each subsequent request, send `page[cursor]` set to the value of `meta.pagination.next_cursor` from the previous response. The default value is 10000, the maximum value is 10000, and the minimum value is 1. # @option opts [String] :page_cursor Cursor for pagination. Use `page[size]` to opt-in to pagination and get the first page; for subsequent pages, use the value from `meta.pagination.next_cursor` in the response. Pagination is complete when `next_cursor` is null. @@ -1137,6 +1140,7 @@ def list_tag_configurations_with_http_info(opts = {}) # query parameters query_params = opts[:query_params] || {} query_params[:'filter[configured]'] = opts[:'filter_configured'] if !opts[:'filter_configured'].nil? + query_params[:'filter[is_configurable]'] = opts[:'filter_is_configurable'] if !opts[:'filter_is_configurable'].nil? query_params[:'filter[tags_configured]'] = opts[:'filter_tags_configured'] if !opts[:'filter_tags_configured'].nil? query_params[:'filter[metric_type]'] = opts[:'filter_metric_type'] if !opts[:'filter_metric_type'].nil? query_params[:'filter[include_percentiles]'] = opts[:'filter_include_percentiles'] if !opts[:'filter_include_percentiles'].nil? @@ -1144,6 +1148,8 @@ def list_tag_configurations_with_http_info(opts = {}) query_params[:'filter[queried][window][seconds]'] = opts[:'filter_queried_window_seconds'] if !opts[:'filter_queried_window_seconds'].nil? query_params[:'filter[tags]'] = opts[:'filter_tags'] if !opts[:'filter_tags'].nil? query_params[:'filter[related_assets]'] = opts[:'filter_related_assets'] if !opts[:'filter_related_assets'].nil? + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'window[seconds]'] = opts[:'window_seconds'] if !opts[:'window_seconds'].nil? query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? diff --git a/lib/datadog_api_client/v2/models/metric.rb b/lib/datadog_api_client/v2/models/metric.rb index aa06243d5df9..2af23312cd8e 100644 --- a/lib/datadog_api_client/v2/models/metric.rb +++ b/lib/datadog_api_client/v2/models/metric.rb @@ -17,13 +17,16 @@ require 'time' module DatadogAPIClient::V2 - # Object for a single metric tag configuration. + # Object for a single metric. class Metric include BaseGenericModel # The metric name for this resource. attr_accessor :id + # Relationships for a metric. + attr_accessor :relationships + # The metric resource type. attr_accessor :type @@ -34,6 +37,7 @@ class Metric def self.attribute_map { :'id' => :'id', + :'relationships' => :'relationships', :'type' => :'type' } end @@ -43,6 +47,7 @@ def self.attribute_map def self.openapi_types { :'id' => :'String', + :'relationships' => :'MetricRelationships', :'type' => :'MetricType' } end @@ -69,6 +74,10 @@ def initialize(attributes = {}) self.id = attributes[:'id'] end + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -101,6 +110,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && + relationships == o.relationships && type == o.type && additional_properties == o.additional_properties end @@ -109,7 +119,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [id, type, additional_properties].hash + [id, relationships, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/metric_ingested_indexed_volume_attributes.rb b/lib/datadog_api_client/v2/models/metric_ingested_indexed_volume_attributes.rb index 00c0ba404e4d..b9da92af460e 100644 --- a/lib/datadog_api_client/v2/models/metric_ingested_indexed_volume_attributes.rb +++ b/lib/datadog_api_client/v2/models/metric_ingested_indexed_volume_attributes.rb @@ -21,10 +21,10 @@ module DatadogAPIClient::V2 class MetricIngestedIndexedVolumeAttributes include BaseGenericModel - # Indexed volume for the given metric. + # Estimated average hourly number of indexed time series for the given metric over the last hour. For organizations on Metric Name Pricing, this represents the estimated sum of indexed data points over the last hour. attr_accessor :indexed_volume - # Ingested volume for the given metric. + # Estimated average hourly number of ingested time series for the given metric over the last hour. This value is 0 for metrics not configured with Metrics Without Limits. For organizations on Metric Name Pricing, this represents the estimated sum of ingested data points over the last hour. attr_accessor :ingested_volume attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/metric_relationships.rb b/lib/datadog_api_client/v2/models/metric_relationships.rb new file mode 100644 index 000000000000..60f3a34df5c1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/metric_relationships.rb @@ -0,0 +1,105 @@ +=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 + # Relationships for a metric. + class MetricRelationships + include BaseGenericModel + + # Relationship to a metric volume included in the response. + attr_accessor :metric_volumes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'metric_volumes' => :'metric_volumes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'metric_volumes' => :'MetricVolumesRelationship' + } + 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::MetricRelationships` 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?(:'metric_volumes') + self.metric_volumes = attributes[:'metric_volumes'] + 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 && + metric_volumes == o.metric_volumes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [metric_volumes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/metric_tag_configuration.rb b/lib/datadog_api_client/v2/models/metric_tag_configuration.rb index 910036837ada..84140ffa7a6a 100644 --- a/lib/datadog_api_client/v2/models/metric_tag_configuration.rb +++ b/lib/datadog_api_client/v2/models/metric_tag_configuration.rb @@ -27,6 +27,9 @@ class MetricTagConfiguration # The metric name for this resource. attr_accessor :id + # Relationships for a metric. + attr_accessor :relationships + # The metric tag configuration resource type. attr_accessor :type @@ -38,6 +41,7 @@ def self.attribute_map { :'attributes' => :'attributes', :'id' => :'id', + :'relationships' => :'relationships', :'type' => :'type' } end @@ -48,6 +52,7 @@ def self.openapi_types { :'attributes' => :'MetricTagConfigurationAttributes', :'id' => :'String', + :'relationships' => :'MetricRelationships', :'type' => :'MetricTagConfigurationType' } end @@ -78,6 +83,10 @@ def initialize(attributes = {}) self.id = attributes[:'id'] end + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -111,6 +120,7 @@ def ==(o) self.class == o.class && attributes == o.attributes && id == o.id && + relationships == o.relationships && type == o.type && additional_properties == o.additional_properties end @@ -119,7 +129,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attributes, id, type, additional_properties].hash + [attributes, id, relationships, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/metric_volumes_relationship.rb b/lib/datadog_api_client/v2/models/metric_volumes_relationship.rb new file mode 100644 index 000000000000..65aed2abc198 --- /dev/null +++ b/lib/datadog_api_client/v2/models/metric_volumes_relationship.rb @@ -0,0 +1,105 @@ +=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 + # Relationship to a metric volume included in the response. + class MetricVolumesRelationship + include BaseGenericModel + + # Relationship data for a metric volume. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'MetricVolumesRelationshipData' + } + 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::MetricVolumesRelationship` 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') + self.data = attributes[:'data'] + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/metric_volumes_relationship_data.rb b/lib/datadog_api_client/v2/models/metric_volumes_relationship_data.rb new file mode 100644 index 000000000000..be43827a01f1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/metric_volumes_relationship_data.rb @@ -0,0 +1,115 @@ +=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 + # Relationship data for a metric volume. + class MetricVolumesRelationshipData + include BaseGenericModel + + # The metric name for this resource. + attr_accessor :id + + # The metric ingested and indexed volume type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'MetricIngestedIndexedVolumeType' + } + 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::MetricVolumesRelationshipData` 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?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/metrics_and_metric_tag_configurations_response.rb b/lib/datadog_api_client/v2/models/metrics_and_metric_tag_configurations_response.rb index 8dbb2fb87161..0b9e183c6aad 100644 --- a/lib/datadog_api_client/v2/models/metrics_and_metric_tag_configurations_response.rb +++ b/lib/datadog_api_client/v2/models/metrics_and_metric_tag_configurations_response.rb @@ -24,6 +24,9 @@ class MetricsAndMetricTagConfigurationsResponse # Array of metrics and metric tag configurations. attr_accessor :data + # Array of metric volume resources included when requested with `include=metric_volumes`. + attr_accessor :included + # Pagination links. Only present if pagination query parameters were provided. attr_accessor :links @@ -37,6 +40,7 @@ class MetricsAndMetricTagConfigurationsResponse def self.attribute_map { :'data' => :'data', + :'included' => :'included', :'links' => :'links', :'meta' => :'meta' } @@ -47,6 +51,7 @@ def self.attribute_map def self.openapi_types { :'data' => :'Array', + :'included' => :'Array', :'links' => :'MetricsListResponseLinks', :'meta' => :'MetricPaginationMeta' } @@ -76,6 +81,12 @@ def initialize(attributes = {}) end end + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + if attributes.key?(:'links') self.links = attributes[:'links'] end @@ -112,6 +123,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && data == o.data && + included == o.included && links == o.links && meta == o.meta && additional_properties == o.additional_properties @@ -121,7 +133,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [data, links, meta, additional_properties].hash + [data, included, links, meta, additional_properties].hash end end end