cuenca 1.0.3.dev1__tar.gz → 1.0.3.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.
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/PKG-INFO +2 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/api_keys.py +5 -4
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/arpc.py +2 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/base.py +50 -39
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/card_activations.py +3 -1
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/cards.py +5 -4
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/clabes.py +2 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/curp_validations.py +5 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/endpoints.py +4 -3
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/file_batches.py +2 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/files.py +8 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/kyc_validations.py +4 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/kyc_verifications.py +3 -3
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/limited_wallets.py +2 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/login_tokens.py +2 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/platforms.py +2 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/questionnaires.py +4 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/resources.py +2 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/savings.py +3 -3
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/sessions.py +2 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/transfers.py +1 -1
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/user_credentials.py +8 -3
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/user_lists_validation.py +5 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/user_logins.py +2 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/users.py +6 -3
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/verifications.py +6 -3
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/wallet_transactions.py +1 -1
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/version.py +1 -1
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca.egg-info/PKG-INFO +2 -2
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca.egg-info/requires.txt +1 -1
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/setup.py +1 -1
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_api_keys.py +1 -1
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/LICENSE +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/README.md +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/__init__.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/exc.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/http/__init__.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/http/client.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/jwt.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/py.typed +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/__init__.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/accounts.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/balance_entries.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/bill_payments.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/card_transactions.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/card_validations.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/cash_references.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/commissions.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/deposits.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/identities.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/identity_events.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/otps.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/service_providers.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/statements.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/user_events.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/webhooks.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca/resources/whatsapp_transfers.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca.egg-info/SOURCES.txt +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca.egg-info/dependency_links.txt +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/cuenca.egg-info/top_level.txt +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/setup.cfg +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/__init__.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/conftest.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/http/__init__.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/http/conftest.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/http/test_client.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/__init__.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_accounts.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_arpc.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_balance_entries.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_bill_payments.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_card_activations.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_card_transactions.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_card_validations.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_cards.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_cash_references.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_clabes.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_commissions.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_curp_validations.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_deposits.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_endpoints.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_file_batches.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_files.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_identities.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_identity_events.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_kyc_validations.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_kyc_verifications.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_limited_wallets.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_login_tokens.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_otps.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_platforms.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_questionnaires.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_resources.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_savings.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_service_providers.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_sessions.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_statements.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_transfers.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_user_credentials.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_user_events.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_user_lists_validation.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_user_logins.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_users.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_verifications.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_wallet_transactions.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_webhooks.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/resources/test_whatsapp_transfers.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/test_cuenca.py +0 -0
- {cuenca-1.0.3.dev1 → cuenca-1.0.3.dev3}/tests/test_jwt.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cuenca
|
|
3
|
-
Version: 1.0.3.
|
|
3
|
+
Version: 1.0.3.dev3
|
|
4
4
|
Summary: Cuenca API Client
|
|
5
5
|
Home-page: https://github.com/cuenca-mx/cuenca-python
|
|
6
6
|
Author: Cuenca
|
|
@@ -13,7 +13,7 @@ Description-Content-Type: text/markdown
|
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: requests<28,>=2.24
|
|
15
15
|
Requires-Dist: dataclasses>=0.7; python_version < "3.8"
|
|
16
|
-
Requires-Dist: cuenca-validations<0.
|
|
16
|
+
Requires-Dist: cuenca-validations<0.13.0,>=0.11.3
|
|
17
17
|
|
|
18
18
|
# Cuenca – Python client library
|
|
19
19
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional, cast
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import ApiKeyQuery, ApiKeyUpdateRequest
|
|
5
5
|
|
|
@@ -36,7 +36,7 @@ class ApiKey(Creatable, Queryable, Retrievable, Updateable):
|
|
|
36
36
|
|
|
37
37
|
@classmethod
|
|
38
38
|
def create(cls, *, session: Session = global_session) -> 'ApiKey':
|
|
39
|
-
return cls._create(session=session)
|
|
39
|
+
return cast('ApiKey', cls._create(session=session))
|
|
40
40
|
|
|
41
41
|
@classmethod
|
|
42
42
|
def deactivate(
|
|
@@ -55,7 +55,7 @@ class ApiKey(Creatable, Queryable, Retrievable, Updateable):
|
|
|
55
55
|
"""
|
|
56
56
|
url = cls._resource + f'/{api_key_id}'
|
|
57
57
|
resp = session.delete(url, dict(minutes=minutes))
|
|
58
|
-
return cls(
|
|
58
|
+
return cast('ApiKey', cls._from_dict(resp))
|
|
59
59
|
|
|
60
60
|
@classmethod
|
|
61
61
|
def update(
|
|
@@ -74,4 +74,5 @@ class ApiKey(Creatable, Queryable, Retrievable, Updateable):
|
|
|
74
74
|
req = ApiKeyUpdateRequest(
|
|
75
75
|
metadata=metadata, user_id=user_id, platform_id=platform_id
|
|
76
76
|
)
|
|
77
|
-
|
|
77
|
+
resp = cls._update(api_key_id, **req.dict(), session=session)
|
|
78
|
+
return cast('ApiKey', resp)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional, cast
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types.requests import ARPCRequest
|
|
5
5
|
|
|
@@ -52,4 +52,4 @@ class Arpc(Creatable):
|
|
|
52
52
|
unique_number=unique_number,
|
|
53
53
|
track_data_method=track_data_method,
|
|
54
54
|
)
|
|
55
|
-
return cls._create(session=session, **req.dict())
|
|
55
|
+
return cast('Arpc', cls._create(session=session, **req.dict()))
|
|
@@ -2,7 +2,7 @@ import base64
|
|
|
2
2
|
import datetime as dt
|
|
3
3
|
import json
|
|
4
4
|
from io import BytesIO
|
|
5
|
-
from typing import ClassVar, Generator, Optional,
|
|
5
|
+
from typing import ClassVar, Dict, Generator, Optional, Union
|
|
6
6
|
from urllib.parse import urlencode
|
|
7
7
|
|
|
8
8
|
from cuenca_validations.types import (
|
|
@@ -12,21 +12,34 @@ from cuenca_validations.types import (
|
|
|
12
12
|
TransactionQuery,
|
|
13
13
|
TransactionStatus,
|
|
14
14
|
)
|
|
15
|
-
from pydantic import BaseModel
|
|
15
|
+
from pydantic import BaseModel
|
|
16
16
|
|
|
17
17
|
from ..exc import MultipleResultsFound, NoResultFound
|
|
18
18
|
from ..http import Session, session as global_session
|
|
19
19
|
|
|
20
|
-
R_co = TypeVar('R_co', bound='Resource', covariant=True)
|
|
21
|
-
|
|
22
20
|
|
|
23
21
|
class Resource(BaseModel):
|
|
24
22
|
_resource: ClassVar[str]
|
|
25
23
|
|
|
26
24
|
id: str
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
@classmethod
|
|
27
|
+
def _from_dict(cls, obj_dict: Dict[str, Union[str, int]]) -> 'Resource':
|
|
28
|
+
cls._filter_excess_fields(obj_dict)
|
|
29
|
+
return cls(**obj_dict)
|
|
30
|
+
|
|
31
|
+
@classmethod
|
|
32
|
+
def _filter_excess_fields(cls, obj_dict):
|
|
33
|
+
"""
|
|
34
|
+
dataclasses don't allow __init__ to be called with excess fields. This
|
|
35
|
+
method allows the API to add fields in the response body without
|
|
36
|
+
breaking the client
|
|
37
|
+
"""
|
|
38
|
+
excess = set(obj_dict.keys()) - set(
|
|
39
|
+
cls.schema().get("properties").keys()
|
|
40
|
+
)
|
|
41
|
+
for f in excess:
|
|
42
|
+
del obj_dict[f]
|
|
30
43
|
|
|
31
44
|
def to_dict(self):
|
|
32
45
|
return SantizedDict(self.dict())
|
|
@@ -35,12 +48,12 @@ class Resource(BaseModel):
|
|
|
35
48
|
class Retrievable(Resource):
|
|
36
49
|
@classmethod
|
|
37
50
|
def retrieve(
|
|
38
|
-
cls
|
|
39
|
-
) ->
|
|
51
|
+
cls, id: str, *, session: Session = global_session
|
|
52
|
+
) -> Resource:
|
|
40
53
|
resp = session.get(f'/{cls._resource}/{id}')
|
|
41
|
-
return cls(
|
|
54
|
+
return cls._from_dict(resp)
|
|
42
55
|
|
|
43
|
-
def refresh(self, *, session: Session = global_session)
|
|
56
|
+
def refresh(self, *, session: Session = global_session):
|
|
44
57
|
new = self.retrieve(self.id, session=session)
|
|
45
58
|
for attr, value in new.__dict__.items():
|
|
46
59
|
setattr(self, attr, value)
|
|
@@ -48,11 +61,9 @@ class Retrievable(Resource):
|
|
|
48
61
|
|
|
49
62
|
class Creatable(Resource):
|
|
50
63
|
@classmethod
|
|
51
|
-
def _create(
|
|
52
|
-
cls: Type[R_co], *, session: Session = global_session, **data
|
|
53
|
-
) -> R_co:
|
|
64
|
+
def _create(cls, *, session: Session = global_session, **data) -> Resource:
|
|
54
65
|
resp = session.post(cls._resource, data)
|
|
55
|
-
return cls(
|
|
66
|
+
return cls._from_dict(resp)
|
|
56
67
|
|
|
57
68
|
|
|
58
69
|
class Updateable(Resource):
|
|
@@ -61,10 +72,10 @@ class Updateable(Resource):
|
|
|
61
72
|
|
|
62
73
|
@classmethod
|
|
63
74
|
def _update(
|
|
64
|
-
cls
|
|
65
|
-
) ->
|
|
75
|
+
cls, id: str, *, session: Session = global_session, **data
|
|
76
|
+
) -> Resource:
|
|
66
77
|
resp = session.patch(f'/{cls._resource}/{id}', data)
|
|
67
|
-
return cls(
|
|
78
|
+
return cls._from_dict(resp)
|
|
68
79
|
|
|
69
80
|
|
|
70
81
|
class Deactivable(Resource):
|
|
@@ -72,20 +83,20 @@ class Deactivable(Resource):
|
|
|
72
83
|
|
|
73
84
|
@classmethod
|
|
74
85
|
def deactivate(
|
|
75
|
-
cls
|
|
76
|
-
) ->
|
|
86
|
+
cls, id: str, *, session: Session = global_session, **data
|
|
87
|
+
) -> Resource:
|
|
77
88
|
resp = session.delete(f'/{cls._resource}/{id}', data)
|
|
78
|
-
return cls(
|
|
89
|
+
return cls._from_dict(resp)
|
|
79
90
|
|
|
80
91
|
@property
|
|
81
|
-
def is_active(self)
|
|
92
|
+
def is_active(self):
|
|
82
93
|
return not self.deactivated_at
|
|
83
94
|
|
|
84
95
|
|
|
85
96
|
class Downloadable(Resource):
|
|
86
97
|
@classmethod
|
|
87
98
|
def download(
|
|
88
|
-
cls
|
|
99
|
+
cls,
|
|
89
100
|
id: str,
|
|
90
101
|
file_format: FileFormat = FileFormat.any,
|
|
91
102
|
*,
|
|
@@ -110,13 +121,13 @@ class Downloadable(Resource):
|
|
|
110
121
|
class Uploadable(Resource):
|
|
111
122
|
@classmethod
|
|
112
123
|
def _upload(
|
|
113
|
-
cls
|
|
124
|
+
cls,
|
|
114
125
|
file: bytes,
|
|
115
126
|
user_id: str,
|
|
116
127
|
*,
|
|
117
128
|
session: Session = global_session,
|
|
118
129
|
**data,
|
|
119
|
-
) ->
|
|
130
|
+
) -> Resource:
|
|
120
131
|
encoded_file = base64.b64encode(file)
|
|
121
132
|
resp = session.request(
|
|
122
133
|
'post',
|
|
@@ -127,7 +138,7 @@ class Uploadable(Resource):
|
|
|
127
138
|
**{k: (None, v) for k, v in data.items()},
|
|
128
139
|
),
|
|
129
140
|
)
|
|
130
|
-
return cls(
|
|
141
|
+
return cls._from_dict(json.loads(resp))
|
|
131
142
|
|
|
132
143
|
|
|
133
144
|
class Queryable(Resource):
|
|
@@ -137,9 +148,9 @@ class Queryable(Resource):
|
|
|
137
148
|
|
|
138
149
|
@classmethod
|
|
139
150
|
def one(
|
|
140
|
-
cls
|
|
141
|
-
) ->
|
|
142
|
-
q =
|
|
151
|
+
cls, *, session: Session = global_session, **query_params
|
|
152
|
+
) -> Resource:
|
|
153
|
+
q = cls._query_params(limit=2, **query_params)
|
|
143
154
|
resp = session.get(cls._resource, q.dict())
|
|
144
155
|
items = resp['items']
|
|
145
156
|
len_items = len(items)
|
|
@@ -147,40 +158,40 @@ class Queryable(Resource):
|
|
|
147
158
|
raise NoResultFound
|
|
148
159
|
if len_items > 1:
|
|
149
160
|
raise MultipleResultsFound
|
|
150
|
-
return cls(
|
|
161
|
+
return cls._from_dict(items[0])
|
|
151
162
|
|
|
152
163
|
@classmethod
|
|
153
164
|
def first(
|
|
154
|
-
cls
|
|
155
|
-
) -> Optional[
|
|
156
|
-
q =
|
|
165
|
+
cls, *, session: Session = global_session, **query_params
|
|
166
|
+
) -> Optional[Resource]:
|
|
167
|
+
q = cls._query_params(limit=1, **query_params)
|
|
157
168
|
resp = session.get(cls._resource, q.dict())
|
|
158
169
|
try:
|
|
159
170
|
item = resp['items'][0]
|
|
160
171
|
except IndexError:
|
|
161
172
|
rv = None
|
|
162
173
|
else:
|
|
163
|
-
rv = cls(
|
|
174
|
+
rv = cls._from_dict(item)
|
|
164
175
|
return rv
|
|
165
176
|
|
|
166
177
|
@classmethod
|
|
167
178
|
def count(
|
|
168
|
-
cls
|
|
179
|
+
cls, *, session: Session = global_session, **query_params
|
|
169
180
|
) -> int:
|
|
170
|
-
q =
|
|
181
|
+
q = cls._query_params(count=True, **query_params)
|
|
171
182
|
resp = session.get(cls._resource, q.dict())
|
|
172
183
|
return resp['count']
|
|
173
184
|
|
|
174
185
|
@classmethod
|
|
175
186
|
def all(
|
|
176
|
-
cls
|
|
177
|
-
) -> Generator[
|
|
187
|
+
cls, *, session: Session = global_session, **query_params
|
|
188
|
+
) -> Generator[Resource, None, None]:
|
|
178
189
|
session = session or global_session
|
|
179
|
-
q =
|
|
190
|
+
q = cls._query_params(**query_params)
|
|
180
191
|
next_page_uri = f'{cls._resource}?{urlencode(q.dict())}'
|
|
181
192
|
while next_page_uri:
|
|
182
193
|
page = session.get(next_page_uri)
|
|
183
|
-
yield from (cls(
|
|
194
|
+
yield from (cls._from_dict(item) for item in page['items'])
|
|
184
195
|
next_page_uri = page['next_page_uri']
|
|
185
196
|
|
|
186
197
|
|
|
@@ -42,7 +42,9 @@ class CardActivation(Creatable):
|
|
|
42
42
|
exp_year=exp_year,
|
|
43
43
|
cvv2=cvv2,
|
|
44
44
|
)
|
|
45
|
-
return
|
|
45
|
+
return cast(
|
|
46
|
+
'CardActivation', cls._create(session=session, **req.dict())
|
|
47
|
+
)
|
|
46
48
|
|
|
47
49
|
@property
|
|
48
50
|
def card(self) -> Optional[Card]:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional, cast
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import (
|
|
5
5
|
CardFundingType,
|
|
@@ -81,7 +81,7 @@ class Card(Retrievable, Queryable, Creatable, Updateable):
|
|
|
81
81
|
card_holder_user_id=card_holder_user_id,
|
|
82
82
|
is_dynamic_cvv=is_dynamic_cvv,
|
|
83
83
|
)
|
|
84
|
-
return cls._create(session=session, **req.dict())
|
|
84
|
+
return cast('Card', cls._create(session=session, **req.dict()))
|
|
85
85
|
|
|
86
86
|
@classmethod
|
|
87
87
|
def update(
|
|
@@ -106,7 +106,8 @@ class Card(Retrievable, Queryable, Creatable, Updateable):
|
|
|
106
106
|
req = CardUpdateRequest(
|
|
107
107
|
status=status, pin_block=pin_block, is_dynamic_cvv=is_dynamic_cvv
|
|
108
108
|
)
|
|
109
|
-
|
|
109
|
+
resp = cls._update(card_id, session=session, **req.dict())
|
|
110
|
+
return cast('Card', resp)
|
|
110
111
|
|
|
111
112
|
@classmethod
|
|
112
113
|
def deactivate(
|
|
@@ -117,4 +118,4 @@ class Card(Retrievable, Queryable, Creatable, Updateable):
|
|
|
117
118
|
"""
|
|
118
119
|
url = f'{cls._resource}/{card_id}'
|
|
119
120
|
resp = session.delete(url)
|
|
120
|
-
return cls(
|
|
121
|
+
return cast('Card', cls._from_dict(resp))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar
|
|
1
|
+
from typing import ClassVar, cast
|
|
2
2
|
|
|
3
3
|
from ..http import Session, session as global_session
|
|
4
4
|
from .base import Creatable, Queryable, Retrievable
|
|
@@ -11,4 +11,4 @@ class Clabe(Creatable, Queryable, Retrievable):
|
|
|
11
11
|
|
|
12
12
|
@classmethod
|
|
13
13
|
def create(cls, session: Session = global_session):
|
|
14
|
-
return cls._create(session=session)
|
|
14
|
+
return cast('Clabe', cls._create(session=session))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional, cast
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import (
|
|
5
5
|
Country,
|
|
@@ -98,4 +98,7 @@ class CurpValidation(Creatable, Retrievable):
|
|
|
98
98
|
gender=gender,
|
|
99
99
|
manual_curp=manual_curp,
|
|
100
100
|
)
|
|
101
|
-
return
|
|
101
|
+
return cast(
|
|
102
|
+
'CurpValidation',
|
|
103
|
+
cls._create(session=session, **req.dict()),
|
|
104
|
+
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar, List, Optional
|
|
1
|
+
from typing import ClassVar, List, Optional, cast
|
|
2
2
|
|
|
3
3
|
from cuenca_validations.types.enums import WebhookEvent
|
|
4
4
|
from cuenca_validations.types.requests import (
|
|
@@ -72,7 +72,7 @@ class Endpoint(Creatable, Deactivable, Retrievable, Queryable, Updateable):
|
|
|
72
72
|
:return: New active endpoint
|
|
73
73
|
"""
|
|
74
74
|
req = EndpointRequest(url=url, events=events)
|
|
75
|
-
return cls._create(session=session, **req.dict())
|
|
75
|
+
return cast('Endpoint', cls._create(session=session, **req.dict()))
|
|
76
76
|
|
|
77
77
|
@classmethod
|
|
78
78
|
def update(
|
|
@@ -96,4 +96,5 @@ class Endpoint(Creatable, Deactivable, Retrievable, Queryable, Updateable):
|
|
|
96
96
|
req = EndpointUpdateRequest(
|
|
97
97
|
url=url, is_enable=is_enable, events=events
|
|
98
98
|
)
|
|
99
|
-
|
|
99
|
+
resp = cls._update(endpoint_id, session=session, **req.dict())
|
|
100
|
+
return cast('Endpoint', resp)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar, Dict, List
|
|
1
|
+
from typing import ClassVar, Dict, List, cast
|
|
2
2
|
|
|
3
3
|
from cuenca_validations.types import BatchFileMetadata, FileBatchUploadRequest
|
|
4
4
|
|
|
@@ -22,4 +22,4 @@ class FileBatch(Creatable, Queryable):
|
|
|
22
22
|
session: Session = global_session,
|
|
23
23
|
) -> 'FileBatch':
|
|
24
24
|
req = FileBatchUploadRequest(files=files, user_id=user_id)
|
|
25
|
-
return cls._create(session=session, **req.dict())
|
|
25
|
+
return cast('FileBatch', cls._create(session=session, **req.dict()))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from io import BytesIO
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional, cast
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import FileQuery, FileUploadRequest, KYCFileType
|
|
5
5
|
from pydantic import HttpUrl
|
|
@@ -44,7 +44,13 @@ class File(Downloadable, Queryable, Uploadable):
|
|
|
44
44
|
is_back=is_back,
|
|
45
45
|
user_id=user_id,
|
|
46
46
|
)
|
|
47
|
-
return
|
|
47
|
+
return cast(
|
|
48
|
+
'File',
|
|
49
|
+
cls._upload(
|
|
50
|
+
session=session,
|
|
51
|
+
**req.dict(),
|
|
52
|
+
),
|
|
53
|
+
)
|
|
48
54
|
|
|
49
55
|
@property
|
|
50
56
|
def file(self) -> bytes:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar, List, Optional
|
|
1
|
+
from typing import ClassVar, List, Optional, cast
|
|
2
2
|
|
|
3
3
|
from cuenca_validations.types import KYCFile, KYCValidationRequest
|
|
4
4
|
|
|
@@ -38,4 +38,6 @@ class KYCValidation(Creatable, Retrievable, Queryable):
|
|
|
38
38
|
force=force,
|
|
39
39
|
documents=documents,
|
|
40
40
|
)
|
|
41
|
-
return
|
|
41
|
+
return cast(
|
|
42
|
+
'KYCValidation', cls._create(**req.dict(), session=session)
|
|
43
|
+
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional, cast
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import (
|
|
5
5
|
Address,
|
|
@@ -39,7 +39,7 @@ class KYCVerification(Creatable, Retrievable, Updateable):
|
|
|
39
39
|
|
|
40
40
|
@classmethod
|
|
41
41
|
def create(cls, session: Session = global_session) -> 'KYCVerification':
|
|
42
|
-
return cls._create(session=session)
|
|
42
|
+
return cast('KYCVerification', cls._create(session=session))
|
|
43
43
|
|
|
44
44
|
@classmethod
|
|
45
45
|
def update(
|
|
@@ -48,4 +48,4 @@ class KYCVerification(Creatable, Retrievable, Updateable):
|
|
|
48
48
|
curp: Optional[CurpField] = None,
|
|
49
49
|
) -> 'KYCVerification':
|
|
50
50
|
req = KYCVerificationUpdateRequest(curp=curp)
|
|
51
|
-
return cls._update(id=kyc_id, **req.dict())
|
|
51
|
+
return cast('KYCVerification', cls._update(id=kyc_id, **req.dict()))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar, Optional
|
|
1
|
+
from typing import ClassVar, Optional, cast
|
|
2
2
|
|
|
3
3
|
from clabe import Clabe
|
|
4
4
|
from cuenca_validations.types import (
|
|
@@ -37,4 +37,4 @@ class LimitedWallet(Wallet):
|
|
|
37
37
|
allowed_curp=allowed_curp,
|
|
38
38
|
allowed_rfc=allowed_rfc,
|
|
39
39
|
)
|
|
40
|
-
return cls._create(**request.dict())
|
|
40
|
+
return cast('LimitedWallet', cls._create(**request.dict()))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar
|
|
1
|
+
from typing import ClassVar, cast
|
|
2
2
|
|
|
3
3
|
from ..http import Session, session as global_session
|
|
4
4
|
from .base import Creatable
|
|
@@ -17,4 +17,4 @@ class LoginToken(Creatable):
|
|
|
17
17
|
Make sure to store this token in a safe place
|
|
18
18
|
:return: Token that you can use in cuenca.configure
|
|
19
19
|
"""
|
|
20
|
-
return cls._create(session=session)
|
|
20
|
+
return cast('LoginToken', cls._create(session=session))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional, cast
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import Country, PlatformRequest, State
|
|
5
5
|
|
|
@@ -76,4 +76,4 @@ class Platform(Creatable):
|
|
|
76
76
|
phone_number=phone_number,
|
|
77
77
|
email_address=email_address,
|
|
78
78
|
)
|
|
79
|
-
return cls._create(session=session, **req.dict())
|
|
79
|
+
return cast('Platform', cls._create(session=session, **req.dict()))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar
|
|
2
|
+
from typing import ClassVar, cast
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import QuestionnairesRequest
|
|
5
5
|
|
|
@@ -38,4 +38,6 @@ class Questionnaires(Creatable, Retrievable):
|
|
|
38
38
|
token=token,
|
|
39
39
|
form_id=form_id,
|
|
40
40
|
)
|
|
41
|
-
return
|
|
41
|
+
return cast(
|
|
42
|
+
'Questionnaires', cls._create(session=session, **req.dict())
|
|
43
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import re
|
|
2
2
|
from concurrent.futures import ThreadPoolExecutor
|
|
3
|
-
from typing import Dict, List
|
|
3
|
+
from typing import Dict, List, cast
|
|
4
4
|
|
|
5
5
|
from .base import Retrievable
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@ def retrieve_uri(uri: str) -> Retrievable:
|
|
|
13
13
|
if not m:
|
|
14
14
|
raise ValueError(f'uri is not a valid format: {uri}')
|
|
15
15
|
resource, id_ = m.groups()
|
|
16
|
-
return RESOURCES[resource].retrieve(id_)
|
|
16
|
+
return cast(Retrievable, RESOURCES[resource].retrieve(id_))
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
def retrieve_uris(uris: List[str]) -> List[Retrievable]:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional, cast
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import (
|
|
5
5
|
SavingCategory,
|
|
@@ -34,7 +34,7 @@ class Saving(Wallet, Updateable):
|
|
|
34
34
|
goal_amount=goal_amount,
|
|
35
35
|
goal_date=goal_date,
|
|
36
36
|
)
|
|
37
|
-
return cls._create(**request.dict())
|
|
37
|
+
return cast('Saving', cls._create(**request.dict()))
|
|
38
38
|
|
|
39
39
|
@classmethod
|
|
40
40
|
def update(
|
|
@@ -51,4 +51,4 @@ class Saving(Wallet, Updateable):
|
|
|
51
51
|
goal_amount=goal_amount,
|
|
52
52
|
goal_date=goal_date,
|
|
53
53
|
)
|
|
54
|
-
return cls._update(id=saving_id, **request.dict())
|
|
54
|
+
return cast('Saving', cls._update(id=saving_id, **request.dict()))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional, cast
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import SessionRequest, SessionType
|
|
5
5
|
from pydantic import AnyUrl
|
|
@@ -50,4 +50,4 @@ class Session(Creatable, Retrievable, Queryable):
|
|
|
50
50
|
success_url=success_url,
|
|
51
51
|
failure_url=failure_url,
|
|
52
52
|
)
|
|
53
|
-
return cls._create(session=session, **req.dict())
|
|
53
|
+
return cast('Session', cls._create(session=session, **req.dict()))
|
|
@@ -69,7 +69,7 @@ class Transfer(Transaction, Creatable):
|
|
|
69
69
|
idempotency_key=idempotency_key,
|
|
70
70
|
user_id=user_id,
|
|
71
71
|
)
|
|
72
|
-
return cls._create(**req.dict())
|
|
72
|
+
return cast('Transfer', cls._create(**req.dict()))
|
|
73
73
|
|
|
74
74
|
@classmethod
|
|
75
75
|
def create_many(cls, requests: List[TransferRequest]) -> DictStrAny:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional, cast
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types.requests import (
|
|
5
5
|
UserCredentialRequest,
|
|
@@ -25,7 +25,9 @@ class UserCredential(Creatable, Updateable):
|
|
|
25
25
|
session: Session = global_session,
|
|
26
26
|
) -> 'UserCredential':
|
|
27
27
|
req = UserCredentialRequest(password=password, user_id=user_id)
|
|
28
|
-
return
|
|
28
|
+
return cast(
|
|
29
|
+
'UserCredential', cls._create(**req.dict(), session=session)
|
|
30
|
+
)
|
|
29
31
|
|
|
30
32
|
@classmethod
|
|
31
33
|
def update(
|
|
@@ -40,4 +42,7 @@ class UserCredential(Creatable, Updateable):
|
|
|
40
42
|
is_active=is_active,
|
|
41
43
|
password=password,
|
|
42
44
|
)
|
|
43
|
-
return
|
|
45
|
+
return cast(
|
|
46
|
+
'UserCredential',
|
|
47
|
+
cls._update(id=user_id, **req.dict(), session=session),
|
|
48
|
+
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional, cast
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import UserListsRequest, VerificationStatus
|
|
5
5
|
from cuenca_validations.types.identities import CurpField
|
|
@@ -36,4 +36,7 @@ class UserListsValidation(Creatable, Retrievable):
|
|
|
36
36
|
curp=curp,
|
|
37
37
|
account_number=account_number,
|
|
38
38
|
)
|
|
39
|
-
return
|
|
39
|
+
return cast(
|
|
40
|
+
'UserListsValidation',
|
|
41
|
+
cls._create(session=session, **req.dict()),
|
|
42
|
+
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional, cast
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types.requests import UserLoginRequest
|
|
5
5
|
|
|
@@ -31,7 +31,7 @@ class UserLogin(Creatable):
|
|
|
31
31
|
session: Session = global_session,
|
|
32
32
|
) -> 'UserLogin':
|
|
33
33
|
req = UserLoginRequest(password=password, user_id=user_id)
|
|
34
|
-
login = cls._create(session=session, **req.dict())
|
|
34
|
+
login = cast('UserLogin', cls._create(session=session, **req.dict()))
|
|
35
35
|
if login.success:
|
|
36
36
|
session.headers['X-Cuenca-LoginId'] = login.id
|
|
37
37
|
return login
|
|
@@ -59,7 +59,7 @@ class User(Creatable, Retrievable, Updateable, Queryable):
|
|
|
59
59
|
|
|
60
60
|
@property
|
|
61
61
|
def balance(self) -> int:
|
|
62
|
-
be = BalanceEntry.first(user_id=self.id)
|
|
62
|
+
be = cast(BalanceEntry, BalanceEntry.first(user_id=self.id))
|
|
63
63
|
return be.rolling_balance if be else 0
|
|
64
64
|
|
|
65
65
|
class Config:
|
|
@@ -135,7 +135,7 @@ class User(Creatable, Retrievable, Updateable, Queryable):
|
|
|
135
135
|
status=status,
|
|
136
136
|
terms_of_service=terms_of_service,
|
|
137
137
|
)
|
|
138
|
-
return cls._create(session=session, **req.dict())
|
|
138
|
+
return cast('User', cls._create(session=session, **req.dict()))
|
|
139
139
|
|
|
140
140
|
@classmethod
|
|
141
141
|
def update(
|
|
@@ -174,7 +174,10 @@ class User(Creatable, Retrievable, Updateable, Queryable):
|
|
|
174
174
|
curp_document=curp_document,
|
|
175
175
|
status=status,
|
|
176
176
|
)
|
|
177
|
-
return
|
|
177
|
+
return cast(
|
|
178
|
+
'User',
|
|
179
|
+
cls._update(id=user_id, **request.dict(), session=session),
|
|
180
|
+
)
|
|
178
181
|
|
|
179
182
|
@property
|
|
180
183
|
def identity(self) -> Identity:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional, Union
|
|
2
|
+
from typing import ClassVar, Optional, Union, cast
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import (
|
|
5
5
|
VerificationAttemptRequest,
|
|
@@ -44,7 +44,7 @@ class Verification(Creatable, Updateable):
|
|
|
44
44
|
req = VerificationRequest(
|
|
45
45
|
recipient=recipient, type=type, platform_id=platform_id
|
|
46
46
|
)
|
|
47
|
-
return cls._create(**req.dict(), session=session)
|
|
47
|
+
return cast('Verification', cls._create(**req.dict(), session=session))
|
|
48
48
|
|
|
49
49
|
@classmethod
|
|
50
50
|
def verify(
|
|
@@ -54,4 +54,7 @@ class Verification(Creatable, Updateable):
|
|
|
54
54
|
session: Session = global_session,
|
|
55
55
|
) -> 'Verification':
|
|
56
56
|
req = VerificationAttemptRequest(code=code)
|
|
57
|
-
return
|
|
57
|
+
return cast(
|
|
58
|
+
'Verification',
|
|
59
|
+
cls._update(id=id, **req.dict(), session=session),
|
|
60
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cuenca
|
|
3
|
-
Version: 1.0.3.
|
|
3
|
+
Version: 1.0.3.dev3
|
|
4
4
|
Summary: Cuenca API Client
|
|
5
5
|
Home-page: https://github.com/cuenca-mx/cuenca-python
|
|
6
6
|
Author: Cuenca
|
|
@@ -13,7 +13,7 @@ Description-Content-Type: text/markdown
|
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: requests<28,>=2.24
|
|
15
15
|
Requires-Dist: dataclasses>=0.7; python_version < "3.8"
|
|
16
|
-
Requires-Dist: cuenca-validations<0.
|
|
16
|
+
Requires-Dist: cuenca-validations<0.13.0,>=0.11.3
|
|
17
17
|
|
|
18
18
|
# Cuenca – Python client library
|
|
19
19
|
|
|
@@ -84,7 +84,7 @@ def test_api_key_from_dict():
|
|
|
84
84
|
metadata=None,
|
|
85
85
|
user_id=None,
|
|
86
86
|
)
|
|
87
|
-
api_key = ApiKey(
|
|
87
|
+
api_key = ApiKey._from_dict(api_keys_dict)
|
|
88
88
|
assert not hasattr(api_key, 'extra_field_1')
|
|
89
89
|
assert not hasattr(api_key, 'extra_field_2')
|
|
90
90
|
assert api_key.id is not None
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|