Skip to content

Commit bbe9c25

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a171e0a of spec repo
1 parent 9e1ee6c commit bbe9c25

36 files changed

+736
-149
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 237 additions & 45 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-06-10T15:38:58.529Z"
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"log": {
3+
"_recordingName": "Events/Post an event returns \"Bad request\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "b35f8f8450dc70b83d7661b05817ff7e",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 867,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 592,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"data\":{\"attributes\":{\"aggregation_key\":\"aggregation_key_123\",\"attributes\":{\"author\":{\"name\":\"example@datadog.com\",\"type\":\"user\"},\"change_metadata\":{\"dd\":{\"team\":\"datadog_team\",\"user_email\":\"datadog@datadog.com\",\"user_id\":\"datadog_user_id\",\"user_name\":\"datadog_username\"},\"resource_link\":\"datadog.com/feature/fallback_payments_test\"},\"changed_resource\":{\"name\":\"fallback_payments_test\",\"type\":\"feature_flag\"},\"impacted_resources\":[{\"name\":\"payments_api\",\"type\":\"service\"}],\"new_value\":{\"enabled\":true,\"percentage\":\"50%\",\"rule\":{\"datacenter\":\"devcycle.us1.prod\"}},\"prev_value\":{\"enabled\":true,\"percentage\":\"10%\",\"rule\":{\"datacenter\":\"devcycle.us1.prod\"}}},\"category\":\"invalid\",\"integration_id\":\"custom-events\",\"message\":\"payment_processed feature flag has been enabled\",\"tags\":[\"env:api_client_test\"],\"title\":\"payment_processed feature flag updated\"},\"type\":\"event\"}}"
36+
},
37+
"queryString": [],
38+
"url": "https://event-management-intake.datadoghq.com/api/v2/events"
39+
},
40+
"response": {
41+
"bodySize": 163,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 163,
45+
"text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"JSON validation failed at $.data.attributes.category: value must be one of: [\\\"alert\\\", \\\"change\\\"].\"}]}"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 323,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 400,
58+
"statusText": "Bad Request"
59+
},
60+
"startedDateTime": "2025-06-10T15:38:58.757Z",
61+
"time": 189
62+
}
63+
],
64+
"pages": [],
65+
"version": "1.2"
66+
}
67+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-06-10T15:38:58.954Z"
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"log": {
3+
"_recordingName": "Events/Post an event returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "12f2ce8ce9b919c06a471c2b7d261fb3",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 866,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 592,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"data\":{\"attributes\":{\"aggregation_key\":\"aggregation_key_123\",\"attributes\":{\"author\":{\"name\":\"example@datadog.com\",\"type\":\"user\"},\"change_metadata\":{\"dd\":{\"team\":\"datadog_team\",\"user_email\":\"datadog@datadog.com\",\"user_id\":\"datadog_user_id\",\"user_name\":\"datadog_username\"},\"resource_link\":\"datadog.com/feature/fallback_payments_test\"},\"changed_resource\":{\"name\":\"fallback_payments_test\",\"type\":\"feature_flag\"},\"impacted_resources\":[{\"name\":\"payments_api\",\"type\":\"service\"}],\"new_value\":{\"enabled\":true,\"percentage\":\"50%\",\"rule\":{\"datacenter\":\"devcycle.us1.prod\"}},\"prev_value\":{\"enabled\":true,\"percentage\":\"10%\",\"rule\":{\"datacenter\":\"devcycle.us1.prod\"}}},\"category\":\"change\",\"integration_id\":\"custom-events\",\"message\":\"payment_processed feature flag has been enabled\",\"tags\":[\"env:api_client_test\"],\"title\":\"payment_processed feature flag updated\"},\"type\":\"event\"}}"
36+
},
37+
"queryString": [],
38+
"url": "https://event-management-intake.datadoghq.com/api/v2/events"
39+
},
40+
"response": {
41+
"bodySize": 191,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 191,
45+
"text": "{\"data\":{\"attributes\":{\"attributes\":{\"evt\":{\"uid\":\"AZdafqaTAACKG_iMQ82pmAAA\"}}},\"id\":\"_\",\"type\":\"event\"},\"links\":{\"self\":\"https://app.datadoghq.com/event/event?uid=AZdafqaTAACKG_iMQ82pmAAA\"}}"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 323,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 202,
58+
"statusText": "Accepted"
59+
},
60+
"startedDateTime": "2025-06-10T15:38:58.956Z",
61+
"time": 212
62+
}
63+
],
64+
"pages": [],
65+
"version": "1.2"
66+
}
67+
}

features/v2/events.feature

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,21 @@ Feature: Events
5050
Then the response status is 200 OK
5151
And the response "data" has length 0
5252

53-
@generated @skip @team:DataDog/event-management
53+
@team:DataDog/event-management
5454
Scenario: Post an event returns "Bad request" response
5555
Given new "CreateEvent" request
56-
And body with value {"data": {"attributes": {"attributes": {"author": {"name": "datadog@datadog.com", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "datadog@datadog.com", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["env:test"], "title": "payment_processed feature flag updated"}, "type": "event"}}
56+
And body with value {"data": {"attributes": {"aggregation_key": "aggregation_key_123", "attributes": {"author": {"name": "example@datadog.com", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "datadog@datadog.com", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "invalid", "integration_id": "custom-events", "message": "payment_processed feature flag has been enabled", "tags": ["env:api_client_test"], "title": "payment_processed feature flag updated"}, "type": "event"}}
5757
When the request is sent
5858
Then the response status is 400 Bad request
5959

60-
@generated @skip @team:DataDog/event-management
60+
@skip-validation @team:DataDog/event-management
6161
Scenario: Post an event returns "OK" response
6262
Given new "CreateEvent" request
63-
And body with value {"data": {"attributes": {"attributes": {"author": {"name": "datadog@datadog.com", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "datadog@datadog.com", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["env:test"], "title": "payment_processed feature flag updated"}, "type": "event"}}
63+
And body with value {"data": {"attributes": {"aggregation_key": "aggregation_key_123", "attributes": {"author": {"name": "example@datadog.com", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "datadog@datadog.com", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "integration_id": "custom-events", "message": "payment_processed feature flag has been enabled", "tags": ["env:api_client_test"], "title": "payment_processed feature flag updated"}, "type": "event"}}
6464
When the request is sent
65-
Then the response status is 200 OK
65+
Then the response status is 202 OK
66+
And the response "data.type" is equal to "event"
67+
And the response "data.attributes.attributes.evt" has field "uid"
6668

6769
@team:DataDog/event-management
6870
Scenario: Search events returns "Bad Request" response

features/v2/undo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@
934934
"CreateEvent": {
935935
"tag": "Events",
936936
"undo": {
937-
"type": "unsafe"
937+
"type": "safe"
938938
}
939939
},
940940
"SearchEvents": {

services/events/src/v2/EventsApi.ts

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export class EventsApiResponseProcessor {
236236
response: ResponseContext,
237237
): Promise<EventCreateResponsePayload> {
238238
const contentType = normalizeMediaType(response.headers["content-type"]);
239-
if (response.httpStatusCode === 200) {
239+
if (response.httpStatusCode === 202) {
240240
const body: EventCreateResponsePayload = deserialize(
241241
parse(await response.body.text(), contentType),
242242
TypingInfo,
@@ -425,7 +425,7 @@ export class EventsApiResponseProcessor {
425425

426426
export interface EventsApiCreateEventRequest {
427427
/**
428-
* Event request object
428+
* Event creation request payload.
429429
* @type EventCreateRequestPayload
430430
*/
431431
body: EventCreateRequestPayload;
@@ -476,7 +476,37 @@ export class EventsApi {
476476
private responseProcessor: EventsApiResponseProcessor;
477477
private configuration: Configuration;
478478

479-
static operationServers: { [key: string]: BaseServerConfiguration[] } = {};
479+
static operationServers: { [key: string]: BaseServerConfiguration[] } = {
480+
"EventsApi.v2.createEvent": [
481+
new ServerConfiguration<{
482+
site:
483+
| "datadoghq.com"
484+
| "us3.datadoghq.com"
485+
| "us5.datadoghq.com"
486+
| "ap1.datadoghq.com"
487+
| "datadoghq.eu"
488+
| "ddog-gov.com";
489+
subdomain: string;
490+
}>("https://{subdomain}.{site}", {
491+
site: "datadoghq.com",
492+
subdomain: "event-management-intake",
493+
}),
494+
new ServerConfiguration<{
495+
name: string;
496+
protocol: string;
497+
}>("{protocol}://{name}", {
498+
name: "event-management-intake.datadoghq.com",
499+
protocol: "https",
500+
}),
501+
new ServerConfiguration<{
502+
site: string;
503+
subdomain: string;
504+
}>("https://{subdomain}.{site}", {
505+
site: "datadoghq.com",
506+
subdomain: "event-management-intake",
507+
}),
508+
],
509+
};
480510

481511
public constructor(
482512
configuration?: Configuration,
@@ -491,11 +521,15 @@ export class EventsApi {
491521
}
492522

493523
/**
494-
* This endpoint allows you to post events.
524+
* This endpoint allows you to publish events.
525+
*
526+
* ✅ **Only events with the `change` or `alert` category** are in General Availability. For change events, see [Change Tracking](https://docs.datadoghq.com/change_tracking) for more details.
527+
*
528+
* ❌ For use cases involving other event categories, use the V1 endpoint or reach out to [support](https://www.datadoghq.com/support/).
495529
*
496-
* ✅ **Only events with the `change` category** are in General Availability. See [Change Tracking](https://docs.datadoghq.com/change_tracking) for more details.
530+
* ❌ Notifications are not yet supported for events sent to this endpoint. Use the V1 endpoint for notification functionality.
497531
*
498-
* ❌ For use cases involving other event categories, please use the V1 endpoint.
532+
* ❌ This endpoint is not available for the Government (US1-FED) site. Contact your account representative for more information.
499533
* @param param The request object
500534
*/
501535
public createEvent(

services/events/src/v2/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ export {
55
EventsApi,
66
} from "./EventsApi";
77

8+
export { AlertEventCustomAttributes } from "./models/AlertEventCustomAttributes";
9+
export { AlertEventCustomAttributesLinksItems } from "./models/AlertEventCustomAttributesLinksItems";
10+
export { AlertEventCustomAttributesLinksItemsCategory } from "./models/AlertEventCustomAttributesLinksItemsCategory";
11+
export { AlertEventCustomAttributesPriority } from "./models/AlertEventCustomAttributesPriority";
12+
export { AlertEventCustomAttributesStatus } from "./models/AlertEventCustomAttributesStatus";
813
export { APIErrorResponse } from "./models/APIErrorResponse";
914
export { ChangeEventCustomAttributes } from "./models/ChangeEventCustomAttributes";
1015
export { ChangeEventCustomAttributesAuthor } from "./models/ChangeEventCustomAttributesAuthor";
@@ -24,8 +29,10 @@ export { EventCreateResponseAttributes } from "./models/EventCreateResponseAttri
2429
export { EventCreateResponseAttributesAttributes } from "./models/EventCreateResponseAttributesAttributes";
2530
export { EventCreateResponseAttributesAttributesEvt } from "./models/EventCreateResponseAttributesAttributesEvt";
2631
export { EventCreateResponsePayload } from "./models/EventCreateResponsePayload";
32+
export { EventCreateResponsePayloadLinks } from "./models/EventCreateResponsePayloadLinks";
2733
export { EventPayload } from "./models/EventPayload";
2834
export { EventPayloadAttributes } from "./models/EventPayloadAttributes";
35+
export { EventPayloadIntegrationId } from "./models/EventPayloadIntegrationId";
2936
export { EventPriority } from "./models/EventPriority";
3037
export { EventResponse } from "./models/EventResponse";
3138
export { EventResponseAttributes } from "./models/EventResponseAttributes";
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import { AttributeTypeMap } from "@datadog/datadog-api-client";
2+
3+
import { AlertEventCustomAttributesLinksItems } from "./AlertEventCustomAttributesLinksItems";
4+
import { AlertEventCustomAttributesPriority } from "./AlertEventCustomAttributesPriority";
5+
import { AlertEventCustomAttributesStatus } from "./AlertEventCustomAttributesStatus";
6+
7+
/**
8+
* Alert event attributes.
9+
*/
10+
export class AlertEventCustomAttributes {
11+
/**
12+
* Free form JSON object for arbitrary data. Supports up to 100 properties per object and a maximum nesting depth of 10 levels.
13+
*/
14+
"custom"?: { [key: string]: any };
15+
/**
16+
* The links related to the event. Maximum of 20 links allowed.
17+
*/
18+
"links"?: Array<AlertEventCustomAttributesLinksItems>;
19+
/**
20+
* The priority of the alert.
21+
*/
22+
"priority"?: AlertEventCustomAttributesPriority;
23+
/**
24+
* The status of the alert.
25+
*/
26+
"status": AlertEventCustomAttributesStatus;
27+
/**
28+
* @ignore
29+
*/
30+
"_unparsed"?: boolean;
31+
32+
/**
33+
* @ignore
34+
*/
35+
static readonly attributeTypeMap: AttributeTypeMap = {
36+
custom: {
37+
baseName: "custom",
38+
type: "{ [key: string]: any; }",
39+
},
40+
links: {
41+
baseName: "links",
42+
type: "Array<AlertEventCustomAttributesLinksItems>",
43+
},
44+
priority: {
45+
baseName: "priority",
46+
type: "AlertEventCustomAttributesPriority",
47+
},
48+
status: {
49+
baseName: "status",
50+
type: "AlertEventCustomAttributesStatus",
51+
required: true,
52+
},
53+
};
54+
55+
/**
56+
* @ignore
57+
*/
58+
static getAttributeTypeMap(): AttributeTypeMap {
59+
return AlertEventCustomAttributes.attributeTypeMap;
60+
}
61+
62+
public constructor() {}
63+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { AttributeTypeMap } from "@datadog/datadog-api-client";
2+
3+
import { AlertEventCustomAttributesLinksItemsCategory } from "./AlertEventCustomAttributesLinksItemsCategory";
4+
5+
/**
6+
* A link.
7+
*/
8+
export class AlertEventCustomAttributesLinksItems {
9+
/**
10+
* The category of the link.
11+
*/
12+
"category": AlertEventCustomAttributesLinksItemsCategory;
13+
/**
14+
* The display text of the link. Limited to 300 characters.
15+
*/
16+
"title"?: string;
17+
/**
18+
* The URL of the link. Limited to 2048 characters.
19+
*/
20+
"url": string;
21+
/**
22+
* @ignore
23+
*/
24+
"_unparsed"?: boolean;
25+
26+
/**
27+
* @ignore
28+
*/
29+
static readonly attributeTypeMap: AttributeTypeMap = {
30+
category: {
31+
baseName: "category",
32+
type: "AlertEventCustomAttributesLinksItemsCategory",
33+
required: true,
34+
},
35+
title: {
36+
baseName: "title",
37+
type: "string",
38+
},
39+
url: {
40+
baseName: "url",
41+
type: "string",
42+
required: true,
43+
},
44+
};
45+
46+
/**
47+
* @ignore
48+
*/
49+
static getAttributeTypeMap(): AttributeTypeMap {
50+
return AlertEventCustomAttributesLinksItems.attributeTypeMap;
51+
}
52+
53+
public constructor() {}
54+
}

0 commit comments

Comments
 (0)