Skip to content

Commit b999d65

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

11 files changed

Lines changed: 537 additions & 3 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 82 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,13 +39749,55 @@ components:
3974139749
oneOf:
3974239750
- $ref: '#/components/schemas/MetricDistinctVolume'
3974339751
- $ref: '#/components/schemas/MetricIngestedIndexedVolume'
39752+
MetricVolumesInclude:
39753+
description: Relationship data to include in the response.
39754+
enum:
39755+
- metric_volumes
39756+
type: string
39757+
x-enum-varnames:
39758+
- METRIC_VOLUMES
39759+
MetricVolumesRelationship:
39760+
description: Relationship to a metric's ingested and indexed volumes.
39761+
properties:
39762+
data:
39763+
$ref: '#/components/schemas/MetricVolumesRelationshipData'
39764+
type: object
39765+
MetricVolumesRelationshipData:
39766+
description: Relationship data for a metric's ingested and indexed volumes.
39767+
properties:
39768+
id:
39769+
$ref: '#/components/schemas/MetricName'
39770+
type:
39771+
$ref: '#/components/schemas/MetricIngestedIndexedVolumeType'
39772+
required:
39773+
- type
39774+
- id
39775+
type: object
3974439776
MetricVolumesResponse:
3974539777
description: Response object which includes a single metric's volume.
3974639778
properties:
3974739779
data:
3974839780
$ref: '#/components/schemas/MetricVolumes'
3974939781
readOnly: true
3975039782
type: object
39783+
MetricVolumesSort:
39784+
description: 'Sort metrics by ingested or indexed volume. Use `-` for descending
39785+
order.
39786+
39787+
Supported values: `metric_volumes.indexed_volume`, `-metric_volumes.indexed_volume`,
39788+
39789+
`metric_volumes.ingested_volume`, `-metric_volumes.ingested_volume`.'
39790+
enum:
39791+
- metric_volumes.indexed_volume
39792+
- -metric_volumes.indexed_volume
39793+
- metric_volumes.ingested_volume
39794+
- -metric_volumes.ingested_volume
39795+
type: string
39796+
x-enum-varnames:
39797+
- METRIC_VOLUMES_INDEXED_VOLUME
39798+
- NOT_METRIC_VOLUMES_INDEXED_VOLUME
39799+
- METRIC_VOLUMES_INGESTED_VOLUME
39800+
- NOT_METRIC_VOLUMES_INGESTED_VOLUME
3975139801
MetricsAggregator:
3975239802
default: avg
3975339803
description: The type of aggregation that can be performed on metrics-based
@@ -39787,6 +39837,12 @@ components:
3978739837
items:
3978839838
$ref: '#/components/schemas/MetricsAndMetricTagConfigurations'
3978939839
type: array
39840+
included:
39841+
description: Array of included metric volume objects. Only present when
39842+
`include=metric_volumes` is requested.
39843+
items:
39844+
$ref: '#/components/schemas/MetricIngestedIndexedVolume'
39845+
type: array
3979039846
links:
3979139847
$ref: '#/components/schemas/MetricsListResponseLinks'
3979239848
meta:
@@ -91450,7 +91506,10 @@ paths:
9145091506
`next_cursor` value from the response as the new `page[cursor]` value.
9145191507

9145291508
Once the `meta.pagination.next_cursor` value is null, all pages have been
91453-
retrieved.'
91509+
retrieved.
91510+
91511+
Use `include=metric_volumes` to fetch indexed and ingested volume data for
91512+
each metric, and `sort` to order results by volume.'
9145491513
operationId: ListTagConfigurations
9145591514
parameters:
9145691515
- description: Filter custom metrics that have configured tags.
@@ -91532,6 +91591,28 @@ paths:
9153291591
required: false
9153391592
schema:
9153491593
type: boolean
91594+
- description: Relationship data to include in the response. Use `metric_volumes`
91595+
to include indexed and ingested volumes.
91596+
example: metric_volumes
91597+
in: query
91598+
name: include
91599+
required: false
91600+
schema:
91601+
$ref: '#/components/schemas/MetricVolumesInclude'
91602+
- description: 'Sort metrics by ingested or indexed volume. Use `-` for descending
91603+
order.
91604+
91605+
Supported values: `metric_volumes.indexed_volume`, `-metric_volumes.indexed_volume`,
91606+
91607+
`metric_volumes.ingested_volume`, `-metric_volumes.ingested_volume`.
91608+
91609+
Only supported when `include=metric_volumes` is provided.'
91610+
example: -metric_volumes.indexed_volume
91611+
in: query
91612+
name: sort
91613+
required: false
91614+
schema:
91615+
$ref: '#/components/schemas/MetricVolumesSort'
9153591616
- description: 'The number of seconds of look back (from now) to apply to a
9153691617
filter[tag] or filter[queried] query.
9153791618

features/scenarios_model_mapping.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2824,6 +2824,8 @@
28242824
"filter_queried_window_seconds" => "Integer",
28252825
"filter_tags" => "String",
28262826
"filter_related_assets" => "Boolean",
2827+
"include" => "MetricVolumesInclude",
2828+
"sort" => "MetricVolumesSort",
28272829
"window_seconds" => "Integer",
28282830
"page_size" => "Integer",
28292831
"page_cursor" => "String",

lib/datadog_api_client/inflector.rb

Lines changed: 5 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,7 +3463,11 @@ 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",
3470+
"v2.metric_volumes_sort" => "MetricVolumesSort",
34663471
"v2.microsoft_sentinel_destination" => "MicrosoftSentinelDestination",
34673472
"v2.microsoft_sentinel_destination_type" => "MicrosoftSentinelDestinationType",
34683473
"v2.microsoft_teams_channel_info_response_attributes" => "MicrosoftTeamsChannelInfoResponseAttributes",

lib/datadog_api_client/v2/api/metrics_api.rb

Lines changed: 13 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 `include=metric_volumes` to fetch indexed and ingested volume data for each metric, and `sort` to order results by volume.
674675
#
675676
# @param opts [Hash] the optional parameters
676677
# @option opts [Boolean] :filter_configured Filter custom metrics that have configured tags.
@@ -681,6 +682,8 @@ 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 Relationship data to include in the response. Use `metric_volumes` to include indexed and ingested volumes.
686+
# @option opts [MetricVolumesSort] :sort Sort metrics by ingested or indexed volume. Use `-` for descending order. Supported values: `metric_volumes.indexed_volume`, `-metric_volumes.indexed_volume`, `metric_volumes.ingested_volume`, `-metric_volumes.ingested_volume`. Only supported when `include=metric_volumes` is provided.
684687
# @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).
685688
# @option opts [Integer] :page_size Maximum number of results returned.
686689
# @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 +703,14 @@ def list_tag_configurations_with_http_info(opts = {})
700703
if @api_client.config.client_side_validation && !opts[:'filter_queried_window_seconds'].nil? && opts[:'filter_queried_window_seconds'] < 0
701704
fail ArgumentError, 'invalid value for "opts[:"filter_queried_window_seconds"]" when calling MetricsAPI.list_tag_configurations, must be greater than or equal to 0.'
702705
end
706+
allowable_values = ['metric_volumes']
707+
if @api_client.config.client_side_validation && opts[:'include'] && !allowable_values.include?(opts[:'include'])
708+
fail ArgumentError, "invalid value for \"include\", must be one of #{allowable_values}"
709+
end
710+
allowable_values = ['metric_volumes.indexed_volume', '-metric_volumes.indexed_volume', 'metric_volumes.ingested_volume', '-metric_volumes.ingested_volume']
711+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
712+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
713+
end
703714
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000
704715
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling MetricsAPI.list_tag_configurations, must be smaller than or equal to 10000.'
705716
end
@@ -719,6 +730,8 @@ def list_tag_configurations_with_http_info(opts = {})
719730
query_params[:'filter[queried][window][seconds]'] = opts[:'filter_queried_window_seconds'] if !opts[:'filter_queried_window_seconds'].nil?
720731
query_params[:'filter[tags]'] = opts[:'filter_tags'] if !opts[:'filter_tags'].nil?
721732
query_params[:'filter[related_assets]'] = opts[:'filter_related_assets'] if !opts[:'filter_related_assets'].nil?
733+
query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
734+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
722735
query_params[:'window[seconds]'] = opts[:'window_seconds'] if !opts[:'window_seconds'].nil?
723736
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
724737
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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
# Relationship data to include in the response.
21+
class MetricVolumesInclude
22+
include BaseEnumModel
23+
24+
METRIC_VOLUMES = "metric_volumes".freeze
25+
end
26+
end

0 commit comments

Comments
 (0)