From f8093c562c9186756be146006784aab1f828a165 Mon Sep 17 00:00:00 2001 From: ajay-plivo Date: Mon, 15 Apr 2024 18:48:37 +0530 Subject: [PATCH 1/8] PinBasedSessionSupport --- CHANGELOG.md | 4 ++++ plivo/resources/maskingsession.py | 17 ++++++++++++++++- plivo/version.py | 2 +- setup.py | 2 +- .../fixtures/maskingSessionCreateResponse.json | 12 +++++++++++- 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7148300e..dac625be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [4.49.1](https://github.com/plivo/plivo-python/tree/v4.49.1) (2024-04-15) +**Adding Pin Based Session** +-Added Pin Based Session support in Create Masking Session API + ## [4.49.0](https://github.com/plivo/plivo-python/tree/v4.49.0) (2024-03-13) **Adding Import Campaign** -Added Import Campaign API diff --git a/plivo/resources/maskingsession.py b/plivo/resources/maskingsession.py index d4dd30f3..2f57e159 100644 --- a/plivo/resources/maskingsession.py +++ b/plivo/resources/maskingsession.py @@ -3,9 +3,11 @@ from plivo.utils import to_param_dict from plivo.utils.validators import * + class MaskingSession(PlivoResource): _name = 'MaskingSession' _identifier_string = 'session_uuid' + def create_masking_session(self): return self.client.calls.create_masking_session(self.id, **to_param_dict(self.create_masking_session(), locals())) @@ -35,6 +37,9 @@ class MaskingSessions(PlivoResourceInterface): recording_callback_url=[optional(is_url())], first_party_play_url=[optional(is_url())], second_party_play_url=[optional(is_url())], + pin_prompt_play=[optional(is_url())], + incorrect_pin_play=[optional(is_url())], + unknown_caller_play=[optional(is_url())], ) def create_masking_session(self, first_party=None, @@ -50,7 +55,17 @@ def create_masking_session(self, ring_timeout=None, first_party_play_url=None, second_party_play_url=None, - recording_callback_method=None + recording_callback_method=None, + is_pin_authentication_required=None, + generate_pin=None, + generate_pin_length=None, + first_party_pin=None, + second_party_pin=None, + pin_prompt_play=None, + pin_retry=None, + pin_retry_wait=None, + incorrect_pin_play=None, + unknown_caller_play=None ): return self.client.request('POST', ('Masking', 'Session',), to_param_dict(self.create_masking_session, locals()), is_voice_request=True) diff --git a/plivo/version.py b/plivo/version.py index 7fc7b21d..77b47b99 100644 --- a/plivo/version.py +++ b/plivo/version.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -__version__ = '4.49.0' +__version__ = '4.49.1' diff --git a/setup.py b/setup.py index 77d8c50a..2f0601a0 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name='plivo', - version='4.49.0', + version='4.49.1', description='A Python SDK to make voice calls & send SMS using Plivo and to generate Plivo XML', long_description=long_description, url='https://github.com/plivo/plivo-python', diff --git a/tests/resources/fixtures/maskingSessionCreateResponse.json b/tests/resources/fixtures/maskingSessionCreateResponse.json index e979604c..a9ea9fd8 100644 --- a/tests/resources/fixtures/maskingSessionCreateResponse.json +++ b/tests/resources/fixtures/maskingSessionCreateResponse.json @@ -30,6 +30,16 @@ "total_call_count": 0, "total_call_billed_duration": 0, "total_session_amount": 0, - "last_interaction_time": "" + "last_interaction_time": "", + "is_pin_authentication_required": true, + "generate_pin": false, + "generate_pin_length": 4, + "first_party_pin": "1234", + "second_party_pin": "1235", + "pin_prompt_play": "https://s3.amazonaws.com/plivosamplexml/pin_prompt_play_url.xml", + "pin_retry": 2, + "pin_retry_wait": 5, + "incorrect_pin_play": "https://s3.amazonaws.com/plivosamplexml/incorrect_play_url.xml", + "unknown_caller_play": "https://s3.amazonaws.com/plivosamplexml/unknown_play_url.xml" } } \ No newline at end of file From 40dd6ecb99f91bf1a831e87f8386f9fe9c10113a Mon Sep 17 00:00:00 2001 From: ajay-plivo Date: Tue, 16 Apr 2024 11:11:56 +0530 Subject: [PATCH 2/8] SubaccountAndGeomatch --- CHANGELOG.md | 4 ++-- plivo/resources/maskingsession.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dac625be..2cf63135 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # Change Log ## [4.49.1](https://github.com/plivo/plivo-python/tree/v4.49.1) (2024-04-15) -**Adding Pin Based Session** --Added Pin Based Session support in Create Masking Session API +**Adding Pin Based Authentication, Sub-account and Geomatch** +-Added Pin Based Authentication, Sub-account and Geomatch support in Masking APIs. ## [4.49.0](https://github.com/plivo/plivo-python/tree/v4.49.0) (2024-03-13) **Adding Import Campaign** diff --git a/plivo/resources/maskingsession.py b/plivo/resources/maskingsession.py index 2f57e159..a76b9925 100644 --- a/plivo/resources/maskingsession.py +++ b/plivo/resources/maskingsession.py @@ -65,7 +65,9 @@ def create_masking_session(self, pin_retry=None, pin_retry_wait=None, incorrect_pin_play=None, - unknown_caller_play=None + unknown_caller_play=None, + subaccount=None, + geomatch=None ): return self.client.request('POST', ('Masking', 'Session',), to_param_dict(self.create_masking_session, locals()), is_voice_request=True) @@ -93,7 +95,9 @@ def update_masking_session(self, ring_timeout=None, first_party_play_url=None, second_party_play_url=None, - recording_callback_method=None + recording_callback_method=None, + subaccount=None, + geomatch=None ): return self.client.request('POST', ('Masking', 'Session', session_uuid), to_param_dict(self.update_masking_session, locals()), is_voice_request=True) @@ -119,7 +123,8 @@ def list_masking_session(self, duration__gt=None, duration__gte=None, limit=None, - offset=None + offset=None, + subaccount=None ): return self.client.request('GET', ('Masking', 'Session'), to_param_dict(self.list_masking_session, locals()), is_voice_request=True) From b1870f2dd7e719c623ab975b8451412be9472431 Mon Sep 17 00:00:00 2001 From: ajay-plivo Date: Thu, 2 May 2024 14:16:08 +0530 Subject: [PATCH 3/8] pythonVersion --- .github/workflows/unitTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unitTests.yml b/.github/workflows/unitTests.yml index f31fb3b0..60c6416f 100644 --- a/.github/workflows/unitTests.yml +++ b/.github/workflows/unitTests.yml @@ -11,7 +11,7 @@ jobs: name: UnitTests strategy: matrix: - python-version: [ 3.5, 3.6, 3.7, 3.8, 3.9, 3.11] + python-version: [ 3.8, 3.9, 3.11] os: [macos-latest] runs-on: ${{ matrix.os }} From a3dada8a099740532dd28964618a0351ed232118 Mon Sep 17 00:00:00 2001 From: ajay-plivo Date: Thu, 2 May 2024 15:28:23 +0530 Subject: [PATCH 4/8] unitTest --- tests/resources/test_maskingsessions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/resources/test_maskingsessions.py b/tests/resources/test_maskingsessions.py index 1fec9d39..9c5c4510 100644 --- a/tests/resources/test_maskingsessions.py +++ b/tests/resources/test_maskingsessions.py @@ -13,7 +13,8 @@ def test_create(self): self.get_voice_url('Masking', 'Session'), self.client.current_request.url) @with_response(201) - def test_create_geomatch_false(self): + # geomatch = false + def test_create(self): self.client.masking_sessions.create_masking_session( first_party='917708772011', second_party='918220568648', @@ -23,7 +24,8 @@ def test_create_geomatch_false(self): self.get_voice_url('Masking', 'Session'), self.client.current_request.url) @with_response(201) - def test_create_geomatch_true(self): + # geomatch = true + def test_create(self): self.client.masking_sessions.create_masking_session( first_party='917708772011', second_party='918220568648', @@ -33,7 +35,8 @@ def test_create_geomatch_true(self): self.get_voice_url('Masking', 'Session'), self.client.current_request.url) @with_response(201) - def test_create_subaccount(self): + # subaccount is passed + def test_create(self): self.client.masking_sessions.create_masking_session( first_party='917708772011', second_party='918220568648', From 29415f5420430de2908cd2557d51c19bfd7ff622 Mon Sep 17 00:00:00 2001 From: ajay-plivo Date: Thu, 2 May 2024 15:29:11 +0530 Subject: [PATCH 5/8] unitTest --- .github/workflows/unitTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unitTests.yml b/.github/workflows/unitTests.yml index 60c6416f..44a0da15 100644 --- a/.github/workflows/unitTests.yml +++ b/.github/workflows/unitTests.yml @@ -11,7 +11,7 @@ jobs: name: UnitTests strategy: matrix: - python-version: [ 3.8, 3.9, 3.11] + python-version: [ 3.8, 3.9, 3.11, 3.12, 3.13] os: [macos-latest] runs-on: ${{ matrix.os }} From 1a0d1249d060044544d4cbdb142e431c9b784807 Mon Sep 17 00:00:00 2001 From: ajay-plivo Date: Thu, 2 May 2024 15:30:23 +0530 Subject: [PATCH 6/8] unitTest --- .github/workflows/unitTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unitTests.yml b/.github/workflows/unitTests.yml index 44a0da15..40e977f4 100644 --- a/.github/workflows/unitTests.yml +++ b/.github/workflows/unitTests.yml @@ -11,7 +11,7 @@ jobs: name: UnitTests strategy: matrix: - python-version: [ 3.8, 3.9, 3.11, 3.12, 3.13] + python-version: [ 3.8, 3.9, 3.11, 3.12] os: [macos-latest] runs-on: ${{ matrix.os }} From 5b166dff1a174d95f7bab91328b531db6f20f290 Mon Sep 17 00:00:00 2001 From: ajay-plivo Date: Thu, 2 May 2024 15:34:37 +0530 Subject: [PATCH 7/8] unitTest --- CHANGELOG.md | 6 +++--- plivo/version.py | 2 +- setup.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3bd2ec2..5518e482 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # Change Log -## [4.50.1](https://github.com/plivo/plivo-python/tree/v4.49.1) (2024-04-15) -**Adding Pin Based Authentication, Sub-account and Geomatch** --Added Pin Based Authentication, Sub-account and Geomatch support in Masking APIs. +## [4.51.0](https://github.com/plivo/plivo-python/tree/v4.51.0) (2024-05-02) +**Feature - Added SubAccount and GeoMatch for Create Masking Session API of Number Masking.** +- Added sub_account and geo_match support in MaskingSession APIs ## [4.50.0](https://github.com/plivo/plivo-python/tree/v4.50.0) (2024-04-22) **Feature - Support for dynamic button components when sending a templated WhatsApp message** diff --git a/plivo/version.py b/plivo/version.py index 005aec77..20d4441d 100644 --- a/plivo/version.py +++ b/plivo/version.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -__version__ = '4.50.1' +__version__ = '4.51.0' diff --git a/setup.py b/setup.py index c3e2aed2..082b7922 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name='plivo', - version='4.50.1', + version='4.51.0', description='A Python SDK to make voice calls & send SMS using Plivo and to generate Plivo XML', long_description=long_description, url='https://github.com/plivo/plivo-python', From 0a1e2c6f2a77a823848acafe1cc3f94d601456f4 Mon Sep 17 00:00:00 2001 From: ajay-plivo Date: Thu, 2 May 2024 15:37:25 +0530 Subject: [PATCH 8/8] unitTest --- .github/workflows/unitTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unitTests.yml b/.github/workflows/unitTests.yml index 40e977f4..60c6416f 100644 --- a/.github/workflows/unitTests.yml +++ b/.github/workflows/unitTests.yml @@ -11,7 +11,7 @@ jobs: name: UnitTests strategy: matrix: - python-version: [ 3.8, 3.9, 3.11, 3.12] + python-version: [ 3.8, 3.9, 3.11] os: [macos-latest] runs-on: ${{ matrix.os }}