8000 Add status_callback_url to PhoneNumber.update() · ryanhorn/twilio-python@e7b14de · GitHub
[go: up one dir, main page]

Skip to content

Commit e7b14de

Browse files
committed
Add status_callback_url to PhoneNumber.update()
The StatusCallback property of phone numbers is unique in that it  specifies a URL, but the property name does not end in "Url" like  VoiceUrl, VoiceFallbackUrl, SmsUrl, and SmsFallbackUrl do. As a convenience, the purchase method of PhoneNumbers automatically assigns any status_callback_url argument to the StatusCallback property. This change adds the same convenience to the update method of PhoneNumber.
1 parent 164d8fc commit e7b14de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

twilio/rest/resources/phone_numbers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,13 @@ def transfer(self, account_sid):
7979
a = self.parent.transfer(self.name, account_sid)
8080
self.load(a.__dict__)
8181

82-
def update(self, **kwargs):
82+
def update(self, status_callback_url=None, **kwargs):
8383
"""
8484
Update this phone number instance.
8585
"""
86+
kwargs["StatusCallback"] = kwargs.get("status_callback",
87+
status_callback_url)
88+
8689
a = self.parent.update(self.name, **kwargs)
8790
self.load(a.__dict__)
8891

0 commit comments

Comments
 (0)
0