diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2b6162acbd9..c9351b62b15 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -145664,13 +145664,11 @@ paths: operator: OR permissions: - bits_investigations_read - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). post: description: |- Trigger a Bits AI investigation from a monitor alert or a general investigation. - The `monitors_read` permission is required when the trigger type is `monitor_alert_trigger`. + This endpoint requires the `bits_investigations_write` permission. When the trigger type is + `monitor_alert_trigger`, the `monitors_read` permission is also required. operationId: TriggerInvestigation requestBody: content: @@ -145730,19 +145728,14 @@ paths: appKeyAuth: [] - AuthZ: - bits_investigations_write - - monitors_read summary: Trigger a Bits AI investigation tags: - Bits AI x-codegen-request-body-name: body "x-permission": - operator: AND + operator: OR permissions: - bits_investigations_write - - monitors_read - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/bits-ai/investigations/{id}: get: description: Get a specific Bits AI investigation by ID. @@ -145803,9 +145796,6 @@ paths: operator: OR permissions: - bits_investigations_read - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cases: get: description: >- diff --git a/examples/v2/bits-ai/GetInvestigation.java b/examples/v2/bits-ai/GetInvestigation.java index e9733fccc76..d12fac7e45f 100644 --- a/examples/v2/bits-ai/GetInvestigation.java +++ b/examples/v2/bits-ai/GetInvestigation.java @@ -9,7 +9,6 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = ApiClient.getDefaultApiClient(); defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); - defaultClient.setUnstableOperationEnabled("v2.getInvestigation", true); BitsAiApi apiInstance = new BitsAiApi(defaultClient); try { diff --git a/examples/v2/bits-ai/ListInvestigations.java b/examples/v2/bits-ai/ListInvestigations.java index ee7bfa751b1..833016a2733 100644 --- a/examples/v2/bits-ai/ListInvestigations.java +++ b/examples/v2/bits-ai/ListInvestigations.java @@ -9,7 +9,6 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = ApiClient.getDefaultApiClient(); defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); - defaultClient.setUnstableOperationEnabled("v2.listInvestigations", true); BitsAiApi apiInstance = new BitsAiApi(defaultClient); try { diff --git a/examples/v2/bits-ai/ListInvestigations_130750454.java b/examples/v2/bits-ai/ListInvestigations_130750454.java index 2dea8c9e820..82f05089ef4 100644 --- a/examples/v2/bits-ai/ListInvestigations_130750454.java +++ b/examples/v2/bits-ai/ListInvestigations_130750454.java @@ -9,7 +9,6 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = ApiClient.getDefaultApiClient(); defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); - defaultClient.setUnstableOperationEnabled("v2.listInvestigations", true); BitsAiApi apiInstance = new BitsAiApi(defaultClient); try { diff --git a/examples/v2/bits-ai/TriggerInvestigation.java b/examples/v2/bits-ai/TriggerInvestigation.java index 9dc9e0bd451..8cb9b331273 100644 --- a/examples/v2/bits-ai/TriggerInvestigation.java +++ b/examples/v2/bits-ai/TriggerInvestigation.java @@ -16,7 +16,6 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = ApiClient.getDefaultApiClient(); defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); - defaultClient.setUnstableOperationEnabled("v2.triggerInvestigation", true); BitsAiApi apiInstance = new BitsAiApi(defaultClient); TriggerInvestigationRequest body = diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index a00128a3616..de5d4aea621 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -1074,9 +1074,6 @@ public class ApiClient { put("v2.getOpenAPI", false); put("v2.listAPIs", false); put("v2.updateOpenAPI", false); - put("v2.getInvestigation", false); - put("v2.listInvestigations", false); - put("v2.triggerInvestigation", false); put("v2.createChangeRequest", false); put("v2.createChangeRequestBranch", false); put("v2.deleteChangeRequestDecision", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java b/src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java index 004af647bd6..8edb5926f5a 100644 --- a/src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java @@ -97,13 +97,6 @@ public CompletableFuture getInvestigationAsync(String */ public ApiResponse getInvestigationWithHttpInfo(String id) throws ApiException { - // Check if unstable operation is enabled - String operationId = "getInvestigation"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } Object localVarPostBody = null; // verify the required parameter 'id' is set @@ -148,16 +141,6 @@ public ApiResponse getInvestigationWithHttpInfo(String */ public CompletableFuture> getInvestigationWithHttpInfoAsync( String id) { - // Check if unstable operation is enabled - String operationId = "getInvestigation"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } Object localVarPostBody = null; // verify the required parameter 'id' is set @@ -371,13 +354,6 @@ public PaginationIterable listInvestigationsWith */ public ApiResponse listInvestigationsWithHttpInfo( ListInvestigationsOptionalParameters parameters) throws ApiException { - // Check if unstable operation is enabled - String operationId = "listInvestigations"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } Object localVarPostBody = null; Long pageOffset = parameters.pageOffset; Long pageLimit = parameters.pageLimit; @@ -423,16 +399,6 @@ public ApiResponse listInvestigationsWithHttpInfo( */ public CompletableFuture> listInvestigationsWithHttpInfoAsync(ListInvestigationsOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "listInvestigations"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } Object localVarPostBody = null; Long pageOffset = parameters.pageOffset; Long pageLimit = parameters.pageLimit; @@ -507,9 +473,9 @@ public CompletableFuture triggerInvestigationAsync } /** - * Trigger a Bits AI investigation from a monitor alert or a general investigation. The - * monitors_read permission is required when the trigger type is - * monitor_alert_trigger. + * Trigger a Bits AI investigation from a monitor alert or a general investigation. This endpoint + * requires the bits_investigations_write permission. When the trigger type is + * monitor_alert_trigger, the monitors_read permission is also required. * * @param body Trigger investigation request body. (required) * @return ApiResponse<TriggerInvestigationResponse> @@ -525,13 +491,6 @@ public CompletableFuture triggerInvestigationAsync */ public ApiResponse triggerInvestigationWithHttpInfo( TriggerInvestigationRequest body) throws ApiException { - // Check if unstable operation is enabled - String operationId = "triggerInvestigation"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } Object localVarPostBody = body; // verify the required parameter 'body' is set @@ -574,17 +533,6 @@ public ApiResponse triggerInvestigationWithHttpInf */ public CompletableFuture> triggerInvestigationWithHttpInfoAsync(TriggerInvestigationRequest body) { - // Check if unstable operation is enabled - String operationId = "triggerInvestigation"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } Object localVarPostBody = body; // verify the required parameter 'body' is set diff --git a/src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature b/src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature index 52c8a9b56fb..c690c0db0f0 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature @@ -9,61 +9,53 @@ Feature: Bits AI @generated @skip @team:ddoghq/bits-ai Scenario: Get a Bits AI investigation returns "Bad Request" response - Given operation "GetInvestigation" enabled - And new "GetInvestigation" request + Given new "GetInvestigation" request And request contains "id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @generated @skip @team:ddoghq/bits-ai Scenario: Get a Bits AI investigation returns "Not Found" response - Given operation "GetInvestigation" enabled - And new "GetInvestigation" request + Given new "GetInvestigation" request And request contains "id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:ddoghq/bits-ai Scenario: Get a Bits AI investigation returns "OK" response - Given operation "GetInvestigation" enabled - And new "GetInvestigation" request + Given new "GetInvestigation" request And request contains "id" parameter from "REPLACE.ME" When the request is sent Then the response status is 200 OK @generated @skip @team:ddoghq/bits-ai Scenario: List Bits AI investigations returns "Bad Request" response - Given operation "ListInvestigations" enabled - And new "ListInvestigations" request + Given new "ListInvestigations" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:ddoghq/bits-ai Scenario: List Bits AI investigations returns "OK" response - Given operation "ListInvestigations" enabled - And new "ListInvestigations" request + Given new "ListInvestigations" request When the request is sent Then the response status is 200 OK @generated @skip @team:ddoghq/bits-ai @with-pagination Scenario: List Bits AI investigations returns "OK" response with pagination - Given operation "ListInvestigations" enabled - And new "ListInvestigations" request + Given new "ListInvestigations" request When the request with pagination is sent Then the response status is 200 OK @generated @skip @team:ddoghq/bits-ai Scenario: Trigger a Bits AI investigation returns "Bad Request" response - Given operation "TriggerInvestigation" enabled - And new "TriggerInvestigation" request + Given new "TriggerInvestigation" request And body with value {"data": {"attributes": {"trigger": {"monitor_alert_trigger": {"event_id": "1234567890123456789", "event_ts": 1700000000000, "monitor_id": 12345678}, "type": "monitor_alert_trigger"}}, "type": "trigger_investigation_request"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:ddoghq/bits-ai Scenario: Trigger a Bits AI investigation returns "OK" response - Given operation "TriggerInvestigation" enabled - And new "TriggerInvestigation" request + Given new "TriggerInvestigation" request And body with value {"data": {"attributes": {"trigger": {"monitor_alert_trigger": {"event_id": "1234567890123456789", "event_ts": 1700000000000, "monitor_id": 12345678}, "type": "monitor_alert_trigger"}}, "type": "trigger_investigation_request"}} When the request is sent Then the response status is 200 OK