diff --git a/.apigentools-info b/.apigentools-info index 64d44af21161..3a9363544bc0 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-13 14:48:47.640089", - "spec_repo_commit": "5392df51" + "regenerated": "2024-12-13 15:30:16.623767", + "spec_repo_commit": "e7a707af" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-13 14:48:47.659296", - "spec_repo_commit": "5392df51" + "regenerated": "2024-12-13 15:30:16.642650", + "spec_repo_commit": "e7a707af" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 05e8f325c19e..e07f73c38b0e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -31356,6 +31356,9 @@ paths: permissions: - rum_delete_data - logs_delete_data + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/deletion/requests: get: description: Gets a list of data deletion requests based on several filter parameters. @@ -31431,6 +31434,9 @@ paths: permissions: - rum_delete_data - logs_delete_data + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/deletion/requests/{id}/cancel: put: description: Cancels a data deletion request by providing its ID. @@ -31473,6 +31479,9 @@ paths: permissions: - rum_delete_data - logs_delete_data + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/domain_allowlist: get: description: Get the domain allowlist for an organization. diff --git a/examples/v2/data-deletion/CancelDataDeletionRequest.rb b/examples/v2/data-deletion/CancelDataDeletionRequest.rb index ca4fafbffdd1..e995cdcd358b 100644 --- a/examples/v2/data-deletion/CancelDataDeletionRequest.rb +++ b/examples/v2/data-deletion/CancelDataDeletionRequest.rb @@ -1,6 +1,9 @@ # Cancels a data deletion request returns "OK" response require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.cancel_data_deletion_request".to_sym] = true +end api_instance = DatadogAPIClient::V2::DataDeletionAPI.new # there is a valid "deletion_request" in the system diff --git a/examples/v2/data-deletion/CreateDataDeletionRequest.rb b/examples/v2/data-deletion/CreateDataDeletionRequest.rb index 4bfac82a9d9e..5ad13527928a 100644 --- a/examples/v2/data-deletion/CreateDataDeletionRequest.rb +++ b/examples/v2/data-deletion/CreateDataDeletionRequest.rb @@ -1,6 +1,9 @@ # Creates a data deletion request returns "OK" response require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_data_deletion_request".to_sym] = true +end api_instance = DatadogAPIClient::V2::DataDeletionAPI.new body = DatadogAPIClient::V2::CreateDataDeletionRequestBody.new({ diff --git a/examples/v2/data-deletion/GetDataDeletionRequests.rb b/examples/v2/data-deletion/GetDataDeletionRequests.rb index 8f703aff8828..3050d79c15ff 100644 --- a/examples/v2/data-deletion/GetDataDeletionRequests.rb +++ b/examples/v2/data-deletion/GetDataDeletionRequests.rb @@ -1,5 +1,8 @@ # Gets a list of data deletion requests returns "OK" response require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_data_deletion_requests".to_sym] = true +end api_instance = DatadogAPIClient::V2::DataDeletionAPI.new p api_instance.get_data_deletion_requests() diff --git a/features/v2/data_deletion.feature b/features/v2/data_deletion.feature index 995dd9c0c3b7..fa8a94e55203 100644 --- a/features/v2/data_deletion.feature +++ b/features/v2/data_deletion.feature @@ -11,14 +11,16 @@ Feature: Data Deletion @replay-only @team:DataDog/supportability-engineering Scenario: Cancels a data deletion request returns "Bad Request" response - Given new "CancelDataDeletionRequest" request + Given operation "CancelDataDeletionRequest" enabled + And new "CancelDataDeletionRequest" request And request contains "id" parameter with value "id-1" When the request is sent Then the response status is 400 Bad Request @team:DataDog/supportability-engineering Scenario: Cancels a data deletion request returns "OK" response - Given there is a valid "deletion_request" in the system + Given operation "CancelDataDeletionRequest" enabled + And there is a valid "deletion_request" in the system And new "CancelDataDeletionRequest" request And request contains "id" parameter from "deletion_request.data.id" When the request is sent @@ -30,14 +32,16 @@ Feature: Data Deletion @replay-only @team:DataDog/supportability-engineering Scenario: Cancels a data deletion request returns "Precondition failed error" response - Given new "CancelDataDeletionRequest" request + Given operation "CancelDataDeletionRequest" enabled + And new "CancelDataDeletionRequest" request And request contains "id" parameter with value "-1" When the request is sent Then the response status is 412 Precondition failed error @generated @skip @team:DataDog/supportability-engineering Scenario: Creates a data deletion request returns "Bad Request" response - Given new "CreateDataDeletionRequest" request + Given operation "CreateDataDeletionRequest" enabled + And new "CreateDataDeletionRequest" request And request contains "product" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}}} When the request is sent @@ -45,7 +49,8 @@ Feature: Data Deletion @team:DataDog/supportability-engineering Scenario: Creates a data deletion request returns "OK" response - Given new "CreateDataDeletionRequest" request + Given operation "CreateDataDeletionRequest" enabled + And new "CreateDataDeletionRequest" request And request contains "product" parameter with value "logs" And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}}} When the request is sent @@ -56,7 +61,8 @@ Feature: Data Deletion @replay-only @team:DataDog/supportability-engineering Scenario: Creates a data deletion request returns "Precondition failed error" response - Given new "CreateDataDeletionRequest" request + Given operation "CreateDataDeletionRequest" enabled + And new "CreateDataDeletionRequest" request And request contains "product" parameter with value "logs" And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {}, "to": 1704063600000}}} When the request is sent @@ -64,13 +70,15 @@ Feature: Data Deletion @generated @skip @team:DataDog/supportability-engineering Scenario: Gets a list of data deletion requests returns "Bad Request" response - Given new "GetDataDeletionRequests" request + Given operation "GetDataDeletionRequests" enabled + And new "GetDataDeletionRequests" request When the request is sent Then the response status is 400 Bad Request @team:DataDog/supportability-engineering Scenario: Gets a list of data deletion requests returns "OK" response - Given there is a valid "deletion_request" in the system + Given operation "GetDataDeletionRequests" enabled + And there is a valid "deletion_request" in the system And new "GetDataDeletionRequests" request When the request is sent Then the response status is 200 OK diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 7752fa03cecb..2ca5a30792a5 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -197,6 +197,9 @@ def initialize "v2.get_active_billing_dimensions": false, "v2.get_billing_dimension_mapping": false, "v2.get_monthly_cost_attribution": false, + "v2.cancel_data_deletion_request": false, + "v2.create_data_deletion_request": false, + "v2.get_data_deletion_requests": false, "v2.create_dora_deployment": false, "v2.create_dora_incident": false, "v2.create_incident": false, diff --git a/lib/datadog_api_client/v2/api/data_deletion_api.rb b/lib/datadog_api_client/v2/api/data_deletion_api.rb index be17f0786f0d..d2fcdc9fa192 100644 --- a/lib/datadog_api_client/v2/api/data_deletion_api.rb +++ b/lib/datadog_api_client/v2/api/data_deletion_api.rb @@ -39,6 +39,12 @@ def cancel_data_deletion_request(id, opts = {}) # @param opts [Hash] the optional parameters # @return [Array<(CancelDataDeletionResponseBody, Integer, Hash)>] CancelDataDeletionResponseBody data, response status code and response headers def cancel_data_deletion_request_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.cancel_data_deletion_request".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.cancel_data_deletion_request") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.cancel_data_deletion_request")) + end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DataDeletionAPI.cancel_data_deletion_request ...' @@ -105,6 +111,12 @@ def create_data_deletion_request(product, body, opts = {}) # @param opts [Hash] the optional parameters # @return [Array<(CreateDataDeletionResponseBody, Integer, Hash)>] CreateDataDeletionResponseBody data, response status code and response headers def create_data_deletion_request_with_http_info(product, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_data_deletion_request".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_data_deletion_request") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_data_deletion_request")) + end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DataDeletionAPI.create_data_deletion_request ...' @@ -180,6 +192,12 @@ def get_data_deletion_requests(opts = {}) # @option opts [Integer] :page_size Sets the page size of the search. # @return [Array<(GetDataDeletionsResponseBody, Integer, Hash)>] GetDataDeletionsResponseBody data, response status code and response headers def get_data_deletion_requests_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_data_deletion_requests".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_data_deletion_requests") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_data_deletion_requests")) + end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DataDeletionAPI.get_data_deletion_requests ...'