Skip to content

Commit

Permalink
feat: Add delete_annotation method
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Uhlik committed Jun 4, 2024
1 parent 6b9bd60 commit bd33bf1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rossum_api/elis_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,12 @@ async def create_new_annotation(self, data: dict[str, Any]) -> Annotation:

return self._deserializer(Resource.Annotation, annotation)

async def delete_annotation(self, annotation_id: int) -> None:
"""https://elis.rossum.ai/api/docs/#delete-annotation"""
return await self.request(
"POST", url=f"{Resource.Annotation.value}/{annotation_id}/delete"
)

# ##### DOCUMENTS #####
async def retrieve_document_content(self, document_id: int) -> bytes:
"""https://elis.rossum.ai/api/docs/#document-content"""
Expand Down
6 changes: 6 additions & 0 deletions rossum_api/elis_api_client_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,12 @@ def create_new_annotation(self, data: dict[str, Any]) -> Annotation:
"""https://elis.rossum.ai/api/docs/#create-an-annotation"""
return self.event_loop.run_until_complete(self.elis_api_client.create_new_annotation(data))

def delete_annotation(self, annotation_id: int) -> None:
"""https://elis.rossum.ai/api/docs/#delete-annotation"""
return self.event_loop.run_until_complete(
self.elis_api_client.delete_annotation(annotation_id)
)

# ##### DOCUMENTS #####
def retrieve_document_content(self, document_id: int) -> bytes:
"""https://elis.rossum.ai/api/docs/#document-content"""
Expand Down

0 comments on commit bd33bf1

Please sign in to comment.