Skip to content

Commit 1ba2f9b

Browse files
committed
twilio python changes for orgs api uptake
1 parent 6a8c2d8 commit 1ba2f9b

File tree

9 files changed

+2
-97
lines changed

9 files changed

+2
-97
lines changed

twilio/base/client_base.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ def request(
9999
if auth_strategy.auth_type == AuthType.TOKEN:
100100
auth_strategy.fetch_token()
101101
headers["Authorization"] = auth_strategy.get_auth_string()
102-
if auth_strategy.auth_type == AuthType.BASIC:
103-
headers["Authorization"] = auth_strategy.get_auth_string()
104102
else:
105103
auth = self.get_auth(auth)
106104

@@ -161,8 +159,6 @@ async def request_async(
161159
if auth_strategy.auth_type == AuthType.TOKEN:
162160
auth_strategy.fetch_token()
163161
headers["Authorization"] = auth_strategy.get_auth_string()
164-
if auth_strategy.auth_type == AuthType.BASIC:
165-
headers["Authorization"] = auth_strategy.get_auth_string()
166162
else:
167163
auth = self.get_auth(auth)
168164

@@ -262,10 +258,3 @@ def __repr__(self) -> str:
262258
:returns: Machine friendly representation
263259
"""
264260
return "<Twilio {}>".format(self.account_sid)
265-
266-
267-
def dynamic_import(module_name, class_name):
268-
from importlib import import_module
269-
270-
module = import_module(module_name)
271-
return getattr(module, class_name)

twilio/base/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def get_uri(code: int) -> str:
6262
"\n\n{twilio_returned}\n\n{message}\n".format(
6363
red_error=red("HTTP Error"),
6464
request_was=white("Your request was:"),
65-
http_line=teal("%s %s" % (self.method, self.uri, self.data, self.uri)),
65+
http_line=teal("%s %s" % (self.method, self.uri)),
6666
twilio_returned=white("Twilio returned the following information:"),
6767
message=blue(str(self.msg)),
6868
)

twilio/base/oauth_token_base.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

twilio/base/version.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,6 @@ def create(
447447
auth: Optional[Tuple[str, str]] = None,
448448
timeout: Optional[float] = None,
449449
allow_redirects: bool = False,
450-
is_oauth: bool = False,
451450
) -> Any:
452451
"""
453452
Create a resource instance.
@@ -474,7 +473,6 @@ async def create_async(
474473
auth: Optional[Tuple[str, str]] = None,
475474
timeout: Optional[float] = None,
476475
allow_redirects: bool = False,
477-
is_oauth: bool = False,
478476
) -> Any:
479477
"""
480478
Asynchronously create a resource instance.
@@ -488,6 +486,5 @@ async def create_async(
488486
auth=auth,
489487
timeout=timeout,
490488
allow_redirects=allow_redirects,
491-
is_oauth=is_oauth,
492489
)
493490
return self._parse_create(method, uri, response)

twilio/http/no_auth_http_client.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

twilio/http/orgs_token_manager.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def __init__(
3131
self.client = Client()
3232

3333
def fetch_access_token(self):
34-
# token_list = TokenList(version)
3534
token_instance = self.client.preview_iam.v1.token.create(
3635
grant_type=self.grant_type,
3736
client_id=self.client_id,

twilio/rest/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ def __init__(
112112
:returns: Twilio Client
113113
:rtype: twilio.rest.Client
114114
"""
115-
116115
super().__init__(
117116
username,
118117
password,

twilio/rest/preview_iam/organizations/__init__.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,9 @@ def __init__(self, domain: Domain):
3535
@property
3636
def accounts(self) -> AccountList:
3737
if self._accounts is None:
38-
self._accounts = AccountList(self, organization_sid="OR64adedc0f4dc99b9113305f725677b47")
38+
self._accounts = AccountList(self)
3939
return self._accounts
4040

41-
# @property
42-
# def accounts(self, organization_sid) -> AccountList:
43-
# if self._accounts is None:
44-
# self._accounts = AccountList(self, "OR64adedc0f4dc99b9113305f725677b47")
45-
# return self._accounts
4641

4742
@property
4843
def role_assignments(self) -> RoleAssignmentList:

twilio/twilio_bearer_token_auth.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)