From 61c4f9271b3e66cef7198ba5fe4cb9cde88ac6e1 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:18:30 +0000 Subject: [PATCH] [ECT-99] Add app key to post /api/v2/events (#2589) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +++---- .generator/schemas/v2/openapi.yaml | 1 + .../datadog/api/client/v2/api/EventsApi.java | 4 ++-- .../datadog/api/client/v2/api/events.feature | 22 +++++++------------ 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index c0b2bbe2bcd..fb036e79ae6 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-11-26 13:36:15.509612", - "spec_repo_commit": "cf1aa5ea" + "regenerated": "2024-11-27 13:09:00.927359", + "spec_repo_commit": "fd3dd4d0" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-11-26 13:36:15.529715", - "spec_repo_commit": "cf1aa5ea" + "regenerated": "2024-11-27 13:09:00.946410", + "spec_repo_commit": "fd3dd4d0" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 581c73992ab..dbd569affab 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -31492,6 +31492,7 @@ paths: $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] + appKeyAuth: [] summary: Post an event tags: - Events diff --git a/src/main/java/com/datadog/api/client/v2/api/EventsApi.java b/src/main/java/com/datadog/api/client/v2/api/EventsApi.java index febcf7aa5fc..dc6e98dda34 100644 --- a/src/main/java/com/datadog/api/client/v2/api/EventsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/EventsApi.java @@ -124,7 +124,7 @@ public ApiResponse createEventWithHttpInfo( localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "POST", builder, @@ -170,7 +170,7 @@ public CompletableFuture> createEventWit localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); diff --git a/src/test/resources/com/datadog/api/client/v2/api/events.feature b/src/test/resources/com/datadog/api/client/v2/api/events.feature index 2013c242f6c..eada249fd88 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/events.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/events.feature @@ -7,26 +7,24 @@ Feature: Events Background: Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system And an instance of "Events" API @generated @skip @team:DataDog/event-management Scenario: Get a list of events returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "ListEvents" request + Given new "ListEvents" request When the request is sent Then the response status is 400 Bad Request @skip-validation @team:DataDog/event-management Scenario: Get a list of events returns "OK" response - Given a valid "appKeyAuth" key in the system - And new "ListEvents" request + Given new "ListEvents" request When the request is sent Then the response status is 200 OK @replay-only @skip-validation @team:DataDog/event-management @with-pagination Scenario: Get a list of events returns "OK" response with pagination - Given a valid "appKeyAuth" key in the system - And new "ListEvents" request + Given new "ListEvents" request And request contains "filter[from]" parameter with value "now-15m" And request contains "filter[to]" parameter with value "now" And request contains "page[limit]" parameter with value 2 @@ -36,8 +34,7 @@ Feature: Events @team:DataDog/event-management Scenario: Get a quick list of events returns "OK" response - Given a valid "appKeyAuth" key in the system - And new "ListEvents" request + Given new "ListEvents" request And request contains "filter[query]" parameter with value "datadog-agent" And request contains "filter[from]" parameter with value "2020-09-17T11:48:36+01:00" And request contains "filter[to]" parameter with value "2020-09-17T12:48:36+01:00" @@ -62,16 +59,14 @@ Feature: Events @team:DataDog/event-management Scenario: Search events returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "SearchEvents" request + Given new "SearchEvents" request And body with value {"filter": {"from": "now-15m", "query": "service:web* AND @http.status_code:[200 TO 299]", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} When the request is sent Then the response status is 400 Bad Request @team:DataDog/event-management Scenario: Search events returns "OK" response - Given a valid "appKeyAuth" key in the system - And new "SearchEvents" request + Given new "SearchEvents" request And body with value {"filter": {"query": "datadog-agent", "from": "2020-09-17T11:48:36+01:00", "to": "2020-09-17T12:48:36+01:00"}, "sort": "timestamp", "page": {"limit": 5}} When the request is sent Then the response status is 200 OK @@ -79,8 +74,7 @@ Feature: Events @replay-only @skip-validation @team:DataDog/event-management @with-pagination Scenario: Search events returns "OK" response with pagination - Given a valid "appKeyAuth" key in the system - And new "SearchEvents" request + Given new "SearchEvents" request And body with value {"filter": {"from": "now-15m", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 2}, "sort": "timestamp"} When the request with pagination is sent Then the response status is 200 OK