Tapi 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tapi/__init__.py +2 -0
- tapi/api/__init__.py +46 -0
- tapi/api/action/__init__.py +7 -0
- tapi/api/action/actions.py +106 -0
- tapi/api/action/events.py +33 -0
- tapi/api/action/logs.py +34 -0
- tapi/api/admin/__init__.py +12 -0
- tapi/api/admin/action_egress_control_rules.py +87 -0
- tapi/api/admin/admin.py +43 -0
- tapi/api/admin/ip_access_control.py +76 -0
- tapi/api/admin/job.py +42 -0
- tapi/api/admin/scim.py +27 -0
- tapi/api/admin/template.py +86 -0
- tapi/api/admin/user.py +104 -0
- tapi/api/audit_log/__init__.py +5 -0
- tapi/api/audit_log/audit_logs.py +24 -0
- tapi/api/case/__init__.py +20 -0
- tapi/api/case/actions.py +90 -0
- tapi/api/case/activities.py +35 -0
- tapi/api/case/assignees.py +21 -0
- tapi/api/case/blocks.py +112 -0
- tapi/api/case/cases.py +132 -0
- tapi/api/case/comments.py +102 -0
- tapi/api/case/fields.py +69 -0
- tapi/api/case/files.py +77 -0
- tapi/api/case/inputs.py +64 -0
- tapi/api/case/linked_cases.py +57 -0
- tapi/api/case/metadata.py +65 -0
- tapi/api/case/notes.py +78 -0
- tapi/api/case/records.py +54 -0
- tapi/api/case/subscribers.py +56 -0
- tapi/api/credential/__init__.py +1 -0
- tapi/api/credential/credentials.py +240 -0
- tapi/api/event/__init__.py +1 -0
- tapi/api/event/events.py +44 -0
- tapi/api/folder/__init__.py +1 -0
- tapi/api/folder/folders.py +71 -0
- tapi/api/note/__init__.py +5 -0
- tapi/api/note/notes.py +76 -0
- tapi/api/record/__init__.py +7 -0
- tapi/api/record/artifacts.py +17 -0
- tapi/api/record/records.py +85 -0
- tapi/api/record/types.py +52 -0
- tapi/api/report/__init__.py +5 -0
- tapi/api/report/reporting.py +41 -0
- tapi/api/resource/__init__.py +1 -0
- tapi/api/resource/resources.py +152 -0
- tapi/api/story/__init__.py +10 -0
- tapi/api/story/change_requests.py +64 -0
- tapi/api/story/drafts.py +45 -0
- tapi/api/story/groups.py +38 -0
- tapi/api/story/runs.py +43 -0
- tapi/api/story/stories.py +162 -0
- tapi/api/story/versions.py +65 -0
- tapi/api/team/__init__.py +4 -0
- tapi/api/team/members.py +62 -0
- tapi/api/team/teams.py +60 -0
- tapi/api/tenant.py +68 -0
- tapi/client/__init__.py +1 -0
- tapi/client/client.py +55 -0
- tapi/utils/helpers.py +9 -0
- tapi/utils/http.py +8 -0
- tapi/utils/testing_decorators.py +5 -0
- tapi/utils/types.py +300 -0
- tapi-0.1.2.dist-info/METADATA +2487 -0
- tapi-0.1.2.dist-info/RECORD +69 -0
- tapi-0.1.2.dist-info/WHEEL +5 -0
- tapi-0.1.2.dist-info/licenses/LICENSE +674 -0
- tapi-0.1.2.dist-info/top_level.txt +1 -0
tapi/api/case/fields.py
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from typing import Union
|
|
2
|
+
from tapi.client import Client
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class CaseFieldsAPI(Client):
|
|
6
|
+
def __init__(self, domain: str, apiKey: str):
|
|
7
|
+
super().__init__(domain, apiKey)
|
|
8
|
+
self.base_endpoint = "cases"
|
|
9
|
+
|
|
10
|
+
def create(
|
|
11
|
+
self,
|
|
12
|
+
case_id: int,
|
|
13
|
+
input_id: int,
|
|
14
|
+
value: Union[str, int]
|
|
15
|
+
):
|
|
16
|
+
return self._http_request(
|
|
17
|
+
"POST",
|
|
18
|
+
f"{self.base_endpoint}/{case_id}/fields",
|
|
19
|
+
"v2",
|
|
20
|
+
params = {"input_id": input_id, "value": value}
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
def get(
|
|
24
|
+
self,
|
|
25
|
+
case_id: int,
|
|
26
|
+
field_id: int
|
|
27
|
+
):
|
|
28
|
+
return self._http_request(
|
|
29
|
+
"GET",
|
|
30
|
+
f"{self.base_endpoint}/{case_id}/fields/{field_id}",
|
|
31
|
+
"v2"
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
def update(
|
|
35
|
+
self,
|
|
36
|
+
case_id: int,
|
|
37
|
+
field_id: int,
|
|
38
|
+
value: Union[str, int]
|
|
39
|
+
):
|
|
40
|
+
return self._http_request(
|
|
41
|
+
"PUT",
|
|
42
|
+
f"{self.base_endpoint}/{case_id}/fields/{field_id}",
|
|
43
|
+
"v2",
|
|
44
|
+
json={"value": value}
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
def list(
|
|
48
|
+
self,
|
|
49
|
+
case_id: int,
|
|
50
|
+
per_page: int = 10,
|
|
51
|
+
page: int = 1
|
|
52
|
+
):
|
|
53
|
+
return self._http_request(
|
|
54
|
+
"GET",
|
|
55
|
+
f"{self.base_endpoint}/{case_id}/fields",
|
|
56
|
+
"v2",
|
|
57
|
+
params = {"per_page": per_page, "page": page}
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
def delete(
|
|
61
|
+
self,
|
|
62
|
+
case_id: int,
|
|
63
|
+
field_id: int
|
|
64
|
+
):
|
|
65
|
+
return self._http_request(
|
|
66
|
+
"DELETE",
|
|
67
|
+
f"{self.base_endpoint}/{case_id}/fields/{field_id}",
|
|
68
|
+
"v2"
|
|
69
|
+
)
|
tapi/api/case/files.py
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
from tapi.client import Client
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class CaseFilesAPI(Client):
|
|
6
|
+
def __init__(self, domain: str, apiKey: str):
|
|
7
|
+
super().__init__(domain, apiKey)
|
|
8
|
+
self.base_endpoint = "cases"
|
|
9
|
+
|
|
10
|
+
def create(
|
|
11
|
+
self,
|
|
12
|
+
case_id: int,
|
|
13
|
+
filename: str,
|
|
14
|
+
file_contents: str,
|
|
15
|
+
value: Optional[str] = None,
|
|
16
|
+
author_email: Optional[str] = None,
|
|
17
|
+
team_case_block_id: Optional[int] = None
|
|
18
|
+
|
|
19
|
+
):
|
|
20
|
+
return self._http_request(
|
|
21
|
+
"POST",
|
|
22
|
+
f"{self.base_endpoint}/{case_id}/files",
|
|
23
|
+
"v2",
|
|
24
|
+
json = {
|
|
25
|
+
"filename": filename,
|
|
26
|
+
"file_contents": file_contents,
|
|
27
|
+
"value": value,
|
|
28
|
+
"author_email": author_email,
|
|
29
|
+
"team_case_block_id": team_case_block_id
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
def get(
|
|
34
|
+
self,
|
|
35
|
+
case_id: int,
|
|
36
|
+
file_id: int
|
|
37
|
+
):
|
|
38
|
+
return self._http_request(
|
|
39
|
+
"GET",
|
|
40
|
+
f"{self.base_endpoint}/{case_id}/files/{file_id}",
|
|
41
|
+
"v2"
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
def list(
|
|
45
|
+
self,
|
|
46
|
+
case_id: int,
|
|
47
|
+
per_page: int = 10,
|
|
48
|
+
page: int = 1
|
|
49
|
+
):
|
|
50
|
+
return self._http_request(
|
|
51
|
+
"GET",
|
|
52
|
+
f"{self.base_endpoint}/{case_id}/files",
|
|
53
|
+
"v2",
|
|
54
|
+
params = {"per_page": per_page, "page": page}
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
def delete(
|
|
58
|
+
self,
|
|
59
|
+
case_id: int,
|
|
60
|
+
file_id: int
|
|
61
|
+
):
|
|
62
|
+
return self._http_request(
|
|
63
|
+
"DELETE",
|
|
64
|
+
f"{self.base_endpoint}/{case_id}/files/{file_id}",
|
|
65
|
+
"v2"
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
def download(
|
|
69
|
+
self,
|
|
70
|
+
case_id: int,
|
|
71
|
+
file_id: int
|
|
72
|
+
):
|
|
73
|
+
return self._http_request(
|
|
74
|
+
"GET",
|
|
75
|
+
f"{self.base_endpoint}/{case_id}/files/{file_id}/download",
|
|
76
|
+
"v2"
|
|
77
|
+
)
|
tapi/api/case/inputs.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from tapi.client import Client
|
|
2
|
+
from typing import List, Dict, Optional, Union
|
|
3
|
+
from tapi.utils.types import CaseInputType, CaseValidationType
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class CaseInputsAPI(Client):
|
|
7
|
+
def __init__(self, domain: str, apiKey: str):
|
|
8
|
+
super().__init__(domain, apiKey)
|
|
9
|
+
self.base_endpoint = "case_inputs"
|
|
10
|
+
self.fields = CaseInputsFieldsAPI(domain, apiKey)
|
|
11
|
+
|
|
12
|
+
def create(
|
|
13
|
+
self,
|
|
14
|
+
name: str,
|
|
15
|
+
input_type: Union[CaseInputType, str],
|
|
16
|
+
team_id: int,
|
|
17
|
+
validation_type: Optional[Union[CaseValidationType, str]] = None,
|
|
18
|
+
validation_options: Optional[Union[Dict[str, List[str]], Dict[str, str]]] = None
|
|
19
|
+
):
|
|
20
|
+
return self._http_request(
|
|
21
|
+
"POST",
|
|
22
|
+
self.base_endpoint,
|
|
23
|
+
json = {key: value for key, value in locals().items() if
|
|
24
|
+
value is not None and key not in ("self", "case_id")}
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
def get(
|
|
28
|
+
self,
|
|
29
|
+
case_input_id: int
|
|
30
|
+
):
|
|
31
|
+
return self._http_request(
|
|
32
|
+
"GET",
|
|
33
|
+
f"{self.base_endpoint}/{case_input_id}"
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
def list(
|
|
37
|
+
self,
|
|
38
|
+
team_id: Optional[int] = None,
|
|
39
|
+
per_page: int = 10,
|
|
40
|
+
page: int = 1,
|
|
41
|
+
):
|
|
42
|
+
return self._http_request(
|
|
43
|
+
"GET",
|
|
44
|
+
self.base_endpoint,
|
|
45
|
+
params = {"team_id": team_id},
|
|
46
|
+
json = {"per_page": per_page,"page": page}
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
class CaseInputsFieldsAPI(Client):
|
|
50
|
+
def __init__(self, domain: str, apiKey: str):
|
|
51
|
+
super().__init__(domain, apiKey)
|
|
52
|
+
self.base_endpoint = "case_inputs"
|
|
53
|
+
|
|
54
|
+
def list(
|
|
55
|
+
self,
|
|
56
|
+
case_input_id: int,
|
|
57
|
+
per_page: Optional[int] = None,
|
|
58
|
+
page: Optional[int] = None
|
|
59
|
+
):
|
|
60
|
+
return self._http_request(
|
|
61
|
+
"GET",
|
|
62
|
+
f"{self.base_endpoint}/{case_input_id}/fields",
|
|
63
|
+
json = {"per_page": per_page, "page": page}
|
|
64
|
+
)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
from tapi.client import Client
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class LinkedCasesAPI(Client):
|
|
6
|
+
def __init__(self, domain: str, apiKey: str):
|
|
7
|
+
super().__init__(domain, apiKey)
|
|
8
|
+
self.base_endpoint = "cases"
|
|
9
|
+
|
|
10
|
+
def create(
|
|
11
|
+
self,
|
|
12
|
+
case_id: int,
|
|
13
|
+
id: int
|
|
14
|
+
):
|
|
15
|
+
return self._http_request(
|
|
16
|
+
"POST",
|
|
17
|
+
f"{self.base_endpoint}/{case_id}/linked_cases",
|
|
18
|
+
"v2",
|
|
19
|
+
json = {"id": id}
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
def list(
|
|
23
|
+
self,
|
|
24
|
+
case_id: int,
|
|
25
|
+
per_page: int = 10,
|
|
26
|
+
page: int = 1
|
|
27
|
+
):
|
|
28
|
+
return self._http_request(
|
|
29
|
+
"GET",
|
|
30
|
+
f"{self.base_endpoint}/{case_id}/linked_cases",
|
|
31
|
+
"v2",
|
|
32
|
+
params = {"per_page": per_page, "page": page}
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
def delete(
|
|
36
|
+
self,
|
|
37
|
+
case_id: int,
|
|
38
|
+
linked_case_id: int
|
|
39
|
+
):
|
|
40
|
+
return self._http_request(
|
|
41
|
+
"DELETE",
|
|
42
|
+
f"{self.base_endpoint}/{case_id}/linked_cases/{linked_case_id}",
|
|
43
|
+
"v2"
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
def batch_delete(
|
|
47
|
+
self,
|
|
48
|
+
case_id: int,
|
|
49
|
+
ids: List[int]
|
|
50
|
+
):
|
|
51
|
+
return self._http_request(
|
|
52
|
+
"POST",
|
|
53
|
+
f"{self.base_endpoint}/{case_id}/linked_cases/batch",
|
|
54
|
+
"v2",
|
|
55
|
+
json = {"ids": ids}
|
|
56
|
+
)
|
|
57
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from tapi.client import Client
|
|
2
|
+
from typing import List, Dict
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class CaseMetadataAPI(Client):
|
|
6
|
+
def __init__(self, domain: str, apiKey: str):
|
|
7
|
+
super().__init__(domain, apiKey)
|
|
8
|
+
self.base_endpoint = "cases"
|
|
9
|
+
|
|
10
|
+
def create(
|
|
11
|
+
self,
|
|
12
|
+
case_id: int,
|
|
13
|
+
metadata: Dict[str, str]
|
|
14
|
+
):
|
|
15
|
+
return self._http_request(
|
|
16
|
+
"POST",
|
|
17
|
+
f"{self.base_endpoint}/{case_id}/metadata",
|
|
18
|
+
"v2",
|
|
19
|
+
json = {"metadata": metadata}
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
def get(
|
|
23
|
+
self,
|
|
24
|
+
case_id: int,
|
|
25
|
+
key: str
|
|
26
|
+
):
|
|
27
|
+
return self._http_request(
|
|
28
|
+
"GET",
|
|
29
|
+
f"{self.base_endpoint}/{case_id}/metadata/{key}",
|
|
30
|
+
"v2"
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
def update(
|
|
34
|
+
self,
|
|
35
|
+
case_id: int,
|
|
36
|
+
metadata: Dict[str, str]
|
|
37
|
+
):
|
|
38
|
+
return self._http_request(
|
|
39
|
+
"PUT",
|
|
40
|
+
f"{self.base_endpoint}/{case_id}/metadata",
|
|
41
|
+
"v2",
|
|
42
|
+
json = {"metadata": metadata}
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
def list(
|
|
46
|
+
self,
|
|
47
|
+
case_id: int
|
|
48
|
+
):
|
|
49
|
+
return self._http_request(
|
|
50
|
+
"GET",
|
|
51
|
+
f"{self.base_endpoint}/{case_id}/metadata",
|
|
52
|
+
"v2"
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
def delete(
|
|
56
|
+
self,
|
|
57
|
+
case_id: int,
|
|
58
|
+
metadata_keys: List[str]
|
|
59
|
+
):
|
|
60
|
+
return self._http_request(
|
|
61
|
+
"DELETE",
|
|
62
|
+
f"{self.base_endpoint}/{case_id}/metadata",
|
|
63
|
+
"v2",
|
|
64
|
+
json = {"metadata": metadata_keys}
|
|
65
|
+
)
|
tapi/api/case/notes.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
from tapi.client import Client
|
|
2
|
+
from tapi.utils.types import CaseNoteColor
|
|
3
|
+
from typing import Optional, Union
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class CaseNotesAPI(Client):
|
|
7
|
+
def __init__(self, domain: str, apiKey: str):
|
|
8
|
+
super().__init__(domain, apiKey)
|
|
9
|
+
self.base_endpoint = "cases"
|
|
10
|
+
|
|
11
|
+
def create(
|
|
12
|
+
self,
|
|
13
|
+
case_id: int,
|
|
14
|
+
title: str,
|
|
15
|
+
content: Optional[str] = None,
|
|
16
|
+
color: Optional[Union[CaseNoteColor, str]] = None,
|
|
17
|
+
position: Optional[int] = None
|
|
18
|
+
):
|
|
19
|
+
return self._http_request(
|
|
20
|
+
"POST",
|
|
21
|
+
f"{self.base_endpoint}/{case_id}/notes",
|
|
22
|
+
"v2",
|
|
23
|
+
json = {key: value for key, value in locals().items() if
|
|
24
|
+
value is not None and key not in ("self", "case_id")}
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
def get(
|
|
28
|
+
self,
|
|
29
|
+
case_id: int,
|
|
30
|
+
note_id: int
|
|
31
|
+
):
|
|
32
|
+
return self._http_request(
|
|
33
|
+
"GET",
|
|
34
|
+
f"{self.base_endpoint}/{case_id}/notes/{note_id}",
|
|
35
|
+
"v2"
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
def update(
|
|
39
|
+
self,
|
|
40
|
+
case_id: int,
|
|
41
|
+
note_id: int,
|
|
42
|
+
title: Optional[str] = None,
|
|
43
|
+
content: Optional[str] = None,
|
|
44
|
+
color: Optional[Union[CaseNoteColor, str]] = None,
|
|
45
|
+
position: Optional[int] = None
|
|
46
|
+
):
|
|
47
|
+
return self._http_request(
|
|
48
|
+
"PUT",
|
|
49
|
+
f"{self.base_endpoint}/{case_id}/notes/{note_id}",
|
|
50
|
+
"v2",
|
|
51
|
+
json = {key: value for key, value in locals().items() if
|
|
52
|
+
value is not None and key not in ("self", "case_id", "note_id")}
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
def list(
|
|
56
|
+
self,
|
|
57
|
+
case_id: int,
|
|
58
|
+
per_page: int = 10,
|
|
59
|
+
page: int = 1
|
|
60
|
+
):
|
|
61
|
+
return self._http_request(
|
|
62
|
+
"GET",
|
|
63
|
+
f"{self.base_endpoint}/{case_id}/notes",
|
|
64
|
+
"v2",
|
|
65
|
+
params = {"per_page": per_page, "page": page}
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
def delete(
|
|
69
|
+
self,
|
|
70
|
+
case_id: int,
|
|
71
|
+
note_id: int
|
|
72
|
+
):
|
|
73
|
+
return self._http_request(
|
|
74
|
+
"DELETE",
|
|
75
|
+
f"{self.base_endpoint}/{case_id}/notes/{note_id}",
|
|
76
|
+
"v2"
|
|
77
|
+
)
|
|
78
|
+
|
tapi/api/case/records.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
from tapi.client import Client
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class CaseRecordsAPI(Client):
|
|
5
|
+
def __init__(self, domain: str, apiKey: str):
|
|
6
|
+
super().__init__(domain, apiKey)
|
|
7
|
+
self.base_endpoint = "cases"
|
|
8
|
+
|
|
9
|
+
def create(
|
|
10
|
+
self,
|
|
11
|
+
case_id: int,
|
|
12
|
+
record_id: int
|
|
13
|
+
):
|
|
14
|
+
return self._http_request(
|
|
15
|
+
"POST",
|
|
16
|
+
f"{self.base_endpoint}/{case_id}/records",
|
|
17
|
+
"v2",
|
|
18
|
+
json = {"record_id": record_id}
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
def get(
|
|
22
|
+
self,
|
|
23
|
+
case_id: int,
|
|
24
|
+
record_id: int
|
|
25
|
+
):
|
|
26
|
+
return self._http_request(
|
|
27
|
+
"GET",
|
|
28
|
+
f"{self.base_endpoint}/{case_id}/records/{record_id}",
|
|
29
|
+
"v2"
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
def list(
|
|
33
|
+
self,
|
|
34
|
+
case_id: int,
|
|
35
|
+
per_page: int = 10,
|
|
36
|
+
page: int = 1
|
|
37
|
+
):
|
|
38
|
+
return self._http_request(
|
|
39
|
+
"GET",
|
|
40
|
+
f"{self.base_endpoint}/{case_id}/records",
|
|
41
|
+
"v2",
|
|
42
|
+
params = {"per_page": per_page, "page": page}
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
def delete(
|
|
46
|
+
self,
|
|
47
|
+
case_id: int,
|
|
48
|
+
record_id: int
|
|
49
|
+
):
|
|
50
|
+
return self._http_request(
|
|
51
|
+
"DELETE",
|
|
52
|
+
f"{self.base_endpoint}/{case_id}/records/{record_id}",
|
|
53
|
+
"v2"
|
|
54
|
+
)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
from tapi.client import Client
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class CaseSubscribersAPI(Client):
|
|
6
|
+
def __init__(self, domain: str, apiKey: str):
|
|
7
|
+
super().__init__(domain, apiKey)
|
|
8
|
+
self.base_endpoint = "cases"
|
|
9
|
+
|
|
10
|
+
def create(
|
|
11
|
+
self,
|
|
12
|
+
case_id: int,
|
|
13
|
+
user_email: str
|
|
14
|
+
):
|
|
15
|
+
return self._http_request(
|
|
16
|
+
"POST",
|
|
17
|
+
f"{self.base_endpoint}/{case_id}/subscribers",
|
|
18
|
+
"v2",
|
|
19
|
+
json = {"user_email": user_email}
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
def list(
|
|
23
|
+
self,
|
|
24
|
+
case_id: int,
|
|
25
|
+
per_page: int = 10,
|
|
26
|
+
page: int = 1
|
|
27
|
+
):
|
|
28
|
+
return self._http_request(
|
|
29
|
+
"GET",
|
|
30
|
+
f"{self.base_endpoint}/{case_id}/subscribers",
|
|
31
|
+
"v2",
|
|
32
|
+
params = {"per_page": per_page, "page": page}
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
def delete(
|
|
36
|
+
self,
|
|
37
|
+
case_id: int,
|
|
38
|
+
subscriber_id: int
|
|
39
|
+
):
|
|
40
|
+
return self._http_request(
|
|
41
|
+
"DELETE",
|
|
42
|
+
f"{self.base_endpoint}/{case_id}/subscribers/{subscriber_id}",
|
|
43
|
+
"v2"
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
def batch_create(
|
|
47
|
+
self,
|
|
48
|
+
case_id: int,
|
|
49
|
+
user_emails: List[str]
|
|
50
|
+
):
|
|
51
|
+
return self._http_request(
|
|
52
|
+
"POST",
|
|
53
|
+
f"{self.base_endpoint}/{case_id}/subscribers/batch",
|
|
54
|
+
"v2",
|
|
55
|
+
json = {"user_emails": user_emails}
|
|
56
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .credentials import CredentialsAPI
|