Skip to content

Commit f964e72

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a357f01 of spec repo
1 parent a3bee96 commit f964e72

10 files changed

Lines changed: 475 additions & 3 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38523,6 +38523,8 @@ components:
3852338523
properties:
3852438524
id:
3852538525
$ref: '#/components/schemas/MetricName'
38526+
relationships:
38527+
$ref: '#/components/schemas/MetricRelationships'
3852638528
type:
3852738529
$ref: '#/components/schemas/MetricType'
3852838530
type: object
@@ -39298,6 +39300,12 @@ components:
3929839300
format: double
3929939301
type: number
3930039302
type: object
39303+
MetricRelationships:
39304+
description: Relationships to related metric objects.
39305+
properties:
39306+
metric_volumes:
39307+
$ref: '#/components/schemas/MetricVolumesRelationship'
39308+
type: object
3930139309
MetricResource:
3930239310
description: Metric resource.
3930339311
example:
@@ -39741,6 +39749,33 @@ components:
3974139749
oneOf:
3974239750
- $ref: '#/components/schemas/MetricDistinctVolume'
3974339751
- $ref: '#/components/schemas/MetricIngestedIndexedVolume'
39752+
MetricVolumesInclude:
39753+
description: Comma-separated list of additional data to include in the response.
39754+
Allowed values are `metric_volumes`.
39755+
enum:
39756+
- metric_volumes
39757+
- generated_metric_attributes
39758+
type: string
39759+
x-enum-varnames:
39760+
- METRIC_VOLUMES
39761+
- GENERATED_METRIC_ATTRIBUTES
39762+
MetricVolumesRelationship:
39763+
description: Relationship to a metric's ingested and indexed volumes.
39764+
properties:
39765+
data:
39766+
$ref: '#/components/schemas/MetricVolumesRelationshipData'
39767+
type: object
39768+
MetricVolumesRelationshipData:
39769+
description: Relationship data for a metric's ingested and indexed volumes.
39770+
properties:
39771+
id:
39772+
$ref: '#/components/schemas/MetricName'
39773+
type:
39774+
$ref: '#/components/schemas/MetricIngestedIndexedVolumeType'
39775+
required:
39776+
- type
39777+
- id
39778+
type: object
3974439779
MetricVolumesResponse:
3974539780
description: Response object which includes a single metric's volume.
3974639781
properties:
@@ -39787,6 +39822,12 @@ components:
3978739822
items:
3978839823
$ref: '#/components/schemas/MetricsAndMetricTagConfigurations'
3978939824
type: array
39825+
included:
39826+
description: Array of included metric volume objects. Only present when
39827+
`include=metric_volumes` is requested.
39828+
items:
39829+
$ref: '#/components/schemas/MetricIngestedIndexedVolume'
39830+
type: array
3979039831
links:
3979139832
$ref: '#/components/schemas/MetricsListResponseLinks'
3979239833
meta:
@@ -91450,7 +91491,13 @@ paths:
9145091491
`next_cursor` value from the response as the new `page[cursor]` value.
9145191492

9145291493
Once the `meta.pagination.next_cursor` value is null, all pages have been
91453-
retrieved.'
91494+
retrieved.
91495+
91496+
Use the `include` query parameter to fetch additional data with the response.
91497+
When `include=metric_volumes` is specified, the response includes volume data
91498+
for each custom metric in the `included` array, with a corresponding `relationships`
91499+
link on each metric in `data`. Volume data is only returned for custom metrics.
91500+
All volume values represent a 1-hour timeframe.'
9145491501
operationId: ListTagConfigurations
9145591502
parameters:
9145691503
- description: Filter custom metrics that have configured tags.
@@ -91532,6 +91579,16 @@ paths:
9153291579
required: false
9153391580
schema:
9153491581
type: boolean
91582+
- description: 'Comma-separated list of additional data to include in the response.
91583+
Allowed values: `metric_volumes`. When `metric_volumes` is specified, the
91584+
response includes volume data for each custom metric in the `included` array,
91585+
with a corresponding `relationships` link on each metric in `data`.'
91586+
example: metric_volumes
91587+
in: query
91588+
name: include
91589+
required: false
91590+
schema:
91591+
$ref: '#/components/schemas/MetricVolumesInclude'
9153591592
- description: 'The number of seconds of look back (from now) to apply to a
9153691593
filter[tag] or filter[queried] query.
9153791594

features/scenarios_model_mapping.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2824,6 +2824,7 @@
28242824
"filter_queried_window_seconds" => "Integer",
28252825
"filter_tags" => "String",
28262826
"filter_related_assets" => "Boolean",
2827+
"include" => "MetricVolumesInclude",
28272828
"window_seconds" => "Integer",
28282829
"page_size" => "Integer",
28292830
"page_cursor" => "String",

lib/datadog_api_client/inflector.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3430,6 +3430,7 @@ def overrides
34303430
"v2.metric_pagination_meta" => "MetricPaginationMeta",
34313431
"v2.metric_payload" => "MetricPayload",
34323432
"v2.metric_point" => "MetricPoint",
3433+
"v2.metric_relationships" => "MetricRelationships",
34333434
"v2.metric_resource" => "MetricResource",
34343435
"v2.metrics_aggregator" => "MetricsAggregator",
34353436
"v2.metrics_and_metric_tag_configurations" => "MetricsAndMetricTagConfigurations",
@@ -3462,6 +3463,9 @@ def overrides
34623463
"v2.metric_tag_configuration_update_request" => "MetricTagConfigurationUpdateRequest",
34633464
"v2.metric_type" => "MetricType",
34643465
"v2.metric_volumes" => "MetricVolumes",
3466+
"v2.metric_volumes_include" => "MetricVolumesInclude",
3467+
"v2.metric_volumes_relationship" => "MetricVolumesRelationship",
3468+
"v2.metric_volumes_relationship_data" => "MetricVolumesRelationshipData",
34653469
"v2.metric_volumes_response" => "MetricVolumesResponse",
34663470
"v2.microsoft_sentinel_destination" => "MicrosoftSentinelDestination",
34673471
"v2.microsoft_sentinel_destination_type" => "MicrosoftSentinelDestinationType",

lib/datadog_api_client/v2/api/metrics_api.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ def list_tag_configurations(opts = {})
671671
# Optionally, paginate by using the `page[cursor]` and/or `page[size]` query parameters.
672672
# To fetch the first page, pass in a query parameter with either a valid `page[size]` or an empty cursor like `page[cursor]=`. To fetch the next page, pass in the `next_cursor` value from the response as the new `page[cursor]` value.
673673
# Once the `meta.pagination.next_cursor` value is null, all pages have been retrieved.
674+
# Use the `include` query parameter to fetch additional data with the response. When `include=metric_volumes` is specified, the response includes volume data for each custom metric in the `included` array, with a corresponding `relationships` link on each metric in `data`. Volume data is only returned for custom metrics. All volume values represent a 1-hour timeframe.
674675
#
675676
# @param opts [Hash] the optional parameters
676677
# @option opts [Boolean] :filter_configured Filter custom metrics that have configured tags.
@@ -681,6 +682,7 @@ def list_tag_configurations(opts = {})
681682
# @option opts [Integer] :filter_queried_window_seconds The number of seconds of look back (from now) used by the `filter[queried]` filter logic. Must be sent with `filter[queried]` and is only applied when `filter[queried]=true`. If `filter[queried]=false`, this parameter is ignored and default queried-window behavior applies. If `filter[queried]` is not provided, sending this parameter returns a 400. For example: `GET /api/v2/metrics?filter[queried]=true&filter[queried][window][seconds]=7776000`.
682683
# @option opts [String] :filter_tags Filter metrics that have been submitted with the given tags. Supports boolean and wildcard expressions. Can only be combined with the filter[queried] filter.
683684
# @option opts [Boolean] :filter_related_assets (Preview) Filter metrics that are used in dashboards, monitors, notebooks, SLOs.
685+
# @option opts [MetricVolumesInclude] :include Comma-separated list of additional data to include in the response. Allowed values: `metric_volumes`. When `metric_volumes` is specified, the response includes volume data for each custom metric in the `included` array, with a corresponding `relationships` link on each metric in `data`.
684686
# @option opts [Integer] :window_seconds The number of seconds of look back (from now) to apply to a filter[tag] or filter[queried] query. Default value is 3600 (1 hour), maximum value is 5,184,000 (60 days).
685687
# @option opts [Integer] :page_size Maximum number of results returned.
686688
# @option opts [String] :page_cursor String to query the next page of results. This key is provided with each valid response from the API in `meta.pagination.next_cursor`. Once the `meta.pagination.next_cursor` key is null, all pages have been retrieved.
@@ -700,6 +702,10 @@ def list_tag_configurations_with_http_info(opts = {})
700702
if @api_client.config.client_side_validation && !opts[:'filter_queried_window_seconds'].nil? && opts[:'filter_queried_window_seconds'] < 0
701703
fail ArgumentError, 'invalid value for "opts[:"filter_queried_window_seconds"]" when calling MetricsAPI.list_tag_configurations, must be greater than or equal to 0.'
702704
end
705+
allowable_values = ['metric_volumes', 'generated_metric_attributes']
706+
if @api_client.config.client_side_validation && opts[:'include'] && !allowable_values.include?(opts[:'include'])
707+
fail ArgumentError, "invalid value for \"include\", must be one of #{allowable_values}"
708+
end
703709
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000
704710
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling MetricsAPI.list_tag_configurations, must be smaller than or equal to 10000.'
705711
end
@@ -719,6 +725,7 @@ def list_tag_configurations_with_http_info(opts = {})
719725
query_params[:'filter[queried][window][seconds]'] = opts[:'filter_queried_window_seconds'] if !opts[:'filter_queried_window_seconds'].nil?
720726
query_params[:'filter[tags]'] = opts[:'filter_tags'] if !opts[:'filter_tags'].nil?
721727
query_params[:'filter[related_assets]'] = opts[:'filter_related_assets'] if !opts[:'filter_related_assets'].nil?
728+
query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
722729
query_params[:'window[seconds]'] = opts[:'window_seconds'] if !opts[:'window_seconds'].nil?
723730
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
724731
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?

lib/datadog_api_client/v2/models/metric.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class Metric
2424
# The metric name for this resource.
2525
attr_accessor :id
2626

27+
# Relationships to related metric objects.
28+
attr_accessor :relationships
29+
2730
# The metric resource type.
2831
attr_accessor :type
2932

@@ -34,6 +37,7 @@ class Metric
3437
def self.attribute_map
3538
{
3639
:'id' => :'id',
40+
:'relationships' => :'relationships',
3741
:'type' => :'type'
3842
}
3943
end
@@ -43,6 +47,7 @@ def self.attribute_map
4347
def self.openapi_types
4448
{
4549
:'id' => :'String',
50+
:'relationships' => :'MetricRelationships',
4651
:'type' => :'MetricType'
4752
}
4853
end
@@ -69,6 +74,10 @@ def initialize(attributes = {})
6974
self.id = attributes[:'id']
7075
end
7176

77+
if attributes.key?(:'relationships')
78+
self.relationships = attributes[:'relationships']
79+
end
80+
7281
if attributes.key?(:'type')
7382
self.type = attributes[:'type']
7483
end
@@ -101,6 +110,7 @@ def ==(o)
101110
return true if self.equal?(o)
102111
self.class == o.class &&
103112
id == o.id &&
113+
relationships == o.relationships &&
104114
type == o.type &&
105115
additional_properties == o.additional_properties
106116
end
@@ -109,7 +119,7 @@ def ==(o)
109119
# @return [Integer] Hash code
110120
# @!visibility private
111121
def hash
112-
[id, type, additional_properties].hash
122+
[id, relationships, type, additional_properties].hash
113123
end
114124
end
115125
end
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# Relationships to related metric objects.
21+
class MetricRelationships
22+
include BaseGenericModel
23+
24+
# Relationship to a metric's ingested and indexed volumes.
25+
attr_accessor :metric_volumes
26+
27+
attr_accessor :additional_properties
28+
29+
# Attribute mapping from ruby-style variable name to JSON key.
30+
# @!visibility private
31+
def self.attribute_map
32+
{
33+
:'metric_volumes' => :'metric_volumes'
34+
}
35+
end
36+
37+
# Attribute type mapping.
38+
# @!visibility private
39+
def self.openapi_types
40+
{
41+
:'metric_volumes' => :'MetricVolumesRelationship'
42+
}
43+
end
44+
45+
# Initializes the object
46+
# @param attributes [Hash] Model attributes in the form of hash
47+
# @!visibility private
48+
def initialize(attributes = {})
49+
if (!attributes.is_a?(Hash))
50+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricRelationships` initialize method"
51+
end
52+
53+
self.additional_properties = {}
54+
# check to see if the attribute exists and convert string to symbol for hash key
55+
attributes = attributes.each_with_object({}) { |(k, v), h|
56+
if (!self.class.attribute_map.key?(k.to_sym))
57+
self.additional_properties[k.to_sym] = v
58+
else
59+
h[k.to_sym] = v
60+
end
61+
}
62+
63+
if attributes.key?(:'metric_volumes')
64+
self.metric_volumes = attributes[:'metric_volumes']
65+
end
66+
end
67+
68+
# Returns the object in the form of hash, with additionalProperties support.
69+
# @return [Hash] Returns the object in the form of hash
70+
# @!visibility private
71+
def to_hash
72+
hash = {}
73+
self.class.attribute_map.each_pair do |attr, param|
74+
value = self.send(attr)
75+
if value.nil?
76+
is_nullable = self.class.openapi_nullable.include?(attr)
77+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
78+
end
79+
80+
hash[param] = _to_hash(value)
81+
end
82+
self.additional_properties.each_pair do |attr, value|
83+
hash[attr] = value
84+
end
85+
hash
86+
end
87+
88+
# Checks equality by comparing each attribute.
89+
# @param o [Object] Object to be compared
90+
# @!visibility private
91+
def ==(o)
92+
return true if self.equal?(o)
93+
self.class == o.class &&
94+
metric_volumes == o.metric_volumes &&
95+
additional_properties == o.additional_properties
96+
end
97+
98+
# Calculates hash code according to all attributes.
99+
# @return [Integer] Hash code
100+
# @!visibility private
101+
def hash
102+
[metric_volumes, additional_properties].hash
103+
end
104+
end
105+
end
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# Comma-separated list of additional data to include in the response. Allowed values are `metric_volumes`.
21+
class MetricVolumesInclude
22+
include BaseEnumModel
23+
24+
METRIC_VOLUMES = "metric_volumes".freeze
25+
GENERATED_METRIC_ATTRIBUTES = "generated_metric_attributes".freeze
26+
end
27+
end

0 commit comments

Comments
 (0)