Skip to content

Commit 99736f3

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit ad22b00 of spec repo (#273)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent e573cd4 commit 99736f3

14 files changed

+261
-15
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.5.1.dev2",
7-
"regenerated": "2021-10-25 10:56:38.403189",
8-
"spec_repo_commit": "53a5665"
7+
"regenerated": "2021-10-25 17:57:20.012281",
8+
"spec_repo_commit": "ad22b00"
99
},
1010
"v2": {
1111
"apigentools_version": "1.5.1.dev2",
12-
"regenerated": "2021-10-25 10:57:32.600783",
13-
"spec_repo_commit": "53a5665"
12+
"regenerated": "2021-10-25 17:58:19.788636",
13+
"spec_repo_commit": "ad22b00"
1414
}
1515
}
1616
}

docs/v2/MetricsApi.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ All URIs are relative to *https://api.datadoghq.com*
1616

1717
> MetricTagConfigurationResponse createTagConfiguration(body)
1818
19-
Create and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric. Optionally, include percentile aggregations on any distribution metric.
19+
Create and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric.
20+
Optionally, include percentile aggregations on any distribution metric or configure custom aggregations
21+
on any count, rate, or gauge metric.
2022
Can only be used with application keys of users with the `Manage Tags for Metrics` permission.
2123

2224
### Example
@@ -35,6 +37,16 @@ let params: v2.MetricsApiCreateTagConfigurationRequest = {
3537
body: {
3638
data: {
3739
attributes: {
40+
aggregations: [
41+
{
42+
space: "sum",
43+
time: "sum",
44+
},
45+
{
46+
space: "sum",
47+
time: "sum",
48+
},
49+
],
3850
includePercentiles: true,
3951
metricType: "count",
4052
tags: ["app", "datacenter"],
@@ -414,8 +426,9 @@ apiInstance
414426

415427
> MetricTagConfigurationResponse updateTagConfiguration(body)
416428
417-
Update the tag configuration of a metric or percentile aggregations of a distribution metric. Can only be used with
418-
application keys from users with the `Manage Tags for Metrics` permission.
429+
Update the tag configuration of a metric or percentile aggregations of a distribution metric or custom aggregations
430+
of a count, rate, or gauge metric.
431+
Can only be used with application keys from users with the `Manage Tags for Metrics` permission.
419432

420433
### Example
421434

@@ -433,6 +446,16 @@ let params: v2.MetricsApiUpdateTagConfigurationRequest = {
433446
body: {
434447
data: {
435448
attributes: {
449+
aggregations: [
450+
{
451+
space: "sum",
452+
time: "sum",
453+
},
454+
{
455+
space: "sum",
456+
time: "sum",
457+
},
458+
],
436459
includePercentiles: true,
437460
tags: ["app", "datacenter"],
438461
},

packages/datadog-api-client-v2/.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ models/Metric.ts
209209
models/MetricAllTags.ts
210210
models/MetricAllTagsAttributes.ts
211211
models/MetricAllTagsResponse.ts
212+
models/MetricCustomAggregation.ts
213+
models/MetricCustomSpaceAggregation.ts
214+
models/MetricCustomTimeAggregation.ts
212215
models/MetricDistinctVolume.ts
213216
models/MetricDistinctVolumeAttributes.ts
214217
models/MetricDistinctVolumeType.ts

packages/datadog-api-client-v2/apis/MetricsApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { MetricsAndMetricTagConfigurationsResponse } from "../models/MetricsAndM
2020
*/
2121
export class MetricsApiRequestFactory extends BaseAPIRequestFactory {
2222
/**
23-
* Create and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric. Optionally, include percentile aggregations on any distribution metric. Can only be used with application keys of users with the `Manage Tags for Metrics` permission.
23+
* Create and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric. Optionally, include percentile aggregations on any distribution metric or configure custom aggregations on any count, rate, or gauge metric. Can only be used with application keys of users with the `Manage Tags for Metrics` permission.
2424
* Create a tag configuration
2525
* @param metricName The name of the metric.
2626
* @param body
@@ -427,7 +427,7 @@ export class MetricsApiRequestFactory extends BaseAPIRequestFactory {
427427
}
428428

429429
/**
430-
* Update the tag configuration of a metric or percentile aggregations of a distribution metric. Can only be used with application keys from users with the `Manage Tags for Metrics` permission.
430+
* Update the tag configuration of a metric or percentile aggregations of a distribution metric or custom aggregations of a count, rate, or gauge metric. Can only be used with application keys from users with the `Manage Tags for Metrics` permission.
431431
* Update a tag configuration
432432
* @param metricName The name of the metric.
433433
* @param body
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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 2020-Present Datadog, Inc.
5+
*
6+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7+
* https://openapi-generator.tech
8+
* Do not edit the class manually.
9+
*/
10+
11+
import { MetricCustomSpaceAggregation } from "./MetricCustomSpaceAggregation";
12+
import { MetricCustomTimeAggregation } from "./MetricCustomTimeAggregation";
13+
14+
export class MetricCustomAggregation {
15+
"space": MetricCustomSpaceAggregation;
16+
"time": MetricCustomTimeAggregation;
17+
18+
"unparsedObject"?: any;
19+
20+
static readonly discriminator: string | undefined = undefined;
21+
22+
static readonly attributeTypeMap: {
23+
[key: string]: { baseName: string; type: string; format: string };
24+
} = {
25+
space: {
26+
baseName: "space",
27+
type: "MetricCustomSpaceAggregation",
28+
format: "",
29+
},
30+
time: {
31+
baseName: "time",
32+
type: "MetricCustomTimeAggregation",
33+
format: "",
34+
},
35+
};
36+
37+
static getAttributeTypeMap() {
38+
return MetricCustomAggregation.attributeTypeMap;
39+
}
40+
41+
static deserialize(data: { [key: string]: any }): MetricCustomAggregation {
42+
const res = new MetricCustomAggregation();
43+
44+
if (data.space === undefined) {
45+
throw new TypeError(
46+
"missing required attribute 'space' on 'MetricCustomAggregation' object"
47+
);
48+
}
49+
if (["avg", "max", "min", "sum", undefined].includes(data.space)) {
50+
res.space = data.space;
51+
} else {
52+
const raw = new MetricCustomAggregation();
53+
raw.unparsedObject = data;
54+
return raw;
55+
}
56+
57+
if (data.time === undefined) {
58+
throw new TypeError(
59+
"missing required attribute 'time' on 'MetricCustomAggregation' object"
60+
);
61+
}
62+
if (["avg", "count", "max", "min", "sum", undefined].includes(data.time)) {
63+
res.time = data.time;
64+
} else {
65+
const raw = new MetricCustomAggregation();
66+
raw.unparsedObject = data;
67+
return raw;
68+
}
69+
70+
return res;
71+
}
72+
73+
static serialize(data: MetricCustomAggregation): { [key: string]: any } {
74+
const attributeTypes = MetricCustomAggregation.getAttributeTypeMap();
75+
const res: { [index: string]: any } = {};
76+
for (const [key, value] of Object.entries(data)) {
77+
if (!(key in attributeTypes)) {
78+
throw new TypeError(`${key} attribute not in schema`);
79+
}
80+
}
81+
if (data?.unparsedObject !== undefined) {
82+
return data.unparsedObject;
83+
}
84+
if (data.space === undefined) {
85+
throw new TypeError(
86+
"missing required attribute 'space' on 'MetricCustomAggregation' object"
87+
);
88+
}
89+
if (["avg", "max", "min", "sum", undefined].includes(data.space)) {
90+
res.space = data.space;
91+
} else {
92+
throw TypeError(`invalid enum value ${data.space} for space`);
93+
}
94+
95+
if (data.time === undefined) {
96+
throw new TypeError(
97+
"missing required attribute 'time' on 'MetricCustomAggregation' object"
98+
);
99+
}
100+
if (["avg", "count", "max", "min", "sum", undefined].includes(data.time)) {
101+
res.time = data.time;
102+
} else {
103+
throw TypeError(`invalid enum value ${data.time} for time`);
104+
}
105+
106+
return res;
107+
}
108+
109+
public constructor() {}
110+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 2020-Present Datadog, Inc.
5+
*
6+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7+
* https://openapi-generator.tech
8+
* Do not edit the class manually.
9+
*/
10+
11+
export type MetricCustomSpaceAggregation =
12+
| typeof AVG
13+
| typeof MAX
14+
| typeof MIN
15+
| typeof SUM;
16+
export const AVG = "avg";
17+
export const MAX = "max";
18+
export const MIN = "min";
19+
export const SUM = "sum";
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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 2020-Present Datadog, Inc.
5+
*
6+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7+
* https://openapi-generator.tech
8+
* Do not edit the class manually.
9+
*/
10+
11+
export type MetricCustomTimeAggregation =
12+
| typeof AVG
13+
| typeof COUNT
14+
| typeof MAX
15+
| typeof MIN
16+
| typeof SUM;
17+
export const AVG = "avg";
18+
export const COUNT = "count";
19+
export const MAX = "max";
20+
export const MIN = "min";
21+
export const SUM = "sum";

packages/datadog-api-client-v2/models/MetricTagConfigurationAttributes.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Do not edit the class manually.
99
*/
1010

11+
import { MetricCustomAggregation } from "./MetricCustomAggregation";
1112
import { MetricTagConfigurationMetricTypes } from "./MetricTagConfigurationMetricTypes";
1213
import { ObjectSerializer } from "./ObjectSerializer";
1314

@@ -16,6 +17,10 @@ import { ObjectSerializer } from "./ObjectSerializer";
1617
*/
1718

1819
export class MetricTagConfigurationAttributes {
20+
/**
21+
* A list of queryable aggregation combinations for a count, rate, or gauge metric. By default, count and rate metrics require the (time: sum, space: sum) aggregation and Gauge metrics require the (time: avg, space: avg) aggregation. Additional time & space combinations are also available: - time: avg, space: avg - time: avg, space: max - time: avg, space: min - time: avg, space: sum - time: count, space: sum - time: max, space: max - time: min, space: min - time: sum, space: avg - time: sum, space: sum Can only be applied to metrics that have a `metric_type` of `count`, `rate`, or `gauge`.
22+
*/
23+
"aggregations"?: Array<MetricCustomAggregation>;
1924
/**
2025
* Timestamp when the tag configuration was created.
2126
*/
@@ -41,6 +46,11 @@ export class MetricTagConfigurationAttributes {
4146
static readonly attributeTypeMap: {
4247
[key: string]: { baseName: string; type: string; format: string };
4348
} = {
49+
aggregations: {
50+
baseName: "aggregations",
51+
type: "Array<MetricCustomAggregation>",
52+
format: "",
53+
},
4454
createdAt: {
4555
baseName: "created_at",
4656
type: "Date",
@@ -77,6 +87,12 @@ export class MetricTagConfigurationAttributes {
7787
}): MetricTagConfigurationAttributes {
7888
const res = new MetricTagConfigurationAttributes();
7989

90+
res.aggregations = ObjectSerializer.deserialize(
91+
data.aggregations,
92+
"Array<MetricCustomAggregation>",
93+
""
94+
);
95+
8096
res.createdAt = ObjectSerializer.deserialize(
8197
data.created_at,
8298
"Date",
@@ -126,6 +142,12 @@ export class MetricTagConfigurationAttributes {
126142
if (data?.unparsedObject !== undefined) {
127143
return data.unparsedObject;
128144
}
145+
res.aggregations = ObjectSerializer.serialize(
146+
data.aggregations,
147+
"Array<MetricCustomAggregation>",
148+
""
149+
);
150+
129151
res.created_at = ObjectSerializer.serialize(
130152
data.createdAt,
131153
"Date",

packages/datadog-api-client-v2/models/MetricTagConfigurationCreateAttributes.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Do not edit the class manually.
99
*/
1010

11+
import { MetricCustomAggregation } from "./MetricCustomAggregation";
1112
import { MetricTagConfigurationMetricTypes } from "./MetricTagConfigurationMetricTypes";
1213
import { ObjectSerializer } from "./ObjectSerializer";
1314

@@ -16,6 +17,10 @@ import { ObjectSerializer } from "./ObjectSerializer";
1617
*/
1718

1819
export class MetricTagConfigurationCreateAttributes {
20+
/**
21+
* A list of queryable aggregation combinations for a count, rate, or gauge metric. By default, count and rate metrics require the (time: sum, space: sum) aggregation and Gauge metrics require the (time: avg, space: avg) aggregation. Additional time & space combinations are also available: - time: avg, space: avg - time: avg, space: max - time: avg, space: min - time: avg, space: sum - time: count, space: sum - time: max, space: max - time: min, space: min - time: sum, space: avg - time: sum, space: sum Can only be applied to metrics that have a `metric_type` of `count`, `rate`, or `gauge`.
22+
*/
23+
"aggregations"?: Array<MetricCustomAggregation>;
1924
/**
2025
* Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a `metric_type` of `distribution`.
2126
*/
@@ -33,6 +38,11 @@ export class MetricTagConfigurationCreateAttributes {
3338
static readonly attributeTypeMap: {
3439
[key: string]: { baseName: string; type: string; format: string };
3540
} = {
41+
aggregations: {
42+
baseName: "aggregations",
43+
type: "Array<MetricCustomAggregation>",
44+
format: "",
45+
},
3646
includePercentiles: {
3747
baseName: "include_percentiles",
3848
type: "boolean",
@@ -59,6 +69,12 @@ export class MetricTagConfigurationCreateAttributes {
5969
}): MetricTagConfigurationCreateAttributes {
6070
const res = new MetricTagConfigurationCreateAttributes();
6171

72+
res.aggregations = ObjectSerializer.deserialize(
73+
data.aggregations,
74+
"Array<MetricCustomAggregation>",
75+
""
76+
);
77+
6278
res.includePercentiles = ObjectSerializer.deserialize(
6379
data.include_percentiles,
6480
"boolean",
@@ -106,6 +122,12 @@ export class MetricTagConfigurationCreateAttributes {
106122
if (data?.unparsedObject !== undefined) {
107123
return data.unparsedObject;
108124
}
125+
res.aggregations = ObjectSerializer.serialize(
126+
data.aggregations,
127+
"Array<MetricCustomAggregation>",
128+
""
129+
);
130+
109131
res.include_percentiles = ObjectSerializer.serialize(
110132
data.includePercentiles,
111133
"boolean",

0 commit comments

Comments
 (0)