Skip to content

Commit 2e48bbd

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d394b63 of spec repo
1 parent 3e94288 commit 2e48bbd

File tree

7 files changed

+87
-12
lines changed

7 files changed

+87
-12
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "8001cbb",
3-
"generated": "2025-08-13 20:28:25.331"
2+
"spec_repo_commit": "d394b63",
3+
"generated": "2025-08-14 13:59:05.137"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7649,12 +7649,12 @@ components:
76497649
description: The type of the changed resource.
76507650
enum:
76517651
- feature_flag
7652-
- configuration
7652+
- metric_configuration
76537653
example: feature_flag
76547654
type: string
76557655
x-enum-varnames:
76567656
- FEATURE_FLAG
7657-
- CONFIGURATION
7657+
- METRIC_CONFIGURATION
76587658
ChangeEventAttributesImpactedResourcesItem:
76597659
description: A uniquely identified resource.
76607660
properties:
@@ -7780,12 +7780,12 @@ components:
77807780
description: The type of the resource that was changed.
77817781
enum:
77827782
- feature_flag
7783-
- configuration
7783+
- metric_configuration
77847784
example: feature_flag
77857785
type: string
77867786
x-enum-varnames:
77877787
- FEATURE_FLAG
7788-
- CONFIGURATION
7788+
- METRIC_CONFIGURATION
77897789
ChangeEventCustomAttributesImpactedResourcesItems:
77907790
additionalProperties: false
77917791
description: Object representing a uniquely identified resource.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/**
2+
* Post an event with metric_configuration resource type returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.EventsApi(configuration);
9+
10+
const params: v2.EventsApiCreateEventRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
aggregationKey: "aggregation_key_123",
15+
attributes: {
16+
author: {
17+
18+
type: "user",
19+
},
20+
changeMetadata: {
21+
dd: "{'team': 'datadog_team', 'user_email': '[email protected]', 'user_id': 'datadog_user_id', 'user_name': 'datadog_username'}",
22+
resource_link: "datadog.com/metric/config_test",
23+
},
24+
changedResource: {
25+
name: "config_test",
26+
type: "metric_configuration",
27+
},
28+
impactedResources: [
29+
{
30+
name: "system.cpu.usage",
31+
type: "service",
32+
},
33+
],
34+
newValue: {
35+
aggregation: "avg",
36+
tags: "['env:prod', 'service:web']",
37+
unit: "percent",
38+
},
39+
prevValue: {
40+
aggregation: "sum",
41+
tags: "['env:prod']",
42+
unit: "percent",
43+
},
44+
},
45+
category: "change",
46+
integrationId: "custom-events",
47+
message: "metric configuration has been updated",
48+
tags: ["env:api_client_test"],
49+
title: "metric configuration updated",
50+
},
51+
type: "event",
52+
},
53+
},
54+
};
55+
56+
apiInstance
57+
.createEvent(params)
58+
.then((data: v2.EventCreateResponsePayload) => {
59+
console.log(
60+
"API called successfully. Returned data: " + JSON.stringify(data)
61+
);
62+
})
63+
.catch((error: any) => console.error(error));

features/v2/events.feature

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ Feature: Events
8787
And the response "data.type" is equal to "event"
8888
And the response "data.attributes.attributes.evt" has field "uid"
8989

90+
@skip-validation @team:DataDog/event-management
91+
Scenario: Post an event with metric_configuration resource type returns "OK" response
92+
Given new "CreateEvent" request
93+
And body with value {"data": {"attributes": {"aggregation_key": "aggregation_key_123", "attributes": {"author": {"name": "[email protected]", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "[email protected]", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/metric/config_test"}, "changed_resource": {"name": "config_test", "type": "metric_configuration"}, "impacted_resources": [{"name": "system.cpu.usage", "type": "service"}], "new_value": {"aggregation": "avg", "tags": ["env:prod", "service:web"], "unit": "percent"}, "prev_value": {"aggregation": "sum", "tags": ["env:prod"], "unit": "percent"}}, "category": "change", "integration_id": "custom-events", "message": "metric configuration has been updated", "tags": ["env:api_client_test"], "title": "metric configuration updated"}, "type": "event"}}
94+
When the request is sent
95+
Then the response status is 202 OK
96+
And the response "data.type" is equal to "event"
97+
And the response "data.attributes.attributes.evt" has field "uid"
98+
9099
@team:DataDog/event-management
91100
Scenario: Search events returns "Bad Request" response
92101
Given new "SearchEvents" request

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { UnparsedObject } from "../../datadog-api-client-common/util";
1212

1313
export type ChangeEventAttributesChangedResourceType =
1414
| typeof FEATURE_FLAG
15-
| typeof CONFIGURATION
15+
| typeof METRIC_CONFIGURATION
1616
| UnparsedObject;
1717
export const FEATURE_FLAG = "feature_flag";
18-
export const CONFIGURATION = "configuration";
18+
export const METRIC_CONFIGURATION = "metric_configuration";

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { UnparsedObject } from "../../datadog-api-client-common/util";
1212

1313
export type ChangeEventCustomAttributesChangedResourceType =
1414
| typeof FEATURE_FLAG
15-
| typeof CONFIGURATION
15+
| typeof METRIC_CONFIGURATION
1616
| UnparsedObject;
1717
export const FEATURE_FLAG = "feature_flag";
18-
export const CONFIGURATION = "configuration";
18+
export const METRIC_CONFIGURATION = "metric_configuration";

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,7 +2358,10 @@ const enumsMap: { [key: string]: any[] } = {
23582358
CaseStatus: ["OPEN", "IN_PROGRESS", "CLOSED"],
23592359
CaseType: ["STANDARD"],
23602360
ChangeEventAttributesAuthorType: ["user", "system", "api", "automation"],
2361-
ChangeEventAttributesChangedResourceType: ["feature_flag", "configuration"],
2361+
ChangeEventAttributesChangedResourceType: [
2362+
"feature_flag",
2363+
"metric_configuration",
2364+
],
23622365
ChangeEventAttributesImpactedResourcesItemType: ["service"],
23632366
ChangeEventCustomAttributesAuthorType: [
23642367
"user",
@@ -2368,7 +2371,7 @@ const enumsMap: { [key: string]: any[] } = {
23682371
],
23692372
ChangeEventCustomAttributesChangedResourceType: [
23702373
"feature_flag",
2371-
"configuration",
2374+
"metric_configuration",
23722375
],
23732376
ChangeEventCustomAttributesImpactedResourcesItemsType: ["service"],
23742377
CircleCIAPIKeyType: ["CircleCIAPIKey"],

0 commit comments

Comments
 (0)