Skip to content

Commit

Permalink
[Librarian] Regenerated @ ca4a5892d2b6a6161860845fe1152af07920bc07 40…
Browse files Browse the repository at this point in the history
…3073118470eabf87311669c7fea876d35ced04
  • Loading branch information
twilio-dx committed Dec 12, 2024
1 parent 0b8aab4 commit ec1b6bf
Show file tree
Hide file tree
Showing 506 changed files with 20,008 additions and 5,625 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ twilio-python Changelog

Here you can see the full list of changes between each twilio-python release.

[2024-12-12] Version 9.4.0
--------------------------
**Library - Feature**
- [PR #825](https://github.com/twilio/twilio-python/pull/825): Docs update and examples for organization api uptake and public oauth. Thanks to [@AsabuHere](https://github.com/AsabuHere)!
- [PR #815](https://github.com/twilio/twilio-python/pull/815): Organizations Api uptake for twilio-python. Thanks to [@AsabuHere](https://github.com/AsabuHere)!


[2024-12-05] Version 9.3.8
--------------------------
**Api**
Expand Down
6 changes: 4 additions & 2 deletions examples/organization_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ def example():
"""
self.client = Client(
account_sid=ACCOUNT_SID,
credential_provider= OrgsCredentialProvider(CLIENT_ID,CLIENT_SECRET)
credential_provider=OrgsCredentialProvider(CLIENT_ID, CLIENT_SECRET),
)

accounts = self.client.preview_iam.organization(organization_sid=ORGS_SID).accounts.stream()
accounts = self.client.preview_iam.organization(
organization_sid=ORGS_SID
).accounts.stream()
for record in accounts:
print(record)

Expand Down
2 changes: 1 addition & 1 deletion examples/public_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def example():
"""
self.client = Client(
account_sid=ACCOUNT_SID,
credential_provider= ClientCredentialProvider(CLIENT_ID,CLIENT_SECRET)
credential_provider=ClientCredentialProvider(CLIENT_ID, CLIENT_SECRET),
)

msg = self.client.messages.create(
Expand Down
32 changes: 15 additions & 17 deletions twilio/rest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from twilio.rest.events import Events
from twilio.rest.flex_api import FlexApi
from twilio.rest.frontline_api import FrontlineApi
from twilio.rest.preview_iam import PreviewIam
from twilio.rest.iam import Iam
from twilio.rest.insights import Insights
from twilio.rest.intelligence import Intelligence
Expand Down Expand Up @@ -96,7 +97,6 @@ def __init__(
environment=None,
edge=None,
user_agent_extensions=None,
credential_provider=None,
):
"""
Initializes the Twilio Client
Expand All @@ -122,7 +122,6 @@ def __init__(
environment,
edge,
user_agent_extensions,
credential_provider,
)

# Domains
Expand All @@ -136,8 +135,8 @@ def __init__(
self._events: Optional["Events"] = None
self._flex_api: Optional["FlexApi"] = None
self._frontline_api: Optional["FrontlineApi"] = None
self._iam: Optional["Iam"] = None
self._preview_iam: Optional["PreviewIam"] = None
self._iam: Optional["Iam"] = None
self._insights: Optional["Insights"] = None
self._intelligence: Optional["Intelligence"] = None
self._ip_messaging: Optional["IpMessaging"] = None
Expand All @@ -150,7 +149,6 @@ def __init__(
self._numbers: Optional["Numbers"] = None
self._oauth: Optional["Oauth"] = None
self._preview: Optional["Preview"] = None
self._preview_iam: Optional["PreviewIam"] = None
self._pricing: Optional["Pricing"] = None
self._proxy: Optional["Proxy"] = None
self._routes: Optional["Routes"] = None
Expand Down Expand Up @@ -296,6 +294,19 @@ def frontline_api(self) -> "FrontlineApi":
self._frontline_api = FrontlineApi(self)
return self._frontline_api

@property
def preview_iam(self) -> "PreviewIam":
"""
Access the PreviewIam Twilio Domain
:returns: PreviewIam Twilio Domain
"""
if self._preview_iam is None:
from twilio.rest.preview_iam import PreviewIam

self._preview_iam = PreviewIam(self)
return self._preview_iam

@property
def iam(self) -> "Iam":
"""
Expand Down Expand Up @@ -400,19 +411,6 @@ def microvisor(self) -> "Microvisor":
self._microvisor = Microvisor(self)
return self._microvisor

@property
def preview_iam(self) -> "PreviewIam":
"""
Access the PreviewIam Twilio Domain
:returns: PreviewIam Twilio Domain
"""
if self._preview_iam is None:
from twilio.rest.preview_iam import PreviewIam

self._preview_iam = PreviewIam(self)
return self._preview_iam

@property
def monitor(self) -> "Monitor":
"""
Expand Down
16 changes: 10 additions & 6 deletions twilio/rest/accounts/v1/auth_token_promotion.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,14 @@ def update(self) -> AuthTokenPromotionInstance:
:returns: The updated AuthTokenPromotionInstance
"""

data = values.of({})
headers = values.of({})

headers["Accept"] = "application/json"

payload = self._version.update(
method="POST",
uri=self._uri,
data=data,
method="POST", uri=self._uri, data=data, headers=headers
)

return AuthTokenPromotionInstance(self._version, payload)
Expand All @@ -123,12 +125,14 @@ async def update_async(self) -> AuthTokenPromotionInstance:
:returns: The updated AuthTokenPromotionInstance
"""

data = values.of({})
headers = values.of({})

headers["Accept"] = "application/json"

payload = await self._version.update_async(
method="POST",
uri=self._uri,
data=data,
method="POST", uri=self._uri, data=data, headers=headers
)

return AuthTokenPromotionInstance(self._version, payload)
Expand Down
8 changes: 8 additions & 0 deletions twilio/rest/accounts/v1/bulk_consents.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def create(self, items: List[object]) -> BulkConsentsInstance:
)
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})

headers["Content-Type"] = "application/x-www-form-urlencoded"

headers["Accept"] = "application/json"

payload = self._version.create(
method="POST", uri=self._uri, data=data, headers=headers
)
Expand All @@ -91,6 +95,10 @@ async def create_async(self, items: List[object]) -> BulkConsentsInstance:
)
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})

headers["Content-Type"] = "application/x-www-form-urlencoded"

headers["Accept"] = "application/json"

payload = await self._version.create_async(
method="POST", uri=self._uri, data=data, headers=headers
)
Expand Down
8 changes: 8 additions & 0 deletions twilio/rest/accounts/v1/bulk_contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def create(self, items: List[object]) -> BulkContactsInstance:
)
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})

headers["Content-Type"] = "application/x-www-form-urlencoded"

headers["Accept"] = "application/json"

payload = self._version.create(
method="POST", uri=self._uri, data=data, headers=headers
)
Expand All @@ -91,6 +95,10 @@ async def create_async(self, items: List[object]) -> BulkContactsInstance:
)
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})

headers["Content-Type"] = "application/x-www-form-urlencoded"

headers["Accept"] = "application/json"

payload = await self._version.create_async(
method="POST", uri=self._uri, data=data, headers=headers
)
Expand Down
72 changes: 52 additions & 20 deletions twilio/rest/accounts/v1/credential/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ def delete(self) -> bool:
:returns: True if delete succeeds, False otherwise
"""
return self._version.delete(
method="DELETE",
uri=self._uri,
)

headers = values.of({})

return self._version.delete(method="DELETE", uri=self._uri, headers=headers)

async def delete_async(self) -> bool:
"""
Expand All @@ -176,9 +176,11 @@ async def delete_async(self) -> bool:
:returns: True if delete succeeds, False otherwise
"""

headers = values.of({})

return await self._version.delete_async(
method="DELETE",
uri=self._uri,
method="DELETE", uri=self._uri, headers=headers
)

def fetch(self) -> AwsInstance:
Expand All @@ -189,10 +191,11 @@ def fetch(self) -> AwsInstance:
:returns: The fetched AwsInstance
"""

payload = self._version.fetch(
method="GET",
uri=self._uri,
)
headers = values.of({})

headers["Accept"] = "application/json"

payload = self._version.fetch(method="GET", uri=self._uri, headers=headers)

return AwsInstance(
self._version,
Expand All @@ -208,9 +211,12 @@ async def fetch_async(self) -> AwsInstance:
:returns: The fetched AwsInstance
"""

headers = values.of({})

headers["Accept"] = "application/json"

payload = await self._version.fetch_async(
method="GET",
uri=self._uri,
method="GET", uri=self._uri, headers=headers
)

return AwsInstance(
Expand All @@ -227,16 +233,20 @@ def update(self, friendly_name: Union[str, object] = values.unset) -> AwsInstanc
:returns: The updated AwsInstance
"""

data = values.of(
{
"FriendlyName": friendly_name,
}
)
headers = values.of({})

headers["Content-Type"] = "application/x-www-form-urlencoded"

headers["Accept"] = "application/json"

payload = self._version.update(
method="POST",
uri=self._uri,
data=data,
method="POST", uri=self._uri, data=data, headers=headers
)

return AwsInstance(self._version, payload, sid=self._solution["sid"])
Expand All @@ -251,16 +261,20 @@ async def update_async(
:returns: The updated AwsInstance
"""

data = values.of(
{
"FriendlyName": friendly_name,
}
)
headers = values.of({})

headers["Content-Type"] = "application/x-www-form-urlencoded"

headers["Accept"] = "application/json"

payload = await self._version.update_async(
method="POST",
uri=self._uri,
data=data,
method="POST", uri=self._uri, data=data, headers=headers
)

return AwsInstance(self._version, payload, sid=self._solution["sid"])
Expand Down Expand Up @@ -332,6 +346,10 @@ def create(
)
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})

headers["Content-Type"] = "application/x-www-form-urlencoded"

headers["Accept"] = "application/json"

payload = self._version.create(
method="POST", uri=self._uri, data=data, headers=headers
)
Expand Down Expand Up @@ -363,6 +381,10 @@ async def create_async(
)
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})

headers["Content-Type"] = "application/x-www-form-urlencoded"

headers["Accept"] = "application/json"

payload = await self._version.create_async(
method="POST", uri=self._uri, data=data, headers=headers
)
Expand Down Expand Up @@ -496,7 +518,13 @@ def page(
}
)

response = self._version.page(method="GET", uri=self._uri, params=data)
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})

headers["Accept"] = "application/json"

response = self._version.page(
method="GET", uri=self._uri, params=data, headers=headers
)
return AwsPage(self._version, response)

async def page_async(
Expand All @@ -523,8 +551,12 @@ async def page_async(
}
)

headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})

headers["Accept"] = "application/json"

response = await self._version.page_async(
method="GET", uri=self._uri, params=data
method="GET", uri=self._uri, params=data, headers=headers
)
return AwsPage(self._version, response)

Expand Down
Loading

0 comments on commit ec1b6bf

Please sign in to comment.