diff --git a/.apigentools-info b/.apigentools-info index 4f776b7ace1f..39b5aa60135c 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:44.449437", - "spec_repo_commit": "7511c5f0" + "regenerated": "2024-12-03 10:17:27.054710", + "spec_repo_commit": "3f8bbb67" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-02 19:29:44.468467", - "spec_repo_commit": "7511c5f0" + "regenerated": "2024-12-03 10:17:27.073595", + "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 66bdf713cec8..ed720de0d077 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/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-Bad-Request-response_1737272784/frozen.json b/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-Bad-Request-response_1737272784/frozen.json new file mode 100644 index 000000000000..758fed8ce7db --- /dev/null +++ b/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-Bad-Request-response_1737272784/frozen.json @@ -0,0 +1 @@ +"2024-11-15T08:56:51.182Z" diff --git a/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-Bad-Request-response_1737272784/recording.har b/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-Bad-Request-response_1737272784/recording.har new file mode 100644 index 000000000000..d70ca63d3301 --- /dev/null +++ b/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-Bad-Request-response_1737272784/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Data Deletion/Cancels a data deletion request returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "cb80b30419790613e957ee220c628fe0", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 554, + "httpVersion": "HTTP/1.1", + "method": "PUT", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deletion/requests/id-1/cancel" + }, + "response": { + "bodySize": 128, + "content": { + "mimeType": "application/vnd.api+json", + "size": 128, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid Parameter\",\"detail\":\"invalid parameter \\\"id\\\" in \\\"path\\\"; expected type \\\"int\\\"\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 665, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2024-11-15T08:56:51.190Z", + "time": 487 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-OK-response_383699486/frozen.json b/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-OK-response_383699486/frozen.json new file mode 100644 index 000000000000..1c62a4889c65 --- /dev/null +++ b/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-OK-response_383699486/frozen.json @@ -0,0 +1 @@ +"2024-11-15T08:57:02.769Z" diff --git a/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-OK-response_383699486/recording.har b/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-OK-response_383699486/recording.har new file mode 100644 index 000000000000..b8db0859301c --- /dev/null +++ b/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-OK-response_383699486/recording.har @@ -0,0 +1,153 @@ +{ + "log": { + "_recordingName": "Data Deletion/Cancels a data deletion request returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "5cd4cf4794a785396a9ce898d8edd4fb", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 136, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 578, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"from\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"query\":{\"host\":\"abc\",\"service\":\"xyz\"},\"to\":1704063600000}}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deletion/data/logs" + }, + "response": { + "bodySize": 458, + "content": { + "mimeType": "application/vnd.api+json", + "size": 458, + "text": "{\"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\"}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 666, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2024-11-15T08:57:02.776Z", + "time": 502 + }, + { + "_id": "5c48cf256248675c8bcede02c7c5fb57", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 553, + "httpVersion": "HTTP/1.1", + "method": "PUT", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deletion/requests/303/cancel" + }, + "response": { + "bodySize": 481, + "content": { + "mimeType": "application/vnd.api+json", + "size": 481, + "text": "{\"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\"}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 666, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2024-11-15T08:57:03.289Z", + "time": 355 + }, + { + "_id": "5c48cf256248675c8bcede02c7c5fb57", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 553, + "httpVersion": "HTTP/1.1", + "method": "PUT", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deletion/requests/303/cancel" + }, + "response": { + "bodySize": 481, + "content": { + "mimeType": "application/vnd.api+json", + "size": 481, + "text": "{\"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\"}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 666, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2024-11-15T08:57:03.655Z", + "time": 355 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-Precondition-failed-error-response_780321563/frozen.json b/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-Precondition-failed-error-response_780321563/frozen.json new file mode 100644 index 000000000000..10f450806c9e --- /dev/null +++ b/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-Precondition-failed-error-response_780321563/frozen.json @@ -0,0 +1 @@ +"2024-11-15T08:57:14.890Z" diff --git a/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-Precondition-failed-error-response_780321563/recording.har b/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-Precondition-failed-error-response_780321563/recording.har new file mode 100644 index 000000000000..b791c242c40a --- /dev/null +++ b/cassettes/v2/Data-Deletion_68448529/Cancels-a-data-deletion-request-returns-Precondition-failed-error-response_780321563/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Data Deletion/Cancels a data deletion request returns \"Precondition failed error\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "f7808c13ff401d773b308d1a7f7fb27b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 550, + "httpVersion": "HTTP/1.1", + "method": "PUT", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deletion/requests/-1/cancel" + }, + "response": { + "bodySize": 92, + "content": { + "mimeType": "application/vnd.api+json", + "size": 92, + "text": "{\"errors\":[{\"status\":\"412\",\"code\":\"INVALID_ID\",\"title\":\"INVALID_ID\",\"detail\":\"INVALID_ID\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 665, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 412, + "statusText": "Precondition Failed" + }, + "startedDateTime": "2024-11-15T08:57:14.897Z", + "time": 483 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Data-Deletion_68448529/Creates-a-data-deletion-request-returns-OK-response_3410553644/frozen.json b/cassettes/v2/Data-Deletion_68448529/Creates-a-data-deletion-request-returns-OK-response_3410553644/frozen.json new file mode 100644 index 000000000000..03daab0969b2 --- /dev/null +++ b/cassettes/v2/Data-Deletion_68448529/Creates-a-data-deletion-request-returns-OK-response_3410553644/frozen.json @@ -0,0 +1 @@ +"2024-11-15T08:59:09.810Z" diff --git a/cassettes/v2/Data-Deletion_68448529/Creates-a-data-deletion-request-returns-OK-response_3410553644/recording.har b/cassettes/v2/Data-Deletion_68448529/Creates-a-data-deletion-request-returns-OK-response_3410553644/recording.har new file mode 100644 index 000000000000..7279f5796f86 --- /dev/null +++ b/cassettes/v2/Data-Deletion_68448529/Creates-a-data-deletion-request-returns-OK-response_3410553644/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "Data Deletion/Creates a data deletion request returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "5cd4cf4794a785396a9ce898d8edd4fb", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 136, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 578, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"from\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"query\":{\"host\":\"abc\",\"service\":\"xyz\"},\"to\":1704063600000}}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deletion/data/logs" + }, + "response": { + "bodySize": 458, + "content": { + "mimeType": "application/vnd.api+json", + "size": 458, + "text": "{\"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\"}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 666, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2024-11-15T08:59:09.818Z", + "time": 514 + }, + { + "_id": "7ee59a126bea0625a0801c7a65384828", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 553, + "httpVersion": "HTTP/1.1", + "method": "PUT", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deletion/requests/305/cancel" + }, + "response": { + "bodySize": 481, + "content": { + "mimeType": "application/vnd.api+json", + "size": 481, + "text": "{\"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\"}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 666, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2024-11-15T08:59:10.338Z", + "time": 356 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Data-Deletion_68448529/Creates-a-data-deletion-request-returns-Precondition-failed-error-response_3107389441/frozen.json b/cassettes/v2/Data-Deletion_68448529/Creates-a-data-deletion-request-returns-Precondition-failed-error-response_3107389441/frozen.json new file mode 100644 index 000000000000..fd19411103b3 --- /dev/null +++ b/cassettes/v2/Data-Deletion_68448529/Creates-a-data-deletion-request-returns-Precondition-failed-error-response_3107389441/frozen.json @@ -0,0 +1 @@ +"2024-11-15T08:59:22.532Z" diff --git a/cassettes/v2/Data-Deletion_68448529/Creates-a-data-deletion-request-returns-Precondition-failed-error-response_3107389441/recording.har b/cassettes/v2/Data-Deletion_68448529/Creates-a-data-deletion-request-returns-Precondition-failed-error-response_3107389441/recording.har new file mode 100644 index 000000000000..b17d3a39623d --- /dev/null +++ b/cassettes/v2/Data-Deletion_68448529/Creates-a-data-deletion-request-returns-Precondition-failed-error-response_3107389441/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Data Deletion/Creates a data deletion request returns \"Precondition failed error\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "38a81782900f19778fe051f319bdc048", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 108, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 576, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"from\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"query\":{},\"to\":1704063600000}}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deletion/data/logs" + }, + "response": { + "bodySize": 98, + "content": { + "mimeType": "application/vnd.api+json", + "size": 98, + "text": "{\"errors\":[{\"status\":\"412\",\"code\":\"INVALID_BODY\",\"title\":\"INVALID_BODY\",\"detail\":\"INVALID_BODY\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 665, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 412, + "statusText": "Precondition Failed" + }, + "startedDateTime": "2024-11-15T08:59:22.540Z", + "time": 448 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Data-Deletion_68448529/Gets-a-list-of-data-deletion-requests-returns-OK-response_4168454704/frozen.json b/cassettes/v2/Data-Deletion_68448529/Gets-a-list-of-data-deletion-requests-returns-OK-response_4168454704/frozen.json new file mode 100644 index 000000000000..d4bfa9039b90 --- /dev/null +++ b/cassettes/v2/Data-Deletion_68448529/Gets-a-list-of-data-deletion-requests-returns-OK-response_4168454704/frozen.json @@ -0,0 +1 @@ +"2024-11-15T08:57:26.678Z" diff --git a/cassettes/v2/Data-Deletion_68448529/Gets-a-list-of-data-deletion-requests-returns-OK-response_4168454704/recording.har b/cassettes/v2/Data-Deletion_68448529/Gets-a-list-of-data-deletion-requests-returns-OK-response_4168454704/recording.har new file mode 100644 index 000000000000..a6666a9ab4b4 --- /dev/null +++ b/cassettes/v2/Data-Deletion_68448529/Gets-a-list-of-data-deletion-requests-returns-OK-response_4168454704/recording.har @@ -0,0 +1,153 @@ +{ + "log": { + "_recordingName": "Data Deletion/Gets a list of data deletion requests returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "5cd4cf4794a785396a9ce898d8edd4fb", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 136, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 578, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"from\":1672527600000,\"indexes\":[\"index-1\",\"index-2\"],\"query\":{\"host\":\"abc\",\"service\":\"xyz\"},\"to\":1704063600000}}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deletion/data/logs" + }, + "response": { + "bodySize": 458, + "content": { + "mimeType": "application/vnd.api+json", + "size": 458, + "text": "{\"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\"}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 666, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2024-11-15T08:57:26.687Z", + "time": 502 + }, + { + "_id": "bccdc35611c8dffda53fbc89d021a953", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 521, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deletion/requests" + }, + "response": { + "bodySize": 12272, + "content": { + "mimeType": "application/vnd.api+json", + "size": 12272, + "text": "{\"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}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 672, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2024-11-15T08:57:27.209Z", + "time": 349 + }, + { + "_id": "304701f86edc945feae822fbcda19564", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 553, + "httpVersion": "HTTP/1.1", + "method": "PUT", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deletion/requests/304/cancel" + }, + "response": { + "bodySize": 481, + "content": { + "mimeType": "application/vnd.api+json", + "size": 481, + "text": "{\"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\"}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 666, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2024-11-15T08:57:27.583Z", + "time": 357 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/data-deletion/CancelDataDeletionRequest.ts b/examples/v2/data-deletion/CancelDataDeletionRequest.ts new file mode 100644 index 000000000000..78bec84a27f8 --- /dev/null +++ b/examples/v2/data-deletion/CancelDataDeletionRequest.ts @@ -0,0 +1,24 @@ +/** + * Cancels a data deletion request returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.DataDeletionApi(configuration); + +// there is a valid "deletion_request" in the system +const DELETION_REQUEST_DATA_ID = process.env.DELETION_REQUEST_DATA_ID as string; + +const params: v2.DataDeletionApiCancelDataDeletionRequestRequest = { + id: DELETION_REQUEST_DATA_ID, +}; + +apiInstance + .cancelDataDeletionRequest(params) + .then((data: v2.CancelDataDeletionResponseBody) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/data-deletion/CreateDataDeletionRequest.ts b/examples/v2/data-deletion/CreateDataDeletionRequest.ts new file mode 100644 index 000000000000..38b2223ff2d3 --- /dev/null +++ b/examples/v2/data-deletion/CreateDataDeletionRequest.ts @@ -0,0 +1,34 @@ +/** + * Creates a data deletion request returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.DataDeletionApi(configuration); + +const params: v2.DataDeletionApiCreateDataDeletionRequestRequest = { + body: { + data: { + attributes: { + from: 1672527600000, + indexes: ["index-1", "index-2"], + query: { + host: "abc", + service: "xyz", + }, + to: 1704063600000, + }, + }, + }, + product: "logs", +}; + +apiInstance + .createDataDeletionRequest(params) + .then((data: v2.CreateDataDeletionResponseBody) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/data-deletion/GetDataDeletionRequests.ts b/examples/v2/data-deletion/GetDataDeletionRequests.ts new file mode 100644 index 000000000000..df9cfb24804f --- /dev/null +++ b/examples/v2/data-deletion/GetDataDeletionRequests.ts @@ -0,0 +1,17 @@ +/** + * Gets a list of data deletion requests returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.DataDeletionApi(configuration); + +apiInstance + .getDataDeletionRequests() + .then((data: v2.GetDataDeletionsResponseBody) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 68cd43249f77..a738e99b4d2c 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -3356,6 +3356,47 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "DashboardListUpdateItemsResponse", }, + "v2.CreateDataDeletionRequest": { + "product": { + "type": "string", + "format": "", + }, + "body": { + "type": "CreateDataDeletionRequestBody", + "format": "", + }, + "operationResponseType": "CreateDataDeletionResponseBody", + }, + "v2.GetDataDeletionRequests": { + "nextPage": { + "type": "string", + "format": "", + }, + "product": { + "type": "string", + "format": "", + }, + "query": { + "type": "string", + "format": "", + }, + "status": { + "type": "string", + "format": "", + }, + "pageSize": { + "type": "number", + "format": "int64", + }, + "operationResponseType": "GetDataDeletionsResponseBody", + }, + "v2.CancelDataDeletionRequest": { + "id": { + "type": "string", + "format": "", + }, + "operationResponseType": "CancelDataDeletionResponseBody", + }, "v2.GetDomainAllowlist": { "operationResponseType": "DomainAllowlistResponse", }, diff --git a/features/v2/data_deletion.feature b/features/v2/data_deletion.feature new file mode 100644 index 000000000000..84c5830ead3a --- /dev/null +++ b/features/v2/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/features/v2/given.json b/features/v2/given.json index 41cd8e0f22a3..62f11ecc9502 100644 --- a/features/v2/given.json +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index 91f554953bdf..608035022755 100644 --- a/features/v2/undo.json +++ b/features/v2/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": { diff --git a/packages/datadog-api-client-v2/apis/DataDeletionApi.ts b/packages/datadog-api-client-v2/apis/DataDeletionApi.ts new file mode 100644 index 000000000000..a9f7c929593b --- /dev/null +++ b/packages/datadog-api-client-v2/apis/DataDeletionApi.ts @@ -0,0 +1,507 @@ +import { + BaseAPIRequestFactory, + RequiredError, +} from "../../datadog-api-client-common/baseapi"; +import { + Configuration, + applySecurityAuthentication, +} from "../../datadog-api-client-common/configuration"; +import { + RequestContext, + HttpMethod, + ResponseContext, +} from "../../datadog-api-client-common/http/http"; + +import { logger } from "../../../logger"; +import { ObjectSerializer } from "../models/ObjectSerializer"; +import { ApiException } from "../../datadog-api-client-common/exception"; + +import { APIErrorResponse } from "../models/APIErrorResponse"; +import { CancelDataDeletionResponseBody } from "../models/CancelDataDeletionResponseBody"; +import { CreateDataDeletionRequestBody } from "../models/CreateDataDeletionRequestBody"; +import { CreateDataDeletionResponseBody } from "../models/CreateDataDeletionResponseBody"; +import { GetDataDeletionsResponseBody } from "../models/GetDataDeletionsResponseBody"; + +export class DataDeletionApiRequestFactory extends BaseAPIRequestFactory { + public async cancelDataDeletionRequest( + id: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("id", "cancelDataDeletionRequest"); + } + + // Path Params + const localVarPath = "/api/v2/deletion/requests/{id}/cancel".replace( + "{id}", + encodeURIComponent(String(id)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.DataDeletionApi.cancelDataDeletionRequest") + .makeRequestContext(localVarPath, HttpMethod.PUT); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async createDataDeletionRequest( + product: string, + body: CreateDataDeletionRequestBody, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'product' is not null or undefined + if (product === null || product === undefined) { + throw new RequiredError("product", "createDataDeletionRequest"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createDataDeletionRequest"); + } + + // Path Params + const localVarPath = "/api/v2/deletion/data/{product}".replace( + "{product}", + encodeURIComponent(String(product)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.DataDeletionApi.createDataDeletionRequest") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "CreateDataDeletionRequestBody", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getDataDeletionRequests( + nextPage?: string, + product?: string, + query?: string, + status?: string, + pageSize?: number, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // Path Params + const localVarPath = "/api/v2/deletion/requests"; + + // Make Request Context + const requestContext = _config + .getServer("v2.DataDeletionApi.getDataDeletionRequests") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (nextPage !== undefined) { + requestContext.setQueryParam( + "next_page", + ObjectSerializer.serialize(nextPage, "string", ""), + "" + ); + } + if (product !== undefined) { + requestContext.setQueryParam( + "product", + ObjectSerializer.serialize(product, "string", ""), + "" + ); + } + if (query !== undefined) { + requestContext.setQueryParam( + "query", + ObjectSerializer.serialize(query, "string", ""), + "" + ); + } + if (status !== undefined) { + requestContext.setQueryParam( + "status", + ObjectSerializer.serialize(status, "string", ""), + "" + ); + } + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page_size", + ObjectSerializer.serialize(pageSize, "number", "int64"), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class DataDeletionApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to cancelDataDeletionRequest + * @throws ApiException if the response code was not in [200, 299] + */ + public async cancelDataDeletionRequest( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: CancelDataDeletionResponseBody = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CancelDataDeletionResponseBody" + ) as CancelDataDeletionResponseBody; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 412 || + response.httpStatusCode === 429 || + response.httpStatusCode === 500 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: CancelDataDeletionResponseBody = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CancelDataDeletionResponseBody", + "" + ) as CancelDataDeletionResponseBody; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createDataDeletionRequest + * @throws ApiException if the response code was not in [200, 299] + */ + public async createDataDeletionRequest( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: CreateDataDeletionResponseBody = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CreateDataDeletionResponseBody" + ) as CreateDataDeletionResponseBody; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 412 || + response.httpStatusCode === 429 || + response.httpStatusCode === 500 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: CreateDataDeletionResponseBody = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CreateDataDeletionResponseBody", + "" + ) as CreateDataDeletionResponseBody; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getDataDeletionRequests + * @throws ApiException if the response code was not in [200, 299] + */ + public async getDataDeletionRequests( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: GetDataDeletionsResponseBody = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "GetDataDeletionsResponseBody" + ) as GetDataDeletionsResponseBody; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 || + response.httpStatusCode === 500 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: GetDataDeletionsResponseBody = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "GetDataDeletionsResponseBody", + "" + ) as GetDataDeletionsResponseBody; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } +} + +export interface DataDeletionApiCancelDataDeletionRequestRequest { + /** + * ID of the deletion request. + * @type string + */ + id: string; +} + +export interface DataDeletionApiCreateDataDeletionRequestRequest { + /** + * Name of the product to be deleted, either `logs` or `rum`. + * @type string + */ + product: string; + /** + * @type CreateDataDeletionRequestBody + */ + body: CreateDataDeletionRequestBody; +} + +export interface DataDeletionApiGetDataDeletionRequestsRequest { + /** + * The next page of the previous search. If the next_page parameter is included, the rest of the query elements are ignored. + * @type string + */ + nextPage?: string; + /** + * Retrieve only the requests related to the given product. + * @type string + */ + product?: string; + /** + * Retrieve only the requests that matches the given query. + * @type string + */ + query?: string; + /** + * Retrieve only the requests with the given status. + * @type string + */ + status?: string; + /** + * Sets the page size of the search. + * @type number + */ + pageSize?: number; +} + +export class DataDeletionApi { + private requestFactory: DataDeletionApiRequestFactory; + private responseProcessor: DataDeletionApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: DataDeletionApiRequestFactory, + responseProcessor?: DataDeletionApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = + requestFactory || new DataDeletionApiRequestFactory(configuration); + this.responseProcessor = + responseProcessor || new DataDeletionApiResponseProcessor(); + } + + /** + * Cancels a data deletion request by providing its ID. + * @param param The request object + */ + public cancelDataDeletionRequest( + param: DataDeletionApiCancelDataDeletionRequestRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.cancelDataDeletionRequest( + param.id, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.cancelDataDeletionRequest( + responseContext + ); + }); + }); + } + + /** + * Creates a data deletion request by providing a query and a time frame targeting the proper data. + * @param param The request object + */ + public createDataDeletionRequest( + param: DataDeletionApiCreateDataDeletionRequestRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.createDataDeletionRequest( + param.product, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createDataDeletionRequest( + responseContext + ); + }); + }); + } + + /** + * Gets a list of data deletion requests based on several filter parameters. + * @param param The request object + */ + public getDataDeletionRequests( + param: DataDeletionApiGetDataDeletionRequestsRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getDataDeletionRequests( + param.nextPage, + param.product, + param.query, + param.status, + param.pageSize, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getDataDeletionRequests( + responseContext + ); + }); + }); + } +} diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 11ba56ac4073..52d07ad20f0c 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -143,6 +143,13 @@ export { DashboardListsApi, } from "./apis/DashboardListsApi"; +export { + DataDeletionApiCancelDataDeletionRequestRequest, + DataDeletionApiCreateDataDeletionRequestRequest, + DataDeletionApiGetDataDeletionRequestsRequest, + DataDeletionApi, +} from "./apis/DataDeletionApi"; + export { DomainAllowlistApiPatchDomainAllowlistRequest, DomainAllowlistApi, @@ -730,6 +737,7 @@ export { BulkMuteFindingsRequestProperties } from "./models/BulkMuteFindingsRequ export { BulkMuteFindingsResponse } from "./models/BulkMuteFindingsResponse"; export { BulkMuteFindingsResponseData } from "./models/BulkMuteFindingsResponseData"; export { CalculatedField } from "./models/CalculatedField"; +export { CancelDataDeletionResponseBody } from "./models/CancelDataDeletionResponseBody"; export { Case } from "./models/Case"; export { Case3rdPartyTicketStatus } from "./models/Case3rdPartyTicketStatus"; export { CaseAssign } from "./models/CaseAssign"; @@ -934,6 +942,10 @@ export { CostByOrg } from "./models/CostByOrg"; export { CostByOrgAttributes } from "./models/CostByOrgAttributes"; export { CostByOrgResponse } from "./models/CostByOrgResponse"; export { CostByOrgType } from "./models/CostByOrgType"; +export { CreateDataDeletionRequestBody } from "./models/CreateDataDeletionRequestBody"; +export { CreateDataDeletionRequestBodyAttributes } from "./models/CreateDataDeletionRequestBodyAttributes"; +export { CreateDataDeletionRequestBodyData } from "./models/CreateDataDeletionRequestBodyData"; +export { CreateDataDeletionResponseBody } from "./models/CreateDataDeletionResponseBody"; export { CreateOpenAPIResponse } from "./models/CreateOpenAPIResponse"; export { CreateOpenAPIResponseAttributes } from "./models/CreateOpenAPIResponseAttributes"; export { CreateOpenAPIResponseData } from "./models/CreateOpenAPIResponseData"; @@ -1003,6 +1015,9 @@ export { DashboardListItems } from "./models/DashboardListItems"; export { DashboardListUpdateItemsRequest } from "./models/DashboardListUpdateItemsRequest"; export { DashboardListUpdateItemsResponse } from "./models/DashboardListUpdateItemsResponse"; export { DashboardType } from "./models/DashboardType"; +export { DataDeletionResponseItem } from "./models/DataDeletionResponseItem"; +export { DataDeletionResponseItemAttributes } from "./models/DataDeletionResponseItemAttributes"; +export { DataDeletionResponseMeta } from "./models/DataDeletionResponseMeta"; export { DataScalarColumn } from "./models/DataScalarColumn"; export { DetailedFinding } from "./models/DetailedFinding"; export { DetailedFindingAttributes } from "./models/DetailedFindingAttributes"; @@ -1205,6 +1220,7 @@ export { GCPSTSServiceAccountResponse } from "./models/GCPSTSServiceAccountRespo export { GCPSTSServiceAccountsResponse } from "./models/GCPSTSServiceAccountsResponse"; export { GCPSTSServiceAccountUpdateRequest } from "./models/GCPSTSServiceAccountUpdateRequest"; export { GCPSTSServiceAccountUpdateRequestData } from "./models/GCPSTSServiceAccountUpdateRequestData"; +export { GetDataDeletionsResponseBody } from "./models/GetDataDeletionsResponseBody"; export { GetDeviceAttributes } from "./models/GetDeviceAttributes"; export { GetDeviceData } from "./models/GetDeviceData"; export { GetDeviceResponse } from "./models/GetDeviceResponse"; diff --git a/packages/datadog-api-client-v2/models/CancelDataDeletionResponseBody.ts b/packages/datadog-api-client-v2/models/CancelDataDeletionResponseBody.ts new file mode 100644 index 000000000000..7ead179b5bbc --- /dev/null +++ b/packages/datadog-api-client-v2/models/CancelDataDeletionResponseBody.ts @@ -0,0 +1,62 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { DataDeletionResponseItem } from "./DataDeletionResponseItem"; +import { DataDeletionResponseMeta } from "./DataDeletionResponseMeta"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The response from the cancel data deletion request endpoint. + */ +export class CancelDataDeletionResponseBody { + /** + * The created data deletion request information. + */ + "data"?: DataDeletionResponseItem; + /** + * The metadata of the data deletion response. + */ + "meta"?: DataDeletionResponseMeta; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "DataDeletionResponseItem", + }, + meta: { + baseName: "meta", + type: "DataDeletionResponseMeta", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CancelDataDeletionResponseBody.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/CreateDataDeletionRequestBody.ts b/packages/datadog-api-client-v2/models/CreateDataDeletionRequestBody.ts new file mode 100644 index 000000000000..03ac3b956d99 --- /dev/null +++ b/packages/datadog-api-client-v2/models/CreateDataDeletionRequestBody.ts @@ -0,0 +1,54 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { CreateDataDeletionRequestBodyData } from "./CreateDataDeletionRequestBodyData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object needed to create a data deletion request. + */ +export class CreateDataDeletionRequestBody { + /** + * Data needed to create a data deletion request. + */ + "data": CreateDataDeletionRequestBodyData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "CreateDataDeletionRequestBodyData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateDataDeletionRequestBody.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/CreateDataDeletionRequestBodyAttributes.ts b/packages/datadog-api-client-v2/models/CreateDataDeletionRequestBodyAttributes.ts new file mode 100644 index 000000000000..1c7d82c1e553 --- /dev/null +++ b/packages/datadog-api-client-v2/models/CreateDataDeletionRequestBodyAttributes.ts @@ -0,0 +1,81 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for creating a data deletion request. + */ +export class CreateDataDeletionRequestBodyAttributes { + /** + * Start of requested time window, milliseconds since Unix epoch. + */ + "from": number; + /** + * List of indexes for the search. If not provided, the search is performed in all indexes. + */ + "indexes"?: Array; + /** + * Query for creating a data deletion request. + */ + "query": { [key: string]: string }; + /** + * End of requested time window, milliseconds since Unix epoch. + */ + "to": number; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + from: { + baseName: "from", + type: "number", + required: true, + format: "int64", + }, + indexes: { + baseName: "indexes", + type: "Array", + }, + query: { + baseName: "query", + type: "{ [key: string]: string; }", + required: true, + }, + to: { + baseName: "to", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateDataDeletionRequestBodyAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/CreateDataDeletionRequestBodyData.ts b/packages/datadog-api-client-v2/models/CreateDataDeletionRequestBodyData.ts new file mode 100644 index 000000000000..815e6a955eb3 --- /dev/null +++ b/packages/datadog-api-client-v2/models/CreateDataDeletionRequestBodyData.ts @@ -0,0 +1,54 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { CreateDataDeletionRequestBodyAttributes } from "./CreateDataDeletionRequestBodyAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data needed to create a data deletion request. + */ +export class CreateDataDeletionRequestBodyData { + /** + * Attributes for creating a data deletion request. + */ + "attributes": CreateDataDeletionRequestBodyAttributes; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "CreateDataDeletionRequestBodyAttributes", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateDataDeletionRequestBodyData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/CreateDataDeletionResponseBody.ts b/packages/datadog-api-client-v2/models/CreateDataDeletionResponseBody.ts new file mode 100644 index 000000000000..1006e9073e7d --- /dev/null +++ b/packages/datadog-api-client-v2/models/CreateDataDeletionResponseBody.ts @@ -0,0 +1,62 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { DataDeletionResponseItem } from "./DataDeletionResponseItem"; +import { DataDeletionResponseMeta } from "./DataDeletionResponseMeta"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The response from the create data deletion request endpoint. + */ +export class CreateDataDeletionResponseBody { + /** + * The created data deletion request information. + */ + "data"?: DataDeletionResponseItem; + /** + * The metadata of the data deletion response. + */ + "meta"?: DataDeletionResponseMeta; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "DataDeletionResponseItem", + }, + meta: { + baseName: "meta", + type: "DataDeletionResponseMeta", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateDataDeletionResponseBody.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/DataDeletionResponseItem.ts b/packages/datadog-api-client-v2/models/DataDeletionResponseItem.ts new file mode 100644 index 000000000000..5a3865936d85 --- /dev/null +++ b/packages/datadog-api-client-v2/models/DataDeletionResponseItem.ts @@ -0,0 +1,72 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { DataDeletionResponseItemAttributes } from "./DataDeletionResponseItemAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The created data deletion request information. + */ +export class DataDeletionResponseItem { + /** + * Deletion attribute for data deletion response. + */ + "attributes": DataDeletionResponseItemAttributes; + /** + * The ID of the created data deletion request. + */ + "id": string; + /** + * The type of the request created. + */ + "type": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "DataDeletionResponseItemAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DataDeletionResponseItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/DataDeletionResponseItemAttributes.ts b/packages/datadog-api-client-v2/models/DataDeletionResponseItemAttributes.ts new file mode 100644 index 000000000000..84397112a93b --- /dev/null +++ b/packages/datadog-api-client-v2/models/DataDeletionResponseItemAttributes.ts @@ -0,0 +1,164 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Deletion attribute for data deletion response. + */ +export class DataDeletionResponseItemAttributes { + /** + * Creation time of the deletion request. + */ + "createdAt": string; + /** + * User who created the deletion request. + */ + "createdBy": string; + /** + * Start of requested time window, milliseconds since Unix epoch. + */ + "fromTime": number; + /** + * List of indexes for the search. If not provided, the search is performed in all indexes. + */ + "indexes"?: Array; + /** + * Whether the deletion request is fully created or not. + */ + "isCreated": boolean; + /** + * Organization ID. + */ + "orgId": number; + /** + * Product name. + */ + "product": string; + /** + * Query for creating a data deletion request. + */ + "query": string; + /** + * Starting time of the process to delete the requested data. + */ + "startingAt": string; + /** + * Status of the deletion request. + */ + "status": string; + /** + * End of requested time window, milliseconds since Unix epoch. + */ + "toTime": number; + /** + * 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. + */ + "totalUnrestricted": number; + /** + * Update time of the deletion request. + */ + "updatedAt": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + createdAt: { + baseName: "created_at", + type: "string", + required: true, + }, + createdBy: { + baseName: "created_by", + type: "string", + required: true, + }, + fromTime: { + baseName: "from_time", + type: "number", + required: true, + format: "int64", + }, + indexes: { + baseName: "indexes", + type: "Array", + }, + isCreated: { + baseName: "is_created", + type: "boolean", + required: true, + }, + orgId: { + baseName: "org_id", + type: "number", + required: true, + format: "int64", + }, + product: { + baseName: "product", + type: "string", + required: true, + }, + query: { + baseName: "query", + type: "string", + required: true, + }, + startingAt: { + baseName: "starting_at", + type: "string", + required: true, + }, + status: { + baseName: "status", + type: "string", + required: true, + }, + toTime: { + baseName: "to_time", + type: "number", + required: true, + format: "int64", + }, + totalUnrestricted: { + baseName: "total_unrestricted", + type: "number", + required: true, + format: "int64", + }, + updatedAt: { + baseName: "updated_at", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DataDeletionResponseItemAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/DataDeletionResponseMeta.ts b/packages/datadog-api-client-v2/models/DataDeletionResponseMeta.ts new file mode 100644 index 000000000000..ca9d2aad2df5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/DataDeletionResponseMeta.ts @@ -0,0 +1,84 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The metadata of the data deletion response. + */ +export class DataDeletionResponseMeta { + /** + * The total deletion requests created by product. + */ + "countProduct"?: { [key: string]: number }; + /** + * The total deletion requests created by status. + */ + "countStatus"?: { [key: string]: number }; + /** + * The next page when searching deletion requests created in the current organization. + */ + "nextPage"?: string; + /** + * The product of the deletion request. + */ + "product"?: string; + /** + * The status of the executed request. + */ + "requestStatus"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + countProduct: { + baseName: "count_product", + type: "{ [key: string]: number; }", + }, + countStatus: { + baseName: "count_status", + type: "{ [key: string]: number; }", + }, + nextPage: { + baseName: "next_page", + type: "string", + }, + product: { + baseName: "product", + type: "string", + }, + requestStatus: { + baseName: "request_status", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DataDeletionResponseMeta.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/GetDataDeletionsResponseBody.ts b/packages/datadog-api-client-v2/models/GetDataDeletionsResponseBody.ts new file mode 100644 index 000000000000..818533d20c89 --- /dev/null +++ b/packages/datadog-api-client-v2/models/GetDataDeletionsResponseBody.ts @@ -0,0 +1,62 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { DataDeletionResponseItem } from "./DataDeletionResponseItem"; +import { DataDeletionResponseMeta } from "./DataDeletionResponseMeta"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The response from the get data deletion requests endpoint. + */ +export class GetDataDeletionsResponseBody { + /** + * The list of data deletion requests that matches the query. + */ + "data"?: Array; + /** + * The metadata of the data deletion response. + */ + "meta"?: DataDeletionResponseMeta; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + meta: { + baseName: "meta", + type: "DataDeletionResponseMeta", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetDataDeletionsResponseBody.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index ad3271945834..a83a66b980b7 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -158,6 +158,7 @@ import { CIAppTestsGroupBy } from "./CIAppTestsGroupBy"; import { CIAppTestsQueryFilter } from "./CIAppTestsQueryFilter"; import { CIAppWarning } from "./CIAppWarning"; import { CalculatedField } from "./CalculatedField"; +import { CancelDataDeletionResponseBody } from "./CancelDataDeletionResponseBody"; import { Case } from "./Case"; import { CaseAssign } from "./CaseAssign"; import { CaseAssignAttributes } from "./CaseAssignAttributes"; @@ -268,6 +269,10 @@ import { CostAttributionAggregatesBody } from "./CostAttributionAggregatesBody"; import { CostByOrg } from "./CostByOrg"; import { CostByOrgAttributes } from "./CostByOrgAttributes"; import { CostByOrgResponse } from "./CostByOrgResponse"; +import { CreateDataDeletionRequestBody } from "./CreateDataDeletionRequestBody"; +import { CreateDataDeletionRequestBodyAttributes } from "./CreateDataDeletionRequestBodyAttributes"; +import { CreateDataDeletionRequestBodyData } from "./CreateDataDeletionRequestBodyData"; +import { CreateDataDeletionResponseBody } from "./CreateDataDeletionResponseBody"; import { CreateOpenAPIResponse } from "./CreateOpenAPIResponse"; import { CreateOpenAPIResponseAttributes } from "./CreateOpenAPIResponseAttributes"; import { CreateOpenAPIResponseData } from "./CreateOpenAPIResponseData"; @@ -331,6 +336,9 @@ import { DashboardListItemResponse } from "./DashboardListItemResponse"; import { DashboardListItems } from "./DashboardListItems"; import { DashboardListUpdateItemsRequest } from "./DashboardListUpdateItemsRequest"; import { DashboardListUpdateItemsResponse } from "./DashboardListUpdateItemsResponse"; +import { DataDeletionResponseItem } from "./DataDeletionResponseItem"; +import { DataDeletionResponseItemAttributes } from "./DataDeletionResponseItemAttributes"; +import { DataDeletionResponseMeta } from "./DataDeletionResponseMeta"; import { DataScalarColumn } from "./DataScalarColumn"; import { DetailedFinding } from "./DetailedFinding"; import { DetailedFindingAttributes } from "./DetailedFindingAttributes"; @@ -483,6 +491,7 @@ import { GCPSTSServiceAccountUpdateRequest } from "./GCPSTSServiceAccountUpdateR import { GCPSTSServiceAccountUpdateRequestData } from "./GCPSTSServiceAccountUpdateRequestData"; import { GCPSTSServiceAccountsResponse } from "./GCPSTSServiceAccountsResponse"; import { GCPServiceAccountMeta } from "./GCPServiceAccountMeta"; +import { GetDataDeletionsResponseBody } from "./GetDataDeletionsResponseBody"; import { GetDeviceAttributes } from "./GetDeviceAttributes"; import { GetDeviceData } from "./GetDeviceData"; import { GetDeviceResponse } from "./GetDeviceResponse"; @@ -2195,6 +2204,7 @@ const typeMap: { [index: string]: any } = { CIAppTestsQueryFilter: CIAppTestsQueryFilter, CIAppWarning: CIAppWarning, CalculatedField: CalculatedField, + CancelDataDeletionResponseBody: CancelDataDeletionResponseBody, Case: Case, CaseAssign: CaseAssign, CaseAssignAttributes: CaseAssignAttributes, @@ -2325,6 +2335,11 @@ const typeMap: { [index: string]: any } = { CostByOrg: CostByOrg, CostByOrgAttributes: CostByOrgAttributes, CostByOrgResponse: CostByOrgResponse, + CreateDataDeletionRequestBody: CreateDataDeletionRequestBody, + CreateDataDeletionRequestBodyAttributes: + CreateDataDeletionRequestBodyAttributes, + CreateDataDeletionRequestBodyData: CreateDataDeletionRequestBodyData, + CreateDataDeletionResponseBody: CreateDataDeletionResponseBody, CreateOpenAPIResponse: CreateOpenAPIResponse, CreateOpenAPIResponseAttributes: CreateOpenAPIResponseAttributes, CreateOpenAPIResponseData: CreateOpenAPIResponseData, @@ -2404,6 +2419,9 @@ const typeMap: { [index: string]: any } = { DashboardListItems: DashboardListItems, DashboardListUpdateItemsRequest: DashboardListUpdateItemsRequest, DashboardListUpdateItemsResponse: DashboardListUpdateItemsResponse, + DataDeletionResponseItem: DataDeletionResponseItem, + DataDeletionResponseItemAttributes: DataDeletionResponseItemAttributes, + DataDeletionResponseMeta: DataDeletionResponseMeta, DataScalarColumn: DataScalarColumn, DetailedFinding: DetailedFinding, DetailedFindingAttributes: DetailedFindingAttributes, @@ -2570,6 +2588,7 @@ const typeMap: { [index: string]: any } = { GCPSTSServiceAccountUpdateRequestData: GCPSTSServiceAccountUpdateRequestData, GCPSTSServiceAccountsResponse: GCPSTSServiceAccountsResponse, GCPServiceAccountMeta: GCPServiceAccountMeta, + GetDataDeletionsResponseBody: GetDataDeletionsResponseBody, GetDeviceAttributes: GetDeviceAttributes, GetDeviceData: GetDeviceData, GetDeviceResponse: GetDeviceResponse,