Skip to content

Commit e80a43e

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Add type in Data Deletion API (#2358)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent fd4b3fa commit e80a43e

19 files changed

+166
-88
lines changed

Diff for: .apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-01-17 19:31:42.049587",
8-
"spec_repo_commit": "45186abe"
7+
"regenerated": "2025-01-17 20:19:08.532230",
8+
"spec_repo_commit": "4e5906d6"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-17 19:31:42.068225",
13-
"spec_repo_commit": "45186abe"
12+
"regenerated": "2025-01-17 20:19:08.546517",
13+
"spec_repo_commit": "4e5906d6"
1414
}
1515
}
1616
}

Diff for: .generator/schemas/v2/openapi.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -7378,9 +7378,20 @@ components:
73787378
properties:
73797379
attributes:
73807380
$ref: '#/components/schemas/CreateDataDeletionRequestBodyAttributes'
7381+
type:
7382+
$ref: '#/components/schemas/CreateDataDeletionRequestBodyDataType'
73817383
required:
73827384
- attributes
7385+
- type
73837386
type: object
7387+
CreateDataDeletionRequestBodyDataType:
7388+
description: The deletion request type.
7389+
enum:
7390+
- create_deletion_req
7391+
example: create_deletion_req
7392+
type: string
7393+
x-enum-varnames:
7394+
- CREATE_DELETION_REQ
73847395
CreateDataDeletionResponseBody:
73857396
description: The response from the create data deletion request endpoint.
73867397
properties:

Diff for: docs/datadog_api_client.v2.model.rst

+7
Original file line numberDiff line numberDiff line change
@@ -2867,6 +2867,13 @@ datadog\_api\_client.v2.model.create\_data\_deletion\_request\_body\_data module
28672867
:members:
28682868
:show-inheritance:
28692869

2870+
datadog\_api\_client.v2.model.create\_data\_deletion\_request\_body\_data\_type module
2871+
--------------------------------------------------------------------------------------
2872+
2873+
.. automodule:: datadog_api_client.v2.model.create_data_deletion_request_body_data_type
2874+
:members:
2875+
:show-inheritance:
2876+
28702877
datadog\_api\_client.v2.model.create\_data\_deletion\_response\_body module
28712878
---------------------------------------------------------------------------
28722879

Diff for: examples/v2/data-deletion/CreateDataDeletionRequest.py

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
CreateDataDeletionRequestBodyAttributes,
1010
)
1111
from datadog_api_client.v2.model.create_data_deletion_request_body_data import CreateDataDeletionRequestBodyData
12+
from datadog_api_client.v2.model.create_data_deletion_request_body_data_type import (
13+
CreateDataDeletionRequestBodyDataType,
14+
)
1215

1316
body = CreateDataDeletionRequestBody(
1417
data=CreateDataDeletionRequestBodyData(
@@ -24,6 +27,7 @@
2427
),
2528
to=1704063600000,
2629
),
30+
type=CreateDataDeletionRequestBodyDataType.CREATE_DELETION_REQ,
2731
),
2832
)
2933

Diff for: src/datadog_api_client/v2/model/create_data_deletion_request_body_data.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
from datadog_api_client.v2.model.create_data_deletion_request_body_attributes import (
1616
CreateDataDeletionRequestBodyAttributes,
1717
)
18+
from datadog_api_client.v2.model.create_data_deletion_request_body_data_type import (
19+
CreateDataDeletionRequestBodyDataType,
20+
)
1821

1922

2023
class CreateDataDeletionRequestBodyData(ModelNormal):
@@ -23,22 +26,36 @@ def openapi_types(_):
2326
from datadog_api_client.v2.model.create_data_deletion_request_body_attributes import (
2427
CreateDataDeletionRequestBodyAttributes,
2528
)
29+
from datadog_api_client.v2.model.create_data_deletion_request_body_data_type import (
30+
CreateDataDeletionRequestBodyDataType,
31+
)
2632

2733
return {
2834
"attributes": (CreateDataDeletionRequestBodyAttributes,),
35+
"type": (CreateDataDeletionRequestBodyDataType,),
2936
}
3037

3138
attribute_map = {
3239
"attributes": "attributes",
40+
"type": "type",
3341
}
3442

35-
def __init__(self_, attributes: CreateDataDeletionRequestBodyAttributes, **kwargs):
43+
def __init__(
44+
self_,
45+
attributes: CreateDataDeletionRequestBodyAttributes,
46+
type: CreateDataDeletionRequestBodyDataType,
47+
**kwargs,
48+
):
3649
"""
3750
Data needed to create a data deletion request.
3851
3952
:param attributes: Attributes for creating a data deletion request.
4053
:type attributes: CreateDataDeletionRequestBodyAttributes
54+
55+
:param type: The deletion request type.
56+
:type type: CreateDataDeletionRequestBodyDataType
4157
"""
4258
super().__init__(kwargs)
4359

4460
self_.attributes = attributes
61+
self_.type = type
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class CreateDataDeletionRequestBodyDataType(ModelSimple):
16+
"""
17+
The deletion request type.
18+
19+
:param value: If omitted defaults to "create_deletion_req". Must be one of ["create_deletion_req"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"create_deletion_req",
25+
}
26+
CREATE_DELETION_REQ: ClassVar["CreateDataDeletionRequestBodyDataType"]
27+
28+
@cached_property
29+
def openapi_types(_):
30+
return {
31+
"value": (str,),
32+
}
33+
34+
35+
CreateDataDeletionRequestBodyDataType.CREATE_DELETION_REQ = CreateDataDeletionRequestBodyDataType("create_deletion_req")

Diff for: src/datadog_api_client/v2/models/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,9 @@
477477
CreateDataDeletionRequestBodyAttributes,
478478
)
479479
from datadog_api_client.v2.model.create_data_deletion_request_body_data import CreateDataDeletionRequestBodyData
480+
from datadog_api_client.v2.model.create_data_deletion_request_body_data_type import (
481+
CreateDataDeletionRequestBodyDataType,
482+
)
480483
from datadog_api_client.v2.model.create_data_deletion_response_body import CreateDataDeletionResponseBody
481484
from datadog_api_client.v2.model.create_open_api_response import CreateOpenAPIResponse
482485
from datadog_api_client.v2.model.create_open_api_response_attributes import CreateOpenAPIResponseAttributes
@@ -2777,6 +2780,7 @@
27772780
"CreateDataDeletionRequestBody",
27782781
"CreateDataDeletionRequestBodyAttributes",
27792782
"CreateDataDeletionRequestBodyData",
2783+
"CreateDataDeletionRequestBodyDataType",
27802784
"CreateDataDeletionResponseBody",
27812785
"CreateOpenAPIResponse",
27822786
"CreateOpenAPIResponseAttributes",
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-12-05T09:23:41.160Z
1+
2025-01-15T14:25:54.929Z
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-12-05T09:23:41.674Z
1+
2025-01-15T14:26:08.930Z

Diff for: tests/v2/cassettes/test_scenarios/test_cancels_a_data_deletion_request_returns_ok_response.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"data":{"attributes":{"from":1672527600000,"indexes":["test-index","test-index-2"],"query":{"host":"abc","service":"xyz"},"to":1704063600000}}}'
3+
body: '{"data":{"attributes":{"from":1672527600000,"indexes":["test-index","test-index-2"],"query":{"host":"abc","service":"xyz"},"to":1704063600000},"type":"create_deletion_req"}}'
44
headers:
55
accept:
66
- application/json
@@ -10,8 +10,8 @@ interactions:
1010
uri: https://api.datadoghq.com/api/v2/deletion/data/logs
1111
response:
1212
body:
13-
string: '{"data":{"id":"523","type":"deletion_request","attributes":{"created_at":"2024-12-05T09:23:42.016613164Z","created_by":"[email protected]","from_time":1672527600000,"indexes":["test-index","test-index-2"],"is_created":false,"org_id":321813,"product":"logs","query":"host:abc
14-
service:xyz","starting_at":"0001-01-01T00:00:00Z","status":"pending","to_time":1704063600000,"total_unrestricted":0,"updated_at":"2024-12-05T09:23:42.016613164Z"}},"meta":{"product":"logs"}}'
13+
string: '{"data":{"id":"753","type":"deletion_request","attributes":{"created_at":"2025-01-15T14:26:09.447960191Z","created_by":"[email protected]","from_time":1672527600000,"indexes":["test-index","test-index-2"],"is_created":false,"org_id":321813,"product":"logs","query":"host:abc
14+
service:xyz","starting_at":"0001-01-01T00:00:00Z","status":"pending","to_time":1704063600000,"total_unrestricted":0,"updated_at":"2025-01-15T14:26:09.447960191Z"}},"meta":{"product":"logs"}}'
1515
headers:
1616
content-type:
1717
- application/vnd.api+json
@@ -24,11 +24,11 @@ interactions:
2424
accept:
2525
- application/json
2626
method: PUT
27-
uri: https://api.datadoghq.com/api/v2/deletion/requests/523/cancel
27+
uri: https://api.datadoghq.com/api/v2/deletion/requests/753/cancel
2828
response:
2929
body:
30-
string: '{"data":{"id":"523","type":"deletion_request","attributes":{"created_at":"2024-12-05T09:23:42.016613Z","created_by":"[email protected]","from_time":1672527600000,"indexes":["test-index","test-index-2"],"is_created":false,"org_id":321813,"product":"logs","query":"host:abc
31-
service:xyz","starting_at":"0001-01-01T00:00:00Z","status":"canceled","to_time":1704063600000,"total_unrestricted":0,"updated_at":"2024-12-05T09:23:42.384299Z"}},"meta":{"product":"logs","request_status":"canceled"}}'
30+
string: '{"data":{"id":"753","type":"deletion_request","attributes":{"created_at":"2025-01-15T14:26:09.44796Z","created_by":"[email protected]","from_time":1672527600000,"indexes":["test-index","test-index-2"],"is_created":false,"org_id":321813,"product":"logs","query":"host:abc
31+
service:xyz","starting_at":"0001-01-01T00:00:00Z","status":"canceled","to_time":1704063600000,"total_unrestricted":0,"updated_at":"2025-01-15T14:26:10.016496Z"}},"meta":{"product":"logs","request_status":"canceled"}}'
3232
headers:
3333
content-type:
3434
- application/vnd.api+json
@@ -41,11 +41,11 @@ interactions:
4141
accept:
4242
- application/json
4343
method: PUT
44-
uri: https://api.datadoghq.com/api/v2/deletion/requests/523/cancel
44+
uri: https://api.datadoghq.com/api/v2/deletion/requests/753/cancel
4545
response:
4646
body:
47-
string: '{"data":{"id":"523","type":"deletion_request","attributes":{"created_at":"2024-12-05T09:23:42.016613Z","created_by":"[email protected]","from_time":1672527600000,"indexes":["test-index","test-index-2"],"is_created":false,"org_id":321813,"product":"logs","query":"host:abc
48-
service:xyz","starting_at":"0001-01-01T00:00:00Z","status":"canceled","to_time":1704063600000,"total_unrestricted":0,"updated_at":"2024-12-05T09:23:42.384299Z"}},"meta":{"product":"logs","request_status":"canceled"}}'
47+
string: '{"data":{"id":"753","type":"deletion_request","attributes":{"created_at":"2025-01-15T14:26:09.44796Z","created_by":"[email protected]","from_time":1672527600000,"indexes":["test-index","test-index-2"],"is_created":false,"org_id":321813,"product":"logs","query":"host:abc
48+
service:xyz","starting_at":"0001-01-01T00:00:00Z","status":"canceled","to_time":1704063600000,"total_unrestricted":0,"updated_at":"2025-01-15T14:26:10.016496Z"}},"meta":{"product":"logs","request_status":"canceled"}}'
4949
headers:
5050
content-type:
5151
- application/vnd.api+json
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-12-05T09:23:42.850Z
1+
2025-01-15T14:26:26.195Z
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-12-05T09:23:43.197Z
1+
2025-01-15T14:27:27.929Z

Diff for: tests/v2/cassettes/test_scenarios/test_creates_a_data_deletion_request_returns_ok_response.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"data":{"attributes":{"from":1672527600000,"indexes":["test-index","test-index-2"],"query":{"host":"abc","service":"xyz"},"to":1704063600000}}}'
3+
body: '{"data":{"attributes":{"from":1672527600000,"indexes":["test-index","test-index-2"],"query":{"host":"abc","service":"xyz"},"to":1704063600000},"type":"create_deletion_req"}}'
44
headers:
55
accept:
66
- application/json
@@ -10,8 +10,8 @@ interactions:
1010
uri: https://api.datadoghq.com/api/v2/deletion/data/logs
1111
response:
1212
body:
13-
string: '{"data":{"id":"524","type":"deletion_request","attributes":{"created_at":"2024-12-05T09:23:43.527574137Z","created_by":"[email protected]","from_time":1672527600000,"indexes":["test-index","test-index-2"],"is_created":false,"org_id":321813,"product":"logs","query":"host:abc
14-
service:xyz","starting_at":"0001-01-01T00:00:00Z","status":"pending","to_time":1704063600000,"total_unrestricted":0,"updated_at":"2024-12-05T09:23:43.527574137Z"}},"meta":{"product":"logs"}}'
13+
string: '{"data":{"id":"754","type":"deletion_request","attributes":{"created_at":"2025-01-15T14:27:28.457837225Z","created_by":"[email protected]","from_time":1672527600000,"indexes":["test-index","test-index-2"],"is_created":false,"org_id":321813,"product":"logs","query":"host:abc
14+
service:xyz","starting_at":"0001-01-01T00:00:00Z","status":"pending","to_time":1704063600000,"total_unrestricted":0,"updated_at":"2025-01-15T14:27:28.457837225Z"}},"meta":{"product":"logs"}}'
1515
headers:
1616
content-type:
1717
- application/vnd.api+json
@@ -24,11 +24,11 @@ interactions:
2424
accept:
2525
- application/json
2626
method: PUT
27-
uri: https://api.datadoghq.com/api/v2/deletion/requests/524/cancel
27+
uri: https://api.datadoghq.com/api/v2/deletion/requests/754/cancel
2828
response:
2929
body:
30-
string: '{"data":{"id":"524","type":"deletion_request","attributes":{"created_at":"2024-12-05T09:23:43.527574Z","created_by":"[email protected]","from_time":1672527600000,"indexes":["test-index","test-index-2"],"is_created":false,"org_id":321813,"product":"logs","query":"host:abc
31-
service:xyz","starting_at":"0001-01-01T00:00:00Z","status":"canceled","to_time":1704063600000,"total_unrestricted":0,"updated_at":"2024-12-05T09:23:44.017414Z"}},"meta":{"product":"logs","request_status":"canceled"}}'
30+
string: '{"data":{"id":"754","type":"deletion_request","attributes":{"created_at":"2025-01-15T14:27:28.457837Z","created_by":"[email protected]","from_time":1672527600000,"indexes":["test-index","test-index-2"],"is_created":false,"org_id":321813,"product":"logs","query":"host:abc
31+
service:xyz","starting_at":"0001-01-01T00:00:00Z","status":"canceled","to_time":1704063600000,"total_unrestricted":0,"updated_at":"2025-01-15T14:27:28.841156Z"}},"meta":{"product":"logs","request_status":"canceled"}}'
3232
headers:
3333
content-type:
3434
- application/vnd.api+json
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-12-05T09:23:44.038Z
1+
2025-01-15T14:27:45.329Z

Diff for: tests/v2/cassettes/test_scenarios/test_creates_a_data_deletion_request_returns_precondition_failed_error_response.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"data":{"attributes":{"from":1672527600000,"indexes":["test-index","test-index-2"],"query":{},"to":1704063600000}}}'
3+
body: '{"data":{"attributes":{"from":1672527600000,"indexes":["test-index","test-index-2"],"query":{},"to":1704063600000},"type":"create_deletion_req"}}'
44
headers:
55
accept:
66
- application/json
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-12-05T09:23:44.395Z
1+
2025-01-15T14:28:03.053Z

0 commit comments

Comments
 (0)