cuenca 2.1.6.dev3__py3-none-any.whl → 2.1.7__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/__init__.py CHANGED
@@ -45,6 +45,8 @@ __all__ = [
45
45
  'TermsOfService',
46
46
  'UserTOSAgreement',
47
47
  'PostalCodes',
48
+ 'ExistPhones',
49
+ 'PhoneVerificationAssociations',
48
50
  ]
49
51
 
50
52
  from . import http
@@ -64,6 +66,7 @@ from .resources import (
64
66
  CurpValidation,
65
67
  Deposit,
66
68
  Endpoint,
69
+ ExistPhones,
67
70
  File,
68
71
  FileBatch,
69
72
  Identity,
@@ -73,6 +76,7 @@ from .resources import (
73
76
  LimitedWallet,
74
77
  LoginToken,
75
78
  Otp,
79
+ PhoneVerificationAssociations,
76
80
  Platform,
77
81
  PostalCodes,
78
82
  Questionnaires,
@@ -16,6 +16,7 @@ __all__ = [
16
16
  'Endpoint',
17
17
  'File',
18
18
  'FileBatch',
19
+ 'ExistPhones',
19
20
  'Identity',
20
21
  'IdentityEvent',
21
22
  'KYCValidation',
@@ -23,6 +24,7 @@ __all__ = [
23
24
  'LoginToken',
24
25
  'Otp',
25
26
  'Platform',
27
+ 'PhoneVerificationAssociation',
26
28
  'Questionnaires',
27
29
  'Saving',
28
30
  'ServiceProvider',
@@ -58,6 +60,7 @@ from .commissions import Commission
58
60
  from .curp_validations import CurpValidation
59
61
  from .deposits import Deposit
60
62
  from .endpoints import Endpoint
63
+ from .exist_phones import ExistPhones
61
64
  from .file_batches import FileBatch
62
65
  from .files import File
63
66
  from .identities import Identity
@@ -67,6 +70,7 @@ from .kyc_validations import KYCValidation
67
70
  from .limited_wallets import LimitedWallet
68
71
  from .login_tokens import LoginToken
69
72
  from .otps import Otp
73
+ from .phone_verification_associations import PhoneVerificationAssociations
70
74
  from .platforms import Platform
71
75
  from .postal_codes import PostalCodes
72
76
  from .questionnaires import Questionnaires
@@ -132,6 +136,7 @@ resource_classes = [
132
136
  JwtToken,
133
137
  TermsOfService,
134
138
  UserTOSAgreement,
139
+ PhoneVerificationAssociations,
135
140
  ]
136
141
  for resource_cls in resource_classes:
137
142
  RESOURCES[resource_cls._resource] = resource_cls # type: ignore
@@ -0,0 +1,12 @@
1
+ from typing import ClassVar
2
+
3
+ from pydantic_extra_types.phone_numbers import PhoneNumber
4
+
5
+ from .base import Retrievable
6
+
7
+
8
+ class ExistPhones(Retrievable):
9
+ _resource: ClassVar = 'exist_phones'
10
+
11
+ id: PhoneNumber
12
+ exist: bool
@@ -0,0 +1,26 @@
1
+ import datetime as dt
2
+ from typing import ClassVar
3
+
4
+ from cuenca_validations.types.requests import (
5
+ PhoneVerificationAssociationRequest,
6
+ )
7
+
8
+ from ..http import Session, session as global_session
9
+ from .base import Creatable
10
+
11
+
12
+ class PhoneVerificationAssociations(Creatable):
13
+ _resource: ClassVar = 'phone_verification_associations'
14
+
15
+ verification_id: str
16
+ user_id: str
17
+ created_at: dt.datetime
18
+
19
+ @classmethod
20
+ def create(
21
+ cls, verification_id: str, session: Session = global_session
22
+ ) -> 'PhoneVerificationAssociations':
23
+ req = PhoneVerificationAssociationRequest(
24
+ verification_id=verification_id
25
+ )
26
+ return cls._create(session=session, **req.model_dump())
@@ -1,8 +1,13 @@
1
1
  import datetime as dt
2
- from typing import ClassVar
2
+ from typing import ClassVar, Optional
3
3
 
4
4
  from cuenca_validations.types.general import SerializableHttpUrl
5
+ from cuenca_validations.types.requests import (
6
+ FileCuencaUrl,
7
+ UserTOSAgreementRequest,
8
+ )
5
9
 
10
+ from ..http import Session, session as global_session
6
11
  from .base import Creatable, Queryable, Retrievable
7
12
 
8
13
 
@@ -12,10 +17,27 @@ class UserTOSAgreement(Creatable, Retrievable, Queryable):
12
17
  id: str
13
18
  created_at: dt.datetime
14
19
  updated_at: dt.datetime
15
- terms_of_service: str
20
+ terms_of_service_uri: str
16
21
  user_id: str
17
22
  ip: str
18
23
  location: str
19
- digital_signature: str
20
- signed_document_url: SerializableHttpUrl
21
- notification_id: str
24
+ digital_signature: Optional[str] = None
25
+ signature_image_url: Optional[FileCuencaUrl] = None
26
+ signed_document_url: Optional[SerializableHttpUrl] = None
27
+ notification_id: Optional[str] = None
28
+
29
+ @classmethod
30
+ def create(
31
+ cls,
32
+ location: str,
33
+ tos_id: str,
34
+ signature_image_url: Optional[FileCuencaUrl] = None,
35
+ *,
36
+ session: Session = global_session,
37
+ ) -> 'UserTOSAgreement':
38
+ req = UserTOSAgreementRequest(
39
+ location=location,
40
+ tos_id=tos_id,
41
+ signature_image_url=signature_image_url,
42
+ )
43
+ return cls._create(session=session, **req.model_dump())
cuenca/version.py CHANGED
@@ -1,3 +1,3 @@
1
- __version__ = '2.1.6.dev3'
1
+ __version__ = '2.1.7'
2
2
  CLIENT_VERSION = __version__
3
3
  API_VERSION = '2020-03-19'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cuenca
3
- Version: 2.1.6.dev3
3
+ Version: 2.1.7
4
4
  Summary: Cuenca API Client
5
5
  Home-page: https://github.com/cuenca-mx/cuenca-python
6
6
  Author: Cuenca
@@ -1,11 +1,11 @@
1
- cuenca/__init__.py,sha256=glrCEfdQ7vemadixSdLY3kQLYU4K4o-mQwKkmBRydK0,1870
1
+ cuenca/__init__.py,sha256=R_PNGTPbmivdWfiE5qAFQE-gsw0AOB4cw4W6DWpF-KY,1978
2
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=QIZTqGoqaGwT2KVipvaCIGUDy2qZLoESvRilr7MNsFo,83
5
+ cuenca/version.py,sha256=nFj9WOdhV-T2N2EV0XZCqg_eVvpzr_TyyMaUY_x3nMM,78
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=RVdGFW-0dqa94obH-NxGVw5zd7DJXgUz49rSZiUYCiI,3249
8
+ cuenca/resources/__init__.py,sha256=uBp3dzTwPTY62Dx8o9bPCtNJ6OeHKNRoTsUc2RQL5uA,3452
9
9
  cuenca/resources/accounts.py,sha256=5yfNxAHpxWFosoR4WrPrDGpBCRkaQk98V-w0wCPPXqU,345
10
10
  cuenca/resources/api_keys.py,sha256=p65ZUiAu51JhEL_fZDc7_DTR0PMcSa-YQeK9gRFY82s,2618
11
11
  cuenca/resources/arpc.py,sha256=a9gGIgpBV8RK2ePSPBxI5c4ET4MtKH6Po_HRiv73B5k,1689
@@ -22,6 +22,7 @@ cuenca/resources/commissions.py,sha256=Fz5kHq7FPJl8Z0qiu5_z-Ws2jEPqGi1x2OOwXCCM-
22
22
  cuenca/resources/curp_validations.py,sha256=LWJcu1ccoc6_t9ky0t8xqWepdpWSrUYIjW6a_8xJ_Rs,3506
23
23
  cuenca/resources/deposits.py,sha256=8FINQJ3c0Zg8FAq7e1JZu9i8G40fX-Kmawhl7Ouxpx4,566
24
24
  cuenca/resources/endpoints.py,sha256=AhrG8O6-6rtjtA9Ll98nmxq7xxiLkrKHR7XXZ59PGSs,3235
25
+ cuenca/resources/exist_phones.py,sha256=yuAOPaxuw8OI1farvqsNxjAI15P3147SqVnkRXilWV0,231
25
26
  cuenca/resources/file_batches.py,sha256=2Fsmz8ryOjvLn3dpsyR0G2iS0zNVR4ajovNkaMZaHaM,786
26
27
  cuenca/resources/files.py,sha256=WZYRo76fIGXNXk2HzA252dSdIdA4bl3EjB6q0bb6BFg,1837
27
28
  cuenca/resources/identities.py,sha256=IdL495eTjx_2gDRxM9oG_QmDNOwaY7Nv9gzqeZu_Wdk,1092
@@ -31,6 +32,7 @@ cuenca/resources/kyc_validations.py,sha256=xxbdztNRD7A3vleZ637TjeGPPK7Ei2waashsm
31
32
  cuenca/resources/limited_wallets.py,sha256=Z3pKMRmMFTAaCw-KdzGSWfYFHCpy-ZrBwOmalVfSdRU,1049
32
33
  cuenca/resources/login_tokens.py,sha256=vxRWqQznxdEUK0R80k0qC0BkTSZwZgUsC2neX8TTd8Q,799
33
34
  cuenca/resources/otps.py,sha256=dZEwns98N8uUtRBFCu6Qs6ySHARU9v3zTF6T5rpF43M,711
35
+ cuenca/resources/phone_verification_associations.py,sha256=JydlFi57kVH-3qdCRMfj67tZSz6N--ZX5ULBe9Owu0Q,720
34
36
  cuenca/resources/platforms.py,sha256=ztGcI-cNnushMRqKqjPaZg_ioS1bpR4vR88osHAyYXw,2560
35
37
  cuenca/resources/postal_codes.py,sha256=FOC9P4nZCQVRHMGeG8wHiRtsD083EdHtcKGPuJKj8b8,467
36
38
  cuenca/resources/questionnaires.py,sha256=TKICPHghEhER83byMhe75Wb798K5veqv47RafYA5VOM,1043
@@ -46,12 +48,12 @@ cuenca/resources/user_events.py,sha256=L57v7clStwxyJX2vwe-357uRTrzeQglDpCCgXRg7v
46
48
  cuenca/resources/user_lists_validation.py,sha256=UrInfZRUVd4nODBIBOTH8ALEZ3pvdYS2_xfFR7UeNrc,1595
47
49
  cuenca/resources/user_logins.py,sha256=KDauv2c5BJUR-C5ZeIjAPsv-8VH11BhoT-wCU9KgrwY,1542
48
50
  cuenca/resources/users.py,sha256=3qb0-_3KBQCooqFUrknQ28ywU2v7s4JMudrd65z5Q-0,6321
49
- cuenca/resources/users_tos_agreements.py,sha256=zLWEVttFipz_8Vh9YeNo68VLrWugy-Ob5ENFSVAAeTs,518
51
+ cuenca/resources/users_tos_agreements.py,sha256=bZiVuobGfLlxwlIyoiA9Izdo4KiUlxJyBffp9Y2NYYU,1250
50
52
  cuenca/resources/verifications.py,sha256=c90Pyd20EXLA5Wy0C1RABxjjivMB--q6yu6uK-R8aNA,1607
51
53
  cuenca/resources/wallet_transactions.py,sha256=8ePZI3-GaEd658GPYizAfHK9GVwlkt1r95-mEb7T3Jg,1030
52
54
  cuenca/resources/webhooks.py,sha256=bGjuvkSP3GXo4Q6v8iZ40Md8xc4AQrEmAD3r40VJqxM,392
53
55
  cuenca/resources/whatsapp_transfers.py,sha256=YSL606FBOMGKjhyKK5TiF0di96zdDKoiVtjiz_Zl_ZI,902
54
- cuenca-2.1.6.dev3.dist-info/licenses/LICENSE,sha256=aWv5PmUiAcNENEAdghcVQSeU56pXJHWexJYgklK9XLg,1063
56
+ cuenca-2.1.7.dist-info/licenses/LICENSE,sha256=aWv5PmUiAcNENEAdghcVQSeU56pXJHWexJYgklK9XLg,1063
55
57
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
58
  tests/conftest.py,sha256=O8GhZPxJenGV_O-DMoXGl3xJImkHBOuXYV3DJDGngzc,1904
57
59
  tests/test_cuenca.py,sha256=aeha_utz9YiHQg6eJK2PB7g66pVUYFi9U6pYMGXDKvk,1628
@@ -75,6 +77,7 @@ tests/resources/test_commissions.py,sha256=cdRP9LHPUlX-OB_AMDrYux9G_2xYKIUfKqirG
75
77
  tests/resources/test_curp_validations.py,sha256=5GvPrgQGfzD8JCtCdQDz4023Q2caonLbirn7_gZMXow,530
76
78
  tests/resources/test_deposits.py,sha256=LQxg3PYQsyl2f8naPUAKvXnAanZszFlGFsa4WDRvouc,262
77
79
  tests/resources/test_endpoints.py,sha256=prAB6FRYOnkXDOq-LACyTtUXJr_Cq_MmWxyM5awrW24,1509
80
+ tests/resources/test_exist_phone.py,sha256=aGtwQQSmKHGBMg9w8R-YnlKMKvuhEPo9TBhezkO8dMg,270
78
81
  tests/resources/test_file_batches.py,sha256=xcVeWZns4j3_RPZEv8W1Ws4-bcaxOXTQzFyUpKGVmxM,981
79
82
  tests/resources/test_files.py,sha256=2VSlvYnGHrw--mYNvA6hlpEw-olbW_Hlq2d4vdn8v7M,961
80
83
  tests/resources/test_identities.py,sha256=0osumiLrzKkGG4XLlL4nIdSp_nGutHaPf55w_IVREps,454
@@ -84,6 +87,7 @@ tests/resources/test_kyc_validations.py,sha256=Cn_aiGUNSWFrptTQtgS8HhbK-50QEq_Qo
84
87
  tests/resources/test_limited_wallets.py,sha256=c0zDDOip3lJk8chbcGr_nWCdkO9yuL_HbD1IikR5jH4,527
85
88
  tests/resources/test_login_tokens.py,sha256=kn0gXFOanIXjgKjbeOzfNyKsGAUkc2iKnuVmzIRaMD8,572
86
89
  tests/resources/test_otps.py,sha256=IpCczDNRL_WaWwc1rYbSRmtWMR7GMa-Pfbq2TZcZQDw,616
90
+ tests/resources/test_phone_verification_association.py,sha256=ZYzXYJbYVjlb2KqeE6vDhmkrbYO3aq07gl5nvpdcA_0,375
87
91
  tests/resources/test_platforms.py,sha256=5b6-XC3uAz8GARFkFoanH62jxE1uJIMXcdpeUhmI8Kg,211
88
92
  tests/resources/test_postal_codes.py,sha256=LnP_6wRxlpsl3zmWoyCmqyA7Wa5pUxNgSyfP1rmwSiY,408
89
93
  tests/resources/test_questionnaires.py,sha256=Sl8YHXgL42xiijUncycOUzGu5MtI3jEnhADS8Nol6N8,321
@@ -98,11 +102,12 @@ tests/resources/test_user_events.py,sha256=aPTyrEVF7jBD8-UQZeVOLbUmj9sni0JRCYgoo
98
102
  tests/resources/test_user_lists_validation.py,sha256=sZkjCYkySbWtOxM9NVSzZHaoOhXS7N0XD4buD3dke5E,1196
99
103
  tests/resources/test_user_logins.py,sha256=YLIZiFsR9tBv1fNH-lIpIMtvGY_7NHGQpMBFVuEFj6c,988
100
104
  tests/resources/test_users.py,sha256=op6c6uTweJQtD8OkE_vUUxTMqIC2UrncTwt-B6YO0Qc,3256
105
+ tests/resources/test_users_tos_agreements.py,sha256=s4Gt36KLi3fjVtVzV9vhi6VF94QzbB_Ut0HDj9Zvj7Q,272
101
106
  tests/resources/test_verifications.py,sha256=bBXR-pkmrs-_MekKo9iJS4TDkSyqZ65crsrcqVZs4FQ,1591
102
107
  tests/resources/test_wallet_transactions.py,sha256=_L2hjPHT4FwwhxksUoaoVHwFFYOGWfF4ScCbk0kb7Hw,3945
103
108
  tests/resources/test_webhooks.py,sha256=nYCqAnlNJcMJKRHhgoHOWTQnFLWQHHvFyY8GVCxGTD8,328
104
109
  tests/resources/test_whatsapp_transfers.py,sha256=4Dmrsbytx7LRrLQo9M8TAL7cGKJufPStkp51UdRCnYU,1030
105
- cuenca-2.1.6.dev3.dist-info/METADATA,sha256=xeU1qPfVwAS4cCzcs_XYVIE3qg_gEkrWZmv4O-mFNNw,4988
106
- cuenca-2.1.6.dev3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
107
- cuenca-2.1.6.dev3.dist-info/top_level.txt,sha256=5h3K7XJTmJniDloPq4sIJHni_xLw-Uoc6ZJ5mcw_lZY,13
108
- cuenca-2.1.6.dev3.dist-info/RECORD,,
110
+ cuenca-2.1.7.dist-info/METADATA,sha256=dV0NW-curvKWhRFIYXhbqff72T7A2Z2UoTzzNYEH0AY,4983
111
+ cuenca-2.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
112
+ cuenca-2.1.7.dist-info/top_level.txt,sha256=5h3K7XJTmJniDloPq4sIJHni_xLw-Uoc6ZJ5mcw_lZY,13
113
+ cuenca-2.1.7.dist-info/RECORD,,
@@ -0,0 +1,11 @@
1
+ import pytest
2
+
3
+ from cuenca import ExistPhones
4
+
5
+
6
+ @pytest.mark.vcr
7
+ def test_exist_phone_retrieve():
8
+ phone_number = '+527331256958'
9
+ exist_phone: ExistPhones = ExistPhones.retrieve(phone_number)
10
+ assert exist_phone.id == phone_number
11
+ assert exist_phone.exist
@@ -0,0 +1,13 @@
1
+ import pytest
2
+
3
+ from cuenca import PhoneVerificationAssociations
4
+
5
+
6
+ @pytest.mark.vcr
7
+ def test_phone_verification_association_create():
8
+
9
+ phone_verification_association = PhoneVerificationAssociations.create(
10
+ verification_id='VEeCjasQQWQM-Hr-odTGoKoQ',
11
+ )
12
+ assert phone_verification_association.verification_id
13
+ assert phone_verification_association.user_id
@@ -0,0 +1,12 @@
1
+ import pytest
2
+
3
+ from cuenca.resources import UserTOSAgreement
4
+
5
+
6
+ @pytest.mark.vcr
7
+ def test_user_tos_agreements_create() -> None:
8
+ tos = UserTOSAgreement.create(
9
+ location="9.3953792,-99.139584",
10
+ tos_id="TS67f5bf03c1fc891bdf36090d",
11
+ )
12
+ assert tos.id