Skip to content

Commit 8762ac6

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 0f642af of spec repo
1 parent 4e815fa commit 8762ac6

7 files changed

Lines changed: 143 additions & 20 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61652,6 +61652,26 @@ components:
6165261652
$ref: "#/components/schemas/MetricAssetResponseIncluded"
6165361653
type: array
6165461654
type: object
61655+
MetricAvailableAggrFunctions:
61656+
description: A single aggregation function used to query a metric.
61657+
enum:
61658+
- avg
61659+
- min
61660+
- max
61661+
- sum
61662+
- count
61663+
- stddev
61664+
- pxx
61665+
example: avg
61666+
type: string
61667+
x-enum-varnames:
61668+
- AVG
61669+
- MIN
61670+
- MAX
61671+
- SUM
61672+
- COUNT
61673+
- STDDEV
61674+
- PXX
6165561675
MetricBulkConfigureTagsType:
6165661676
default: metric_bulk_configure_tags
6165761677
description: The metric bulk configure tags resource.
@@ -61830,14 +61850,26 @@ components:
6183061850
MetricCustomAggregations:
6183161851
description: |-
6183261852
Deprecated. You no longer need to configure specific time and space aggregations for Metrics Without Limits.
61833-
example:
61834-
- space: sum
61835-
time: sum
61836-
- space: sum
61837-
time: count
61838-
items:
61839-
$ref: "#/components/schemas/MetricCustomAggregation"
61840-
type: array
61853+
oneOf:
61854+
- example:
61855+
- space: sum
61856+
time: sum
61857+
- space: sum
61858+
time: count
61859+
items:
61860+
$ref: "#/components/schemas/MetricCustomAggregation"
61861+
type: array
61862+
- example:
61863+
- avg
61864+
- min
61865+
- max
61866+
- sum
61867+
- count
61868+
- stddev
61869+
- pxx
61870+
items:
61871+
$ref: "#/components/schemas/MetricAvailableAggrFunctions"
61872+
type: array
6184161873
MetricCustomSpaceAggregation:
6184261874
description: A space aggregation for use in query.
6184361875
enum:

lib/datadog_api_client/inflector.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4765,6 +4765,7 @@ def overrides
47654765
"v2.metric_asset_slo_relationship" => "MetricAssetSLORelationship",
47664766
"v2.metric_asset_slo_relationships" => "MetricAssetSLORelationships",
47674767
"v2.metric_assets_response" => "MetricAssetsResponse",
4768+
"v2.metric_available_aggr_functions" => "MetricAvailableAggrFunctions",
47684769
"v2.metric_bulk_configure_tags_type" => "MetricBulkConfigureTagsType",
47694770
"v2.metric_bulk_tag_config_create" => "MetricBulkTagConfigCreate",
47704771
"v2.metric_bulk_tag_config_create_attributes" => "MetricBulkTagConfigCreateAttributes",
@@ -4777,6 +4778,7 @@ def overrides
47774778
"v2.metric_bulk_tag_config_status_attributes" => "MetricBulkTagConfigStatusAttributes",
47784779
"v2.metric_content_encoding" => "MetricContentEncoding",
47794780
"v2.metric_custom_aggregation" => "MetricCustomAggregation",
4781+
"v2.metric_custom_aggregations" => "MetricCustomAggregations",
47804782
"v2.metric_custom_space_aggregation" => "MetricCustomSpaceAggregation",
47814783
"v2.metric_custom_time_aggregation" => "MetricCustomTimeAggregation",
47824784
"v2.metric_dashboard_asset" => "MetricDashboardAsset",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
# A single aggregation function used to query a metric.
21+
class MetricAvailableAggrFunctions
22+
include BaseEnumModel
23+
24+
AVG = "avg".freeze
25+
MIN = "min".freeze
26+
MAX = "max".freeze
27+
SUM = "sum".freeze
28+
COUNT = "count".freeze
29+
STDDEV = "stddev".freeze
30+
PXX = "pxx".freeze
31+
end
32+
end
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
# Deprecated. You no longer need to configure specific time and space aggregations for Metrics Without Limits.
21+
module MetricCustomAggregations
22+
class << self
23+
include BaseOneOfModel
24+
include BaseOneOfModelNoDiscriminator
25+
26+
# List of class defined in oneOf (OpenAPI v3)
27+
def openapi_one_of
28+
[
29+
:'Array<MetricCustomAggregation>',
30+
:'Array<MetricAvailableAggrFunctions>'
31+
]
32+
end
33+
# Builds the object
34+
# @param data [Mixed] Data to be matched against the list of oneOf items
35+
# @return [Object] Returns the model or the data itself
36+
def build(data)
37+
# Go through the list of oneOf items and attempt to identify the appropriate one.
38+
# Note:
39+
# - We do not attempt to check whether exactly one item matches.
40+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
41+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
42+
# - TODO: scalar values are de facto behaving as if they were nullable.
43+
# - TODO: logging when debugging is set.
44+
openapi_one_of.each do |klass|
45+
begin
46+
next if klass == :AnyType # "nullable: true"
47+
typed_data = find_and_cast_into_type(klass, data)
48+
next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
49+
return typed_data if typed_data
50+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
51+
end
52+
end
53+
54+
if openapi_one_of.include?(:AnyType)
55+
data
56+
else
57+
self._unparsed = true
58+
DatadogAPIClient::UnparsedObject.new(data)
59+
end
60+
end
61+
end
62+
end
63+
end

lib/datadog_api_client/v2/models/metric_tag_configuration_attributes.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def self.attribute_map
6565
# @!visibility private
6666
def self.openapi_types
6767
{
68-
:'aggregations' => :'Array<MetricCustomAggregation>',
68+
:'aggregations' => :'MetricCustomAggregations',
6969
:'created_at' => :'Time',
7070
:'exclude_tags_mode' => :'Boolean',
7171
:'include_percentiles' => :'Boolean',
@@ -94,9 +94,7 @@ def initialize(attributes = {})
9494
}
9595

9696
if attributes.key?(:'aggregations')
97-
if (value = attributes[:'aggregations']).is_a?(Array)
98-
self.aggregations = value
99-
end
97+
self.aggregations = attributes[:'aggregations']
10098
end
10199

102100
if attributes.key?(:'created_at')

lib/datadog_api_client/v2/models/metric_tag_configuration_create_attributes.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def self.attribute_map
5757
# @!visibility private
5858
def self.openapi_types
5959
{
60-
:'aggregations' => :'Array<MetricCustomAggregation>',
60+
:'aggregations' => :'MetricCustomAggregations',
6161
:'exclude_tags_mode' => :'Boolean',
6262
:'include_percentiles' => :'Boolean',
6363
:'metric_type' => :'MetricTagConfigurationMetricTypes',
@@ -84,9 +84,7 @@ def initialize(attributes = {})
8484
}
8585

8686
if attributes.key?(:'aggregations')
87-
if (value = attributes[:'aggregations']).is_a?(Array)
88-
self.aggregations = value
89-
end
87+
self.aggregations = attributes[:'aggregations']
9088
end
9189

9290
if attributes.key?(:'exclude_tags_mode')

lib/datadog_api_client/v2/models/metric_tag_configuration_update_attributes.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def self.attribute_map
5353
# @!visibility private
5454
def self.openapi_types
5555
{
56-
:'aggregations' => :'Array<MetricCustomAggregation>',
56+
:'aggregations' => :'MetricCustomAggregations',
5757
:'exclude_tags_mode' => :'Boolean',
5858
:'include_percentiles' => :'Boolean',
5959
:'tags' => :'Array<String>'
@@ -79,9 +79,7 @@ def initialize(attributes = {})
7979
}
8080

8181
if attributes.key?(:'aggregations')
82-
if (value = attributes[:'aggregations']).is_a?(Array)
83-
self.aggregations = value
84-
end
82+
self.aggregations = attributes[:'aggregations']
8583
end
8684

8785
if attributes.key?(:'exclude_tags_mode')

0 commit comments

Comments
 (0)