Skip to content

Commit

Permalink
[Librarian] Regenerated @ a7caf52aaea6fe6c7b30170a468564bcea4f0362 13…
Browse files Browse the repository at this point in the history
…ec50967b82ae43900a263102daafb96aa61935
  • Loading branch information
twilio-dx committed Jan 28, 2025
1 parent ab846b4 commit 338cbb0
Show file tree
Hide file tree
Showing 11 changed files with 212 additions and 45 deletions.
23 changes: 23 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,29 @@ twilio-python Changelog

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

[2025-01-28] Version 9.4.4
--------------------------
**Library - Fix**
- [PR #822](https://github.com/twilio/twilio-python/pull/822): Fix for 10 vulnerabilities. Thanks to [@twilio-product-security](https://github.com/twilio-product-security)!

**Library - Chore**
- [PR #834](https://github.com/twilio/twilio-python/pull/834): update httpclient. Thanks to [@manisha1997](https://github.com/manisha1997)!
- [PR #837](https://github.com/twilio/twilio-python/pull/837): enable newer versions of aiohttp-retry. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
- [PR #833](https://github.com/twilio/twilio-python/pull/833): created bug report issue template. Thanks to [@sbansla](https://github.com/sbansla)!

**Api**
- Add open-api file tag to `conference/call recordings` and `recording_transcriptions`.

**Events**
- Add support for subaccount subscriptions (beta)

**Insights**
- add new region to conference APIs

**Lookups**
- Add new `parnter_sub_id` query parameter to the lookup request


[2025-01-13] Version 9.4.3
--------------------------
**Messaging**
Expand Down
1 change: 0 additions & 1 deletion tests/unit/http/test_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ def test_session_not_preserved(self):
self.assertEqual(response_2.content, "response_2")



class MyVersion(Version):
def __init__(self, domain):
super().__init__(domain, "v1")
Expand Down
87 changes: 87 additions & 0 deletions twilio/rest/content/v1/content/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,26 @@ 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 @@ -551,6 +571,7 @@ 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 @@ -587,6 +608,9 @@ 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 @@ -642,6 +666,11 @@ 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 @@ -1355,6 +1384,26 @@ 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 @@ -1381,6 +1430,7 @@ 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 @@ -1417,6 +1467,9 @@ 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 @@ -1472,6 +1525,11 @@ 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 @@ -2186,6 +2244,26 @@ 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 @@ -2212,6 +2290,7 @@ 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 @@ -2248,6 +2327,9 @@ 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 @@ -2303,6 +2385,11 @@ 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: 1 addition & 0 deletions twilio/rest/conversations/v1/address_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ 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: 38 additions & 2 deletions twilio/rest/events/v1/subscription/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ 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 @@ -52,6 +53,9 @@ 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 @@ -113,36 +117,42 @@ 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 @@ -253,12 +263,14 @@ 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 @@ -267,6 +279,9 @@ def update(
{
"Description": description,
"SinkSid": sink_sid,
"ReceiveEventsFromSubaccounts": serialize.boolean_to_string(
receive_events_from_subaccounts
),
}
)
headers = values.of({})
Expand All @@ -285,12 +300,14 @@ 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 @@ -299,6 +316,9 @@ 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 @@ -368,14 +388,19 @@ def __init__(self, version: Version):
self._uri = "/Subscriptions"

def create(
self, description: str, sink_sid: str, types: List[object]
self,
description: str,
sink_sid: str,
types: List[object],
receive_events_from_subaccounts: Union[bool, object] = values.unset,
) -> 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 @@ -385,6 +410,9 @@ 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 @@ -400,14 +428,19 @@ def create(
return SubscriptionInstance(self._version, payload)

async def create_async(
self, description: str, sink_sid: str, types: List[object]
self,
description: str,
sink_sid: str,
types: List[object],
receive_events_from_subaccounts: Union[bool, object] = values.unset,
) -> 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 @@ -417,6 +450,9 @@ 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
Loading

0 comments on commit 338cbb0

Please sign in to comment.