diff --git a/LICENSE b/LICENSE index a9acc25d..749af7fb 100644 --- a/LICENSE +++ b/LICENSE @@ -3,7 +3,7 @@ License: The MIT License (MIT) http://opensource.org/licenses/MIT -Copyright (c) 2014 - 2016 APIMATIC Limited +Copyright (c) 2014 - 2020 APIMATIC Limited Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/bandwidth/controllers/base_controller.py b/bandwidth/controllers/base_controller.py index 3f7583fb..35be446b 100644 --- a/bandwidth/controllers/base_controller.py +++ b/bandwidth/controllers/base_controller.py @@ -28,7 +28,7 @@ class BaseController(object): def global_headers(self): return { - 'user-agent': 'python-sdk-refs/tags/python6.13.2' + 'user-agent': 'python-sdk' } def __init__(self, config, call_back=None): diff --git a/bandwidth/http/api_response.py b/bandwidth/http/api_response.py index 77edf3a7..04a6c9ac 100644 --- a/bandwidth/http/api_response.py +++ b/bandwidth/http/api_response.py @@ -40,9 +40,15 @@ def __init__(self, http_response, self.errors = errors def is_success(self): + """ Returns true if status code is between 200-300 + + """ return 200 <= self.status_code < 300 def is_error(self): + """ Returns true if status code is between 400-600 + + """ return 400 <= self.status_code < 600 def __repr__(self): diff --git a/bandwidth/messaging/controllers/api_controller.py b/bandwidth/messaging/controllers/api_controller.py index 561002a9..764664ef 100644 --- a/bandwidth/messaging/controllers/api_controller.py +++ b/bandwidth/messaging/controllers/api_controller.py @@ -52,7 +52,7 @@ def list_media(self, # Prepare query URL _url_path = '/users/{userId}/media' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'userId': {'value': user_id, 'encode': True} + 'userId': {'value': user_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.MESSAGINGDEFAULT) _query_builder += _url_path @@ -115,7 +115,7 @@ def get_media(self, # Prepare query URL _url_path = '/users/{userId}/media/{mediaId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'userId': {'value': user_id, 'encode': True}, + 'userId': {'value': user_id, 'encode': False}, 'mediaId': {'value': media_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.MESSAGINGDEFAULT) @@ -181,8 +181,8 @@ def upload_media(self, # Prepare query URL _url_path = '/users/{userId}/media/{mediaId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'userId': {'value': user_id, 'encode': True}, - 'mediaId': {'value': media_id, 'encode': True} + 'userId': {'value': user_id, 'encode': False}, + 'mediaId': {'value': media_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.MESSAGINGDEFAULT) _query_builder += _url_path @@ -251,8 +251,8 @@ def delete_media(self, # Prepare query URL _url_path = '/users/{userId}/media/{mediaId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'userId': {'value': user_id, 'encode': True}, - 'mediaId': {'value': media_id, 'encode': True} + 'userId': {'value': user_id, 'encode': False}, + 'mediaId': {'value': media_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.MESSAGINGDEFAULT) _query_builder += _url_path @@ -308,7 +308,7 @@ def create_message(self, # Prepare query URL _url_path = '/users/{userId}/messages' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'userId': {'value': user_id, 'encode': True} + 'userId': {'value': user_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.MESSAGINGDEFAULT) _query_builder += _url_path diff --git a/bandwidth/messaging/controllers/base_controller.py b/bandwidth/messaging/controllers/base_controller.py index 3f7583fb..35be446b 100644 --- a/bandwidth/messaging/controllers/base_controller.py +++ b/bandwidth/messaging/controllers/base_controller.py @@ -28,7 +28,7 @@ class BaseController(object): def global_headers(self): return { - 'user-agent': 'python-sdk-refs/tags/python6.13.2' + 'user-agent': 'python-sdk' } def __init__(self, config, call_back=None): diff --git a/bandwidth/twofactorauth/controllers/api_controller.py b/bandwidth/twofactorauth/controllers/api_controller.py index 436d2458..70e1d82e 100644 --- a/bandwidth/twofactorauth/controllers/api_controller.py +++ b/bandwidth/twofactorauth/controllers/api_controller.py @@ -52,7 +52,7 @@ def create_voice_two_factor(self, # Prepare query URL _url_path = '/accounts/{accountId}/code/voice' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.TWOFACTORAUTHDEFAULT) _query_builder += _url_path @@ -106,7 +106,7 @@ def create_messaging_two_factor(self, # Prepare query URL _url_path = '/accounts/{accountId}/code/messaging' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.TWOFACTORAUTHDEFAULT) _query_builder += _url_path @@ -159,7 +159,7 @@ def create_verify_two_factor(self, # Prepare query URL _url_path = '/accounts/{accountId}/code/verify' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.TWOFACTORAUTHDEFAULT) _query_builder += _url_path diff --git a/bandwidth/twofactorauth/controllers/base_controller.py b/bandwidth/twofactorauth/controllers/base_controller.py index 3f7583fb..35be446b 100644 --- a/bandwidth/twofactorauth/controllers/base_controller.py +++ b/bandwidth/twofactorauth/controllers/base_controller.py @@ -28,7 +28,7 @@ class BaseController(object): def global_headers(self): return { - 'user-agent': 'python-sdk-refs/tags/python6.13.2' + 'user-agent': 'python-sdk' } def __init__(self, config, call_back=None): diff --git a/bandwidth/twofactorauth/models/two_factor_verify_request_schema.py b/bandwidth/twofactorauth/models/two_factor_verify_request_schema.py index eb147906..6d3f9d22 100644 --- a/bandwidth/twofactorauth/models/two_factor_verify_request_schema.py +++ b/bandwidth/twofactorauth/models/two_factor_verify_request_schema.py @@ -15,14 +15,10 @@ class TwoFactorVerifyRequestSchema(object): Attributes: to (string): The phone number to send the 2fa code to. - mfrom (string): The application phone number, the sender of the 2fa - code. application_id (string): The application unique ID, obtained from Bandwidth. scope (string): An optional field to denote what scope or action the 2fa code is addressing. If not supplied, defaults to "2FA". - digits (float): The number of digits for your 2fa code. The valid - number ranges from 2 to 8, inclusively. expiration_time_in_minutes (float): The time period, in minutes, to validate the 2fa code. By setting this to 3 minutes, it will mean any code generated within the last 3 minutes are still valid. The @@ -35,9 +31,7 @@ class TwoFactorVerifyRequestSchema(object): # Create a mapping from Model property names to API property names _names = { "to": 'to', - "mfrom": 'from', "application_id": 'applicationId', - "digits": 'digits', "expiration_time_in_minutes": 'expirationTimeInMinutes', "code": 'code', "scope": 'scope' @@ -45,9 +39,7 @@ class TwoFactorVerifyRequestSchema(object): def __init__(self, to=None, - mfrom=None, application_id=None, - digits=None, expiration_time_in_minutes=None, code=None, scope=None): @@ -55,10 +47,8 @@ def __init__(self, # Initialize members of the class self.to = to - self.mfrom = mfrom self.application_id = application_id self.scope = scope - self.digits = digits self.expiration_time_in_minutes = expiration_time_in_minutes self.code = code @@ -81,18 +71,14 @@ def from_dictionary(cls, # Extract variables from the dictionary to = dictionary.get('to') - mfrom = dictionary.get('from') application_id = dictionary.get('applicationId') - digits = dictionary.get('digits') expiration_time_in_minutes = dictionary.get('expirationTimeInMinutes') code = dictionary.get('code') scope = dictionary.get('scope') # Return an object of this model return cls(to, - mfrom, application_id, - digits, expiration_time_in_minutes, code, scope) diff --git a/bandwidth/voice/__init__.py b/bandwidth/voice/__init__.py index 358ad66e..843fbc5d 100644 --- a/bandwidth/voice/__init__.py +++ b/bandwidth/voice/__init__.py @@ -1,7 +1,7 @@ -__all__ = [ +__all__ = [ 'bxml', 'controllers', 'exceptions', 'models', - 'voice_client', + 'voice_client', ] diff --git a/bandwidth/voice/controllers/api_controller.py b/bandwidth/voice/controllers/api_controller.py index 472cb35f..2696af17 100644 --- a/bandwidth/voice/controllers/api_controller.py +++ b/bandwidth/voice/controllers/api_controller.py @@ -57,7 +57,7 @@ def create_call(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/calls' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -122,8 +122,8 @@ def get_call_state(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/calls/{callId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'callId': {'value': call_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'callId': {'value': call_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -189,8 +189,8 @@ def modify_call(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/calls/{callId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'callId': {'value': call_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'callId': {'value': call_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -255,8 +255,8 @@ def modify_call_recording_state(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recording' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'callId': {'value': call_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'callId': {'value': call_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -320,8 +320,8 @@ def get_query_metadata_for_account_and_call(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'callId': {'value': call_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'callId': {'value': call_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -387,9 +387,9 @@ def get_metadata_for_recording(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'callId': {'value': call_id, 'encode': True}, - 'recordingId': {'value': recording_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'callId': {'value': call_id, 'encode': False}, + 'recordingId': {'value': recording_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -454,9 +454,9 @@ def delete_recording(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'callId': {'value': call_id, 'encode': True}, - 'recordingId': {'value': recording_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'callId': {'value': call_id, 'encode': False}, + 'recordingId': {'value': recording_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -516,9 +516,9 @@ def get_stream_recording_media(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'callId': {'value': call_id, 'encode': True}, - 'recordingId': {'value': recording_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'callId': {'value': call_id, 'encode': False}, + 'recordingId': {'value': recording_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -578,9 +578,9 @@ def delete_recording_media(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'callId': {'value': call_id, 'encode': True}, - 'recordingId': {'value': recording_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'callId': {'value': call_id, 'encode': False}, + 'recordingId': {'value': recording_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -640,9 +640,9 @@ def get_recording_transcription(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'callId': {'value': call_id, 'encode': True}, - 'recordingId': {'value': recording_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'callId': {'value': call_id, 'encode': False}, + 'recordingId': {'value': recording_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -710,9 +710,9 @@ def create_transcribe_recording(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'callId': {'value': call_id, 'encode': True}, - 'recordingId': {'value': recording_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'callId': {'value': call_id, 'encode': False}, + 'recordingId': {'value': recording_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -778,9 +778,9 @@ def delete_recording_transcription(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'callId': {'value': call_id, 'encode': True}, - 'recordingId': {'value': recording_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'callId': {'value': call_id, 'encode': False}, + 'recordingId': {'value': recording_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -847,7 +847,7 @@ def get_conferences_by_account(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/conferences' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -922,8 +922,8 @@ def get_conference_by_id(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/conferences/{conferenceId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'conferenceId': {'value': conference_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'conferenceId': {'value': conference_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -971,7 +971,7 @@ def modify_conference(self, Args: account_id (string): TODO: type description here. conference_id (string): TODO: type description here. - body (CallEngineModifyConferenceRequest, optional): TODO: type + body (ApiModifyConferenceRequest, optional): TODO: type description here. Returns: @@ -989,8 +989,8 @@ def modify_conference(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/conferences/{conferenceId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'conferenceId': {'value': conference_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'conferenceId': {'value': conference_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -1057,9 +1057,9 @@ def modify_conference_member(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/conferences/{conferenceId}/members/{callId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'conferenceId': {'value': conference_id, 'encode': True}, - 'callId': {'value': call_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'conferenceId': {'value': conference_id, 'encode': False}, + 'callId': {'value': call_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -1124,9 +1124,9 @@ def get_conference_member(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'conferenceId': {'value': conference_id, 'encode': True}, - 'memberId': {'value': member_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'conferenceId': {'value': conference_id, 'encode': False}, + 'memberId': {'value': member_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -1191,8 +1191,8 @@ def get_query_metadata_for_account_and_conference(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'conferenceId': {'value': conference_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'conferenceId': {'value': conference_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -1258,9 +1258,9 @@ def get_metadata_for_conference_recording(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'conferenceId': {'value': conference_id, 'encode': True}, - 'recordingId': {'value': recording_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'conferenceId': {'value': conference_id, 'encode': False}, + 'recordingId': {'value': recording_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -1326,9 +1326,9 @@ def get_stream_conference_recording_media(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'conferenceId': {'value': conference_id, 'encode': True}, - 'recordingId': {'value': recording_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'conferenceId': {'value': conference_id, 'encode': False}, + 'recordingId': {'value': recording_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path @@ -1397,7 +1397,7 @@ def get_query_metadata_for_account(self, # Prepare query URL _url_path = '/api/v2/accounts/{accountId}/recordings' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT) _query_builder += _url_path diff --git a/bandwidth/voice/controllers/base_controller.py b/bandwidth/voice/controllers/base_controller.py index 3f7583fb..35be446b 100644 --- a/bandwidth/voice/controllers/base_controller.py +++ b/bandwidth/voice/controllers/base_controller.py @@ -28,7 +28,7 @@ class BaseController(object): def global_headers(self): return { - 'user-agent': 'python-sdk-refs/tags/python6.13.2' + 'user-agent': 'python-sdk' } def __init__(self, config, call_back=None): diff --git a/bandwidth/voice/models/__init__.py b/bandwidth/voice/models/__init__.py index 1b9d7f05..7274beaa 100644 --- a/bandwidth/voice/models/__init__.py +++ b/bandwidth/voice/models/__init__.py @@ -3,7 +3,7 @@ 'api_call_state_response', 'api_create_call_request', 'api_modify_call_request', - 'call_engine_modify_conference_request', + 'api_modify_conference_request', 'api_transcribe_recording_request', 'conference_detail', 'conference_member_detail', diff --git a/bandwidth/voice/models/api_create_call_request.py b/bandwidth/voice/models/api_create_call_request.py index 7351a3f8..036de8ad 100644 --- a/bandwidth/voice/models/api_create_call_request.py +++ b/bandwidth/voice/models/api_create_call_request.py @@ -15,7 +15,12 @@ class ApiCreateCallRequest(object): Attributes: mfrom (string): Format is E164 - to (string): Format is E164 + to (string): Format is E164 or SIP URI + uui (string): When calling a SIP URI, this will be sent as the + 'User-To-User' header within the initial INVITE. An 'encoding' + parameter must be specified as described in + https://tools.ietf.org/html/rfc7433. This header cannot exceed 256 + characters, including the encoding parameter. call_timeout (float): TODO: type description here. callback_timeout (float): TODO: type description here. answer_url (string): TODO: type description here. @@ -43,6 +48,7 @@ class ApiCreateCallRequest(object): "to": 'to', "answer_url": 'answerUrl', "application_id": 'applicationId', + "uui": 'uui', "call_timeout": 'callTimeout', "callback_timeout": 'callbackTimeout', "answer_fallback_url": 'answerFallbackUrl', @@ -64,6 +70,7 @@ def __init__(self, to=None, answer_url=None, application_id=None, + uui=None, call_timeout=None, callback_timeout=None, answer_fallback_url=None, @@ -83,6 +90,7 @@ def __init__(self, # Initialize members of the class self.mfrom = mfrom self.to = to + self.uui = uui self.call_timeout = call_timeout self.callback_timeout = callback_timeout self.answer_url = answer_url @@ -122,6 +130,7 @@ def from_dictionary(cls, to = dictionary.get('to') answer_url = dictionary.get('answerUrl') application_id = dictionary.get('applicationId') + uui = dictionary.get('uui') call_timeout = dictionary.get('callTimeout') callback_timeout = dictionary.get('callbackTimeout') answer_fallback_url = dictionary.get('answerFallbackUrl') @@ -142,6 +151,7 @@ def from_dictionary(cls, to, answer_url, application_id, + uui, call_timeout, callback_timeout, answer_fallback_url, diff --git a/bandwidth/voice/models/api_modify_conference_request.py b/bandwidth/voice/models/api_modify_conference_request.py new file mode 100644 index 00000000..e3117c96 --- /dev/null +++ b/bandwidth/voice/models/api_modify_conference_request.py @@ -0,0 +1,103 @@ +# -*- coding: utf-8 -*- + +""" +bandwidth + +This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). +""" + + +class ApiModifyConferenceRequest(object): + + """Implementation of the 'ApiModifyConferenceRequest' model. + + TODO: type model description here. + + Attributes: + status (StatusEnum): TODO: type description here. + redirect_url (string): TODO: type description here. + redirect_fallback_url (string): TODO: type description here. + redirect_method (RedirectMethodEnum): TODO: type description here. + redirect_fallback_method (RedirectFallbackMethodEnum): TODO: type + description here. + username (string): TODO: type description here. + password (string): TODO: type description here. + fallback_username (string): TODO: type description here. + fallback_password (string): TODO: type description here. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "status": 'status', + "redirect_url": 'redirectUrl', + "redirect_fallback_url": 'redirectFallbackUrl', + "redirect_method": 'redirectMethod', + "redirect_fallback_method": 'redirectFallbackMethod', + "username": 'username', + "password": 'password', + "fallback_username": 'fallbackUsername', + "fallback_password": 'fallbackPassword' + } + + def __init__(self, + status=None, + redirect_url=None, + redirect_fallback_url=None, + redirect_method=None, + redirect_fallback_method=None, + username=None, + password=None, + fallback_username=None, + fallback_password=None): + """Constructor for the ApiModifyConferenceRequest class""" + + # Initialize members of the class + self.status = status + self.redirect_url = redirect_url + self.redirect_fallback_url = redirect_fallback_url + self.redirect_method = redirect_method + self.redirect_fallback_method = redirect_fallback_method + self.username = username + self.password = password + self.fallback_username = fallback_username + self.fallback_password = fallback_password + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if dictionary is None: + return None + + # Extract variables from the dictionary + status = dictionary.get('status') + redirect_url = dictionary.get('redirectUrl') + redirect_fallback_url = dictionary.get('redirectFallbackUrl') + redirect_method = dictionary.get('redirectMethod') + redirect_fallback_method = dictionary.get('redirectFallbackMethod') + username = dictionary.get('username') + password = dictionary.get('password') + fallback_username = dictionary.get('fallbackUsername') + fallback_password = dictionary.get('fallbackPassword') + + # Return an object of this model + return cls(status, + redirect_url, + redirect_fallback_url, + redirect_method, + redirect_fallback_method, + username, + password, + fallback_username, + fallback_password) diff --git a/bandwidth/voice/models/state_enum.py b/bandwidth/voice/models/state_enum.py index 5fb7ff43..adc39124 100644 --- a/bandwidth/voice/models/state_enum.py +++ b/bandwidth/voice/models/state_enum.py @@ -20,8 +20,8 @@ class StateEnum(object): """ - DISCONNECTED = 'disconnected' + DISCONNECTED = 'DISCONNECTED' - ANSWERED = 'answered' + ANSWERED = 'ANSWERED' - INITIATED = 'initiated' + INITIATED = 'INITIATED' diff --git a/bandwidth/webrtc/controllers/api_controller.py b/bandwidth/webrtc/controllers/api_controller.py index cc324876..fdac0ff4 100644 --- a/bandwidth/webrtc/controllers/api_controller.py +++ b/bandwidth/webrtc/controllers/api_controller.py @@ -54,7 +54,7 @@ def create_participant(self, # Prepare query URL _url_path = '/accounts/{accountId}/participants' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT) _query_builder += _url_path @@ -112,8 +112,8 @@ def get_participant(self, # Prepare query URL _url_path = '/accounts/{accountId}/participants/{participantId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'participantId': {'value': participant_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'participantId': {'value': participant_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT) _query_builder += _url_path @@ -171,8 +171,8 @@ def delete_participant(self, # Prepare query URL _url_path = '/accounts/{accountId}/participants/{participantId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'participantId': {'value': participant_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'participantId': {'value': participant_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT) _query_builder += _url_path @@ -225,7 +225,7 @@ def create_session(self, # Prepare query URL _url_path = '/accounts/{accountId}/sessions' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT) _query_builder += _url_path @@ -283,8 +283,8 @@ def get_session(self, # Prepare query URL _url_path = '/accounts/{accountId}/sessions/{sessionId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'sessionId': {'value': session_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'sessionId': {'value': session_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT) _query_builder += _url_path @@ -342,8 +342,8 @@ def delete_session(self, # Prepare query URL _url_path = '/accounts/{accountId}/sessions/{sessionId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'sessionId': {'value': session_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'sessionId': {'value': session_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT) _query_builder += _url_path @@ -394,8 +394,8 @@ def list_session_participants(self, # Prepare query URL _url_path = '/accounts/{accountId}/sessions/{sessionId}/participants' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'sessionId': {'value': session_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'sessionId': {'value': session_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT) _query_builder += _url_path @@ -459,9 +459,9 @@ def add_participant_to_session(self, # Prepare query URL _url_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'sessionId': {'value': session_id, 'encode': True}, - 'participantId': {'value': participant_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'sessionId': {'value': session_id, 'encode': False}, + 'participantId': {'value': participant_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT) _query_builder += _url_path @@ -522,9 +522,9 @@ def remove_participant_from_session(self, # Prepare query URL _url_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'participantId': {'value': participant_id, 'encode': True}, - 'sessionId': {'value': session_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'participantId': {'value': participant_id, 'encode': False}, + 'sessionId': {'value': session_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT) _query_builder += _url_path @@ -577,9 +577,9 @@ def get_participant_subscriptions(self, # Prepare query URL _url_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'participantId': {'value': participant_id, 'encode': True}, - 'sessionId': {'value': session_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'participantId': {'value': participant_id, 'encode': False}, + 'sessionId': {'value': session_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT) _query_builder += _url_path @@ -645,9 +645,9 @@ def update_participant_subscriptions(self, # Prepare query URL _url_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { - 'accountId': {'value': account_id, 'encode': True}, - 'participantId': {'value': participant_id, 'encode': True}, - 'sessionId': {'value': session_id, 'encode': True} + 'accountId': {'value': account_id, 'encode': False}, + 'participantId': {'value': participant_id, 'encode': False}, + 'sessionId': {'value': session_id, 'encode': False} }) _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT) _query_builder += _url_path diff --git a/bandwidth/webrtc/controllers/base_controller.py b/bandwidth/webrtc/controllers/base_controller.py index 3f7583fb..35be446b 100644 --- a/bandwidth/webrtc/controllers/base_controller.py +++ b/bandwidth/webrtc/controllers/base_controller.py @@ -28,7 +28,7 @@ class BaseController(object): def global_headers(self): return { - 'user-agent': 'python-sdk-refs/tags/python6.13.2' + 'user-agent': 'python-sdk' } def __init__(self, config, call_back=None): diff --git a/setup.py b/setup.py index e505858f..ae12a352 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( name='bandwidth-sdk', - version='6.14.2', + version='7.0.0', description='Bandwidth\'s set of APIs', long_description=long_description, long_description_content_type="text/markdown", @@ -24,7 +24,7 @@ 'requests>=2.9.1, <3.0', 'jsonpickle>=0.7.1, <1.0', 'cachecontrol>=0.11.7, <1.0', - 'python-dateutil>=2.5.1, <3.0', + 'python-dateutil>=2.5.3, <3.0', 'enum34>=1.1.6', 'lxml>=4.3.4' ]