コード例 #1
0
ファイル: endpoints.py プロジェクト: plivo/plivo-python
 def list(self, limit=20, offset=0):
     return self.client.request(
         'GET',
         ('Endpoint', ),
         to_param_dict(self.list, locals()),
         objects_type=Endpoint,
         response_type=ListResponseObject)
コード例 #2
0
ファイル: calls.py プロジェクト: plivo/plivo-python
 def list(self,
          subaccount=None,
          call_direction=None,
          call_direction__lt=None,
          call_direction__lte=None,
          call_direction__gt=None,
          call_direction__gte=None,
          end_time__lt=None,
          end_time__lte=None,
          end_time__gt=None,
          end_time__gte=None,
          end_time=None,
          from_number=None,
          to_number=None,
          bill_duration=None,
          limit=20,
          offset=0,
          status=None,
          parent_call_uuid=None,
          hangup_cause_code=None,
          hangup_source=None):
     return self.client.request(
         'GET',
         ('Call', ),
         to_param_dict(self.list, locals()),
         response_type=ListResponseObject,
     )
コード例 #3
0
 def list(self, limit=20, offset=0):
     return self.client.request(
         'GET',
         ('Endpoint', ),
         to_param_dict(self.list, locals()),
         objects_type=Endpoint,
         response_type=ListResponseObject, is_voice_request=True)
コード例 #4
0
    def list(self,
             subaccount=None,
             call_uuid=None,
             add_time__gt=None,
             add_time__gte=None,
             add_time__lt=None,
             add_time__lte=None,
             add_time=None,
             limit=20,
             offset=0):

        if subaccount:
            if isinstance(subaccount, Subaccount):
                subaccount = subaccount.id

        if add_time__gt and is_valid_time_comparison(add_time__gt):
            add_time__gt = str(add_time__gt)

        if add_time__gte and is_valid_time_comparison(add_time__gte):
            add_time__gte = str(add_time__gte)

        if add_time__lt and is_valid_time_comparison(add_time__lt):
            add_time__lt = str(add_time__lt)

        if add_time__lte and is_valid_time_comparison(add_time__lte):
            add_time__lte = str(add_time__lte)

        if add_time and is_valid_time_comparison(add_time):
            add_time = str(add_time)

        return self.client.request('GET', ('Recording', ),
                                   to_param_dict(self.list, locals()),
                                   objects_type=Recording,
                                   response_type=ListResponseObject,
                                   is_voice_request=True)
コード例 #5
0
ファイル: calls.py プロジェクト: tirkarthi/plivo-python
 def list(self,
          subaccount=None,
          call_direction=None,
          call_direction__lt=None,
          call_direction__lte=None,
          call_direction__gt=None,
          call_direction__gte=None,
          end_time__lt=None,
          end_time__lte=None,
          end_time__gt=None,
          end_time__gte=None,
          end_time=None,
          from_number=None,
          to_number=None,
          bill_duration=None,
          limit=20,
          offset=0,
          status=None,
          parent_call_uuid=None,
          hangup_cause_code=None,
          hangup_source=None):
     return self.client.request('GET', ('Call', ),
                                to_param_dict(self.list, locals()),
                                response_type=ListResponseObject,
                                is_voice_request=True)
コード例 #6
0
ファイル: calls.py プロジェクト: tirkarthi/plivo-python
 def create(self,
            from_,
            to_,
            answer_url,
            answer_method='POST',
            ring_url=None,
            ring_method='POST',
            hangup_url=None,
            hangup_method='POST',
            fallback_url=None,
            fallback_method='POST',
            caller_name=None,
            send_digits=None,
            send_on_preanswer=None,
            time_limit=None,
            hangup_on_ring=None,
            machine_detection=None,
            machine_detection_time=5000,
            machine_detection_url=None,
            machine_detection_method='POST',
            sip_headers=None,
            ring_timeout=120,
            parent_call_uuid=None,
            error_if_parent_not_found=False):
     if from_ in to_.split('<'):
         raise ValidationError('src and destination cannot overlap')
     return self.client.request('POST', ('Call', ),
                                to_param_dict(self.create, locals()),
                                is_voice_request=True)
コード例 #7
0
ファイル: nodes.py プロジェクト: tirkarthi/plivo-python
 def update(self,
            action,
            trigger_source,
            to,
            role):
     return self.client.request('POST', ('phlo', self.phlo_id, self.node_type, self.node_id),
                                to_param_dict(self.update, locals()))
コード例 #8
0
ファイル: calls.py プロジェクト: plivo/plivo-python
    def create(self,
               from_,
               to_,
               answer_url,
               answer_method='POST',
               ring_url=None,
               ring_method='POST',
               hangup_url=None,
               hangup_method='POST',
               fallback_url=None,
               fallback_method='POST',
               caller_name=None,
               send_digits=None,
               send_on_preanswer=False,
               time_limit=None,
               hangup_on_ring=None,
               machine_detection=None,
               machine_detection_time=5000,
               machine_detection_url=None,
               machine_detection_method='POST',
               sip_headers=None,
               ring_timeout=120,
               parent_call_uuid=None,
               error_if_parent_not_found=False):
        if from_ in to_.split('<'):
            raise ValidationError('src and destination cannot overlap')

        return self.client.request('POST', ('Call', ),
                                   to_param_dict(self.create, locals()))
コード例 #9
0
ファイル: applications.py プロジェクト: SUNILKUMARVADLA/Basic
 def list(self, subaccount=None, limit=20, offset=0):
     if subaccount:
         if isinstance(subaccount, Subaccount):
             subaccount = subaccount.id
     return self.client.request('GET', ('Application', ),
                                to_param_dict(self.list, locals()),
                                response_type=ListResponseObject,
                                objects_type=Application)
コード例 #10
0
 def member_speak(self,
                  member_id,
                  text,
                  voice="WOMAN",     #Changed the value to "WOMAN" since the default value is WOMAN
                  language=None):
     return self.client.conferences.member_speak(
         self.conference_name, member_id, text, **to_param_dict( self.member_speak, locals())
     )
コード例 #11
0
ファイル: numbers.py プロジェクト: plivo/plivo-python
 def update(self,
            number,
            app_id=None,
            subaccount=None,
            alias=None,
            verification_info=None):
     return self.client.request('POST', ('Number', number),
                                to_param_dict(self.update, locals()))
コード例 #12
0
ファイル: calls.py プロジェクト: tirkarthi/plivo-python
 def update(self,
            legs=None,
            aleg_url=None,
            aleg_method=None,
            bleg_url=None,
            bleg_method=None):
     return self.client.calls.update(self.id,
                                     **to_param_dict(self.update, locals()))
コード例 #13
0
ファイル: numbers.py プロジェクト: SUNILKUMARVADLA/Basic
 def update(self,
            number,
            app_id=None,
            subaccount=None,
            alias=None,
            verification_info=None):
     return self.client.request('POST', ('Number', number),
                                to_param_dict(self.update, locals()))
コード例 #14
0
ファイル: calls.py プロジェクト: yotamofek/plivo-python
 def play(self,
          call_uuid,
          urls,
          length=None,
          legs=None,
          loop=None,
          mix=None):
     return self.start_playing(**to_param_dict(self.play, locals()))
コード例 #15
0
ファイル: calls.py プロジェクト: plivo/plivo-python
 def play(self,
          call_uuid,
          urls,
          length=None,
          legs=None,
          loop=None,
          mix=None):
     return self.start_playing(**to_param_dict(self.play, locals()))
コード例 #16
0
    def update(
        self,
        identity_id,
        country_iso=None,
        salutation=None,
        first_name=None,
        last_name=None,
        birth_place=None,
        birth_date=None,
        nationality=None,
        id_nationality=None,
        id_issue_date=None,
        id_type=None,
        id_number=None,
        address_line1=None,
        address_line2=None,
        city=None,
        region=None,
        postal_code=None,
        alias=None,
        business_name=None,
        fiscal_identification_code=None,
        street_code=None,
        municipal_code=None,
        subaccount=None,
        file_to_upload=None,  # Value in doc 'file'
        auto_correct_address=None,
        callback_url=None,
    ):
        if file_to_upload:
            file_extension = file_to_upload.strip().split('.')[-1].lower()
            if file_extension not in ['jpg', 'jpeg', 'png', 'pdf']:
                raise ValidationError(
                    'File format of the file to be uploaded should be one of JPG, JPEG, PNG or PDF'
                )

            content_types = {
                'jpeg': 'image/jpeg',
                'jpg': 'image/jpeg',
                'png': 'image/png',
                'pdf': 'application/pdf',
            }

            import os

            files = {
                'file': (file_to_upload.split(os.sep)[-1],
                         open(file_to_upload,
                              'rb'), content_types[file_extension])
            }
        else:
            files = {'file': ''}

        data_to_send = to_param_dict(self.create, locals())
        return self.client.request('POST',
                                   ('Verification', 'Identity', identity_id),
                                   data_to_send,
                                   files=files)
コード例 #17
0
ファイル: calls.py プロジェクト: plivo/plivo-python
 def update(self,
            call_uuid,
            legs=None,
            aleg_url=None,
            aleg_method=None,
            bleg_url=None,
            bleg_method=None):
     return self.client.request('POST', ('Call', call_uuid),
                                to_param_dict(self.update, locals()))
コード例 #18
0
ファイル: calls.py プロジェクト: yotamofek/plivo-python
 def start_playing(self,
                   call_uuid,
                   urls,
                   length=None,
                   legs=None,
                   loop=None,
                   mix=None):
     return self.client.request('POST', ('Call', call_uuid, 'Play'),
                                to_param_dict(self.play, locals()))
コード例 #19
0
ファイル: calls.py プロジェクト: plivo/plivo-python
 def update(self,
            call_uuid,
            legs=None,
            aleg_url=None,
            aleg_method=None,
            bleg_url=None,
            bleg_method=None):
     return self.client.calls.update(call_uuid,
                                     **to_param_dict(self.update, locals()))
コード例 #20
0
ファイル: numbers.py プロジェクト: SUNILKUMARVADLA/Basic
 def create(self,
            numbers,
            carrier,
            region,
            number_type=None,
            app_id=None,
            subaccount=None):
     return self.client.request('POST', ('Number', ),
                                to_param_dict(self.create, locals()))
コード例 #21
0
ファイル: conferences.py プロジェクト: SUNILKUMARVADLA/Basic
 def record(self,
            file_format=None,
            transcription_type=None,
            transcription_url=None,
            transcription_method=None,
            callback_url=None,
            callback_method=None):
     return self.client.conferences.record(
         self.conference_name, **to_param_dict(self.member_speak, locals()))
コード例 #22
0
ファイル: numbers.py プロジェクト: plivo/plivo-python
 def create(self,
            numbers,
            carrier,
            region,
            number_type=None,
            app_id=None,
            subaccount=None):
     return self.client.request('POST', ('Number', ),
                                to_param_dict(self.create, locals()))
コード例 #23
0
ファイル: calls.py プロジェクト: yotamofek/plivo-python
 def update(self,
            call_uuid,
            legs=None,
            aleg_url=None,
            aleg_method=None,
            bleg_url=None,
            bleg_method=None):
     return self.client.request('POST', ('Call', call_uuid),
                                to_param_dict(self.update, locals()))
コード例 #24
0
ファイル: calls.py プロジェクト: tirkarthi/plivo-python
 def start_speaking(self,
                    text,
                    voice=None,
                    language=None,
                    legs=None,
                    loop=None,
                    mix=None):
     return self.client.calls.start_speaking(
         self.id, **to_param_dict(self.start_playing, locals()))
コード例 #25
0
ファイル: applications.py プロジェクト: plivo/plivo-python
 def list(self, subaccount=None, limit=20, offset=0):
     if subaccount:
         if isinstance(subaccount, Subaccount):
             subaccount = subaccount.id
     return self.client.request(
         'GET', ('Application', ),
         to_param_dict(self.list, locals()),
         response_type=ListResponseObject,
         objects_type=Application)
コード例 #26
0
ファイル: calls.py プロジェクト: plivo/plivo-python
 def start_playing(self,
                   call_uuid,
                   urls,
                   length=None,
                   legs=None,
                   loop=None,
                   mix=None):
     return self.client.request('POST', ('Call', call_uuid, 'Play'),
                                to_param_dict(self.play, locals()))
コード例 #27
0
ファイル: conferences.py プロジェクト: SUNILKUMARVADLA/Basic
 def member_speak(self,
                  conference_name,
                  member_id,
                  text,
                  voice=None,
                  language=None):
     return self.client.request(
         'POST',
         ('Conference', conference_name, 'Member', member_id, 'Speak'),
         to_param_dict(self.member_speak, locals()))
コード例 #28
0
ファイル: conferences.py プロジェクト: plivo/plivo-python
 def record(self,
            file_format=None,
            transcription_type=None,
            transcription_url=None,
            transcription_method=None,
            callback_url=None,
            callback_method=None):
     return self.client.conferences.record(self.conference_name,
                                           **to_param_dict(
                                               self.member_speak, locals()))
コード例 #29
0
ファイル: live_calls.py プロジェクト: plivo/plivo-python
 def list_ids(self,
              call_direction=None,
              from_number=None,
              to_number=None,
              limit=20,
              offset=0,
              ):
     params = to_param_dict(self.list_ids, locals())
     params.update({'status': 'live'})
     return self.client.request('GET', ('Call',), params)
コード例 #30
0
ファイル: conferences.py プロジェクト: plivo/plivo-python
 def member_speak(self,
                  conference_name,
                  member_id,
                  text,
                  voice=None,
                  language=None):
     return self.client.request(
         'POST',
         ('Conference', conference_name, 'Member', member_id, 'Speak'),
         to_param_dict(self.member_speak, locals()))
コード例 #31
0
ファイル: calls.py プロジェクト: tirkarthi/plivo-python
 def start_recording(self,
                     time_limit=None,
                     file_format=None,
                     transcription_type=None,
                     transcription_url=None,
                     transcription_method=None,
                     callback_url=None,
                     callback_method=None):
     return self.client.calls.start_recording(
         self.id, **to_param_dict(self.start_recording, locals()))
コード例 #32
0
ファイル: calls.py プロジェクト: plivo/plivo-python
 def record(self,
            time_limit=None,
            file_format=None,
            transcription_type=None,
            transcription_url=None,
            transcription_method=None,
            callback_url=None,
            callback_mathod=None):
     return self.client.calls.record(self.id,
                                     **to_param_dict(self.record, locals()))
コード例 #33
0
    def create(self,
               country_iso,
               salutation,
               first_name,
               last_name,
               address_line1,
               address_line2,
               city,
               region,
               postal_code,
               address_proof_type,
               alias=None,
               file_to_upload=None,
               auto_correct_address=None,
               fiscal_identification_code=None,
               street_code=None,
               municipal_code=None,
               callback_url=None):
        if country_iso == 'ES' and not fiscal_identification_code:
            raise ValidationError(
                'The parameter fiscal_identification_code is required for Spain numbers'
            )

        if country_iso == 'DK' and not all(street_code, municipal_code):
            raise ValidationError(
                'The parameters street_code and municipal_code are required for Denmark numbers'
            )

        if file_to_upload:
            file_extension = file_to_upload.strip().split('.')[-1].lower()
            if file_extension not in ['jpg', 'jpeg', 'png', 'pdf']:
                raise ValidationError(
                    'File format of the file to be uploaded should be one of JPG, JPEG, PNG or PDF'
                )

            content_types = {
                'jpeg': 'image/jpeg',
                'jpg': 'image/jpeg',
                'png': 'image/png',
                'pdf': 'application/pdf',
            }

            import os

            files = {
                'file': (file_to_upload.split(os.sep)[-1],
                         open(file_to_upload,
                              'rb'), content_types[file_extension])
            }
        else:
            files = {'file': ''}
        data_to_send = to_param_dict(self.create, locals())
        return self.client.request('POST', ('Verification', 'Address'),
                                   data_to_send,
                                   files=files)
コード例 #34
0
ファイル: identities.py プロジェクト: plivo/plivo-python
    def update(self,
               identity_id,
               country_iso=None,
               salutation=None,
               first_name=None,
               last_name=None,
               birth_place=None,
               birth_date=None,
               nationality=None,
               id_nationality=None,
               id_issue_date=None,
               id_type=None,
               id_number=None,
               address_line1=None,
               address_line2=None,
               city=None,
               region=None,
               postal_code=None,
               alias=None,
               business_name=None,
               fiscal_identification_code=None,
               street_code=None,
               municipal_code=None,
               subaccount=None,
               file_to_upload=None,
               auto_correct_address=None,
               callback_url=None):
        if file_to_upload:
            file_extension = file_to_upload.strip().split('.')[-1].lower()
            if file_extension not in ['jpg', 'jpeg', 'png', 'pdf']:
                raise ValidationError(
                    'File format of the file to be uploaded should be one of JPG, JPEG, PNG or PDF'
                )

            content_types = {
                'jpeg': 'image/jpeg',
                'jpg': 'image/jpeg',
                'png': 'image/png',
                'pdf': 'application/pdf',
            }

            import os

            files = {
                'file': (file_to_upload.split(os.sep)[-1], open(
                    file_to_upload, 'rb'), content_types[file_extension])
            }
        else:
            files = {'file': ''}

        data_to_send = to_param_dict(self.create, locals())
        return self.client.request(
            'POST', ('Verification', 'Identity', identity_id),
            data_to_send,
            files=files)
コード例 #35
0
ファイル: calls.py プロジェクト: plivo/plivo-python
 def start_speaking(self,
                    call_uuid,
                    text,
                    voice=None,
                    language=None,
                    legs=None,
                    loop=None,
                    mix=None):
     return self.client.request('POST', ('Call', call_uuid, 'Speak'),
                                to_param_dict(self.start_speaking,
                                              locals()))
コード例 #36
0
ファイル: calls.py プロジェクト: yotamofek/plivo-python
 def start_speaking(self,
                    call_uuid,
                    text,
                    voice=None,
                    language=None,
                    legs=None,
                    loop=None,
                    mix=None):
     return self.client.request(
         'POST', ('Call', call_uuid, 'Speak'),
         to_param_dict(self.start_speaking, locals()))
コード例 #37
0
ファイル: calls.py プロジェクト: plivo/plivo-python
 def start_speaking(self,
                    text,
                    voice=None,
                    language=None,
                    legs=None,
                    loop=None,
                    mix=None):
     return self.client.calls.start_speaking(self.id,
                                             **to_param_dict(
                                                 self.start_playing,
                                                 locals()))
コード例 #38
0
ファイル: calls.py プロジェクト: plivo/plivo-python
 def record(self,
            call_uuid,
            time_limit=None,
            file_format=None,
            transcription_type=None,
            transcription_url=None,
            transcription_method=None,
            callback_url=None,
            callback_mathod=None):
     return self.start_recording(**to_param_dict(self.start_recording,
                                                 locals()))
コード例 #39
0
 def list_ids(
     self,
     call_direction=None,
     from_number=None,
     to_number=None,
     limit=20,
     offset=0,
 ):
     params = to_param_dict(self.list_ids, locals())
     params.update({'status': 'live'})
     return self.client.request('GET', ('Call', ), params)
コード例 #40
0
 def member_speak(self,
                  conference_name,
                  member_id,
                  text,
                  voice="WOMAN",              #Changed the value to "WOMAN" since the default value is WOMAN
                  language=None
                  ):
     return self.client.request(
         'POST', ('Conference', conference_name, 'Member', member_id, 'Speak'),
         to_param_dict(self.member_speak, locals())
     )
コード例 #41
0
ファイル: calls.py プロジェクト: tirkarthi/plivo-python
 def record(self,
            call_uuid,
            time_limit=None,
            file_format=None,
            transcription_type=None,
            transcription_url=None,
            transcription_method=None,
            callback_url=None,
            callback_method=None):
     return self.start_recording(
         **to_param_dict(self.start_recording, locals()))
コード例 #42
0
ファイル: calls.py プロジェクト: tirkarthi/plivo-python
 def speak(self,
           call_uuid,
           text,
           voice=None,
           language=None,
           legs=None,
           loop=None,
           mix=None,
           is_voice_request=True):
     return self.client.calls.speak(
         self.id, **to_param_dict(self.start_playing, locals()))
コード例 #43
0
ファイル: calls.py プロジェクト: yotamofek/plivo-python
 def start_recording(self,
                     call_uuid,
                     time_limit=None,
                     file_format=None,
                     transcription_type=None,
                     transcription_url=None,
                     transcription_method=None,
                     callback_url=None,
                     callback_mathod=None):
     return self.client.request(
         'POST', ('Call', call_uuid, 'Record'),
         to_param_dict(self.start_recording, locals()))
コード例 #44
0
 def search(self,
            country_iso,
            type=None,
            pattern=None,
            region=None,
            services=None,
            lata=None,
            rate_center=None,
            limit=None,
            offset=None):
     return self.client.request('GET', ('PhoneNumber', ),
                                to_param_dict(self.search, locals()))
コード例 #45
0
ファイル: addresses.py プロジェクト: plivo/plivo-python
    def create(self,
               country_iso,
               salutation,
               first_name,
               last_name,
               address_line1,
               address_line2,
               city,
               region,
               postal_code,
               address_proof_type,
               alias=None,
               file_to_upload=None,
               auto_correct_address=None,
               fiscal_identification_code=None,
               street_code=None,
               municipal_code=None,
               callback_url=None):
        if country_iso == 'ES' and not fiscal_identification_code:
            raise ValidationError(
                'The parameter fiscal_identification_code is required for Spain numbers'
            )

        if country_iso == 'DK' and not all(street_code, municipal_code):
            raise ValidationError(
                'The parameters street_code and municipal_code are required for Denmark numbers'
            )

        if file_to_upload:
            file_extension = file_to_upload.strip().split('.')[-1].lower()
            if file_extension not in ['jpg', 'jpeg', 'png', 'pdf']:
                raise ValidationError(
                    'File format of the file to be uploaded should be one of JPG, JPEG, PNG or PDF'
                )

            content_types = {
                'jpeg': 'image/jpeg',
                'jpg': 'image/jpeg',
                'png': 'image/png',
                'pdf': 'application/pdf',
            }

            import os

            files = {
                'file': (file_to_upload.split(os.sep)[-1], open(
                    file_to_upload, 'rb'), content_types[file_extension])
            }
        else:
            files = {'file': ''}
        data_to_send = to_param_dict(self.create, locals())
        return self.client.request(
            'POST', ('Verification', 'Address'), data_to_send, files=files)
コード例 #46
0
ファイル: calls.py プロジェクト: plivo/plivo-python
 def start_recording(self,
                     call_uuid,
                     time_limit=None,
                     file_format=None,
                     transcription_type=None,
                     transcription_url=None,
                     transcription_method=None,
                     callback_url=None,
                     callback_mathod=None):
     return self.client.request('POST', ('Call', call_uuid, 'Record'),
                                to_param_dict(self.start_recording,
                                              locals()))
コード例 #47
0
ファイル: calls.py プロジェクト: tirkarthi/plivo-python
 def start_playing(self,
                   call_uuid,
                   urls,
                   length=None,
                   legs=None,
                   loop=None,
                   mix=None,
                   callback_url=None,
                   callback_method=None):
     return self.client.request('POST', ('Call', call_uuid, 'Play'),
                                to_param_dict(self.play, locals()),
                                is_voice_request=True)
コード例 #48
0
ファイル: identities.py プロジェクト: SUNILKUMARVADLA/Basic
 def list(self,
          country_iso=None,
          customer_name=None,
          alias=None,
          verification_status=None,
          limit=20,
          offset=0):
     return self.client.request(
         'GET', ('Verification', 'Identity', ),
         to_param_dict(self.list, locals()),
         response_type=ListResponseObject,
         objects_type=Identity)
コード例 #49
0
ファイル: numbers.py プロジェクト: plivo/plivo-python
 def search(self,
            country_iso,
            type=None,
            pattern=None,
            region=None,
            services=None,
            lata=None,
            rate_center=None,
            limit=None,
            offset=None,
            eligible=None):
     return self.client.request('GET', ('PhoneNumber', ),
                                to_param_dict(self.search, locals()))
コード例 #50
0
ファイル: numbers.py プロジェクト: plivo/plivo-python
 def list(self,
          type=None,
          number_startswith=None,
          subaccount=None,
          alias=None,
          services=None,
          limit=20,
          offset=0):
     return self.client.request(
         'GET',
         ('Number', ),
         to_param_dict(self.list, locals()),
         objects_type=Number,
         response_type=ListResponseObject, )
コード例 #51
0
ファイル: numbers.py プロジェクト: SUNILKUMARVADLA/Basic
 def list(self,
          type=None,
          number_startswith=None,
          subaccount=None,
          alias=None,
          services=None,
          limit=20,
          offset=0):
     return self.client.request(
         'GET',
         ('Number', ),
         to_param_dict(self.list, locals()),
         objects_type=Number,
         response_type=ListResponseObject,
     )
コード例 #52
0
ファイル: applications.py プロジェクト: loki-NK/plivo-python
 def update(self,
            answer_url,
            answer_method='POST',
            hangup_url=None,
            hangup_method='POST',
            fallback_answer_url=None,
            fallback_method='POST',
            message_url=None,
            message_method='POST',
            default_number_app=False,
            default_endpoint_app=False,
            subaccount=None,
            log_incoming_messages=True):
     params = to_param_dict(self.update, locals())
     self.__dict__.update(params)
     return self.client.applications.update(self.id, **params)
コード例 #53
0
ファイル: applications.py プロジェクト: plivo/plivo-python
 def update(self,
            answer_url,
            answer_method='POST',
            hangup_url=None,
            hangup_method='POST',
            fallback_answer_url=None,
            fallback_method='POST',
            message_url=None,
            message_method='POST',
            default_number_app=False,
            default_endpoint_app=False,
            subaccount=None,
            log_incoming_messages=True):
     params = to_param_dict(self.update, locals())
     self.__dict__.update(params)
     return self.client.applications.update(self.id, **params)
コード例 #54
0
ファイル: applications.py プロジェクト: plivo/plivo-python
 def update(self,
            app_id,
            answer_url,
            answer_method='POST',
            hangup_url=None,
            hangup_method='POST',
            fallback_answer_url=None,
            fallback_method='POST',
            message_url=None,
            message_method='POST',
            default_number_app=False,
            default_endpoint_app=False,
            subaccount=None,
            log_incoming_messages=True):
     if subaccount:
         if isinstance(subaccount, Subaccount):
             subaccount = subaccount.id
     return self.client.request('POST', ('Application', app_id),
                                to_param_dict(self.update, locals()))
コード例 #55
0
ファイル: recordings.py プロジェクト: plivo/plivo-python
    def list(self,
             subaccount=None,
             call_uuid=None,
             add_time__gt=None,
             add_time__gte=None,
             add_time__lt=None,
             add_time__lte=None,
             add_time=None,
             limit=20,
             offset=0):

        if subaccount:
            if isinstance(subaccount, Subaccount):
                subaccount = subaccount.id

        if add_time__gt and is_valid_time_comparison(add_time__gt):
            add_time__gt = str(add_time__gt)

        if add_time__gte and is_valid_time_comparison(add_time__gte):
            add_time__gte = str(add_time__gte)

        if add_time__lt and is_valid_time_comparison(add_time__lt):
            add_time__lt = str(add_time__lt)

        if add_time__lte and is_valid_time_comparison(add_time__lte):
            add_time__lte = str(add_time__lte)

        if add_time and is_valid_time_comparison(add_time):
            add_time = str(add_time)

        return self.client.request(
            'GET',
            ('Recording', ),
            to_param_dict(self.list, locals()),
            objects_type=Recording,
            response_type=ListResponseObject,
        )
コード例 #56
0
ファイル: applications.py プロジェクト: plivo/plivo-python
 def delete(self, app_id):
     return self.client.request('DELETE', ('Application', app_id),
                                to_param_dict(self.update, locals()))
コード例 #57
0
ファイル: conferences.py プロジェクト: plivo/plivo-python
 def member_play(self, conference_name, member_id, url):
     return self.client.request(
         'POST',
         ('Conference', conference_name, 'Member', member_id, 'Play'),
         to_param_dict(self.member_play, locals()))
コード例 #58
0
ファイル: conferences.py プロジェクト: plivo/plivo-python
 def member_speak(self, member_id, text, voice=None, language=None):
     return self.client.conferences.member_speak(self.conference_name,
                                                 member_id, text,
                                                 **to_param_dict(
                                                     self.member_speak,
                                                     locals()))