Skip to content

Commit adc88e7

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 779f1de of spec repo (#2406)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 711a431 commit adc88e7

33 files changed

+149
-726
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 45 additions & 233 deletions
Large diffs are not rendered by default.

cassettes/v2/Events_3416228/Post-an-event-returns-Bad-request-response_947004866/frozen.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

cassettes/v2/Events_3416228/Post-an-event-returns-Bad-request-response_947004866/recording.har

Lines changed: 0 additions & 67 deletions
This file was deleted.

cassettes/v2/Events_3416228/Post-an-event-returns-OK-response_1209415328/frozen.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

cassettes/v2/Events_3416228/Post-an-event-returns-OK-response_1209415328/recording.har

Lines changed: 0 additions & 67 deletions
This file was deleted.

features/v2/events.feature

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

53-
@team:DataDog/event-management
53+
@generated @skip @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": {"aggregation_key": "aggregation_key_123", "attributes": {"author": {"name": "example@datadog.com", "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/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"}}
56+
And body with value {"data": {"attributes": {"attributes": {"author": {"name": "datadog@datadog.com", "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/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"}}
5757
When the request is sent
5858
Then the response status is 400 Bad request
5959

60-
@skip-validation @team:DataDog/event-management
60+
@generated @skip @team:DataDog/event-management
6161
Scenario: Post an event returns "OK" response
6262
Given new "CreateEvent" request
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": "[email protected]", "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"}}
63+
And body with value {"data": {"attributes": {"attributes": {"author": {"name": "datadog@datadog.com", "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/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"}}
6464
When the request is sent
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"
65+
Then the response status is 200 OK
6866

6967
@team:DataDog/event-management
7068
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": "safe"
937+
"type": "unsafe"
938938
}
939939
},
940940
"SearchEvents": {

services/events/src/v2/EventsApi.ts

Lines changed: 6 additions & 40 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 === 202) {
239+
if (response.httpStatusCode === 200) {
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 creation request payload.
428+
* Event request object
429429
* @type EventCreateRequestPayload
430430
*/
431431
body: EventCreateRequestPayload;
@@ -476,37 +476,7 @@ export class EventsApi {
476476
private responseProcessor: EventsApiResponseProcessor;
477477
private configuration: Configuration;
478478

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-
};
479+
static operationServers: { [key: string]: BaseServerConfiguration[] } = {};
510480

511481
public constructor(
512482
configuration?: Configuration,
@@ -521,15 +491,11 @@ export class EventsApi {
521491
}
522492

523493
/**
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/).
494+
* This endpoint allows you to post events.
529495
*
530-
* ❌ Notifications are not yet supported for events sent to this endpoint. Use the V1 endpoint for notification functionality.
496+
* ✅ **Only events with the `change` category** are in General Availability. See [Change Tracking](https://docs.datadoghq.com/change_tracking) for more details.
531497
*
532-
* ❌ This endpoint is not available for the Government (US1-FED) site. Contact your account representative for more information.
498+
* ❌ For use cases involving other event categories, please use the V1 endpoint.
533499
* @param param The request object
534500
*/
535501
public createEvent(

services/events/src/v2/index.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ 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";
138
export { APIErrorResponse } from "./models/APIErrorResponse";
149
export { ChangeEventCustomAttributes } from "./models/ChangeEventCustomAttributes";
1510
export { ChangeEventCustomAttributesAuthor } from "./models/ChangeEventCustomAttributesAuthor";
@@ -29,10 +24,8 @@ export { EventCreateResponseAttributes } from "./models/EventCreateResponseAttri
2924
export { EventCreateResponseAttributesAttributes } from "./models/EventCreateResponseAttributesAttributes";
3025
export { EventCreateResponseAttributesAttributesEvt } from "./models/EventCreateResponseAttributesAttributesEvt";
3126
export { EventCreateResponsePayload } from "./models/EventCreateResponsePayload";
32-
export { EventCreateResponsePayloadLinks } from "./models/EventCreateResponsePayloadLinks";
3327
export { EventPayload } from "./models/EventPayload";
3428
export { EventPayloadAttributes } from "./models/EventPayloadAttributes";
35-
export { EventPayloadIntegrationId } from "./models/EventPayloadIntegrationId";
3629
export { EventPriority } from "./models/EventPriority";
3730
export { EventResponse } from "./models/EventResponse";
3831
export { EventResponseAttributes } from "./models/EventResponseAttributes";

services/events/src/v2/models/AlertEventCustomAttributes.ts

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)