Skip to content
Open
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": "2011bb0",
"generated": "2025-08-27 13:49:59.180"
}
12 changes: 12 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10662,6 +10662,11 @@ components:
CreateDataDeletionRequestBodyAttributes:
description: Attributes for creating a data deletion request.
properties:
displayed_total:
description: Total number of elements to be deleted according to the UI.
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 +10699,7 @@ components:
- query
- from
- to
- displayed_total
type: object
CreateDataDeletionRequestBodyData:
description: Data needed to create a data deletion request.
Expand Down Expand Up @@ -12900,6 +12906,11 @@ components:
description: User who created the deletion request.
example: [email protected]
type: string
displayed_total:
description: Total number of elements to be deleted according to the UI.
example: 25000
format: int64
type: integer
from_time:
description: Start of requested time window, milliseconds since Unix epoch.
example: 1672527600000
Expand Down Expand Up @@ -12961,6 +12972,7 @@ components:
required:
- created_at
- created_by
- displayed_total
- from_time
- is_created
- org_id
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: Total number of elements to be deleted according to the UI.
: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 @@ -19,6 +19,7 @@ def openapi_types(_):
return {
"created_at": (str,),
"created_by": (str,),
"displayed_total": (int,),
"from_time": (int,),
"indexes": ([str],),
"is_created": (bool,),
Expand All @@ -35,6 +36,7 @@ def openapi_types(_):
attribute_map = {
"created_at": "created_at",
"created_by": "created_by",
"displayed_total": "displayed_total",
"from_time": "from_time",
"indexes": "indexes",
"is_created": "is_created",
Expand All @@ -52,6 +54,7 @@ def __init__(
self_,
created_at: str,
created_by: str,
displayed_total: int,
from_time: int,
is_created: bool,
org_id: int,
Expand All @@ -74,6 +77,9 @@ def __init__(
:param created_by: User who created the deletion request.
:type created_by: str

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

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

Expand Down Expand Up @@ -113,6 +119,7 @@ def __init__(

self_.created_at = created_at
self_.created_by = created_by
self_.displayed_total = displayed_total
self_.from_time = from_time
self_.is_created = is_created
self_.org_id = org_id
Expand Down
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 \"displayed_total\": 25000,\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}"
}
],
"step": "there is a valid \"deletion_request\" in the system",
Expand Down
Loading