Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "98e3371",
"generated": "2025-08-27 08:45:21.765"
"spec_repo_commit": "fb522ba",
"generated": "2025-08-27 10:19:43.054"
}
13 changes: 13 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10662,6 +10662,12 @@ components:
CreateDataDeletionRequestBodyAttributes:
description: Attributes for creating a data deletion request.
properties:
displayed_total:
description: The total number of elements to be deleted that the UI shows
to the user.
example: 25000
format: int64
type: integer
from:
description: Start of requested time window, milliseconds since Unix epoch.
example: 1672527600000
Expand Down Expand Up @@ -10694,6 +10700,7 @@ components:
- query
- from
- to
- displayed_total
type: object
CreateDataDeletionRequestBodyData:
description: Data needed to create a data deletion request.
Expand Down Expand Up @@ -12947,6 +12954,11 @@ components:
example: 1704063600000
format: int64
type: integer
total_displayed:
description: Total number of elements to be deleted according to the UI.
example: 100
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
Expand All @@ -12969,6 +12981,7 @@ components:
- starting_at
- status
- to_time
- total_displayed
- total_unrestricted
- updated_at
type: object
Expand Down
1 change: 1 addition & 0 deletions examples/v2/data-deletion/CreateDataDeletionRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
body = CreateDataDeletionRequestBody(
data=CreateDataDeletionRequestBodyData(
attributes=CreateDataDeletionRequestBodyAttributes(
displayed_total=25000,
_from=1672527600000,
indexes=[
"test-index",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,36 @@ class CreateDataDeletionRequestBodyAttributes(ModelNormal):
@cached_property
def openapi_types(_):
return {
"displayed_total": (int,),
"_from": (int,),
"indexes": ([str],),
"query": ({str: (str,)},),
"to": (int,),
}

attribute_map = {
"displayed_total": "displayed_total",
"_from": "from",
"indexes": "indexes",
"query": "query",
"to": "to",
}

def __init__(
self_, _from: int, query: Dict[str, str], to: int, indexes: Union[List[str], UnsetType] = unset, **kwargs
self_,
displayed_total: int,
_from: int,
query: Dict[str, str],
to: int,
indexes: Union[List[str], UnsetType] = unset,
**kwargs,
):
"""
Attributes for creating a data deletion request.

:param displayed_total: The total number of elements to be deleted that the UI shows to the user.
:type displayed_total: int

:param _from: Start of requested time window, milliseconds since Unix epoch.
:type _from: int

Expand All @@ -52,6 +63,7 @@ def __init__(
kwargs["indexes"] = indexes
super().__init__(kwargs)

self_.displayed_total = displayed_total
self_._from = _from
self_.query = query
self_.to = to
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def openapi_types(_):
"starting_at": (str,),
"status": (str,),
"to_time": (int,),
"total_displayed": (int,),
"total_unrestricted": (int,),
"updated_at": (str,),
}
Expand All @@ -44,6 +45,7 @@ def openapi_types(_):
"starting_at": "starting_at",
"status": "status",
"to_time": "to_time",
"total_displayed": "total_displayed",
"total_unrestricted": "total_unrestricted",
"updated_at": "updated_at",
}
Expand All @@ -60,6 +62,7 @@ def __init__(
starting_at: str,
status: str,
to_time: int,
total_displayed: int,
total_unrestricted: int,
updated_at: str,
indexes: Union[List[str], UnsetType] = unset,
Expand Down Expand Up @@ -101,6 +104,9 @@ def __init__(
:param to_time: End of requested time window, milliseconds since Unix epoch.
:type to_time: int

:param total_displayed: Total number of elements to be deleted according to the UI.
:type total_displayed: int

:param total_unrestricted: 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.
:type total_unrestricted: int

Expand All @@ -121,5 +127,6 @@ def __init__(
self_.starting_at = starting_at
self_.status = status
self_.to_time = to_time
self_.total_displayed = total_displayed
self_.total_unrestricted = total_unrestricted
self_.updated_at = updated_at
6 changes: 3 additions & 3 deletions tests/v2/features/data_deletion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Feature: Data Deletion
Given operation "CreateDataDeletionRequest" enabled
And new "CreateDataDeletionRequest" request
And request contains "product" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}, "type": "create_deletion_req"}}
And body with value {"data": {"attributes": {"displayed_total": 25000, "from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}, "type": "create_deletion_req"}}
When the request is sent
Then the response status is 400 Bad Request

Expand All @@ -52,7 +52,7 @@ Feature: Data Deletion
Given operation "CreateDataDeletionRequest" enabled
And new "CreateDataDeletionRequest" request
And request contains "product" parameter with value "logs"
And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}, "type": "create_deletion_req"}}
And body with value {"data": {"attributes": {"displayed_total": 25000, "from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}, "type": "create_deletion_req"}}
When the request is sent
Then the response status is 200 OK
And the response "data.type" is equal to "deletion_request"
Expand All @@ -64,7 +64,7 @@ Feature: Data Deletion
Given operation "CreateDataDeletionRequest" enabled
And new "CreateDataDeletionRequest" request
And request contains "product" parameter with value "logs"
And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {}, "to": 1704063600000}, "type": "create_deletion_req"}}
And body with value {"data": {"attributes": {"displayed_total": 25000, "from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {}, "to": 1704063600000}, "type": "create_deletion_req"}}
When the request is sent
Then the response status is 412 Precondition failed error

Expand Down
2 changes: 1 addition & 1 deletion tests/v2/features/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
},
{
"name": "body",
"value": "{\n \"data\": {\n \"attributes\": {\n \"from\": 1672527600000,\n \"to\": 1704063600000,\n \"indexes\": [\"test-index\", \"test-index-2\"],\n \"query\": {\"host\": \"abc\", \"service\": \"xyz\"}\n },\n \"type\": \"create_deletion_req\"\n }\n}"
"value": "{\n \"data\": {\n \"attributes\": {\n \"from\": 1672527600000,\n \"to\": 1704063600000,\n \"indexes\": [\"test-index\", \"test-index-2\"],\n \"query\": {\"host\": \"abc\", \"service\": \"xyz\"},\n \"displayed_total\": 25000\n },\n \"type\": \"create_deletion_req\"\n }\n}"
}
],
"step": "there is a valid \"deletion_request\" in the system",
Expand Down
Loading