Skip to content

Commit 8a317be

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update v2 metrics list endpoint filter by metric type to use metric type category (#2496)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent cf027d4 commit 8a317be

File tree

7 files changed

+95
-19
lines changed

7 files changed

+95
-19
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-09-26 19:34:40.400740",
8-
"spec_repo_commit": "83debf9e"
7+
"regenerated": "2024-09-30 13:57:08.451305",
8+
"spec_repo_commit": "eb66b1cf"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-09-26 19:34:40.414847",
13-
"spec_repo_commit": "83debf9e"
12+
"regenerated": "2024-09-30 13:57:08.465453",
13+
"spec_repo_commit": "eb66b1cf"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13939,8 +13939,8 @@ components:
1393913939
- time: sum, space: sum
1394013940

1394113941

13942-
Can only be applied to metrics that have a `metric_type` of `count`, `rate`,
13943-
or `gauge`.'
13942+
Can only be applied to non_distribution metrics that have a `metric_type`
13943+
of `count`, `rate`, or `gauge`.'
1394413944
example:
1394513945
- space: sum
1394613946
time: sum
@@ -14548,6 +14548,17 @@ components:
1454814548
required:
1454914549
- data
1455014550
type: object
14551+
MetricTagConfigurationMetricTypeCategory:
14552+
default: distribution
14553+
description: The metric's type category.
14554+
enum:
14555+
- non_distribution
14556+
- distribution
14557+
example: distribution
14558+
type: string
14559+
x-enum-varnames:
14560+
- NON_DISTRIBUTION
14561+
- DISTRIBUTION
1455114562
MetricTagConfigurationMetricTypes:
1455214563
default: gauge
1455314564
description: The metric's type.
@@ -32405,7 +32416,7 @@ paths:
3240532416
name: filter[metric_type]
3240632417
required: false
3240732418
schema:
32408-
$ref: '#/components/schemas/MetricTagConfigurationMetricTypes'
32419+
$ref: '#/components/schemas/MetricTagConfigurationMetricTypeCategory'
3240932420
- description: 'Filter distributions with additional percentile
3241032421

3241132422
aggregations enabled or disabled.'

src/main/java/com/datadog/api/client/v2/api/MetricsApi.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import com.datadog.api.client.v2.model.MetricPayload;
1616
import com.datadog.api.client.v2.model.MetricSuggestedTagsAndAggregationsResponse;
1717
import com.datadog.api.client.v2.model.MetricTagConfigurationCreateRequest;
18-
import com.datadog.api.client.v2.model.MetricTagConfigurationMetricTypes;
18+
import com.datadog.api.client.v2.model.MetricTagConfigurationMetricTypeCategory;
1919
import com.datadog.api.client.v2.model.MetricTagConfigurationResponse;
2020
import com.datadog.api.client.v2.model.MetricTagConfigurationUpdateRequest;
2121
import com.datadog.api.client.v2.model.MetricVolumesResponse;
@@ -1445,7 +1445,7 @@ public ApiResponse<MetricTagConfigurationResponse> listTagConfigurationByNameWit
14451445
public static class ListTagConfigurationsOptionalParameters {
14461446
private Boolean filterConfigured;
14471447
private String filterTagsConfigured;
1448-
private MetricTagConfigurationMetricTypes filterMetricType;
1448+
private MetricTagConfigurationMetricTypeCategory filterMetricType;
14491449
private Boolean filterIncludePercentiles;
14501450
private Boolean filterQueried;
14511451
private String filterTags;
@@ -1477,11 +1477,11 @@ public ListTagConfigurationsOptionalParameters filterTagsConfigured(
14771477
/**
14781478
* Set filterMetricType.
14791479
*
1480-
* @param filterMetricType Filter metrics by metric type. (optional, default to "gauge")
1480+
* @param filterMetricType Filter metrics by metric type. (optional, default to "distribution")
14811481
* @return ListTagConfigurationsOptionalParameters
14821482
*/
14831483
public ListTagConfigurationsOptionalParameters filterMetricType(
1484-
MetricTagConfigurationMetricTypes filterMetricType) {
1484+
MetricTagConfigurationMetricTypeCategory filterMetricType) {
14851485
this.filterMetricType = filterMetricType;
14861486
return this;
14871487
}
@@ -1620,7 +1620,7 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
16201620
Object localVarPostBody = null;
16211621
Boolean filterConfigured = parameters.filterConfigured;
16221622
String filterTagsConfigured = parameters.filterTagsConfigured;
1623-
MetricTagConfigurationMetricTypes filterMetricType = parameters.filterMetricType;
1623+
MetricTagConfigurationMetricTypeCategory filterMetricType = parameters.filterMetricType;
16241624
Boolean filterIncludePercentiles = parameters.filterIncludePercentiles;
16251625
Boolean filterQueried = parameters.filterQueried;
16261626
String filterTags = parameters.filterTags;
@@ -1676,7 +1676,7 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
16761676
Object localVarPostBody = null;
16771677
Boolean filterConfigured = parameters.filterConfigured;
16781678
String filterTagsConfigured = parameters.filterTagsConfigured;
1679-
MetricTagConfigurationMetricTypes filterMetricType = parameters.filterMetricType;
1679+
MetricTagConfigurationMetricTypeCategory filterMetricType = parameters.filterMetricType;
16801680
Boolean filterIncludePercentiles = parameters.filterIncludePercentiles;
16811681
Boolean filterQueried = parameters.filterQueried;
16821682
String filterTags = parameters.filterTags;

src/main/java/com/datadog/api/client/v2/model/MetricTagConfigurationAttributes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ public MetricTagConfigurationAttributes addAggregationsItem(
9090
* <li>time: sum, space: sum
9191
* </ul>
9292
*
93-
* <p>Can only be applied to metrics that have a <code>metric_type</code> of <code>count</code>,
94-
* <code>rate</code>, or <code>gauge</code>.
93+
* <p>Can only be applied to non_distribution metrics that have a <code>metric_type</code> of
94+
* <code>count</code>, <code>rate</code>, or <code>gauge</code>.
9595
*
9696
* @return aggregations
9797
*/

src/main/java/com/datadog/api/client/v2/model/MetricTagConfigurationCreateAttributes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ public MetricTagConfigurationCreateAttributes addAggregationsItem(
9595
* <li>time: sum, space: sum
9696
* </ul>
9797
*
98-
* <p>Can only be applied to metrics that have a <code>metric_type</code> of <code>count</code>,
99-
* <code>rate</code>, or <code>gauge</code>.
98+
* <p>Can only be applied to non_distribution metrics that have a <code>metric_type</code> of
99+
* <code>count</code>, <code>rate</code>, or <code>gauge</code>.
100100
*
101101
* @return aggregations
102102
*/
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2019-Present Datadog, Inc.
5+
*/
6+
7+
package com.datadog.api.client.v2.model;
8+
9+
import com.datadog.api.client.ModelEnum;
10+
import com.fasterxml.jackson.annotation.JsonCreator;
11+
import com.fasterxml.jackson.core.JsonGenerator;
12+
import com.fasterxml.jackson.core.JsonProcessingException;
13+
import com.fasterxml.jackson.databind.SerializerProvider;
14+
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
15+
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
16+
import java.io.IOException;
17+
import java.util.Arrays;
18+
import java.util.HashSet;
19+
import java.util.Set;
20+
21+
/** The metric's type category. */
22+
@JsonSerialize(
23+
using =
24+
MetricTagConfigurationMetricTypeCategory.MetricTagConfigurationMetricTypeCategorySerializer
25+
.class)
26+
public class MetricTagConfigurationMetricTypeCategory extends ModelEnum<String> {
27+
28+
private static final Set<String> allowedValues =
29+
new HashSet<String>(Arrays.asList("non_distribution", "distribution"));
30+
31+
public static final MetricTagConfigurationMetricTypeCategory NON_DISTRIBUTION =
32+
new MetricTagConfigurationMetricTypeCategory("non_distribution");
33+
public static final MetricTagConfigurationMetricTypeCategory DISTRIBUTION =
34+
new MetricTagConfigurationMetricTypeCategory("distribution");
35+
36+
MetricTagConfigurationMetricTypeCategory(String value) {
37+
super(value, allowedValues);
38+
}
39+
40+
public static class MetricTagConfigurationMetricTypeCategorySerializer
41+
extends StdSerializer<MetricTagConfigurationMetricTypeCategory> {
42+
public MetricTagConfigurationMetricTypeCategorySerializer(
43+
Class<MetricTagConfigurationMetricTypeCategory> t) {
44+
super(t);
45+
}
46+
47+
public MetricTagConfigurationMetricTypeCategorySerializer() {
48+
this(null);
49+
}
50+
51+
@Override
52+
public void serialize(
53+
MetricTagConfigurationMetricTypeCategory value,
54+
JsonGenerator jgen,
55+
SerializerProvider provider)
56+
throws IOException, JsonProcessingException {
57+
jgen.writeObject(value.value);
58+
}
59+
}
60+
61+
@JsonCreator
62+
public static MetricTagConfigurationMetricTypeCategory fromValue(String value) {
63+
return new MetricTagConfigurationMetricTypeCategory(value);
64+
}
65+
}

src/main/java/com/datadog/api/client/v2/model/MetricTagConfigurationUpdateAttributes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public MetricTagConfigurationUpdateAttributes addAggregationsItem(
7878
* <li>time: sum, space: sum
7979
* </ul>
8080
*
81-
* <p>Can only be applied to metrics that have a <code>metric_type</code> of <code>count</code>,
82-
* <code>rate</code>, or <code>gauge</code>.
81+
* <p>Can only be applied to non_distribution metrics that have a <code>metric_type</code> of
82+
* <code>count</code>, <code>rate</code>, or <code>gauge</code>.
8383
*
8484
* @return aggregations
8585
*/

0 commit comments

Comments
 (0)