exist-client 0.2.0__tar.gz → 0.2.1.dev3__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.
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/PKG-INFO +1 -1
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/pyproject.toml +1 -1
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/client.py +24 -3
- exist_client-0.2.1.dev3/src/exist_client/models.py +3 -0
- exist_client-0.2.0/src/exist_client/models.py +0 -3
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/README.md +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/__init__.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/__init__.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/__init__.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/default/__init__.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/default/access_token.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/default/accounts_profile.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/default/attribute_values_get.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/default/attributes_acquire.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/default/attributes_get.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/default/attributes_update.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/client.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/errors.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/__init__.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/access_token_data.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attribute.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attribute_by_name.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attribute_by_template.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attribute_group.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attribute_value.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attribute_values_get_result.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attributes_acquire_result.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attributes_acquire_result_failed_item.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attributes_acquire_result_success_item.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attributes_get_result.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attributes_update_result.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attributes_update_result_failed_item.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/date_value.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/error_mixin.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/paginated_response.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/tokens.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/user_profile.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/types.py +0 -0
- {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/py.typed +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import itertools
|
|
2
2
|
from typing import Any, Callable, Iterable, Optional, Protocol, TypeVar
|
|
3
3
|
|
|
4
|
-
from ._exist_io_client import AuthenticatedClient
|
|
4
|
+
from ._exist_io_client import AuthenticatedClient, Client
|
|
5
5
|
from ._exist_io_client.api.default import (
|
|
6
|
+
access_token,
|
|
6
7
|
accounts_profile,
|
|
7
8
|
attribute_values_get,
|
|
8
9
|
attributes_acquire,
|
|
@@ -12,14 +13,14 @@ from ._exist_io_client.api.default import (
|
|
|
12
13
|
|
|
13
14
|
# TODO: move to .models
|
|
14
15
|
from ._exist_io_client.models import (
|
|
15
|
-
|
|
16
|
+
AccessTokenData,
|
|
16
17
|
AttributeByTemplate,
|
|
17
18
|
AttributesAcquireResult,
|
|
18
19
|
AttributesUpdateResult,
|
|
19
20
|
DateValue,
|
|
20
21
|
UserProfile,
|
|
21
22
|
)
|
|
22
|
-
from .models import Attribute, AttributeValue
|
|
23
|
+
from .models import Attribute, AttributeByName, AttributeValue, Tokens
|
|
23
24
|
|
|
24
25
|
EXIST_IO_BASE_URL = "https://exist.io"
|
|
25
26
|
|
|
@@ -43,6 +44,25 @@ class ExistClient:
|
|
|
43
44
|
follow_redirects=True,
|
|
44
45
|
)
|
|
45
46
|
|
|
47
|
+
@staticmethod
|
|
48
|
+
def get_tokens(
|
|
49
|
+
*,
|
|
50
|
+
code: str,
|
|
51
|
+
client_id: str,
|
|
52
|
+
client_secret: str,
|
|
53
|
+
base_url: str = EXIST_IO_BASE_URL,
|
|
54
|
+
) -> Optional[Tokens]:
|
|
55
|
+
client = Client(base_url)
|
|
56
|
+
return access_token.sync(
|
|
57
|
+
client=client,
|
|
58
|
+
form_data=AccessTokenData(
|
|
59
|
+
grant_type="authorization_code",
|
|
60
|
+
code=code,
|
|
61
|
+
client_id=client_id,
|
|
62
|
+
client_secret=client_secret,
|
|
63
|
+
),
|
|
64
|
+
)
|
|
65
|
+
|
|
46
66
|
def get_profile(self) -> Optional[UserProfile]:
|
|
47
67
|
return accounts_profile.sync(client=self.client)
|
|
48
68
|
|
|
@@ -89,4 +109,5 @@ class ExistClient:
|
|
|
89
109
|
def update_attributes(
|
|
90
110
|
self, *, updates: list[AttributeValue]
|
|
91
111
|
) -> Optional[AttributesUpdateResult]:
|
|
112
|
+
# TODO: verify that the updates actually happened, and maybe return something other than AttributeValue
|
|
92
113
|
return attributes_update.sync(client=self.client, json_body=updates)
|
|
File without changes
|
|
File without changes
|
{exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/__init__.py
RENAMED
|
File without changes
|
{exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/__init__.py
RENAMED
|
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
|
{exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attribute.py
RENAMED
|
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
|
{exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/tokens.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|