diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 9bba6d8ba..e94bc5fd9 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -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 diff --git a/CHANGES.md b/CHANGES.md index 2db0e04b3..7289bdc50 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,34 @@ Here you can see the full list of changes between each twilio-python release. --------------------------- - Release Candidate preparation +[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** diff --git a/requirements.txt b/requirements.txt index ff6d4043d..f2b815e85 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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.9.1 +aiohttp>=3.9.0 aiohttp-retry>=2.8.3 diff --git a/twilio/__init__.py b/twilio/__init__.py index 35bc4c306..ed70a4bc1 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("8", "10", "3") +__version_info__ = ("8", "11", "0") __version__ = ".".join(__version_info__) diff --git a/twilio/rest/api/v2010/account/authorized_connect_app.py b/twilio/rest/api/v2010/account/authorized_connect_app.py index 4d71766b6..a62da5a76 100644 --- a/twilio/rest/api/v2010/account/authorized_connect_app.py +++ b/twilio/rest/api/v2010/account/authorized_connect_app.py @@ -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 @@ -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`. """ @@ -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") diff --git a/twilio/rest/events/v1/subscription/subscribed_event.py b/twilio/rest/events/v1/subscription/subscribed_event.py index f45fe0b2e..7cccb1cb8 100644 --- a/twilio/rest/events/v1/subscription/subscribed_event.py +++ b/twilio/rest/events/v1/subscription/subscribed_event.py @@ -27,7 +27,7 @@ class SubscribedEventInstance(InstanceResource): """ :ivar account_sid: The unique SID identifier of the Account. :ivar type: Type of event being subscribed to. - :ivar schema_version: The schema version that the subscription should use. + :ivar schema_version: The schema version that the Subscription should use. :ivar subscription_sid: The unique SID identifier of the Subscription. :ivar url: The URL of this resource. """ @@ -113,7 +113,7 @@ def update( """ Update the SubscribedEventInstance - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The updated SubscribedEventInstance """ @@ -127,7 +127,7 @@ async def update_async( """ Asynchronous coroutine to update the SubscribedEventInstance - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The updated SubscribedEventInstance """ @@ -235,7 +235,7 @@ def update( """ Update the SubscribedEventInstance - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The updated SubscribedEventInstance """ @@ -264,7 +264,7 @@ async def update_async( """ Asynchronous coroutine to update the SubscribedEventInstance - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The updated SubscribedEventInstance """ @@ -343,7 +343,7 @@ def create( Create the SubscribedEventInstance :param type: Type of event being subscribed to. - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The created SubscribedEventInstance """ @@ -371,7 +371,7 @@ async def create_async( Asynchronously create the SubscribedEventInstance :param type: Type of event being subscribed to. - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The created SubscribedEventInstance """ diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index e7ee222a4..a9285ae49 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -17,6 +17,7 @@ from twilio.base.domain import Domain from twilio.rest.numbers.v1.bulk_eligibility import BulkEligibilityList from twilio.rest.numbers.v1.porting_bulk_portability import PortingBulkPortabilityList +from twilio.rest.numbers.v1.porting_port_in_fetch import PortingPortInFetchList from twilio.rest.numbers.v1.porting_portability import PortingPortabilityList @@ -30,6 +31,7 @@ def __init__(self, domain: Domain): super().__init__(domain, "v1") self._bulk_eligibilities: Optional[BulkEligibilityList] = None self._porting_bulk_portabilities: Optional[PortingBulkPortabilityList] = None + self._porting_port_ins: Optional[PortingPortInFetchList] = None self._porting_portabilities: Optional[PortingPortabilityList] = None @property @@ -44,6 +46,12 @@ def porting_bulk_portabilities(self) -> PortingBulkPortabilityList: self._porting_bulk_portabilities = PortingBulkPortabilityList(self) return self._porting_bulk_portabilities + @property + def porting_port_ins(self) -> PortingPortInFetchList: + if self._porting_port_ins is None: + self._porting_port_ins = PortingPortInFetchList(self) + return self._porting_port_ins + @property def porting_portabilities(self) -> PortingPortabilityList: if self._porting_portabilities is None: diff --git a/twilio/rest/numbers/v1/porting_port_in_fetch.py b/twilio/rest/numbers/v1/porting_port_in_fetch.py new file mode 100644 index 000000000..0ac469fe6 --- /dev/null +++ b/twilio/rest/numbers/v1/porting_port_in_fetch.py @@ -0,0 +1,217 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Numbers + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + + +from datetime import date +from typing import Any, Dict, List, Optional +from twilio.base import deserialize +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class PortingPortInFetchInstance(InstanceResource): + + """ + :ivar port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + :ivar url: The URL of this Port In request + :ivar account_sid: The Account SID that the numbers will be added to after they are ported into Twilio. + :ivar notification_emails: List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails. + :ivar target_port_in_date: Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation. + :ivar target_port_in_time_range_start: Minimum hour in the future needs to be established with the Ops team for validation. + :ivar target_port_in_time_range_end: Maximum hour in the future needs to be established with the Ops team for validation. + :ivar losing_carrier_information: The information for the losing carrier. + :ivar phone_numbers: The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212). + :ivar documents: The list of documents SID referencing a utility bills + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + port_in_request_sid: Optional[str] = None, + ): + super().__init__(version) + + self.port_in_request_sid: Optional[str] = payload.get("port_in_request_sid") + self.url: Optional[str] = payload.get("url") + self.account_sid: Optional[str] = payload.get("account_sid") + self.notification_emails: Optional[List[str]] = payload.get( + "notification_emails" + ) + self.target_port_in_date: Optional[date] = deserialize.iso8601_date( + payload.get("target_port_in_date") + ) + self.target_port_in_time_range_start: Optional[str] = payload.get( + "target_port_in_time_range_start" + ) + self.target_port_in_time_range_end: Optional[str] = payload.get( + "target_port_in_time_range_end" + ) + self.losing_carrier_information: Optional[Dict[str, object]] = payload.get( + "losing_carrier_information" + ) + self.phone_numbers: Optional[List[object]] = payload.get("phone_numbers") + self.documents: Optional[List[str]] = payload.get("documents") + + self._solution = { + "port_in_request_sid": port_in_request_sid or self.port_in_request_sid, + } + self._context: Optional[PortingPortInFetchContext] = None + + @property + def _proxy(self) -> "PortingPortInFetchContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: PortingPortInFetchContext for this PortingPortInFetchInstance + """ + if self._context is None: + self._context = PortingPortInFetchContext( + self._version, + port_in_request_sid=self._solution["port_in_request_sid"], + ) + return self._context + + def fetch(self) -> "PortingPortInFetchInstance": + """ + Fetch the PortingPortInFetchInstance + + + :returns: The fetched PortingPortInFetchInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "PortingPortInFetchInstance": + """ + Asynchronous coroutine to fetch the PortingPortInFetchInstance + + + :returns: The fetched PortingPortInFetchInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PortingPortInFetchContext(InstanceContext): + def __init__(self, version: Version, port_in_request_sid: str): + """ + Initialize the PortingPortInFetchContext + + :param version: Version that contains the resource + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "port_in_request_sid": port_in_request_sid, + } + self._uri = "/Porting/PortIn/{port_in_request_sid}".format(**self._solution) + + def fetch(self) -> PortingPortInFetchInstance: + """ + Fetch the PortingPortInFetchInstance + + + :returns: The fetched PortingPortInFetchInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return PortingPortInFetchInstance( + self._version, + payload, + port_in_request_sid=self._solution["port_in_request_sid"], + ) + + async def fetch_async(self) -> PortingPortInFetchInstance: + """ + Asynchronous coroutine to fetch the PortingPortInFetchInstance + + + :returns: The fetched PortingPortInFetchInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return PortingPortInFetchInstance( + self._version, + payload, + port_in_request_sid=self._solution["port_in_request_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PortingPortInFetchList(ListResource): + def __init__(self, version: Version): + """ + Initialize the PortingPortInFetchList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, port_in_request_sid: str) -> PortingPortInFetchContext: + """ + Constructs a PortingPortInFetchContext + + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + """ + return PortingPortInFetchContext( + self._version, port_in_request_sid=port_in_request_sid + ) + + def __call__(self, port_in_request_sid: str) -> PortingPortInFetchContext: + """ + Constructs a PortingPortInFetchContext + + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + """ + return PortingPortInFetchContext( + self._version, port_in_request_sid=port_in_request_sid + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/taskrouter/v1/workspace/task/reservation.py b/twilio/rest/taskrouter/v1/workspace/task/reservation.py index 32e7c6b4d..af5098400 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/task/reservation.py @@ -200,6 +200,7 @@ def update( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Update the ReservationInstance @@ -258,6 +259,7 @@ def update( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -316,6 +318,7 @@ def update( supervisor=supervisor, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, + jitter_buffer_size=jitter_buffer_size, ) async def update_async( @@ -380,6 +383,7 @@ async def update_async( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Asynchronous coroutine to update the ReservationInstance @@ -438,6 +442,7 @@ async def update_async( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -496,6 +501,7 @@ async def update_async( supervisor=supervisor, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, + jitter_buffer_size=jitter_buffer_size, ) def __repr__(self) -> str: @@ -636,6 +642,7 @@ def update( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Update the ReservationInstance @@ -694,6 +701,7 @@ def update( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -758,6 +766,7 @@ def update( "Supervisor": supervisor, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, + "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( @@ -840,6 +849,7 @@ async def update_async( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Asynchronous coroutine to update the ReservationInstance @@ -898,6 +908,7 @@ async def update_async( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -962,6 +973,7 @@ async def update_async( "Supervisor": supervisor, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, + "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( diff --git a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py index e99705d66..24727b114 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py @@ -191,6 +191,7 @@ def update( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Update the ReservationInstance @@ -247,6 +248,7 @@ def update( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -303,6 +305,7 @@ def update( post_work_activity_sid=post_work_activity_sid, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, + jitter_buffer_size=jitter_buffer_size, ) async def update_async( @@ -363,6 +366,7 @@ async def update_async( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Asynchronous coroutine to update the ReservationInstance @@ -419,6 +423,7 @@ async def update_async( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -475,6 +480,7 @@ async def update_async( post_work_activity_sid=post_work_activity_sid, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, + jitter_buffer_size=jitter_buffer_size, ) def __repr__(self) -> str: @@ -609,6 +615,7 @@ def update( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Update the ReservationInstance @@ -665,6 +672,7 @@ def update( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -727,6 +735,7 @@ def update( "PostWorkActivitySid": post_work_activity_sid, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, + "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( @@ -805,6 +814,7 @@ async def update_async( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Asynchronous coroutine to update the ReservationInstance @@ -861,6 +871,7 @@ async def update_async( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -923,6 +934,7 @@ async def update_async( "PostWorkActivitySid": post_work_activity_sid, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, + "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( diff --git a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py index 5ee58326a..f2059c4e5 100644 --- a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py @@ -13,8 +13,8 @@ """ -from typing import Any, Dict, Optional -from twilio.base import values +from typing import Any, Dict, List, Optional, Union +from twilio.base import serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -22,6 +22,12 @@ class ComplianceTollfreeInquiriesInstance(InstanceResource): + class OptInType(object): + VERBAL = "VERBAL" + WEB_FORM = "WEB_FORM" + PAPER_FORM = "PAPER_FORM" + VIA_TEXT = "VIA_TEXT" + MOBILE_QR_CODE = "MOBILE_QR_CODE" """ :ivar inquiry_id: The unique ID used to start an embedded compliance registration session. @@ -61,13 +67,55 @@ def __init__(self, version: Version): self._uri = "/ComplianceInquiries/Tollfree/Initialize" def create( - self, tollfree_phone_number: str, notification_email: str + self, + tollfree_phone_number: str, + notification_email: str, + business_name: Union[str, object] = values.unset, + business_website: Union[str, object] = values.unset, + use_case_categories: Union[List[str], object] = values.unset, + use_case_summary: Union[str, object] = values.unset, + production_message_sample: Union[str, object] = values.unset, + opt_in_image_urls: Union[List[str], object] = values.unset, + opt_in_type: Union[ + "ComplianceTollfreeInquiriesInstance.OptInType", object + ] = values.unset, + message_volume: Union[str, object] = values.unset, + business_street_address: Union[str, object] = values.unset, + business_street_address2: Union[str, object] = values.unset, + business_city: Union[str, object] = values.unset, + business_state_province_region: Union[str, object] = values.unset, + business_postal_code: Union[str, object] = values.unset, + business_country: Union[str, object] = values.unset, + additional_information: Union[str, object] = values.unset, + business_contact_first_name: Union[str, object] = values.unset, + business_contact_last_name: Union[str, object] = values.unset, + business_contact_email: Union[str, object] = values.unset, + business_contact_phone: Union[str, object] = values.unset, ) -> ComplianceTollfreeInquiriesInstance: """ Create the ComplianceTollfreeInquiriesInstance :param tollfree_phone_number: The Tollfree phone number to be verified - :param notification_email: The notification email to be triggered when verification status is changed + :param notification_email: The email address to receive the notification about the verification result. + :param business_name: The name of the business or organization using the Tollfree number. + :param business_website: The website of the business or organization using the Tollfree number. + :param use_case_categories: The category of the use case for the Tollfree Number. List as many are applicable.. + :param use_case_summary: Use this to further explain how messaging is used by the business or organization. + :param production_message_sample: An example of message content, i.e. a sample message. + :param opt_in_image_urls: Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + :param opt_in_type: + :param message_volume: Estimate monthly volume of messages from the Tollfree Number. + :param business_street_address: The address of the business or organization using the Tollfree number. + :param business_street_address2: The address of the business or organization using the Tollfree number. + :param business_city: The city of the business or organization using the Tollfree number. + :param business_state_province_region: The state/province/region of the business or organization using the Tollfree number. + :param business_postal_code: The postal code of the business or organization using the Tollfree number. + :param business_country: The country of the business or organization using the Tollfree number. + :param additional_information: Additional information to be provided for verification. + :param business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. + :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. + :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. + :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. :returns: The created ComplianceTollfreeInquiriesInstance """ @@ -75,6 +123,25 @@ def create( { "TollfreePhoneNumber": tollfree_phone_number, "NotificationEmail": notification_email, + "BusinessName": business_name, + "BusinessWebsite": business_website, + "UseCaseCategories": serialize.map(use_case_categories, lambda e: e), + "UseCaseSummary": use_case_summary, + "ProductionMessageSample": production_message_sample, + "OptInImageUrls": serialize.map(opt_in_image_urls, lambda e: e), + "OptInType": opt_in_type, + "MessageVolume": message_volume, + "BusinessStreetAddress": business_street_address, + "BusinessStreetAddress2": business_street_address2, + "BusinessCity": business_city, + "BusinessStateProvinceRegion": business_state_province_region, + "BusinessPostalCode": business_postal_code, + "BusinessCountry": business_country, + "AdditionalInformation": additional_information, + "BusinessContactFirstName": business_contact_first_name, + "BusinessContactLastName": business_contact_last_name, + "BusinessContactEmail": business_contact_email, + "BusinessContactPhone": business_contact_phone, } ) @@ -87,13 +154,55 @@ def create( return ComplianceTollfreeInquiriesInstance(self._version, payload) async def create_async( - self, tollfree_phone_number: str, notification_email: str + self, + tollfree_phone_number: str, + notification_email: str, + business_name: Union[str, object] = values.unset, + business_website: Union[str, object] = values.unset, + use_case_categories: Union[List[str], object] = values.unset, + use_case_summary: Union[str, object] = values.unset, + production_message_sample: Union[str, object] = values.unset, + opt_in_image_urls: Union[List[str], object] = values.unset, + opt_in_type: Union[ + "ComplianceTollfreeInquiriesInstance.OptInType", object + ] = values.unset, + message_volume: Union[str, object] = values.unset, + business_street_address: Union[str, object] = values.unset, + business_street_address2: Union[str, object] = values.unset, + business_city: Union[str, object] = values.unset, + business_state_province_region: Union[str, object] = values.unset, + business_postal_code: Union[str, object] = values.unset, + business_country: Union[str, object] = values.unset, + additional_information: Union[str, object] = values.unset, + business_contact_first_name: Union[str, object] = values.unset, + business_contact_last_name: Union[str, object] = values.unset, + business_contact_email: Union[str, object] = values.unset, + business_contact_phone: Union[str, object] = values.unset, ) -> ComplianceTollfreeInquiriesInstance: """ Asynchronously create the ComplianceTollfreeInquiriesInstance :param tollfree_phone_number: The Tollfree phone number to be verified - :param notification_email: The notification email to be triggered when verification status is changed + :param notification_email: The email address to receive the notification about the verification result. + :param business_name: The name of the business or organization using the Tollfree number. + :param business_website: The website of the business or organization using the Tollfree number. + :param use_case_categories: The category of the use case for the Tollfree Number. List as many are applicable.. + :param use_case_summary: Use this to further explain how messaging is used by the business or organization. + :param production_message_sample: An example of message content, i.e. a sample message. + :param opt_in_image_urls: Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + :param opt_in_type: + :param message_volume: Estimate monthly volume of messages from the Tollfree Number. + :param business_street_address: The address of the business or organization using the Tollfree number. + :param business_street_address2: The address of the business or organization using the Tollfree number. + :param business_city: The city of the business or organization using the Tollfree number. + :param business_state_province_region: The state/province/region of the business or organization using the Tollfree number. + :param business_postal_code: The postal code of the business or organization using the Tollfree number. + :param business_country: The country of the business or organization using the Tollfree number. + :param additional_information: Additional information to be provided for verification. + :param business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. + :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. + :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. + :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. :returns: The created ComplianceTollfreeInquiriesInstance """ @@ -101,6 +210,25 @@ async def create_async( { "TollfreePhoneNumber": tollfree_phone_number, "NotificationEmail": notification_email, + "BusinessName": business_name, + "BusinessWebsite": business_website, + "UseCaseCategories": serialize.map(use_case_categories, lambda e: e), + "UseCaseSummary": use_case_summary, + "ProductionMessageSample": production_message_sample, + "OptInImageUrls": serialize.map(opt_in_image_urls, lambda e: e), + "OptInType": opt_in_type, + "MessageVolume": message_volume, + "BusinessStreetAddress": business_street_address, + "BusinessStreetAddress2": business_street_address2, + "BusinessCity": business_city, + "BusinessStateProvinceRegion": business_state_province_region, + "BusinessPostalCode": business_postal_code, + "BusinessCountry": business_country, + "AdditionalInformation": additional_information, + "BusinessContactFirstName": business_contact_first_name, + "BusinessContactLastName": business_contact_last_name, + "BusinessContactEmail": business_contact_email, + "BusinessContactPhone": business_contact_phone, } )