Skip to content

Commit

Permalink
fix version
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutoshkumar-plivo committed Feb 28, 2024
2 parents cb14383 + 935e482 commit abe240f
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 16 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# Change Log
## [4.47.2](https://github.com/plivo/plivo-python/tree/v4.47.2) (2024-02-05)

## [4.48.2](https://github.com/plivo/plivo-python/tree/v4.48.2) (2024-02-28)
**Feature - Log Redaction Enhancement**
- Added log attribute in GET and List MDR response
- Change log field from bool to string in send SMS

## [4.48.1](https://github.com/plivo/plivo-python/tree/v4.48.1) (2024-02-26)
**Added new param 'waitTime' for MPC XML

## [4.48.0](https://github.com/plivo/plivo-python/tree/v4.48.0) (2024-02-12)
**Custom Verify OTP - Added new optional param 'otp' for Create Session and made 'otp' param optional for Validate Session**

## [4.47.2](https://github.com/plivo/plivo-python/tree/v4.47.2) (2024-01-25)
**Added new params 'create_mpc_with_single_participant' for Add Participant API of MPC**

## [4.47.1](https://github.com/plivo/plivo-python/tree/v4.47.1) (2023-12-19)
**Type param addition in speak api for call and mpc**

Expand Down
7 changes: 5 additions & 2 deletions plivo/resources/multipartycall.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def add_participant(self,
start_recording_audio=None,
start_recording_audio_method='GET',
stop_recording_audio=None,
stop_recording_audio_method='GET'
stop_recording_audio_method='GET',
create_mpc_with_single_participant=True
):
return self.client.multi_party_calls.add_participant(role, uuid=self.id,
**to_param_dict(self.add_participant, locals()))
Expand Down Expand Up @@ -334,6 +335,7 @@ def get(self, uuid=None, friendly_name=None, callback_url=None, callback_method=
stop_recording_audio_method=[optional(of_type_exact(str), is_in(('GET', 'POST'), case_sensitive=False))],
callback_url=[optional(is_url())],
callback_method=[optional(of_type(six.text_type))],
create_mpc_with_single_participant=[optional(of_type_exact(bool))],
)
def add_participant(self,
role,
Expand Down Expand Up @@ -387,7 +389,8 @@ def add_participant(self,
stop_recording_audio=None,
stop_recording_audio_method='GET',
callback_url=None,
callback_method=None
callback_method=None,
create_mpc_with_single_participant=True
):
mpc_id = self.__make_mpc_id(friendly_name, uuid)
caller_name = caller_name or from_
Expand Down
4 changes: 2 additions & 2 deletions plivo/resources/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ class Sessions(PlivoResourceInterface):

@validate_args(
app_uuid=[optional(of_type(six.text_type))],
otp=[optional(of_type(six.text_type))],
recipient=[required(is_phonenumber())],
channel=[optional(all_of(of_type(six.text_type), is_in(('sms', 'voice'))))],
url=[optional(is_url())],
method=[optional(of_type(six.text_type))])
def create(self,
app_uuid=None,
otp=None,
recipient=None,
channel=None,
url=None,
Expand Down Expand Up @@ -91,8 +93,6 @@ def list(self,
session_uuid=[of_type(six.text_type)]
)
def validate(self, session_uuid, otp=None):
if otp is None:
raise ValidationError('otp is required')
return self.client.request('POST', ('Verify', 'Session', session_uuid),
to_param_dict(self.validate, locals()))

2 changes: 1 addition & 1 deletion plivo/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
__version__ = '4.47.2'
__version__ = '4.48.2'
23 changes: 23 additions & 0 deletions plivo/xml/MultiPartyCallElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,26 @@ def set_wait_music_method(self, wait_music_method):
self.wait_music_method = wait_music_method
return self

@property
def wait_time(self):
return self.__wait_time

@wait_time.setter
@validate_args(
wait_time=[
optional(
of_type_exact(int),
check(lambda wait_time: 0 <= wait_time <= 1800, '0 <= wait_time <= 1800')
)
],
)
def wait_time(self, wait_time):
self.__wait_time = wait_time

def set_wait_time(self, wait_time):
self.wait_time = wait_time
return self

@property
def agent_hold_music_url(self):
return self.__agent_hold_music_url
Expand Down Expand Up @@ -543,6 +563,7 @@ def __init__(
record_min_member_count=1,
wait_music_url=None,
wait_music_method='GET',
wait_time=None,
agent_hold_music_url=None,
agent_hold_music_method='GET',
customer_hold_music_url=None,
Expand Down Expand Up @@ -585,6 +606,7 @@ def __init__(
self.record_min_member_count = record_min_member_count
self.wait_music_url = wait_music_url
self.wait_music_method = wait_music_method
self.wait_time = wait_time
self.agent_hold_music_url = agent_hold_music_url
self.agent_hold_music_method = agent_hold_music_method
self.customer_hold_music_url = customer_hold_music_url
Expand Down Expand Up @@ -619,6 +641,7 @@ def to_dict(self):
'recordMinMemberCount': self.record_min_member_count,
'waitMusicUrl': self.wait_music_url,
'waitMusicMethod': self.wait_music_method,
'waitTime': self.wait_time,
'agentHoldMusicUrl': self.agent_hold_music_url,
'agentHoldMusicMethod': self.agent_hold_music_method,
'customerHoldMusicUrl': self.customer_hold_music_url,
Expand Down
2 changes: 2 additions & 0 deletions plivo/xml/ResponseElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ def add_multi_party_call(self,
max_participants=10,
wait_music_url=None,
wait_music_method="GET",
wait_time=None,
agent_hold_music_url=None,
agent_hold_music_method='GET',
customer_hold_music_url=None,
Expand Down Expand Up @@ -371,6 +372,7 @@ def add_multi_party_call(self,
max_participants=max_participants,
wait_music_url=wait_music_url,
wait_music_method=wait_music_method,
wait_time=wait_time,
agent_hold_music_url=agent_hold_music_url,
agent_hold_music_method=agent_hold_music_method,
customer_hold_music_url=customer_hold_music_url,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='plivo',
version='4.47.0',
version='4.48.2',
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',
Expand Down
1 change: 1 addition & 0 deletions tests/resources/test_multipartycalls.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def test_add_participant(self):
'role': 'agent',
'start_recording_audio_method': 'GET',
'stop_recording_audio_method': 'GET',
'create_mpc_with_single_participant': True
}

add_participant_response = self.client.multi_party_calls.add_participant(friendly_name='Voice', role='agent',
Expand Down
6 changes: 0 additions & 6 deletions tests/resources/test_verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,3 @@ def test_validate(self):
self.assertEqual(test_session.message,
expected_response['message'])

def test_validate_without_otp(self):
self.assertRaises(
exceptions.ValidationError,
self.client.verify_session.validate,
session_uuid='1234567'
)
4 changes: 3 additions & 1 deletion tests/xml/test_MultiPartyCallElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@ def test_builder_setting(self):
'statusCallbackEvents="mpc-state-changes,participant-state-changes" ' \
'statusCallbackMethod="POST" stayAlone="false" stopRecordingAudio="http://plivo.com/api.mp3" ' \
'stopRecordingAudioMethod="GET" ' \
'waitTime="5" ' \
'waitMusicMethod="GET" recordMinMemberCount="1">Helsinki</MultiPartyCall> '
element = plivoxml.MultiPartyCallElement(content='Helsinki', role='customer'). \
set_max_duration(4500).set_max_participants(9).set_end_mpc_on_exit(True). \
set_customer_hold_music_url('http://plivo.com/voice.mp3').set_coach_mode(False). \
set_on_exit_action_url('http://plivo.com/api.mp3').set_on_exit_action_method('GET'). \
set_stop_recording_audio("http://plivo.com/api.mp3"). \
set_start_recording_audio("http://plivo.com/api.mp3")
set_start_recording_audio("http://plivo.com/api.mp3"). \
set_wait_time(5)

self.assertXmlEqual(expected_xml, element.to_string(False))
5 changes: 3 additions & 2 deletions tests/xml/test_responseElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_add_mpc(self):
'enterSoundMethod="GET" exitSound="beep:1" exitSoundMethod="GET" hold="true" ' \
'maxDuration="20000" maxParticipants="7" mute="true" onExitActionMethod="POST" ' \
'onExitActionUrl="https://plivo.com/exitAction" record="true" recordFileFormat="wav" ' \
'recordMinMemberCount="1" recordingCallbackMethod="GET" ' \
'recordMinMemberCount="1" recordParticipantTrack="false" recordingCallbackMethod="GET" ' \
'relayDTMFInputs="false" role="customer" ' \
'startMpcOnEnter="true" '\
'startRecordingAudio="https://plivo.com/plivoTone.mp3" ' \
Expand All @@ -120,13 +120,14 @@ def test_add_mpc(self):
'stopRecordingAudio="https://plivo.com/plivoTone.mp3" ' \
'stopRecordingAudioMethod="GET" ' \
'waitMusicMethod="POST" ' \
'waitTime="5" ' \
'waitMusicUrl="https://plivo.com/plivoTone.mp3">multi party conference</MultiPartyCall>' \
'</Response>'

elem = plivoxml.ResponseElement().add_multi_party_call(content='multi party conference', role='customer',
max_duration=20000, max_participants=7,
wait_music_url='https://plivo.com/plivoTone.mp3',
wait_music_method='POST', start_mpc_on_enter=True,
wait_music_method='POST', wait_time=5, start_mpc_on_enter=True,
record=True, record_file_format='wav', mute=True,
enter_sound='beep:2', exit_sound='beep:1', hold=True,
on_exit_action_url='https://plivo.com/exitAction',
Expand Down

0 comments on commit abe240f

Please sign in to comment.