diff --git a/.apigentools-info b/.apigentools-info
index 488bbc7366a..3d48d1fbd82 100644
--- a/.apigentools-info
+++ b/.apigentools-info
@@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
- "regenerated": "2024-12-02 19:29:43.029608",
- "spec_repo_commit": "7511c5f0"
+ "regenerated": "2024-12-03 10:17:35.829758",
+ "spec_repo_commit": "3f8bbb67"
},
"v2": {
"apigentools_version": "1.6.6",
- "regenerated": "2024-12-02 19:29:43.049579",
- "spec_repo_commit": "7511c5f0"
+ "regenerated": "2024-12-03 10:17:35.848888",
+ "spec_repo_commit": "3f8bbb67"
}
}
}
\ No newline at end of file
diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index 66bdf713cec..ed720de0d07 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -566,6 +566,13 @@ components:
example: 10
format: int64
type: integer
+ ProductName:
+ description: Name of the product to be deleted, either `logs` or `rum`.
+ in: path
+ name: product
+ required: true
+ schema:
+ type: string
ProjectIDPathParameter:
description: Project UUID
example: e555e290-ed65-49bd-ae18-8acbfcf18db7
@@ -581,6 +588,13 @@ components:
required: true
schema:
type: string
+ RequestId:
+ description: ID of the deletion request.
+ in: path
+ name: id
+ required: true
+ schema:
+ type: string
ResourceID:
description: 'Identifier, formatted as `type:id`. Supported types: `connection`,
`dashboard`, `notebook`, `security-rule`, `slo`.'
@@ -4197,6 +4211,14 @@ components:
- name
- expression
type: object
+ CancelDataDeletionResponseBody:
+ description: The response from the cancel data deletion request endpoint.
+ properties:
+ data:
+ $ref: '#/components/schemas/DataDeletionResponseItem'
+ meta:
+ $ref: '#/components/schemas/DataDeletionResponseMeta'
+ type: object
Case:
description: A case
properties:
@@ -6372,6 +6394,66 @@ components:
type: string
x-enum-varnames:
- COST_BY_ORG
+ CreateDataDeletionRequestBody:
+ description: Object needed to create a data deletion request.
+ properties:
+ data:
+ $ref: '#/components/schemas/CreateDataDeletionRequestBodyData'
+ required:
+ - data
+ type: object
+ CreateDataDeletionRequestBodyAttributes:
+ description: Attributes for creating a data deletion request.
+ properties:
+ from:
+ description: Start of requested time window, milliseconds since Unix epoch.
+ example: 1672527600000
+ format: int64
+ type: integer
+ indexes:
+ description: List of indexes for the search. If not provided, the search
+ is performed in all indexes.
+ example:
+ - index-1
+ - index-2
+ items:
+ description: Individual index.
+ type: string
+ type: array
+ query:
+ additionalProperties:
+ type: string
+ description: Query for creating a data deletion request.
+ example:
+ host: abc
+ service: xyz
+ type: object
+ to:
+ description: End of requested time window, milliseconds since Unix epoch.
+ example: 1704063600000
+ format: int64
+ type: integer
+ required:
+ - query
+ - from
+ - to
+ type: object
+ CreateDataDeletionRequestBodyData:
+ description: Data needed to create a data deletion request.
+ properties:
+ attributes:
+ $ref: '#/components/schemas/CreateDataDeletionRequestBodyAttributes'
+ required:
+ - attributes
+ type: object
+ CreateDataDeletionResponseBody:
+ description: The response from the create data deletion request endpoint.
+ properties:
+ data:
+ $ref: '#/components/schemas/DataDeletionResponseItem'
+ meta:
+ $ref: '#/components/schemas/DataDeletionResponseMeta'
+ type: object
CreateOpenAPIResponse:
description: Response for `CreateOpenAPI` operation.
properties:
@@ -7663,6 +7745,140 @@ components:
- INTEGRATION_SCREENBOARD
- INTEGRATION_TIMEBOARD
- HOST_TIMEBOARD
+ DataDeletionResponseItem:
+ description: The created data deletion request information.
+ properties:
+ attributes:
+ $ref: '#/components/schemas/DataDeletionResponseItemAttributes'
+ id:
+ description: The ID of the created data deletion request.
+ example: '1'
+ type: string
+ type:
+ description: The type of the request created.
+ example: deletion_request
+ type: string
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ DataDeletionResponseItemAttributes:
+ description: Deletion attribute for data deletion response.
+ properties:
+ created_at:
+ description: Creation time of the deletion request.
+ example: '2024-01-01T00:00:00.000000Z'
+ type: string
+ created_by:
+ description: User who created the deletion request.
+ example: test.user@datadoghq.com
+ type: string
+ from_time:
+ description: Start of requested time window, milliseconds since Unix epoch.
+ example: 1672527600000
+ format: int64
+ type: integer
+ indexes:
+ description: List of indexes for the search. If not provided, the search
+ is performed in all indexes.
+ example:
+ - index-1
+ - index-2
+ items:
+ description: Individual index.
+ type: string
+ type: array
+ is_created:
+ description: Whether the deletion request is fully created or not.
+ example: true
+ type: boolean
+ org_id:
+ description: Organization ID.
+ example: 321813
+ format: int64
+ type: integer
+ product:
+ description: Product name.
+ example: logs
+ type: string
+ query:
+ description: Query for creating a data deletion request.
+ example: service:xyz host:abc
+ type: string
+ starting_at:
+ description: Starting time of the process to delete the requested data.
+ example: '2024-01-01T02:00:00.000000Z'
+ type: string
+ status:
+ description: Status of the deletion request.
+ example: pending
+ type: string
+ to_time:
+ description: End of requested time window, milliseconds since Unix epoch.
+ example: 1704063600000
+ format: int64
+ type: integer
+ total_unrestricted:
+ description: Total number of elements to be deleted. Only the data accessible
+ to the current user that matches the query and timeframe provided will
+ be deleted.
+ example: 100
+ format: int64
+ type: integer
+ updated_at:
+ description: Update time of the deletion request.
+ example: '2024-01-01T00:00:00.000000Z'
+ type: string
+ required:
+ - created_at
+ - created_by
+ - from_time
+ - is_created
+ - org_id
+ - product
+ - query
+ - starting_at
+ - status
+ - to_time
+ - total_unrestricted
+ - updated_at
+ type: object
+ DataDeletionResponseMeta:
+ description: The metadata of the data deletion response.
+ properties:
+ count_product:
+ additionalProperties:
+ format: int64
+ type: integer
+ description: The total deletion requests created by product.
+ example:
+ logs: 8
+ rum: 7
+ type: object
+ count_status:
+ additionalProperties:
+ format: int64
+ type: integer
+ description: The total deletion requests created by status.
+ example:
+ completed: 10
+ pending: 5
+ type: object
+ next_page:
+ description: The next page when searching deletion requests created in the
+ current organization.
+ example: cGFnZTI=
+ type: string
+ product:
+ description: The product of the deletion request.
+ example: logs
+ type: string
+ request_status:
+ description: The status of the executed request.
+ example: canceled
+ type: string
+ type: object
DataScalarColumn:
description: A column containing the numerical results for a formula or query.
properties:
@@ -10649,6 +10865,17 @@ components:
type: string
x-enum-varnames:
- GCP_SERVICE_ACCOUNT
+ GetDataDeletionsResponseBody:
+ description: The response from the get data deletion requests endpoint.
+ properties:
+ data:
+ description: The list of data deletion requests that matches the query.
+ items:
+ $ref: '#/components/schemas/DataDeletionResponseItem'
+ type: array
+ meta:
+ $ref: '#/components/schemas/DataDeletionResponseMeta'
+ type: object
GetDeviceAttributes:
description: The device attributes
properties:
@@ -30912,6 +31139,172 @@ paths:
tags:
- Dashboard Lists
x-codegen-request-body-name: body
+ /api/v2/deletion/data/{product}:
+ post:
+ description: Creates a data deletion request by providing a query and a time
+ frame targeting the proper data.
+ operationId: CreateDataDeletionRequest
+ parameters:
+ - $ref: '#/components/parameters/ProductName'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateDataDeletionRequestBody'
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateDataDeletionResponseBody'
+ description: OK
+ '400':
+ $ref: '#/components/responses/BadRequestResponse'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '412':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResponse'
+ description: Precondition failed error
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ '500':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResponse'
+ description: Internal server error
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ summary: Creates a data deletion request
+ tags:
+ - Data Deletion
+ x-permission:
+ operator: OR
+ permissions:
+ - rum_delete_data
+ - logs_delete_data
+ /api/v2/deletion/requests:
+ get:
+ description: Gets a list of data deletion requests based on several filter parameters.
+ operationId: GetDataDeletionRequests
+ parameters:
+ - description: The next page of the previous search. If the next_page parameter
+ is included, the rest of the query elements are ignored.
+ example: cGFnZTI=
+ in: query
+ name: next_page
+ required: false
+ schema:
+ type: string
+ - description: Retrieve only the requests related to the given product.
+ example: logs
+ in: query
+ name: product
+ required: false
+ schema:
+ type: string
+ - description: Retrieve only the requests that matches the given query.
+ example: service:xyz host:abc
+ in: query
+ name: query
+ required: false
+ schema:
+ type: string
+ - description: Retrieve only the requests with the given status.
+ example: pending
+ in: query
+ name: status
+ required: false
+ schema:
+ type: string
+ - description: Sets the page size of the search.
+ example: '50'
+ in: query
+ name: page_size
+ required: false
+ schema:
+ default: 50
+ format: int64
+ maximum: 50
+ minimum: 1
+ type: integer
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GetDataDeletionsResponseBody'
+ description: OK
+ '400':
+ $ref: '#/components/responses/BadRequestResponse'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ '500':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResponse'
+ description: Internal server error
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ summary: Gets a list of data deletion requests
+ tags:
+ - Data Deletion
+ x-permission:
+ operator: OR
+ permissions:
+ - rum_delete_data
+ - logs_delete_data
+ /api/v2/deletion/requests/{id}/cancel:
+ put:
+ description: Cancels a data deletion request by providing its ID.
+ operationId: CancelDataDeletionRequest
+ parameters:
+ - $ref: '#/components/parameters/RequestId'
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CancelDataDeletionResponseBody'
+ description: OK
+ '400':
+ $ref: '#/components/responses/BadRequestResponse'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '412':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResponse'
+ description: Precondition failed error
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ '500':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResponse'
+ description: Internal server error
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ summary: Cancels a data deletion request
+ tags:
+ - Data Deletion
+ x-permission:
+ operator: OR
+ permissions:
+ - rum_delete_data
+ - logs_delete_data
/api/v2/domain_allowlist:
get:
description: Get the domain allowlist for an organization.
@@ -44061,6 +44454,10 @@ tags:
organization.'
name: Dashboard Lists
+- description: The Data Deletion API allows the user to target and delete data from
+ the allowed products. It's currently enabled for Logs and RUM and depends on `logs_delete_data`
+ and `rum_delete_data` permissions respectively.
+ name: Data Deletion
- description: 'Configure your Datadog Email Domain Allowlist directly through the
Datadog API.
diff --git a/examples/v2/data-deletion/CancelDataDeletionRequest.java b/examples/v2/data-deletion/CancelDataDeletionRequest.java
new file mode 100644
index 00000000000..28c46367f20
--- /dev/null
+++ b/examples/v2/data-deletion/CancelDataDeletionRequest.java
@@ -0,0 +1,28 @@
+// Cancels a data deletion request returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.DataDeletionApi;
+import com.datadog.api.client.v2.model.CancelDataDeletionResponseBody;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ DataDeletionApi apiInstance = new DataDeletionApi(defaultClient);
+
+ // there is a valid "deletion_request" in the system
+ String DELETION_REQUEST_DATA_ID = System.getenv("DELETION_REQUEST_DATA_ID");
+
+ try {
+ CancelDataDeletionResponseBody result =
+ apiInstance.cancelDataDeletionRequest(DELETION_REQUEST_DATA_ID);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling DataDeletionApi#cancelDataDeletionRequest");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/data-deletion/CreateDataDeletionRequest.java b/examples/v2/data-deletion/CreateDataDeletionRequest.java
new file mode 100644
index 00000000000..84a1afb4682
--- /dev/null
+++ b/examples/v2/data-deletion/CreateDataDeletionRequest.java
@@ -0,0 +1,42 @@
+// Creates a data deletion request returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.DataDeletionApi;
+import com.datadog.api.client.v2.model.CreateDataDeletionRequestBody;
+import com.datadog.api.client.v2.model.CreateDataDeletionRequestBodyAttributes;
+import com.datadog.api.client.v2.model.CreateDataDeletionRequestBodyData;
+import com.datadog.api.client.v2.model.CreateDataDeletionResponseBody;
+import java.util.Arrays;
+import java.util.Map;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ DataDeletionApi apiInstance = new DataDeletionApi(defaultClient);
+
+ CreateDataDeletionRequestBody body =
+ new CreateDataDeletionRequestBody()
+ .data(
+ new CreateDataDeletionRequestBodyData()
+ .attributes(
+ new CreateDataDeletionRequestBodyAttributes()
+ .from(1672527600000L)
+ .indexes(Arrays.asList("index-1", "index-2"))
+ .query(
+ Map.ofEntries(
+ Map.entry("host", "abc"), Map.entry("service", "xyz")))
+ .to(1704063600000L)));
+
+ try {
+ CreateDataDeletionResponseBody result = apiInstance.createDataDeletionRequest("logs", body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling DataDeletionApi#createDataDeletionRequest");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/data-deletion/GetDataDeletionRequests.java b/examples/v2/data-deletion/GetDataDeletionRequests.java
new file mode 100644
index 00000000000..7e02c52f9b5
--- /dev/null
+++ b/examples/v2/data-deletion/GetDataDeletionRequests.java
@@ -0,0 +1,24 @@
+// Gets a list of data deletion requests returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.DataDeletionApi;
+import com.datadog.api.client.v2.model.GetDataDeletionsResponseBody;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ DataDeletionApi apiInstance = new DataDeletionApi(defaultClient);
+
+ try {
+ GetDataDeletionsResponseBody result = apiInstance.getDataDeletionRequests();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling DataDeletionApi#getDataDeletionRequests");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/api/DataDeletionApi.java b/src/main/java/com/datadog/api/client/v2/api/DataDeletionApi.java
new file mode 100644
index 00000000000..73aebfb7f79
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/api/DataDeletionApi.java
@@ -0,0 +1,595 @@
+package com.datadog.api.client.v2.api;
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.ApiResponse;
+import com.datadog.api.client.Pair;
+import com.datadog.api.client.v2.model.CancelDataDeletionResponseBody;
+import com.datadog.api.client.v2.model.CreateDataDeletionRequestBody;
+import com.datadog.api.client.v2.model.CreateDataDeletionResponseBody;
+import com.datadog.api.client.v2.model.GetDataDeletionsResponseBody;
+import jakarta.ws.rs.client.Invocation;
+import jakarta.ws.rs.core.GenericType;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class DataDeletionApi {
+ private ApiClient apiClient;
+
+ public DataDeletionApi() {
+ this(ApiClient.getDefaultApiClient());
+ }
+
+ public DataDeletionApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Get the API client.
+ *
+ * @return API client
+ */
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ /**
+ * Set the API client.
+ *
+ * @param apiClient an instance of API client
+ */
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Cancels a data deletion request.
+ *
+ *
See {@link #cancelDataDeletionRequestWithHttpInfo}.
+ *
+ * @param id ID of the deletion request. (required)
+ * @return CancelDataDeletionResponseBody
+ * @throws ApiException if fails to make API call
+ */
+ public CancelDataDeletionResponseBody cancelDataDeletionRequest(String id) throws ApiException {
+ return cancelDataDeletionRequestWithHttpInfo(id).getData();
+ }
+
+ /**
+ * Cancels a data deletion request.
+ *
+ *
See {@link #cancelDataDeletionRequestWithHttpInfoAsync}.
+ *
+ * @param id ID of the deletion request. (required)
+ * @return CompletableFuture<CancelDataDeletionResponseBody>
+ */
+ public CompletableFuture cancelDataDeletionRequestAsync(
+ String id) {
+ return cancelDataDeletionRequestWithHttpInfoAsync(id)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Cancels a data deletion request by providing its ID.
+ *
+ * @param id ID of the deletion request. (required)
+ * @return ApiResponse<CancelDataDeletionResponseBody>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 412 | Precondition failed error | - |
+ * | 429 | Too many requests | - |
+ * | 500 | Internal server error | - |
+ *
+ */
+ public ApiResponse cancelDataDeletionRequestWithHttpInfo(
+ String id) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'id' is set
+ if (id == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'id' when calling cancelDataDeletionRequest");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/deletion/requests/{id}/cancel"
+ .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.DataDeletionApi.cancelDataDeletionRequest",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "PUT",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Cancels a data deletion request.
+ *
+ * See {@link #cancelDataDeletionRequestWithHttpInfo}.
+ *
+ * @param id ID of the deletion request. (required)
+ * @return CompletableFuture<ApiResponse<CancelDataDeletionResponseBody>>
+ */
+ public CompletableFuture>
+ cancelDataDeletionRequestWithHttpInfoAsync(String id) {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'id' is set
+ if (id == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'id' when calling cancelDataDeletionRequest"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/deletion/requests/{id}/cancel"
+ .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.DataDeletionApi.cancelDataDeletionRequest",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "PUT",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Creates a data deletion request.
+ *
+ * See {@link #createDataDeletionRequestWithHttpInfo}.
+ *
+ * @param product Name of the product to be deleted, either logs or rum.
+ * (required)
+ * @param body (required)
+ * @return CreateDataDeletionResponseBody
+ * @throws ApiException if fails to make API call
+ */
+ public CreateDataDeletionResponseBody createDataDeletionRequest(
+ String product, CreateDataDeletionRequestBody body) throws ApiException {
+ return createDataDeletionRequestWithHttpInfo(product, body).getData();
+ }
+
+ /**
+ * Creates a data deletion request.
+ *
+ *
See {@link #createDataDeletionRequestWithHttpInfoAsync}.
+ *
+ * @param product Name of the product to be deleted, either logs or rum.
+ * (required)
+ * @param body (required)
+ * @return CompletableFuture<CreateDataDeletionResponseBody>
+ */
+ public CompletableFuture createDataDeletionRequestAsync(
+ String product, CreateDataDeletionRequestBody body) {
+ return createDataDeletionRequestWithHttpInfoAsync(product, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Creates a data deletion request by providing a query and a time frame targeting the proper
+ * data.
+ *
+ * @param product Name of the product to be deleted, either logs or rum.
+ * (required)
+ * @param body (required)
+ * @return ApiResponse<CreateDataDeletionResponseBody>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 412 | Precondition failed error | - |
+ * | 429 | Too many requests | - |
+ * | 500 | Internal server error | - |
+ *
+ */
+ public ApiResponse createDataDeletionRequestWithHttpInfo(
+ String product, CreateDataDeletionRequestBody body) throws ApiException {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'product' is set
+ if (product == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'product' when calling createDataDeletionRequest");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling createDataDeletionRequest");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/deletion/data/{product}"
+ .replaceAll("\\{" + "product" + "\\}", apiClient.escapeString(product.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.DataDeletionApi.createDataDeletionRequest",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Creates a data deletion request.
+ *
+ * See {@link #createDataDeletionRequestWithHttpInfo}.
+ *
+ * @param product Name of the product to be deleted, either logs or rum.
+ * (required)
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<CreateDataDeletionResponseBody>>
+ */
+ public CompletableFuture>
+ createDataDeletionRequestWithHttpInfoAsync(
+ String product, CreateDataDeletionRequestBody body) {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'product' is set
+ if (product == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'product' when calling createDataDeletionRequest"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling createDataDeletionRequest"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/deletion/data/{product}"
+ .replaceAll("\\{" + "product" + "\\}", apiClient.escapeString(product.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.DataDeletionApi.createDataDeletionRequest",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /** Manage optional parameters to getDataDeletionRequests. */
+ public static class GetDataDeletionRequestsOptionalParameters {
+ private String nextPage;
+ private String product;
+ private String query;
+ private String status;
+ private Long pageSize;
+
+ /**
+ * Set nextPage.
+ *
+ * @param nextPage The next page of the previous search. If the next_page parameter is included,
+ * the rest of the query elements are ignored. (optional)
+ * @return GetDataDeletionRequestsOptionalParameters
+ */
+ public GetDataDeletionRequestsOptionalParameters nextPage(String nextPage) {
+ this.nextPage = nextPage;
+ return this;
+ }
+
+ /**
+ * Set product.
+ *
+ * @param product Retrieve only the requests related to the given product. (optional)
+ * @return GetDataDeletionRequestsOptionalParameters
+ */
+ public GetDataDeletionRequestsOptionalParameters product(String product) {
+ this.product = product;
+ return this;
+ }
+
+ /**
+ * Set query.
+ *
+ * @param query Retrieve only the requests that matches the given query. (optional)
+ * @return GetDataDeletionRequestsOptionalParameters
+ */
+ public GetDataDeletionRequestsOptionalParameters query(String query) {
+ this.query = query;
+ return this;
+ }
+
+ /**
+ * Set status.
+ *
+ * @param status Retrieve only the requests with the given status. (optional)
+ * @return GetDataDeletionRequestsOptionalParameters
+ */
+ public GetDataDeletionRequestsOptionalParameters status(String status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Set pageSize.
+ *
+ * @param pageSize Sets the page size of the search. (optional, default to 50)
+ * @return GetDataDeletionRequestsOptionalParameters
+ */
+ public GetDataDeletionRequestsOptionalParameters pageSize(Long pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+ }
+
+ /**
+ * Gets a list of data deletion requests.
+ *
+ * See {@link #getDataDeletionRequestsWithHttpInfo}.
+ *
+ * @return GetDataDeletionsResponseBody
+ * @throws ApiException if fails to make API call
+ */
+ public GetDataDeletionsResponseBody getDataDeletionRequests() throws ApiException {
+ return getDataDeletionRequestsWithHttpInfo(new GetDataDeletionRequestsOptionalParameters())
+ .getData();
+ }
+
+ /**
+ * Gets a list of data deletion requests.
+ *
+ *
See {@link #getDataDeletionRequestsWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<GetDataDeletionsResponseBody>
+ */
+ public CompletableFuture getDataDeletionRequestsAsync() {
+ return getDataDeletionRequestsWithHttpInfoAsync(new GetDataDeletionRequestsOptionalParameters())
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Gets a list of data deletion requests.
+ *
+ * See {@link #getDataDeletionRequestsWithHttpInfo}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return GetDataDeletionsResponseBody
+ * @throws ApiException if fails to make API call
+ */
+ public GetDataDeletionsResponseBody getDataDeletionRequests(
+ GetDataDeletionRequestsOptionalParameters parameters) throws ApiException {
+ return getDataDeletionRequestsWithHttpInfo(parameters).getData();
+ }
+
+ /**
+ * Gets a list of data deletion requests.
+ *
+ *
See {@link #getDataDeletionRequestsWithHttpInfoAsync}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<GetDataDeletionsResponseBody>
+ */
+ public CompletableFuture getDataDeletionRequestsAsync(
+ GetDataDeletionRequestsOptionalParameters parameters) {
+ return getDataDeletionRequestsWithHttpInfoAsync(parameters)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Gets a list of data deletion requests based on several filter parameters.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return ApiResponse<GetDataDeletionsResponseBody>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ * | 500 | Internal server error | - |
+ *
+ */
+ public ApiResponse getDataDeletionRequestsWithHttpInfo(
+ GetDataDeletionRequestsOptionalParameters parameters) throws ApiException {
+ Object localVarPostBody = null;
+ String nextPage = parameters.nextPage;
+ String product = parameters.product;
+ String query = parameters.query;
+ String status = parameters.status;
+ Long pageSize = parameters.pageSize;
+ // create path and map variables
+ String localVarPath = "/api/v2/deletion/requests";
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "next_page", nextPage));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize));
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.DataDeletionApi.getDataDeletionRequests",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Gets a list of data deletion requests.
+ *
+ * See {@link #getDataDeletionRequestsWithHttpInfo}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ApiResponse<GetDataDeletionsResponseBody>>
+ */
+ public CompletableFuture>
+ getDataDeletionRequestsWithHttpInfoAsync(
+ GetDataDeletionRequestsOptionalParameters parameters) {
+ Object localVarPostBody = null;
+ String nextPage = parameters.nextPage;
+ String product = parameters.product;
+ String query = parameters.query;
+ String status = parameters.status;
+ Long pageSize = parameters.pageSize;
+ // create path and map variables
+ String localVarPath = "/api/v2/deletion/requests";
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "next_page", nextPage));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize));
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.DataDeletionApi.getDataDeletionRequests",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CancelDataDeletionResponseBody.java b/src/main/java/com/datadog/api/client/v2/model/CancelDataDeletionResponseBody.java
new file mode 100644
index 00000000000..ca738fb45f0
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CancelDataDeletionResponseBody.java
@@ -0,0 +1,168 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** The response from the cancel data deletion request endpoint. */
+@JsonPropertyOrder({
+ CancelDataDeletionResponseBody.JSON_PROPERTY_DATA,
+ CancelDataDeletionResponseBody.JSON_PROPERTY_META
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CancelDataDeletionResponseBody {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private DataDeletionResponseItem data;
+
+ public static final String JSON_PROPERTY_META = "meta";
+ private DataDeletionResponseMeta meta;
+
+ public CancelDataDeletionResponseBody data(DataDeletionResponseItem data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ return this;
+ }
+
+ /**
+ * The created data deletion request information.
+ *
+ * @return data
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public DataDeletionResponseItem getData() {
+ return data;
+ }
+
+ public void setData(DataDeletionResponseItem data) {
+ this.data = data;
+ }
+
+ public CancelDataDeletionResponseBody meta(DataDeletionResponseMeta meta) {
+ this.meta = meta;
+ this.unparsed |= meta.unparsed;
+ return this;
+ }
+
+ /**
+ * The metadata of the data deletion response.
+ *
+ * @return meta
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_META)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public DataDeletionResponseMeta getMeta() {
+ return meta;
+ }
+
+ public void setMeta(DataDeletionResponseMeta meta) {
+ this.meta = meta;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return CancelDataDeletionResponseBody
+ */
+ @JsonAnySetter
+ public CancelDataDeletionResponseBody putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this CancelDataDeletionResponseBody object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CancelDataDeletionResponseBody cancelDataDeletionResponseBody =
+ (CancelDataDeletionResponseBody) o;
+ return Objects.equals(this.data, cancelDataDeletionResponseBody.data)
+ && Objects.equals(this.meta, cancelDataDeletionResponseBody.meta)
+ && Objects.equals(
+ this.additionalProperties, cancelDataDeletionResponseBody.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, meta, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CancelDataDeletionResponseBody {\n");
+ sb.append(" data: ").append(toIndentedString(data)).append("\n");
+ sb.append(" meta: ").append(toIndentedString(meta)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateDataDeletionRequestBody.java b/src/main/java/com/datadog/api/client/v2/model/CreateDataDeletionRequestBody.java
new file mode 100644
index 00000000000..7d5ee1bebed
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CreateDataDeletionRequestBody.java
@@ -0,0 +1,147 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** Object needed to create a data deletion request. */
+@JsonPropertyOrder({CreateDataDeletionRequestBody.JSON_PROPERTY_DATA})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CreateDataDeletionRequestBody {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private CreateDataDeletionRequestBodyData data;
+
+ public CreateDataDeletionRequestBody() {}
+
+ @JsonCreator
+ public CreateDataDeletionRequestBody(
+ @JsonProperty(required = true, value = JSON_PROPERTY_DATA)
+ CreateDataDeletionRequestBodyData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ }
+
+ public CreateDataDeletionRequestBody data(CreateDataDeletionRequestBodyData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ return this;
+ }
+
+ /**
+ * Data needed to create a data deletion request.
+ *
+ * @return data
+ */
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public CreateDataDeletionRequestBodyData getData() {
+ return data;
+ }
+
+ public void setData(CreateDataDeletionRequestBodyData data) {
+ this.data = data;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return CreateDataDeletionRequestBody
+ */
+ @JsonAnySetter
+ public CreateDataDeletionRequestBody putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this CreateDataDeletionRequestBody object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateDataDeletionRequestBody createDataDeletionRequestBody = (CreateDataDeletionRequestBody) o;
+ return Objects.equals(this.data, createDataDeletionRequestBody.data)
+ && Objects.equals(
+ this.additionalProperties, createDataDeletionRequestBody.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CreateDataDeletionRequestBody {\n");
+ sb.append(" data: ").append(toIndentedString(data)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateDataDeletionRequestBodyAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateDataDeletionRequestBodyAttributes.java
new file mode 100644
index 00000000000..7a721d56beb
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CreateDataDeletionRequestBodyAttributes.java
@@ -0,0 +1,246 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/** Attributes for creating a data deletion request. */
+@JsonPropertyOrder({
+ CreateDataDeletionRequestBodyAttributes.JSON_PROPERTY_FROM,
+ CreateDataDeletionRequestBodyAttributes.JSON_PROPERTY_INDEXES,
+ CreateDataDeletionRequestBodyAttributes.JSON_PROPERTY_QUERY,
+ CreateDataDeletionRequestBodyAttributes.JSON_PROPERTY_TO
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CreateDataDeletionRequestBodyAttributes {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_FROM = "from";
+ private Long from;
+
+ public static final String JSON_PROPERTY_INDEXES = "indexes";
+ private List indexes = null;
+
+ public static final String JSON_PROPERTY_QUERY = "query";
+ private Map query = new HashMap();
+
+ public static final String JSON_PROPERTY_TO = "to";
+ private Long to;
+
+ public CreateDataDeletionRequestBodyAttributes() {}
+
+ @JsonCreator
+ public CreateDataDeletionRequestBodyAttributes(
+ @JsonProperty(required = true, value = JSON_PROPERTY_FROM) Long from,
+ @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) Map query,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TO) Long to) {
+ this.from = from;
+ this.query = query;
+ this.to = to;
+ }
+
+ public CreateDataDeletionRequestBodyAttributes from(Long from) {
+ this.from = from;
+ return this;
+ }
+
+ /**
+ * Start of requested time window, milliseconds since Unix epoch.
+ *
+ * @return from
+ */
+ @JsonProperty(JSON_PROPERTY_FROM)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Long getFrom() {
+ return from;
+ }
+
+ public void setFrom(Long from) {
+ this.from = from;
+ }
+
+ public CreateDataDeletionRequestBodyAttributes indexes(List indexes) {
+ this.indexes = indexes;
+ return this;
+ }
+
+ public CreateDataDeletionRequestBodyAttributes addIndexesItem(String indexesItem) {
+ if (this.indexes == null) {
+ this.indexes = new ArrayList<>();
+ }
+ this.indexes.add(indexesItem);
+ return this;
+ }
+
+ /**
+ * List of indexes for the search. If not provided, the search is performed in all indexes.
+ *
+ * @return indexes
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_INDEXES)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public List getIndexes() {
+ return indexes;
+ }
+
+ public void setIndexes(List indexes) {
+ this.indexes = indexes;
+ }
+
+ public CreateDataDeletionRequestBodyAttributes query(Map query) {
+ this.query = query;
+ return this;
+ }
+
+ public CreateDataDeletionRequestBodyAttributes putQueryItem(String key, String queryItem) {
+ this.query.put(key, queryItem);
+ return this;
+ }
+
+ /**
+ * Query for creating a data deletion request.
+ *
+ * @return query
+ */
+ @JsonProperty(JSON_PROPERTY_QUERY)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Map getQuery() {
+ return query;
+ }
+
+ public void setQuery(Map query) {
+ this.query = query;
+ }
+
+ public CreateDataDeletionRequestBodyAttributes to(Long to) {
+ this.to = to;
+ return this;
+ }
+
+ /**
+ * End of requested time window, milliseconds since Unix epoch.
+ *
+ * @return to
+ */
+ @JsonProperty(JSON_PROPERTY_TO)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Long getTo() {
+ return to;
+ }
+
+ public void setTo(Long to) {
+ this.to = to;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return CreateDataDeletionRequestBodyAttributes
+ */
+ @JsonAnySetter
+ public CreateDataDeletionRequestBodyAttributes putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this CreateDataDeletionRequestBodyAttributes object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateDataDeletionRequestBodyAttributes createDataDeletionRequestBodyAttributes =
+ (CreateDataDeletionRequestBodyAttributes) o;
+ return Objects.equals(this.from, createDataDeletionRequestBodyAttributes.from)
+ && Objects.equals(this.indexes, createDataDeletionRequestBodyAttributes.indexes)
+ && Objects.equals(this.query, createDataDeletionRequestBodyAttributes.query)
+ && Objects.equals(this.to, createDataDeletionRequestBodyAttributes.to)
+ && Objects.equals(
+ this.additionalProperties,
+ createDataDeletionRequestBodyAttributes.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(from, indexes, query, to, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CreateDataDeletionRequestBodyAttributes {\n");
+ sb.append(" from: ").append(toIndentedString(from)).append("\n");
+ sb.append(" indexes: ").append(toIndentedString(indexes)).append("\n");
+ sb.append(" query: ").append(toIndentedString(query)).append("\n");
+ sb.append(" to: ").append(toIndentedString(to)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateDataDeletionRequestBodyData.java b/src/main/java/com/datadog/api/client/v2/model/CreateDataDeletionRequestBodyData.java
new file mode 100644
index 00000000000..bad6663ddf9
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CreateDataDeletionRequestBodyData.java
@@ -0,0 +1,149 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** Data needed to create a data deletion request. */
+@JsonPropertyOrder({CreateDataDeletionRequestBodyData.JSON_PROPERTY_ATTRIBUTES})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CreateDataDeletionRequestBodyData {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
+ private CreateDataDeletionRequestBodyAttributes attributes;
+
+ public CreateDataDeletionRequestBodyData() {}
+
+ @JsonCreator
+ public CreateDataDeletionRequestBodyData(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES)
+ CreateDataDeletionRequestBodyAttributes attributes) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ }
+
+ public CreateDataDeletionRequestBodyData attributes(
+ CreateDataDeletionRequestBodyAttributes attributes) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ return this;
+ }
+
+ /**
+ * Attributes for creating a data deletion request.
+ *
+ * @return attributes
+ */
+ @JsonProperty(JSON_PROPERTY_ATTRIBUTES)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public CreateDataDeletionRequestBodyAttributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(CreateDataDeletionRequestBodyAttributes attributes) {
+ this.attributes = attributes;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return CreateDataDeletionRequestBodyData
+ */
+ @JsonAnySetter
+ public CreateDataDeletionRequestBodyData putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this CreateDataDeletionRequestBodyData object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateDataDeletionRequestBodyData createDataDeletionRequestBodyData =
+ (CreateDataDeletionRequestBodyData) o;
+ return Objects.equals(this.attributes, createDataDeletionRequestBodyData.attributes)
+ && Objects.equals(
+ this.additionalProperties, createDataDeletionRequestBodyData.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(attributes, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CreateDataDeletionRequestBodyData {\n");
+ sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateDataDeletionResponseBody.java b/src/main/java/com/datadog/api/client/v2/model/CreateDataDeletionResponseBody.java
new file mode 100644
index 00000000000..5683ad0a061
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CreateDataDeletionResponseBody.java
@@ -0,0 +1,168 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** The response from the create data deletion request endpoint. */
+@JsonPropertyOrder({
+ CreateDataDeletionResponseBody.JSON_PROPERTY_DATA,
+ CreateDataDeletionResponseBody.JSON_PROPERTY_META
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CreateDataDeletionResponseBody {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private DataDeletionResponseItem data;
+
+ public static final String JSON_PROPERTY_META = "meta";
+ private DataDeletionResponseMeta meta;
+
+ public CreateDataDeletionResponseBody data(DataDeletionResponseItem data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ return this;
+ }
+
+ /**
+ * The created data deletion request information.
+ *
+ * @return data
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public DataDeletionResponseItem getData() {
+ return data;
+ }
+
+ public void setData(DataDeletionResponseItem data) {
+ this.data = data;
+ }
+
+ public CreateDataDeletionResponseBody meta(DataDeletionResponseMeta meta) {
+ this.meta = meta;
+ this.unparsed |= meta.unparsed;
+ return this;
+ }
+
+ /**
+ * The metadata of the data deletion response.
+ *
+ * @return meta
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_META)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public DataDeletionResponseMeta getMeta() {
+ return meta;
+ }
+
+ public void setMeta(DataDeletionResponseMeta meta) {
+ this.meta = meta;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return CreateDataDeletionResponseBody
+ */
+ @JsonAnySetter
+ public CreateDataDeletionResponseBody putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this CreateDataDeletionResponseBody object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateDataDeletionResponseBody createDataDeletionResponseBody =
+ (CreateDataDeletionResponseBody) o;
+ return Objects.equals(this.data, createDataDeletionResponseBody.data)
+ && Objects.equals(this.meta, createDataDeletionResponseBody.meta)
+ && Objects.equals(
+ this.additionalProperties, createDataDeletionResponseBody.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, meta, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CreateDataDeletionResponseBody {\n");
+ sb.append(" data: ").append(toIndentedString(data)).append("\n");
+ sb.append(" meta: ").append(toIndentedString(meta)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/DataDeletionResponseItem.java b/src/main/java/com/datadog/api/client/v2/model/DataDeletionResponseItem.java
new file mode 100644
index 00000000000..cd5616b9169
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/DataDeletionResponseItem.java
@@ -0,0 +1,204 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** The created data deletion request information. */
+@JsonPropertyOrder({
+ DataDeletionResponseItem.JSON_PROPERTY_ATTRIBUTES,
+ DataDeletionResponseItem.JSON_PROPERTY_ID,
+ DataDeletionResponseItem.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class DataDeletionResponseItem {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
+ private DataDeletionResponseItemAttributes attributes;
+
+ public static final String JSON_PROPERTY_ID = "id";
+ private String id;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private String type;
+
+ public DataDeletionResponseItem() {}
+
+ @JsonCreator
+ public DataDeletionResponseItem(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES)
+ DataDeletionResponseItemAttributes attributes,
+ @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ this.id = id;
+ this.type = type;
+ }
+
+ public DataDeletionResponseItem attributes(DataDeletionResponseItemAttributes attributes) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ return this;
+ }
+
+ /**
+ * Deletion attribute for data deletion response.
+ *
+ * @return attributes
+ */
+ @JsonProperty(JSON_PROPERTY_ATTRIBUTES)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public DataDeletionResponseItemAttributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(DataDeletionResponseItemAttributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public DataDeletionResponseItem id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * The ID of the created data deletion request.
+ *
+ * @return id
+ */
+ @JsonProperty(JSON_PROPERTY_ID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public DataDeletionResponseItem type(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * The type of the request created.
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return DataDeletionResponseItem
+ */
+ @JsonAnySetter
+ public DataDeletionResponseItem putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this DataDeletionResponseItem object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ DataDeletionResponseItem dataDeletionResponseItem = (DataDeletionResponseItem) o;
+ return Objects.equals(this.attributes, dataDeletionResponseItem.attributes)
+ && Objects.equals(this.id, dataDeletionResponseItem.id)
+ && Objects.equals(this.type, dataDeletionResponseItem.type)
+ && Objects.equals(this.additionalProperties, dataDeletionResponseItem.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(attributes, id, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class DataDeletionResponseItem {\n");
+ sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/DataDeletionResponseItemAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DataDeletionResponseItemAttributes.java
new file mode 100644
index 00000000000..f5bda28afd4
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/DataDeletionResponseItemAttributes.java
@@ -0,0 +1,509 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/** Deletion attribute for data deletion response. */
+@JsonPropertyOrder({
+ DataDeletionResponseItemAttributes.JSON_PROPERTY_CREATED_AT,
+ DataDeletionResponseItemAttributes.JSON_PROPERTY_CREATED_BY,
+ DataDeletionResponseItemAttributes.JSON_PROPERTY_FROM_TIME,
+ DataDeletionResponseItemAttributes.JSON_PROPERTY_INDEXES,
+ DataDeletionResponseItemAttributes.JSON_PROPERTY_IS_CREATED,
+ DataDeletionResponseItemAttributes.JSON_PROPERTY_ORG_ID,
+ DataDeletionResponseItemAttributes.JSON_PROPERTY_PRODUCT,
+ DataDeletionResponseItemAttributes.JSON_PROPERTY_QUERY,
+ DataDeletionResponseItemAttributes.JSON_PROPERTY_STARTING_AT,
+ DataDeletionResponseItemAttributes.JSON_PROPERTY_STATUS,
+ DataDeletionResponseItemAttributes.JSON_PROPERTY_TO_TIME,
+ DataDeletionResponseItemAttributes.JSON_PROPERTY_TOTAL_UNRESTRICTED,
+ DataDeletionResponseItemAttributes.JSON_PROPERTY_UPDATED_AT
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class DataDeletionResponseItemAttributes {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_CREATED_AT = "created_at";
+ private String createdAt;
+
+ public static final String JSON_PROPERTY_CREATED_BY = "created_by";
+ private String createdBy;
+
+ public static final String JSON_PROPERTY_FROM_TIME = "from_time";
+ private Long fromTime;
+
+ public static final String JSON_PROPERTY_INDEXES = "indexes";
+ private List indexes = null;
+
+ public static final String JSON_PROPERTY_IS_CREATED = "is_created";
+ private Boolean isCreated;
+
+ public static final String JSON_PROPERTY_ORG_ID = "org_id";
+ private Long orgId;
+
+ public static final String JSON_PROPERTY_PRODUCT = "product";
+ private String product;
+
+ public static final String JSON_PROPERTY_QUERY = "query";
+ private String query;
+
+ public static final String JSON_PROPERTY_STARTING_AT = "starting_at";
+ private String startingAt;
+
+ public static final String JSON_PROPERTY_STATUS = "status";
+ private String status;
+
+ public static final String JSON_PROPERTY_TO_TIME = "to_time";
+ private Long toTime;
+
+ public static final String JSON_PROPERTY_TOTAL_UNRESTRICTED = "total_unrestricted";
+ private Long totalUnrestricted;
+
+ public static final String JSON_PROPERTY_UPDATED_AT = "updated_at";
+ private String updatedAt;
+
+ public DataDeletionResponseItemAttributes() {}
+
+ @JsonCreator
+ public DataDeletionResponseItemAttributes(
+ @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) String createdAt,
+ @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) String createdBy,
+ @JsonProperty(required = true, value = JSON_PROPERTY_FROM_TIME) Long fromTime,
+ @JsonProperty(required = true, value = JSON_PROPERTY_IS_CREATED) Boolean isCreated,
+ @JsonProperty(required = true, value = JSON_PROPERTY_ORG_ID) Long orgId,
+ @JsonProperty(required = true, value = JSON_PROPERTY_PRODUCT) String product,
+ @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query,
+ @JsonProperty(required = true, value = JSON_PROPERTY_STARTING_AT) String startingAt,
+ @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) String status,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TO_TIME) Long toTime,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL_UNRESTRICTED)
+ Long totalUnrestricted,
+ @JsonProperty(required = true, value = JSON_PROPERTY_UPDATED_AT) String updatedAt) {
+ this.createdAt = createdAt;
+ this.createdBy = createdBy;
+ this.fromTime = fromTime;
+ this.isCreated = isCreated;
+ this.orgId = orgId;
+ this.product = product;
+ this.query = query;
+ this.startingAt = startingAt;
+ this.status = status;
+ this.toTime = toTime;
+ this.totalUnrestricted = totalUnrestricted;
+ this.updatedAt = updatedAt;
+ }
+
+ public DataDeletionResponseItemAttributes createdAt(String createdAt) {
+ this.createdAt = createdAt;
+ return this;
+ }
+
+ /**
+ * Creation time of the deletion request.
+ *
+ * @return createdAt
+ */
+ @JsonProperty(JSON_PROPERTY_CREATED_AT)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getCreatedAt() {
+ return createdAt;
+ }
+
+ public void setCreatedAt(String createdAt) {
+ this.createdAt = createdAt;
+ }
+
+ public DataDeletionResponseItemAttributes createdBy(String createdBy) {
+ this.createdBy = createdBy;
+ return this;
+ }
+
+ /**
+ * User who created the deletion request.
+ *
+ * @return createdBy
+ */
+ @JsonProperty(JSON_PROPERTY_CREATED_BY)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getCreatedBy() {
+ return createdBy;
+ }
+
+ public void setCreatedBy(String createdBy) {
+ this.createdBy = createdBy;
+ }
+
+ public DataDeletionResponseItemAttributes fromTime(Long fromTime) {
+ this.fromTime = fromTime;
+ return this;
+ }
+
+ /**
+ * Start of requested time window, milliseconds since Unix epoch.
+ *
+ * @return fromTime
+ */
+ @JsonProperty(JSON_PROPERTY_FROM_TIME)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Long getFromTime() {
+ return fromTime;
+ }
+
+ public void setFromTime(Long fromTime) {
+ this.fromTime = fromTime;
+ }
+
+ public DataDeletionResponseItemAttributes indexes(List indexes) {
+ this.indexes = indexes;
+ return this;
+ }
+
+ public DataDeletionResponseItemAttributes addIndexesItem(String indexesItem) {
+ if (this.indexes == null) {
+ this.indexes = new ArrayList<>();
+ }
+ this.indexes.add(indexesItem);
+ return this;
+ }
+
+ /**
+ * List of indexes for the search. If not provided, the search is performed in all indexes.
+ *
+ * @return indexes
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_INDEXES)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public List getIndexes() {
+ return indexes;
+ }
+
+ public void setIndexes(List indexes) {
+ this.indexes = indexes;
+ }
+
+ public DataDeletionResponseItemAttributes isCreated(Boolean isCreated) {
+ this.isCreated = isCreated;
+ return this;
+ }
+
+ /**
+ * Whether the deletion request is fully created or not.
+ *
+ * @return isCreated
+ */
+ @JsonProperty(JSON_PROPERTY_IS_CREATED)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Boolean getIsCreated() {
+ return isCreated;
+ }
+
+ public void setIsCreated(Boolean isCreated) {
+ this.isCreated = isCreated;
+ }
+
+ public DataDeletionResponseItemAttributes orgId(Long orgId) {
+ this.orgId = orgId;
+ return this;
+ }
+
+ /**
+ * Organization ID.
+ *
+ * @return orgId
+ */
+ @JsonProperty(JSON_PROPERTY_ORG_ID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Long getOrgId() {
+ return orgId;
+ }
+
+ public void setOrgId(Long orgId) {
+ this.orgId = orgId;
+ }
+
+ public DataDeletionResponseItemAttributes product(String product) {
+ this.product = product;
+ return this;
+ }
+
+ /**
+ * Product name.
+ *
+ * @return product
+ */
+ @JsonProperty(JSON_PROPERTY_PRODUCT)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getProduct() {
+ return product;
+ }
+
+ public void setProduct(String product) {
+ this.product = product;
+ }
+
+ public DataDeletionResponseItemAttributes query(String query) {
+ this.query = query;
+ return this;
+ }
+
+ /**
+ * Query for creating a data deletion request.
+ *
+ * @return query
+ */
+ @JsonProperty(JSON_PROPERTY_QUERY)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getQuery() {
+ return query;
+ }
+
+ public void setQuery(String query) {
+ this.query = query;
+ }
+
+ public DataDeletionResponseItemAttributes startingAt(String startingAt) {
+ this.startingAt = startingAt;
+ return this;
+ }
+
+ /**
+ * Starting time of the process to delete the requested data.
+ *
+ * @return startingAt
+ */
+ @JsonProperty(JSON_PROPERTY_STARTING_AT)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getStartingAt() {
+ return startingAt;
+ }
+
+ public void setStartingAt(String startingAt) {
+ this.startingAt = startingAt;
+ }
+
+ public DataDeletionResponseItemAttributes status(String status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Status of the deletion request.
+ *
+ * @return status
+ */
+ @JsonProperty(JSON_PROPERTY_STATUS)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public DataDeletionResponseItemAttributes toTime(Long toTime) {
+ this.toTime = toTime;
+ return this;
+ }
+
+ /**
+ * End of requested time window, milliseconds since Unix epoch.
+ *
+ * @return toTime
+ */
+ @JsonProperty(JSON_PROPERTY_TO_TIME)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Long getToTime() {
+ return toTime;
+ }
+
+ public void setToTime(Long toTime) {
+ this.toTime = toTime;
+ }
+
+ public DataDeletionResponseItemAttributes totalUnrestricted(Long totalUnrestricted) {
+ this.totalUnrestricted = totalUnrestricted;
+ return this;
+ }
+
+ /**
+ * Total number of elements to be deleted. Only the data accessible to the current user that
+ * matches the query and timeframe provided will be deleted.
+ *
+ * @return totalUnrestricted
+ */
+ @JsonProperty(JSON_PROPERTY_TOTAL_UNRESTRICTED)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Long getTotalUnrestricted() {
+ return totalUnrestricted;
+ }
+
+ public void setTotalUnrestricted(Long totalUnrestricted) {
+ this.totalUnrestricted = totalUnrestricted;
+ }
+
+ public DataDeletionResponseItemAttributes updatedAt(String updatedAt) {
+ this.updatedAt = updatedAt;
+ return this;
+ }
+
+ /**
+ * Update time of the deletion request.
+ *
+ * @return updatedAt
+ */
+ @JsonProperty(JSON_PROPERTY_UPDATED_AT)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getUpdatedAt() {
+ return updatedAt;
+ }
+
+ public void setUpdatedAt(String updatedAt) {
+ this.updatedAt = updatedAt;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return DataDeletionResponseItemAttributes
+ */
+ @JsonAnySetter
+ public DataDeletionResponseItemAttributes putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this DataDeletionResponseItemAttributes object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ DataDeletionResponseItemAttributes dataDeletionResponseItemAttributes =
+ (DataDeletionResponseItemAttributes) o;
+ return Objects.equals(this.createdAt, dataDeletionResponseItemAttributes.createdAt)
+ && Objects.equals(this.createdBy, dataDeletionResponseItemAttributes.createdBy)
+ && Objects.equals(this.fromTime, dataDeletionResponseItemAttributes.fromTime)
+ && Objects.equals(this.indexes, dataDeletionResponseItemAttributes.indexes)
+ && Objects.equals(this.isCreated, dataDeletionResponseItemAttributes.isCreated)
+ && Objects.equals(this.orgId, dataDeletionResponseItemAttributes.orgId)
+ && Objects.equals(this.product, dataDeletionResponseItemAttributes.product)
+ && Objects.equals(this.query, dataDeletionResponseItemAttributes.query)
+ && Objects.equals(this.startingAt, dataDeletionResponseItemAttributes.startingAt)
+ && Objects.equals(this.status, dataDeletionResponseItemAttributes.status)
+ && Objects.equals(this.toTime, dataDeletionResponseItemAttributes.toTime)
+ && Objects.equals(
+ this.totalUnrestricted, dataDeletionResponseItemAttributes.totalUnrestricted)
+ && Objects.equals(this.updatedAt, dataDeletionResponseItemAttributes.updatedAt)
+ && Objects.equals(
+ this.additionalProperties, dataDeletionResponseItemAttributes.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ createdAt,
+ createdBy,
+ fromTime,
+ indexes,
+ isCreated,
+ orgId,
+ product,
+ query,
+ startingAt,
+ status,
+ toTime,
+ totalUnrestricted,
+ updatedAt,
+ additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class DataDeletionResponseItemAttributes {\n");
+ sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
+ sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n");
+ sb.append(" fromTime: ").append(toIndentedString(fromTime)).append("\n");
+ sb.append(" indexes: ").append(toIndentedString(indexes)).append("\n");
+ sb.append(" isCreated: ").append(toIndentedString(isCreated)).append("\n");
+ sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n");
+ sb.append(" product: ").append(toIndentedString(product)).append("\n");
+ sb.append(" query: ").append(toIndentedString(query)).append("\n");
+ sb.append(" startingAt: ").append(toIndentedString(startingAt)).append("\n");
+ sb.append(" status: ").append(toIndentedString(status)).append("\n");
+ sb.append(" toTime: ").append(toIndentedString(toTime)).append("\n");
+ sb.append(" totalUnrestricted: ").append(toIndentedString(totalUnrestricted)).append("\n");
+ sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/DataDeletionResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/DataDeletionResponseMeta.java
new file mode 100644
index 00000000000..3865fbb5c8f
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/DataDeletionResponseMeta.java
@@ -0,0 +1,262 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** The metadata of the data deletion response. */
+@JsonPropertyOrder({
+ DataDeletionResponseMeta.JSON_PROPERTY_COUNT_PRODUCT,
+ DataDeletionResponseMeta.JSON_PROPERTY_COUNT_STATUS,
+ DataDeletionResponseMeta.JSON_PROPERTY_NEXT_PAGE,
+ DataDeletionResponseMeta.JSON_PROPERTY_PRODUCT,
+ DataDeletionResponseMeta.JSON_PROPERTY_REQUEST_STATUS
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class DataDeletionResponseMeta {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_COUNT_PRODUCT = "count_product";
+ private Map countProduct = null;
+
+ public static final String JSON_PROPERTY_COUNT_STATUS = "count_status";
+ private Map countStatus = null;
+
+ public static final String JSON_PROPERTY_NEXT_PAGE = "next_page";
+ private String nextPage;
+
+ public static final String JSON_PROPERTY_PRODUCT = "product";
+ private String product;
+
+ public static final String JSON_PROPERTY_REQUEST_STATUS = "request_status";
+ private String requestStatus;
+
+ public DataDeletionResponseMeta countProduct(Map countProduct) {
+ this.countProduct = countProduct;
+ return this;
+ }
+
+ public DataDeletionResponseMeta putCountProductItem(String key, Long countProductItem) {
+ if (this.countProduct == null) {
+ this.countProduct = new HashMap<>();
+ }
+ this.countProduct.put(key, countProductItem);
+ return this;
+ }
+
+ /**
+ * The total deletion requests created by product.
+ *
+ * @return countProduct
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_COUNT_PRODUCT)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Map getCountProduct() {
+ return countProduct;
+ }
+
+ public void setCountProduct(Map countProduct) {
+ this.countProduct = countProduct;
+ }
+
+ public DataDeletionResponseMeta countStatus(Map countStatus) {
+ this.countStatus = countStatus;
+ return this;
+ }
+
+ public DataDeletionResponseMeta putCountStatusItem(String key, Long countStatusItem) {
+ if (this.countStatus == null) {
+ this.countStatus = new HashMap<>();
+ }
+ this.countStatus.put(key, countStatusItem);
+ return this;
+ }
+
+ /**
+ * The total deletion requests created by status.
+ *
+ * @return countStatus
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_COUNT_STATUS)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Map getCountStatus() {
+ return countStatus;
+ }
+
+ public void setCountStatus(Map countStatus) {
+ this.countStatus = countStatus;
+ }
+
+ public DataDeletionResponseMeta nextPage(String nextPage) {
+ this.nextPage = nextPage;
+ return this;
+ }
+
+ /**
+ * The next page when searching deletion requests created in the current organization.
+ *
+ * @return nextPage
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_NEXT_PAGE)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getNextPage() {
+ return nextPage;
+ }
+
+ public void setNextPage(String nextPage) {
+ this.nextPage = nextPage;
+ }
+
+ public DataDeletionResponseMeta product(String product) {
+ this.product = product;
+ return this;
+ }
+
+ /**
+ * The product of the deletion request.
+ *
+ * @return product
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_PRODUCT)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getProduct() {
+ return product;
+ }
+
+ public void setProduct(String product) {
+ this.product = product;
+ }
+
+ public DataDeletionResponseMeta requestStatus(String requestStatus) {
+ this.requestStatus = requestStatus;
+ return this;
+ }
+
+ /**
+ * The status of the executed request.
+ *
+ * @return requestStatus
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_REQUEST_STATUS)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getRequestStatus() {
+ return requestStatus;
+ }
+
+ public void setRequestStatus(String requestStatus) {
+ this.requestStatus = requestStatus;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return DataDeletionResponseMeta
+ */
+ @JsonAnySetter
+ public DataDeletionResponseMeta putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this DataDeletionResponseMeta object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ DataDeletionResponseMeta dataDeletionResponseMeta = (DataDeletionResponseMeta) o;
+ return Objects.equals(this.countProduct, dataDeletionResponseMeta.countProduct)
+ && Objects.equals(this.countStatus, dataDeletionResponseMeta.countStatus)
+ && Objects.equals(this.nextPage, dataDeletionResponseMeta.nextPage)
+ && Objects.equals(this.product, dataDeletionResponseMeta.product)
+ && Objects.equals(this.requestStatus, dataDeletionResponseMeta.requestStatus)
+ && Objects.equals(this.additionalProperties, dataDeletionResponseMeta.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ countProduct, countStatus, nextPage, product, requestStatus, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class DataDeletionResponseMeta {\n");
+ sb.append(" countProduct: ").append(toIndentedString(countProduct)).append("\n");
+ sb.append(" countStatus: ").append(toIndentedString(countStatus)).append("\n");
+ sb.append(" nextPage: ").append(toIndentedString(nextPage)).append("\n");
+ sb.append(" product: ").append(toIndentedString(product)).append("\n");
+ sb.append(" requestStatus: ").append(toIndentedString(requestStatus)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/GetDataDeletionsResponseBody.java b/src/main/java/com/datadog/api/client/v2/model/GetDataDeletionsResponseBody.java
new file mode 100644
index 00000000000..7a3e5611cdd
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/GetDataDeletionsResponseBody.java
@@ -0,0 +1,180 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/** The response from the get data deletion requests endpoint. */
+@JsonPropertyOrder({
+ GetDataDeletionsResponseBody.JSON_PROPERTY_DATA,
+ GetDataDeletionsResponseBody.JSON_PROPERTY_META
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class GetDataDeletionsResponseBody {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private List data = null;
+
+ public static final String JSON_PROPERTY_META = "meta";
+ private DataDeletionResponseMeta meta;
+
+ public GetDataDeletionsResponseBody data(List data) {
+ this.data = data;
+ for (DataDeletionResponseItem item : data) {
+ this.unparsed |= item.unparsed;
+ }
+ return this;
+ }
+
+ public GetDataDeletionsResponseBody addDataItem(DataDeletionResponseItem dataItem) {
+ if (this.data == null) {
+ this.data = new ArrayList<>();
+ }
+ this.data.add(dataItem);
+ this.unparsed |= dataItem.unparsed;
+ return this;
+ }
+
+ /**
+ * The list of data deletion requests that matches the query.
+ *
+ * @return data
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public GetDataDeletionsResponseBody meta(DataDeletionResponseMeta meta) {
+ this.meta = meta;
+ this.unparsed |= meta.unparsed;
+ return this;
+ }
+
+ /**
+ * The metadata of the data deletion response.
+ *
+ * @return meta
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_META)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public DataDeletionResponseMeta getMeta() {
+ return meta;
+ }
+
+ public void setMeta(DataDeletionResponseMeta meta) {
+ this.meta = meta;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return GetDataDeletionsResponseBody
+ */
+ @JsonAnySetter
+ public GetDataDeletionsResponseBody putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this GetDataDeletionsResponseBody object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ GetDataDeletionsResponseBody getDataDeletionsResponseBody = (GetDataDeletionsResponseBody) o;
+ return Objects.equals(this.data, getDataDeletionsResponseBody.data)
+ && Objects.equals(this.meta, getDataDeletionsResponseBody.meta)
+ && Objects.equals(
+ this.additionalProperties, getDataDeletionsResponseBody.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, meta, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class GetDataDeletionsResponseBody {\n");
+ sb.append(" data: ").append(toIndentedString(data)).append("\n");
+ sb.append(" meta: ").append(toIndentedString(meta)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_Bad_Request_response.freeze
new file mode 100644
index 00000000000..4390af5977d
--- /dev/null
+++ b/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_Bad_Request_response.freeze
@@ -0,0 +1 @@
+2024-11-15T08:56:51.182Z
\ No newline at end of file
diff --git a/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_Bad_Request_response.json
new file mode 100644
index 00000000000..ebb095f475c
--- /dev/null
+++ b/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_Bad_Request_response.json
@@ -0,0 +1,28 @@
+[
+ {
+ "httpRequest": {
+ "headers": {},
+ "method": "PUT",
+ "path": "/api/v2/deletion/requests/id-1/cancel",
+ "keepAlive": false,
+ "secure": true
+ },
+ "httpResponse": {
+ "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid Parameter\",\"detail\":\"invalid parameter \\\"id\\\" in \\\"path\\\"; expected type \\\"int\\\"\"}]}",
+ "headers": {
+ "Content-Type": [
+ "application/vnd.api+json"
+ ]
+ },
+ "statusCode": 400,
+ "reasonPhrase": "Bad Request"
+ },
+ "times": {
+ "remainingTimes": 1
+ },
+ "timeToLive": {
+ "unlimited": true
+ },
+ "id": "cb80b304-1979-0613-e957-ee220c628fe0"
+ }
+]
\ No newline at end of file
diff --git a/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_OK_response.freeze
new file mode 100644
index 00000000000..04ac8a541df
--- /dev/null
+++ b/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_OK_response.freeze
@@ -0,0 +1 @@
+2024-11-15T08:57:02.769Z
\ No newline at end of file
diff --git a/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_OK_response.json
new file mode 100644
index 00000000000..9736b905357
--- /dev/null
+++ b/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_OK_response.json
@@ -0,0 +1,84 @@
+[
+ {
+ "httpRequest": {
+ "body": {
+ "type": "JSON",
+ "json": "{\"data\":{\"attributes\":{\"from\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"query\":{\"host\":\"abc\",\"service\":\"xyz\"},\"to\":1704063600000}}}"
+ },
+ "headers": {},
+ "method": "POST",
+ "path": "/api/v2/deletion/data/logs",
+ "keepAlive": false,
+ "secure": true
+ },
+ "httpResponse": {
+ "body": "{\"data\":{\"id\":\"303\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T08:57:03.242841331Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"pending\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T08:57:03.242841331Z\"}},\"meta\":{\"product\":\"logs\"}}",
+ "headers": {
+ "Content-Type": [
+ "application/vnd.api+json"
+ ]
+ },
+ "statusCode": 200,
+ "reasonPhrase": "OK"
+ },
+ "times": {
+ "remainingTimes": 1
+ },
+ "timeToLive": {
+ "unlimited": true
+ },
+ "id": "5cd4cf47-94a7-8539-6a9c-e898d8edd4fb"
+ },
+ {
+ "httpRequest": {
+ "headers": {},
+ "method": "PUT",
+ "path": "/api/v2/deletion/requests/303/cancel",
+ "keepAlive": false,
+ "secure": true
+ },
+ "httpResponse": {
+ "body": "{\"data\":{\"id\":\"303\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T08:57:03.242841Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T08:57:03.638067Z\"}},\"meta\":{\"product\":\"logs\",\"request_status\":\"canceled\"}}",
+ "headers": {
+ "Content-Type": [
+ "application/vnd.api+json"
+ ]
+ },
+ "statusCode": 200,
+ "reasonPhrase": "OK"
+ },
+ "times": {
+ "remainingTimes": 1
+ },
+ "timeToLive": {
+ "unlimited": true
+ },
+ "id": "5c48cf25-6248-675c-8bce-de02c7c5fb57"
+ },
+ {
+ "httpRequest": {
+ "headers": {},
+ "method": "PUT",
+ "path": "/api/v2/deletion/requests/303/cancel",
+ "keepAlive": false,
+ "secure": true
+ },
+ "httpResponse": {
+ "body": "{\"data\":{\"id\":\"303\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T08:57:03.242841Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T08:57:03.936325Z\"}},\"meta\":{\"product\":\"logs\",\"request_status\":\"canceled\"}}",
+ "headers": {
+ "Content-Type": [
+ "application/vnd.api+json"
+ ]
+ },
+ "statusCode": 200,
+ "reasonPhrase": "OK"
+ },
+ "times": {
+ "remainingTimes": 1
+ },
+ "timeToLive": {
+ "unlimited": true
+ },
+ "id": "5c48cf25-6248-675c-8bce-de02c7c5fb58"
+ }
+]
\ No newline at end of file
diff --git a/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_Precondition_failed_error_response.freeze b/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_Precondition_failed_error_response.freeze
new file mode 100644
index 00000000000..3bb79b73d33
--- /dev/null
+++ b/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_Precondition_failed_error_response.freeze
@@ -0,0 +1 @@
+2024-11-15T08:57:14.890Z
\ No newline at end of file
diff --git a/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_Precondition_failed_error_response.json b/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_Precondition_failed_error_response.json
new file mode 100644
index 00000000000..de4af7dbc53
--- /dev/null
+++ b/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_Precondition_failed_error_response.json
@@ -0,0 +1,28 @@
+[
+ {
+ "httpRequest": {
+ "headers": {},
+ "method": "PUT",
+ "path": "/api/v2/deletion/requests/-1/cancel",
+ "keepAlive": false,
+ "secure": true
+ },
+ "httpResponse": {
+ "body": "{\"errors\":[{\"status\":\"412\",\"code\":\"INVALID_ID\",\"title\":\"INVALID_ID\",\"detail\":\"INVALID_ID\"}]}",
+ "headers": {
+ "Content-Type": [
+ "application/vnd.api+json"
+ ]
+ },
+ "statusCode": 412,
+ "reasonPhrase": "Precondition Failed"
+ },
+ "times": {
+ "remainingTimes": 1
+ },
+ "timeToLive": {
+ "unlimited": true
+ },
+ "id": "f7808c13-ff40-1d77-3b30-8d1a7f7fb27b"
+ }
+]
\ No newline at end of file
diff --git a/src/test/resources/cassettes/features/v2/Creates_a_data_deletion_request_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Creates_a_data_deletion_request_returns_OK_response.freeze
new file mode 100644
index 00000000000..b74c2983af0
--- /dev/null
+++ b/src/test/resources/cassettes/features/v2/Creates_a_data_deletion_request_returns_OK_response.freeze
@@ -0,0 +1 @@
+2024-11-15T08:59:09.810Z
\ No newline at end of file
diff --git a/src/test/resources/cassettes/features/v2/Creates_a_data_deletion_request_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Creates_a_data_deletion_request_returns_OK_response.json
new file mode 100644
index 00000000000..f20a4517c22
--- /dev/null
+++ b/src/test/resources/cassettes/features/v2/Creates_a_data_deletion_request_returns_OK_response.json
@@ -0,0 +1,58 @@
+[
+ {
+ "httpRequest": {
+ "body": {
+ "type": "JSON",
+ "json": "{\"data\":{\"attributes\":{\"from\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"query\":{\"host\":\"abc\",\"service\":\"xyz\"},\"to\":1704063600000}}}"
+ },
+ "headers": {},
+ "method": "POST",
+ "path": "/api/v2/deletion/data/logs",
+ "keepAlive": false,
+ "secure": true
+ },
+ "httpResponse": {
+ "body": "{\"data\":{\"id\":\"305\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T08:59:10.304195172Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"pending\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T08:59:10.304195172Z\"}},\"meta\":{\"product\":\"logs\"}}",
+ "headers": {
+ "Content-Type": [
+ "application/vnd.api+json"
+ ]
+ },
+ "statusCode": 200,
+ "reasonPhrase": "OK"
+ },
+ "times": {
+ "remainingTimes": 1
+ },
+ "timeToLive": {
+ "unlimited": true
+ },
+ "id": "5cd4cf47-94a7-8539-6a9c-e898d8edd4fd"
+ },
+ {
+ "httpRequest": {
+ "headers": {},
+ "method": "PUT",
+ "path": "/api/v2/deletion/requests/305/cancel",
+ "keepAlive": false,
+ "secure": true
+ },
+ "httpResponse": {
+ "body": "{\"data\":{\"id\":\"305\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T08:59:10.304195Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T08:59:10.681676Z\"}},\"meta\":{\"product\":\"logs\",\"request_status\":\"canceled\"}}",
+ "headers": {
+ "Content-Type": [
+ "application/vnd.api+json"
+ ]
+ },
+ "statusCode": 200,
+ "reasonPhrase": "OK"
+ },
+ "times": {
+ "remainingTimes": 1
+ },
+ "timeToLive": {
+ "unlimited": true
+ },
+ "id": "7ee59a12-6bea-0625-a080-1c7a65384828"
+ }
+]
\ No newline at end of file
diff --git a/src/test/resources/cassettes/features/v2/Creates_a_data_deletion_request_returns_Precondition_failed_error_response.freeze b/src/test/resources/cassettes/features/v2/Creates_a_data_deletion_request_returns_Precondition_failed_error_response.freeze
new file mode 100644
index 00000000000..74ecbd427cf
--- /dev/null
+++ b/src/test/resources/cassettes/features/v2/Creates_a_data_deletion_request_returns_Precondition_failed_error_response.freeze
@@ -0,0 +1 @@
+2024-11-15T08:59:22.532Z
\ No newline at end of file
diff --git a/src/test/resources/cassettes/features/v2/Creates_a_data_deletion_request_returns_Precondition_failed_error_response.json b/src/test/resources/cassettes/features/v2/Creates_a_data_deletion_request_returns_Precondition_failed_error_response.json
new file mode 100644
index 00000000000..f8065e3efd5
--- /dev/null
+++ b/src/test/resources/cassettes/features/v2/Creates_a_data_deletion_request_returns_Precondition_failed_error_response.json
@@ -0,0 +1,32 @@
+[
+ {
+ "httpRequest": {
+ "body": {
+ "type": "JSON",
+ "json": "{\"data\":{\"attributes\":{\"from\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"query\":{},\"to\":1704063600000}}}"
+ },
+ "headers": {},
+ "method": "POST",
+ "path": "/api/v2/deletion/data/logs",
+ "keepAlive": false,
+ "secure": true
+ },
+ "httpResponse": {
+ "body": "{\"errors\":[{\"status\":\"412\",\"code\":\"INVALID_BODY\",\"title\":\"INVALID_BODY\",\"detail\":\"INVALID_BODY\"}]}",
+ "headers": {
+ "Content-Type": [
+ "application/vnd.api+json"
+ ]
+ },
+ "statusCode": 412,
+ "reasonPhrase": "Precondition Failed"
+ },
+ "times": {
+ "remainingTimes": 1
+ },
+ "timeToLive": {
+ "unlimited": true
+ },
+ "id": "38a81782-900f-1977-8fe0-51f319bdc048"
+ }
+]
\ No newline at end of file
diff --git a/src/test/resources/cassettes/features/v2/Gets_a_list_of_data_deletion_requests_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Gets_a_list_of_data_deletion_requests_returns_OK_response.freeze
new file mode 100644
index 00000000000..108d0eae363
--- /dev/null
+++ b/src/test/resources/cassettes/features/v2/Gets_a_list_of_data_deletion_requests_returns_OK_response.freeze
@@ -0,0 +1 @@
+2024-11-15T08:57:26.678Z
\ No newline at end of file
diff --git a/src/test/resources/cassettes/features/v2/Gets_a_list_of_data_deletion_requests_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Gets_a_list_of_data_deletion_requests_returns_OK_response.json
new file mode 100644
index 00000000000..0290164298a
--- /dev/null
+++ b/src/test/resources/cassettes/features/v2/Gets_a_list_of_data_deletion_requests_returns_OK_response.json
@@ -0,0 +1,84 @@
+[
+ {
+ "httpRequest": {
+ "body": {
+ "type": "JSON",
+ "json": "{\"data\":{\"attributes\":{\"from\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"query\":{\"host\":\"abc\",\"service\":\"xyz\"},\"to\":1704063600000}}}"
+ },
+ "headers": {},
+ "method": "POST",
+ "path": "/api/v2/deletion/data/logs",
+ "keepAlive": false,
+ "secure": true
+ },
+ "httpResponse": {
+ "body": "{\"data\":{\"id\":\"304\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T08:57:27.161919269Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"pending\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T08:57:27.161919269Z\"}},\"meta\":{\"product\":\"logs\"}}",
+ "headers": {
+ "Content-Type": [
+ "application/vnd.api+json"
+ ]
+ },
+ "statusCode": 200,
+ "reasonPhrase": "OK"
+ },
+ "times": {
+ "remainingTimes": 1
+ },
+ "timeToLive": {
+ "unlimited": true
+ },
+ "id": "5cd4cf47-94a7-8539-6a9c-e898d8edd4fc"
+ },
+ {
+ "httpRequest": {
+ "headers": {},
+ "method": "GET",
+ "path": "/api/v2/deletion/requests",
+ "keepAlive": false,
+ "secure": true
+ },
+ "httpResponse": {
+ "body": "{\"data\":[{\"id\":\"304\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T08:57:27.161919Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"pending\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T08:57:27.161919Z\"}},{\"id\":\"303\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T08:57:03.242841Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T08:57:03.936325Z\"}},{\"id\":\"302\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T08:44:51.953197Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T08:44:54.901861Z\"}},{\"id\":\"301\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T08:44:12.92412Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T08:44:44.846759Z\"}},{\"id\":\"300\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T08:20:26.053712Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T08:20:34.545658Z\"}},{\"id\":\"299\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T08:12:17.70049Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T08:12:50.271468Z\"}},{\"id\":\"298\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T08:09:41.997486Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T08:09:45.322668Z\"}},{\"id\":\"297\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T07:51:10.059846Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T07:51:27.637588Z\"}},{\"id\":\"296\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T07:49:26.502631Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T07:49:28.431587Z\"}},{\"id\":\"295\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T17:57:14.713251Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T17:57:16.874262Z\"}},{\"id\":\"294\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T17:56:38.672296Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T17:56:39.220134Z\"}},{\"id\":\"293\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T17:56:21.931549Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T17:56:22.653515Z\"}},{\"id\":\"292\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T17:52:37.230638Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T17:52:41.82939Z\"}},{\"id\":\"291\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T17:51:34.464818Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T17:51:35.662615Z\"}},{\"id\":\"290\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T17:34:51.13924Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T17:34:52.585803Z\"}},{\"id\":\"289\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T16:54:28.587048Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T16:54:30.222141Z\"}},{\"id\":\"288\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T16:52:52.567007Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T16:52:54.810859Z\"}},{\"id\":\"287\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T16:49:54.011076Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T16:49:55.255357Z\"}},{\"id\":\"286\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T16:35:25.381857Z\",\"created_by\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T16:35:30.570834Z\"}},{\"id\":\"285\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T16:32:52.425512Z\",\"created_by\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T16:33:25.559245Z\"}},{\"id\":\"284\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T16:27:22.412357Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T16:27:28.763719Z\"}},{\"id\":\"283\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T16:26:56.006849Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T16:26:57.682661Z\"}},{\"id\":\"282\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T16:26:02.447468Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T16:26:05.009146Z\"}},{\"id\":\"281\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T16:24:58.627741Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T16:25:02.852354Z\"}},{\"id\":\"280\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T16:23:10.220638Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T16:23:42.451575Z\"}},{\"id\":\"279\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T16:22:34.323711Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T16:23:06.006296Z\"}},{\"id\":\"278\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T16:21:42.323606Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T16:21:49.622015Z\"}},{\"id\":\"277\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T16:19:07.723768Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T16:19:11.463512Z\"}},{\"id\":\"276\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-14T16:16:47.047428Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-14T16:17:18.723041Z\"}}],\"meta\":{\"count_status\":{\"canceled\":28,\"pending\":1},\"count_product\":{\"logs\":29}}}",
+ "headers": {
+ "Content-Type": [
+ "application/vnd.api+json"
+ ]
+ },
+ "statusCode": 200,
+ "reasonPhrase": "OK"
+ },
+ "times": {
+ "remainingTimes": 1
+ },
+ "timeToLive": {
+ "unlimited": true
+ },
+ "id": "bccdc356-11c8-dffd-a53f-bc89d021a953"
+ },
+ {
+ "httpRequest": {
+ "headers": {},
+ "method": "PUT",
+ "path": "/api/v2/deletion/requests/304/cancel",
+ "keepAlive": false,
+ "secure": true
+ },
+ "httpResponse": {
+ "body": "{\"data\":{\"id\":\"304\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-11-15T08:57:27.161919Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-11-15T08:57:27.931008Z\"}},\"meta\":{\"product\":\"logs\",\"request_status\":\"canceled\"}}",
+ "headers": {
+ "Content-Type": [
+ "application/vnd.api+json"
+ ]
+ },
+ "statusCode": 200,
+ "reasonPhrase": "OK"
+ },
+ "times": {
+ "remainingTimes": 1
+ },
+ "timeToLive": {
+ "unlimited": true
+ },
+ "id": "304701f8-6edc-945f-eae8-22fbcda19564"
+ }
+]
\ No newline at end of file
diff --git a/src/test/resources/com/datadog/api/client/v2/api/data_deletion.feature b/src/test/resources/com/datadog/api/client/v2/api/data_deletion.feature
new file mode 100644
index 00000000000..84c5830ead3
--- /dev/null
+++ b/src/test/resources/com/datadog/api/client/v2/api/data_deletion.feature
@@ -0,0 +1,76 @@
+@endpoint(data-deletion) @endpoint(data-deletion-v2)
+Feature: Data Deletion
+ The Data Deletion API allows the user to target and delete data from the
+ allowed products. It's currently enabled for Logs and RUM and depends on
+ `logs_delete_data` and `rum_delete_data` permissions respectively.
+
+ Background:
+ Given a valid "apiKeyAuth" key in the system
+ And a valid "appKeyAuth" key in the system
+ And an instance of "DataDeletion" API
+
+ @team:DataDog/supportability-engineering
+ Scenario: Cancels a data deletion request returns "Bad Request" response
+ Given 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
+ And new "CancelDataDeletionRequest" request
+ And request contains "id" parameter from "deletion_request.data.id"
+ When the request is sent
+ Then the response status is 200 OK
+ And the response "data.id" is equal to "{{ deletion_request.data.id }}"
+ And the response "data.type" is equal to "{{ deletion_request.data.type }}"
+ And the response "data.attributes.product" is equal to "{{ deletion_request.data.attributes.product }}"
+ And the response "data.attributes.status" is equal to "canceled"
+
+ @team:DataDog/supportability-engineering
+ Scenario: Cancels a data deletion request returns "Precondition failed error" response
+ Given 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
+ And request contains "product" parameter from "REPLACE.ME"
+ And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["index-1", "index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}}}
+ When the request is sent
+ Then the response status is 400 Bad Request
+
+ @team:DataDog/supportability-engineering
+ Scenario: Creates a data deletion request returns "OK" response
+ Given new "CreateDataDeletionRequest" request
+ And request contains "product" parameter with value "logs"
+ And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["index-1", "index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}}}
+ When the request is sent
+ Then the response status is 200 OK
+ And the response "data.type" is equal to "deletion_request"
+ And the response "data.attributes.product" is equal to "logs"
+ And the response "data.attributes.status" is equal to "pending"
+
+ @team:DataDog/supportability-engineering
+ Scenario: Creates a data deletion request returns "Precondition failed error" response
+ Given new "CreateDataDeletionRequest" request
+ And request contains "product" parameter with value "logs"
+ And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["index-1", "index-2"], "query": {}, "to": 1704063600000}}}
+ When the request is sent
+ Then the response status is 412 Precondition failed error
+
+ @generated @skip @team:DataDog/supportability-engineering
+ Scenario: Gets a list of data deletion requests returns "Bad Request" response
+ Given 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
+ And new "GetDataDeletionRequests" request
+ When the request is sent
+ Then the response status is 200 OK
diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json
index 41cd8e0f22a..62f11ecc950 100644
--- a/src/test/resources/com/datadog/api/client/v2/api/given.json
+++ b/src/test/resources/com/datadog/api/client/v2/api/given.json
@@ -128,6 +128,22 @@
"tag": "Dashboard Lists",
"operationId": "CreateDashboardListItems"
},
+ {
+ "parameters": [
+ {
+ "name": "product",
+ "value": "\"logs\""
+ },
+ {
+ "name": "body",
+ "value": "{\n \"data\": {\n \"attributes\": {\n \"from\": 1672527600000,\n \"to\": 1704063600000,\n \"indexes\": [\"index-1\", \"index-2\"],\n \"query\": {\"host\": \"abc\", \"service\": \"xyz\"}\n }\n }\n}"
+ }
+ ],
+ "step": "there is a valid \"deletion_request\" in the system",
+ "key": "deletion_request",
+ "tag": "Data Deletion",
+ "operationId": "CreateDataDeletionRequest"
+ },
{
"parameters": [
{
diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json
index 91f554953bd..60803502275 100644
--- a/src/test/resources/com/datadog/api/client/v2/api/undo.json
+++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json
@@ -541,6 +541,31 @@
"type": "safe"
}
},
+ "CreateDataDeletionRequest": {
+ "tag": "Data Deletion",
+ "undo": {
+ "operationId": "CancelDataDeletionRequest",
+ "parameters": [
+ {
+ "name": "id",
+ "source": "data.id"
+ }
+ ],
+ "type": "unsafe"
+ }
+ },
+ "GetDataDeletionRequests": {
+ "tag": "Data Deletion",
+ "undo": {
+ "type": "safe"
+ }
+ },
+ "CancelDataDeletionRequest": {
+ "tag": "Data Deletion",
+ "undo": {
+ "type": "idempotent"
+ }
+ },
"GetDomainAllowlist": {
"tag": "Domain Allowlist",
"undo": {