From 040d2eb487908cf973b5227f0b19693638985b4e Mon Sep 17 00:00:00 2001 From: sbansla <104902068+sbansla@users.noreply.github.com> Date: Thu, 22 Feb 2024 16:57:46 +0530 Subject: [PATCH 1/5] chore: cluster tests enabled (#768) --- .github/workflows/test-and-deploy.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index c9d4c023f7..9fdcf4c752 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -38,16 +38,16 @@ jobs: - name: Run the tests run: make test-with-coverage -# - name: Run Cluster Tests -# if: (!github.event.pull_request.head.repo.fork) -# env: -# TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} -# TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}} -# TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }} -# TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} -# TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} -# TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }} -# run: make cluster-test + - name: Run Cluster Tests + if: (!github.event.pull_request.head.repo.fork) + env: + TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} + TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}} + TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }} + TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} + TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} + TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }} + run: make cluster-test - name: Verify docs generation run: make docs From 69441eb97ff9d9a36703a057ff88a49978d5a92f Mon Sep 17 00:00:00 2001 From: Shubham Date: Thu, 22 Feb 2024 19:09:38 +0530 Subject: [PATCH 2/5] chore: added check for unset values (#771) --- twilio/base/serialize.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/twilio/base/serialize.py b/twilio/base/serialize.py index eac2e12c2e..cea91b04c7 100644 --- a/twilio/base/serialize.py +++ b/twilio/base/serialize.py @@ -62,6 +62,9 @@ def flatten_dict(d, result=None, prv_keys=None): def boolean_to_string(bool_or_str): + if bool_or_str == values.unset: + return bool_or_str + if bool_or_str is None: return bool_or_str From 7b52a49026a45bad6cb4e2840cb8f77d51a216f8 Mon Sep 17 00:00:00 2001 From: Shubham Date: Fri, 23 Feb 2024 18:27:15 +0530 Subject: [PATCH 3/5] * feat: json content type (#737) * feat: add application/json support for client * feat: add application/json support for client * feat: add application/json support for client * feat: add application/json support for client * feat: add application/json support for client * chore: updated changelogs for rc-branch * chore: add domain detail (#739) * feat: add domain detail to twilio python * feat: add domain detail to twilio python * feat: add domain detail to twilio python * feat: add domain detail to twilio python * corrected rc version * Update setup.py * Update setup.py * chore: corrected cluster test * chore: disables cluster test (#765) * chore: disables cluster test * chore: added make prettier to workflow * feat!: MVR release preparation (#766) * feat!: MVR release preparation * fix: added test for json data in http client --------- Co-authored-by: Manisha Singh Co-authored-by: sbansla Co-authored-by: Twilio --- UPGRADE.md | 9 + tests/unit/http/test_http_client.py | 26 +++ twilio/http/http_client.py | 13 +- twilio/rest/__init__.py | 15 ++ .../rest/api/v2010/account/call/__init__.py | 72 ------- .../api/v2010/account/conference/__init__.py | 72 ------- .../api/v2010/account/message/__init__.py | 46 +--- .../content/v1/content/approval_create.py | 138 ++++++++++++ twilio/rest/flex_api/v1/configuration.py | 52 +++++ twilio/rest/numbers/v1/__init__.py | 16 ++ twilio/rest/numbers/v1/bulk_eligibility.py | 32 +++ twilio/rest/numbers/v1/eligibility.py | 91 ++++++++ twilio/rest/numbers/v1/porting_port_in.py | 93 ++++++++ .../numbers/v2/bulk_hosted_number_order.py | 32 +++ .../regulatory_compliance/bundle/__init__.py | 36 ---- .../preview_messaging/PreviewMessagingBase.py | 44 ++++ twilio/rest/preview_messaging/__init__.py | 13 ++ twilio/rest/preview_messaging/v1/__init__.py | 51 +++++ twilio/rest/preview_messaging/v1/broadcast.py | 125 +++++++++++ twilio/rest/preview_messaging/v1/message.py | 203 ++++++++++++++++++ .../v1/workspace/task_queue/__init__.py | 17 ++ .../task_queue_bulk_real_time_statistics.py | 123 +++++++++++ 22 files changed, 1089 insertions(+), 230 deletions(-) create mode 100644 twilio/rest/content/v1/content/approval_create.py create mode 100644 twilio/rest/numbers/v1/eligibility.py create mode 100644 twilio/rest/numbers/v1/porting_port_in.py create mode 100644 twilio/rest/preview_messaging/PreviewMessagingBase.py create mode 100644 twilio/rest/preview_messaging/__init__.py create mode 100644 twilio/rest/preview_messaging/v1/__init__.py create mode 100644 twilio/rest/preview_messaging/v1/broadcast.py create mode 100644 twilio/rest/preview_messaging/v1/message.py create mode 100644 twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py diff --git a/UPGRADE.md b/UPGRADE.md index 79bdb48cc5..03c196bf5b 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -3,6 +3,15 @@ _`MAJOR` version bumps will have upgrade notes posted here._ +## [2024-02-20] 8.x.x to 9.x.x +### Overview + +##### Twilio Python Helper Library’s major version 9.0.0 is now available. We ensured that you can upgrade to Python helper Library 9.0.0 version without any breaking changes of existing apis + +Behind the scenes Python Helper is now auto-generated via OpenAPI with this release. This enables us to rapidly add new features and enhance consistency across versions and languages. +We're pleased to inform you that version 9.0.0 adds support for the application/json content type in the request body. + + ## [2023-04-05] 7.x.x to 8.x.x - **Supported Python versions updated** diff --git a/tests/unit/http/test_http_client.py b/tests/unit/http/test_http_client.py index e599aaaf00..8484e57b17 100644 --- a/tests/unit/http/test_http_client.py +++ b/tests/unit/http/test_http_client.py @@ -145,6 +145,32 @@ def test_last_request_last_response_exist(self): "testing-unicode: Ω≈ç√, 💩", self.client._test_only_last_response.text ) + def test_request_with_json(self): + self.request_mock.url = "https://api.twilio.com/" + self.request_mock.headers = {"Host": "other.twilio.com"} + + self.client.request( + "doesnt-matter-method", + "doesnt-matter-url", + {"params-value": "params-key"}, + {"json-key": "json-value"}, + {"Content-Type": "application/json"}, + ) + + self.assertIsNotNone(self.client._test_only_last_request) + self.assertEqual( + {"Content-Type": "application/json"}, + self.client._test_only_last_request.headers, + ) + + self.assertIsNotNone(self.client._test_only_last_response) + + if self.client._test_only_last_response is not None: + self.assertEqual(200, self.client._test_only_last_response.status_code) + self.assertEqual( + "testing-unicode: Ω≈ç√, 💩", self.client._test_only_last_response.text + ) + def test_last_response_empty_on_error(self): self.session_mock.send.side_effect = Exception("voltron") diff --git a/twilio/http/http_client.py b/twilio/http/http_client.py index bfc38feaf7..7a1715ad49 100644 --- a/twilio/http/http_client.py +++ b/twilio/http/http_client.py @@ -27,11 +27,10 @@ def __init__( ): """ Constructor for the TwilioHttpClient - :param pool_connections :param request_hooks :param timeout: Timeout for the requests. - Timeout should never be zero (0) or less. + Timeout should never be zero (0) or less :param logger :param proxy: Http proxy for the requests session :param max_retries: Maximum number of retries each request should attempt @@ -65,10 +64,10 @@ def request( :param headers: HTTP Headers to send with the request :param auth: Basic Auth arguments :param timeout: Socket/Read timeout for the request - :param allow_redirects: Whether or not to allow redirects + :param allow_redirects: Whether to allow redirects See the requests documentation for explanation of all these parameters - :return: An http response + :return: An HTTP response """ if timeout is None: timeout = self.timeout @@ -79,12 +78,14 @@ def request( "method": method.upper(), "url": url, "params": params, - "data": data, "headers": headers, "auth": auth, "hooks": self.request_hooks, } - + if headers and headers.get("Content-Type") == "application/json": + kwargs["json"] = data + else: + kwargs["data"] = data self.log_request(kwargs) self._test_only_last_response = None diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 3e895271f9..818688e399 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -28,6 +28,7 @@ from twilio.rest.ip_messaging import IpMessaging from twilio.rest.lookups import Lookups from twilio.rest.media import Media + from twilio.rest.preview_messaging import PreviewMessaging from twilio.rest.messaging import Messaging from twilio.rest.microvisor import Microvisor from twilio.rest.monitor import Monitor @@ -135,6 +136,7 @@ def __init__( self._ip_messaging: Optional["IpMessaging"] = None self._lookups: Optional["Lookups"] = None self._media: Optional["Media"] = None + self._preview_messaging: Optional["PreviewMessaging"] = None self._messaging: Optional["Messaging"] = None self._microvisor: Optional["Microvisor"] = None self._monitor: Optional["Monitor"] = None @@ -338,6 +340,19 @@ def media(self) -> "Media": self._media = Media(self) return self._media + @property + def preview_messaging(self) -> "PreviewMessaging": + """ + Access the PreviewMessaging Twilio Domain + + :returns: PreviewMessaging Twilio Domain + """ + if self._preview_messaging is None: + from twilio.rest.preview_messaging import PreviewMessaging + + self._preview_messaging = PreviewMessaging(self) + return self._preview_messaging + @property def messaging(self) -> "Messaging": """ diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index 406db27602..21c4e9c27e 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -984,11 +984,7 @@ def stream( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[CallInstance]: @@ -1003,11 +999,7 @@ def stream( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :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 @@ -1024,11 +1016,7 @@ def stream( parent_call_sid=parent_call_sid, status=status, start_time=start_time, - start_time_before=start_time_before, - start_time_after=start_time_after, end_time=end_time, - end_time_before=end_time_before, - end_time_after=end_time_after, page_size=limits["page_size"], ) @@ -1041,11 +1029,7 @@ async def stream_async( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[CallInstance]: @@ -1060,11 +1044,7 @@ async def stream_async( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :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 @@ -1081,11 +1061,7 @@ async def stream_async( parent_call_sid=parent_call_sid, status=status, start_time=start_time, - start_time_before=start_time_before, - start_time_after=start_time_after, end_time=end_time, - end_time_before=end_time_before, - end_time_after=end_time_after, page_size=limits["page_size"], ) @@ -1098,11 +1074,7 @@ def list( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[CallInstance]: @@ -1116,11 +1088,7 @@ def list( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :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 @@ -1137,11 +1105,7 @@ def list( parent_call_sid=parent_call_sid, status=status, start_time=start_time, - start_time_before=start_time_before, - start_time_after=start_time_after, end_time=end_time, - end_time_before=end_time_before, - end_time_after=end_time_after, limit=limit, page_size=page_size, ) @@ -1154,11 +1118,7 @@ async def list_async( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[CallInstance]: @@ -1172,11 +1132,7 @@ async def list_async( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :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 @@ -1194,11 +1150,7 @@ async def list_async( parent_call_sid=parent_call_sid, status=status, start_time=start_time, - start_time_before=start_time_before, - start_time_after=start_time_after, end_time=end_time, - end_time_before=end_time_before, - end_time_after=end_time_after, limit=limit, page_size=page_size, ) @@ -1211,11 +1163,7 @@ def page( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -1229,11 +1177,7 @@ def page( :param parent_call_sid: Only include calls spawned by calls with this SID. :param status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :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 @@ -1247,11 +1191,7 @@ def page( "ParentCallSid": parent_call_sid, "Status": status, "StartTime": serialize.iso8601_datetime(start_time), - "StartTime<": serialize.iso8601_datetime(start_time_before), - "StartTime>": serialize.iso8601_datetime(start_time_after), "EndTime": serialize.iso8601_datetime(end_time), - "EndTime<": serialize.iso8601_datetime(end_time_before), - "EndTime>": serialize.iso8601_datetime(end_time_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -1268,11 +1208,7 @@ async def page_async( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -1286,11 +1222,7 @@ async def page_async( :param parent_call_sid: Only include calls spawned by calls with this SID. :param status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :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 @@ -1304,11 +1236,7 @@ async def page_async( "ParentCallSid": parent_call_sid, "Status": status, "StartTime": serialize.iso8601_datetime(start_time), - "StartTime<": serialize.iso8601_datetime(start_time_before), - "StartTime>": serialize.iso8601_datetime(start_time_after), "EndTime": serialize.iso8601_datetime(end_time), - "EndTime<": serialize.iso8601_datetime(end_time_before), - "EndTime>": serialize.iso8601_datetime(end_time_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/conference/__init__.py b/twilio/rest/api/v2010/account/conference/__init__.py index fff75dea5d..36cd390c60 100644 --- a/twilio/rest/api/v2010/account/conference/__init__.py +++ b/twilio/rest/api/v2010/account/conference/__init__.py @@ -412,11 +412,7 @@ def __init__(self, version: Version, account_sid: str): def stream( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -429,11 +425,7 @@ def stream( The results are returned as a generator, so this operation is memory efficient. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. stream() @@ -448,11 +440,7 @@ def stream( limits = self._version.read_limits(limit, page_size) page = self.page( date_created=date_created, - date_created_before=date_created_before, - date_created_after=date_created_after, date_updated=date_updated, - date_updated_before=date_updated_before, - date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, page_size=limits["page_size"], @@ -463,11 +451,7 @@ def stream( async def stream_async( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -480,11 +464,7 @@ async def stream_async( The results are returned as a generator, so this operation is memory efficient. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. stream() @@ -499,11 +479,7 @@ async def stream_async( limits = self._version.read_limits(limit, page_size) page = await self.page_async( date_created=date_created, - date_created_before=date_created_before, - date_created_after=date_created_after, date_updated=date_updated, - date_updated_before=date_updated_before, - date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, page_size=limits["page_size"], @@ -514,11 +490,7 @@ async def stream_async( def list( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -530,11 +502,7 @@ def list( memory before returning. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. list() guarantees @@ -549,11 +517,7 @@ def list( return list( self.stream( date_created=date_created, - date_created_before=date_created_before, - date_created_after=date_created_after, date_updated=date_updated, - date_updated_before=date_updated_before, - date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, limit=limit, @@ -564,11 +528,7 @@ def list( async def list_async( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -580,11 +540,7 @@ async def list_async( memory before returning. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. list() guarantees @@ -600,11 +556,7 @@ async def list_async( record async for record in await self.stream_async( date_created=date_created, - date_created_before=date_created_before, - date_created_after=date_created_after, date_updated=date_updated, - date_updated_before=date_updated_before, - date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, limit=limit, @@ -615,11 +567,7 @@ async def list_async( def page( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, page_token: Union[str, object] = values.unset, @@ -631,11 +579,7 @@ def page( Request is executed immediately :param date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param friendly_name: The string that identifies the Conference resources to read. :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param page_token: PageToken provided by the API @@ -647,11 +591,7 @@ def page( data = values.of( { "DateCreated": serialize.iso8601_date(date_created), - "DateCreated<": serialize.iso8601_date(date_created_before), - "DateCreated>": serialize.iso8601_date(date_created_after), "DateUpdated": serialize.iso8601_date(date_updated), - "DateUpdated<": serialize.iso8601_date(date_updated_before), - "DateUpdated>": serialize.iso8601_date(date_updated_after), "FriendlyName": friendly_name, "Status": status, "PageToken": page_token, @@ -666,11 +606,7 @@ def page( async def page_async( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, page_token: Union[str, object] = values.unset, @@ -682,11 +618,7 @@ async def page_async( Request is executed immediately :param date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param friendly_name: The string that identifies the Conference resources to read. :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param page_token: PageToken provided by the API @@ -698,11 +630,7 @@ async def page_async( data = values.of( { "DateCreated": serialize.iso8601_date(date_created), - "DateCreated<": serialize.iso8601_date(date_created_before), - "DateCreated>": serialize.iso8601_date(date_created_after), "DateUpdated": serialize.iso8601_date(date_updated), - "DateUpdated<": serialize.iso8601_date(date_updated_before), - "DateUpdated>": serialize.iso8601_date(date_updated_after), "FriendlyName": friendly_name, "Status": status, "PageToken": page_token, diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index 9706e80cf0..8d8144d331 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -674,8 +674,6 @@ def stream( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[MessageInstance]: @@ -688,8 +686,6 @@ def stream( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :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 @@ -701,12 +697,7 @@ def stream( """ limits = self._version.read_limits(limit, page_size) page = self.page( - to=to, - from_=from_, - date_sent=date_sent, - date_sent_before=date_sent_before, - date_sent_after=date_sent_after, - page_size=limits["page_size"], + to=to, from_=from_, date_sent=date_sent, page_size=limits["page_size"] ) return self._version.stream(page, limits["limit"]) @@ -716,8 +707,6 @@ async def stream_async( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[MessageInstance]: @@ -730,8 +719,6 @@ async def stream_async( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :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 @@ -743,12 +730,7 @@ async def stream_async( """ limits = self._version.read_limits(limit, page_size) page = await self.page_async( - to=to, - from_=from_, - date_sent=date_sent, - date_sent_before=date_sent_before, - date_sent_after=date_sent_after, - page_size=limits["page_size"], + to=to, from_=from_, date_sent=date_sent, page_size=limits["page_size"] ) return self._version.stream_async(page, limits["limit"]) @@ -758,8 +740,6 @@ def list( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[MessageInstance]: @@ -771,8 +751,6 @@ def list( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :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 @@ -787,8 +765,6 @@ def list( to=to, from_=from_, date_sent=date_sent, - date_sent_before=date_sent_before, - date_sent_after=date_sent_after, limit=limit, page_size=page_size, ) @@ -799,8 +775,6 @@ async def list_async( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[MessageInstance]: @@ -812,8 +786,6 @@ async def list_async( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :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 @@ -829,8 +801,6 @@ async def list_async( to=to, from_=from_, date_sent=date_sent, - date_sent_before=date_sent_before, - date_sent_after=date_sent_after, limit=limit, page_size=page_size, ) @@ -841,8 +811,6 @@ def page( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -854,8 +822,6 @@ def page( :param to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :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 @@ -867,8 +833,6 @@ def page( "To": to, "From": from_, "DateSent": serialize.iso8601_datetime(date_sent), - "DateSent<": serialize.iso8601_datetime(date_sent_before), - "DateSent>": serialize.iso8601_datetime(date_sent_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -883,8 +847,6 @@ async def page_async( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -896,8 +858,6 @@ async def page_async( :param to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :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 @@ -909,8 +869,6 @@ async def page_async( "To": to, "From": from_, "DateSent": serialize.iso8601_datetime(date_sent), - "DateSent<": serialize.iso8601_datetime(date_sent_before), - "DateSent>": serialize.iso8601_datetime(date_sent_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/content/v1/content/approval_create.py b/twilio/rest/content/v1/content/approval_create.py new file mode 100644 index 0000000000..63a4474306 --- /dev/null +++ b/twilio/rest/content/v1/content/approval_create.py @@ -0,0 +1,138 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Content + 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 typing import Any, Dict, Optional + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class ApprovalCreateInstance(InstanceResource): + """ + :ivar name: + :ivar category: + :ivar content_type: + :ivar status: + :ivar rejection_reason: + :ivar allow_category_change: + """ + + def __init__(self, version: Version, payload: Dict[str, Any], sid: str): + super().__init__(version) + + self.name: Optional[str] = payload.get("name") + self.category: Optional[str] = payload.get("category") + self.content_type: Optional[str] = payload.get("content_type") + self.status: Optional[str] = payload.get("status") + self.rejection_reason: Optional[str] = payload.get("rejection_reason") + self.allow_category_change: Optional[bool] = payload.get( + "allow_category_change" + ) + + self._solution = { + "sid": 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 ApprovalCreateList(ListResource): + + class ContentApprovalRequest(object): + """ + :ivar name: Name of the template. + :ivar category: A WhatsApp recognized template category. + """ + + def __init__(self, payload: Dict[str, Any], sid: str): + + self.name: Optional[str] = payload.get("name") + self.category: Optional[str] = payload.get("category") + + def to_dict(self): + return { + "name": self.name, + "category": self.category, + } + + def __init__(self, version: Version, sid: str): + """ + Initialize the ApprovalCreateList + + :param version: Version that contains the resource + :param sid: + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/Content/{sid}/ApprovalRequests/whatsapp".format(**self._solution) + + def create( + self, content_approval_request: ContentApprovalRequest + ) -> ApprovalCreateInstance: + """ + Create the ApprovalCreateInstance + + :param content_approval_request: + + :returns: The created ApprovalCreateInstance + """ + data = content_approval_request.to_dict() + + headers = {"Content-Type": "application/json"} + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ApprovalCreateInstance(self._version, payload, sid=self._solution["sid"]) + + async def create_async( + self, content_approval_request: ContentApprovalRequest + ) -> ApprovalCreateInstance: + """ + Asynchronously create the ApprovalCreateInstance + + :param content_approval_request: + + :returns: The created ApprovalCreateInstance + """ + + data = content_approval_request.to_dict() + headers = {"Content-Type": "application/json"} + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ApprovalCreateInstance(self._version, payload, sid=self._solution["sid"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v1/configuration.py b/twilio/rest/flex_api/v1/configuration.py index 511321a588..b358081517 100644 --- a/twilio/rest/flex_api/v1/configuration.py +++ b/twilio/rest/flex_api/v1/configuration.py @@ -237,6 +237,24 @@ async def fetch_async( ui_version=ui_version, ) + def update(self) -> "ConfigurationInstance": + """ + Update the ConfigurationInstance + + + :returns: The updated ConfigurationInstance + """ + return self._proxy.update() + + async def update_async(self) -> "ConfigurationInstance": + """ + Asynchronous coroutine to update the ConfigurationInstance + + + :returns: The updated ConfigurationInstance + """ + return await self._proxy.update_async() + def __repr__(self) -> str: """ Provide a friendly representation @@ -309,6 +327,40 @@ async def fetch_async( payload, ) + def update(self) -> ConfigurationInstance: + """ + Update the ConfigurationInstance + + + :returns: The updated ConfigurationInstance + """ + data = values.of({}) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return ConfigurationInstance(self._version, payload) + + async def update_async(self) -> ConfigurationInstance: + """ + Asynchronous coroutine to update the ConfigurationInstance + + + :returns: The updated ConfigurationInstance + """ + data = values.of({}) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return ConfigurationInstance(self._version, payload) + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 384b0d95e3..95223e1615 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -16,7 +16,9 @@ from twilio.base.version import Version from twilio.base.domain import Domain from twilio.rest.numbers.v1.bulk_eligibility import BulkEligibilityList +from twilio.rest.numbers.v1.eligibility import EligibilityList from twilio.rest.numbers.v1.porting_bulk_portability import PortingBulkPortabilityList +from twilio.rest.numbers.v1.porting_port_in import PortingPortInList from twilio.rest.numbers.v1.porting_port_in_fetch import PortingPortInFetchList from twilio.rest.numbers.v1.porting_portability import PortingPortabilityList @@ -31,7 +33,9 @@ def __init__(self, domain: Domain): """ super().__init__(domain, "v1") self._bulk_eligibilities: Optional[BulkEligibilityList] = None + self._eligibilities: Optional[EligibilityList] = None self._porting_bulk_portabilities: Optional[PortingBulkPortabilityList] = None + self._porting_port_ins: Optional[PortingPortInList] = None self._porting_port_ins: Optional[PortingPortInFetchList] = None self._porting_portabilities: Optional[PortingPortabilityList] = None @@ -41,12 +45,24 @@ def bulk_eligibilities(self) -> BulkEligibilityList: self._bulk_eligibilities = BulkEligibilityList(self) return self._bulk_eligibilities + @property + def eligibilities(self) -> EligibilityList: + if self._eligibilities is None: + self._eligibilities = EligibilityList(self) + return self._eligibilities + @property def porting_bulk_portabilities(self) -> PortingBulkPortabilityList: if self._porting_bulk_portabilities is None: self._porting_bulk_portabilities = PortingBulkPortabilityList(self) return self._porting_bulk_portabilities + @property + def porting_port_ins(self) -> PortingPortInList: + if self._porting_port_ins is None: + self._porting_port_ins = PortingPortInList(self) + return self._porting_port_ins + @property def porting_port_ins(self) -> PortingPortInFetchList: if self._porting_port_ins is None: diff --git a/twilio/rest/numbers/v1/bulk_eligibility.py b/twilio/rest/numbers/v1/bulk_eligibility.py index 64be314b44..c13f42c796 100644 --- a/twilio/rest/numbers/v1/bulk_eligibility.py +++ b/twilio/rest/numbers/v1/bulk_eligibility.py @@ -178,6 +178,38 @@ def __init__(self, version: Version): """ super().__init__(version) + self._uri = "/HostedNumber/Eligibility/Bulk" + + def create(self) -> BulkEligibilityInstance: + """ + Create the BulkEligibilityInstance + + + :returns: The created BulkEligibilityInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return BulkEligibilityInstance(self._version, payload) + + async def create_async(self) -> BulkEligibilityInstance: + """ + Asynchronously create the BulkEligibilityInstance + + + :returns: The created BulkEligibilityInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return BulkEligibilityInstance(self._version, payload) + def get(self, request_id: str) -> BulkEligibilityContext: """ Constructs a BulkEligibilityContext diff --git a/twilio/rest/numbers/v1/eligibility.py b/twilio/rest/numbers/v1/eligibility.py new file mode 100644 index 0000000000..99461374ee --- /dev/null +++ b/twilio/rest/numbers/v1/eligibility.py @@ -0,0 +1,91 @@ +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 typing import Any, Dict, List, Optional + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class EligibilityInstance(InstanceResource): + """ + :ivar results: The result set that contains the eligibility check response for the requested number, each result has at least the following attributes: phone_number: The requested phone number ,hosting_account_sid: The account sid where the phone number will be hosted, date_last_checked: Datetime (ISO 8601) when the PN was last checked for eligibility, country: Phone number’s country, eligibility_status: Indicates the eligibility status of the PN (Eligible/Ineligible), eligibility_sub_status: Indicates the sub status of the eligibility , ineligibility_reason: Reason for number's ineligibility (if applicable), next_step: Suggested next step in the hosting process based on the eligibility status. + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.results: Optional[List[Dict[str, object]]] = payload.get("results") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class EligibilityList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the EligibilityList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/HostedNumber/Eligibility" + + def create(self) -> EligibilityInstance: + """ + Create the EligibilityInstance + + + :returns: The created EligibilityInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return EligibilityInstance(self._version, payload) + + async def create_async(self) -> EligibilityInstance: + """ + Asynchronously create the EligibilityInstance + + + :returns: The created EligibilityInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return EligibilityInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py new file mode 100644 index 0000000000..ad3140a0b8 --- /dev/null +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -0,0 +1,93 @@ +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 typing import Any, Dict, Optional + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class PortingPortInInstance(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: + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.port_in_request_sid: Optional[str] = payload.get("port_in_request_sid") + self.url: Optional[str] = payload.get("url") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class PortingPortInList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PortingPortInList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Porting/PortIn" + + def create(self) -> PortingPortInInstance: + """ + Create the PortingPortInInstance + + + :returns: The created PortingPortInInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return PortingPortInInstance(self._version, payload) + + async def create_async(self) -> PortingPortInInstance: + """ + Asynchronously create the PortingPortInInstance + + + :returns: The created PortingPortInInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return PortingPortInInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/numbers/v2/bulk_hosted_number_order.py b/twilio/rest/numbers/v2/bulk_hosted_number_order.py index 31f95814f0..f7f6026c50 100644 --- a/twilio/rest/numbers/v2/bulk_hosted_number_order.py +++ b/twilio/rest/numbers/v2/bulk_hosted_number_order.py @@ -216,6 +216,38 @@ def __init__(self, version: Version): """ super().__init__(version) + self._uri = "/HostedNumber/Orders/Bulk" + + def create(self) -> BulkHostedNumberOrderInstance: + """ + Create the BulkHostedNumberOrderInstance + + + :returns: The created BulkHostedNumberOrderInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return BulkHostedNumberOrderInstance(self._version, payload) + + async def create_async(self) -> BulkHostedNumberOrderInstance: + """ + Asynchronously create the BulkHostedNumberOrderInstance + + + :returns: The created BulkHostedNumberOrderInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return BulkHostedNumberOrderInstance(self._version, payload) + def get(self, bulk_hosting_sid: str) -> BulkHostedNumberOrderContext: """ Constructs a BulkHostedNumberOrderContext diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py index 5e1eec5b16..8215bb95b7 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py @@ -578,8 +578,6 @@ def stream( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[BundleInstance]: @@ -598,8 +596,6 @@ def stream( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :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 @@ -620,8 +616,6 @@ def stream( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, - valid_until_date_before=valid_until_date_before, - valid_until_date_after=valid_until_date_after, page_size=limits["page_size"], ) @@ -638,8 +632,6 @@ async def stream_async( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[BundleInstance]: @@ -658,8 +650,6 @@ async def stream_async( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :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 @@ -680,8 +670,6 @@ async def stream_async( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, - valid_until_date_before=valid_until_date_before, - valid_until_date_after=valid_until_date_after, page_size=limits["page_size"], ) @@ -698,8 +686,6 @@ def list( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[BundleInstance]: @@ -717,8 +703,6 @@ def list( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :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 @@ -739,8 +723,6 @@ def list( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, - valid_until_date_before=valid_until_date_before, - valid_until_date_after=valid_until_date_after, limit=limit, page_size=page_size, ) @@ -757,8 +739,6 @@ async def list_async( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[BundleInstance]: @@ -776,8 +756,6 @@ async def list_async( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :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 @@ -799,8 +777,6 @@ async def list_async( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, - valid_until_date_before=valid_until_date_before, - valid_until_date_after=valid_until_date_after, limit=limit, page_size=page_size, ) @@ -817,8 +793,6 @@ def page( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -836,8 +810,6 @@ def page( :param sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :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 @@ -855,8 +827,6 @@ def page( "SortBy": sort_by, "SortDirection": sort_direction, "ValidUntilDate": serialize.iso8601_datetime(valid_until_date), - "ValidUntilDate<": serialize.iso8601_datetime(valid_until_date_before), - "ValidUntilDate>": serialize.iso8601_datetime(valid_until_date_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -877,8 +847,6 @@ async def page_async( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -896,8 +864,6 @@ async def page_async( :param sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :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 @@ -915,8 +881,6 @@ async def page_async( "SortBy": sort_by, "SortDirection": sort_direction, "ValidUntilDate": serialize.iso8601_datetime(valid_until_date), - "ValidUntilDate<": serialize.iso8601_datetime(valid_until_date_before), - "ValidUntilDate>": serialize.iso8601_datetime(valid_until_date_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/preview_messaging/PreviewMessagingBase.py b/twilio/rest/preview_messaging/PreviewMessagingBase.py new file mode 100644 index 0000000000..12b19f4cf1 --- /dev/null +++ b/twilio/rest/preview_messaging/PreviewMessagingBase.py @@ -0,0 +1,44 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional + +from twilio.base.domain import Domain +from twilio.rest import Client +from twilio.rest.preview_messaging.v1 import V1 + + +class PreviewMessagingBase(Domain): + + def __init__(self, twilio: Client): + """ + Initialize the PreviewMessaging Domain + + :returns: Domain for PreviewMessaging + """ + super().__init__(twilio, "https://preview.messaging.twilio.com") + self._v1: Optional[V1] = None + + @property + def v1(self) -> V1: + """ + :returns: Versions v1 of PreviewMessaging + """ + if self._v1 is None: + self._v1 = V1(self) + return self._v1 + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_messaging/__init__.py b/twilio/rest/preview_messaging/__init__.py new file mode 100644 index 0000000000..73bf67969d --- /dev/null +++ b/twilio/rest/preview_messaging/__init__.py @@ -0,0 +1,13 @@ +from twilio.rest.preview_messaging.PreviewMessagingBase import PreviewMessagingBase +from twilio.rest.preview_messaging.v1.broadcast import BroadcastList +from twilio.rest.preview_messaging.v1.message import MessageList + + +class PreviewMessaging(PreviewMessagingBase): + @property + def broadcast(self) -> BroadcastList: + return self.v1.broadcasts + + @property + def messages(self) -> MessageList: + return self.v1.messages diff --git a/twilio/rest/preview_messaging/v1/__init__.py b/twilio/rest/preview_messaging/v1/__init__.py new file mode 100644 index 0000000000..424af648e8 --- /dev/null +++ b/twilio/rest/preview_messaging/v1/__init__.py @@ -0,0 +1,51 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Bulk Messaging and Broadcast + Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.preview_messaging.v1.broadcast import BroadcastList +from twilio.rest.preview_messaging.v1.message import MessageList + + +class V1(Version): + + def __init__(self, domain: Domain): + """ + Initialize the V1 version of PreviewMessaging + + :param domain: The Twilio.preview_messaging domain + """ + super().__init__(domain, "v1") + self._broadcasts: Optional[BroadcastList] = None + self._messages: Optional[MessageList] = None + + @property + def broadcasts(self) -> BroadcastList: + if self._broadcasts is None: + self._broadcasts = BroadcastList(self) + return self._broadcasts + + @property + def messages(self) -> MessageList: + if self._messages is None: + self._messages = MessageList(self) + return self._messages + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_messaging/v1/broadcast.py b/twilio/rest/preview_messaging/v1/broadcast.py new file mode 100644 index 0000000000..e41e066bad --- /dev/null +++ b/twilio/rest/preview_messaging/v1/broadcast.py @@ -0,0 +1,125 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Bulk Messaging and Broadcast + Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class BroadcastInstance(InstanceResource): + """ + :ivar broadcast_sid: Numeric ID indentifying individual Broadcast requests + :ivar created_date: Timestamp of when the Broadcast was created + :ivar updated_date: Timestamp of when the Broadcast was last updated + :ivar broadcast_status: Status of the Broadcast request. Valid values are None, Pending-Upload, Uploaded, Queued, Executing, Execution-Failure, Execution-Completed, Cancelation-Requested, and Canceled + :ivar execution_details: + :ivar results_file: Path to a file detailing successful requests and errors from Broadcast execution + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.broadcast_sid: Optional[str] = payload.get("broadcast_sid") + self.created_date: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("created_date") + ) + self.updated_date: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("updated_date") + ) + self.broadcast_status: Optional[str] = payload.get("broadcast_status") + self.execution_details: Optional[str] = payload.get("execution_details") + self.results_file: Optional[str] = payload.get("results_file") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class BroadcastList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the BroadcastList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Broadcasts" + + def create( + self, x_twilio_request_key: Union[str, object] = values.unset + ) -> BroadcastInstance: + """ + Create the BroadcastInstance + + :param x_twilio_request_key: Idempotency key provided by the client + + :returns: The created BroadcastInstance + """ + + data = values.of({}) + headers = values.of( + { + "X-Twilio-Request-Key": x_twilio_request_key, + } + ) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return BroadcastInstance(self._version, payload) + + async def create_async( + self, x_twilio_request_key: Union[str, object] = values.unset + ) -> BroadcastInstance: + """ + Asynchronously create the BroadcastInstance + + :param x_twilio_request_key: Idempotency key provided by the client + + :returns: The created BroadcastInstance + """ + + data = values.of({}) + headers = values.of( + { + "X-Twilio-Request-Key": x_twilio_request_key, + } + ) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return BroadcastInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_messaging/v1/message.py b/twilio/rest/preview_messaging/v1/message.py new file mode 100644 index 0000000000..c6212c7f4f --- /dev/null +++ b/twilio/rest/preview_messaging/v1/message.py @@ -0,0 +1,203 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Bulk Messaging and Broadcast + Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional +from twilio.base import deserialize + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class MessageInstance(InstanceResource): + """ + :ivar total_message_count: The number of Messages processed in the request, equal to the sum of success_count and error_count. + :ivar success_count: The number of Messages successfully created. + :ivar error_count: The number of Messages unsuccessfully processed in the request. + :ivar message_receipts: + :ivar failed_message_receipts: + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.total_message_count: Optional[int] = deserialize.integer( + payload.get("total_message_count") + ) + self.success_count: Optional[int] = deserialize.integer( + payload.get("success_count") + ) + self.error_count: Optional[int] = deserialize.integer( + payload.get("error_count") + ) + self.message_receipts: Optional[List[str]] = payload.get("message_receipts") + self.failed_message_receipts: Optional[List[str]] = payload.get( + "failed_message_receipts" + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class MessageList(ListResource): + + class CreateMessagesRequest(object): + """ + :ivar messages: + :ivar from_: A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty. + :ivar messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured and leave the `from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery. + :ivar body: The text of the message you want to send. Can be up to 1,600 characters in length. + :ivar content_sid: The SID of the preconfigured [Content Template](https://www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided `ContentVariables`. This Twilio product is currently in Private Beta. + :ivar media_url: The URL of the media to send with the message. The media can be of type `gif`, `png`, and `jpeg` and will be formatted correctly on the recipient's device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple `media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada. + :ivar status_callback: The URL we should call using the \"status_callback_method\" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](https://www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including \"MessageSid\", \"MessageStatus\", and \"ErrorCode\". If you include this parameter with the \"messaging_service_sid\", we use this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed. + :ivar validity_period: How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds. + :ivar send_at: The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format. + :ivar schedule_type: This parameter indicates your intent to schedule a message. Pass the value `fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter. + :ivar shorten_urls: Determines the usage of Click Tracking. Setting it to `true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`. + :ivar send_as_mms: If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media. + :ivar max_price: The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked. + :ivar attempt: Total number of attempts made ( including this ) to send out the message regardless of the provider used + :ivar smart_encoded: This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false. + :ivar force_delivery: This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline. + :ivar application_sid: The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application's message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application's message_status_callback parameter will be used. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.messages: Optional[List[MessageList.MessagingV1Message]] = payload.get( + "messages" + ) + self.from_: Optional[str] = payload.get("from_") + self.messaging_service_sid: Optional[str] = payload.get( + "messaging_service_sid" + ) + self.body: Optional[str] = payload.get("body") + self.content_sid: Optional[str] = payload.get("content_sid") + self.media_url: Optional[List[str]] = payload.get("media_url") + self.status_callback: Optional[str] = payload.get("status_callback") + self.validity_period: Optional[int] = payload.get("validity_period") + self.send_at: Optional[str] = payload.get("send_at") + self.schedule_type: Optional[str] = payload.get("schedule_type") + self.shorten_urls: Optional[bool] = payload.get("shorten_urls") + self.send_as_mms: Optional[bool] = payload.get("send_as_mms") + self.max_price: Optional[float] = payload.get("max_price") + self.attempt: Optional[int] = payload.get("attempt") + self.smart_encoded: Optional[bool] = payload.get("smart_encoded") + self.force_delivery: Optional[bool] = payload.get("force_delivery") + self.application_sid: Optional[str] = payload.get("application_sid") + + def to_dict(self): + return { + "messages": [messages.to_dict() for messages in self.messages], + "from": self.from_, + "messaging_service_sid": self.messaging_service_sid, + "body": self.body, + "content_sid": self.content_sid, + "media_url": self.media_url, + "status_callback": self.status_callback, + "validity_period": self.validity_period, + "send_at": self.send_at, + "schedule_type": self.schedule_type, + "shorten_urls": self.shorten_urls, + "send_as_mms": self.send_as_mms, + "max_price": self.max_price, + "attempt": self.attempt, + "smart_encoded": self.smart_encoded, + "force_delivery": self.force_delivery, + "application_sid": self.application_sid, + } + + class MessagingV1Message(object): + """ + :ivar to: The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format for SMS/MMS or [Channel user address](https://www.twilio.com/docs/sms/channels#channel-addresses) for other 3rd-party channels. + :ivar body: The text of the message you want to send. Can be up to 1,600 characters in length. Overrides the request-level body and content template if provided. + :ivar content_variables: Key-value pairs of variable names to substitution values. Refer to the [Twilio Content API Resources](https://www.twilio.com/docs/content-api/content-api-resources#send-a-message-with-preconfigured-content) for more details. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.to: Optional[str] = payload.get("to") + self.body: Optional[str] = payload.get("body") + self.content_variables: Optional[dict[str, str]] = payload.get( + "content_variables" + ) + + def to_dict(self): + return { + "to": self.to, + "body": self.body, + "content_variables": self.content_variables, + } + + def __init__(self, version: Version): + """ + Initialize the MessageList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Messages" + + def create(self, create_messages_request: CreateMessagesRequest) -> MessageInstance: + """ + Create the MessageInstance + + :param create_messages_request: + + :returns: The created MessageInstance + """ + data = create_messages_request.to_dict() + + headers = {"Content-Type": "application/json"} + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return MessageInstance(self._version, payload) + + async def create_async( + self, create_messages_request: CreateMessagesRequest + ) -> MessageInstance: + """ + Asynchronously create the MessageInstance + + :param create_messages_request: + + :returns: The created MessageInstance + """ + + data = create_messages_request.to_dict() + headers = {"Content-Type": "application/json"} + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return MessageInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py index 5c750d94cb..794fd216d3 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py @@ -20,6 +20,9 @@ from twilio.base.list_resource import ListResource from twilio.base.version import Version from twilio.base.page import Page +from twilio.rest.taskrouter.v1.workspace.task_queue.task_queue_bulk_real_time_statistics import ( + TaskQueueBulkRealTimeStatisticsList, +) from twilio.rest.taskrouter.v1.workspace.task_queue.task_queue_cumulative_statistics import ( TaskQueueCumulativeStatisticsList, ) @@ -515,6 +518,9 @@ def __init__(self, version: Version, workspace_sid: str): } self._uri = "/Workspaces/{workspace_sid}/TaskQueues".format(**self._solution) + self._bulk_real_time_statistics: Optional[ + TaskQueueBulkRealTimeStatisticsList + ] = None self._statistics: Optional[TaskQueuesStatisticsList] = None def create( @@ -862,6 +868,17 @@ async def get_page_async(self, target_url: str) -> TaskQueuePage: response = await self._version.domain.twilio.request_async("GET", target_url) return TaskQueuePage(self._version, response, self._solution) + @property + def bulk_real_time_statistics(self) -> TaskQueueBulkRealTimeStatisticsList: + """ + Access the bulk_real_time_statistics + """ + if self._bulk_real_time_statistics is None: + self._bulk_real_time_statistics = TaskQueueBulkRealTimeStatisticsList( + self._version, workspace_sid=self._solution["workspace_sid"] + ) + return self._bulk_real_time_statistics + @property def statistics(self) -> TaskQueuesStatisticsList: """ diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py new file mode 100644 index 0000000000..90552babf3 --- /dev/null +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py @@ -0,0 +1,123 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Taskrouter + 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 typing import Any, Dict, List, Optional +from twilio.base import deserialize + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class TaskQueueBulkRealTimeStatisticsInstance(InstanceResource): + """ + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. + :ivar workspace_sid: The SID of the Workspace that contains the TaskQueue. + :ivar task_queue_data: The real-time statistics for each requested TaskQueue SID. `task_queue_data` returns the following attributes: `task_queue_sid`: The SID of the TaskQueue from which these statistics were calculated. `total_available_workers`: The total number of Workers available for Tasks in the TaskQueue. `total_eligible_workers`: The total number of Workers eligible for Tasks in the TaskQueue, regardless of their Activity state. `total_tasks`: The total number of Tasks. `longest_task_waiting_age`: The age of the longest waiting Task. `longest_task_waiting_sid`: The SID of the longest waiting Task. `tasks_by_status`: The number of Tasks grouped by their current status. `tasks_by_priority`: The number of Tasks grouped by priority. `activity_statistics`: The number of current Workers grouped by Activity. + :ivar task_queue_response_count: The number of TaskQueue statistics received in task_queue_data. + :ivar url: The absolute URL of the TaskQueue statistics resource. + """ + + def __init__(self, version: Version, payload: Dict[str, Any], workspace_sid: str): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.workspace_sid: Optional[str] = payload.get("workspace_sid") + self.task_queue_data: Optional[List[Dict[str, object]]] = payload.get( + "task_queue_data" + ) + self.task_queue_response_count: Optional[int] = deserialize.integer( + payload.get("task_queue_response_count") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "workspace_sid": workspace_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 TaskQueueBulkRealTimeStatisticsList(ListResource): + + def __init__(self, version: Version, workspace_sid: str): + """ + Initialize the TaskQueueBulkRealTimeStatisticsList + + :param version: Version that contains the resource + :param workspace_sid: The unique SID identifier of the Workspace. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "workspace_sid": workspace_sid, + } + self._uri = "/Workspaces/{workspace_sid}/TaskQueues/RealTimeStatistics".format( + **self._solution + ) + + def create(self) -> TaskQueueBulkRealTimeStatisticsInstance: + """ + Create the TaskQueueBulkRealTimeStatisticsInstance + + + :returns: The created TaskQueueBulkRealTimeStatisticsInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return TaskQueueBulkRealTimeStatisticsInstance( + self._version, payload, workspace_sid=self._solution["workspace_sid"] + ) + + async def create_async(self) -> TaskQueueBulkRealTimeStatisticsInstance: + """ + Asynchronously create the TaskQueueBulkRealTimeStatisticsInstance + + + :returns: The created TaskQueueBulkRealTimeStatisticsInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return TaskQueueBulkRealTimeStatisticsInstance( + self._version, payload, workspace_sid=self._solution["workspace_sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" From af6547ffc7e94099915bcddffbb0489eacf87a7b Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 27 Feb 2024 13:59:00 +0000 Subject: [PATCH 4/5] [Librarian] Regenerated @ f75e0fb81b57afeb6b457dc85e19644ebb530f9b --- CHANGES.md | 33 ++ .../api/v2010/account/address/__init__.py | 18 +- twilio/rest/api/v2010/account/application.py | 34 +- .../available_phone_number_country/local.py | 46 +- .../machine_to_machine.py | 46 +- .../available_phone_number_country/mobile.py | 46 +- .../national.py | 46 +- .../shared_cost.py | 46 +- .../toll_free.py | 46 +- .../available_phone_number_country/voip.py | 46 +- .../rest/api/v2010/account/call/__init__.py | 40 +- .../rest/api/v2010/account/call/feedback.py | 333 ------------- .../v2010/account/call/feedback_summary.py | 378 --------------- twilio/rest/api/v2010/account/call/payment.py | 8 +- .../v2010/account/conference/participant.py | 68 +-- .../account/incoming_phone_number/__init__.py | 22 +- .../account/incoming_phone_number/local.py | 14 +- .../account/incoming_phone_number/mobile.py | 14 +- .../incoming_phone_number/toll_free.py | 14 +- .../api/v2010/account/message/__init__.py | 20 +- .../api/v2010/account/recording/__init__.py | 8 +- .../api/v2010/account/sip/domain/__init__.py | 34 +- .../v2010/account/usage/record/__init__.py | 4 +- .../v2010/account/usage/record/all_time.py | 4 +- .../api/v2010/account/usage/record/daily.py | 4 +- .../v2010/account/usage/record/last_month.py | 4 +- .../api/v2010/account/usage/record/monthly.py | 4 +- .../v2010/account/usage/record/this_month.py | 4 +- .../api/v2010/account/usage/record/today.py | 4 +- .../api/v2010/account/usage/record/yearly.py | 4 +- .../v2010/account/usage/record/yesterday.py | 4 +- .../bulkexports/v1/export_configuration.py | 6 +- twilio/rest/chat/v1/credential.py | 10 +- twilio/rest/chat/v1/service/__init__.py | 44 +- twilio/rest/chat/v2/credential.py | 10 +- twilio/rest/chat/v2/service/__init__.py | 60 ++- twilio/rest/content/v1/content/__init__.py | 458 +++++++++++++++++- .../rest/content/v1/content_and_approvals.py | 2 +- .../conversations/v1/address_configuration.py | 16 +- twilio/rest/conversations/v1/credential.py | 10 +- .../v1/service/configuration/__init__.py | 10 +- .../v1/service/configuration/notification.py | 42 +- twilio/rest/events/v1/sink/__init__.py | 4 +- twilio/rest/flex_api/v1/__init__.py | 26 - twilio/rest/flex_api/v1/channel.py | 6 +- twilio/rest/flex_api/v1/configuration.py | 46 +- twilio/rest/flex_api/v1/flex_flow.py | 42 +- .../flex_api/v1/insights_conversational_ai.py | 295 ----------- ...ights_conversational_ai_report_insights.py | 279 ----------- .../flex_api/v1/insights_questionnaires.py | 12 +- .../v1/insights_questionnaires_question.py | 8 +- .../interaction_channel_participant.py | 10 + twilio/rest/frontline_api/v1/user.py | 6 +- twilio/rest/insights/v1/call/annotation.py | 6 +- twilio/rest/insights/v1/call_summaries.py | 22 +- twilio/rest/insights/v1/setting.py | 10 +- twilio/rest/intelligence/v2/service.py | 34 +- .../rest/intelligence/v2/transcript/media.py | 6 +- .../v2/transcript/operator_result.py | 10 +- .../intelligence/v2/transcript/sentence.py | 6 +- twilio/rest/ip_messaging/v1/credential.py | 10 +- .../rest/ip_messaging/v1/service/__init__.py | 44 +- twilio/rest/ip_messaging/v2/credential.py | 10 +- .../rest/ip_messaging/v2/service/__init__.py | 60 ++- twilio/rest/lookups/v2/phone_number.py | 12 +- .../rest/media/v1/player_streamer/__init__.py | 6 +- .../v1/brand_registration/__init__.py | 14 +- twilio/rest/messaging/v1/domain_config.py | 10 +- twilio/rest/messaging/v1/service/__init__.py | 82 ++-- .../messaging/v1/service/us_app_to_person.py | 36 +- .../messaging/v1/tollfree_verification.py | 18 +- twilio/rest/microvisor/v1/device/__init__.py | 10 +- twilio/rest/notify/v1/credential.py | 10 +- twilio/rest/notify/v1/service/__init__.py | 26 +- twilio/rest/numbers/v1/bulk_eligibility.py | 25 +- twilio/rest/numbers/v1/eligibility.py | 22 +- twilio/rest/numbers/v1/porting_port_in.py | 24 +- .../numbers/v2/bulk_hosted_number_order.py | 21 +- twilio/rest/numbers/v2/hosted_number_order.py | 8 +- .../regulatory_compliance/bundle/__init__.py | 4 +- .../preview/deployed_devices/fleet/device.py | 10 +- .../hosted_numbers/hosted_number_order.py | 4 +- .../marketplace/installed_add_on/__init__.py | 8 +- .../installed_add_on_extension.py | 6 +- twilio/rest/preview/sync/service/__init__.py | 26 +- .../service/document/document_permission.py | 14 +- .../service/sync_list/sync_list_permission.py | 14 +- .../service/sync_map/sync_map_permission.py | 14 +- twilio/rest/preview/wireless/rate_plan.py | 24 +- twilio/rest/proxy/v1/service/phone_number.py | 10 +- twilio/rest/proxy/v1/service/short_code.py | 6 +- twilio/rest/serverless/v1/service/__init__.py | 18 +- twilio/rest/supersim/v1/esim_profile.py | 6 +- twilio/rest/supersim/v1/fleet.py | 10 +- twilio/rest/sync/v1/service/__init__.py | 58 ++- .../service/document/document_permission.py | 14 +- .../service/sync_list/sync_list_permission.py | 14 +- .../service/sync_map/sync_map_permission.py | 14 +- .../rest/taskrouter/v1/workspace/__init__.py | 10 +- .../rest/taskrouter/v1/workspace/activity.py | 6 +- .../taskrouter/v1/workspace/task/__init__.py | 4 +- .../v1/workspace/task/reservation.py | 52 +- .../taskrouter/v1/workspace/task_channel.py | 18 +- .../task_queue_bulk_real_time_statistics.py | 25 +- .../v1/workspace/worker/__init__.py | 10 +- .../v1/workspace/worker/reservation.py | 52 +- .../v1/workspace/worker/worker_channel.py | 6 +- twilio/rest/trunking/v1/trunk/__init__.py | 18 +- .../rest/trunking/v1/trunk/origination_url.py | 10 +- .../v1/compliance_registration_inquiries.py | 75 ++- twilio/rest/verify/v2/service/__init__.py | 90 ++-- twilio/rest/video/v1/composition.py | 4 +- twilio/rest/video/v1/composition_hook.py | 20 +- twilio/rest/video/v1/composition_settings.py | 10 +- twilio/rest/video/v1/recording_settings.py | 10 +- twilio/rest/video/v1/room/__init__.py | 20 +- twilio/rest/voice/v1/byoc_trunk.py | 10 +- .../connection_policy_target.py | 10 +- .../dialing_permissions/country/__init__.py | 26 +- .../voice/v1/dialing_permissions/settings.py | 10 +- twilio/rest/wireless/v1/command.py | 10 +- twilio/rest/wireless/v1/rate_plan.py | 20 +- 122 files changed, 1932 insertions(+), 2208 deletions(-) delete mode 100644 twilio/rest/api/v2010/account/call/feedback.py delete mode 100644 twilio/rest/api/v2010/account/call/feedback_summary.py delete mode 100644 twilio/rest/flex_api/v1/insights_conversational_ai.py delete mode 100644 twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py diff --git a/CHANGES.md b/CHANGES.md index 73bbaa1061..d9cb281a5e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,39 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-02-27] Version 9.0.0 +-------------------------- +**Note:** This release contains breaking changes, check our [upgrade guide](./UPGRADE.md###-2024-02-20-8xx-to-9xx) for detailed migration notes. + +**Library - Feature** +- [PR #767](https://github.com/twilio/twilio-python/pull/767): Merge branch '9.0.0-rc' into main. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! **(breaking change)** + +**Library - Chore** +- [PR #771](https://github.com/twilio/twilio-python/pull/771): added check for unset values. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! +- [PR #768](https://github.com/twilio/twilio-python/pull/768): cluster tests enabled. Thanks to [@sbansla](https://github.com/sbansla)! + +**Api** +- remove feedback and feedback summary from call resource + +**Flex** +- Adding `routing_properties` to Interactions Channels Participant + +**Lookups** +- Add new `line_status` package to the lookup response +- Remove `live_activity` package from the lookup response **(breaking change)** + +**Messaging** +- Add tollfree multiple rejection reasons response array + +**Trusthub** +- Add ENUM for businessRegistrationAuthority in compliance_registration. **(breaking change)** +- Add new field in isIsvEmbed in compliance_registration. +- Add additional optional fields in compliance_registration for Individual business type. + +**Twiml** +- Add support for new Amazon Polly and Google voices (Q1 2024) for `Say` verb + + [2024-02-09] Version 8.13.0 --------------------------- **Library - Fix** diff --git a/twilio/rest/api/v2010/account/address/__init__.py b/twilio/rest/api/v2010/account/address/__init__.py index 422d7f776c..fd77747102 100644 --- a/twilio/rest/api/v2010/account/address/__init__.py +++ b/twilio/rest/api/v2010/account/address/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -350,8 +350,8 @@ def update( "City": city, "Region": region, "PostalCode": postal_code, - "EmergencyEnabled": emergency_enabled, - "AutoCorrectAddress": auto_correct_address, + "EmergencyEnabled": serialize.boolean_to_string(emergency_enabled), + "AutoCorrectAddress": serialize.boolean_to_string(auto_correct_address), "StreetSecondary": street_secondary, } ) @@ -404,8 +404,8 @@ async def update_async( "City": city, "Region": region, "PostalCode": postal_code, - "EmergencyEnabled": emergency_enabled, - "AutoCorrectAddress": auto_correct_address, + "EmergencyEnabled": serialize.boolean_to_string(emergency_enabled), + "AutoCorrectAddress": serialize.boolean_to_string(auto_correct_address), "StreetSecondary": street_secondary, } ) @@ -524,8 +524,8 @@ def create( "PostalCode": postal_code, "IsoCountry": iso_country, "FriendlyName": friendly_name, - "EmergencyEnabled": emergency_enabled, - "AutoCorrectAddress": auto_correct_address, + "EmergencyEnabled": serialize.boolean_to_string(emergency_enabled), + "AutoCorrectAddress": serialize.boolean_to_string(auto_correct_address), "StreetSecondary": street_secondary, } ) @@ -579,8 +579,8 @@ async def create_async( "PostalCode": postal_code, "IsoCountry": iso_country, "FriendlyName": friendly_name, - "EmergencyEnabled": emergency_enabled, - "AutoCorrectAddress": auto_correct_address, + "EmergencyEnabled": serialize.boolean_to_string(emergency_enabled), + "AutoCorrectAddress": serialize.boolean_to_string(auto_correct_address), "StreetSecondary": street_secondary, } ) diff --git a/twilio/rest/api/v2010/account/application.py b/twilio/rest/api/v2010/account/application.py index 3f70417b5e..a3b11f0282 100644 --- a/twilio/rest/api/v2010/account/application.py +++ b/twilio/rest/api/v2010/account/application.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -414,14 +414,18 @@ def update( "VoiceFallbackMethod": voice_fallback_method, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "SmsUrl": sms_url, "SmsMethod": sms_method, "SmsFallbackUrl": sms_fallback_url, "SmsFallbackMethod": sms_fallback_method, "SmsStatusCallback": sms_status_callback, "MessageStatusCallback": message_status_callback, - "PublicApplicationConnectEnabled": public_application_connect_enabled, + "PublicApplicationConnectEnabled": serialize.boolean_to_string( + public_application_connect_enabled + ), } ) @@ -489,14 +493,18 @@ async def update_async( "VoiceFallbackMethod": voice_fallback_method, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "SmsUrl": sms_url, "SmsMethod": sms_method, "SmsFallbackUrl": sms_fallback_url, "SmsFallbackMethod": sms_fallback_method, "SmsStatusCallback": sms_status_callback, "MessageStatusCallback": message_status_callback, - "PublicApplicationConnectEnabled": public_application_connect_enabled, + "PublicApplicationConnectEnabled": serialize.boolean_to_string( + public_application_connect_enabled + ), } ) @@ -613,7 +621,9 @@ def create( "VoiceFallbackMethod": voice_fallback_method, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "SmsUrl": sms_url, "SmsMethod": sms_method, "SmsFallbackUrl": sms_fallback_url, @@ -621,7 +631,9 @@ def create( "SmsStatusCallback": sms_status_callback, "MessageStatusCallback": message_status_callback, "FriendlyName": friendly_name, - "PublicApplicationConnectEnabled": public_application_connect_enabled, + "PublicApplicationConnectEnabled": serialize.boolean_to_string( + public_application_connect_enabled + ), } ) @@ -686,7 +698,9 @@ async def create_async( "VoiceFallbackMethod": voice_fallback_method, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "SmsUrl": sms_url, "SmsMethod": sms_method, "SmsFallbackUrl": sms_fallback_url, @@ -694,7 +708,9 @@ async def create_async( "SmsStatusCallback": sms_status_callback, "MessageStatusCallback": message_status_callback, "FriendlyName": friendly_name, - "PublicApplicationConnectEnabled": public_application_connect_enabled, + "PublicApplicationConnectEnabled": serialize.boolean_to_string( + public_application_connect_enabled + ), } ) diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/local.py b/twilio/rest/api/v2010/account/available_phone_number_country/local.py index a3fd567a7f..43118d9f72 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/local.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/local.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -501,13 +501,19 @@ def page( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -516,7 +522,7 @@ def page( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -582,13 +588,19 @@ async def page_async( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -597,7 +609,7 @@ async def page_async( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py b/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py index 04ba514cca..ee94aa944e 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -501,13 +501,19 @@ def page( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -516,7 +522,7 @@ def page( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -582,13 +588,19 @@ async def page_async( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -597,7 +609,7 @@ async def page_async( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py b/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py index cd37127017..622d2b8597 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -501,13 +501,19 @@ def page( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -516,7 +522,7 @@ def page( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -582,13 +588,19 @@ async def page_async( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -597,7 +609,7 @@ async def page_async( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/national.py b/twilio/rest/api/v2010/account/available_phone_number_country/national.py index 018bef3ac7..d0f3a63dda 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/national.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/national.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -501,13 +501,19 @@ def page( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -516,7 +522,7 @@ def page( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -582,13 +588,19 @@ async def page_async( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -597,7 +609,7 @@ async def page_async( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py b/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py index 3cb7af3eff..7b5b9b11c8 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -501,13 +501,19 @@ def page( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -516,7 +522,7 @@ def page( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -582,13 +588,19 @@ async def page_async( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -597,7 +609,7 @@ async def page_async( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py b/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py index e9d830c0bb..4368018001 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -501,13 +501,19 @@ def page( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -516,7 +522,7 @@ def page( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -582,13 +588,19 @@ async def page_async( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -597,7 +609,7 @@ async def page_async( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/voip.py b/twilio/rest/api/v2010/account/available_phone_number_country/voip.py index 8825843c8f..e0615d5a6e 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/voip.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/voip.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -501,13 +501,19 @@ def page( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -516,7 +522,7 @@ def page( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -582,13 +588,19 @@ async def page_async( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -597,7 +609,7 @@ async def page_async( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index 21c4e9c27e..0dcb8c5d5b 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -21,8 +21,6 @@ from twilio.base.version import Version from twilio.base.page import Page from twilio.rest.api.v2010.account.call.event import EventList -from twilio.rest.api.v2010.account.call.feedback import FeedbackList -from twilio.rest.api.v2010.account.call.feedback_summary import FeedbackSummaryList from twilio.rest.api.v2010.account.call.notification import NotificationList from twilio.rest.api.v2010.account.call.payment import PaymentList from twilio.rest.api.v2010.account.call.recording import RecordingList @@ -270,13 +268,6 @@ def events(self) -> EventList: """ return self._proxy.events - @property - def feedback(self) -> FeedbackList: - """ - Access the feedback - """ - return self._proxy.feedback - @property def notifications(self) -> NotificationList: """ @@ -356,7 +347,6 @@ def __init__(self, version: Version, account_sid: str, sid: str): self._uri = "/Accounts/{account_sid}/Calls/{sid}.json".format(**self._solution) self._events: Optional[EventList] = None - self._feedback: Optional[FeedbackList] = None self._notifications: Optional[NotificationList] = None self._payments: Optional[PaymentList] = None self._recordings: Optional[RecordingList] = None @@ -552,19 +542,6 @@ def events(self) -> EventList: ) return self._events - @property - def feedback(self) -> FeedbackList: - """ - Access the feedback - """ - if self._feedback is None: - self._feedback = FeedbackList( - self._version, - self._solution["account_sid"], - self._solution["sid"], - ) - return self._feedback - @property def notifications(self) -> NotificationList: """ @@ -707,8 +684,6 @@ def __init__(self, version: Version, account_sid: str): } self._uri = "/Accounts/{account_sid}/Calls.json".format(**self._solution) - self._feedback_summaries: Optional[FeedbackSummaryList] = None - def create( self, to: str, @@ -803,7 +778,7 @@ def create( "StatusCallbackMethod": status_callback_method, "SendDigits": send_digits, "Timeout": timeout, - "Record": record, + "Record": serialize.boolean_to_string(record), "RecordingChannels": recording_channels, "RecordingStatusCallback": recording_status_callback, "RecordingStatusCallbackMethod": recording_status_callback_method, @@ -937,7 +912,7 @@ async def create_async( "StatusCallbackMethod": status_callback_method, "SendDigits": send_digits, "Timeout": timeout, - "Record": record, + "Record": serialize.boolean_to_string(record), "RecordingChannels": recording_channels, "RecordingStatusCallback": recording_status_callback, "RecordingStatusCallbackMethod": recording_status_callback_method, @@ -1272,17 +1247,6 @@ async def get_page_async(self, target_url: str) -> CallPage: response = await self._version.domain.twilio.request_async("GET", target_url) return CallPage(self._version, response, self._solution) - @property - def feedback_summaries(self) -> FeedbackSummaryList: - """ - Access the feedback_summaries - """ - if self._feedback_summaries is None: - self._feedback_summaries = FeedbackSummaryList( - self._version, account_sid=self._solution["account_sid"] - ) - return self._feedback_summaries - def get(self, sid: str) -> CallContext: """ Constructs a CallContext diff --git a/twilio/rest/api/v2010/account/call/feedback.py b/twilio/rest/api/v2010/account/call/feedback.py deleted file mode 100644 index 210a529ac2..0000000000 --- a/twilio/rest/api/v2010/account/call/feedback.py +++ /dev/null @@ -1,333 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Api - 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 datetime -from typing import Any, Dict, List, Optional, Union -from twilio.base import deserialize, serialize, values -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 FeedbackInstance(InstanceResource): - - class Issues(object): - AUDIO_LATENCY = "audio-latency" - DIGITS_NOT_CAPTURED = "digits-not-captured" - DROPPED_CALL = "dropped-call" - IMPERFECT_AUDIO = "imperfect-audio" - INCORRECT_CALLER_ID = "incorrect-caller-id" - ONE_WAY_AUDIO = "one-way-audio" - POST_DIAL_DELAY = "post-dial-delay" - UNSOLICITED_CALL = "unsolicited-call" - - """ - :ivar account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - :ivar date_created: The date that this resource was created, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. - :ivar date_updated: The date that this resource was last updated, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. - :ivar issues: A list of issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. - :ivar quality_score: `1` to `5` quality score where `1` represents imperfect experience and `5` represents a perfect call. - :ivar sid: A 34 character string that uniquely identifies this resource. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], account_sid: str, call_sid: str - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_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.issues: Optional[List["FeedbackInstance.Issues"]] = payload.get("issues") - self.quality_score: Optional[int] = deserialize.integer( - payload.get("quality_score") - ) - self.sid: Optional[str] = payload.get("sid") - - self._solution = { - "account_sid": account_sid, - "call_sid": call_sid, - } - self._context: Optional[FeedbackContext] = None - - @property - def _proxy(self) -> "FeedbackContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FeedbackContext for this FeedbackInstance - """ - if self._context is None: - self._context = FeedbackContext( - self._version, - account_sid=self._solution["account_sid"], - call_sid=self._solution["call_sid"], - ) - return self._context - - def fetch(self) -> "FeedbackInstance": - """ - Fetch the FeedbackInstance - - - :returns: The fetched FeedbackInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FeedbackInstance": - """ - Asynchronous coroutine to fetch the FeedbackInstance - - - :returns: The fetched FeedbackInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - quality_score: Union[int, object] = values.unset, - issue: Union[List["FeedbackInstance.Issues"], object] = values.unset, - ) -> "FeedbackInstance": - """ - Update the FeedbackInstance - - :param quality_score: The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. - :param issue: One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. - - :returns: The updated FeedbackInstance - """ - return self._proxy.update( - quality_score=quality_score, - issue=issue, - ) - - async def update_async( - self, - quality_score: Union[int, object] = values.unset, - issue: Union[List["FeedbackInstance.Issues"], object] = values.unset, - ) -> "FeedbackInstance": - """ - Asynchronous coroutine to update the FeedbackInstance - - :param quality_score: The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. - :param issue: One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. - - :returns: The updated FeedbackInstance - """ - return await self._proxy.update_async( - quality_score=quality_score, - issue=issue, - ) - - 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 FeedbackContext(InstanceContext): - - def __init__(self, version: Version, account_sid: str, call_sid: str): - """ - Initialize the FeedbackContext - - :param version: Version that contains the resource - :param account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - :param call_sid: The call sid that uniquely identifies the call - """ - super().__init__(version) - - # Path Solution - self._solution = { - "account_sid": account_sid, - "call_sid": call_sid, - } - self._uri = "/Accounts/{account_sid}/Calls/{call_sid}/Feedback.json".format( - **self._solution - ) - - def fetch(self) -> FeedbackInstance: - """ - Fetch the FeedbackInstance - - - :returns: The fetched FeedbackInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FeedbackInstance( - self._version, - payload, - account_sid=self._solution["account_sid"], - call_sid=self._solution["call_sid"], - ) - - async def fetch_async(self) -> FeedbackInstance: - """ - Asynchronous coroutine to fetch the FeedbackInstance - - - :returns: The fetched FeedbackInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FeedbackInstance( - self._version, - payload, - account_sid=self._solution["account_sid"], - call_sid=self._solution["call_sid"], - ) - - def update( - self, - quality_score: Union[int, object] = values.unset, - issue: Union[List["FeedbackInstance.Issues"], object] = values.unset, - ) -> FeedbackInstance: - """ - Update the FeedbackInstance - - :param quality_score: The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. - :param issue: One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. - - :returns: The updated FeedbackInstance - """ - data = values.of( - { - "QualityScore": quality_score, - "Issue": serialize.map(issue, lambda e: e), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return FeedbackInstance( - self._version, - payload, - account_sid=self._solution["account_sid"], - call_sid=self._solution["call_sid"], - ) - - async def update_async( - self, - quality_score: Union[int, object] = values.unset, - issue: Union[List["FeedbackInstance.Issues"], object] = values.unset, - ) -> FeedbackInstance: - """ - Asynchronous coroutine to update the FeedbackInstance - - :param quality_score: The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. - :param issue: One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. - - :returns: The updated FeedbackInstance - """ - data = values.of( - { - "QualityScore": quality_score, - "Issue": serialize.map(issue, lambda e: e), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FeedbackInstance( - self._version, - payload, - account_sid=self._solution["account_sid"], - call_sid=self._solution["call_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 FeedbackList(ListResource): - - def __init__(self, version: Version, account_sid: str, call_sid: str): - """ - Initialize the FeedbackList - - :param version: Version that contains the resource - :param account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - :param call_sid: The call sid that uniquely identifies the call - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "account_sid": account_sid, - "call_sid": call_sid, - } - - def get(self) -> FeedbackContext: - """ - Constructs a FeedbackContext - - """ - return FeedbackContext( - self._version, - account_sid=self._solution["account_sid"], - call_sid=self._solution["call_sid"], - ) - - def __call__(self) -> FeedbackContext: - """ - Constructs a FeedbackContext - - """ - return FeedbackContext( - self._version, - account_sid=self._solution["account_sid"], - call_sid=self._solution["call_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/api/v2010/account/call/feedback_summary.py b/twilio/rest/api/v2010/account/call/feedback_summary.py deleted file mode 100644 index 2f26b0b0a4..0000000000 --- a/twilio/rest/api/v2010/account/call/feedback_summary.py +++ /dev/null @@ -1,378 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Api - 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, datetime -from typing import Any, Dict, List, Optional, Union -from twilio.base import deserialize, serialize, values -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 FeedbackSummaryInstance(InstanceResource): - - class Status(object): - QUEUED = "queued" - IN_PROGRESS = "in-progress" - COMPLETED = "completed" - FAILED = "failed" - - """ - :ivar account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - :ivar call_count: The total number of calls. - :ivar call_feedback_count: The total number of calls with a feedback entry. - :ivar date_created: The date that this resource was created, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. - :ivar date_updated: The date that this resource was last updated, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. - :ivar end_date: The last date for which feedback entries are included in this Feedback Summary, formatted as `YYYY-MM-DD` and specified in UTC. - :ivar include_subaccounts: Whether the feedback summary includes subaccounts; `true` if it does, otherwise `false`. - :ivar issues: A list of issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, or `one-way-audio`. - :ivar quality_score_average: The average QualityScore of the feedback entries. - :ivar quality_score_median: The median QualityScore of the feedback entries. - :ivar quality_score_standard_deviation: The standard deviation of the quality scores. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar start_date: The first date for which feedback entries are included in this feedback summary, formatted as `YYYY-MM-DD` and specified in UTC. - :ivar status: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - account_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.call_count: Optional[int] = deserialize.integer(payload.get("call_count")) - self.call_feedback_count: Optional[int] = deserialize.integer( - payload.get("call_feedback_count") - ) - 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.end_date: Optional[date] = deserialize.iso8601_date( - payload.get("end_date") - ) - self.include_subaccounts: Optional[bool] = payload.get("include_subaccounts") - self.issues: Optional[List[Dict[str, object]]] = payload.get("issues") - self.quality_score_average: Optional[float] = deserialize.decimal( - payload.get("quality_score_average") - ) - self.quality_score_median: Optional[float] = deserialize.decimal( - payload.get("quality_score_median") - ) - self.quality_score_standard_deviation: Optional[float] = deserialize.decimal( - payload.get("quality_score_standard_deviation") - ) - self.sid: Optional[str] = payload.get("sid") - self.start_date: Optional[date] = deserialize.iso8601_date( - payload.get("start_date") - ) - self.status: Optional["FeedbackSummaryInstance.Status"] = payload.get("status") - - self._solution = { - "account_sid": account_sid, - "sid": sid or self.sid, - } - self._context: Optional[FeedbackSummaryContext] = None - - @property - def _proxy(self) -> "FeedbackSummaryContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FeedbackSummaryContext for this FeedbackSummaryInstance - """ - if self._context is None: - self._context = FeedbackSummaryContext( - self._version, - account_sid=self._solution["account_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FeedbackSummaryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FeedbackSummaryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FeedbackSummaryInstance": - """ - Fetch the FeedbackSummaryInstance - - - :returns: The fetched FeedbackSummaryInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FeedbackSummaryInstance": - """ - Asynchronous coroutine to fetch the FeedbackSummaryInstance - - - :returns: The fetched FeedbackSummaryInstance - """ - 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 FeedbackSummaryContext(InstanceContext): - - def __init__(self, version: Version, account_sid: str, sid: str): - """ - Initialize the FeedbackSummaryContext - - :param version: Version that contains the resource - :param account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - :param sid: A 34 character string that uniquely identifies this resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "account_sid": account_sid, - "sid": sid, - } - self._uri = "/Accounts/{account_sid}/Calls/FeedbackSummary/{sid}.json".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the FeedbackSummaryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FeedbackSummaryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FeedbackSummaryInstance: - """ - Fetch the FeedbackSummaryInstance - - - :returns: The fetched FeedbackSummaryInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FeedbackSummaryInstance( - self._version, - payload, - account_sid=self._solution["account_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FeedbackSummaryInstance: - """ - Asynchronous coroutine to fetch the FeedbackSummaryInstance - - - :returns: The fetched FeedbackSummaryInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FeedbackSummaryInstance( - self._version, - payload, - account_sid=self._solution["account_sid"], - sid=self._solution["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 FeedbackSummaryList(ListResource): - - def __init__(self, version: Version, account_sid: str): - """ - Initialize the FeedbackSummaryList - - :param version: Version that contains the resource - :param account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "account_sid": account_sid, - } - self._uri = "/Accounts/{account_sid}/Calls/FeedbackSummary.json".format( - **self._solution - ) - - def create( - self, - start_date: date, - end_date: date, - include_subaccounts: Union[bool, object] = values.unset, - status_callback: Union[str, object] = values.unset, - status_callback_method: Union[str, object] = values.unset, - ) -> FeedbackSummaryInstance: - """ - Create the FeedbackSummaryInstance - - :param start_date: Only include feedback given on or after this date. Format is `YYYY-MM-DD` and specified in UTC. - :param end_date: Only include feedback given on or before this date. Format is `YYYY-MM-DD` and specified in UTC. - :param include_subaccounts: Whether to also include Feedback resources from all subaccounts. `true` includes feedback from all subaccounts and `false`, the default, includes feedback from only the specified account. - :param status_callback: The URL that we will request when the feedback summary is complete. - :param status_callback_method: The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` URL. - - :returns: The created FeedbackSummaryInstance - """ - - data = values.of( - { - "StartDate": serialize.iso8601_date(start_date), - "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, - "StatusCallback": status_callback, - "StatusCallbackMethod": status_callback_method, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return FeedbackSummaryInstance( - self._version, payload, account_sid=self._solution["account_sid"] - ) - - async def create_async( - self, - start_date: date, - end_date: date, - include_subaccounts: Union[bool, object] = values.unset, - status_callback: Union[str, object] = values.unset, - status_callback_method: Union[str, object] = values.unset, - ) -> FeedbackSummaryInstance: - """ - Asynchronously create the FeedbackSummaryInstance - - :param start_date: Only include feedback given on or after this date. Format is `YYYY-MM-DD` and specified in UTC. - :param end_date: Only include feedback given on or before this date. Format is `YYYY-MM-DD` and specified in UTC. - :param include_subaccounts: Whether to also include Feedback resources from all subaccounts. `true` includes feedback from all subaccounts and `false`, the default, includes feedback from only the specified account. - :param status_callback: The URL that we will request when the feedback summary is complete. - :param status_callback_method: The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` URL. - - :returns: The created FeedbackSummaryInstance - """ - - data = values.of( - { - "StartDate": serialize.iso8601_date(start_date), - "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, - "StatusCallback": status_callback, - "StatusCallbackMethod": status_callback_method, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FeedbackSummaryInstance( - self._version, payload, account_sid=self._solution["account_sid"] - ) - - def get(self, sid: str) -> FeedbackSummaryContext: - """ - Constructs a FeedbackSummaryContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return FeedbackSummaryContext( - self._version, account_sid=self._solution["account_sid"], sid=sid - ) - - def __call__(self, sid: str) -> FeedbackSummaryContext: - """ - Constructs a FeedbackSummaryContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return FeedbackSummaryContext( - self._version, account_sid=self._solution["account_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/api/v2010/account/call/payment.py b/twilio/rest/api/v2010/account/call/payment.py index 540baa8435..d6252f5277 100644 --- a/twilio/rest/api/v2010/account/call/payment.py +++ b/twilio/rest/api/v2010/account/call/payment.py @@ -354,8 +354,8 @@ def create( "Parameter": serialize.object(parameter), "PaymentConnector": payment_connector, "PaymentMethod": payment_method, - "PostalCode": postal_code, - "SecurityCode": security_code, + "PostalCode": serialize.boolean_to_string(postal_code), + "SecurityCode": serialize.boolean_to_string(security_code), "Timeout": timeout, "TokenType": token_type, "ValidCardTypes": valid_card_types, @@ -432,8 +432,8 @@ async def create_async( "Parameter": serialize.object(parameter), "PaymentConnector": payment_connector, "PaymentMethod": payment_method, - "PostalCode": postal_code, - "SecurityCode": security_code, + "PostalCode": serialize.boolean_to_string(postal_code), + "SecurityCode": serialize.boolean_to_string(security_code), "Timeout": timeout, "TokenType": token_type, "ValidCardTypes": valid_card_types, diff --git a/twilio/rest/api/v2010/account/conference/participant.py b/twilio/rest/api/v2010/account/conference/participant.py index 3759e4558d..1f3fffd8a4 100644 --- a/twilio/rest/api/v2010/account/conference/participant.py +++ b/twilio/rest/api/v2010/account/conference/participant.py @@ -374,17 +374,19 @@ def update( """ data = values.of( { - "Muted": muted, - "Hold": hold, + "Muted": serialize.boolean_to_string(muted), + "Hold": serialize.boolean_to_string(hold), "HoldUrl": hold_url, "HoldMethod": hold_method, "AnnounceUrl": announce_url, "AnnounceMethod": announce_method, "WaitUrl": wait_url, "WaitMethod": wait_method, - "BeepOnExit": beep_on_exit, - "EndConferenceOnExit": end_conference_on_exit, - "Coaching": coaching, + "BeepOnExit": serialize.boolean_to_string(beep_on_exit), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), + "Coaching": serialize.boolean_to_string(coaching), "CallSidToCoach": call_sid_to_coach, } ) @@ -438,17 +440,19 @@ async def update_async( """ data = values.of( { - "Muted": muted, - "Hold": hold, + "Muted": serialize.boolean_to_string(muted), + "Hold": serialize.boolean_to_string(hold), "HoldUrl": hold_url, "HoldMethod": hold_method, "AnnounceUrl": announce_url, "AnnounceMethod": announce_method, "WaitUrl": wait_url, "WaitMethod": wait_method, - "BeepOnExit": beep_on_exit, - "EndConferenceOnExit": end_conference_on_exit, - "Coaching": coaching, + "BeepOnExit": serialize.boolean_to_string(beep_on_exit), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), + "Coaching": serialize.boolean_to_string(coaching), "CallSidToCoach": call_sid_to_coach, } ) @@ -642,14 +646,18 @@ def create( ), "Label": label, "Timeout": timeout, - "Record": record, - "Muted": muted, + "Record": serialize.boolean_to_string(record), + "Muted": serialize.boolean_to_string(muted), "Beep": beep, - "StartConferenceOnEnter": start_conference_on_enter, - "EndConferenceOnExit": end_conference_on_exit, + "StartConferenceOnEnter": serialize.boolean_to_string( + start_conference_on_enter + ), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), "WaitUrl": wait_url, "WaitMethod": wait_method, - "EarlyMedia": early_media, + "EarlyMedia": serialize.boolean_to_string(early_media), "MaxParticipants": max_participants, "ConferenceRecord": conference_record, "ConferenceTrim": conference_trim, @@ -672,7 +680,7 @@ def create( "ConferenceRecordingStatusCallbackEvent": serialize.map( conference_recording_status_callback_event, lambda e: e ), - "Coaching": coaching, + "Coaching": serialize.boolean_to_string(coaching), "CallSidToCoach": call_sid_to_coach, "JitterBufferSize": jitter_buffer_size, "Byoc": byoc, @@ -824,14 +832,18 @@ async def create_async( ), "Label": label, "Timeout": timeout, - "Record": record, - "Muted": muted, + "Record": serialize.boolean_to_string(record), + "Muted": serialize.boolean_to_string(muted), "Beep": beep, - "StartConferenceOnEnter": start_conference_on_enter, - "EndConferenceOnExit": end_conference_on_exit, + "StartConferenceOnEnter": serialize.boolean_to_string( + start_conference_on_enter + ), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), "WaitUrl": wait_url, "WaitMethod": wait_method, - "EarlyMedia": early_media, + "EarlyMedia": serialize.boolean_to_string(early_media), "MaxParticipants": max_participants, "ConferenceRecord": conference_record, "ConferenceTrim": conference_trim, @@ -854,7 +866,7 @@ async def create_async( "ConferenceRecordingStatusCallbackEvent": serialize.map( conference_recording_status_callback_event, lambda e: e ), - "Coaching": coaching, + "Coaching": serialize.boolean_to_string(coaching), "CallSidToCoach": call_sid_to_coach, "JitterBufferSize": jitter_buffer_size, "Byoc": byoc, @@ -1048,9 +1060,9 @@ def page( """ data = values.of( { - "Muted": muted, - "Hold": hold, - "Coaching": coaching, + "Muted": serialize.boolean_to_string(muted), + "Hold": serialize.boolean_to_string(hold), + "Coaching": serialize.boolean_to_string(coaching), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -1084,9 +1096,9 @@ async def page_async( """ data = values.of( { - "Muted": muted, - "Hold": hold, - "Coaching": coaching, + "Muted": serialize.boolean_to_string(muted), + "Hold": serialize.boolean_to_string(hold), + "Coaching": serialize.boolean_to_string(coaching), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py index b1910d5bf6..6fa4748b60 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -553,7 +553,9 @@ def update( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -653,7 +655,9 @@ async def update_async( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -823,7 +827,9 @@ def create( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -924,7 +930,9 @@ async def create_async( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -1132,7 +1140,7 @@ def page( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, @@ -1171,7 +1179,7 @@ async def page_async( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/local.py b/twilio/rest/api/v2010/account/incoming_phone_number/local.py index 6f87f0e94c..4548720329 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/local.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/local.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -263,7 +263,9 @@ def create( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -359,7 +361,9 @@ async def create_async( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -565,7 +569,7 @@ def page( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, @@ -604,7 +608,7 @@ async def page_async( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py index 59fdda7a90..6147d4bfe7 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -265,7 +265,9 @@ def create( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -363,7 +365,9 @@ async def create_async( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -569,7 +573,7 @@ def page( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, @@ -608,7 +612,7 @@ async def page_async( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py b/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py index e6a197283a..806b7c0500 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -265,7 +265,9 @@ def create( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -363,7 +365,9 @@ async def create_async( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -569,7 +573,7 @@ def page( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, @@ -608,7 +612,7 @@ async def page_async( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index 8d8144d331..795ad19747 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -539,18 +539,18 @@ def create( "StatusCallback": status_callback, "ApplicationSid": application_sid, "MaxPrice": max_price, - "ProvideFeedback": provide_feedback, + "ProvideFeedback": serialize.boolean_to_string(provide_feedback), "Attempt": attempt, "ValidityPeriod": validity_period, - "ForceDelivery": force_delivery, + "ForceDelivery": serialize.boolean_to_string(force_delivery), "ContentRetention": content_retention, "AddressRetention": address_retention, - "SmartEncoded": smart_encoded, + "SmartEncoded": serialize.boolean_to_string(smart_encoded), "PersistentAction": serialize.map(persistent_action, lambda e: e), - "ShortenUrls": shorten_urls, + "ShortenUrls": serialize.boolean_to_string(shorten_urls), "ScheduleType": schedule_type, "SendAt": serialize.iso8601_datetime(send_at), - "SendAsMms": send_as_mms, + "SendAsMms": serialize.boolean_to_string(send_as_mms), "ContentVariables": content_variables, "RiskCheck": risk_check, "From": from_, @@ -637,18 +637,18 @@ async def create_async( "StatusCallback": status_callback, "ApplicationSid": application_sid, "MaxPrice": max_price, - "ProvideFeedback": provide_feedback, + "ProvideFeedback": serialize.boolean_to_string(provide_feedback), "Attempt": attempt, "ValidityPeriod": validity_period, - "ForceDelivery": force_delivery, + "ForceDelivery": serialize.boolean_to_string(force_delivery), "ContentRetention": content_retention, "AddressRetention": address_retention, - "SmartEncoded": smart_encoded, + "SmartEncoded": serialize.boolean_to_string(smart_encoded), "PersistentAction": serialize.map(persistent_action, lambda e: e), - "ShortenUrls": shorten_urls, + "ShortenUrls": serialize.boolean_to_string(shorten_urls), "ScheduleType": schedule_type, "SendAt": serialize.iso8601_datetime(send_at), - "SendAsMms": send_as_mms, + "SendAsMms": serialize.boolean_to_string(send_as_mms), "ContentVariables": content_variables, "RiskCheck": risk_check, "From": from_, diff --git a/twilio/rest/api/v2010/account/recording/__init__.py b/twilio/rest/api/v2010/account/recording/__init__.py index b6d7c98273..bc1ddccb76 100644 --- a/twilio/rest/api/v2010/account/recording/__init__.py +++ b/twilio/rest/api/v2010/account/recording/__init__.py @@ -258,7 +258,7 @@ def fetch( data = values.of( { - "IncludeSoftDeleted": include_soft_deleted, + "IncludeSoftDeleted": serialize.boolean_to_string(include_soft_deleted), } ) @@ -284,7 +284,7 @@ async def fetch_async( data = values.of( { - "IncludeSoftDeleted": include_soft_deleted, + "IncludeSoftDeleted": serialize.boolean_to_string(include_soft_deleted), } ) @@ -588,7 +588,7 @@ def page( "DateCreated>": serialize.iso8601_datetime(date_created_after), "CallSid": call_sid, "ConferenceSid": conference_sid, - "IncludeSoftDeleted": include_soft_deleted, + "IncludeSoftDeleted": serialize.boolean_to_string(include_soft_deleted), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -633,7 +633,7 @@ async def page_async( "DateCreated>": serialize.iso8601_datetime(date_created_after), "CallSid": call_sid, "ConferenceSid": conference_sid, - "IncludeSoftDeleted": include_soft_deleted, + "IncludeSoftDeleted": serialize.boolean_to_string(include_soft_deleted), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/sip/domain/__init__.py b/twilio/rest/api/v2010/account/sip/domain/__init__.py index f59a0c8a27..b469628388 100644 --- a/twilio/rest/api/v2010/account/sip/domain/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -423,10 +423,12 @@ def update( "VoiceStatusCallbackMethod": voice_status_callback_method, "VoiceStatusCallbackUrl": voice_status_callback_url, "VoiceUrl": voice_url, - "SipRegistration": sip_registration, + "SipRegistration": serialize.boolean_to_string(sip_registration), "DomainName": domain_name, - "EmergencyCallingEnabled": emergency_calling_enabled, - "Secure": secure, + "EmergencyCallingEnabled": serialize.boolean_to_string( + emergency_calling_enabled + ), + "Secure": serialize.boolean_to_string(secure), "ByocTrunkSid": byoc_trunk_sid, "EmergencyCallerSid": emergency_caller_sid, } @@ -489,10 +491,12 @@ async def update_async( "VoiceStatusCallbackMethod": voice_status_callback_method, "VoiceStatusCallbackUrl": voice_status_callback_url, "VoiceUrl": voice_url, - "SipRegistration": sip_registration, + "SipRegistration": serialize.boolean_to_string(sip_registration), "DomainName": domain_name, - "EmergencyCallingEnabled": emergency_calling_enabled, - "Secure": secure, + "EmergencyCallingEnabled": serialize.boolean_to_string( + emergency_calling_enabled + ), + "Secure": serialize.boolean_to_string(secure), "ByocTrunkSid": byoc_trunk_sid, "EmergencyCallerSid": emergency_caller_sid, } @@ -645,9 +649,11 @@ def create( "VoiceFallbackMethod": voice_fallback_method, "VoiceStatusCallbackUrl": voice_status_callback_url, "VoiceStatusCallbackMethod": voice_status_callback_method, - "SipRegistration": sip_registration, - "EmergencyCallingEnabled": emergency_calling_enabled, - "Secure": secure, + "SipRegistration": serialize.boolean_to_string(sip_registration), + "EmergencyCallingEnabled": serialize.boolean_to_string( + emergency_calling_enabled + ), + "Secure": serialize.boolean_to_string(secure), "ByocTrunkSid": byoc_trunk_sid, "EmergencyCallerSid": emergency_caller_sid, } @@ -709,9 +715,11 @@ async def create_async( "VoiceFallbackMethod": voice_fallback_method, "VoiceStatusCallbackUrl": voice_status_callback_url, "VoiceStatusCallbackMethod": voice_status_callback_method, - "SipRegistration": sip_registration, - "EmergencyCallingEnabled": emergency_calling_enabled, - "Secure": secure, + "SipRegistration": serialize.boolean_to_string(sip_registration), + "EmergencyCallingEnabled": serialize.boolean_to_string( + emergency_calling_enabled + ), + "Secure": serialize.boolean_to_string(secure), "ByocTrunkSid": byoc_trunk_sid, "EmergencyCallerSid": emergency_caller_sid, } diff --git a/twilio/rest/api/v2010/account/usage/record/__init__.py b/twilio/rest/api/v2010/account/usage/record/__init__.py index 8f8236fa23..0afc8e3472 100644 --- a/twilio/rest/api/v2010/account/usage/record/__init__.py +++ b/twilio/rest/api/v2010/account/usage/record/__init__.py @@ -646,7 +646,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -685,7 +685,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/all_time.py b/twilio/rest/api/v2010/account/usage/record/all_time.py index 5c424bbb80..7c0b6f5ce4 100644 --- a/twilio/rest/api/v2010/account/usage/record/all_time.py +++ b/twilio/rest/api/v2010/account/usage/record/all_time.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/daily.py b/twilio/rest/api/v2010/account/usage/record/daily.py index 6ce34da022..a0acd62b2a 100644 --- a/twilio/rest/api/v2010/account/usage/record/daily.py +++ b/twilio/rest/api/v2010/account/usage/record/daily.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/last_month.py b/twilio/rest/api/v2010/account/usage/record/last_month.py index 53b6deec6f..21fa1e1b61 100644 --- a/twilio/rest/api/v2010/account/usage/record/last_month.py +++ b/twilio/rest/api/v2010/account/usage/record/last_month.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/monthly.py b/twilio/rest/api/v2010/account/usage/record/monthly.py index baa1164a7d..0eff14396a 100644 --- a/twilio/rest/api/v2010/account/usage/record/monthly.py +++ b/twilio/rest/api/v2010/account/usage/record/monthly.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/this_month.py b/twilio/rest/api/v2010/account/usage/record/this_month.py index 5ce2ddc58a..646b4a49d5 100644 --- a/twilio/rest/api/v2010/account/usage/record/this_month.py +++ b/twilio/rest/api/v2010/account/usage/record/this_month.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/today.py b/twilio/rest/api/v2010/account/usage/record/today.py index cb814db819..30de9d4cb7 100644 --- a/twilio/rest/api/v2010/account/usage/record/today.py +++ b/twilio/rest/api/v2010/account/usage/record/today.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/yearly.py b/twilio/rest/api/v2010/account/usage/record/yearly.py index ac757b9eb7..fbe9dd1f6f 100644 --- a/twilio/rest/api/v2010/account/usage/record/yearly.py +++ b/twilio/rest/api/v2010/account/usage/record/yearly.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/yesterday.py b/twilio/rest/api/v2010/account/usage/record/yesterday.py index ab262b7092..db5f9eb472 100644 --- a/twilio/rest/api/v2010/account/usage/record/yesterday.py +++ b/twilio/rest/api/v2010/account/usage/record/yesterday.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/bulkexports/v1/export_configuration.py b/twilio/rest/bulkexports/v1/export_configuration.py index 59aee93915..c6629d21cf 100644 --- a/twilio/rest/bulkexports/v1/export_configuration.py +++ b/twilio/rest/bulkexports/v1/export_configuration.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -205,7 +205,7 @@ def update( """ data = values.of( { - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "WebhookUrl": webhook_url, "WebhookMethod": webhook_method, } @@ -238,7 +238,7 @@ async def update_async( """ data = values.of( { - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "WebhookUrl": webhook_url, "WebhookMethod": webhook_method, } diff --git a/twilio/rest/chat/v1/credential.py b/twilio/rest/chat/v1/credential.py index 8b477b675d..68ec9f4b46 100644 --- a/twilio/rest/chat/v1/credential.py +++ b/twilio/rest/chat/v1/credential.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -289,7 +289,7 @@ def update( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -329,7 +329,7 @@ async def update_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -415,7 +415,7 @@ def create( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -459,7 +459,7 @@ async def create_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } diff --git a/twilio/rest/chat/v1/service/__init__.py b/twilio/rest/chat/v1/service/__init__.py index 2783da6a9a..1e2a5884a7 100644 --- a/twilio/rest/chat/v1/service/__init__.py +++ b/twilio/rest/chat/v1/service/__init__.py @@ -732,17 +732,27 @@ def update( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "PreWebhookUrl": pre_webhook_url, "PostWebhookUrl": post_webhook_url, @@ -916,17 +926,27 @@ async def update_async( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "PreWebhookUrl": pre_webhook_url, "PostWebhookUrl": post_webhook_url, diff --git a/twilio/rest/chat/v2/credential.py b/twilio/rest/chat/v2/credential.py index 564cd5159f..8011ed0e1f 100644 --- a/twilio/rest/chat/v2/credential.py +++ b/twilio/rest/chat/v2/credential.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -289,7 +289,7 @@ def update( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -329,7 +329,7 @@ async def update_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -415,7 +415,7 @@ def create( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -459,7 +459,7 @@ async def create_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } diff --git a/twilio/rest/chat/v2/service/__init__.py b/twilio/rest/chat/v2/service/__init__.py index 66dd200b41..f6fa9e2c49 100644 --- a/twilio/rest/chat/v2/service/__init__.py +++ b/twilio/rest/chat/v2/service/__init__.py @@ -571,21 +571,33 @@ def update( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, "Notifications.NewMessage.Sound": notifications_new_message_sound, - "Notifications.NewMessage.BadgeCountEnabled": notifications_new_message_badge_count_enabled, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.NewMessage.BadgeCountEnabled": serialize.boolean_to_string( + notifications_new_message_badge_count_enabled + ), + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, "Notifications.AddedToChannel.Sound": notifications_added_to_channel_sound, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, "Notifications.RemovedFromChannel.Sound": notifications_removed_from_channel_sound, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "Notifications.InvitedToChannel.Sound": notifications_invited_to_channel_sound, "PreWebhookUrl": pre_webhook_url, @@ -597,7 +609,9 @@ def update( "Media.CompatibilityMessage": media_compatibility_message, "PreWebhookRetryCount": pre_webhook_retry_count, "PostWebhookRetryCount": post_webhook_retry_count, - "Notifications.LogEnabled": notifications_log_enabled, + "Notifications.LogEnabled": serialize.boolean_to_string( + notifications_log_enabled + ), } ) @@ -688,21 +702,33 @@ async def update_async( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, "Notifications.NewMessage.Sound": notifications_new_message_sound, - "Notifications.NewMessage.BadgeCountEnabled": notifications_new_message_badge_count_enabled, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.NewMessage.BadgeCountEnabled": serialize.boolean_to_string( + notifications_new_message_badge_count_enabled + ), + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, "Notifications.AddedToChannel.Sound": notifications_added_to_channel_sound, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, "Notifications.RemovedFromChannel.Sound": notifications_removed_from_channel_sound, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "Notifications.InvitedToChannel.Sound": notifications_invited_to_channel_sound, "PreWebhookUrl": pre_webhook_url, @@ -714,7 +740,9 @@ async def update_async( "Media.CompatibilityMessage": media_compatibility_message, "PreWebhookRetryCount": pre_webhook_retry_count, "PostWebhookRetryCount": post_webhook_retry_count, - "Notifications.LogEnabled": notifications_log_enabled, + "Notifications.LogEnabled": serialize.boolean_to_string( + notifications_log_enabled + ), } ) diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index b057cb4f86..39496ace84 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -20,10 +20,27 @@ from twilio.base.list_resource import ListResource from twilio.base.version import Version from twilio.base.page import Page +from twilio.rest.content.v1.content.approval_create import ApprovalCreateList from twilio.rest.content.v1.content.approval_fetch import ApprovalFetchList class ContentInstance(InstanceResource): + + class AuthenticationActionType(object): + COPY_CODE = "COPY_CODE" + + class CallToActionActionType(object): + URL = "URL" + PHONE_NUMBER = "PHONE_NUMBER" + + class CardActionType(object): + URL = "URL" + PHONE_NUMBER = "PHONE_NUMBER" + QUICK_REPLY = "QUICK_REPLY" + + class QuickReplyActionType(object): + QUICK_REPLY = "QUICK_REPLY" + """ :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. @@ -32,7 +49,7 @@ class ContentInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar url: The URL of the resource, relative to `https://content.twilio.com`. :ivar links: A list of links related to the Content resource, such as approval_fetch and approval_create """ @@ -113,6 +130,13 @@ async def fetch_async(self) -> "ContentInstance": """ return await self._proxy.fetch_async() + @property + def approval_create(self) -> ApprovalCreateList: + """ + Access the approval_create + """ + return self._proxy.approval_create + @property def approval_fetch(self) -> ApprovalFetchList: """ @@ -147,6 +171,7 @@ def __init__(self, version: Version, sid: str): } self._uri = "/Content/{sid}".format(**self._solution) + self._approval_create: Optional[ApprovalCreateList] = None self._approval_fetch: Optional[ApprovalFetchList] = None def delete(self) -> bool: @@ -211,6 +236,18 @@ async def fetch_async(self) -> ContentInstance: sid=self._solution["sid"], ) + @property + def approval_create(self) -> ApprovalCreateList: + """ + Access the approval_create + """ + if self._approval_create is None: + self._approval_create = ApprovalCreateList( + self._version, + self._solution["sid"], + ) + return self._approval_create + @property def approval_fetch(self) -> ApprovalFetchList: """ @@ -254,6 +291,388 @@ def __repr__(self) -> str: class ContentList(ListResource): + class AuthenticationAction(object): + """ + :ivar type: + :ivar copy_code_text: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.AuthenticationActionType"] = ( + payload.get("type") + ) + self.copy_code_text: Optional[str] = payload.get("copy_code_text") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "copy_code_text": self.copy_code_text, + } + + class CallToActionAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.CallToActionActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "title": self.title, + "url": self.url, + "phone": self.phone, + "id": self.id, + } + + class CardAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.CardActionType"] = payload.get("type") + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "title": self.title, + "url": self.url, + "phone": self.phone, + "id": self.id, + } + + class ContentCreateRequest(object): + """ + :ivar friendly_name: User defined name of the content + :ivar variables: Key value pairs of variable name to value + :ivar language: Language code for the content + :ivar types: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.variables: Optional[dict[str, str]] = payload.get("variables") + self.language: Optional[str] = payload.get("language") + self.types: Optional[ContentList.Types] = payload.get("types") + + def to_dict(self): + return { + "friendly_name": self.friendly_name, + "variables": self.variables, + "language": self.language, + "types": self.types.to_dict(), + } + + class ListItem(object): + """ + :ivar id: + :ivar item: + :ivar description: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.id: Optional[str] = payload.get("id") + self.item: Optional[str] = payload.get("item") + self.description: Optional[str] = payload.get("description") + + def to_dict(self): + return { + "id": self.id, + "item": self.item, + "description": self.description, + } + + class QuickReplyAction(object): + """ + :ivar type: + :ivar title: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.QuickReplyActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "title": self.title, + "id": self.id, + } + + class TwilioCallToAction(object): + """ + :ivar body: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.actions: Optional[List[ContentList.CallToActionAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "actions": [actions.to_dict() for actions in self.actions], + } + + class TwilioCard(object): + """ + :ivar title: + :ivar subtitle: + :ivar media: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.title: Optional[str] = payload.get("title") + self.subtitle: Optional[str] = payload.get("subtitle") + self.media: Optional[List[str]] = payload.get("media") + self.actions: Optional[List[ContentList.CardAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "title": self.title, + "subtitle": self.subtitle, + "media": self.media, + "actions": [actions.to_dict() for actions in self.actions], + } + + class TwilioListPicker(object): + """ + :ivar body: + :ivar button: + :ivar items: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.button: Optional[str] = payload.get("button") + self.items: Optional[List[ContentList.ListItem]] = payload.get("items") + + def to_dict(self): + return { + "body": self.body, + "button": self.button, + "items": [items.to_dict() for items in self.items], + } + + class TwilioLocation(object): + """ + :ivar latitude: + :ivar longitude: + :ivar label: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.latitude: Optional[float] = payload.get("latitude") + self.longitude: Optional[float] = payload.get("longitude") + self.label: Optional[str] = payload.get("label") + + def to_dict(self): + return { + "latitude": self.latitude, + "longitude": self.longitude, + "label": self.label, + } + + class TwilioMedia(object): + """ + :ivar body: + :ivar media: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.media: Optional[List[str]] = payload.get("media") + + def to_dict(self): + return { + "body": self.body, + "media": self.media, + } + + class TwilioQuickReply(object): + """ + :ivar body: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.actions: Optional[List[ContentList.QuickReplyAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "actions": [actions.to_dict() for actions in self.actions], + } + + class TwilioText(object): + """ + :ivar body: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + + def to_dict(self): + return { + "body": self.body, + } + + class Types(object): + """ + :ivar twilio_text: + :ivar twilio_media: + :ivar twilio_location: + :ivar twilio_list_picker: + :ivar twilio_call_to_action: + :ivar twilio_quick_reply: + :ivar twilio_card: + :ivar whatsapp_card: + :ivar whatsapp_authentication: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.twilio_text: Optional[ContentList.TwilioText] = payload.get( + "twilio_text" + ) + self.twilio_media: Optional[ContentList.TwilioMedia] = payload.get( + "twilio_media" + ) + self.twilio_location: Optional[ContentList.TwilioLocation] = payload.get( + "twilio_location" + ) + self.twilio_list_picker: Optional[ContentList.TwilioListPicker] = ( + payload.get("twilio_list_picker") + ) + self.twilio_call_to_action: Optional[ContentList.TwilioCallToAction] = ( + payload.get("twilio_call_to_action") + ) + self.twilio_quick_reply: Optional[ContentList.TwilioQuickReply] = ( + payload.get("twilio_quick_reply") + ) + self.twilio_card: Optional[ContentList.TwilioCard] = payload.get( + "twilio_card" + ) + self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get( + "whatsapp_card" + ) + self.whatsapp_authentication: Optional[ + ContentList.WhatsappAuthentication + ] = payload.get("whatsapp_authentication") + + def to_dict(self): + return { + "twilio_text": self.twilio_text.to_dict(), + "twilio_media": self.twilio_media.to_dict(), + "twilio_location": self.twilio_location.to_dict(), + "twilio_list_picker": self.twilio_list_picker.to_dict(), + "twilio_call_to_action": self.twilio_call_to_action.to_dict(), + "twilio_quick_reply": self.twilio_quick_reply.to_dict(), + "twilio_card": self.twilio_card.to_dict(), + "whatsapp_card": self.whatsapp_card.to_dict(), + "whatsapp_authentication": self.whatsapp_authentication.to_dict(), + } + + class WhatsappAuthentication(object): + """ + :ivar add_security_recommendation: + :ivar code_expiration_minutes: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.add_security_recommendation: Optional[bool] = payload.get( + "add_security_recommendation" + ) + self.code_expiration_minutes: Optional[float] = payload.get( + "code_expiration_minutes" + ) + self.actions: Optional[List[ContentList.AuthenticationAction]] = ( + payload.get("actions") + ) + + def to_dict(self): + return { + "add_security_recommendation": self.add_security_recommendation, + "code_expiration_minutes": self.code_expiration_minutes, + "actions": [actions.to_dict() for actions in self.actions], + } + + class WhatsappCard(object): + """ + :ivar body: + :ivar footer: + :ivar media: + :ivar header_text: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.footer: Optional[str] = payload.get("footer") + self.media: Optional[List[str]] = payload.get("media") + self.header_text: Optional[str] = payload.get("header_text") + self.actions: Optional[List[ContentList.CardAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "footer": self.footer, + "media": self.media, + "header_text": self.header_text, + "actions": [actions.to_dict() for actions in self.actions], + } + def __init__(self, version: Version): """ Initialize the ContentList @@ -265,6 +684,43 @@ def __init__(self, version: Version): self._uri = "/Content" + def create(self, content_create_request: ContentCreateRequest) -> ContentInstance: + """ + Create the ContentInstance + + :param content_create_request: + + :returns: The created ContentInstance + """ + data = content_create_request.to_dict() + + headers = {"Content-Type": "application/json"} + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ContentInstance(self._version, payload) + + async def create_async( + self, content_create_request: ContentCreateRequest + ) -> ContentInstance: + """ + Asynchronously create the ContentInstance + + :param content_create_request: + + :returns: The created ContentInstance + """ + + data = content_create_request.to_dict() + headers = {"Content-Type": "application/json"} + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ContentInstance(self._version, payload) + def stream( self, limit: Optional[int] = None, diff --git a/twilio/rest/content/v1/content_and_approvals.py b/twilio/rest/content/v1/content_and_approvals.py index e2d6d72aaf..de40cfc172 100644 --- a/twilio/rest/content/v1/content_and_approvals.py +++ b/twilio/rest/content/v1/content_and_approvals.py @@ -31,7 +31,7 @@ class ContentAndApprovalsInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar approval_requests: The submitted information and approval request status of the Content resource. """ diff --git a/twilio/rest/conversations/v1/address_configuration.py b/twilio/rest/conversations/v1/address_configuration.py index 3295eade6c..86cdb08066 100644 --- a/twilio/rest/conversations/v1/address_configuration.py +++ b/twilio/rest/conversations/v1/address_configuration.py @@ -340,7 +340,9 @@ def update( data = values.of( { "FriendlyName": friendly_name, - "AutoCreation.Enabled": auto_creation_enabled, + "AutoCreation.Enabled": serialize.boolean_to_string( + auto_creation_enabled + ), "AutoCreation.Type": auto_creation_type, "AutoCreation.ConversationServiceSid": auto_creation_conversation_service_sid, "AutoCreation.WebhookUrl": auto_creation_webhook_url, @@ -397,7 +399,9 @@ async def update_async( data = values.of( { "FriendlyName": friendly_name, - "AutoCreation.Enabled": auto_creation_enabled, + "AutoCreation.Enabled": serialize.boolean_to_string( + auto_creation_enabled + ), "AutoCreation.Type": auto_creation_type, "AutoCreation.ConversationServiceSid": auto_creation_conversation_service_sid, "AutoCreation.WebhookUrl": auto_creation_webhook_url, @@ -507,7 +511,9 @@ def create( "Type": type, "Address": address, "FriendlyName": friendly_name, - "AutoCreation.Enabled": auto_creation_enabled, + "AutoCreation.Enabled": serialize.boolean_to_string( + auto_creation_enabled + ), "AutoCreation.Type": auto_creation_type, "AutoCreation.ConversationServiceSid": auto_creation_conversation_service_sid, "AutoCreation.WebhookUrl": auto_creation_webhook_url, @@ -572,7 +578,9 @@ async def create_async( "Type": type, "Address": address, "FriendlyName": friendly_name, - "AutoCreation.Enabled": auto_creation_enabled, + "AutoCreation.Enabled": serialize.boolean_to_string( + auto_creation_enabled + ), "AutoCreation.Type": auto_creation_type, "AutoCreation.ConversationServiceSid": auto_creation_conversation_service_sid, "AutoCreation.WebhookUrl": auto_creation_webhook_url, diff --git a/twilio/rest/conversations/v1/credential.py b/twilio/rest/conversations/v1/credential.py index 92f26d1f0a..120710f7e8 100644 --- a/twilio/rest/conversations/v1/credential.py +++ b/twilio/rest/conversations/v1/credential.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -298,7 +298,7 @@ def update( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -341,7 +341,7 @@ async def update_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -427,7 +427,7 @@ def create( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -471,7 +471,7 @@ async def create_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } diff --git a/twilio/rest/conversations/v1/service/configuration/__init__.py b/twilio/rest/conversations/v1/service/configuration/__init__.py index 15de8dfda9..9ca23a435f 100644 --- a/twilio/rest/conversations/v1/service/configuration/__init__.py +++ b/twilio/rest/conversations/v1/service/configuration/__init__.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -230,7 +230,9 @@ def update( "DefaultConversationCreatorRoleSid": default_conversation_creator_role_sid, "DefaultConversationRoleSid": default_conversation_role_sid, "DefaultChatServiceRoleSid": default_chat_service_role_sid, - "ReachabilityEnabled": reachability_enabled, + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), } ) @@ -266,7 +268,9 @@ async def update_async( "DefaultConversationCreatorRoleSid": default_conversation_creator_role_sid, "DefaultConversationRoleSid": default_conversation_role_sid, "DefaultChatServiceRoleSid": default_chat_service_role_sid, - "ReachabilityEnabled": reachability_enabled, + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), } ) diff --git a/twilio/rest/conversations/v1/service/configuration/notification.py b/twilio/rest/conversations/v1/service/configuration/notification.py index 498478fdf7..2dee2d4d29 100644 --- a/twilio/rest/conversations/v1/service/configuration/notification.py +++ b/twilio/rest/conversations/v1/service/configuration/notification.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -292,18 +292,26 @@ def update( """ data = values.of( { - "LogEnabled": log_enabled, - "NewMessage.Enabled": new_message_enabled, + "LogEnabled": serialize.boolean_to_string(log_enabled), + "NewMessage.Enabled": serialize.boolean_to_string(new_message_enabled), "NewMessage.Template": new_message_template, "NewMessage.Sound": new_message_sound, - "NewMessage.BadgeCountEnabled": new_message_badge_count_enabled, - "AddedToConversation.Enabled": added_to_conversation_enabled, + "NewMessage.BadgeCountEnabled": serialize.boolean_to_string( + new_message_badge_count_enabled + ), + "AddedToConversation.Enabled": serialize.boolean_to_string( + added_to_conversation_enabled + ), "AddedToConversation.Template": added_to_conversation_template, "AddedToConversation.Sound": added_to_conversation_sound, - "RemovedFromConversation.Enabled": removed_from_conversation_enabled, + "RemovedFromConversation.Enabled": serialize.boolean_to_string( + removed_from_conversation_enabled + ), "RemovedFromConversation.Template": removed_from_conversation_template, "RemovedFromConversation.Sound": removed_from_conversation_sound, - "NewMessage.WithMedia.Enabled": new_message_with_media_enabled, + "NewMessage.WithMedia.Enabled": serialize.boolean_to_string( + new_message_with_media_enabled + ), "NewMessage.WithMedia.Template": new_message_with_media_template, } ) @@ -355,18 +363,26 @@ async def update_async( """ data = values.of( { - "LogEnabled": log_enabled, - "NewMessage.Enabled": new_message_enabled, + "LogEnabled": serialize.boolean_to_string(log_enabled), + "NewMessage.Enabled": serialize.boolean_to_string(new_message_enabled), "NewMessage.Template": new_message_template, "NewMessage.Sound": new_message_sound, - "NewMessage.BadgeCountEnabled": new_message_badge_count_enabled, - "AddedToConversation.Enabled": added_to_conversation_enabled, + "NewMessage.BadgeCountEnabled": serialize.boolean_to_string( + new_message_badge_count_enabled + ), + "AddedToConversation.Enabled": serialize.boolean_to_string( + added_to_conversation_enabled + ), "AddedToConversation.Template": added_to_conversation_template, "AddedToConversation.Sound": added_to_conversation_sound, - "RemovedFromConversation.Enabled": removed_from_conversation_enabled, + "RemovedFromConversation.Enabled": serialize.boolean_to_string( + removed_from_conversation_enabled + ), "RemovedFromConversation.Template": removed_from_conversation_template, "RemovedFromConversation.Sound": removed_from_conversation_sound, - "NewMessage.WithMedia.Enabled": new_message_with_media_enabled, + "NewMessage.WithMedia.Enabled": serialize.boolean_to_string( + new_message_with_media_enabled + ), "NewMessage.WithMedia.Template": new_message_with_media_template, } ) diff --git a/twilio/rest/events/v1/sink/__init__.py b/twilio/rest/events/v1/sink/__init__.py index 67688f296d..b09b5edec3 100644 --- a/twilio/rest/events/v1/sink/__init__.py +++ b/twilio/rest/events/v1/sink/__init__.py @@ -577,7 +577,7 @@ def page( """ data = values.of( { - "InUse": in_use, + "InUse": serialize.boolean_to_string(in_use), "Status": status, "PageToken": page_token, "Page": page_number, @@ -610,7 +610,7 @@ async def page_async( """ data = values.of( { - "InUse": in_use, + "InUse": serialize.boolean_to_string(in_use), "Status": status, "PageToken": page_token, "Page": page_number, diff --git a/twilio/rest/flex_api/v1/__init__.py b/twilio/rest/flex_api/v1/__init__.py index 7ee41b75f0..9ea1197724 100644 --- a/twilio/rest/flex_api/v1/__init__.py +++ b/twilio/rest/flex_api/v1/__init__.py @@ -22,12 +22,6 @@ from twilio.rest.flex_api.v1.insights_assessments_comment import ( InsightsAssessmentsCommentList, ) -from twilio.rest.flex_api.v1.insights_conversational_ai import ( - InsightsConversationalAiList, -) -from twilio.rest.flex_api.v1.insights_conversational_ai_report_insights import ( - InsightsConversationalAiReportInsightsList, -) from twilio.rest.flex_api.v1.insights_conversations import InsightsConversationsList from twilio.rest.flex_api.v1.insights_questionnaires import InsightsQuestionnairesList from twilio.rest.flex_api.v1.insights_questionnaires_category import ( @@ -66,10 +60,6 @@ def __init__(self, domain: Domain): self._insights_assessments_comment: Optional[InsightsAssessmentsCommentList] = ( None ) - self._insights_conversational_ai: Optional[InsightsConversationalAiList] = None - self._insights_conversational_ai_report_insights: Optional[ - InsightsConversationalAiReportInsightsList - ] = None self._insights_conversations: Optional[InsightsConversationsList] = None self._insights_questionnaires: Optional[InsightsQuestionnairesList] = None self._insights_questionnaires_category: Optional[ @@ -119,22 +109,6 @@ def insights_assessments_comment(self) -> InsightsAssessmentsCommentList: self._insights_assessments_comment = InsightsAssessmentsCommentList(self) return self._insights_assessments_comment - @property - def insights_conversational_ai(self) -> InsightsConversationalAiList: - if self._insights_conversational_ai is None: - self._insights_conversational_ai = InsightsConversationalAiList(self) - return self._insights_conversational_ai - - @property - def insights_conversational_ai_report_insights( - self, - ) -> InsightsConversationalAiReportInsightsList: - if self._insights_conversational_ai_report_insights is None: - self._insights_conversational_ai_report_insights = ( - InsightsConversationalAiReportInsightsList(self) - ) - return self._insights_conversational_ai_report_insights - @property def insights_conversations(self) -> InsightsConversationsList: if self._insights_conversations is None: diff --git a/twilio/rest/flex_api/v1/channel.py b/twilio/rest/flex_api/v1/channel.py index a2f1e1af0f..f362d5b01b 100644 --- a/twilio/rest/flex_api/v1/channel.py +++ b/twilio/rest/flex_api/v1/channel.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -280,7 +280,7 @@ def create( "PreEngagementData": pre_engagement_data, "TaskSid": task_sid, "TaskAttributes": task_attributes, - "LongLived": long_lived, + "LongLived": serialize.boolean_to_string(long_lived), } ) @@ -333,7 +333,7 @@ async def create_async( "PreEngagementData": pre_engagement_data, "TaskSid": task_sid, "TaskAttributes": task_attributes, - "LongLived": long_lived, + "LongLived": serialize.boolean_to_string(long_lived), } ) diff --git a/twilio/rest/flex_api/v1/configuration.py b/twilio/rest/flex_api/v1/configuration.py index b358081517..bec7034cfe 100644 --- a/twilio/rest/flex_api/v1/configuration.py +++ b/twilio/rest/flex_api/v1/configuration.py @@ -237,23 +237,33 @@ async def fetch_async( ui_version=ui_version, ) - def update(self) -> "ConfigurationInstance": + def update( + self, body: Union[object, object] = values.unset + ) -> "ConfigurationInstance": """ Update the ConfigurationInstance + :param body: :returns: The updated ConfigurationInstance """ - return self._proxy.update() + return self._proxy.update( + body=body, + ) - async def update_async(self) -> "ConfigurationInstance": + async def update_async( + self, body: Union[object, object] = values.unset + ) -> "ConfigurationInstance": """ Asynchronous coroutine to update the ConfigurationInstance + :param body: :returns: The updated ConfigurationInstance """ - return await self._proxy.update_async() + return await self._proxy.update_async( + body=body, + ) def __repr__(self) -> str: """ @@ -327,36 +337,48 @@ async def fetch_async( payload, ) - def update(self) -> ConfigurationInstance: + def update( + self, body: Union[object, object] = values.unset + ) -> ConfigurationInstance: """ Update the ConfigurationInstance + :param body: :returns: The updated ConfigurationInstance """ data = values.of({}) + headers = values.of( + { + "body": body, + } + ) payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConfigurationInstance(self._version, payload) - async def update_async(self) -> ConfigurationInstance: + async def update_async( + self, body: Union[object, object] = values.unset + ) -> ConfigurationInstance: """ Asynchronous coroutine to update the ConfigurationInstance + :param body: :returns: The updated ConfigurationInstance """ data = values.of({}) + headers = values.of( + { + "body": body, + } + ) payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConfigurationInstance(self._version, payload) diff --git a/twilio/rest/flex_api/v1/flex_flow.py b/twilio/rest/flex_api/v1/flex_flow.py index 57c9a8f430..b11482937e 100644 --- a/twilio/rest/flex_api/v1/flex_flow.py +++ b/twilio/rest/flex_api/v1/flex_flow.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -408,7 +408,7 @@ def update( "ChatServiceSid": chat_service_sid, "ChannelType": channel_type, "ContactIdentity": contact_identity, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "IntegrationType": integration_type, "Integration.FlowSid": integration_flow_sid, "Integration.Url": integration_url, @@ -417,9 +417,11 @@ def update( "Integration.Channel": integration_channel, "Integration.Timeout": integration_timeout, "Integration.Priority": integration_priority, - "Integration.CreationOnMessage": integration_creation_on_message, - "LongLived": long_lived, - "JanitorEnabled": janitor_enabled, + "Integration.CreationOnMessage": serialize.boolean_to_string( + integration_creation_on_message + ), + "LongLived": serialize.boolean_to_string(long_lived), + "JanitorEnabled": serialize.boolean_to_string(janitor_enabled), "Integration.RetryCount": integration_retry_count, } ) @@ -483,7 +485,7 @@ async def update_async( "ChatServiceSid": chat_service_sid, "ChannelType": channel_type, "ContactIdentity": contact_identity, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "IntegrationType": integration_type, "Integration.FlowSid": integration_flow_sid, "Integration.Url": integration_url, @@ -492,9 +494,11 @@ async def update_async( "Integration.Channel": integration_channel, "Integration.Timeout": integration_timeout, "Integration.Priority": integration_priority, - "Integration.CreationOnMessage": integration_creation_on_message, - "LongLived": long_lived, - "JanitorEnabled": janitor_enabled, + "Integration.CreationOnMessage": serialize.boolean_to_string( + integration_creation_on_message + ), + "LongLived": serialize.boolean_to_string(long_lived), + "JanitorEnabled": serialize.boolean_to_string(janitor_enabled), "Integration.RetryCount": integration_retry_count, } ) @@ -601,7 +605,7 @@ def create( "ChatServiceSid": chat_service_sid, "ChannelType": channel_type, "ContactIdentity": contact_identity, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "IntegrationType": integration_type, "Integration.FlowSid": integration_flow_sid, "Integration.Url": integration_url, @@ -610,9 +614,11 @@ def create( "Integration.Channel": integration_channel, "Integration.Timeout": integration_timeout, "Integration.Priority": integration_priority, - "Integration.CreationOnMessage": integration_creation_on_message, - "LongLived": long_lived, - "JanitorEnabled": janitor_enabled, + "Integration.CreationOnMessage": serialize.boolean_to_string( + integration_creation_on_message + ), + "LongLived": serialize.boolean_to_string(long_lived), + "JanitorEnabled": serialize.boolean_to_string(janitor_enabled), "Integration.RetryCount": integration_retry_count, } ) @@ -677,7 +683,7 @@ async def create_async( "ChatServiceSid": chat_service_sid, "ChannelType": channel_type, "ContactIdentity": contact_identity, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "IntegrationType": integration_type, "Integration.FlowSid": integration_flow_sid, "Integration.Url": integration_url, @@ -686,9 +692,11 @@ async def create_async( "Integration.Channel": integration_channel, "Integration.Timeout": integration_timeout, "Integration.Priority": integration_priority, - "Integration.CreationOnMessage": integration_creation_on_message, - "LongLived": long_lived, - "JanitorEnabled": janitor_enabled, + "Integration.CreationOnMessage": serialize.boolean_to_string( + integration_creation_on_message + ), + "LongLived": serialize.boolean_to_string(long_lived), + "JanitorEnabled": serialize.boolean_to_string(janitor_enabled), "Integration.RetryCount": integration_retry_count, } ) diff --git a/twilio/rest/flex_api/v1/insights_conversational_ai.py b/twilio/rest/flex_api/v1/insights_conversational_ai.py deleted file mode 100644 index 0cce79ad9d..0000000000 --- a/twilio/rest/flex_api/v1/insights_conversational_ai.py +++ /dev/null @@ -1,295 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Flex - 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 datetime -from typing import Any, Dict, List, Optional, Union -from twilio.base import deserialize, serialize, values -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 InsightsConversationalAiInstance(InstanceResource): - - class Granularity(object): - DAYS = "days" - WEEKS = "weeks" - MONTHS = "months" - QUARTERS = "quarters" - YEARS = "years" - - """ - :ivar instance_sid: Sid of Flex Service Instance - :ivar report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics - :ivar granularity: - :ivar period_start: The start date from which report data is included - :ivar period_end: The end date till report data is included - :ivar updated: Updated time of the report - :ivar total_pages: Represents total number of pages fetched report has - :ivar page: Page offset required for pagination - :ivar rows: List of report breakdown - :ivar url: The URL of this resource. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - instance_sid: Optional[str] = None, - ): - super().__init__(version) - - self.instance_sid: Optional[str] = payload.get("instance_sid") - self.report_id: Optional[str] = payload.get("report_id") - self.granularity: Optional["InsightsConversationalAiInstance.Granularity"] = ( - payload.get("granularity") - ) - self.period_start: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("period_start") - ) - self.period_end: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("period_end") - ) - self.updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("updated") - ) - self.total_pages: Optional[int] = deserialize.integer( - payload.get("total_pages") - ) - self.page: Optional[int] = deserialize.integer(payload.get("page")) - self.rows: Optional[List[Dict[str, object]]] = payload.get("rows") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "instance_sid": instance_sid or self.instance_sid, - } - self._context: Optional[InsightsConversationalAiContext] = None - - @property - def _proxy(self) -> "InsightsConversationalAiContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: InsightsConversationalAiContext for this InsightsConversationalAiInstance - """ - if self._context is None: - self._context = InsightsConversationalAiContext( - self._version, - instance_sid=self._solution["instance_sid"], - ) - return self._context - - def fetch( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[ - "InsightsConversationalAiInstance.Granularity", object - ] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> "InsightsConversationalAiInstance": - """ - Fetch the InsightsConversationalAiInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiInstance - """ - return self._proxy.fetch( - max_rows=max_rows, - report_id=report_id, - granularity=granularity, - include_date=include_date, - ) - - async def fetch_async( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[ - "InsightsConversationalAiInstance.Granularity", object - ] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> "InsightsConversationalAiInstance": - """ - Asynchronous coroutine to fetch the InsightsConversationalAiInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiInstance - """ - return await self._proxy.fetch_async( - max_rows=max_rows, - report_id=report_id, - granularity=granularity, - include_date=include_date, - ) - - 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 InsightsConversationalAiContext(InstanceContext): - - def __init__(self, version: Version, instance_sid: str): - """ - Initialize the InsightsConversationalAiContext - - :param version: Version that contains the resource - :param instance_sid: Sid of Flex Service Instance - """ - super().__init__(version) - - # Path Solution - self._solution = { - "instance_sid": instance_sid, - } - self._uri = "/Insights/Instances/{instance_sid}/AI/Reports".format( - **self._solution - ) - - def fetch( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[ - "InsightsConversationalAiInstance.Granularity", object - ] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> InsightsConversationalAiInstance: - """ - Fetch the InsightsConversationalAiInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiInstance - """ - - data = values.of( - { - "MaxRows": max_rows, - "ReportId": report_id, - "Granularity": granularity, - "IncludeDate": serialize.iso8601_datetime(include_date), - } - ) - - payload = self._version.fetch(method="GET", uri=self._uri, params=data) - - return InsightsConversationalAiInstance( - self._version, - payload, - instance_sid=self._solution["instance_sid"], - ) - - async def fetch_async( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[ - "InsightsConversationalAiInstance.Granularity", object - ] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> InsightsConversationalAiInstance: - """ - Asynchronous coroutine to fetch the InsightsConversationalAiInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiInstance - """ - - data = values.of( - { - "MaxRows": max_rows, - "ReportId": report_id, - "Granularity": granularity, - "IncludeDate": serialize.iso8601_datetime(include_date), - } - ) - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data - ) - - return InsightsConversationalAiInstance( - self._version, - payload, - instance_sid=self._solution["instance_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 InsightsConversationalAiList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the InsightsConversationalAiList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - def get(self, instance_sid: str) -> InsightsConversationalAiContext: - """ - Constructs a InsightsConversationalAiContext - - :param instance_sid: Sid of Flex Service Instance - """ - return InsightsConversationalAiContext(self._version, instance_sid=instance_sid) - - def __call__(self, instance_sid: str) -> InsightsConversationalAiContext: - """ - Constructs a InsightsConversationalAiContext - - :param instance_sid: Sid of Flex Service Instance - """ - return InsightsConversationalAiContext(self._version, instance_sid=instance_sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py b/twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py deleted file mode 100644 index 59ac5a04bf..0000000000 --- a/twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py +++ /dev/null @@ -1,279 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Flex - 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 datetime -from typing import Any, Dict, List, Optional, Union -from twilio.base import deserialize, serialize, values -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 InsightsConversationalAiReportInsightsInstance(InstanceResource): - """ - :ivar instance_sid: The Instance SID of the instance for which report insights is fetched - :ivar report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics - :ivar period_start: The start date from which report insights data is included - :ivar period_end: The end date till report insights data is included - :ivar updated: Updated time of the report insights - :ivar insights: List of report insights breakdown - :ivar url: The URL of this resource - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - instance_sid: Optional[str] = None, - ): - super().__init__(version) - - self.instance_sid: Optional[str] = payload.get("instance_sid") - self.report_id: Optional[str] = payload.get("report_id") - self.period_start: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("period_start") - ) - self.period_end: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("period_end") - ) - self.updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("updated") - ) - self.insights: Optional[List[Dict[str, object]]] = payload.get("insights") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "instance_sid": instance_sid or self.instance_sid, - } - self._context: Optional[InsightsConversationalAiReportInsightsContext] = None - - @property - def _proxy(self) -> "InsightsConversationalAiReportInsightsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: InsightsConversationalAiReportInsightsContext for this InsightsConversationalAiReportInsightsInstance - """ - if self._context is None: - self._context = InsightsConversationalAiReportInsightsContext( - self._version, - instance_sid=self._solution["instance_sid"], - ) - return self._context - - def fetch( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[str, object] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> "InsightsConversationalAiReportInsightsInstance": - """ - Fetch the InsightsConversationalAiReportInsightsInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report insights is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiReportInsightsInstance - """ - return self._proxy.fetch( - max_rows=max_rows, - report_id=report_id, - granularity=granularity, - include_date=include_date, - ) - - async def fetch_async( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[str, object] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> "InsightsConversationalAiReportInsightsInstance": - """ - Asynchronous coroutine to fetch the InsightsConversationalAiReportInsightsInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report insights is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiReportInsightsInstance - """ - return await self._proxy.fetch_async( - max_rows=max_rows, - report_id=report_id, - granularity=granularity, - include_date=include_date, - ) - - 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 InsightsConversationalAiReportInsightsContext(InstanceContext): - - def __init__(self, version: Version, instance_sid: str): - """ - Initialize the InsightsConversationalAiReportInsightsContext - - :param version: Version that contains the resource - :param instance_sid: The Instance SID of the instance for which report insights will be fetched - """ - super().__init__(version) - - # Path Solution - self._solution = { - "instance_sid": instance_sid, - } - self._uri = "/Insights/Instances/{instance_sid}/AI/ReportInsights".format( - **self._solution - ) - - def fetch( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[str, object] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> InsightsConversationalAiReportInsightsInstance: - """ - Fetch the InsightsConversationalAiReportInsightsInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report insights is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiReportInsightsInstance - """ - - data = values.of( - { - "MaxRows": max_rows, - "ReportId": report_id, - "Granularity": granularity, - "IncludeDate": serialize.iso8601_datetime(include_date), - } - ) - - payload = self._version.fetch(method="GET", uri=self._uri, params=data) - - return InsightsConversationalAiReportInsightsInstance( - self._version, - payload, - instance_sid=self._solution["instance_sid"], - ) - - async def fetch_async( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[str, object] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> InsightsConversationalAiReportInsightsInstance: - """ - Asynchronous coroutine to fetch the InsightsConversationalAiReportInsightsInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report insights is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiReportInsightsInstance - """ - - data = values.of( - { - "MaxRows": max_rows, - "ReportId": report_id, - "Granularity": granularity, - "IncludeDate": serialize.iso8601_datetime(include_date), - } - ) - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data - ) - - return InsightsConversationalAiReportInsightsInstance( - self._version, - payload, - instance_sid=self._solution["instance_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 InsightsConversationalAiReportInsightsList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the InsightsConversationalAiReportInsightsList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - def get(self, instance_sid: str) -> InsightsConversationalAiReportInsightsContext: - """ - Constructs a InsightsConversationalAiReportInsightsContext - - :param instance_sid: The Instance SID of the instance for which report insights will be fetched - """ - return InsightsConversationalAiReportInsightsContext( - self._version, instance_sid=instance_sid - ) - - def __call__( - self, instance_sid: str - ) -> InsightsConversationalAiReportInsightsContext: - """ - Constructs a InsightsConversationalAiReportInsightsContext - - :param instance_sid: The Instance SID of the instance for which report insights will be fetched - """ - return InsightsConversationalAiReportInsightsContext( - self._version, instance_sid=instance_sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/flex_api/v1/insights_questionnaires.py b/twilio/rest/flex_api/v1/insights_questionnaires.py index fe0338a9fe..807f129955 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires.py @@ -316,7 +316,7 @@ def update( """ data = values.of( { - "Active": active, + "Active": serialize.boolean_to_string(active), "Name": name, "Description": description, "QuestionSids": serialize.map(question_sids, lambda e: e), @@ -359,7 +359,7 @@ async def update_async( """ data = values.of( { - "Active": active, + "Active": serialize.boolean_to_string(active), "Name": name, "Description": description, "QuestionSids": serialize.map(question_sids, lambda e: e), @@ -447,7 +447,7 @@ def create( { "Name": name, "Description": description, - "Active": active, + "Active": serialize.boolean_to_string(active), "QuestionSids": serialize.map(question_sids, lambda e: e), } ) @@ -487,7 +487,7 @@ async def create_async( { "Name": name, "Description": description, - "Active": active, + "Active": serialize.boolean_to_string(active), "QuestionSids": serialize.map(question_sids, lambda e: e), } ) @@ -657,7 +657,7 @@ def page( data = values.of( { "Authorization": authorization, - "IncludeInactive": include_inactive, + "IncludeInactive": serialize.boolean_to_string(include_inactive), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -690,7 +690,7 @@ async def page_async( data = values.of( { "Authorization": authorization, - "IncludeInactive": include_inactive, + "IncludeInactive": serialize.boolean_to_string(include_inactive), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_question.py b/twilio/rest/flex_api/v1/insights_questionnaires_question.py index b796ff6afd..e4f2f4a4f0 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_question.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_question.py @@ -250,7 +250,7 @@ def update( """ data = values.of( { - "AllowNa": allow_na, + "AllowNa": serialize.boolean_to_string(allow_na), "CategorySid": category_sid, "Question": question, "Description": description, @@ -294,7 +294,7 @@ async def update_async( """ data = values.of( { - "AllowNa": allow_na, + "AllowNa": serialize.boolean_to_string(allow_na), "CategorySid": category_sid, "Question": question, "Description": description, @@ -388,7 +388,7 @@ def create( "CategorySid": category_sid, "Question": question, "AnswerSetId": answer_set_id, - "AllowNa": allow_na, + "AllowNa": serialize.boolean_to_string(allow_na), "Description": description, } ) @@ -431,7 +431,7 @@ async def create_async( "CategorySid": category_sid, "Question": question, "AnswerSetId": answer_set_id, - "AllowNa": allow_na, + "AllowNa": serialize.boolean_to_string(allow_na), "Description": description, } ) diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py index 649439ba2b..ba9f80f9a3 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py @@ -40,6 +40,7 @@ class Type(object): :ivar interaction_sid: The Interaction Sid for this channel. :ivar channel_sid: The Channel Sid for this Participant. :ivar url: + :ivar routing_properties: The Participant's routing properties. """ def __init__( @@ -59,6 +60,9 @@ def __init__( self.interaction_sid: Optional[str] = payload.get("interaction_sid") self.channel_sid: Optional[str] = payload.get("channel_sid") self.url: Optional[str] = payload.get("url") + self.routing_properties: Optional[Dict[str, object]] = payload.get( + "routing_properties" + ) self._solution = { "interaction_sid": interaction_sid, @@ -273,12 +277,14 @@ def create( self, type: "InteractionChannelParticipantInstance.Type", media_properties: object, + routing_properties: Union[object, object] = values.unset, ) -> InteractionChannelParticipantInstance: """ Create the InteractionChannelParticipantInstance :param type: :param media_properties: JSON representing the Media Properties for the new Participant. + :param routing_properties: Object representing the Routing Properties for the new Participant. :returns: The created InteractionChannelParticipantInstance """ @@ -287,6 +293,7 @@ def create( { "Type": type, "MediaProperties": serialize.object(media_properties), + "RoutingProperties": serialize.object(routing_properties), } ) @@ -307,12 +314,14 @@ async def create_async( self, type: "InteractionChannelParticipantInstance.Type", media_properties: object, + routing_properties: Union[object, object] = values.unset, ) -> InteractionChannelParticipantInstance: """ Asynchronously create the InteractionChannelParticipantInstance :param type: :param media_properties: JSON representing the Media Properties for the new Participant. + :param routing_properties: Object representing the Routing Properties for the new Participant. :returns: The created InteractionChannelParticipantInstance """ @@ -321,6 +330,7 @@ async def create_async( { "Type": type, "MediaProperties": serialize.object(media_properties), + "RoutingProperties": serialize.object(routing_properties), } ) diff --git a/twilio/rest/frontline_api/v1/user.py b/twilio/rest/frontline_api/v1/user.py index b14fbd0989..8c9dd93853 100644 --- a/twilio/rest/frontline_api/v1/user.py +++ b/twilio/rest/frontline_api/v1/user.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -222,7 +222,7 @@ def update( "FriendlyName": friendly_name, "Avatar": avatar, "State": state, - "IsAvailable": is_available, + "IsAvailable": serialize.boolean_to_string(is_available), } ) @@ -256,7 +256,7 @@ async def update_async( "FriendlyName": friendly_name, "Avatar": avatar, "State": state, - "IsAvailable": is_available, + "IsAvailable": serialize.boolean_to_string(is_available), } ) diff --git a/twilio/rest/insights/v1/call/annotation.py b/twilio/rest/insights/v1/call/annotation.py index 0d3f7bb4f4..d560003c0a 100644 --- a/twilio/rest/insights/v1/call/annotation.py +++ b/twilio/rest/insights/v1/call/annotation.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -269,7 +269,7 @@ def update( "AnsweredBy": answered_by, "ConnectivityIssue": connectivity_issue, "QualityIssues": quality_issues, - "Spam": spam, + "Spam": serialize.boolean_to_string(spam), "CallScore": call_score, "Comment": comment, "Incident": incident, @@ -316,7 +316,7 @@ async def update_async( "AnsweredBy": answered_by, "ConnectivityIssue": connectivity_issue, "QualityIssues": quality_issues, - "Spam": spam, + "Spam": serialize.boolean_to_string(spam), "CallScore": call_score, "Comment": comment, "Incident": incident, diff --git a/twilio/rest/insights/v1/call_summaries.py b/twilio/rest/insights/v1/call_summaries.py index 78cd5b506e..f68744eefc 100644 --- a/twilio/rest/insights/v1/call_summaries.py +++ b/twilio/rest/insights/v1/call_summaries.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -651,9 +651,9 @@ def page( "ToCarrier": to_carrier, "FromCountryCode": from_country_code, "ToCountryCode": to_country_code, - "Branded": branded, - "VerifiedCaller": verified_caller, - "HasTag": has_tag, + "Branded": serialize.boolean_to_string(branded), + "VerifiedCaller": serialize.boolean_to_string(verified_caller), + "HasTag": serialize.boolean_to_string(has_tag), "StartTime": start_time, "EndTime": end_time, "CallType": call_type, @@ -662,12 +662,12 @@ def page( "ProcessingState": processing_state, "SortBy": sort_by, "Subaccount": subaccount, - "AbnormalSession": abnormal_session, + "AbnormalSession": serialize.boolean_to_string(abnormal_session), "AnsweredBy": answered_by, "AnsweredByAnnotation": answered_by_annotation, "ConnectivityIssueAnnotation": connectivity_issue_annotation, "QualityIssueAnnotation": quality_issue_annotation, - "SpamAnnotation": spam_annotation, + "SpamAnnotation": serialize.boolean_to_string(spam_annotation), "CallScoreAnnotation": call_score_annotation, "PageToken": page_token, "Page": page_number, @@ -752,9 +752,9 @@ async def page_async( "ToCarrier": to_carrier, "FromCountryCode": from_country_code, "ToCountryCode": to_country_code, - "Branded": branded, - "VerifiedCaller": verified_caller, - "HasTag": has_tag, + "Branded": serialize.boolean_to_string(branded), + "VerifiedCaller": serialize.boolean_to_string(verified_caller), + "HasTag": serialize.boolean_to_string(has_tag), "StartTime": start_time, "EndTime": end_time, "CallType": call_type, @@ -763,12 +763,12 @@ async def page_async( "ProcessingState": processing_state, "SortBy": sort_by, "Subaccount": subaccount, - "AbnormalSession": abnormal_session, + "AbnormalSession": serialize.boolean_to_string(abnormal_session), "AnsweredBy": answered_by, "AnsweredByAnnotation": answered_by_annotation, "ConnectivityIssueAnnotation": connectivity_issue_annotation, "QualityIssueAnnotation": quality_issue_annotation, - "SpamAnnotation": spam_annotation, + "SpamAnnotation": serialize.boolean_to_string(spam_annotation), "CallScoreAnnotation": call_score_annotation, "PageToken": page_token, "Page": page_number, diff --git a/twilio/rest/insights/v1/setting.py b/twilio/rest/insights/v1/setting.py index f0bb5f60d8..c385fc424e 100644 --- a/twilio/rest/insights/v1/setting.py +++ b/twilio/rest/insights/v1/setting.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -211,8 +211,8 @@ def update( """ data = values.of( { - "AdvancedFeatures": advanced_features, - "VoiceTrace": voice_trace, + "AdvancedFeatures": serialize.boolean_to_string(advanced_features), + "VoiceTrace": serialize.boolean_to_string(voice_trace), "SubaccountSid": subaccount_sid, } ) @@ -242,8 +242,8 @@ async def update_async( """ data = values.of( { - "AdvancedFeatures": advanced_features, - "VoiceTrace": voice_trace, + "AdvancedFeatures": serialize.boolean_to_string(advanced_features), + "VoiceTrace": serialize.boolean_to_string(voice_trace), "SubaccountSid": subaccount_sid, } ) diff --git a/twilio/rest/intelligence/v2/service.py b/twilio/rest/intelligence/v2/service.py index 0761da5445..d983be5b2e 100644 --- a/twilio/rest/intelligence/v2/service.py +++ b/twilio/rest/intelligence/v2/service.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -334,13 +334,13 @@ def update( """ data = values.of( { - "AutoTranscribe": auto_transcribe, - "DataLogging": data_logging, + "AutoTranscribe": serialize.boolean_to_string(auto_transcribe), + "DataLogging": serialize.boolean_to_string(data_logging), "FriendlyName": friendly_name, "LanguageCode": language_code, "UniqueName": unique_name, - "AutoRedaction": auto_redaction, - "MediaRedaction": media_redaction, + "AutoRedaction": serialize.boolean_to_string(auto_redaction), + "MediaRedaction": serialize.boolean_to_string(media_redaction), "WebhookUrl": webhook_url, "WebhookHttpMethod": webhook_http_method, } @@ -388,13 +388,13 @@ async def update_async( """ data = values.of( { - "AutoTranscribe": auto_transcribe, - "DataLogging": data_logging, + "AutoTranscribe": serialize.boolean_to_string(auto_transcribe), + "DataLogging": serialize.boolean_to_string(data_logging), "FriendlyName": friendly_name, "LanguageCode": language_code, "UniqueName": unique_name, - "AutoRedaction": auto_redaction, - "MediaRedaction": media_redaction, + "AutoRedaction": serialize.boolean_to_string(auto_redaction), + "MediaRedaction": serialize.boolean_to_string(media_redaction), "WebhookUrl": webhook_url, "WebhookHttpMethod": webhook_http_method, } @@ -484,12 +484,12 @@ def create( data = values.of( { "UniqueName": unique_name, - "AutoTranscribe": auto_transcribe, - "DataLogging": data_logging, + "AutoTranscribe": serialize.boolean_to_string(auto_transcribe), + "DataLogging": serialize.boolean_to_string(data_logging), "FriendlyName": friendly_name, "LanguageCode": language_code, - "AutoRedaction": auto_redaction, - "MediaRedaction": media_redaction, + "AutoRedaction": serialize.boolean_to_string(auto_redaction), + "MediaRedaction": serialize.boolean_to_string(media_redaction), "WebhookUrl": webhook_url, "WebhookHttpMethod": webhook_http_method, } @@ -534,12 +534,12 @@ async def create_async( data = values.of( { "UniqueName": unique_name, - "AutoTranscribe": auto_transcribe, - "DataLogging": data_logging, + "AutoTranscribe": serialize.boolean_to_string(auto_transcribe), + "DataLogging": serialize.boolean_to_string(data_logging), "FriendlyName": friendly_name, "LanguageCode": language_code, - "AutoRedaction": auto_redaction, - "MediaRedaction": media_redaction, + "AutoRedaction": serialize.boolean_to_string(auto_redaction), + "MediaRedaction": serialize.boolean_to_string(media_redaction), "WebhookUrl": webhook_url, "WebhookHttpMethod": webhook_http_method, } diff --git a/twilio/rest/intelligence/v2/transcript/media.py b/twilio/rest/intelligence/v2/transcript/media.py index cb129b436a..74d3ab9959 100644 --- a/twilio/rest/intelligence/v2/transcript/media.py +++ b/twilio/rest/intelligence/v2/transcript/media.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -122,7 +122,7 @@ def fetch(self, redacted: Union[bool, object] = values.unset) -> MediaInstance: data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), } ) @@ -147,7 +147,7 @@ async def fetch_async( data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), } ) diff --git a/twilio/rest/intelligence/v2/transcript/operator_result.py b/twilio/rest/intelligence/v2/transcript/operator_result.py index 0865673329..9d1d614f4d 100644 --- a/twilio/rest/intelligence/v2/transcript/operator_result.py +++ b/twilio/rest/intelligence/v2/transcript/operator_result.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -183,7 +183,7 @@ def fetch( data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), } ) @@ -209,7 +209,7 @@ async def fetch_async( data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), } ) @@ -408,7 +408,7 @@ def page( """ data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -438,7 +438,7 @@ async def page_async( """ data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/intelligence/v2/transcript/sentence.py b/twilio/rest/intelligence/v2/transcript/sentence.py index f419135419..5bdd18b00f 100644 --- a/twilio/rest/intelligence/v2/transcript/sentence.py +++ b/twilio/rest/intelligence/v2/transcript/sentence.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -237,7 +237,7 @@ def page( """ data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -267,7 +267,7 @@ async def page_async( """ data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/ip_messaging/v1/credential.py b/twilio/rest/ip_messaging/v1/credential.py index 01423f4900..eac8e38cf5 100644 --- a/twilio/rest/ip_messaging/v1/credential.py +++ b/twilio/rest/ip_messaging/v1/credential.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -289,7 +289,7 @@ def update( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -329,7 +329,7 @@ async def update_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -415,7 +415,7 @@ def create( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -459,7 +459,7 @@ async def create_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } diff --git a/twilio/rest/ip_messaging/v1/service/__init__.py b/twilio/rest/ip_messaging/v1/service/__init__.py index 8e080657b5..ad4f002513 100644 --- a/twilio/rest/ip_messaging/v1/service/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/__init__.py @@ -732,17 +732,27 @@ def update( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "PreWebhookUrl": pre_webhook_url, "PostWebhookUrl": post_webhook_url, @@ -916,17 +926,27 @@ async def update_async( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "PreWebhookUrl": pre_webhook_url, "PostWebhookUrl": post_webhook_url, diff --git a/twilio/rest/ip_messaging/v2/credential.py b/twilio/rest/ip_messaging/v2/credential.py index f81892c742..beec9fbebe 100644 --- a/twilio/rest/ip_messaging/v2/credential.py +++ b/twilio/rest/ip_messaging/v2/credential.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -289,7 +289,7 @@ def update( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -329,7 +329,7 @@ async def update_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -415,7 +415,7 @@ def create( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -459,7 +459,7 @@ async def create_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } diff --git a/twilio/rest/ip_messaging/v2/service/__init__.py b/twilio/rest/ip_messaging/v2/service/__init__.py index 227789bab8..b107a11976 100644 --- a/twilio/rest/ip_messaging/v2/service/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/__init__.py @@ -571,21 +571,33 @@ def update( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, "Notifications.NewMessage.Sound": notifications_new_message_sound, - "Notifications.NewMessage.BadgeCountEnabled": notifications_new_message_badge_count_enabled, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.NewMessage.BadgeCountEnabled": serialize.boolean_to_string( + notifications_new_message_badge_count_enabled + ), + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, "Notifications.AddedToChannel.Sound": notifications_added_to_channel_sound, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, "Notifications.RemovedFromChannel.Sound": notifications_removed_from_channel_sound, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "Notifications.InvitedToChannel.Sound": notifications_invited_to_channel_sound, "PreWebhookUrl": pre_webhook_url, @@ -597,7 +609,9 @@ def update( "Media.CompatibilityMessage": media_compatibility_message, "PreWebhookRetryCount": pre_webhook_retry_count, "PostWebhookRetryCount": post_webhook_retry_count, - "Notifications.LogEnabled": notifications_log_enabled, + "Notifications.LogEnabled": serialize.boolean_to_string( + notifications_log_enabled + ), } ) @@ -688,21 +702,33 @@ async def update_async( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, "Notifications.NewMessage.Sound": notifications_new_message_sound, - "Notifications.NewMessage.BadgeCountEnabled": notifications_new_message_badge_count_enabled, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.NewMessage.BadgeCountEnabled": serialize.boolean_to_string( + notifications_new_message_badge_count_enabled + ), + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, "Notifications.AddedToChannel.Sound": notifications_added_to_channel_sound, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, "Notifications.RemovedFromChannel.Sound": notifications_removed_from_channel_sound, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "Notifications.InvitedToChannel.Sound": notifications_invited_to_channel_sound, "PreWebhookUrl": pre_webhook_url, @@ -714,7 +740,9 @@ async def update_async( "Media.CompatibilityMessage": media_compatibility_message, "PreWebhookRetryCount": pre_webhook_retry_count, "PostWebhookRetryCount": post_webhook_retry_count, - "Notifications.LogEnabled": notifications_log_enabled, + "Notifications.LogEnabled": serialize.boolean_to_string( + notifications_log_enabled + ), } ) diff --git a/twilio/rest/lookups/v2/phone_number.py b/twilio/rest/lookups/v2/phone_number.py index 97ef39b940..57491aa0a9 100644 --- a/twilio/rest/lookups/v2/phone_number.py +++ b/twilio/rest/lookups/v2/phone_number.py @@ -40,7 +40,7 @@ class ValidationError(object): :ivar caller_name: An object that contains caller name information based on [CNAM](https://support.twilio.com/hc/en-us/articles/360051670533-Getting-Started-with-CNAM-Caller-ID). :ivar sim_swap: An object that contains information on the last date the subscriber identity module (SIM) was changed for a mobile phone number. :ivar call_forwarding: An object that contains information on the unconditional call forwarding status of mobile phone number. - :ivar live_activity: An object that contains live activity information for a mobile phone number. + :ivar line_status: An object that contains line status information for a mobile phone number. :ivar line_type_intelligence: An object that contains line type information including the carrier name, mobile country code, and mobile network code. :ivar identity_match: An object that contains identity match information. The result of comparing user-provided information including name, address, date of birth, national ID, against authoritative phone-based data sources :ivar reassigned_number: An object that contains reassigned number information. Reassigned Numbers will return a phone number's reassignment status given a phone number and date @@ -70,7 +70,7 @@ def __init__( self.call_forwarding: Optional[Dict[str, object]] = payload.get( "call_forwarding" ) - self.live_activity: Optional[Dict[str, object]] = payload.get("live_activity") + self.line_status: Optional[Dict[str, object]] = payload.get("line_status") self.line_type_intelligence: Optional[Dict[str, object]] = payload.get( "line_type_intelligence" ) @@ -125,7 +125,7 @@ def fetch( """ Fetch the PhoneNumberInstance - :param fields: A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number. + :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. :param country_code: The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. :param first_name: User’s first name. This query parameter is only used (optionally) for identity_match package requests. :param last_name: User’s last name. This query parameter is only used (optionally) for identity_match package requests. @@ -176,7 +176,7 @@ async def fetch_async( """ Asynchronous coroutine to fetch the PhoneNumberInstance - :param fields: A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number. + :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. :param country_code: The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. :param first_name: User’s first name. This query parameter is only used (optionally) for identity_match package requests. :param last_name: User’s last name. This query parameter is only used (optionally) for identity_match package requests. @@ -254,7 +254,7 @@ def fetch( """ Fetch the PhoneNumberInstance - :param fields: A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number. + :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. :param country_code: The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. :param first_name: User’s first name. This query parameter is only used (optionally) for identity_match package requests. :param last_name: User’s last name. This query parameter is only used (optionally) for identity_match package requests. @@ -316,7 +316,7 @@ async def fetch_async( """ Asynchronous coroutine to fetch the PhoneNumberInstance - :param fields: A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number. + :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. :param country_code: The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. :param first_name: User’s first name. This query parameter is only used (optionally) for identity_match package requests. :param last_name: User’s last name. This query parameter is only used (optionally) for identity_match package requests. diff --git a/twilio/rest/media/v1/player_streamer/__init__.py b/twilio/rest/media/v1/player_streamer/__init__.py index 6ea0889fc3..86832ba990 100644 --- a/twilio/rest/media/v1/player_streamer/__init__.py +++ b/twilio/rest/media/v1/player_streamer/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -349,7 +349,7 @@ def create( data = values.of( { - "Video": video, + "Video": serialize.boolean_to_string(video), "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "MaxDuration": max_duration, @@ -384,7 +384,7 @@ async def create_async( data = values.of( { - "Video": video, + "Video": serialize.boolean_to_string(video), "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "MaxDuration": max_duration, diff --git a/twilio/rest/messaging/v1/brand_registration/__init__.py b/twilio/rest/messaging/v1/brand_registration/__init__.py index 5c6dbc8246..e69e149239 100644 --- a/twilio/rest/messaging/v1/brand_registration/__init__.py +++ b/twilio/rest/messaging/v1/brand_registration/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -382,8 +382,10 @@ def create( "CustomerProfileBundleSid": customer_profile_bundle_sid, "A2PProfileBundleSid": a2p_profile_bundle_sid, "BrandType": brand_type, - "Mock": mock, - "SkipAutomaticSecVet": skip_automatic_sec_vet, + "Mock": serialize.boolean_to_string(mock), + "SkipAutomaticSecVet": serialize.boolean_to_string( + skip_automatic_sec_vet + ), } ) @@ -420,8 +422,10 @@ async def create_async( "CustomerProfileBundleSid": customer_profile_bundle_sid, "A2PProfileBundleSid": a2p_profile_bundle_sid, "BrandType": brand_type, - "Mock": mock, - "SkipAutomaticSecVet": skip_automatic_sec_vet, + "Mock": serialize.boolean_to_string(mock), + "SkipAutomaticSecVet": serialize.boolean_to_string( + skip_automatic_sec_vet + ), } ) diff --git a/twilio/rest/messaging/v1/domain_config.py b/twilio/rest/messaging/v1/domain_config.py index 4889827a60..25d69342d0 100644 --- a/twilio/rest/messaging/v1/domain_config.py +++ b/twilio/rest/messaging/v1/domain_config.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, Optional, Union -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -230,8 +230,8 @@ def update( { "FallbackUrl": fallback_url, "CallbackUrl": callback_url, - "ContinueOnFailure": continue_on_failure, - "DisableHttps": disable_https, + "ContinueOnFailure": serialize.boolean_to_string(continue_on_failure), + "DisableHttps": serialize.boolean_to_string(disable_https), } ) @@ -266,8 +266,8 @@ async def update_async( { "FallbackUrl": fallback_url, "CallbackUrl": callback_url, - "ContinueOnFailure": continue_on_failure, - "DisableHttps": disable_https, + "ContinueOnFailure": serialize.boolean_to_string(continue_on_failure), + "DisableHttps": serialize.boolean_to_string(disable_https), } ) diff --git a/twilio/rest/messaging/v1/service/__init__.py b/twilio/rest/messaging/v1/service/__init__.py index 3695b744f7..75c798f4c4 100644 --- a/twilio/rest/messaging/v1/service/__init__.py +++ b/twilio/rest/messaging/v1/service/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -477,16 +477,22 @@ def update( "FallbackUrl": fallback_url, "FallbackMethod": fallback_method, "StatusCallback": status_callback, - "StickySender": sticky_sender, - "MmsConverter": mms_converter, - "SmartEncoding": smart_encoding, + "StickySender": serialize.boolean_to_string(sticky_sender), + "MmsConverter": serialize.boolean_to_string(mms_converter), + "SmartEncoding": serialize.boolean_to_string(smart_encoding), "ScanMessageContent": scan_message_content, - "FallbackToLongCode": fallback_to_long_code, - "AreaCodeGeomatch": area_code_geomatch, + "FallbackToLongCode": serialize.boolean_to_string( + fallback_to_long_code + ), + "AreaCodeGeomatch": serialize.boolean_to_string(area_code_geomatch), "ValidityPeriod": validity_period, - "SynchronousValidation": synchronous_validation, + "SynchronousValidation": serialize.boolean_to_string( + synchronous_validation + ), "Usecase": usecase, - "UseInboundWebhookOnNumber": use_inbound_webhook_on_number, + "UseInboundWebhookOnNumber": serialize.boolean_to_string( + use_inbound_webhook_on_number + ), } ) @@ -549,16 +555,22 @@ async def update_async( "FallbackUrl": fallback_url, "FallbackMethod": fallback_method, "StatusCallback": status_callback, - "StickySender": sticky_sender, - "MmsConverter": mms_converter, - "SmartEncoding": smart_encoding, + "StickySender": serialize.boolean_to_string(sticky_sender), + "MmsConverter": serialize.boolean_to_string(mms_converter), + "SmartEncoding": serialize.boolean_to_string(smart_encoding), "ScanMessageContent": scan_message_content, - "FallbackToLongCode": fallback_to_long_code, - "AreaCodeGeomatch": area_code_geomatch, + "FallbackToLongCode": serialize.boolean_to_string( + fallback_to_long_code + ), + "AreaCodeGeomatch": serialize.boolean_to_string(area_code_geomatch), "ValidityPeriod": validity_period, - "SynchronousValidation": synchronous_validation, + "SynchronousValidation": serialize.boolean_to_string( + synchronous_validation + ), "Usecase": usecase, - "UseInboundWebhookOnNumber": use_inbound_webhook_on_number, + "UseInboundWebhookOnNumber": serialize.boolean_to_string( + use_inbound_webhook_on_number + ), } ) @@ -736,16 +748,22 @@ def create( "FallbackUrl": fallback_url, "FallbackMethod": fallback_method, "StatusCallback": status_callback, - "StickySender": sticky_sender, - "MmsConverter": mms_converter, - "SmartEncoding": smart_encoding, + "StickySender": serialize.boolean_to_string(sticky_sender), + "MmsConverter": serialize.boolean_to_string(mms_converter), + "SmartEncoding": serialize.boolean_to_string(smart_encoding), "ScanMessageContent": scan_message_content, - "FallbackToLongCode": fallback_to_long_code, - "AreaCodeGeomatch": area_code_geomatch, + "FallbackToLongCode": serialize.boolean_to_string( + fallback_to_long_code + ), + "AreaCodeGeomatch": serialize.boolean_to_string(area_code_geomatch), "ValidityPeriod": validity_period, - "SynchronousValidation": synchronous_validation, + "SynchronousValidation": serialize.boolean_to_string( + synchronous_validation + ), "Usecase": usecase, - "UseInboundWebhookOnNumber": use_inbound_webhook_on_number, + "UseInboundWebhookOnNumber": serialize.boolean_to_string( + use_inbound_webhook_on_number + ), } ) @@ -809,16 +827,22 @@ async def create_async( "FallbackUrl": fallback_url, "FallbackMethod": fallback_method, "StatusCallback": status_callback, - "StickySender": sticky_sender, - "MmsConverter": mms_converter, - "SmartEncoding": smart_encoding, + "StickySender": serialize.boolean_to_string(sticky_sender), + "MmsConverter": serialize.boolean_to_string(mms_converter), + "SmartEncoding": serialize.boolean_to_string(smart_encoding), "ScanMessageContent": scan_message_content, - "FallbackToLongCode": fallback_to_long_code, - "AreaCodeGeomatch": area_code_geomatch, + "FallbackToLongCode": serialize.boolean_to_string( + fallback_to_long_code + ), + "AreaCodeGeomatch": serialize.boolean_to_string(area_code_geomatch), "ValidityPeriod": validity_period, - "SynchronousValidation": synchronous_validation, + "SynchronousValidation": serialize.boolean_to_string( + synchronous_validation + ), "Usecase": usecase, - "UseInboundWebhookOnNumber": use_inbound_webhook_on_number, + "UseInboundWebhookOnNumber": serialize.boolean_to_string( + use_inbound_webhook_on_number + ), } ) diff --git a/twilio/rest/messaging/v1/service/us_app_to_person.py b/twilio/rest/messaging/v1/service/us_app_to_person.py index cc23f0caf5..9034e4e2eb 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person.py @@ -346,13 +346,13 @@ def update( """ data = values.of( { - "HasEmbeddedLinks": has_embedded_links, - "HasEmbeddedPhone": has_embedded_phone, + "HasEmbeddedLinks": serialize.boolean_to_string(has_embedded_links), + "HasEmbeddedPhone": serialize.boolean_to_string(has_embedded_phone), "MessageSamples": serialize.map(message_samples, lambda e: e), "MessageFlow": message_flow, "Description": description, - "AgeGated": age_gated, - "DirectLending": direct_lending, + "AgeGated": serialize.boolean_to_string(age_gated), + "DirectLending": serialize.boolean_to_string(direct_lending), } ) @@ -394,13 +394,13 @@ async def update_async( """ data = values.of( { - "HasEmbeddedLinks": has_embedded_links, - "HasEmbeddedPhone": has_embedded_phone, + "HasEmbeddedLinks": serialize.boolean_to_string(has_embedded_links), + "HasEmbeddedPhone": serialize.boolean_to_string(has_embedded_phone), "MessageSamples": serialize.map(message_samples, lambda e: e), "MessageFlow": message_flow, "Description": description, - "AgeGated": age_gated, - "DirectLending": direct_lending, + "AgeGated": serialize.boolean_to_string(age_gated), + "DirectLending": serialize.boolean_to_string(direct_lending), } ) @@ -519,17 +519,17 @@ def create( "MessageFlow": message_flow, "MessageSamples": serialize.map(message_samples, lambda e: e), "UsAppToPersonUsecase": us_app_to_person_usecase, - "HasEmbeddedLinks": has_embedded_links, - "HasEmbeddedPhone": has_embedded_phone, + "HasEmbeddedLinks": serialize.boolean_to_string(has_embedded_links), + "HasEmbeddedPhone": serialize.boolean_to_string(has_embedded_phone), "OptInMessage": opt_in_message, "OptOutMessage": opt_out_message, "HelpMessage": help_message, "OptInKeywords": serialize.map(opt_in_keywords, lambda e: e), "OptOutKeywords": serialize.map(opt_out_keywords, lambda e: e), "HelpKeywords": serialize.map(help_keywords, lambda e: e), - "SubscriberOptIn": subscriber_opt_in, - "AgeGated": age_gated, - "DirectLending": direct_lending, + "SubscriberOptIn": serialize.boolean_to_string(subscriber_opt_in), + "AgeGated": serialize.boolean_to_string(age_gated), + "DirectLending": serialize.boolean_to_string(direct_lending), } ) @@ -594,17 +594,17 @@ async def create_async( "MessageFlow": message_flow, "MessageSamples": serialize.map(message_samples, lambda e: e), "UsAppToPersonUsecase": us_app_to_person_usecase, - "HasEmbeddedLinks": has_embedded_links, - "HasEmbeddedPhone": has_embedded_phone, + "HasEmbeddedLinks": serialize.boolean_to_string(has_embedded_links), + "HasEmbeddedPhone": serialize.boolean_to_string(has_embedded_phone), "OptInMessage": opt_in_message, "OptOutMessage": opt_out_message, "HelpMessage": help_message, "OptInKeywords": serialize.map(opt_in_keywords, lambda e: e), "OptOutKeywords": serialize.map(opt_out_keywords, lambda e: e), "HelpKeywords": serialize.map(help_keywords, lambda e: e), - "SubscriberOptIn": subscriber_opt_in, - "AgeGated": age_gated, - "DirectLending": direct_lending, + "SubscriberOptIn": serialize.boolean_to_string(subscriber_opt_in), + "AgeGated": serialize.boolean_to_string(age_gated), + "DirectLending": serialize.boolean_to_string(direct_lending), } ) diff --git a/twilio/rest/messaging/v1/tollfree_verification.py b/twilio/rest/messaging/v1/tollfree_verification.py index af57cfc5fc..e742c57191 100644 --- a/twilio/rest/messaging/v1/tollfree_verification.py +++ b/twilio/rest/messaging/v1/tollfree_verification.py @@ -56,7 +56,7 @@ class Status(object): :ivar business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. :ivar business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. :ivar business_contact_email: The email address of the contact for the business or organization using the Tollfree number. - :ivar business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :ivar business_contact_phone: The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. :ivar notification_email: The email address to receive the notification about the verification result. . :ivar use_case_categories: The category of the use case for the Tollfree Number. List as many are applicable.. :ivar use_case_summary: Use this to further explain how messaging is used by the business or organization. @@ -72,6 +72,7 @@ class Status(object): :ivar error_code: The error code given when a Tollfree Verification has been rejected. :ivar edit_expiration: The date and time when the ability to edit a rejected verification expires. :ivar edit_allowed: If a rejected verification is allowed to be edited/resubmitted. Some rejection reasons allow editing and some do not. + :ivar rejection_reasons: A list of rejection reasons and codes describing why a Tollfree Verification has been rejected. :ivar resource_links: The URLs of the documents associated with the Tollfree Verification resource. :ivar external_reference_id: An optional external reference ID supplied by customer and echoed back on status retrieval. """ @@ -147,6 +148,9 @@ def __init__( payload.get("edit_expiration") ) self.edit_allowed: Optional[bool] = payload.get("edit_allowed") + self.rejection_reasons: Optional[List[Dict[str, object]]] = payload.get( + "rejection_reasons" + ) self.resource_links: Optional[Dict[str, object]] = payload.get("resource_links") self.external_reference_id: Optional[str] = payload.get("external_reference_id") @@ -254,7 +258,7 @@ def update( :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. + :param business_contact_phone: The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. :param edit_reason: Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. :returns: The updated TollfreeVerificationInstance @@ -331,7 +335,7 @@ async def update_async( :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. + :param business_contact_phone: The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. :param edit_reason: Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. :returns: The updated TollfreeVerificationInstance @@ -497,7 +501,7 @@ def update( :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. + :param business_contact_phone: The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. :param edit_reason: Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. :returns: The updated TollfreeVerificationInstance @@ -586,7 +590,7 @@ async def update_async( :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. + :param business_contact_phone: The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. :param edit_reason: Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. :returns: The updated TollfreeVerificationInstance @@ -719,7 +723,7 @@ def create( :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. + :param business_contact_phone: The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. :param external_reference_id: An optional external reference ID supplied by customer and echoed back on status retrieval. :returns: The created TollfreeVerificationInstance @@ -811,7 +815,7 @@ async def create_async( :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. + :param business_contact_phone: The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. :param external_reference_id: An optional external reference ID supplied by customer and echoed back on status retrieval. :returns: The created TollfreeVerificationInstance diff --git a/twilio/rest/microvisor/v1/device/__init__.py b/twilio/rest/microvisor/v1/device/__init__.py index 56904ee1f7..42a17340f6 100644 --- a/twilio/rest/microvisor/v1/device/__init__.py +++ b/twilio/rest/microvisor/v1/device/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -245,8 +245,8 @@ def update( { "UniqueName": unique_name, "TargetApp": target_app, - "LoggingEnabled": logging_enabled, - "RestartApp": restart_app, + "LoggingEnabled": serialize.boolean_to_string(logging_enabled), + "RestartApp": serialize.boolean_to_string(restart_app), } ) @@ -279,8 +279,8 @@ async def update_async( { "UniqueName": unique_name, "TargetApp": target_app, - "LoggingEnabled": logging_enabled, - "RestartApp": restart_app, + "LoggingEnabled": serialize.boolean_to_string(logging_enabled), + "RestartApp": serialize.boolean_to_string(restart_app), } ) diff --git a/twilio/rest/notify/v1/credential.py b/twilio/rest/notify/v1/credential.py index 3dd6380cee..5cb86363a3 100644 --- a/twilio/rest/notify/v1/credential.py +++ b/twilio/rest/notify/v1/credential.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -289,7 +289,7 @@ def update( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -329,7 +329,7 @@ async def update_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -415,7 +415,7 @@ def create( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -459,7 +459,7 @@ async def create_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } diff --git a/twilio/rest/notify/v1/service/__init__.py b/twilio/rest/notify/v1/service/__init__.py index 912d6ba9cd..0cd9adb685 100644 --- a/twilio/rest/notify/v1/service/__init__.py +++ b/twilio/rest/notify/v1/service/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -408,11 +408,13 @@ def update( "DefaultGcmNotificationProtocolVersion": default_gcm_notification_protocol_version, "FcmCredentialSid": fcm_credential_sid, "DefaultFcmNotificationProtocolVersion": default_fcm_notification_protocol_version, - "LogEnabled": log_enabled, + "LogEnabled": serialize.boolean_to_string(log_enabled), "AlexaSkillId": alexa_skill_id, "DefaultAlexaNotificationProtocolVersion": default_alexa_notification_protocol_version, "DeliveryCallbackUrl": delivery_callback_url, - "DeliveryCallbackEnabled": delivery_callback_enabled, + "DeliveryCallbackEnabled": serialize.boolean_to_string( + delivery_callback_enabled + ), } ) @@ -472,11 +474,13 @@ async def update_async( "DefaultGcmNotificationProtocolVersion": default_gcm_notification_protocol_version, "FcmCredentialSid": fcm_credential_sid, "DefaultFcmNotificationProtocolVersion": default_fcm_notification_protocol_version, - "LogEnabled": log_enabled, + "LogEnabled": serialize.boolean_to_string(log_enabled), "AlexaSkillId": alexa_skill_id, "DefaultAlexaNotificationProtocolVersion": default_alexa_notification_protocol_version, "DeliveryCallbackUrl": delivery_callback_url, - "DeliveryCallbackEnabled": delivery_callback_enabled, + "DeliveryCallbackEnabled": serialize.boolean_to_string( + delivery_callback_enabled + ), } ) @@ -603,11 +607,13 @@ def create( "DefaultGcmNotificationProtocolVersion": default_gcm_notification_protocol_version, "FcmCredentialSid": fcm_credential_sid, "DefaultFcmNotificationProtocolVersion": default_fcm_notification_protocol_version, - "LogEnabled": log_enabled, + "LogEnabled": serialize.boolean_to_string(log_enabled), "AlexaSkillId": alexa_skill_id, "DefaultAlexaNotificationProtocolVersion": default_alexa_notification_protocol_version, "DeliveryCallbackUrl": delivery_callback_url, - "DeliveryCallbackEnabled": delivery_callback_enabled, + "DeliveryCallbackEnabled": serialize.boolean_to_string( + delivery_callback_enabled + ), } ) @@ -668,11 +674,13 @@ async def create_async( "DefaultGcmNotificationProtocolVersion": default_gcm_notification_protocol_version, "FcmCredentialSid": fcm_credential_sid, "DefaultFcmNotificationProtocolVersion": default_fcm_notification_protocol_version, - "LogEnabled": log_enabled, + "LogEnabled": serialize.boolean_to_string(log_enabled), "AlexaSkillId": alexa_skill_id, "DefaultAlexaNotificationProtocolVersion": default_alexa_notification_protocol_version, "DeliveryCallbackUrl": delivery_callback_url, - "DeliveryCallbackEnabled": delivery_callback_enabled, + "DeliveryCallbackEnabled": serialize.boolean_to_string( + delivery_callback_enabled + ), } ) diff --git a/twilio/rest/numbers/v1/bulk_eligibility.py b/twilio/rest/numbers/v1/bulk_eligibility.py index c13f42c796..3915116416 100644 --- a/twilio/rest/numbers/v1/bulk_eligibility.py +++ b/twilio/rest/numbers/v1/bulk_eligibility.py @@ -13,8 +13,8 @@ """ from datetime import datetime -from typing import Any, Dict, List, Optional -from twilio.base import deserialize +from typing import Any, Dict, List, Optional, Union +from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -180,32 +180,41 @@ def __init__(self, version: Version): self._uri = "/HostedNumber/Eligibility/Bulk" - def create(self) -> BulkEligibilityInstance: + def create( + self, body: Union[object, object] = values.unset + ) -> BulkEligibilityInstance: """ Create the BulkEligibilityInstance + :param body: :returns: The created BulkEligibilityInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = self._version.create( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return BulkEligibilityInstance(self._version, payload) - async def create_async(self) -> BulkEligibilityInstance: + async def create_async( + self, body: Union[object, object] = values.unset + ) -> BulkEligibilityInstance: """ Asynchronously create the BulkEligibilityInstance + :param body: :returns: The created BulkEligibilityInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return BulkEligibilityInstance(self._version, payload) diff --git a/twilio/rest/numbers/v1/eligibility.py b/twilio/rest/numbers/v1/eligibility.py index 99461374ee..3b8b5be345 100644 --- a/twilio/rest/numbers/v1/eligibility.py +++ b/twilio/rest/numbers/v1/eligibility.py @@ -12,7 +12,8 @@ Do not edit the class manually. """ -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Optional, Union +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -52,32 +53,39 @@ def __init__(self, version: Version): self._uri = "/HostedNumber/Eligibility" - def create(self) -> EligibilityInstance: + def create(self, body: Union[object, object] = values.unset) -> EligibilityInstance: """ Create the EligibilityInstance + :param body: :returns: The created EligibilityInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = self._version.create( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return EligibilityInstance(self._version, payload) - async def create_async(self) -> EligibilityInstance: + async def create_async( + self, body: Union[object, object] = values.unset + ) -> EligibilityInstance: """ Asynchronously create the EligibilityInstance + :param body: :returns: The created EligibilityInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return EligibilityInstance(self._version, payload) diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py index ad3140a0b8..b0cd0fdfc1 100644 --- a/twilio/rest/numbers/v1/porting_port_in.py +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -12,7 +12,8 @@ Do not edit the class manually. """ -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 from twilio.base.list_resource import ListResource @@ -54,32 +55,41 @@ def __init__(self, version: Version): self._uri = "/Porting/PortIn" - def create(self) -> PortingPortInInstance: + def create( + self, body: Union[object, object] = values.unset + ) -> PortingPortInInstance: """ Create the PortingPortInInstance + :param body: :returns: The created PortingPortInInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = self._version.create( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return PortingPortInInstance(self._version, payload) - async def create_async(self) -> PortingPortInInstance: + async def create_async( + self, body: Union[object, object] = values.unset + ) -> PortingPortInInstance: """ Asynchronously create the PortingPortInInstance + :param body: :returns: The created PortingPortInInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return PortingPortInInstance(self._version, payload) diff --git a/twilio/rest/numbers/v2/bulk_hosted_number_order.py b/twilio/rest/numbers/v2/bulk_hosted_number_order.py index f7f6026c50..0e75a5067b 100644 --- a/twilio/rest/numbers/v2/bulk_hosted_number_order.py +++ b/twilio/rest/numbers/v2/bulk_hosted_number_order.py @@ -218,32 +218,41 @@ def __init__(self, version: Version): self._uri = "/HostedNumber/Orders/Bulk" - def create(self) -> BulkHostedNumberOrderInstance: + def create( + self, body: Union[object, object] = values.unset + ) -> BulkHostedNumberOrderInstance: """ Create the BulkHostedNumberOrderInstance + :param body: :returns: The created BulkHostedNumberOrderInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = self._version.create( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return BulkHostedNumberOrderInstance(self._version, payload) - async def create_async(self) -> BulkHostedNumberOrderInstance: + async def create_async( + self, body: Union[object, object] = values.unset + ) -> BulkHostedNumberOrderInstance: """ Asynchronously create the BulkHostedNumberOrderInstance + :param body: :returns: The created BulkHostedNumberOrderInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return BulkHostedNumberOrderInstance(self._version, payload) diff --git a/twilio/rest/numbers/v2/hosted_number_order.py b/twilio/rest/numbers/v2/hosted_number_order.py index c20fc517c8..2063e7a87d 100644 --- a/twilio/rest/numbers/v2/hosted_number_order.py +++ b/twilio/rest/numbers/v2/hosted_number_order.py @@ -331,7 +331,7 @@ def create( "SmsUrl": sms_url, "SmsMethod": sms_method, "SmsFallbackUrl": sms_fallback_url, - "SmsCapability": sms_capability, + "SmsCapability": serialize.boolean_to_string(sms_capability), "SmsFallbackMethod": sms_fallback_method, "StatusCallbackUrl": status_callback_url, "StatusCallbackMethod": status_callback_method, @@ -402,7 +402,7 @@ async def create_async( "SmsUrl": sms_url, "SmsMethod": sms_method, "SmsFallbackUrl": sms_fallback_url, - "SmsCapability": sms_capability, + "SmsCapability": serialize.boolean_to_string(sms_capability), "SmsFallbackMethod": sms_fallback_method, "StatusCallbackUrl": status_callback_url, "StatusCallbackMethod": status_callback_method, @@ -615,7 +615,7 @@ def page( data = values.of( { "Status": status, - "SmsCapability": sms_capability, + "SmsCapability": serialize.boolean_to_string(sms_capability), "PhoneNumber": phone_number, "IncomingPhoneNumberSid": incoming_phone_number_sid, "FriendlyName": friendly_name, @@ -657,7 +657,7 @@ async def page_async( data = values.of( { "Status": status, - "SmsCapability": sms_capability, + "SmsCapability": serialize.boolean_to_string(sms_capability), "PhoneNumber": phone_number, "IncomingPhoneNumberSid": incoming_phone_number_sid, "FriendlyName": friendly_name, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py index 8215bb95b7..a76ceaf83a 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py @@ -823,7 +823,7 @@ def page( "RegulationSid": regulation_sid, "IsoCountry": iso_country, "NumberType": number_type, - "HasValidUntilDate": has_valid_until_date, + "HasValidUntilDate": serialize.boolean_to_string(has_valid_until_date), "SortBy": sort_by, "SortDirection": sort_direction, "ValidUntilDate": serialize.iso8601_datetime(valid_until_date), @@ -877,7 +877,7 @@ async def page_async( "RegulationSid": regulation_sid, "IsoCountry": iso_country, "NumberType": number_type, - "HasValidUntilDate": has_valid_until_date, + "HasValidUntilDate": serialize.boolean_to_string(has_valid_until_date), "SortBy": sort_by, "SortDirection": sort_direction, "ValidUntilDate": serialize.iso8601_datetime(valid_until_date), diff --git a/twilio/rest/preview/deployed_devices/fleet/device.py b/twilio/rest/preview/deployed_devices/fleet/device.py index 8f20074915..7e9b818140 100644 --- a/twilio/rest/preview/deployed_devices/fleet/device.py +++ b/twilio/rest/preview/deployed_devices/fleet/device.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -287,7 +287,7 @@ def update( "FriendlyName": friendly_name, "Identity": identity, "DeploymentSid": deployment_sid, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) @@ -326,7 +326,7 @@ async def update_async( "FriendlyName": friendly_name, "Identity": identity, "DeploymentSid": deployment_sid, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) @@ -418,7 +418,7 @@ def create( "FriendlyName": friendly_name, "Identity": identity, "DeploymentSid": deployment_sid, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) @@ -458,7 +458,7 @@ async def create_async( "FriendlyName": friendly_name, "Identity": identity, "DeploymentSid": deployment_sid, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) diff --git a/twilio/rest/preview/hosted_numbers/hosted_number_order.py b/twilio/rest/preview/hosted_numbers/hosted_number_order.py index 70b9f309ba..7e68f57b56 100644 --- a/twilio/rest/preview/hosted_numbers/hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/hosted_number_order.py @@ -550,7 +550,7 @@ def create( data = values.of( { "PhoneNumber": phone_number, - "SmsCapability": sms_capability, + "SmsCapability": serialize.boolean_to_string(sms_capability), "AccountSid": account_sid, "FriendlyName": friendly_name, "UniqueName": unique_name, @@ -626,7 +626,7 @@ async def create_async( data = values.of( { "PhoneNumber": phone_number, - "SmsCapability": sms_capability, + "SmsCapability": serialize.boolean_to_string(sms_capability), "AccountSid": account_sid, "FriendlyName": friendly_name, "UniqueName": unique_name, diff --git a/twilio/rest/preview/marketplace/installed_add_on/__init__.py b/twilio/rest/preview/marketplace/installed_add_on/__init__.py index 5a0530aef4..d067f9fe79 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/installed_add_on/__init__.py @@ -380,7 +380,9 @@ def create( data = values.of( { "AvailableAddOnSid": available_add_on_sid, - "AcceptTermsOfService": accept_terms_of_service, + "AcceptTermsOfService": serialize.boolean_to_string( + accept_terms_of_service + ), "Configuration": serialize.object(configuration), "UniqueName": unique_name, } @@ -415,7 +417,9 @@ async def create_async( data = values.of( { "AvailableAddOnSid": available_add_on_sid, - "AcceptTermsOfService": accept_terms_of_service, + "AcceptTermsOfService": serialize.boolean_to_string( + accept_terms_of_service + ), "Configuration": serialize.object(configuration), "UniqueName": unique_name, } diff --git a/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py b/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py index a6002fa0d1..f8e65d12c1 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py +++ b/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -196,7 +196,7 @@ def update(self, enabled: bool) -> InstalledAddOnExtensionInstance: """ data = values.of( { - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) @@ -223,7 +223,7 @@ async def update_async(self, enabled: bool) -> InstalledAddOnExtensionInstance: """ data = values.of( { - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) diff --git a/twilio/rest/preview/sync/service/__init__.py b/twilio/rest/preview/sync/service/__init__.py index e270895fbf..cb8cdf7910 100644 --- a/twilio/rest/preview/sync/service/__init__.py +++ b/twilio/rest/preview/sync/service/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -300,8 +300,10 @@ def update( { "WebhookUrl": webhook_url, "FriendlyName": friendly_name, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), } ) @@ -334,8 +336,10 @@ async def update_async( { "WebhookUrl": webhook_url, "FriendlyName": friendly_name, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), } ) @@ -447,8 +451,10 @@ def create( { "FriendlyName": friendly_name, "WebhookUrl": webhook_url, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), } ) @@ -482,8 +488,10 @@ async def create_async( { "FriendlyName": friendly_name, "WebhookUrl": webhook_url, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), } ) diff --git a/twilio/rest/preview/sync/service/document/document_permission.py b/twilio/rest/preview/sync/service/document/document_permission.py index 7439d34341..48addbb163 100644 --- a/twilio/rest/preview/sync/service/document/document_permission.py +++ b/twilio/rest/preview/sync/service/document/document_permission.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -263,9 +263,9 @@ def update( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) @@ -297,9 +297,9 @@ async def update_async( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py index 0f4f9e4b28..2fcaca5b26 100644 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py +++ b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -265,9 +265,9 @@ def update( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) @@ -299,9 +299,9 @@ async def update_async( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py index 999713e0e9..b626f07bdc 100644 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py +++ b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -263,9 +263,9 @@ def update( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) @@ -297,9 +297,9 @@ async def update_async( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) diff --git a/twilio/rest/preview/wireless/rate_plan.py b/twilio/rest/preview/wireless/rate_plan.py index abd9cbecc2..f3484efa66 100644 --- a/twilio/rest/preview/wireless/rate_plan.py +++ b/twilio/rest/preview/wireless/rate_plan.py @@ -381,13 +381,15 @@ def create( { "UniqueName": unique_name, "FriendlyName": friendly_name, - "DataEnabled": data_enabled, + "DataEnabled": serialize.boolean_to_string(data_enabled), "DataLimit": data_limit, "DataMetering": data_metering, - "MessagingEnabled": messaging_enabled, - "VoiceEnabled": voice_enabled, - "CommandsEnabled": commands_enabled, - "NationalRoamingEnabled": national_roaming_enabled, + "MessagingEnabled": serialize.boolean_to_string(messaging_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "CommandsEnabled": serialize.boolean_to_string(commands_enabled), + "NationalRoamingEnabled": serialize.boolean_to_string( + national_roaming_enabled + ), "InternationalRoaming": serialize.map( international_roaming, lambda e: e ), @@ -436,13 +438,15 @@ async def create_async( { "UniqueName": unique_name, "FriendlyName": friendly_name, - "DataEnabled": data_enabled, + "DataEnabled": serialize.boolean_to_string(data_enabled), "DataLimit": data_limit, "DataMetering": data_metering, - "MessagingEnabled": messaging_enabled, - "VoiceEnabled": voice_enabled, - "CommandsEnabled": commands_enabled, - "NationalRoamingEnabled": national_roaming_enabled, + "MessagingEnabled": serialize.boolean_to_string(messaging_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "CommandsEnabled": serialize.boolean_to_string(commands_enabled), + "NationalRoamingEnabled": serialize.boolean_to_string( + national_roaming_enabled + ), "InternationalRoaming": serialize.map( international_roaming, lambda e: e ), diff --git a/twilio/rest/proxy/v1/service/phone_number.py b/twilio/rest/proxy/v1/service/phone_number.py index c4252b3980..366b9ba11f 100644 --- a/twilio/rest/proxy/v1/service/phone_number.py +++ b/twilio/rest/proxy/v1/service/phone_number.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -257,7 +257,7 @@ def update( """ data = values.of( { - "IsReserved": is_reserved, + "IsReserved": serialize.boolean_to_string(is_reserved), } ) @@ -286,7 +286,7 @@ async def update_async( """ data = values.of( { - "IsReserved": is_reserved, + "IsReserved": serialize.boolean_to_string(is_reserved), } ) @@ -372,7 +372,7 @@ def create( { "Sid": sid, "PhoneNumber": phone_number, - "IsReserved": is_reserved, + "IsReserved": serialize.boolean_to_string(is_reserved), } ) @@ -406,7 +406,7 @@ async def create_async( { "Sid": sid, "PhoneNumber": phone_number, - "IsReserved": is_reserved, + "IsReserved": serialize.boolean_to_string(is_reserved), } ) diff --git a/twilio/rest/proxy/v1/service/short_code.py b/twilio/rest/proxy/v1/service/short_code.py index 7fc108e673..712d6f82fa 100644 --- a/twilio/rest/proxy/v1/service/short_code.py +++ b/twilio/rest/proxy/v1/service/short_code.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -251,7 +251,7 @@ def update( """ data = values.of( { - "IsReserved": is_reserved, + "IsReserved": serialize.boolean_to_string(is_reserved), } ) @@ -280,7 +280,7 @@ async def update_async( """ data = values.of( { - "IsReserved": is_reserved, + "IsReserved": serialize.boolean_to_string(is_reserved), } ) diff --git a/twilio/rest/serverless/v1/service/__init__.py b/twilio/rest/serverless/v1/service/__init__.py index 493b1a2e05..0fe404c8f1 100644 --- a/twilio/rest/serverless/v1/service/__init__.py +++ b/twilio/rest/serverless/v1/service/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -299,9 +299,9 @@ def update( """ data = values.of( { - "IncludeCredentials": include_credentials, + "IncludeCredentials": serialize.boolean_to_string(include_credentials), "FriendlyName": friendly_name, - "UiEditable": ui_editable, + "UiEditable": serialize.boolean_to_string(ui_editable), } ) @@ -330,9 +330,9 @@ async def update_async( """ data = values.of( { - "IncludeCredentials": include_credentials, + "IncludeCredentials": serialize.boolean_to_string(include_credentials), "FriendlyName": friendly_name, - "UiEditable": ui_editable, + "UiEditable": serialize.boolean_to_string(ui_editable), } ) @@ -456,8 +456,8 @@ def create( { "UniqueName": unique_name, "FriendlyName": friendly_name, - "IncludeCredentials": include_credentials, - "UiEditable": ui_editable, + "IncludeCredentials": serialize.boolean_to_string(include_credentials), + "UiEditable": serialize.boolean_to_string(ui_editable), } ) @@ -491,8 +491,8 @@ async def create_async( { "UniqueName": unique_name, "FriendlyName": friendly_name, - "IncludeCredentials": include_credentials, - "UiEditable": ui_editable, + "IncludeCredentials": serialize.boolean_to_string(include_credentials), + "UiEditable": serialize.boolean_to_string(ui_editable), } ) diff --git a/twilio/rest/supersim/v1/esim_profile.py b/twilio/rest/supersim/v1/esim_profile.py index c8ecb02ae0..847bcae33a 100644 --- a/twilio/rest/supersim/v1/esim_profile.py +++ b/twilio/rest/supersim/v1/esim_profile.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -240,7 +240,7 @@ def create( { "CallbackUrl": callback_url, "CallbackMethod": callback_method, - "GenerateMatchingId": generate_matching_id, + "GenerateMatchingId": serialize.boolean_to_string(generate_matching_id), "Eid": eid, } ) @@ -275,7 +275,7 @@ async def create_async( { "CallbackUrl": callback_url, "CallbackMethod": callback_method, - "GenerateMatchingId": generate_matching_id, + "GenerateMatchingId": serialize.boolean_to_string(generate_matching_id), "Eid": eid, } ) diff --git a/twilio/rest/supersim/v1/fleet.py b/twilio/rest/supersim/v1/fleet.py index 2447057a7f..2003eb77b5 100644 --- a/twilio/rest/supersim/v1/fleet.py +++ b/twilio/rest/supersim/v1/fleet.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -403,11 +403,11 @@ def create( { "NetworkAccessProfile": network_access_profile, "UniqueName": unique_name, - "DataEnabled": data_enabled, + "DataEnabled": serialize.boolean_to_string(data_enabled), "DataLimit": data_limit, "IpCommandsUrl": ip_commands_url, "IpCommandsMethod": ip_commands_method, - "SmsCommandsEnabled": sms_commands_enabled, + "SmsCommandsEnabled": serialize.boolean_to_string(sms_commands_enabled), "SmsCommandsUrl": sms_commands_url, "SmsCommandsMethod": sms_commands_method, } @@ -453,11 +453,11 @@ async def create_async( { "NetworkAccessProfile": network_access_profile, "UniqueName": unique_name, - "DataEnabled": data_enabled, + "DataEnabled": serialize.boolean_to_string(data_enabled), "DataLimit": data_limit, "IpCommandsUrl": ip_commands_url, "IpCommandsMethod": ip_commands_method, - "SmsCommandsEnabled": sms_commands_enabled, + "SmsCommandsEnabled": serialize.boolean_to_string(sms_commands_enabled), "SmsCommandsUrl": sms_commands_url, "SmsCommandsMethod": sms_commands_method, } diff --git a/twilio/rest/sync/v1/service/__init__.py b/twilio/rest/sync/v1/service/__init__.py index 9fd7c22e30..0bf1045f2b 100644 --- a/twilio/rest/sync/v1/service/__init__.py +++ b/twilio/rest/sync/v1/service/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -347,11 +347,17 @@ def update( { "WebhookUrl": webhook_url, "FriendlyName": friendly_name, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, - "ReachabilityDebouncingEnabled": reachability_debouncing_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), + "ReachabilityDebouncingEnabled": serialize.boolean_to_string( + reachability_debouncing_enabled + ), "ReachabilityDebouncingWindow": reachability_debouncing_window, - "WebhooksFromRestEnabled": webhooks_from_rest_enabled, + "WebhooksFromRestEnabled": serialize.boolean_to_string( + webhooks_from_rest_enabled + ), } ) @@ -390,11 +396,17 @@ async def update_async( { "WebhookUrl": webhook_url, "FriendlyName": friendly_name, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, - "ReachabilityDebouncingEnabled": reachability_debouncing_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), + "ReachabilityDebouncingEnabled": serialize.boolean_to_string( + reachability_debouncing_enabled + ), "ReachabilityDebouncingWindow": reachability_debouncing_window, - "WebhooksFromRestEnabled": webhooks_from_rest_enabled, + "WebhooksFromRestEnabled": serialize.boolean_to_string( + webhooks_from_rest_enabled + ), } ) @@ -524,11 +536,17 @@ def create( { "FriendlyName": friendly_name, "WebhookUrl": webhook_url, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, - "ReachabilityDebouncingEnabled": reachability_debouncing_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), + "ReachabilityDebouncingEnabled": serialize.boolean_to_string( + reachability_debouncing_enabled + ), "ReachabilityDebouncingWindow": reachability_debouncing_window, - "WebhooksFromRestEnabled": webhooks_from_rest_enabled, + "WebhooksFromRestEnabled": serialize.boolean_to_string( + webhooks_from_rest_enabled + ), } ) @@ -568,11 +586,17 @@ async def create_async( { "FriendlyName": friendly_name, "WebhookUrl": webhook_url, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, - "ReachabilityDebouncingEnabled": reachability_debouncing_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), + "ReachabilityDebouncingEnabled": serialize.boolean_to_string( + reachability_debouncing_enabled + ), "ReachabilityDebouncingWindow": reachability_debouncing_window, - "WebhooksFromRestEnabled": webhooks_from_rest_enabled, + "WebhooksFromRestEnabled": serialize.boolean_to_string( + webhooks_from_rest_enabled + ), } ) diff --git a/twilio/rest/sync/v1/service/document/document_permission.py b/twilio/rest/sync/v1/service/document/document_permission.py index d8f157fb4e..40f524832c 100644 --- a/twilio/rest/sync/v1/service/document/document_permission.py +++ b/twilio/rest/sync/v1/service/document/document_permission.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -263,9 +263,9 @@ def update( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) @@ -297,9 +297,9 @@ async def update_async( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) diff --git a/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py b/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py index 228ab0d192..07fce14b95 100644 --- a/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py +++ b/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -265,9 +265,9 @@ def update( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) @@ -299,9 +299,9 @@ async def update_async( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) diff --git a/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py b/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py index 3f204d65ba..ba056906c7 100644 --- a/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py +++ b/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -263,9 +263,9 @@ def update( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) @@ -297,9 +297,9 @@ async def update_async( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) diff --git a/twilio/rest/taskrouter/v1/workspace/__init__.py b/twilio/rest/taskrouter/v1/workspace/__init__.py index 0b0136fedc..f1202197c4 100644 --- a/twilio/rest/taskrouter/v1/workspace/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -416,7 +416,7 @@ def update( "EventCallbackUrl": event_callback_url, "EventsFilter": events_filter, "FriendlyName": friendly_name, - "MultiTaskEnabled": multi_task_enabled, + "MultiTaskEnabled": serialize.boolean_to_string(multi_task_enabled), "TimeoutActivitySid": timeout_activity_sid, "PrioritizeQueueOrder": prioritize_queue_order, } @@ -461,7 +461,7 @@ async def update_async( "EventCallbackUrl": event_callback_url, "EventsFilter": events_filter, "FriendlyName": friendly_name, - "MultiTaskEnabled": multi_task_enabled, + "MultiTaskEnabled": serialize.boolean_to_string(multi_task_enabled), "TimeoutActivitySid": timeout_activity_sid, "PrioritizeQueueOrder": prioritize_queue_order, } @@ -666,7 +666,7 @@ def create( "FriendlyName": friendly_name, "EventCallbackUrl": event_callback_url, "EventsFilter": events_filter, - "MultiTaskEnabled": multi_task_enabled, + "MultiTaskEnabled": serialize.boolean_to_string(multi_task_enabled), "Template": template, "PrioritizeQueueOrder": prioritize_queue_order, } @@ -709,7 +709,7 @@ async def create_async( "FriendlyName": friendly_name, "EventCallbackUrl": event_callback_url, "EventsFilter": events_filter, - "MultiTaskEnabled": multi_task_enabled, + "MultiTaskEnabled": serialize.boolean_to_string(multi_task_enabled), "Template": template, "PrioritizeQueueOrder": prioritize_queue_order, } diff --git a/twilio/rest/taskrouter/v1/workspace/activity.py b/twilio/rest/taskrouter/v1/workspace/activity.py index 3ab15acf8e..bae49d5efa 100644 --- a/twilio/rest/taskrouter/v1/workspace/activity.py +++ b/twilio/rest/taskrouter/v1/workspace/activity.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -361,7 +361,7 @@ def create( data = values.of( { "FriendlyName": friendly_name, - "Available": available, + "Available": serialize.boolean_to_string(available), } ) @@ -390,7 +390,7 @@ async def create_async( data = values.of( { "FriendlyName": friendly_name, - "Available": available, + "Available": serialize.boolean_to_string(available), } ) diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index 708db25105..f5c306b65a 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -855,7 +855,7 @@ def page( "TaskQueueName": task_queue_name, "EvaluateTaskAttributes": evaluate_task_attributes, "Ordering": ordering, - "HasAddons": has_addons, + "HasAddons": serialize.boolean_to_string(has_addons), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -909,7 +909,7 @@ async def page_async( "TaskQueueName": task_queue_name, "EvaluateTaskAttributes": evaluate_task_attributes, "Ordering": ordering, - "HasAddons": has_addons, + "HasAddons": serialize.boolean_to_string(has_addons), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/taskrouter/v1/workspace/task/reservation.py b/twilio/rest/taskrouter/v1/workspace/task/reservation.py index 7ac7807c0e..50b1ed1273 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/task/reservation.py @@ -723,9 +723,9 @@ def update( "CallTo": call_to, "CallUrl": call_url, "CallStatusCallbackUrl": call_status_callback_url, - "CallAccept": call_accept, + "CallAccept": serialize.boolean_to_string(call_accept), "RedirectCallSid": redirect_call_sid, - "RedirectAccept": redirect_accept, + "RedirectAccept": serialize.boolean_to_string(redirect_accept), "RedirectUrl": redirect_url, "To": to, "From": from_, @@ -735,14 +735,18 @@ def update( status_callback_event, lambda e: e ), "Timeout": timeout, - "Record": record, - "Muted": muted, + "Record": serialize.boolean_to_string(record), + "Muted": serialize.boolean_to_string(muted), "Beep": beep, - "StartConferenceOnEnter": start_conference_on_enter, - "EndConferenceOnExit": end_conference_on_exit, + "StartConferenceOnEnter": serialize.boolean_to_string( + start_conference_on_enter + ), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), "WaitUrl": wait_url, "WaitMethod": wait_method, - "EarlyMedia": early_media, + "EarlyMedia": serialize.boolean_to_string(early_media), "MaxParticipants": max_participants, "ConferenceStatusCallback": conference_status_callback, "ConferenceStatusCallbackMethod": conference_status_callback_method, @@ -765,8 +769,12 @@ def update( "PostWorkActivitySid": post_work_activity_sid, "SupervisorMode": supervisor_mode, "Supervisor": supervisor, - "EndConferenceOnCustomerExit": end_conference_on_customer_exit, - "BeepOnCustomerEntrance": beep_on_customer_entrance, + "EndConferenceOnCustomerExit": serialize.boolean_to_string( + end_conference_on_customer_exit + ), + "BeepOnCustomerEntrance": serialize.boolean_to_string( + beep_on_customer_entrance + ), "JitterBufferSize": jitter_buffer_size, } ) @@ -930,9 +938,9 @@ async def update_async( "CallTo": call_to, "CallUrl": call_url, "CallStatusCallbackUrl": call_status_callback_url, - "CallAccept": call_accept, + "CallAccept": serialize.boolean_to_string(call_accept), "RedirectCallSid": redirect_call_sid, - "RedirectAccept": redirect_accept, + "RedirectAccept": serialize.boolean_to_string(redirect_accept), "RedirectUrl": redirect_url, "To": to, "From": from_, @@ -942,14 +950,18 @@ async def update_async( status_callback_event, lambda e: e ), "Timeout": timeout, - "Record": record, - "Muted": muted, + "Record": serialize.boolean_to_string(record), + "Muted": serialize.boolean_to_string(muted), "Beep": beep, - "StartConferenceOnEnter": start_conference_on_enter, - "EndConferenceOnExit": end_conference_on_exit, + "StartConferenceOnEnter": serialize.boolean_to_string( + start_conference_on_enter + ), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), "WaitUrl": wait_url, "WaitMethod": wait_method, - "EarlyMedia": early_media, + "EarlyMedia": serialize.boolean_to_string(early_media), "MaxParticipants": max_participants, "ConferenceStatusCallback": conference_status_callback, "ConferenceStatusCallbackMethod": conference_status_callback_method, @@ -972,8 +984,12 @@ async def update_async( "PostWorkActivitySid": post_work_activity_sid, "SupervisorMode": supervisor_mode, "Supervisor": supervisor, - "EndConferenceOnCustomerExit": end_conference_on_customer_exit, - "BeepOnCustomerEntrance": beep_on_customer_entrance, + "EndConferenceOnCustomerExit": serialize.boolean_to_string( + end_conference_on_customer_exit + ), + "BeepOnCustomerEntrance": serialize.boolean_to_string( + beep_on_customer_entrance + ), "JitterBufferSize": jitter_buffer_size, } ) diff --git a/twilio/rest/taskrouter/v1/workspace/task_channel.py b/twilio/rest/taskrouter/v1/workspace/task_channel.py index 780c4ef9fa..099f85efb1 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/task_channel.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -267,7 +267,9 @@ def update( data = values.of( { "FriendlyName": friendly_name, - "ChannelOptimizedRouting": channel_optimized_routing, + "ChannelOptimizedRouting": serialize.boolean_to_string( + channel_optimized_routing + ), } ) @@ -300,7 +302,9 @@ async def update_async( data = values.of( { "FriendlyName": friendly_name, - "ChannelOptimizedRouting": channel_optimized_routing, + "ChannelOptimizedRouting": serialize.boolean_to_string( + channel_optimized_routing + ), } ) @@ -386,7 +390,9 @@ def create( { "FriendlyName": friendly_name, "UniqueName": unique_name, - "ChannelOptimizedRouting": channel_optimized_routing, + "ChannelOptimizedRouting": serialize.boolean_to_string( + channel_optimized_routing + ), } ) @@ -420,7 +426,9 @@ async def create_async( { "FriendlyName": friendly_name, "UniqueName": unique_name, - "ChannelOptimizedRouting": channel_optimized_routing, + "ChannelOptimizedRouting": serialize.boolean_to_string( + channel_optimized_routing + ), } ) diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py index 90552babf3..0556e6bb4a 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py @@ -12,8 +12,8 @@ Do not edit the class manually. """ -from typing import Any, Dict, List, Optional -from twilio.base import deserialize +from typing import Any, Dict, List, Optional, Union +from twilio.base import deserialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -80,34 +80,43 @@ def __init__(self, version: Version, workspace_sid: str): **self._solution ) - def create(self) -> TaskQueueBulkRealTimeStatisticsInstance: + def create( + self, body: Union[object, object] = values.unset + ) -> TaskQueueBulkRealTimeStatisticsInstance: """ Create the TaskQueueBulkRealTimeStatisticsInstance + :param body: :returns: The created TaskQueueBulkRealTimeStatisticsInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = self._version.create( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskQueueBulkRealTimeStatisticsInstance( self._version, payload, workspace_sid=self._solution["workspace_sid"] ) - async def create_async(self) -> TaskQueueBulkRealTimeStatisticsInstance: + async def create_async( + self, body: Union[object, object] = values.unset + ) -> TaskQueueBulkRealTimeStatisticsInstance: """ Asynchronously create the TaskQueueBulkRealTimeStatisticsInstance + :param body: :returns: The created TaskQueueBulkRealTimeStatisticsInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskQueueBulkRealTimeStatisticsInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py index a3ce2db7d4..a236fcae8d 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -352,7 +352,9 @@ def update( "ActivitySid": activity_sid, "Attributes": attributes, "FriendlyName": friendly_name, - "RejectPendingReservations": reject_pending_reservations, + "RejectPendingReservations": serialize.boolean_to_string( + reject_pending_reservations + ), } ) headers = values.of( @@ -396,7 +398,9 @@ async def update_async( "ActivitySid": activity_sid, "Attributes": attributes, "FriendlyName": friendly_name, - "RejectPendingReservations": reject_pending_reservations, + "RejectPendingReservations": serialize.boolean_to_string( + reject_pending_reservations + ), } ) headers = values.of( diff --git a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py index 2f62c433ef..b7dc4bca9e 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py @@ -694,9 +694,9 @@ def update( "CallTo": call_to, "CallUrl": call_url, "CallStatusCallbackUrl": call_status_callback_url, - "CallAccept": call_accept, + "CallAccept": serialize.boolean_to_string(call_accept), "RedirectCallSid": redirect_call_sid, - "RedirectAccept": redirect_accept, + "RedirectAccept": serialize.boolean_to_string(redirect_accept), "RedirectUrl": redirect_url, "To": to, "From": from_, @@ -706,14 +706,18 @@ def update( status_callback_event, lambda e: e ), "Timeout": timeout, - "Record": record, - "Muted": muted, + "Record": serialize.boolean_to_string(record), + "Muted": serialize.boolean_to_string(muted), "Beep": beep, - "StartConferenceOnEnter": start_conference_on_enter, - "EndConferenceOnExit": end_conference_on_exit, + "StartConferenceOnEnter": serialize.boolean_to_string( + start_conference_on_enter + ), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), "WaitUrl": wait_url, "WaitMethod": wait_method, - "EarlyMedia": early_media, + "EarlyMedia": serialize.boolean_to_string(early_media), "MaxParticipants": max_participants, "ConferenceStatusCallback": conference_status_callback, "ConferenceStatusCallbackMethod": conference_status_callback_method, @@ -734,8 +738,12 @@ def update( dequeue_status_callback_event, lambda e: e ), "PostWorkActivitySid": post_work_activity_sid, - "EndConferenceOnCustomerExit": end_conference_on_customer_exit, - "BeepOnCustomerEntrance": beep_on_customer_entrance, + "EndConferenceOnCustomerExit": serialize.boolean_to_string( + end_conference_on_customer_exit + ), + "BeepOnCustomerEntrance": serialize.boolean_to_string( + beep_on_customer_entrance + ), "JitterBufferSize": jitter_buffer_size, } ) @@ -893,9 +901,9 @@ async def update_async( "CallTo": call_to, "CallUrl": call_url, "CallStatusCallbackUrl": call_status_callback_url, - "CallAccept": call_accept, + "CallAccept": serialize.boolean_to_string(call_accept), "RedirectCallSid": redirect_call_sid, - "RedirectAccept": redirect_accept, + "RedirectAccept": serialize.boolean_to_string(redirect_accept), "RedirectUrl": redirect_url, "To": to, "From": from_, @@ -905,14 +913,18 @@ async def update_async( status_callback_event, lambda e: e ), "Timeout": timeout, - "Record": record, - "Muted": muted, + "Record": serialize.boolean_to_string(record), + "Muted": serialize.boolean_to_string(muted), "Beep": beep, - "StartConferenceOnEnter": start_conference_on_enter, - "EndConferenceOnExit": end_conference_on_exit, + "StartConferenceOnEnter": serialize.boolean_to_string( + start_conference_on_enter + ), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), "WaitUrl": wait_url, "WaitMethod": wait_method, - "EarlyMedia": early_media, + "EarlyMedia": serialize.boolean_to_string(early_media), "MaxParticipants": max_participants, "ConferenceStatusCallback": conference_status_callback, "ConferenceStatusCallbackMethod": conference_status_callback_method, @@ -933,8 +945,12 @@ async def update_async( dequeue_status_callback_event, lambda e: e ), "PostWorkActivitySid": post_work_activity_sid, - "EndConferenceOnCustomerExit": end_conference_on_customer_exit, - "BeepOnCustomerEntrance": beep_on_customer_entrance, + "EndConferenceOnCustomerExit": serialize.boolean_to_string( + end_conference_on_customer_exit + ), + "BeepOnCustomerEntrance": serialize.boolean_to_string( + beep_on_customer_entrance + ), "JitterBufferSize": jitter_buffer_size, } ) diff --git a/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py b/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py index 64f0c3afe9..f48ebb3a62 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -246,7 +246,7 @@ def update( data = values.of( { "Capacity": capacity, - "Available": available, + "Available": serialize.boolean_to_string(available), } ) @@ -280,7 +280,7 @@ async def update_async( data = values.of( { "Capacity": capacity, - "Available": available, + "Available": serialize.boolean_to_string(available), } ) diff --git a/twilio/rest/trunking/v1/trunk/__init__.py b/twilio/rest/trunking/v1/trunk/__init__.py index 935ce2718d..16125ead02 100644 --- a/twilio/rest/trunking/v1/trunk/__init__.py +++ b/twilio/rest/trunking/v1/trunk/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -387,8 +387,8 @@ def update( "DisasterRecoveryUrl": disaster_recovery_url, "DisasterRecoveryMethod": disaster_recovery_method, "TransferMode": transfer_mode, - "Secure": secure, - "CnamLookupEnabled": cnam_lookup_enabled, + "Secure": serialize.boolean_to_string(secure), + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "TransferCallerId": transfer_caller_id, } ) @@ -435,8 +435,8 @@ async def update_async( "DisasterRecoveryUrl": disaster_recovery_url, "DisasterRecoveryMethod": disaster_recovery_method, "TransferMode": transfer_mode, - "Secure": secure, - "CnamLookupEnabled": cnam_lookup_enabled, + "Secure": serialize.boolean_to_string(secure), + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "TransferCallerId": transfer_caller_id, } ) @@ -586,8 +586,8 @@ def create( "DisasterRecoveryUrl": disaster_recovery_url, "DisasterRecoveryMethod": disaster_recovery_method, "TransferMode": transfer_mode, - "Secure": secure, - "CnamLookupEnabled": cnam_lookup_enabled, + "Secure": serialize.boolean_to_string(secure), + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "TransferCallerId": transfer_caller_id, } ) @@ -635,8 +635,8 @@ async def create_async( "DisasterRecoveryUrl": disaster_recovery_url, "DisasterRecoveryMethod": disaster_recovery_method, "TransferMode": transfer_mode, - "Secure": secure, - "CnamLookupEnabled": cnam_lookup_enabled, + "Secure": serialize.boolean_to_string(secure), + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "TransferCallerId": transfer_caller_id, } ) diff --git a/twilio/rest/trunking/v1/trunk/origination_url.py b/twilio/rest/trunking/v1/trunk/origination_url.py index 426938995e..bcf0c5205f 100644 --- a/twilio/rest/trunking/v1/trunk/origination_url.py +++ b/twilio/rest/trunking/v1/trunk/origination_url.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -290,7 +290,7 @@ def update( { "Weight": weight, "Priority": priority, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "FriendlyName": friendly_name, "SipUrl": sip_url, } @@ -332,7 +332,7 @@ async def update_async( { "Weight": weight, "Priority": priority, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "FriendlyName": friendly_name, "SipUrl": sip_url, } @@ -424,7 +424,7 @@ def create( { "Weight": weight, "Priority": priority, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "FriendlyName": friendly_name, "SipUrl": sip_url, } @@ -464,7 +464,7 @@ async def create_async( { "Weight": weight, "Priority": priority, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "FriendlyName": friendly_name, "SipUrl": sip_url, } diff --git a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py index 264dd4ae31..b3ad6790ac 100644 --- a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -27,6 +27,13 @@ class BusinessIdentityType(object): ISV_RESELLER_OR_PARTNER = "isv_reseller_or_partner" UNKNOWN = "unknown" + class BusinessRegistrationAuthority(object): + UK_CRN = "UK:CRN" + US_EIN = "US:EIN" + CA_CBN = "CA:CBN" + AU_ACN = "AU:ACN" + OTHER = "Other" + class EndUserType(object): INDIVIDUAL = "Individual" BUSINESS = "Business" @@ -84,7 +91,10 @@ def create( business_identity_type: Union[ "ComplianceRegistrationInquiriesInstance.BusinessIdentityType", object ] = values.unset, - business_registration_authority: Union[str, object] = values.unset, + business_registration_authority: Union[ + "ComplianceRegistrationInquiriesInstance.BusinessRegistrationAuthority", + object, + ] = values.unset, business_legal_name: Union[str, object] = values.unset, notification_email: Union[str, object] = values.unset, accepted_notification_receipt: Union[bool, object] = values.unset, @@ -111,6 +121,12 @@ def create( use_address_as_emergency_address: Union[bool, object] = values.unset, file_name: Union[str, object] = values.unset, file: Union[str, object] = values.unset, + first_name: Union[str, object] = values.unset, + last_name: Union[str, object] = values.unset, + date_of_birth: Union[str, object] = values.unset, + individual_email: Union[str, object] = values.unset, + individual_phone: Union[str, object] = values.unset, + is_isv_embed: Union[bool, object] = values.unset, ) -> ComplianceRegistrationInquiriesInstance: """ Create the ComplianceRegistrationInquiriesInstance @@ -118,7 +134,7 @@ def create( :param end_user_type: :param phone_number_type: :param business_identity_type: - :param business_registration_authority: The authority that registered the business + :param business_registration_authority: :param business_legal_name: he name of the business or organization using the Tollfree number. :param notification_email: he email address to receive the notification about the verification result. :param accepted_notification_receipt: The email address to receive the notification about the verification result. @@ -145,6 +161,12 @@ def create( :param use_address_as_emergency_address: Use the business address as the emergency address :param file_name: The name of the verification document to upload :param file: The verification document to upload + :param first_name: The first name of the Individual User. + :param last_name: The last name of the Individual User. + :param date_of_birth: The date of birth of the Individual User. + :param individual_email: The email address of the Individual User. + :param individual_phone: The phone number of the Individual User. + :param is_isv_embed: Indicates if the inquiry is being started from an ISV embedded component. :returns: The created ComplianceRegistrationInquiriesInstance """ @@ -157,7 +179,9 @@ def create( "BusinessRegistrationAuthority": business_registration_authority, "BusinessLegalName": business_legal_name, "NotificationEmail": notification_email, - "AcceptedNotificationReceipt": accepted_notification_receipt, + "AcceptedNotificationReceipt": serialize.boolean_to_string( + accepted_notification_receipt + ), "BusinessRegistrationNumber": business_registration_number, "BusinessWebsiteUrl": business_website_url, "FriendlyName": friendly_name, @@ -178,9 +202,17 @@ def create( "EmergencyAddressSubdivision": emergency_address_subdivision, "EmergencyAddressPostalCode": emergency_address_postal_code, "EmergencyAddressCountryCode": emergency_address_country_code, - "UseAddressAsEmergencyAddress": use_address_as_emergency_address, + "UseAddressAsEmergencyAddress": serialize.boolean_to_string( + use_address_as_emergency_address + ), "FileName": file_name, "File": file, + "FirstName": first_name, + "LastName": last_name, + "DateOfBirth": date_of_birth, + "IndividualEmail": individual_email, + "IndividualPhone": individual_phone, + "IsIsvEmbed": serialize.boolean_to_string(is_isv_embed), } ) @@ -199,7 +231,10 @@ async def create_async( business_identity_type: Union[ "ComplianceRegistrationInquiriesInstance.BusinessIdentityType", object ] = values.unset, - business_registration_authority: Union[str, object] = values.unset, + business_registration_authority: Union[ + "ComplianceRegistrationInquiriesInstance.BusinessRegistrationAuthority", + object, + ] = values.unset, business_legal_name: Union[str, object] = values.unset, notification_email: Union[str, object] = values.unset, accepted_notification_receipt: Union[bool, object] = values.unset, @@ -226,6 +261,12 @@ async def create_async( use_address_as_emergency_address: Union[bool, object] = values.unset, file_name: Union[str, object] = values.unset, file: Union[str, object] = values.unset, + first_name: Union[str, object] = values.unset, + last_name: Union[str, object] = values.unset, + date_of_birth: Union[str, object] = values.unset, + individual_email: Union[str, object] = values.unset, + individual_phone: Union[str, object] = values.unset, + is_isv_embed: Union[bool, object] = values.unset, ) -> ComplianceRegistrationInquiriesInstance: """ Asynchronously create the ComplianceRegistrationInquiriesInstance @@ -233,7 +274,7 @@ async def create_async( :param end_user_type: :param phone_number_type: :param business_identity_type: - :param business_registration_authority: The authority that registered the business + :param business_registration_authority: :param business_legal_name: he name of the business or organization using the Tollfree number. :param notification_email: he email address to receive the notification about the verification result. :param accepted_notification_receipt: The email address to receive the notification about the verification result. @@ -260,6 +301,12 @@ async def create_async( :param use_address_as_emergency_address: Use the business address as the emergency address :param file_name: The name of the verification document to upload :param file: The verification document to upload + :param first_name: The first name of the Individual User. + :param last_name: The last name of the Individual User. + :param date_of_birth: The date of birth of the Individual User. + :param individual_email: The email address of the Individual User. + :param individual_phone: The phone number of the Individual User. + :param is_isv_embed: Indicates if the inquiry is being started from an ISV embedded component. :returns: The created ComplianceRegistrationInquiriesInstance """ @@ -272,7 +319,9 @@ async def create_async( "BusinessRegistrationAuthority": business_registration_authority, "BusinessLegalName": business_legal_name, "NotificationEmail": notification_email, - "AcceptedNotificationReceipt": accepted_notification_receipt, + "AcceptedNotificationReceipt": serialize.boolean_to_string( + accepted_notification_receipt + ), "BusinessRegistrationNumber": business_registration_number, "BusinessWebsiteUrl": business_website_url, "FriendlyName": friendly_name, @@ -293,9 +342,17 @@ async def create_async( "EmergencyAddressSubdivision": emergency_address_subdivision, "EmergencyAddressPostalCode": emergency_address_postal_code, "EmergencyAddressCountryCode": emergency_address_country_code, - "UseAddressAsEmergencyAddress": use_address_as_emergency_address, + "UseAddressAsEmergencyAddress": serialize.boolean_to_string( + use_address_as_emergency_address + ), "FileName": file_name, "File": file, + "FirstName": first_name, + "LastName": last_name, + "DateOfBirth": date_of_birth, + "IndividualEmail": individual_email, + "IndividualPhone": individual_phone, + "IsIsvEmbed": serialize.boolean_to_string(is_isv_embed), } ) diff --git a/twilio/rest/verify/v2/service/__init__.py b/twilio/rest/verify/v2/service/__init__.py index 374ecb3ef1..9e4d69d52b 100644 --- a/twilio/rest/verify/v2/service/__init__.py +++ b/twilio/rest/verify/v2/service/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -474,14 +474,18 @@ def update( { "FriendlyName": friendly_name, "CodeLength": code_length, - "LookupEnabled": lookup_enabled, - "SkipSmsToLandlines": skip_sms_to_landlines, - "DtmfInputRequired": dtmf_input_required, + "LookupEnabled": serialize.boolean_to_string(lookup_enabled), + "SkipSmsToLandlines": serialize.boolean_to_string( + skip_sms_to_landlines + ), + "DtmfInputRequired": serialize.boolean_to_string(dtmf_input_required), "TtsName": tts_name, - "Psd2Enabled": psd2_enabled, - "DoNotShareWarningEnabled": do_not_share_warning_enabled, - "CustomCodeEnabled": custom_code_enabled, - "Push.IncludeDate": push_include_date, + "Psd2Enabled": serialize.boolean_to_string(psd2_enabled), + "DoNotShareWarningEnabled": serialize.boolean_to_string( + do_not_share_warning_enabled + ), + "CustomCodeEnabled": serialize.boolean_to_string(custom_code_enabled), + "Push.IncludeDate": serialize.boolean_to_string(push_include_date), "Push.ApnCredentialSid": push_apn_credential_sid, "Push.FcmCredentialSid": push_fcm_credential_sid, "Totp.Issuer": totp_issuer, @@ -489,7 +493,9 @@ def update( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, - "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, + "VerifyEventSubscriptionEnabled": serialize.boolean_to_string( + verify_event_subscription_enabled + ), } ) @@ -550,14 +556,18 @@ async def update_async( { "FriendlyName": friendly_name, "CodeLength": code_length, - "LookupEnabled": lookup_enabled, - "SkipSmsToLandlines": skip_sms_to_landlines, - "DtmfInputRequired": dtmf_input_required, + "LookupEnabled": serialize.boolean_to_string(lookup_enabled), + "SkipSmsToLandlines": serialize.boolean_to_string( + skip_sms_to_landlines + ), + "DtmfInputRequired": serialize.boolean_to_string(dtmf_input_required), "TtsName": tts_name, - "Psd2Enabled": psd2_enabled, - "DoNotShareWarningEnabled": do_not_share_warning_enabled, - "CustomCodeEnabled": custom_code_enabled, - "Push.IncludeDate": push_include_date, + "Psd2Enabled": serialize.boolean_to_string(psd2_enabled), + "DoNotShareWarningEnabled": serialize.boolean_to_string( + do_not_share_warning_enabled + ), + "CustomCodeEnabled": serialize.boolean_to_string(custom_code_enabled), + "Push.IncludeDate": serialize.boolean_to_string(push_include_date), "Push.ApnCredentialSid": push_apn_credential_sid, "Push.FcmCredentialSid": push_fcm_credential_sid, "Totp.Issuer": totp_issuer, @@ -565,7 +575,9 @@ async def update_async( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, - "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, + "VerifyEventSubscriptionEnabled": serialize.boolean_to_string( + verify_event_subscription_enabled + ), } ) @@ -753,14 +765,18 @@ def create( { "FriendlyName": friendly_name, "CodeLength": code_length, - "LookupEnabled": lookup_enabled, - "SkipSmsToLandlines": skip_sms_to_landlines, - "DtmfInputRequired": dtmf_input_required, + "LookupEnabled": serialize.boolean_to_string(lookup_enabled), + "SkipSmsToLandlines": serialize.boolean_to_string( + skip_sms_to_landlines + ), + "DtmfInputRequired": serialize.boolean_to_string(dtmf_input_required), "TtsName": tts_name, - "Psd2Enabled": psd2_enabled, - "DoNotShareWarningEnabled": do_not_share_warning_enabled, - "CustomCodeEnabled": custom_code_enabled, - "Push.IncludeDate": push_include_date, + "Psd2Enabled": serialize.boolean_to_string(psd2_enabled), + "DoNotShareWarningEnabled": serialize.boolean_to_string( + do_not_share_warning_enabled + ), + "CustomCodeEnabled": serialize.boolean_to_string(custom_code_enabled), + "Push.IncludeDate": serialize.boolean_to_string(push_include_date), "Push.ApnCredentialSid": push_apn_credential_sid, "Push.FcmCredentialSid": push_fcm_credential_sid, "Totp.Issuer": totp_issuer, @@ -768,7 +784,9 @@ def create( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, - "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, + "VerifyEventSubscriptionEnabled": serialize.boolean_to_string( + verify_event_subscription_enabled + ), } ) @@ -830,14 +848,18 @@ async def create_async( { "FriendlyName": friendly_name, "CodeLength": code_length, - "LookupEnabled": lookup_enabled, - "SkipSmsToLandlines": skip_sms_to_landlines, - "DtmfInputRequired": dtmf_input_required, + "LookupEnabled": serialize.boolean_to_string(lookup_enabled), + "SkipSmsToLandlines": serialize.boolean_to_string( + skip_sms_to_landlines + ), + "DtmfInputRequired": serialize.boolean_to_string(dtmf_input_required), "TtsName": tts_name, - "Psd2Enabled": psd2_enabled, - "DoNotShareWarningEnabled": do_not_share_warning_enabled, - "CustomCodeEnabled": custom_code_enabled, - "Push.IncludeDate": push_include_date, + "Psd2Enabled": serialize.boolean_to_string(psd2_enabled), + "DoNotShareWarningEnabled": serialize.boolean_to_string( + do_not_share_warning_enabled + ), + "CustomCodeEnabled": serialize.boolean_to_string(custom_code_enabled), + "Push.IncludeDate": serialize.boolean_to_string(push_include_date), "Push.ApnCredentialSid": push_apn_credential_sid, "Push.FcmCredentialSid": push_fcm_credential_sid, "Totp.Issuer": totp_issuer, @@ -845,7 +867,9 @@ async def create_async( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, - "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, + "VerifyEventSubscriptionEnabled": serialize.boolean_to_string( + verify_event_subscription_enabled + ), } ) diff --git a/twilio/rest/video/v1/composition.py b/twilio/rest/video/v1/composition.py index 64ee0b2ce8..30aa33fff8 100644 --- a/twilio/rest/video/v1/composition.py +++ b/twilio/rest/video/v1/composition.py @@ -325,7 +325,7 @@ def create( "Format": format, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "Trim": trim, + "Trim": serialize.boolean_to_string(trim), } ) @@ -377,7 +377,7 @@ async def create_async( "Format": format, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "Trim": trim, + "Trim": serialize.boolean_to_string(trim), } ) diff --git a/twilio/rest/video/v1/composition_hook.py b/twilio/rest/video/v1/composition_hook.py index f6156e82ff..027a27f740 100644 --- a/twilio/rest/video/v1/composition_hook.py +++ b/twilio/rest/video/v1/composition_hook.py @@ -336,13 +336,13 @@ def update( data = values.of( { "FriendlyName": friendly_name, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "VideoLayout": serialize.object(video_layout), "AudioSources": serialize.map(audio_sources, lambda e: e), "AudioSourcesExcluded": serialize.map( audio_sources_excluded, lambda e: e ), - "Trim": trim, + "Trim": serialize.boolean_to_string(trim), "Format": format, "Resolution": resolution, "StatusCallback": status_callback, @@ -392,13 +392,13 @@ async def update_async( data = values.of( { "FriendlyName": friendly_name, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "VideoLayout": serialize.object(video_layout), "AudioSources": serialize.map(audio_sources, lambda e: e), "AudioSourcesExcluded": serialize.map( audio_sources_excluded, lambda e: e ), - "Trim": trim, + "Trim": serialize.boolean_to_string(trim), "Format": format, "Resolution": resolution, "StatusCallback": status_callback, @@ -491,7 +491,7 @@ def create( data = values.of( { "FriendlyName": friendly_name, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "VideoLayout": serialize.object(video_layout), "AudioSources": serialize.map(audio_sources, lambda e: e), "AudioSourcesExcluded": serialize.map( @@ -501,7 +501,7 @@ def create( "Format": format, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "Trim": trim, + "Trim": serialize.boolean_to_string(trim), } ) @@ -546,7 +546,7 @@ async def create_async( data = values.of( { "FriendlyName": friendly_name, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "VideoLayout": serialize.object(video_layout), "AudioSources": serialize.map(audio_sources, lambda e: e), "AudioSourcesExcluded": serialize.map( @@ -556,7 +556,7 @@ async def create_async( "Format": format, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "Trim": trim, + "Trim": serialize.boolean_to_string(trim), } ) @@ -749,7 +749,7 @@ def page( """ data = values.of( { - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "DateCreatedAfter": serialize.iso8601_datetime(date_created_after), "DateCreatedBefore": serialize.iso8601_datetime(date_created_before), "FriendlyName": friendly_name, @@ -788,7 +788,7 @@ async def page_async( """ data = values.of( { - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "DateCreatedAfter": serialize.iso8601_datetime(date_created_after), "DateCreatedBefore": serialize.iso8601_datetime(date_created_before), "FriendlyName": friendly_name, diff --git a/twilio/rest/video/v1/composition_settings.py b/twilio/rest/video/v1/composition_settings.py index 7082866b32..366ec727cf 100644 --- a/twilio/rest/video/v1/composition_settings.py +++ b/twilio/rest/video/v1/composition_settings.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -187,8 +187,8 @@ def create( "AwsCredentialsSid": aws_credentials_sid, "EncryptionKeySid": encryption_key_sid, "AwsS3Url": aws_s3_url, - "AwsStorageEnabled": aws_storage_enabled, - "EncryptionEnabled": encryption_enabled, + "AwsStorageEnabled": serialize.boolean_to_string(aws_storage_enabled), + "EncryptionEnabled": serialize.boolean_to_string(encryption_enabled), } ) @@ -223,8 +223,8 @@ async def create_async( "AwsCredentialsSid": aws_credentials_sid, "EncryptionKeySid": encryption_key_sid, "AwsS3Url": aws_s3_url, - "AwsStorageEnabled": aws_storage_enabled, - "EncryptionEnabled": encryption_enabled, + "AwsStorageEnabled": serialize.boolean_to_string(aws_storage_enabled), + "EncryptionEnabled": serialize.boolean_to_string(encryption_enabled), } ) diff --git a/twilio/rest/video/v1/recording_settings.py b/twilio/rest/video/v1/recording_settings.py index d0d6e5ebb8..3895b9d4ba 100644 --- a/twilio/rest/video/v1/recording_settings.py +++ b/twilio/rest/video/v1/recording_settings.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -187,8 +187,8 @@ def create( "AwsCredentialsSid": aws_credentials_sid, "EncryptionKeySid": encryption_key_sid, "AwsS3Url": aws_s3_url, - "AwsStorageEnabled": aws_storage_enabled, - "EncryptionEnabled": encryption_enabled, + "AwsStorageEnabled": serialize.boolean_to_string(aws_storage_enabled), + "EncryptionEnabled": serialize.boolean_to_string(encryption_enabled), } ) @@ -223,8 +223,8 @@ async def create_async( "AwsCredentialsSid": aws_credentials_sid, "EncryptionKeySid": encryption_key_sid, "AwsS3Url": aws_s3_url, - "AwsStorageEnabled": aws_storage_enabled, - "EncryptionEnabled": encryption_enabled, + "AwsStorageEnabled": serialize.boolean_to_string(aws_storage_enabled), + "EncryptionEnabled": serialize.boolean_to_string(encryption_enabled), } ) diff --git a/twilio/rest/video/v1/room/__init__.py b/twilio/rest/video/v1/room/__init__.py index d787c9896e..a8ffdb895c 100644 --- a/twilio/rest/video/v1/room/__init__.py +++ b/twilio/rest/video/v1/room/__init__.py @@ -437,21 +437,23 @@ def create( data = values.of( { - "EnableTurn": enable_turn, + "EnableTurn": serialize.boolean_to_string(enable_turn), "Type": type, "UniqueName": unique_name, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "MaxParticipants": max_participants, - "RecordParticipantsOnConnect": record_participants_on_connect, + "RecordParticipantsOnConnect": serialize.boolean_to_string( + record_participants_on_connect + ), "VideoCodecs": serialize.map(video_codecs, lambda e: e), "MediaRegion": media_region, "RecordingRules": serialize.object(recording_rules), - "AudioOnly": audio_only, + "AudioOnly": serialize.boolean_to_string(audio_only), "MaxParticipantDuration": max_participant_duration, "EmptyRoomTimeout": empty_room_timeout, "UnusedRoomTimeout": unused_room_timeout, - "LargeRoom": large_room, + "LargeRoom": serialize.boolean_to_string(large_room), } ) @@ -505,21 +507,23 @@ async def create_async( data = values.of( { - "EnableTurn": enable_turn, + "EnableTurn": serialize.boolean_to_string(enable_turn), "Type": type, "UniqueName": unique_name, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "MaxParticipants": max_participants, - "RecordParticipantsOnConnect": record_participants_on_connect, + "RecordParticipantsOnConnect": serialize.boolean_to_string( + record_participants_on_connect + ), "VideoCodecs": serialize.map(video_codecs, lambda e: e), "MediaRegion": media_region, "RecordingRules": serialize.object(recording_rules), - "AudioOnly": audio_only, + "AudioOnly": serialize.boolean_to_string(audio_only), "MaxParticipantDuration": max_participant_duration, "EmptyRoomTimeout": empty_room_timeout, "UnusedRoomTimeout": unused_room_timeout, - "LargeRoom": large_room, + "LargeRoom": serialize.boolean_to_string(large_room), } ) diff --git a/twilio/rest/voice/v1/byoc_trunk.py b/twilio/rest/voice/v1/byoc_trunk.py index 1a8f60984d..a85cae660a 100644 --- a/twilio/rest/voice/v1/byoc_trunk.py +++ b/twilio/rest/voice/v1/byoc_trunk.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -335,7 +335,7 @@ def update( "VoiceFallbackMethod": voice_fallback_method, "StatusCallbackUrl": status_callback_url, "StatusCallbackMethod": status_callback_method, - "CnamLookupEnabled": cnam_lookup_enabled, + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "ConnectionPolicySid": connection_policy_sid, "FromDomainSid": from_domain_sid, } @@ -387,7 +387,7 @@ async def update_async( "VoiceFallbackMethod": voice_fallback_method, "StatusCallbackUrl": status_callback_url, "StatusCallbackMethod": status_callback_method, - "CnamLookupEnabled": cnam_lookup_enabled, + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "ConnectionPolicySid": connection_policy_sid, "FromDomainSid": from_domain_sid, } @@ -482,7 +482,7 @@ def create( "VoiceFallbackMethod": voice_fallback_method, "StatusCallbackUrl": status_callback_url, "StatusCallbackMethod": status_callback_method, - "CnamLookupEnabled": cnam_lookup_enabled, + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "ConnectionPolicySid": connection_policy_sid, "FromDomainSid": from_domain_sid, } @@ -535,7 +535,7 @@ async def create_async( "VoiceFallbackMethod": voice_fallback_method, "StatusCallbackUrl": status_callback_url, "StatusCallbackMethod": status_callback_method, - "CnamLookupEnabled": cnam_lookup_enabled, + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "ConnectionPolicySid": connection_policy_sid, "FromDomainSid": from_domain_sid, } diff --git a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py index d1f8a41524..2fa490880a 100644 --- a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py +++ b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -294,7 +294,7 @@ def update( "Target": target, "Priority": priority, "Weight": weight, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) @@ -336,7 +336,7 @@ async def update_async( "Target": target, "Priority": priority, "Weight": weight, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) @@ -432,7 +432,7 @@ def create( "FriendlyName": friendly_name, "Priority": priority, "Weight": weight, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) @@ -474,7 +474,7 @@ async def create_async( "FriendlyName": friendly_name, "Priority": priority, "Weight": weight, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) diff --git a/twilio/rest/voice/v1/dialing_permissions/country/__init__.py b/twilio/rest/voice/v1/dialing_permissions/country/__init__.py index 4f694f41b0..2b9285c112 100644 --- a/twilio/rest/voice/v1/dialing_permissions/country/__init__.py +++ b/twilio/rest/voice/v1/dialing_permissions/country/__init__.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -436,9 +436,15 @@ def page( "IsoCode": iso_code, "Continent": continent, "CountryCode": country_code, - "LowRiskNumbersEnabled": low_risk_numbers_enabled, - "HighRiskSpecialNumbersEnabled": high_risk_special_numbers_enabled, - "HighRiskTollfraudNumbersEnabled": high_risk_tollfraud_numbers_enabled, + "LowRiskNumbersEnabled": serialize.boolean_to_string( + low_risk_numbers_enabled + ), + "HighRiskSpecialNumbersEnabled": serialize.boolean_to_string( + high_risk_special_numbers_enabled + ), + "HighRiskTollfraudNumbersEnabled": serialize.boolean_to_string( + high_risk_tollfraud_numbers_enabled + ), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -481,9 +487,15 @@ async def page_async( "IsoCode": iso_code, "Continent": continent, "CountryCode": country_code, - "LowRiskNumbersEnabled": low_risk_numbers_enabled, - "HighRiskSpecialNumbersEnabled": high_risk_special_numbers_enabled, - "HighRiskTollfraudNumbersEnabled": high_risk_tollfraud_numbers_enabled, + "LowRiskNumbersEnabled": serialize.boolean_to_string( + low_risk_numbers_enabled + ), + "HighRiskSpecialNumbersEnabled": serialize.boolean_to_string( + high_risk_special_numbers_enabled + ), + "HighRiskTollfraudNumbersEnabled": serialize.boolean_to_string( + high_risk_tollfraud_numbers_enabled + ), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/voice/v1/dialing_permissions/settings.py b/twilio/rest/voice/v1/dialing_permissions/settings.py index 6ede5e3a6f..20d845673a 100644 --- a/twilio/rest/voice/v1/dialing_permissions/settings.py +++ b/twilio/rest/voice/v1/dialing_permissions/settings.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -166,7 +166,9 @@ def update( """ data = values.of( { - "DialingPermissionsInheritance": dialing_permissions_inheritance, + "DialingPermissionsInheritance": serialize.boolean_to_string( + dialing_permissions_inheritance + ), } ) @@ -190,7 +192,9 @@ async def update_async( """ data = values.of( { - "DialingPermissionsInheritance": dialing_permissions_inheritance, + "DialingPermissionsInheritance": serialize.boolean_to_string( + dialing_permissions_inheritance + ), } ) diff --git a/twilio/rest/wireless/v1/command.py b/twilio/rest/wireless/v1/command.py index cb33e1d397..f310db8918 100644 --- a/twilio/rest/wireless/v1/command.py +++ b/twilio/rest/wireless/v1/command.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -303,7 +303,9 @@ def create( "CallbackUrl": callback_url, "CommandMode": command_mode, "IncludeSid": include_sid, - "DeliveryReceiptRequested": delivery_receipt_requested, + "DeliveryReceiptRequested": serialize.boolean_to_string( + delivery_receipt_requested + ), } ) @@ -347,7 +349,9 @@ async def create_async( "CallbackUrl": callback_url, "CommandMode": command_mode, "IncludeSid": include_sid, - "DeliveryReceiptRequested": delivery_receipt_requested, + "DeliveryReceiptRequested": serialize.boolean_to_string( + delivery_receipt_requested + ), } ) diff --git a/twilio/rest/wireless/v1/rate_plan.py b/twilio/rest/wireless/v1/rate_plan.py index 2bc8939257..0ee1e205a2 100644 --- a/twilio/rest/wireless/v1/rate_plan.py +++ b/twilio/rest/wireless/v1/rate_plan.py @@ -391,12 +391,14 @@ def create( { "UniqueName": unique_name, "FriendlyName": friendly_name, - "DataEnabled": data_enabled, + "DataEnabled": serialize.boolean_to_string(data_enabled), "DataLimit": data_limit, "DataMetering": data_metering, - "MessagingEnabled": messaging_enabled, - "VoiceEnabled": voice_enabled, - "NationalRoamingEnabled": national_roaming_enabled, + "MessagingEnabled": serialize.boolean_to_string(messaging_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "NationalRoamingEnabled": serialize.boolean_to_string( + national_roaming_enabled + ), "InternationalRoaming": serialize.map( international_roaming, lambda e: e ), @@ -449,12 +451,14 @@ async def create_async( { "UniqueName": unique_name, "FriendlyName": friendly_name, - "DataEnabled": data_enabled, + "DataEnabled": serialize.boolean_to_string(data_enabled), "DataLimit": data_limit, "DataMetering": data_metering, - "MessagingEnabled": messaging_enabled, - "VoiceEnabled": voice_enabled, - "NationalRoamingEnabled": national_roaming_enabled, + "MessagingEnabled": serialize.boolean_to_string(messaging_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "NationalRoamingEnabled": serialize.boolean_to_string( + national_roaming_enabled + ), "InternationalRoaming": serialize.map( international_roaming, lambda e: e ), From e4285a40a798fce3a0894b1f7e40bb0c3e8955ef Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 27 Feb 2024 14:14:41 +0000 Subject: [PATCH 5/5] Release 9.0.0 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index bb6ca3cecf..295f4e3498 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="8.13.0", + version="9.0.0", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 1d1288358e..77a8b581b3 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("8", "13", "0") +__version_info__ = ("9", "0", "0") __version__ = ".".join(__version_info__)