-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsource_uploader.py
More file actions
51 lines (41 loc) · 1.4 KB
/
source_uploader.py
File metadata and controls
51 lines (41 loc) · 1.4 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
44
45
46
47
48
49
50
51
"""Module for the upload source endpoint."""
from abc import abstractmethod
from typing import Optional
from pydantic import StrictStr
from admin_api_lib.api_endpoints.uploader_base import UploaderBase
from admin_api_lib.models.key_value_pair import KeyValuePair
class SourceUploader(UploaderBase):
"""Abstract base class for source uploader API endpoints."""
@abstractmethod
def cancel_upload(self, identification: str) -> None:
"""
Signal cancellation for an in-flight source upload.
Parameters
----------
identification : str
Document identification (for example ``confluence:my_space``).
"""
@abstractmethod
async def upload_source(
self,
source_type: StrictStr,
name: StrictStr,
kwargs: list[KeyValuePair],
timeout: Optional[float],
) -> None:
"""
Upload the parameters for source content extraction.
Parameters
----------
source_type : str
The type of the source. Is used by the extractor service to determine the correct extraction method.
name : str
Display name of the source.
kwargs : list[KeyValuePair]
List of KeyValuePair with parameters used for the extraction.
timeout : float, optional
Timeout for the operation.
Returns
-------
None
"""