Commit 42d3b237 authored by Christophe Lallement's avatar Christophe Lallement
Browse files

fix POST /v2/records/delete body schema

parent 46ae96a4
Pipeline #78970 passed with stage
in 26 seconds
......@@ -307,7 +307,10 @@
"in" : "body",
"required" : true,
"schema" : {
"type": "array"
"type": "array",
"items" : {
"$ref" : "string"
}
}
}
],
......
......@@ -56,13 +56,13 @@ class _RecordsApi:
json=body,
)
def _build_for_delete_records(self, data_partition_id: str, any: List[m.Any]) -> Awaitable[None]:
def _build_for_delete_records(self, data_partition_id: str, request_body: List[str]) -> Awaitable[None]:
"""
The API performs a logical deletion of the given records. This operation can be reverted later. Required roles: 'users.datalake.editors' or 'users.datalake.admins'.
"""
headers = {"data-partition-id": str(data_partition_id)}
body = jsonable_encoder(any)
body = jsonable_encoder(request_body)
return self.api_client.request(type_=None, method="POST", url="/v2/records/delete", headers=headers, json=body)
......@@ -168,11 +168,11 @@ class AsyncRecordsApi(_RecordsApi):
"""
return await self._build_for_delete_record(id=id, data_partition_id=data_partition_id, body=body)
async def delete_records(self, data_partition_id: str, any: List[m.Any]) -> None:
async def delete_records(self, data_partition_id: str, request_body: List[str]) -> None:
"""
The API performs a logical deletion of the given records. This operation can be reverted later. Required roles: 'users.datalake.editors' or 'users.datalake.admins'.
"""
return await self._build_for_delete_records(data_partition_id=data_partition_id, any=any)
return await self._build_for_delete_records(data_partition_id=data_partition_id, request_body=request_body)
async def get_all_record_versions(self, id: str, data_partition_id: str) -> m.RecordVersions:
"""
......@@ -222,11 +222,11 @@ class SyncRecordsApi(_RecordsApi):
coroutine = self._build_for_delete_record(id=id, data_partition_id=data_partition_id, body=body)
return get_event_loop().run_until_complete(coroutine)
def delete_records(self, data_partition_id: str, any: List[m.Any]) -> None:
def delete_records(self, data_partition_id: str, request_body: List[str]) -> None:
"""
The API performs a logical deletion of the given records. This operation can be reverted later. Required roles: 'users.datalake.editors' or 'users.datalake.admins'.
"""
coroutine = self._build_for_delete_records(data_partition_id=data_partition_id, any=any)
coroutine = self._build_for_delete_records(data_partition_id=data_partition_id, request_body=request_body)
return get_event_loop().run_until_complete(coroutine)
def get_all_record_versions(self, id: str, data_partition_id: str) -> m.RecordVersions:
......
......@@ -145,7 +145,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **delete_records**
> delete_records(data_partition_id, any)
> delete_records(data_partition_id, request_body)
Delete records
......@@ -169,11 +169,11 @@ configuration.host = "https://os-storage-dot-opendes.appspot.com/api/storage"
# Create an instance of the API class
api_instance = odes_storage.RecordsApi(odes_storage.ApiClient(configuration))
data_partition_id = 'common' # str | This value should be the desired data partition id. (default to 'common')
any = [odes_storage.Any()] # List[Any] |
request_body = ['request_body_example'] # List[str] |
try:
# Delete records
api_instance.delete_records(data_partition_id, any)
api_instance.delete_records(data_partition_id, request_body)
except ApiException as e:
print("Exception when calling RecordsApi->delete_records: %s\n" % e)
```
......@@ -183,7 +183,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**data_partition_id** | **str**| This value should be the desired data partition id. | [default to 'common']
**any** | [**List[Any]**](Any.md)| |
**request_body** | [**List[str]**](str.md)| |
### Return type
......
......@@ -284,7 +284,8 @@ paths:
application/json:
schema:
type: array
items: {}
items:
$ref: string
required: true
responses:
"204":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment