cuenca 2.1.6.dev2__py3-none-any.whl → 2.1.6.dev4__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.
@@ -1,5 +1,5 @@
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 import TermsOfService as TermsOfServiceEnum
5
5
 
@@ -11,6 +11,6 @@ class TermsOfService(Retrievable, Queryable):
11
11
 
12
12
  id: str
13
13
  created_at: dt.datetime
14
- deactivated_at: dt.datetime | None
14
+ deactivated_at: Optional[dt.datetime] = None
15
15
  type: TermsOfServiceEnum
16
16
  version: str
@@ -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.dev2'
1
+ __version__ = '2.1.6.dev4'
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.dev2
3
+ Version: 2.1.6.dev4
4
4
  Summary: Cuenca API Client
5
5
  Home-page: https://github.com/cuenca-mx/cuenca-python
6
6
  Author: Cuenca
@@ -2,7 +2,7 @@ cuenca/__init__.py,sha256=glrCEfdQ7vemadixSdLY3kQLYU4K4o-mQwKkmBRydK0,1870
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=5Z7KYpI_h4WwpIv8nm8w6NDuDsqy5QeqtoWwYwSKdOc,83
5
+ cuenca/version.py,sha256=_nKlLQzDt31d3Gh6-E1n4pOKtUqercsobQhBUvTgbhs,83
6
6
  cuenca/http/__init__.py,sha256=V5TG6Ro9d3VY7umzcbtanmvHlGkv-k71H0tqrdMyH-s,49
7
7
  cuenca/http/client.py,sha256=psXJiSgd3SUSJ5jwvhdBWsVMNadenG353BNVXdh7HMY,4168
8
8
  cuenca/resources/__init__.py,sha256=RVdGFW-0dqa94obH-NxGVw5zd7DJXgUz49rSZiUYCiI,3249
@@ -39,19 +39,19 @@ cuenca/resources/savings.py,sha256=3DBP1ygxhcScDpLvAQS_fF5chljyDTz4xwnltI0LCAg,1
39
39
  cuenca/resources/service_providers.py,sha256=x-FNcyiUkdUsNCGudyLGYDbRkD2jPj8-T8U3IumxTVQ,310
40
40
  cuenca/resources/sessions.py,sha256=lWphgjG9SZl81ik7c9tuAI6OE4JUOF0ZfRBvmf4vwyQ,1764
41
41
  cuenca/resources/statements.py,sha256=PqMvhoE9cvBneXjaS7w4JnTzYdDakkCkbdNYrd7b8LI,282
42
- cuenca/resources/terms_of_service.py,sha256=bKbDieQDCj496u3RfUS9o2Qxd9zb0N0QDni740qPcf8,386
42
+ cuenca/resources/terms_of_service.py,sha256=jaYN7NAxgxR9t0MlExL4bRt9HDunb53Y8bCCZO01mKg,406
43
43
  cuenca/resources/transfers.py,sha256=v742SAGUIZfvYHfCNtk0hSm2uyhMGh00RbHIIJiqLzQ,3201
44
44
  cuenca/resources/user_credentials.py,sha256=glpxUa5-aYhgJ1ZG1g_c1PAWaQ9eEWP01lauBaccSQQ,1356
45
45
  cuenca/resources/user_events.py,sha256=L57v7clStwxyJX2vwe-357uRTrzeQglDpCCgXRg7v9Y,728
46
46
  cuenca/resources/user_lists_validation.py,sha256=UrInfZRUVd4nODBIBOTH8ALEZ3pvdYS2_xfFR7UeNrc,1595
47
47
  cuenca/resources/user_logins.py,sha256=KDauv2c5BJUR-C5ZeIjAPsv-8VH11BhoT-wCU9KgrwY,1542
48
48
  cuenca/resources/users.py,sha256=3qb0-_3KBQCooqFUrknQ28ywU2v7s4JMudrd65z5Q-0,6321
49
- cuenca/resources/users_tos_agreements.py,sha256=zLWEVttFipz_8Vh9YeNo68VLrWugy-Ob5ENFSVAAeTs,518
49
+ cuenca/resources/users_tos_agreements.py,sha256=bZiVuobGfLlxwlIyoiA9Izdo4KiUlxJyBffp9Y2NYYU,1250
50
50
  cuenca/resources/verifications.py,sha256=c90Pyd20EXLA5Wy0C1RABxjjivMB--q6yu6uK-R8aNA,1607
51
51
  cuenca/resources/wallet_transactions.py,sha256=8ePZI3-GaEd658GPYizAfHK9GVwlkt1r95-mEb7T3Jg,1030
52
52
  cuenca/resources/webhooks.py,sha256=bGjuvkSP3GXo4Q6v8iZ40Md8xc4AQrEmAD3r40VJqxM,392
53
53
  cuenca/resources/whatsapp_transfers.py,sha256=YSL606FBOMGKjhyKK5TiF0di96zdDKoiVtjiz_Zl_ZI,902
54
- cuenca-2.1.6.dev2.dist-info/licenses/LICENSE,sha256=aWv5PmUiAcNENEAdghcVQSeU56pXJHWexJYgklK9XLg,1063
54
+ cuenca-2.1.6.dev4.dist-info/licenses/LICENSE,sha256=aWv5PmUiAcNENEAdghcVQSeU56pXJHWexJYgklK9XLg,1063
55
55
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
56
  tests/conftest.py,sha256=O8GhZPxJenGV_O-DMoXGl3xJImkHBOuXYV3DJDGngzc,1904
57
57
  tests/test_cuenca.py,sha256=aeha_utz9YiHQg6eJK2PB7g66pVUYFi9U6pYMGXDKvk,1628
@@ -98,11 +98,12 @@ tests/resources/test_user_events.py,sha256=aPTyrEVF7jBD8-UQZeVOLbUmj9sni0JRCYgoo
98
98
  tests/resources/test_user_lists_validation.py,sha256=sZkjCYkySbWtOxM9NVSzZHaoOhXS7N0XD4buD3dke5E,1196
99
99
  tests/resources/test_user_logins.py,sha256=YLIZiFsR9tBv1fNH-lIpIMtvGY_7NHGQpMBFVuEFj6c,988
100
100
  tests/resources/test_users.py,sha256=op6c6uTweJQtD8OkE_vUUxTMqIC2UrncTwt-B6YO0Qc,3256
101
+ tests/resources/test_users_tos_agreements.py,sha256=R4RjjqiU4UY7N5yLU7leJ7-CiOT4CDSFMXJzjaUVjeY,288
101
102
  tests/resources/test_verifications.py,sha256=bBXR-pkmrs-_MekKo9iJS4TDkSyqZ65crsrcqVZs4FQ,1591
102
103
  tests/resources/test_wallet_transactions.py,sha256=_L2hjPHT4FwwhxksUoaoVHwFFYOGWfF4ScCbk0kb7Hw,3945
103
104
  tests/resources/test_webhooks.py,sha256=nYCqAnlNJcMJKRHhgoHOWTQnFLWQHHvFyY8GVCxGTD8,328
104
105
  tests/resources/test_whatsapp_transfers.py,sha256=4Dmrsbytx7LRrLQo9M8TAL7cGKJufPStkp51UdRCnYU,1030
105
- cuenca-2.1.6.dev2.dist-info/METADATA,sha256=OWmAjz06lLQlbm6PEDOcCq2Y41wig6xx2ggAcvDjSp4,4988
106
- cuenca-2.1.6.dev2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
107
- cuenca-2.1.6.dev2.dist-info/top_level.txt,sha256=5h3K7XJTmJniDloPq4sIJHni_xLw-Uoc6ZJ5mcw_lZY,13
108
- cuenca-2.1.6.dev2.dist-info/RECORD,,
106
+ cuenca-2.1.6.dev4.dist-info/METADATA,sha256=7PzTYyJ-9OMmRl0fOrpqf45sURBGo_LKQhQoXTfyvH4,4988
107
+ cuenca-2.1.6.dev4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
108
+ cuenca-2.1.6.dev4.dist-info/top_level.txt,sha256=5h3K7XJTmJniDloPq4sIJHni_xLw-Uoc6ZJ5mcw_lZY,13
109
+ cuenca-2.1.6.dev4.dist-info/RECORD,,
@@ -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():
8
+ tos = UserTOSAgreement.create(
9
+ location=dict(latitude=9.3953792, longitude=-99.139584),
10
+ tos_id="TS67f5bf03c1fc891bdf36090d",
11
+ )
12
+ assert tos.id