Skip to content

Commit 55a3641

Browse files
authored
feat: Add delete_annotation method (#75)
* feat: Add delete_annotation method
1 parent 6b9bd60 commit 55a3641

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

rossum_api/elis_api_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,12 @@ async def create_new_annotation(self, data: dict[str, Any]) -> Annotation:
363363

364364
return self._deserializer(Resource.Annotation, annotation)
365365

366+
async def delete_annotation(self, annotation_id: int) -> None:
367+
"""https://elis.rossum.ai/api/docs/#switch-to-deleted"""
368+
await self._http_client.request(
369+
"POST", url=f"{Resource.Annotation.value}/{annotation_id}/delete"
370+
)
371+
366372
# ##### DOCUMENTS #####
367373
async def retrieve_document_content(self, document_id: int) -> bytes:
368374
"""https://elis.rossum.ai/api/docs/#document-content"""

rossum_api/elis_api_client_sync.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,12 @@ def create_new_annotation(self, data: dict[str, Any]) -> Annotation:
334334
"""https://elis.rossum.ai/api/docs/#create-an-annotation"""
335335
return self.event_loop.run_until_complete(self.elis_api_client.create_new_annotation(data))
336336

337+
def delete_annotation(self, annotation_id: int) -> None:
338+
"""https://elis.rossum.ai/api/docs/#switch-to-deleted"""
339+
return self.event_loop.run_until_complete(
340+
self.elis_api_client.delete_annotation(annotation_id)
341+
)
342+
337343
# ##### DOCUMENTS #####
338344
def retrieve_document_content(self, document_id: int) -> bytes:
339345
"""https://elis.rossum.ai/api/docs/#document-content"""

0 commit comments

Comments
 (0)