-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmodels.py
More file actions
109 lines (91 loc) · 2.89 KB
/
Copy pathmodels.py
File metadata and controls
109 lines (91 loc) · 2.89 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
from typing import Dict, List, Optional, Union
import niquests as requests
from typing_extensions import Self
import abc
from .routes.models import AbstractRoutes, Workspace
class AbstractSeamHttpClient(abc.ABC):
@abc.abstractmethod
def __init__(self, base_url: str, auth_headers: Dict[str, str], **kwargs):
raise NotImplementedError
@abc.abstractmethod
def request(self, method: str, url: str, *args, **kwargs):
raise NotImplementedError
@abc.abstractmethod
def _handle_response(self, response: requests.Response):
raise NotImplementedError
@abc.abstractmethod
def _handle_error_response(self, response: requests.Response):
raise NotImplementedError
class AbstractSeam(AbstractRoutes):
lts_version: str
@abc.abstractmethod
def __init__(
self,
api_key: Optional[str] = None,
*,
personal_access_token: Optional[str] = None,
workspace_id: Optional[str] = None,
endpoint: Optional[str] = None,
wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = True,
):
raise NotImplementedError
@classmethod
@abc.abstractmethod
def from_api_key(
cls,
api_key: str,
*,
endpoint: Optional[str] = None,
wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = True,
) -> Self:
raise NotImplementedError
@classmethod
@abc.abstractmethod
def from_personal_access_token(
cls,
personal_access_token: str,
workspace_id: str,
*,
endpoint: Optional[str] = None,
wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = True,
) -> Self:
raise NotImplementedError
class AbstractSeamMultiWorkspaceWorkspaces(abc.ABC):
@abc.abstractmethod
def create(
self,
*,
connect_partner_name: str,
name: str,
is_sandbox: Optional[bool] = None,
webview_logo_shape: Optional[str] = None,
webview_primary_button_color: Optional[str] = None,
) -> Workspace:
raise NotImplementedError()
@abc.abstractmethod
def list(
self,
) -> List[Workspace]:
raise NotImplementedError()
class AbstractSeamMultiWorkspace:
lts_version: str
wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]]
@abc.abstractmethod
def __init__(
self,
personal_access_token: str,
*,
endpoint: Optional[str] = None,
wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = True,
):
raise NotImplementedError
@classmethod
@abc.abstractmethod
def from_personal_access_token(
cls,
personal_access_token: str,
*,
endpoint: Optional[str] = None,
wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = True,
) -> Self:
raise NotImplementedError