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

chore: Preview gather changes #839

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ twilio-python Changelog

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

[2025-01-31] Version 9.5.0
--------------------------
**Twiml**
- Convert Twiml Attribute `speechModel` of type enum to string **(breaking change)**


[2025-01-28] Version 9.4.4
--------------------------
**Library - Fix**
Expand Down
87 changes: 0 additions & 87 deletions twilio/rest/content/v1/content/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,26 +525,6 @@ def to_dict(self):
),
}

class TwilioSchedule(object):
"""
:ivar id:
:ivar title:
:ivar time_slots:
"""

def __init__(self, payload: Dict[str, Any]):

self.id: Optional[str] = payload.get("id")
self.title: Optional[str] = payload.get("title")
self.time_slots: Optional[str] = payload.get("time_slots")

def to_dict(self):
return {
"id": self.id,
"title": self.title,
"time_slots": self.time_slots,
}

class TwilioText(object):
"""
:ivar body:
Expand All @@ -571,7 +551,6 @@ class Types(object):
:ivar twilio_catalog:
:ivar twilio_carousel:
:ivar twilio_flows:
:ivar twilio_schedule:
:ivar whatsapp_card:
:ivar whatsapp_authentication:
"""
Expand Down Expand Up @@ -608,9 +587,6 @@ def __init__(self, payload: Dict[str, Any]):
self.twilio_flows: Optional[ContentList.TwilioFlows] = payload.get(
"twilio_flows"
)
self.twilio_schedule: Optional[ContentList.TwilioSchedule] = payload.get(
"twilio_schedule"
)
self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get(
"whatsapp_card"
)
Expand Down Expand Up @@ -666,11 +642,6 @@ def to_dict(self):
if self.twilio_flows is not None
else None
),
"twilio_schedule": (
self.twilio_schedule.to_dict()
if self.twilio_schedule is not None
else None
),
"whatsapp_card": (
self.whatsapp_card.to_dict()
if self.whatsapp_card is not None
Expand Down Expand Up @@ -1384,26 +1355,6 @@ def to_dict(self):
),
}

class TwilioSchedule(object):
"""
:ivar id:
:ivar title:
:ivar time_slots:
"""

def __init__(self, payload: Dict[str, Any]):

self.id: Optional[str] = payload.get("id")
self.title: Optional[str] = payload.get("title")
self.time_slots: Optional[str] = payload.get("time_slots")

def to_dict(self):
return {
"id": self.id,
"title": self.title,
"time_slots": self.time_slots,
}

class TwilioText(object):
"""
:ivar body:
Expand All @@ -1430,7 +1381,6 @@ class Types(object):
:ivar twilio_catalog:
:ivar twilio_carousel:
:ivar twilio_flows:
:ivar twilio_schedule:
:ivar whatsapp_card:
:ivar whatsapp_authentication:
"""
Expand Down Expand Up @@ -1467,9 +1417,6 @@ def __init__(self, payload: Dict[str, Any]):
self.twilio_flows: Optional[ContentList.TwilioFlows] = payload.get(
"twilio_flows"
)
self.twilio_schedule: Optional[ContentList.TwilioSchedule] = payload.get(
"twilio_schedule"
)
self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get(
"whatsapp_card"
)
Expand Down Expand Up @@ -1525,11 +1472,6 @@ def to_dict(self):
if self.twilio_flows is not None
else None
),
"twilio_schedule": (
self.twilio_schedule.to_dict()
if self.twilio_schedule is not None
else None
),
"whatsapp_card": (
self.whatsapp_card.to_dict()
if self.whatsapp_card is not None
Expand Down Expand Up @@ -2244,26 +2186,6 @@ def to_dict(self):
),
}

class TwilioSchedule(object):
"""
:ivar id:
:ivar title:
:ivar time_slots:
"""

def __init__(self, payload: Dict[str, Any]):

self.id: Optional[str] = payload.get("id")
self.title: Optional[str] = payload.get("title")
self.time_slots: Optional[str] = payload.get("time_slots")

def to_dict(self):
return {
"id": self.id,
"title": self.title,
"time_slots": self.time_slots,
}

class TwilioText(object):
"""
:ivar body:
Expand All @@ -2290,7 +2212,6 @@ class Types(object):
:ivar twilio_catalog:
:ivar twilio_carousel:
:ivar twilio_flows:
:ivar twilio_schedule:
:ivar whatsapp_card:
:ivar whatsapp_authentication:
"""
Expand Down Expand Up @@ -2327,9 +2248,6 @@ def __init__(self, payload: Dict[str, Any]):
self.twilio_flows: Optional[ContentList.TwilioFlows] = payload.get(
"twilio_flows"
)
self.twilio_schedule: Optional[ContentList.TwilioSchedule] = payload.get(
"twilio_schedule"
)
self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get(
"whatsapp_card"
)
Expand Down Expand Up @@ -2385,11 +2303,6 @@ def to_dict(self):
if self.twilio_flows is not None
else None
),
"twilio_schedule": (
self.twilio_schedule.to_dict()
if self.twilio_schedule is not None
else None
),
"whatsapp_card": (
self.whatsapp_card.to_dict()
if self.whatsapp_card is not None
Expand Down
1 change: 0 additions & 1 deletion twilio/rest/conversations/v1/address_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class Type(object):
GBM = "gbm"
EMAIL = "email"
RCS = "rcs"
APPLE = "apple"

"""
:ivar sid: A 34 character string that uniquely identifies this resource.
Expand Down
40 changes: 2 additions & 38 deletions twilio/rest/events/v1/subscription/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class SubscriptionInstance(InstanceResource):
:ivar sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created.
:ivar url: The URL of this resource.
:ivar links: Contains a dictionary of URL links to nested resources of this Subscription.
:ivar receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription.
"""

def __init__(
Expand All @@ -53,9 +52,6 @@ def __init__(
self.sink_sid: Optional[str] = payload.get("sink_sid")
self.url: Optional[str] = payload.get("url")
self.links: Optional[Dict[str, object]] = payload.get("links")
self.receive_events_from_subaccounts: Optional[bool] = payload.get(
"receive_events_from_subaccounts"
)

self._solution = {
"sid": sid or self.sid,
Expand Down Expand Up @@ -117,42 +113,36 @@ def update(
self,
description: Union[str, object] = values.unset,
sink_sid: Union[str, object] = values.unset,
receive_events_from_subaccounts: Union[bool, object] = values.unset,
) -> "SubscriptionInstance":
"""
Update the SubscriptionInstance

:param description: A human readable description for the Subscription.
:param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created.
:param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription.

:returns: The updated SubscriptionInstance
"""
return self._proxy.update(
description=description,
sink_sid=sink_sid,
receive_events_from_subaccounts=receive_events_from_subaccounts,
)

async def update_async(
self,
description: Union[str, object] = values.unset,
sink_sid: Union[str, object] = values.unset,
receive_events_from_subaccounts: Union[bool, object] = values.unset,
) -> "SubscriptionInstance":
"""
Asynchronous coroutine to update the SubscriptionInstance

:param description: A human readable description for the Subscription.
:param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created.
:param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription.

:returns: The updated SubscriptionInstance
"""
return await self._proxy.update_async(
description=description,
sink_sid=sink_sid,
receive_events_from_subaccounts=receive_events_from_subaccounts,
)

@property
Expand Down Expand Up @@ -263,14 +253,12 @@ def update(
self,
description: Union[str, object] = values.unset,
sink_sid: Union[str, object] = values.unset,
receive_events_from_subaccounts: Union[bool, object] = values.unset,
) -> SubscriptionInstance:
"""
Update the SubscriptionInstance

:param description: A human readable description for the Subscription.
:param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created.
:param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription.

:returns: The updated SubscriptionInstance
"""
Expand All @@ -279,9 +267,6 @@ def update(
{
"Description": description,
"SinkSid": sink_sid,
"ReceiveEventsFromSubaccounts": serialize.boolean_to_string(
receive_events_from_subaccounts
),
}
)
headers = values.of({})
Expand All @@ -300,14 +285,12 @@ async def update_async(
self,
description: Union[str, object] = values.unset,
sink_sid: Union[str, object] = values.unset,
receive_events_from_subaccounts: Union[bool, object] = values.unset,
) -> SubscriptionInstance:
"""
Asynchronous coroutine to update the SubscriptionInstance

:param description: A human readable description for the Subscription.
:param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created.
:param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription.

:returns: The updated SubscriptionInstance
"""
Expand All @@ -316,9 +299,6 @@ async def update_async(
{
"Description": description,
"SinkSid": sink_sid,
"ReceiveEventsFromSubaccounts": serialize.boolean_to_string(
receive_events_from_subaccounts
),
}
)
headers = values.of({})
Expand Down Expand Up @@ -388,19 +368,14 @@ def __init__(self, version: Version):
self._uri = "/Subscriptions"

def create(
self,
description: str,
sink_sid: str,
types: List[object],
receive_events_from_subaccounts: Union[bool, object] = values.unset,
self, description: str, sink_sid: str, types: List[object]
) -> SubscriptionInstance:
"""
Create the SubscriptionInstance

:param description: A human readable description for the Subscription **This value should not contain PII.**
:param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created.
:param types: An array of objects containing the subscribed Event Types
:param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription.

:returns: The created SubscriptionInstance
"""
Expand All @@ -410,9 +385,6 @@ def create(
"Description": description,
"SinkSid": sink_sid,
"Types": serialize.map(types, lambda e: serialize.object(e)),
"ReceiveEventsFromSubaccounts": serialize.boolean_to_string(
receive_events_from_subaccounts
),
}
)
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
Expand All @@ -428,19 +400,14 @@ def create(
return SubscriptionInstance(self._version, payload)

async def create_async(
self,
description: str,
sink_sid: str,
types: List[object],
receive_events_from_subaccounts: Union[bool, object] = values.unset,
self, description: str, sink_sid: str, types: List[object]
) -> SubscriptionInstance:
"""
Asynchronously create the SubscriptionInstance

:param description: A human readable description for the Subscription **This value should not contain PII.**
:param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created.
:param types: An array of objects containing the subscribed Event Types
:param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription.

:returns: The created SubscriptionInstance
"""
Expand All @@ -450,9 +417,6 @@ async def create_async(
"Description": description,
"SinkSid": sink_sid,
"Types": serialize.map(types, lambda e: serialize.object(e)),
"ReceiveEventsFromSubaccounts": serialize.boolean_to_string(
receive_events_from_subaccounts
),
}
)
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
Expand Down
12 changes: 6 additions & 6 deletions twilio/rest/iam/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from twilio.base.domain import Domain
from twilio.rest.iam.v1.api_key import ApiKeyList
from twilio.rest.iam.v1.get_api_keys import GetApiKeysList
from twilio.rest.iam.v1.new_api_key import NewApiKeyList
from twilio.rest.iam.v1.key import KeyList


class V1(Version):
Expand All @@ -31,7 +31,7 @@ def __init__(self, domain: Domain):
super().__init__(domain, "v1")
self._api_key: Optional[ApiKeyList] = None
self._get_api_keys: Optional[GetApiKeysList] = None
self._new_api_key: Optional[NewApiKeyList] = None
self._keys: Optional[KeyList] = None

@property
def api_key(self) -> ApiKeyList:
Expand All @@ -46,10 +46,10 @@ def get_api_keys(self) -> GetApiKeysList:
return self._get_api_keys

@property
def new_api_key(self) -> NewApiKeyList:
if self._new_api_key is None:
self._new_api_key = NewApiKeyList(self)
return self._new_api_key
def keys(self) -> KeyList:
if self._keys is None:
self._keys = KeyList(self)
return self._keys

def __repr__(self) -> str:
"""
Expand Down
Loading
Loading