Skip to content

Commit

Permalink
[Librarian] Regenerated @ fffff4e2a9903902262deb482f4cefeb44c2d081
Browse files Browse the repository at this point in the history
  • Loading branch information
twilio-dx committed May 18, 2023
1 parent d40bb65 commit 58f5223
Show file tree
Hide file tree
Showing 19 changed files with 1,009 additions and 280 deletions.
17 changes: 17 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ twilio-python Changelog

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

[2023-05-18] Version 8.2.1
--------------------------
**Conversations**
- Added `AddressCountry` parameter to Address Configuration endpoint, to support regional short code addresses
- Added query parameters `start_date`, `end_date` and `state` in list Conversations resource for filtering

**Insights**
- Added annotations parameters to list summary api

**Messaging**
- Add GET domainByMessagingService endpoint to linkShortening service
- Add `disable_https` to link shortening domain_config properties

**Numbers**
- Add bulk_eligibility api under version `/v1`.


[2023-05-04] Version 8.2.0
--------------------------
**Conversations**
Expand Down
8 changes: 8 additions & 0 deletions twilio/rest/conversations/v1/address_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class Type(object):
:ivar date_created: The date that this resource was created.
:ivar date_updated: The date that this resource was last updated.
:ivar url: An absolute API resource URL for this address configuration.
:ivar address_country: An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses.
"""

def __init__(
Expand All @@ -69,6 +70,7 @@ def __init__(
payload.get("date_updated")
)
self.url: Optional[str] = payload.get("url")
self.address_country: Optional[str] = payload.get("address_country")

self._solution = {
"sid": sid or self.sid,
Expand Down Expand Up @@ -475,6 +477,7 @@ def create(
auto_creation_webhook_filters: Union[List[str], object] = values.unset,
auto_creation_studio_flow_sid: Union[str, object] = values.unset,
auto_creation_studio_retry_count: Union[int, object] = values.unset,
address_country: Union[str, object] = values.unset,
) -> AddressConfigurationInstance:
"""
Create the AddressConfigurationInstance
Expand All @@ -490,6 +493,7 @@ def create(
:param auto_creation_webhook_filters: The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated`
:param auto_creation_studio_flow_sid: For type `studio`, the studio flow SID where the webhook should be sent to.
:param auto_creation_studio_retry_count: For type `studio`, number of times to retry the webhook request
:param address_country: An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses.
:returns: The created AddressConfigurationInstance
"""
Expand All @@ -508,6 +512,7 @@ def create(
),
"AutoCreation.StudioFlowSid": auto_creation_studio_flow_sid,
"AutoCreation.StudioRetryCount": auto_creation_studio_retry_count,
"AddressCountry": address_country,
}
)

Expand Down Expand Up @@ -536,6 +541,7 @@ async def create_async(
auto_creation_webhook_filters: Union[List[str], object] = values.unset,
auto_creation_studio_flow_sid: Union[str, object] = values.unset,
auto_creation_studio_retry_count: Union[int, object] = values.unset,
address_country: Union[str, object] = values.unset,
) -> AddressConfigurationInstance:
"""
Asynchronously create the AddressConfigurationInstance
Expand All @@ -551,6 +557,7 @@ async def create_async(
:param auto_creation_webhook_filters: The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated`
:param auto_creation_studio_flow_sid: For type `studio`, the studio flow SID where the webhook should be sent to.
:param auto_creation_studio_retry_count: For type `studio`, number of times to retry the webhook request
:param address_country: An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses.
:returns: The created AddressConfigurationInstance
"""
Expand All @@ -569,6 +576,7 @@ async def create_async(
),
"AutoCreation.StudioFlowSid": auto_creation_studio_flow_sid,
"AutoCreation.StudioRetryCount": auto_creation_studio_retry_count,
"AddressCountry": address_country,
}
)

Expand Down
62 changes: 60 additions & 2 deletions twilio/rest/conversations/v1/conversation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,9 @@ async def create_async(

def stream(
self,
start_date: Union[str, object] = values.unset,
end_date: Union[str, object] = values.unset,
state: Union["ConversationInstance.State", object] = values.unset,
limit: Optional[int] = None,
page_size: Optional[int] = None,
) -> Iterator[ConversationInstance]:
Expand All @@ -679,6 +682,9 @@ def stream(
is reached.
The results are returned as a generator, so this operation is memory efficient.
:param str start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters.
:param str end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters.
:param "ConversationInstance.State" state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed`
:param limit: Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit
:param page_size: Number of records to fetch per request, when not set will use
Expand All @@ -689,12 +695,20 @@ def stream(
:returns: Generator that will yield up to limit results
"""
limits = self._version.read_limits(limit, page_size)
page = self.page(page_size=limits["page_size"])
page = self.page(
start_date=start_date,
end_date=end_date,
state=state,
page_size=limits["page_size"],
)

return self._version.stream(page, limits["limit"])

async def stream_async(
self,
start_date: Union[str, object] = values.unset,
end_date: Union[str, object] = values.unset,
state: Union["ConversationInstance.State", object] = values.unset,
limit: Optional[int] = None,
page_size: Optional[int] = None,
) -> AsyncIterator[ConversationInstance]:
Expand All @@ -704,6 +718,9 @@ async def stream_async(
is reached.
The results are returned as a generator, so this operation is memory efficient.
:param str start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters.
:param str end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters.
:param "ConversationInstance.State" state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed`
:param limit: Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit
:param page_size: Number of records to fetch per request, when not set will use
Expand All @@ -714,12 +731,20 @@ async def stream_async(
:returns: Generator that will yield up to limit results
"""
limits = self._version.read_limits(limit, page_size)
page = await self.page_async(page_size=limits["page_size"])
page = await self.page_async(
start_date=start_date,
end_date=end_date,
state=state,
page_size=limits["page_size"],
)

return self._version.stream_async(page, limits["limit"])

def list(
self,
start_date: Union[str, object] = values.unset,
end_date: Union[str, object] = values.unset,
state: Union["ConversationInstance.State", object] = values.unset,
limit: Optional[int] = None,
page_size: Optional[int] = None,
) -> List[ConversationInstance]:
Expand All @@ -728,6 +753,9 @@ def list(
Unlike stream(), this operation is eager and will load `limit` records into
memory before returning.
:param str start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters.
:param str end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters.
:param "ConversationInstance.State" state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed`
:param limit: Upper limit for the number of records to return. list() guarantees
never to return more than limit. Default is no limit
:param page_size: Number of records to fetch per request, when not set will use
Expand All @@ -739,13 +767,19 @@ def list(
"""
return list(
self.stream(
start_date=start_date,
end_date=end_date,
state=state,
limit=limit,
page_size=page_size,
)
)

async def list_async(
self,
start_date: Union[str, object] = values.unset,
end_date: Union[str, object] = values.unset,
state: Union["ConversationInstance.State", object] = values.unset,
limit: Optional[int] = None,
page_size: Optional[int] = None,
) -> List[ConversationInstance]:
Expand All @@ -754,6 +788,9 @@ async def list_async(
Unlike stream(), this operation is eager and will load `limit` records into
memory before returning.
:param str start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters.
:param str end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters.
:param "ConversationInstance.State" state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed`
:param limit: Upper limit for the number of records to return. list() guarantees
never to return more than limit. Default is no limit
:param page_size: Number of records to fetch per request, when not set will use
Expand All @@ -766,13 +803,19 @@ async def list_async(
return [
record
async for record in await self.stream_async(
start_date=start_date,
end_date=end_date,
state=state,
limit=limit,
page_size=page_size,
)
]

def page(
self,
start_date: Union[str, object] = values.unset,
end_date: Union[str, object] = values.unset,
state: Union["ConversationInstance.State", object] = values.unset,
page_token: Union[str, object] = values.unset,
page_number: Union[int, object] = values.unset,
page_size: Union[int, object] = values.unset,
Expand All @@ -781,6 +824,9 @@ def page(
Retrieve a single page of ConversationInstance records from the API.
Request is executed immediately
:param start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters.
:param end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters.
:param state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed`
:param page_token: PageToken provided by the API
:param page_number: Page Number, this value is simply for client state
:param page_size: Number of records to return, defaults to 50
Expand All @@ -789,6 +835,9 @@ def page(
"""
data = values.of(
{
"StartDate": start_date,
"EndDate": end_date,
"State": state,
"PageToken": page_token,
"Page": page_number,
"PageSize": page_size,
Expand All @@ -800,6 +849,9 @@ def page(

async def page_async(
self,
start_date: Union[str, object] = values.unset,
end_date: Union[str, object] = values.unset,
state: Union["ConversationInstance.State", object] = values.unset,
page_token: Union[str, object] = values.unset,
page_number: Union[int, object] = values.unset,
page_size: Union[int, object] = values.unset,
Expand All @@ -808,6 +860,9 @@ async def page_async(
Asynchronously retrieve a single page of ConversationInstance records from the API.
Request is executed immediately
:param start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters.
:param end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters.
:param state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed`
:param page_token: PageToken provided by the API
:param page_number: Page Number, this value is simply for client state
:param page_size: Number of records to return, defaults to 50
Expand All @@ -816,6 +871,9 @@ async def page_async(
"""
data = values.of(
{
"StartDate": start_date,
"EndDate": end_date,
"State": state,
"PageToken": page_token,
"Page": page_number,
"PageSize": page_size,
Expand Down
Loading

0 comments on commit 58f5223

Please sign in to comment.