cuenca 2.0.0.dev7__py3-none-any.whl → 2.0.1__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,11 +1,12 @@
1
1
  from typing import ClassVar, Optional
2
2
 
3
3
  from cuenca_validations.types.enums import WebhookEvent
4
+ from cuenca_validations.types.general import SerializableHttpUrl
4
5
  from cuenca_validations.types.requests import (
5
6
  EndpointRequest,
6
7
  EndpointUpdateRequest,
7
8
  )
8
- from pydantic import ConfigDict, Field, HttpUrl
9
+ from pydantic import ConfigDict, Field
9
10
 
10
11
  from ..http import Session, session as global_session
11
12
  from .base import Creatable, Deactivable, Queryable, Retrievable, Updateable
@@ -14,7 +15,7 @@ from .base import Creatable, Deactivable, Queryable, Retrievable, Updateable
14
15
  class Endpoint(Creatable, Deactivable, Retrievable, Queryable, Updateable):
15
16
  _resource: ClassVar = 'endpoints'
16
17
 
17
- url: HttpUrl = Field(description='HTTPS url to send webhooks')
18
+ url: SerializableHttpUrl = Field(description='HTTPS url to send webhooks')
18
19
  secret: str = Field(
19
20
  description='token to verify the webhook is sent by Cuenca '
20
21
  'using HMAC algorithm',
@@ -51,7 +52,7 @@ class Endpoint(Creatable, Deactivable, Retrievable, Queryable, Updateable):
51
52
  @classmethod
52
53
  def create(
53
54
  cls,
54
- url: HttpUrl,
55
+ url: SerializableHttpUrl,
55
56
  events: Optional[list[WebhookEvent]] = None,
56
57
  *,
57
58
  session: Session = global_session,
@@ -72,7 +73,7 @@ class Endpoint(Creatable, Deactivable, Retrievable, Queryable, Updateable):
72
73
  def update(
73
74
  cls,
74
75
  endpoint_id: str,
75
- url: Optional[HttpUrl] = None,
76
+ url: Optional[SerializableHttpUrl] = None,
76
77
  events: Optional[list[WebhookEvent]] = None,
77
78
  is_enable: Optional[bool] = None,
78
79
  *,
cuenca/resources/files.py CHANGED
@@ -2,7 +2,7 @@ from io import BytesIO
2
2
  from typing import ClassVar, Optional
3
3
 
4
4
  from cuenca_validations.types import FileQuery, FileUploadRequest, KYCFileType
5
- from pydantic import HttpUrl
5
+ from cuenca_validations.types.general import SerializableHttpUrl
6
6
 
7
7
  from ..http import Session, session as global_session
8
8
  from .base import Downloadable, Queryable, Uploadable
@@ -14,7 +14,7 @@ class File(Downloadable, Queryable, Uploadable):
14
14
 
15
15
  extension: str
16
16
  type: KYCFileType
17
- url: HttpUrl
17
+ url: SerializableHttpUrl
18
18
  user_id: str
19
19
 
20
20
  @classmethod
@@ -2,7 +2,8 @@ import datetime as dt
2
2
  from typing import ClassVar, Optional
3
3
 
4
4
  from cuenca_validations.types import SessionRequest, SessionType
5
- from pydantic import AnyUrl, ConfigDict
5
+ from cuenca_validations.types.general import SerializableAnyUrl
6
+ from pydantic import ConfigDict
6
7
 
7
8
  from .. import http
8
9
  from .base import Creatable, Queryable, Retrievable
@@ -16,8 +17,8 @@ class Session(Creatable, Retrievable, Queryable):
16
17
  user_id: str
17
18
  platform_id: str
18
19
  expires_at: dt.datetime
19
- success_url: Optional[AnyUrl] = None
20
- failure_url: Optional[AnyUrl] = None
20
+ success_url: Optional[SerializableAnyUrl] = None
21
+ failure_url: Optional[SerializableAnyUrl] = None
21
22
  type: Optional[SessionType] = None
22
23
 
23
24
  model_config = ConfigDict(
@@ -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 cls._create(**req.model_dump(), session=session)
28
+ data = req.model_dump()
29
+ data['password'] = data['password'].get_secret_value()
30
+ return cls._create(**data, session=session)
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 cls._update(id=user_id, **req.model_dump(), session=session)
45
+ data = req.model_dump()
46
+ if password:
47
+ data['password'] = data['password'].get_secret_value()
48
+ return cls._update(id=user_id, **data, session=session)
cuenca/resources/users.py CHANGED
@@ -15,8 +15,9 @@ from cuenca_validations.types import (
15
15
  UserUpdateRequest,
16
16
  )
17
17
  from cuenca_validations.types.enums import Country, Gender, State
18
+ from cuenca_validations.types.general import SerializableHttpUrl
18
19
  from cuenca_validations.types.identities import Curp
19
- from pydantic import ConfigDict, EmailStr, Field, HttpUrl
20
+ from pydantic import ConfigDict, EmailStr, Field
20
21
 
21
22
  from ..http import Session, session as global_session
22
23
  from .balance_entries import BalanceEntry
@@ -147,7 +148,7 @@ class User(Creatable, Retrievable, Updateable, Queryable):
147
148
  status: Optional[UserStatus] = None,
148
149
  email_verification_id: Optional[str] = None,
149
150
  phone_verification_id: Optional[str] = None,
150
- curp_document: Optional[HttpUrl] = None,
151
+ curp_document: Optional[SerializableHttpUrl] = None,
151
152
  *,
152
153
  session: Session = global_session,
153
154
  ) -> 'User':
cuenca/version.py CHANGED
@@ -1,3 +1,3 @@
1
- __version__ = '2.0.0.dev7'
1
+ __version__ = '2.0.1'
2
2
  CLIENT_VERSION = __version__
3
3
  API_VERSION = '2020-03-19'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cuenca
3
- Version: 2.0.0.dev7
3
+ Version: 2.0.1
4
4
  Summary: Cuenca API Client
5
5
  Home-page: https://github.com/cuenca-mx/cuenca-python
6
6
  Author: Cuenca
@@ -16,7 +16,7 @@ Requires-Python: >=3.9
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
18
  Requires-Dist: requests>=2.32.0
19
- Requires-Dist: cuenca-validations>=2.0.0
19
+ Requires-Dist: cuenca-validations>=2.0.4
20
20
  Requires-Dist: pydantic-extra-types>=2.10.0
21
21
  Dynamic: author
22
22
  Dynamic: author-email
@@ -2,7 +2,7 @@ cuenca/__init__.py,sha256=Lqmi5MUI4WQ1HWGTQOlpfh0Y3ujvJJ3vsvhBR2CPTno,1760
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=chP36FkWzoNW7ka8aLLmRGqMpLTYF21JFjxOWYAIrXQ,83
5
+ cuenca/version.py,sha256=LjAvLwkqP0l1E6xo-ybP-kwTeliGgEy8G_pZixj2NPI,78
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=pySyBur3jnWA5yfHFuVZfdnk6nROj3BsLRy7vVWXFoc,3019
@@ -21,9 +21,9 @@ cuenca/resources/clabes.py,sha256=mIWnOXLpUQMBRlhaoY5xv0vQXRnZz9basMD99RbUXuc,37
21
21
  cuenca/resources/commissions.py,sha256=Fz5kHq7FPJl8Z0qiu5_z-Ws2jEPqGi1x2OOwXCCM-Yw,513
22
22
  cuenca/resources/curp_validations.py,sha256=LWJcu1ccoc6_t9ky0t8xqWepdpWSrUYIjW6a_8xJ_Rs,3506
23
23
  cuenca/resources/deposits.py,sha256=8FINQJ3c0Zg8FAq7e1JZu9i8G40fX-Kmawhl7Ouxpx4,566
24
- cuenca/resources/endpoints.py,sha256=121fGkJnb-xcv98hmMJSGqBMeqLSKu4zp-jSguo5RE4,3143
24
+ cuenca/resources/endpoints.py,sha256=AhrG8O6-6rtjtA9Ll98nmxq7xxiLkrKHR7XXZ59PGSs,3235
25
25
  cuenca/resources/file_batches.py,sha256=2Fsmz8ryOjvLn3dpsyR0G2iS0zNVR4ajovNkaMZaHaM,786
26
- cuenca/resources/files.py,sha256=neEo7TOw0M_FMeXd30UqAv-L54D3uMA8zczETzEWtKs,1789
26
+ cuenca/resources/files.py,sha256=WZYRo76fIGXNXk2HzA252dSdIdA4bl3EjB6q0bb6BFg,1837
27
27
  cuenca/resources/identities.py,sha256=IdL495eTjx_2gDRxM9oG_QmDNOwaY7Nv9gzqeZu_Wdk,1092
28
28
  cuenca/resources/identity_events.py,sha256=K1G6IEGlw6n482nZhBo_CJNBdpKFCO6duMQr5y9k4x8,374
29
29
  cuenca/resources/kyc_validations.py,sha256=1G_dr6e1mpLUlqT9RmBgiC06eh0vQjMzosM5w3ZCQoE,1322
@@ -36,14 +36,14 @@ cuenca/resources/questionnaires.py,sha256=TKICPHghEhER83byMhe75Wb798K5veqv47RafY
36
36
  cuenca/resources/resources.py,sha256=sDkVwN-RguyoQXJhSYCa95Cem1AUmcgMJeFJveVf6Q0,912
37
37
  cuenca/resources/savings.py,sha256=3DBP1ygxhcScDpLvAQS_fF5chljyDTz4xwnltI0LCAg,1433
38
38
  cuenca/resources/service_providers.py,sha256=x-FNcyiUkdUsNCGudyLGYDbRkD2jPj8-T8U3IumxTVQ,310
39
- cuenca/resources/sessions.py,sha256=eYb5jI7linDAG-mlOe8YE1PJ6Of5kK--pz6FAwK7mV4,1602
39
+ cuenca/resources/sessions.py,sha256=Enc8VVIjl9-2CHNxPac_QAc_TfE5x6oFFIEtLzoXPcU,1682
40
40
  cuenca/resources/statements.py,sha256=PqMvhoE9cvBneXjaS7w4JnTzYdDakkCkbdNYrd7b8LI,282
41
41
  cuenca/resources/transfers.py,sha256=v742SAGUIZfvYHfCNtk0hSm2uyhMGh00RbHIIJiqLzQ,3201
42
- cuenca/resources/user_credentials.py,sha256=eXjnXF3skklRF6SpAAv6c3ZXLnz61nbbhyds938dSkE,1165
42
+ cuenca/resources/user_credentials.py,sha256=glpxUa5-aYhgJ1ZG1g_c1PAWaQ9eEWP01lauBaccSQQ,1356
43
43
  cuenca/resources/user_events.py,sha256=L57v7clStwxyJX2vwe-357uRTrzeQglDpCCgXRg7v9Y,728
44
44
  cuenca/resources/user_lists_validation.py,sha256=eOADDHKg-RthgeO50Edh4VQtQcNl2tHvdmXMYuGpsCA,1275
45
45
  cuenca/resources/user_logins.py,sha256=G78OPnxiOd4AVdBsk6UkEH2za-k3IPghRklTiElHYcc,1411
46
- cuenca/resources/users.py,sha256=RNrh6-_0aqde_-7LAA50a3fwE3krKqu1PQh0Cn_8iUE,6253
46
+ cuenca/resources/users.py,sha256=3qb0-_3KBQCooqFUrknQ28ywU2v7s4JMudrd65z5Q-0,6321
47
47
  cuenca/resources/verifications.py,sha256=YyvSh5IpiJ02lHK8k-guTwoHSFoaMYSFk1aC2tPi7n0,1680
48
48
  cuenca/resources/wallet_transactions.py,sha256=8ePZI3-GaEd658GPYizAfHK9GVwlkt1r95-mEb7T3Jg,1030
49
49
  cuenca/resources/webhooks.py,sha256=bGjuvkSP3GXo4Q6v8iZ40Md8xc4AQrEmAD3r40VJqxM,392
@@ -88,7 +88,7 @@ tests/resources/test_service_providers.py,sha256=yhjTvRdVaTpwEHLVtvX8OD6bMef2W9w
88
88
  tests/resources/test_sessions.py,sha256=t9ljOiTbtrkpf_zh15LomK_JkJJDy8q8SdiVLw2pZ2k,1275
89
89
  tests/resources/test_statements.py,sha256=e9S_yn5kD6M8IpfpRmIOJ0Y6aggBkYWQxynY6P7Q7nI,370
90
90
  tests/resources/test_transfers.py,sha256=bW3igYOdYPDiZtLr8WVIYwfP-dV4sdJ9pbaXFps2ac8,4161
91
- tests/resources/test_user_credentials.py,sha256=WbK20aprlT3P_IEOwplvhIYnLfTgGhK3Q3Tu6Tf129c,809
91
+ tests/resources/test_user_credentials.py,sha256=pJkIMIN4yMkj7AlaBMjI-e2O1YIoFWAh4r9C489GT7s,815
92
92
  tests/resources/test_user_events.py,sha256=aPTyrEVF7jBD8-UQZeVOLbUmj9sni0JRCYgootmaQ8c,292
93
93
  tests/resources/test_user_lists_validation.py,sha256=-aHXS13o6mqbDsiWlprfyWzPbhMK3s0Qvk0G0zAhUfA,711
94
94
  tests/resources/test_user_logins.py,sha256=YLIZiFsR9tBv1fNH-lIpIMtvGY_7NHGQpMBFVuEFj6c,988
@@ -97,8 +97,8 @@ tests/resources/test_verifications.py,sha256=yyL-bdryQU3MvqnmAgnnzGG9t7UTxWwPiVu
97
97
  tests/resources/test_wallet_transactions.py,sha256=_L2hjPHT4FwwhxksUoaoVHwFFYOGWfF4ScCbk0kb7Hw,3945
98
98
  tests/resources/test_webhooks.py,sha256=nYCqAnlNJcMJKRHhgoHOWTQnFLWQHHvFyY8GVCxGTD8,328
99
99
  tests/resources/test_whatsapp_transfers.py,sha256=4Dmrsbytx7LRrLQo9M8TAL7cGKJufPStkp51UdRCnYU,1030
100
- cuenca-2.0.0.dev7.dist-info/LICENSE,sha256=aWv5PmUiAcNENEAdghcVQSeU56pXJHWexJYgklK9XLg,1063
101
- cuenca-2.0.0.dev7.dist-info/METADATA,sha256=6n9pj2QpAMWwwxS3xbm4Y05F8MSo_9rnLwl1iAQnZjk,4966
102
- cuenca-2.0.0.dev7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
103
- cuenca-2.0.0.dev7.dist-info/top_level.txt,sha256=5h3K7XJTmJniDloPq4sIJHni_xLw-Uoc6ZJ5mcw_lZY,13
104
- cuenca-2.0.0.dev7.dist-info/RECORD,,
100
+ cuenca-2.0.1.dist-info/LICENSE,sha256=aWv5PmUiAcNENEAdghcVQSeU56pXJHWexJYgklK9XLg,1063
101
+ cuenca-2.0.1.dist-info/METADATA,sha256=rzBCl4HwBPVT7nMPJEUj62XJIEF4P6AhdzUFjB8AbZU,4961
102
+ cuenca-2.0.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
103
+ cuenca-2.0.1.dist-info/top_level.txt,sha256=5h3K7XJTmJniDloPq4sIJHni_xLw-Uoc6ZJ5mcw_lZY,13
104
+ cuenca-2.0.1.dist-info/RECORD,,
@@ -7,9 +7,9 @@ from cuenca.http import Session
7
7
 
8
8
  @pytest.mark.vcr
9
9
  def test_update_password():
10
- UserCredential.create('222222')
11
- UserLogin.create('222222')
12
- UserCredential.update(password='111111')
10
+ UserCredential.create('22222222')
11
+ UserLogin.create('22222222')
12
+ UserCredential.update(password='11111111')
13
13
 
14
14
 
15
15
  @pytest.mark.vcr