Skip to content

Commit 0c31166

Browse files
committed
Refactor Verification class to remove platform_id parameter
1 parent e4f5cd4 commit 0c31166

File tree

7 files changed

+21
-49
lines changed

7 files changed

+21
-49
lines changed

cuenca/resources/verifications.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,9 @@ def create(
3939
cls,
4040
recipient: str,
4141
type: VerificationType,
42-
platform_id: str,
4342
session: Session = global_session,
4443
) -> 'Verification':
45-
req = VerificationRequest(
46-
recipient=recipient, type=type, platform_id=platform_id
47-
)
44+
req = VerificationRequest(recipient=recipient, type=type)
4845
return cls._create(**req.model_dump(), session=session)
4946

5047
@classmethod

cuenca/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = '2.1.5'
1+
__version__ = '2.1.6.dev1'
22
CLIENT_VERSION = __version__
33
API_VERSION = '2020-03-19'

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
requests==2.32.3
2-
cuenca-validations==2.1.8
2+
cuenca-validations==2.1.10
33
pydantic-extra-types==2.10.2

tests/resources/cassettes/test_verification_email_create.yaml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,20 @@
11
interactions:
22
- request:
3-
body: '{"type": "email", "sender": "mail@cuenca.com", "platform_id":
4-
"PL01"}'
3+
body: '{"type": "email", "recipient": "mail@cuenca.com"}'
54
headers:
6-
Accept:
7-
- '*/*'
8-
Accept-Encoding:
9-
- gzip, deflate
10-
Authorization:
11-
- DUMMY
12-
Connection:
13-
- keep-alive
145
Content-Length:
15-
- '82'
6+
- '49'
167
Content-Type:
178
- application/json
189
User-Agent:
19-
- cuenca-python/0.8.0.dev0
10+
- cuenca-python/2.1.5
2011
X-Cuenca-Api-Version:
2112
- '2020-03-19'
2213
method: POST
2314
uri: https://sandbox.cuenca.com/verifications
2415
response:
2516
body:
26-
string: '{"id":"VE01","recipient":"mail@cuenca.com","platform_id":"PL01","api_key":null,"type":"email","created_at":"2022-03-16T22:33:21.930707","updated_at":"2022-03-16T22:33:21.931013","deactivated_at":null}'
17+
string: '{"id":"VEG30ywu-KQnWdel9gpz1a-Q","identity_id":null,"platform_id":"PTZbBlk__kQt-wfwzP5nwA9A","created_at":"2025-07-15T22:28:11.987007","updated_at":"2025-07-15T22:28:11.987284","deactivated_at":null,"recipient":"mail@cuenca.com","language":"en","type":"email"}'
2718
headers:
2819
Connection:
2920
- keep-alive
@@ -32,21 +23,19 @@ interactions:
3223
Content-Type:
3324
- application/json
3425
Date:
35-
- Wed, 16 Mar 2022 22:33:22 GMT
36-
X-Request-Time:
37-
- 'value: 0.323'
26+
- Tue, 15 Jul 2025 22:28:12 GMT
3827
x-amz-apigw-id:
39-
- PGTTzHY-iYcF1zQ=
28+
- NxZfaEnciYcEr9g=
4029
x-amzn-Remapped-Connection:
4130
- keep-alive
4231
x-amzn-Remapped-Content-Length:
4332
- '260'
4433
x-amzn-Remapped-Date:
45-
- Wed, 16 Mar 2022 22:33:22 GMT
34+
- Tue, 15 Jul 2025 22:28:12 GMT
4635
x-amzn-Remapped-Server:
47-
- nginx/1.20.2
36+
- nginx/1.28.0
4837
x-amzn-RequestId:
49-
- 1403b526-7466-4985-bf8a-b8e6c156e527
38+
- 2fe363d1-fc8d-4fd5-ba59-e41a88c08711
5039
status:
5140
code: 201
5241
message: Created

tests/resources/cassettes/test_verification_phone_create.yaml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,20 @@
11
interactions:
22
- request:
3-
body: '{"type": "phone", "sender": "+525555555555", "platform_id":
4-
"PL01"}'
3+
body: '{"type": "phone", "recipient": "+525555555555"}'
54
headers:
6-
Accept:
7-
- '*/*'
8-
Accept-Encoding:
9-
- gzip, deflate
10-
Authorization:
11-
- DUMMY
12-
Connection:
13-
- keep-alive
145
Content-Length:
15-
- '80'
6+
- '47'
167
Content-Type:
178
- application/json
189
User-Agent:
19-
- cuenca-python/0.8.0.dev0
10+
- cuenca-python/2.1.5
2011
X-Cuenca-Api-Version:
2112
- '2020-03-19'
2213
method: POST
2314
uri: https://sandbox.cuenca.com/verifications
2415
response:
2516
body:
26-
string: '{"id":"VE02","recipient":"+525555555555","platform_id":"PL01","api_key":null,"type":"phone","created_at":"2022-03-16T22:33:22.657205","updated_at":"2022-03-16T22:33:22.657613","deactivated_at":null}'
17+
string: '{"id":"VEPsf1IUMGT-C0bSFIvPZ17Q","identity_id":null,"platform_id":"PTZbBlk__kQt-wfwzP5nwA9A","created_at":"2025-07-15T22:31:24.231812","updated_at":"2025-07-15T22:31:24.232089","deactivated_at":null,"recipient":"+525555555555","language":"en","type":"phone"}'
2718
headers:
2819
Connection:
2920
- keep-alive
@@ -32,21 +23,19 @@ interactions:
3223
Content-Type:
3324
- application/json
3425
Date:
35-
- Wed, 16 Mar 2022 22:33:22 GMT
36-
X-Request-Time:
37-
- 'value: 0.285'
26+
- Tue, 15 Jul 2025 22:31:24 GMT
3827
x-amz-apigw-id:
39-
- PGTT7EO2CYcFQ_w=
28+
- NxZ9dHQeiYcEYyw=
4029
x-amzn-Remapped-Connection:
4130
- keep-alive
4231
x-amzn-Remapped-Content-Length:
4332
- '258'
4433
x-amzn-Remapped-Date:
45-
- Wed, 16 Mar 2022 22:33:22 GMT
34+
- Tue, 15 Jul 2025 22:31:24 GMT
4635
x-amzn-Remapped-Server:
47-
- nginx/1.20.2
36+
- nginx/1.28.0
4837
x-amzn-RequestId:
49-
- 7be1235d-09b6-4bc2-b1d9-93b96ac66519
38+
- 742a0869-1f8f-487e-9e8c-bed92bb9a923
5039
status:
5140
code: 201
5241
message: Created

tests/resources/test_users.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def test_user_update_user_email_from_verification():
8383
ver = Verification.create(
8484
recipient='mail@cuenca.com',
8585
type=VerificationType.email,
86-
platform_id='PL01',
8786
)
8887
user = User.update(user_id, email_verification_id=ver.id)
8988
assert user.to_dict()['email_address'] == ver.recipient

tests/resources/test_verifications.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ def test_verification_email_create():
1010
verification: Verification = Verification.create(
1111
recipient='mail@cuenca.com',
1212
type=VerificationType.email,
13-
platform_id='PL01',
1413
)
1514
assert verification.id
1615

@@ -20,7 +19,6 @@ def test_verification_phone_create():
2019
verification: Verification = Verification.create(
2120
recipient='+525555555555',
2221
type=VerificationType.phone,
23-
platform_id='PL01',
2422
)
2523
assert verification.id
2624

0 commit comments

Comments
 (0)