cuenca 0.15.11.dev6__py3-none-any.whl → 1.0.1.dev1__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.
cuenca/exc.py CHANGED
@@ -4,7 +4,7 @@ from cuenca_validations.typing import DictStrAny
4
4
 
5
5
 
6
6
  class CuencaException(Exception):
7
- ...
7
+ """Base Exception Class"""
8
8
 
9
9
 
10
10
  class MalformedJwtToken(CuencaException):
@@ -22,6 +22,7 @@ __all__ = [
22
22
  'KYCVerification',
23
23
  'LimitedWallet',
24
24
  'LoginToken',
25
+ 'Otp',
25
26
  'Platform',
26
27
  'Questionnaires',
27
28
  'Saving',
@@ -62,6 +63,7 @@ from .kyc_validations import KYCValidation
62
63
  from .kyc_verifications import KYCVerification
63
64
  from .limited_wallets import LimitedWallet
64
65
  from .login_tokens import LoginToken
66
+ from .otps import Otp
65
67
  from .platforms import Platform
66
68
  from .questionnaires import Questionnaires
67
69
  from .resources import RESOURCES
@@ -0,0 +1,24 @@
1
+ from typing import ClassVar, cast
2
+
3
+ from ..http import Session, session as global_session
4
+ from .base import Creatable
5
+
6
+
7
+ class Otp(Creatable):
8
+ _resource: ClassVar = 'otps'
9
+ secret: str
10
+
11
+ class Config:
12
+ schema_extra = {
13
+ 'example': {
14
+ 'id': 'OTNEUInh69SuKXXmK95sROwQ',
15
+ 'secret': 'somesecret',
16
+ }
17
+ }
18
+
19
+ @classmethod
20
+ def create(cls, session: Session = global_session) -> 'Otp':
21
+ """
22
+ Use this method to create a OTP seed
23
+ """
24
+ return cast('Otp', cls._create(session=session))
@@ -11,6 +11,9 @@ class Questionnaires(Creatable, Retrievable):
11
11
  _resource: ClassVar = 'questionnaires'
12
12
 
13
13
  created_at: dt.datetime
14
+ token: str
15
+ form_id: str
16
+ user_id: str
14
17
 
15
18
  class Config:
16
19
  schema_extra = {
cuenca/version.py CHANGED
@@ -1,3 +1,3 @@
1
- __version__ = '0.15.11.dev6'
1
+ __version__ = '1.0.1.dev1'
2
2
  CLIENT_VERSION = __version__
3
3
  API_VERSION = '2020-03-19'
@@ -1,22 +1,19 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cuenca
3
- Version: 0.15.11.dev6
3
+ Version: 1.0.1.dev1
4
4
  Summary: Cuenca API Client
5
5
  Home-page: https://github.com/cuenca-mx/cuenca-python
6
6
  Author: Cuenca
7
7
  Author-email: dev@cuenca.com
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.6
10
- Classifier: Programming Language :: Python :: 3.7
11
8
  Classifier: Programming Language :: Python :: 3.8
12
9
  Classifier: License :: OSI Approved :: MIT License
13
10
  Classifier: Operating System :: OS Independent
14
- Requires-Python: >=3.6
11
+ Requires-Python: >=3.8
15
12
  Description-Content-Type: text/markdown
16
13
  License-File: LICENSE
17
14
  Requires-Dist: requests <28,>=2.24
18
15
  Requires-Dist: cuenca-validations <0.12.0,>=0.11.3
19
- Requires-Dist: dataclasses >=0.7 ; python_version < "3.7"
16
+ Requires-Dist: dataclasses >=0.7 ; python_version < "3.8"
20
17
 
21
18
  # Cuenca – Python client library
22
19
 
@@ -1,11 +1,11 @@
1
1
  cuenca/__init__.py,sha256=aUXUxZNqqVyukpUIKEkNxBcM3H5Xf7s0jYWugX5ClLI,1787
2
- cuenca/exc.py,sha256=3w6vAaFD4XKTMzn1P9x-MLQriQpknJFQFD4nTwa7gcE,578
2
+ cuenca/exc.py,sha256=r_lL03-JS0AsXw71wuNbiwNYLHNDagM56tRxpYyK6Lw,601
3
3
  cuenca/jwt.py,sha256=plB2ttHPZnL0xq3gqubw_Jjtj1QYG2E5bk99N3cn5zg,1502
4
4
  cuenca/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- cuenca/version.py,sha256=e1c0X7766mCLhJaLZRyUwdDtZd-Q1IM4ppq_GUINa8A,85
5
+ cuenca/version.py,sha256=bEBUXAGX-saF_NQE3JBBGFNg6ZHyGbnitepSw924fcQ,83
6
6
  cuenca/http/__init__.py,sha256=V5TG6Ro9d3VY7umzcbtanmvHlGkv-k71H0tqrdMyH-s,49
7
7
  cuenca/http/client.py,sha256=psXJiSgd3SUSJ5jwvhdBWsVMNadenG353BNVXdh7HMY,4168
8
- cuenca/resources/__init__.py,sha256=9TYP93f7sIC5nYABiuycd4LLzZkgQrkWz-pJWRGJsKM,2986
8
+ cuenca/resources/__init__.py,sha256=pySyBur3jnWA5yfHFuVZfdnk6nROj3BsLRy7vVWXFoc,3019
9
9
  cuenca/resources/accounts.py,sha256=5yfNxAHpxWFosoR4WrPrDGpBCRkaQk98V-w0wCPPXqU,345
10
10
  cuenca/resources/api_keys.py,sha256=boOBXUCxDSgSI7HMR70ylTEgfug9c_GOBozr_yzhjXQ,2554
11
11
  cuenca/resources/arpc.py,sha256=rLmzq0Tgy5bKvxbe6_EGW4tpcBbuKc-bSIo7HDs3qH8,1689
@@ -30,8 +30,9 @@ cuenca/resources/kyc_validations.py,sha256=Jpj0DsZzdC1662txfJGzdGvpt0-SjGxKIryML
30
30
  cuenca/resources/kyc_verifications.py,sha256=qVBxIjNatjQpHG6eljSlha0F-ZirL648INkdl-Q8Kpo,1560
31
31
  cuenca/resources/limited_wallets.py,sha256=YWpbz1WrS0zswRhxbvaqVS5Y1QS3vKp4oudlYr8gYVw,1080
32
32
  cuenca/resources/login_tokens.py,sha256=uXIbAW5ucSCsqPqU_6O5NKK8EcKr3HLCb1Dw7v1YLWk,639
33
+ cuenca/resources/otps.py,sha256=M4eTocovZlvRXVahdnPfQy1cl1RMy7gzUh9DRHVEJDE,582
33
34
  cuenca/resources/platforms.py,sha256=0kfXU1Z9VPjE8D9v8oMY2ZOloQbGAnBIHfaPoE9oOvE,2743
34
- cuenca/resources/questionnaires.py,sha256=CH37TN0pxGQRAa3b9ZkGtKT4uV1edtvKwHGnmTEXUjU,986
35
+ cuenca/resources/questionnaires.py,sha256=GY4RVYdWeOiRyDQwFGA6qaAWYwyAD50gSuaVCbyePkY,1035
35
36
  cuenca/resources/resources.py,sha256=g6ssYfGTALzP-ZDBTDedJw1GeAnSTiWi78w9Hg_zeAg,706
36
37
  cuenca/resources/savings.py,sha256=1gF_HGSxbcDuzyqq1flmURfPevuLgQexaKBahY33xIc,1433
37
38
  cuenca/resources/service_providers.py,sha256=aOulwTAvCLyzojBlhO7EQaPtlM9YPRYAAUXLjuGZwAk,316
@@ -79,6 +80,7 @@ tests/resources/test_kyc_verifications.py,sha256=Y-ZU61o18I_3NFqMN2w4WGZTzwsIhUL
79
80
  tests/resources/test_limited_wallets.py,sha256=c0zDDOip3lJk8chbcGr_nWCdkO9yuL_HbD1IikR5jH4,527
80
81
  tests/resources/test_login_tokens.py,sha256=kn0gXFOanIXjgKjbeOzfNyKsGAUkc2iKnuVmzIRaMD8,572
81
82
  tests/resources/test_platforms.py,sha256=5b6-XC3uAz8GARFkFoanH62jxE1uJIMXcdpeUhmI8Kg,211
83
+ tests/resources/test_questionnaires.py,sha256=Sl8YHXgL42xiijUncycOUzGu5MtI3jEnhADS8Nol6N8,321
82
84
  tests/resources/test_resources.py,sha256=rTcfjZOxujOJXjfqvOV6TPpYl8lae4bgbZj4jTAWm_o,170
83
85
  tests/resources/test_savings.py,sha256=2qlGo9Qy_bqwYfMmjf9OsPIPVWRb6zlkzaMgg5RWElk,1127
84
86
  tests/resources/test_service_providers.py,sha256=yhjTvRdVaTpwEHLVtvX8OD6bMef2W9wUI8MRwLY-i64,563
@@ -87,15 +89,15 @@ tests/resources/test_statements.py,sha256=e9S_yn5kD6M8IpfpRmIOJ0Y6aggBkYWQxynY6P
87
89
  tests/resources/test_transfers.py,sha256=06_1vHTM1pU3-LJXGupRo44VjZ21m7ICZcviJfxCYU4,4157
88
90
  tests/resources/test_user_credentials.py,sha256=WbK20aprlT3P_IEOwplvhIYnLfTgGhK3Q3Tu6Tf129c,809
89
91
  tests/resources/test_user_events.py,sha256=aPTyrEVF7jBD8-UQZeVOLbUmj9sni0JRCYgootmaQ8c,292
90
- tests/resources/test_user_lists_validation.py,sha256=4QtChGX6uejFycrxhM5cPYRc3f68SX76HI7RXImbk7Q,686
92
+ tests/resources/test_user_lists_validation.py,sha256=-aHXS13o6mqbDsiWlprfyWzPbhMK3s0Qvk0G0zAhUfA,711
91
93
  tests/resources/test_user_logins.py,sha256=YLIZiFsR9tBv1fNH-lIpIMtvGY_7NHGQpMBFVuEFj6c,988
92
94
  tests/resources/test_users.py,sha256=AkUvk4Jdg4mM3dxvYR17jlc_z3WslIH1OLDqNDoTcc4,3223
93
95
  tests/resources/test_verifications.py,sha256=yyL-bdryQU3MvqnmAgnnzGG9t7UTxWwPiVu-cDSCjl4,1647
94
96
  tests/resources/test_wallet_transactions.py,sha256=_L2hjPHT4FwwhxksUoaoVHwFFYOGWfF4ScCbk0kb7Hw,3945
95
97
  tests/resources/test_webhooks.py,sha256=nYCqAnlNJcMJKRHhgoHOWTQnFLWQHHvFyY8GVCxGTD8,328
96
98
  tests/resources/test_whatsapp_transfers.py,sha256=4Dmrsbytx7LRrLQo9M8TAL7cGKJufPStkp51UdRCnYU,1030
97
- cuenca-0.15.11.dev6.dist-info/LICENSE,sha256=aWv5PmUiAcNENEAdghcVQSeU56pXJHWexJYgklK9XLg,1063
98
- cuenca-0.15.11.dev6.dist-info/METADATA,sha256=CdinobAIqFS1SK84u9tQLNLXcstAe_WYkzHTeLlKKw4,4742
99
- cuenca-0.15.11.dev6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
100
- cuenca-0.15.11.dev6.dist-info/top_level.txt,sha256=5h3K7XJTmJniDloPq4sIJHni_xLw-Uoc6ZJ5mcw_lZY,13
101
- cuenca-0.15.11.dev6.dist-info/RECORD,,
99
+ cuenca-1.0.1.dev1.dist-info/LICENSE,sha256=aWv5PmUiAcNENEAdghcVQSeU56pXJHWexJYgklK9XLg,1063
100
+ cuenca-1.0.1.dev1.dist-info/METADATA,sha256=QQaPUTu9mJWyNivn2wF_uLk3cT8U0KN0bxIB0AElVfw,4592
101
+ cuenca-1.0.1.dev1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
102
+ cuenca-1.0.1.dev1.dist-info/top_level.txt,sha256=5h3K7XJTmJniDloPq4sIJHni_xLw-Uoc6ZJ5mcw_lZY,13
103
+ cuenca-1.0.1.dev1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,16 @@
1
+ import pytest
2
+
3
+ from cuenca import Questionnaires
4
+
5
+
6
+ @pytest.mark.vcr
7
+ def test_create_questionnaire():
8
+ qn = Questionnaires.create(
9
+ user_id='US2aaB809x842cq8PxhhdgyC',
10
+ token='some_token',
11
+ form_id='some_form',
12
+ )
13
+ assert qn.id
14
+ assert qn.user_id
15
+ assert qn.form_id
16
+ assert qn.token
@@ -15,6 +15,6 @@ def test_create_user_validation(user_lists_request):
15
15
  @pytest.mark.vcr
16
16
  def test_create_user_validation_invalid_inputs():
17
17
  with pytest.raises(CuencaResponseException) as exc:
18
- UserListsValidation.create(**dict())
18
+ UserListsValidation.create(**dict(curp='MAVM112222HWIERN02'))
19
19
  assert exc.status_code == 403
20
20
  assert exc.json['error'] == 'There is an error with the inputs'