diff --git a/examples/python/tests/unit/credential_test.py b/examples/python/tests/unit/credential_test.py index b37f46346..d8b0cc6e5 100644 --- a/examples/python/tests/unit/credential_test.py +++ b/examples/python/tests/unit/credential_test.py @@ -32,7 +32,7 @@ def test_create_credentials(self, mock_request): request_args = self.generic_request_args request_args["data"] = { "TestString": "abc", - "TestBoolean": True, + "TestBoolean": "true", "TestAnyArray": ['{"any": "thing"}', '{"another": "thing"}'], "TestAnyType": '{"type": "any"}', } @@ -48,7 +48,7 @@ def test_update_credentials(self, mock_request): test_boolean=False, test_string="new string" ) request_args = self.generic_request_args - request_args["data"] = {"TestString": "new string", "TestBoolean": False} + request_args["data"] = {"TestString": "new string", "TestBoolean": "false"} mock_request.assert_called_once_with( "POST", "http://flex-api.twilio.com/v1/Credentials/AWS/123", **request_args @@ -113,7 +113,7 @@ async def test_async_create_credentials(self, mock_request): request_args = self.generic_request_args request_args["data"] = { "TestString": "abc", - "TestBoolean": True, + "TestBoolean": "true", "TestAnyArray": ['{"any": "thing"}', '{"another": "thing"}'], "TestAnyType": '{"type": "any"}', } @@ -129,7 +129,7 @@ async def test_async_update_credentials(self, mock_request): test_boolean=False, test_string="new string" ) request_args = self.generic_request_args - request_args["data"] = {"TestString": "new string", "TestBoolean": False} + request_args["data"] = {"TestString": "new string", "TestBoolean": "false"} mock_request.assert_called_once_with( "POST", "http://flex-api.twilio.com/v1/Credentials/AWS/123", **request_args diff --git a/examples/python/twilio/rest/flex_api/v1/credential/aws/__init__.py b/examples/python/twilio/rest/flex_api/v1/credential/aws/__init__.py index f001230a7..14bb9647d 100644 --- a/examples/python/twilio/rest/flex_api/v1/credential/aws/__init__.py +++ b/examples/python/twilio/rest/flex_api/v1/credential/aws/__init__.py @@ -14,7 +14,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 @@ -249,7 +249,7 @@ def update( data = values.of( { "TestString": test_string, - "TestBoolean": test_boolean, + "TestBoolean": serialize.boolean_to_string(test_boolean), } ) @@ -277,7 +277,7 @@ async def update_async( data = values.of( { "TestString": test_string, - "TestBoolean": test_boolean, + "TestBoolean": serialize.boolean_to_string(test_boolean), } ) diff --git a/examples/python/twilio/rest/flex_api/v1/credential/new_credentials.py b/examples/python/twilio/rest/flex_api/v1/credential/new_credentials.py index 16cd67548..0d43e41a2 100644 --- a/examples/python/twilio/rest/flex_api/v1/credential/new_credentials.py +++ b/examples/python/twilio/rest/flex_api/v1/credential/new_credentials.py @@ -117,7 +117,7 @@ def create( data = values.of( { "TestString": test_string, - "TestBoolean": test_boolean, + "TestBoolean": serialize.boolean_to_string(test_boolean), "TestInteger": test_integer, "TestNumber": test_number, "TestNumberFloat": test_number_float, @@ -195,7 +195,7 @@ async def create_async( data = values.of( { "TestString": test_string, - "TestBoolean": test_boolean, + "TestBoolean": serialize.boolean_to_string(test_boolean), "TestInteger": test_integer, "TestNumber": test_number, "TestNumberFloat": test_number_float, diff --git a/src/main/resources/config/python.json b/src/main/resources/config/python.json index 6d1034355..066c4fc94 100644 --- a/src/main/resources/config/python.json +++ b/src/main/resources/config/python.json @@ -38,7 +38,8 @@ "date_time": "serialize.iso8601_datetime({value})", "date_or_time": "serialize.iso8601_datetime({value})", "date_time_inequality": "serialize.iso8601_datetime({value})", - "prefixed_collapsible_map": "serialize.prefixed_collapsible_map({value}, {trait})" + "prefixed_collapsible_map": "serialize.prefixed_collapsible_map({value}, {trait})", + "boolean": "serialize.boolean_to_string({value})" }, "deserialize": {