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: sync with main #743

Merged
merged 6 commits into from
Dec 14, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ]
steps:
- name: Checkout twilio-python
uses: actions/checkout@v3
Expand Down
34 changes: 34 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,40 @@ twilio-python Changelog

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

[2023-12-14] Version 8.11.0
---------------------------
**Library - Chore**
- [PR #741](https://github.com/twilio/twilio-python/pull/741): upgrade to python 3.12. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
- [PR #740](https://github.com/twilio/twilio-python/pull/740): bump aiohttp. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!

**Api**
- Updated service base url for connect apps and authorized connect apps APIs **(breaking change)**

**Events**
- Marked as GA

**Insights**
- decommission voice-qualitystats-endpoint role

**Numbers**
- Add Get Port In request api

**Taskrouter**
- Add `jitter_buffer_size` param in update reservation

**Trusthub**
- Add additional optional fields in compliance_tollfree_inquiry.json

**Verify**
- Remove `Tags` from Public Docs **(breaking change)**


[2023-12-01] Version 8.10.3
---------------------------
**Verify**
- Add `VerifyEventSubscriptionEnabled` parameter to service create and update endpoints.


[2023-11-17] Version 8.10.2
---------------------------
**Library - Chore**
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pygments>=2.7.4 # not directly required, pinned by Snyk to avoid a vulnerability
requests>=2.0.0
PyJWT>=2.0.0, <3.0.0
aiohttp==3.8.6
aiohttp>=3.9.0
aiohttp-retry>=2.8.3
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setup(
name="twilio",
version="8.10.2",
version="8.11.0",
description="Twilio API client and TwiML generator",
author="Twilio",
help_center="https://www.twilio.com/help/contact",
Expand Down
2 changes: 1 addition & 1 deletion twilio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version_info__ = ("8", "10", "2")
__version_info__ = ("8", "11", "0")
__version__ = ".".join(__version_info__)
64 changes: 59 additions & 5 deletions twilio/rest/accounts/v1/safelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""


from typing import Any, Dict, Optional
from typing import Any, Dict, Optional, Union
from twilio.base import values

from twilio.base.instance_resource import InstanceResource
Expand Down Expand Up @@ -100,23 +100,77 @@ async def create_async(self, phone_number: str) -> SafelistInstance:

return SafelistInstance(self._version, payload)

def fetch(self) -> SafelistInstance:
def delete(self, phone_number: Union[str, object] = values.unset) -> bool:
"""
Asynchronously delete the SafelistInstance

:param phone_number: The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
:returns: True if delete succeeds, False otherwise
"""

params = values.of(
{
"PhoneNumber": phone_number,
}
)
return self._version.delete(method="DELETE", uri=self._uri, params=params)

async def delete_async(
self, phone_number: Union[str, object] = values.unset
) -> bool:
"""
Asynchronously delete the SafelistInstance

:param phone_number: The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
:returns: True if delete succeeds, False otherwise
"""

params = values.of(
{
"PhoneNumber": phone_number,
}
)
return await self._version.delete_async(
method="DELETE", uri=self._uri, params=params
)

def fetch(
self, phone_number: Union[str, object] = values.unset
) -> SafelistInstance:
"""
Asynchronously fetch the SafelistInstance

:param phone_number: The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
:returns: The fetched SafelistInstance
"""
payload = self._version.fetch(method="GET", uri=self._uri)

params = values.of(
{
"PhoneNumber": phone_number,
}
)
payload = self._version.fetch(method="GET", uri=self._uri, params=params)

return SafelistInstance(self._version, payload)

async def fetch_async(self) -> SafelistInstance:
async def fetch_async(
self, phone_number: Union[str, object] = values.unset
) -> SafelistInstance:
"""
Asynchronously fetch the SafelistInstance

:param phone_number: The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
:returns: The fetched SafelistInstance
"""
payload = await self._version.fetch_async(method="GET", uri=self._uri)

params = values.of(
{
"PhoneNumber": phone_number,
}
)
payload = await self._version.fetch_async(
method="GET", uri=self._uri, params=params
)

return SafelistInstance(self._version, payload)

Expand Down
11 changes: 1 addition & 10 deletions twilio/rest/api/v2010/account/authorized_connect_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
"""


from datetime import datetime
from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator
from twilio.base import deserialize, values
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
Expand All @@ -35,8 +34,6 @@ class Permission(object):
:ivar connect_app_friendly_name: The name of the Connect App.
:ivar connect_app_homepage_url: The public URL for the Connect App.
:ivar connect_app_sid: The SID that we assigned to the Connect App.
:ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
:ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
:ivar permissions: The set of permissions that you authorized for the Connect App. Can be: `get-all` or `post-all`.
:ivar uri: The URI of the resource, relative to `https://api.twilio.com`.
"""
Expand Down Expand Up @@ -64,12 +61,6 @@ def __init__(
"connect_app_homepage_url"
)
self.connect_app_sid: Optional[str] = payload.get("connect_app_sid")
self.date_created: Optional[datetime] = deserialize.rfc2822_datetime(
payload.get("date_created")
)
self.date_updated: Optional[datetime] = deserialize.rfc2822_datetime(
payload.get("date_updated")
)
self.permissions: Optional[
List["AuthorizedConnectAppInstance.Permission"]
] = payload.get("permissions")
Expand Down
4 changes: 4 additions & 0 deletions twilio/rest/api/v2010/account/balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ def fetch(self) -> BalanceInstance:
"""
Asynchronously fetch the BalanceInstance


:returns: The fetched BalanceInstance
"""

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

return BalanceInstance(
Expand All @@ -82,8 +84,10 @@ async def fetch_async(self) -> BalanceInstance:
"""
Asynchronously fetch the BalanceInstance


:returns: The fetched BalanceInstance
"""

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

return BalanceInstance(
Expand Down
Loading
Loading