-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathfile_uploader.py
More file actions
43 lines (33 loc) · 1.02 KB
/
file_uploader.py
File metadata and controls
43 lines (33 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""Module for the upload file endpoint."""
from abc import abstractmethod
from fastapi import UploadFile
from admin_api_lib.api_endpoints.uploader_base import UploaderBase
class FileUploader(UploaderBase):
"""File uploader endpoint of the admin API."""
@abstractmethod
def cancel_upload(self, identification: str) -> None:
"""
Signal cancellation for an in-flight upload identified by document id.
Parameters
----------
identification : str
Document identification (for example ``file:my_doc.pdf``).
"""
@abstractmethod
async def upload_file(
self,
base_url: str,
file: UploadFile,
) -> None:
"""
Upload a source file for content extraction.
Parameters
----------
base_url : str
The base url of the service. Is used to determine the download link of the file.
file : UploadFile
The file to process.
Returns
-------
None
"""