Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Organizations Api uptake for twilio-python #815

Merged
merged 35 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b4c5734
feat: oauth sdk implementation (#799)
manisha1997 Jul 23, 2024
3e246e4
Python Orgs Api Changes
AsabuHere Sep 17, 2024
8395487
removing unwanted logs
AsabuHere Sep 17, 2024
bc5c16b
removing unwanted logs
AsabuHere Sep 17, 2024
a66f9e9
removing unwanted logs
AsabuHere Sep 17, 2024
b5a6490
removing unwanted logs
AsabuHere Sep 17, 2024
fac26ee
Fixing token fetch flow
AsabuHere Sep 17, 2024
15e15c0
twilio python changes for orgs api uptake
AsabuHere Sep 26, 2024
7b07ba7
twilio python changes for orgs api uptake
AsabuHere Sep 26, 2024
af11fd2
Update test_cluster.py
AsabuHere Sep 26, 2024
661785d
Update test_cluster.py
AsabuHere Sep 26, 2024
6a8c2d8
twilio python changes for orgs api uptake
AsabuHere Sep 26, 2024
1ba2f9b
twilio python changes for orgs api uptake
AsabuHere Sep 26, 2024
98708f0
twilio python changes for orgs api uptake
AsabuHere Sep 26, 2024
d78d5d5
twilio python changes for orgs api uptake
AsabuHere Sep 26, 2024
7bdf1b5
Merge branch 'main' into asabu_Python_changes
AsabuHere Sep 26, 2024
bc77770
twilio python changes for orgs api uptake
AsabuHere Sep 27, 2024
0211f23
twilio python changes for orgs api uptake
AsabuHere Sep 27, 2024
27dec32
twilio python changes for orgs api uptake
AsabuHere Sep 27, 2024
2959689
twilio python changes for orgs api uptake
AsabuHere Sep 27, 2024
b973065
Uptake of review comments
AsabuHere Oct 1, 2024
ceebd46
modified error messages
AsabuHere Oct 1, 2024
35b5015
Uptake of review comments
AsabuHere Oct 6, 2024
76fecab
Merge branch 'main' into asabu_Python_changes
AsabuHere Oct 6, 2024
e9eaa72
Organization api uptake changes
AsabuHere Dec 11, 2024
1c8420c
Organization api uptake changes
AsabuHere Dec 11, 2024
644f94b
Organization api uptake changes
AsabuHere Dec 11, 2024
66f3e28
Organization api uptake changes
AsabuHere Dec 11, 2024
88f6623
removing accept headers for delete operation
AsabuHere Dec 12, 2024
630c28c
Removing unwanted code
AsabuHere Dec 12, 2024
26ee4d3
Merge branch 'main' into asabu_Python_changes
AsabuHere Dec 12, 2024
ddb336b
Modified generated files
AsabuHere Dec 12, 2024
d79366e
removing unwamted logs
AsabuHere Dec 12, 2024
824ed9f
Formatting changes
AsabuHere Dec 12, 2024
3670f03
make prettier run
AsabuHere Dec 12, 2024
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
Prev Previous commit
Next Next commit
Fixing token fetch flow
  • Loading branch information
AsabuHere committed Sep 17, 2024
commit fac26eec4e513160d579e706fdd55802ad6f7e0b
2 changes: 1 addition & 1 deletion twilio/http/orgs_token_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from twilio.base.version import Version
from twilio.http.token_manager import TokenManager
from twilio.rest.preview_iam.organizations.token import TokenList
from twilio.rest.preview_iam.v1.token import TokenList


class OrgTokenManager(TokenManager):
Expand Down
2 changes: 1 addition & 1 deletion twilio/rest/preview_iam/PreviewIamBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, twilio: Client):

:returns: Domain for PreviewIam
"""
super().__init__(twilio, "https://preview.twilio.com/iam")
super().__init__(twilio, "https://preview-iam.twilio.com")
self._organizations: Optional[Organizations] = None
self._v1: Optional[V1] = None
# self._token: Optional[TokenList] = None
Expand Down
25 changes: 0 additions & 25 deletions twilio/rest/preview_iam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,20 @@ class PreviewIam(PreviewIamBase):

@property
def accounts(self) -> AccountList:
warn(
"accounts is deprecated. Use organizations.accounts instead.",
DeprecationWarning,
stacklevel=2,
)
return self.organizations.accounts

@property
def role_assignments(self) -> RoleAssignmentList:
warn(
"role_assignments is deprecated. Use organizations.role_assignments instead.",
DeprecationWarning,
stacklevel=2,
)
return self.organizations.role_assignments

# @property
# def users(self) -> UserList:
# warn(
# "users is deprecated. Use organizations.users instead.",
# DeprecationWarning,
# stacklevel=2,
# )
# return self.organizations.users

@property
def token(self) -> TokenList:
warn(
"token is deprecated. Use v1.token instead.",
DeprecationWarning,
stacklevel=2,
)
return self.v1.token

@property
def authorize(self) -> AuthorizeList:
warn(
"authorize is deprecated. Use v1.authorize instead.",
DeprecationWarning,
stacklevel=2,
)
return self.v1.authorize
2 changes: 1 addition & 1 deletion twilio/rest/preview_iam/organizations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, domain: Domain):

:param domain: The Twilio.preview_iam domain
"""
super().__init__(domain, "Organizations")
super().__init__(domain, "organizations")
self._accounts: Optional[AccountList] = None
self._role_assignments: Optional[RoleAssignmentList] = None
self._users: Optional[UserList] = None
Expand Down
2 changes: 1 addition & 1 deletion twilio/rest/preview_iam/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, domain: Domain):

:param domain: The Twilio.preview_iam domain
"""
super().__init__(domain, "V1")
super().__init__(domain, "v1")
self._token: Optional[TokenList] = None
self._authorize: Optional[AuthorizeList] = None

Expand Down
5 changes: 1 addition & 4 deletions twilio/rest/preview_iam/v1/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, version: Version):
"""
super().__init__(version)

self._uri = "https://preview-iam.twilio.com/v1/token"
self._uri = "/token"

def create(
self,
Expand Down Expand Up @@ -100,12 +100,9 @@ def create(
}
)
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
print(f'{data}')
print(f'{headers}')
payload = self._version.create(
method="POST", uri=self._uri, data=data, headers=headers
)
print('rest method output...')
return TokenInstance(self._version, payload)

async def create_async(
Expand Down
Loading