dubidoc 0.1.4__tar.gz → 0.2.0__tar.gz
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.
- {dubidoc-0.1.4 → dubidoc-0.2.0}/PKG-INFO +3 -2
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/__init__.py +1 -1
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/__init__.py +1 -0
- dubidoc-0.2.0/dubidoc/_modules/organization.py +22 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/client.py +5 -2
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc.egg-info/PKG-INFO +3 -2
- {dubidoc-0.1.4 → dubidoc-0.2.0}/pyproject.toml +1 -1
- dubidoc-0.1.4/dubidoc/_modules/organization.py +0 -1
- {dubidoc-0.1.4 → dubidoc-0.2.0}/LICENSE +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/README.md +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/access_token.py +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/authentication.py +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/device.py +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/document.py +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/document_link.py +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/download.py +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/organization_user.py +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/participant.py +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/storecode.py +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/enum.py +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/response.py +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc.egg-info/SOURCES.txt +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc.egg-info/dependency_links.txt +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc.egg-info/requires.txt +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc.egg-info/top_level.txt +0 -0
- {dubidoc-0.1.4 → dubidoc-0.2.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: dubidoc
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.2.0
|
4
4
|
Summary: Python SDK for dubidoc.com.ua API
|
5
5
|
Maintainer-email: Dmytro Litvinov <me@dmytrolitvinov.com>
|
6
6
|
License: MIT License
|
@@ -26,6 +26,7 @@ Requires-Python: >=3.8
|
|
26
26
|
Description-Content-Type: text/markdown
|
27
27
|
License-File: LICENSE
|
28
28
|
Requires-Dist: requests
|
29
|
+
Dynamic: license-file
|
29
30
|
|
30
31
|
# Dubidoc API client ✍
|
31
32
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
from dubidoc.enum import HttpMethod
|
2
|
+
|
3
|
+
|
4
|
+
__all__ = ('OrganizationAPI',)
|
5
|
+
|
6
|
+
|
7
|
+
class OrganizationAPI:
|
8
|
+
PATH = 'organizations'
|
9
|
+
|
10
|
+
def __init__(self, client):
|
11
|
+
self.client = client
|
12
|
+
|
13
|
+
def list(self):
|
14
|
+
return self.client.make_request(HttpMethod.GET, self.PATH)
|
15
|
+
|
16
|
+
def get(self, document_id):
|
17
|
+
path = f'{self.PATH}/{document_id}'
|
18
|
+
return self.client.make_request(HttpMethod.GET, path)
|
19
|
+
|
20
|
+
def edit(self, document_id, body):
|
21
|
+
path = f'{self.PATH}/{document_id}'
|
22
|
+
return self.client.make_request(HttpMethod.PUT, path, body)
|
@@ -12,6 +12,7 @@ from dubidoc._modules import (
|
|
12
12
|
DocumentLinkAPI,
|
13
13
|
ParticipantAPI,
|
14
14
|
DownloadAPI,
|
15
|
+
OrganizationAPI,
|
15
16
|
)
|
16
17
|
from dubidoc.enum import HttpMethod
|
17
18
|
from dubidoc.response import DubidocAPIResponse
|
@@ -32,8 +33,9 @@ class DubidocAPIClient:
|
|
32
33
|
'user-agent': f'python-dubidoc/{__version__} | (https://github.com/DmytroLitvinov/python-dubidoc)',
|
33
34
|
}
|
34
35
|
|
35
|
-
def __init__(self, api_token: str, *, is_stage_env: bool = False):
|
36
|
+
def __init__(self, api_token: str, organization_uuid: str = '', *, is_stage_env: bool = False):
|
36
37
|
self.api_token = api_token
|
38
|
+
self.organization_uuid = organization_uuid
|
37
39
|
if is_stage_env:
|
38
40
|
self.base_url = 'https://docs-stage.navkolo.one'
|
39
41
|
else:
|
@@ -50,6 +52,7 @@ class DubidocAPIClient:
|
|
50
52
|
self.document_link_api = self._get_module(DocumentLinkAPI)
|
51
53
|
self.participant_api = self._get_module(ParticipantAPI)
|
52
54
|
self.download_api = self._get_module(DownloadAPI)
|
55
|
+
self.organization_api = self._get_module(OrganizationAPI)
|
53
56
|
|
54
57
|
if is_stage_env == 'stage':
|
55
58
|
self.access_token_api = self._get_module(AccessTokenAPI)
|
@@ -62,7 +65,7 @@ class DubidocAPIClient:
|
|
62
65
|
|
63
66
|
def _get_headers(self):
|
64
67
|
headers = self.DEFAULT_HEADERS.copy()
|
65
|
-
headers.update({'X-Access-Token': f'{self.api_token}'})
|
68
|
+
headers.update({'X-Access-Token': f'{self.api_token}', 'X-Organization': self.organization_uuid})
|
66
69
|
return headers
|
67
70
|
|
68
71
|
def _get_module(self, cls):
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: dubidoc
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.2.0
|
4
4
|
Summary: Python SDK for dubidoc.com.ua API
|
5
5
|
Maintainer-email: Dmytro Litvinov <me@dmytrolitvinov.com>
|
6
6
|
License: MIT License
|
@@ -26,6 +26,7 @@ Requires-Python: >=3.8
|
|
26
26
|
Description-Content-Type: text/markdown
|
27
27
|
License-File: LICENSE
|
28
28
|
Requires-Dist: requests
|
29
|
+
Dynamic: license-file
|
29
30
|
|
30
31
|
# Dubidoc API client ✍
|
31
32
|
|
@@ -1 +0,0 @@
|
|
1
|
-
# TODO
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|