Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions bandwidth/models/bxml/verbs/phone_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def __init__(
self, number: str, transfer_answer_url: str=None, transfer_answer_method: str=None,
transfer_answer_fallback_url: str=None, transfer_answer_fallback_method: str=None,
transfer_disconnect_url: str=None, transfer_disconnect_method: str=None, username: str=None,
password: str=None, fallback_username: str=None, fallback_password: str=None, tag: str=None
password: str=None, fallback_username: str=None, fallback_password: str=None, tag: str=None,
uui: str=None
):
"""Initialize a <PhoneNumber> verb

Expand All @@ -31,6 +32,7 @@ def __init__(
fallback_username (str, optional): The username to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
fallback_password (str, optional): The password to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
tag (str, optional): A custom string that will be sent with these and all future callbacks unless overwritten by a future tag attribute or cleared. May be cleared by setting tag="" Max length 256 characters. Defaults to None.
uui (str, optional): A comma-separated list of 'User-To-User' headers to be sent in the INVITE. The entire value cannot exceed 350 characters, including parameters and separators. Defaults to None.
"""
self.number = number
self.transfer_answer_url = transfer_answer_url
Expand All @@ -44,6 +46,7 @@ def __init__(
self.fallback_username = fallback_username
self.fallback_password = fallback_password
self.tag = tag
self.uui = uui
super().__init__(
tag="PhoneNumber",
content=self.number
Expand All @@ -62,5 +65,6 @@ def _attributes(self):
"password": self.password,
"fallbackUsername": self.fallback_username,
"fallbackPassword": self.fallback_password,
"tag": self.tag
"tag": self.tag,
"uui": self.uui
}
3 changes: 2 additions & 1 deletion test/unit/models/bxml/test_phone_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class TestPhoneNumber(unittest.TestCase):
def setUp(self):
self.phone_number = PhoneNumber(
number="+19195551234",
uui="abc123",
transfer_answer_url="https://example.com/webhooks/transfer_answer",
transfer_answer_method="POST",
tag=""
Expand All @@ -25,5 +26,5 @@ def test_instance(self):
assert isinstance(self.phone_number, Verb)

def test_to_bxml(self):
expected = '<PhoneNumber transferAnswerUrl="https://example.com/webhooks/transfer_answer" transferAnswerMethod="POST" tag="">+19195551234</PhoneNumber>'
expected = '<PhoneNumber transferAnswerUrl="https://example.com/webhooks/transfer_answer" transferAnswerMethod="POST" tag="" uui="abc123">+19195551234</PhoneNumber>'
assert expected == self.phone_number.to_bxml()