10000 Workaround for number transfer from subaccounts · twilio/twilio-python@b413e81 · GitHub
[go: up one dir, main page]

Skip to content

Commit b413e81

Browse files
committed
Workaround for number transfer from subaccounts
1 parent 26f6707 commit b413e81

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

twilio/rest/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class TwilioRestClient(object):
5959
"""
6060

6161
def __init__(self, account=None, token=None, base="https://api.twilio.com",
62-
version="2010-04-01", client=None, timeout=UNSET_TIMEOUT):
62+
version="2010-04-01", client=None, timeout=UNSET_TIMEOUT, subaccount=None):
6363
"""
6464
Create a Twilio REST API client.
6565
"""
@@ -87,7 +87,9 @@ def __init__(self, account=None, token=None, base="https://api.twilio.com",
8787
self.base = base
8888
auth = (account, token)
8989
version_uri = "%s/%s" % (base, version)
90-
account_uri = "%s/%s/Accounts/%s" % (base, version, account)
90+
if subaccount is None:
91+
subaccount = account
92+
account_uri = "%s/%s/Accounts/%s" % (base, version, subaccount)
9193

9294
self.accounts = Accounts(version_uri, auth, timeout)
9395
self.applications = Applications(account_uri, auth, timeout)

0 commit comments

Comments
 (0)
0