Skip to content

Commit 564a5f1

Browse files
authored
Merge pull request #257 from plivo/SMS-6606
SMS-6606: OTP optional param added for create and validate session
2 parents d48b36d + aa24e42 commit 564a5f1

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Change Log
2+
## [4.48.0](https://github.com/plivo/plivo-python/tree/v4.48.0) (2024-02-12)
3+
**Custom Verify OTP - Added new optional param 'otp' for Create Session and made 'otp' param optional for Validate Session**
4+
25
## [4.47.2](https://github.com/plivo/plivo-python/tree/v4.47.2) (2024-01-25)
36
**Added new params 'create_mpc_with_single_participant' for Add Participant API of MPC**
47

plivo/resources/verify.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ class Sessions(PlivoResourceInterface):
2222

2323
@validate_args(
2424
app_uuid=[optional(of_type(six.text_type))],
25+
otp=[optional(of_type(six.text_type))],
2526
recipient=[required(is_phonenumber())],
2627
channel=[optional(all_of(of_type(six.text_type), is_in(('sms', 'voice'))))],
2728
url=[optional(is_url())],
2829
method=[optional(of_type(six.text_type))])
2930
def create(self,
3031
app_uuid=None,
32+
otp=None,
3133
recipient=None,
3234
channel=None,
3335
url=None,
@@ -91,8 +93,6 @@ def list(self,
9193
session_uuid=[of_type(six.text_type)]
9294
)
9395
def validate(self, session_uuid, otp=None):
94-
if otp is None:
95-
raise ValidationError('otp is required')
9696
return self.client.request('POST', ('Verify', 'Session', session_uuid),
9797
to_param_dict(self.validate, locals()))
9898

plivo/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# -*- coding: utf-8 -*-
2-
__version__ = '4.47.2'
2+
__version__ = '4.48.0'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name='plivo',
13-
version='4.47.2',
13+
version='4.48.0',
1414
description='A Python SDK to make voice calls & send SMS using Plivo and to generate Plivo XML',
1515
long_description=long_description,
1616
url='https://github.com/plivo/plivo-python',

tests/resources/test_verify.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,3 @@ def test_validate(self):
6161
self.assertEqual(test_session.message,
6262
expected_response['message'])
6363

64-
def test_validate_without_otp(self):
65-
self.assertRaises(
66-
exceptions.ValidationError,
67-
self.client.verify_session.validate,
68-
session_uuid='1234567'
69-
)

0 commit comments

Comments
 (0)