diff --git a/CHANGES.md b/CHANGES.md index 1dfa5043a..b76a6331b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,30 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-06-18] Version 9.2.0 +-------------------------- +**Library - Chore** +- [PR #796](https://github.com/twilio/twilio-python/pull/796): adding contentType in post and put. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Events** +- Add `status` and `documentation_url` to Event Types + +**Lookups** +- Removed unused `fraud` lookups in V1 only to facilitate rest proxy migration + +**Numbers** +- Add date_created field to the Get Port In Request API +- Rename the `status_last_time_updated_timestamp` field to `last_updated` in the Get Port In Phone Number API **(breaking change)** +- Add Rejection reason and rejection reason code to the Get Port In Phone Number API +- Remove the carrier information from the Portability API + +**Proxy** +- Change property `type` from enum to ienum + +**Trusthub** +- Add skipMessagingUseCase field in compliance_tollfree_inquiry. + + [2024-06-06] Version 9.1.1 -------------------------- **Api** diff --git a/twilio/rest/accounts/v1/credential/aws.py b/twilio/rest/accounts/v1/credential/aws.py index ab7562092..05d92755c 100644 --- a/twilio/rest/accounts/v1/credential/aws.py +++ b/twilio/rest/accounts/v1/credential/aws.py @@ -330,11 +330,10 @@ def create( "AccountSid": account_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AwsInstance(self._version, payload) @@ -362,11 +361,10 @@ async def create_async( "AccountSid": account_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AwsInstance(self._version, payload) diff --git a/twilio/rest/accounts/v1/credential/public_key.py b/twilio/rest/accounts/v1/credential/public_key.py index 09018d1d2..ec2a1f866 100644 --- a/twilio/rest/accounts/v1/credential/public_key.py +++ b/twilio/rest/accounts/v1/credential/public_key.py @@ -334,11 +334,10 @@ def create( "AccountSid": account_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PublicKeyInstance(self._version, payload) @@ -366,11 +365,10 @@ async def create_async( "AccountSid": account_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PublicKeyInstance(self._version, payload) diff --git a/twilio/rest/accounts/v1/safelist.py b/twilio/rest/accounts/v1/safelist.py index ce5672cae..51f00fd8c 100644 --- a/twilio/rest/accounts/v1/safelist.py +++ b/twilio/rest/accounts/v1/safelist.py @@ -69,11 +69,10 @@ def create(self, phone_number: str) -> SafelistInstance: "PhoneNumber": phone_number, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SafelistInstance(self._version, payload) @@ -92,11 +91,10 @@ async def create_async(self, phone_number: str) -> SafelistInstance: "PhoneNumber": phone_number, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SafelistInstance(self._version, payload) @@ -108,13 +106,16 @@ def delete(self, phone_number: Union[str, object] = values.unset) -> bool: :param phone_number: The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: True if delete succeeds, False otherwise """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { "PhoneNumber": phone_number, } ) - return self._version.delete(method="DELETE", uri=self._uri, params=params) + return self._version.delete( + method="DELETE", uri=self._uri, headers=headers, params=params + ) async def delete_async( self, phone_number: Union[str, object] = values.unset @@ -125,6 +126,7 @@ async def delete_async( :param phone_number: The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: True if delete succeeds, False otherwise """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { @@ -132,7 +134,7 @@ async def delete_async( } ) return await self._version.delete_async( - method="DELETE", uri=self._uri, params=params + method="DELETE", uri=self._uri, headers=headers, params=params ) def fetch( @@ -144,6 +146,7 @@ def fetch( :param phone_number: The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: The fetched SafelistInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { @@ -151,7 +154,9 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=params) + payload = self._version.fetch( + method="GET", uri=self._uri, headers=headers, params=params + ) return SafelistInstance(self._version, payload) @@ -164,6 +169,7 @@ async def fetch_async( :param phone_number: The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: The fetched SafelistInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { @@ -172,7 +178,7 @@ async def fetch_async( ) payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=params + method="GET", uri=self._uri, headers=headers, params=params ) return SafelistInstance(self._version, payload) diff --git a/twilio/rest/api/v2010/account/__init__.py b/twilio/rest/api/v2010/account/__init__.py index adf2458f2..dc0c53c9c 100644 --- a/twilio/rest/api/v2010/account/__init__.py +++ b/twilio/rest/api/v2010/account/__init__.py @@ -830,11 +830,10 @@ def create( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountInstance(self._version, payload) @@ -855,11 +854,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountInstance(self._version, payload) diff --git a/twilio/rest/api/v2010/account/address/__init__.py b/twilio/rest/api/v2010/account/address/__init__.py index fd7774710..36ee8f223 100644 --- a/twilio/rest/api/v2010/account/address/__init__.py +++ b/twilio/rest/api/v2010/account/address/__init__.py @@ -529,11 +529,10 @@ def create( "StreetSecondary": street_secondary, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AddressInstance( @@ -584,11 +583,10 @@ async def create_async( "StreetSecondary": street_secondary, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AddressInstance( diff --git a/twilio/rest/api/v2010/account/application.py b/twilio/rest/api/v2010/account/application.py index a3b11f028..d1e50c5f0 100644 --- a/twilio/rest/api/v2010/account/application.py +++ b/twilio/rest/api/v2010/account/application.py @@ -636,11 +636,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ApplicationInstance( @@ -713,11 +712,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ApplicationInstance( diff --git a/twilio/rest/api/v2010/account/balance.py b/twilio/rest/api/v2010/account/balance.py index 0e90cdaae..97c7b3303 100644 --- a/twilio/rest/api/v2010/account/balance.py +++ b/twilio/rest/api/v2010/account/balance.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -72,8 +73,9 @@ def fetch(self) -> BalanceInstance: :returns: The fetched BalanceInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = self._version.fetch(method="GET", uri=self._uri) + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return BalanceInstance( self._version, payload, account_sid=self._solution["account_sid"] @@ -86,8 +88,11 @@ async def fetch_async(self) -> BalanceInstance: :returns: The fetched BalanceInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = await self._version.fetch_async(method="GET", uri=self._uri) + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) return BalanceInstance( self._version, payload, account_sid=self._solution["account_sid"] diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index 2ba343f56..fa8e40707 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -65,7 +65,7 @@ class UpdateStatus(object): :ivar start_time: The start time of the call, given as UTC in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call has not yet been dialed. :ivar end_time: The time the call ended, given as UTC in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call did not complete successfully. :ivar duration: The length of the call in seconds. This value is empty for busy, failed, unanswered, or ongoing calls. - :ivar price: The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available. + :ivar price: The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available. The price associated with a call only reflects the charge for connectivity. Charges for other call-related features such as Answering Machine Detection, Text-To-Speech, and SIP REFER are not included in this value. :ivar price_unit: The currency in which `Price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g., `USD`, `EUR`, `JPY`). Always capitalized for calls. :ivar direction: A string describing the direction of the call. Can be: `inbound` for inbound calls, `outbound-api` for calls initiated via the REST API or `outbound-dial` for calls initiated by a `` verb. Using [Elastic SIP Trunking](https://www.twilio.com/docs/sip-trunking), the values can be [`trunking-terminating`](https://www.twilio.com/docs/sip-trunking#termination) for outgoing calls from your communications infrastructure to the PSTN or [`trunking-originating`](https://www.twilio.com/docs/sip-trunking#origination) for incoming calls to your communications infrastructure from the PSTN. :ivar answered_by: Either `human` or `machine` if this call was initiated with answering machine detection. Empty otherwise. @@ -807,11 +807,10 @@ def create( "ApplicationSid": application_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CallInstance( @@ -941,11 +940,10 @@ async def create_async( "ApplicationSid": application_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CallInstance( diff --git a/twilio/rest/api/v2010/account/call/payment.py b/twilio/rest/api/v2010/account/call/payment.py index 08619588d..00f76be81 100644 --- a/twilio/rest/api/v2010/account/call/payment.py +++ b/twilio/rest/api/v2010/account/call/payment.py @@ -362,11 +362,10 @@ def create( "ValidCardTypes": valid_card_types, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PaymentInstance( @@ -440,11 +439,10 @@ async def create_async( "ValidCardTypes": valid_card_types, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PaymentInstance( diff --git a/twilio/rest/api/v2010/account/call/recording.py b/twilio/rest/api/v2010/account/call/recording.py index b9653c4b5..71158a2fe 100644 --- a/twilio/rest/api/v2010/account/call/recording.py +++ b/twilio/rest/api/v2010/account/call/recording.py @@ -454,11 +454,10 @@ def create( "RecordingTrack": recording_track, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RecordingInstance( @@ -502,11 +501,10 @@ async def create_async( "RecordingTrack": recording_track, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RecordingInstance( diff --git a/twilio/rest/api/v2010/account/call/siprec.py b/twilio/rest/api/v2010/account/call/siprec.py index bcb537071..28a0734e1 100644 --- a/twilio/rest/api/v2010/account/call/siprec.py +++ b/twilio/rest/api/v2010/account/call/siprec.py @@ -861,11 +861,10 @@ def create( "Parameter99.Value": parameter99_value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SiprecInstance( @@ -1498,11 +1497,10 @@ async def create_async( "Parameter99.Value": parameter99_value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SiprecInstance( diff --git a/twilio/rest/api/v2010/account/call/stream.py b/twilio/rest/api/v2010/account/call/stream.py index 3975f52d4..b3fa197bf 100644 --- a/twilio/rest/api/v2010/account/call/stream.py +++ b/twilio/rest/api/v2010/account/call/stream.py @@ -863,11 +863,10 @@ def create( "Parameter99.Value": parameter99_value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return StreamInstance( @@ -1500,11 +1499,10 @@ async def create_async( "Parameter99.Value": parameter99_value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return StreamInstance( diff --git a/twilio/rest/api/v2010/account/call/user_defined_message.py b/twilio/rest/api/v2010/account/call/user_defined_message.py index 0e9d1f049..4b4338371 100644 --- a/twilio/rest/api/v2010/account/call/user_defined_message.py +++ b/twilio/rest/api/v2010/account/call/user_defined_message.py @@ -98,11 +98,10 @@ def create( "IdempotencyKey": idempotency_key, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserDefinedMessageInstance( @@ -130,11 +129,10 @@ async def create_async( "IdempotencyKey": idempotency_key, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserDefinedMessageInstance( diff --git a/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py b/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py index a0b7c1833..677042bd7 100644 --- a/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py +++ b/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py @@ -206,11 +206,10 @@ def create( "Method": method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserDefinedMessageSubscriptionInstance( @@ -243,11 +242,10 @@ async def create_async( "Method": method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserDefinedMessageSubscriptionInstance( diff --git a/twilio/rest/api/v2010/account/conference/participant.py b/twilio/rest/api/v2010/account/conference/participant.py index 2c7ae5932..3706cd24f 100644 --- a/twilio/rest/api/v2010/account/conference/participant.py +++ b/twilio/rest/api/v2010/account/conference/participant.py @@ -701,11 +701,10 @@ def create( "CallToken": call_token, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ParticipantInstance( @@ -887,11 +886,10 @@ async def create_async( "CallToken": call_token, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ParticipantInstance( 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 6fa4748b6..d1001a7ca 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py @@ -845,11 +845,10 @@ def create( "AreaCode": area_code, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IncomingPhoneNumberInstance( @@ -948,11 +947,10 @@ async def create_async( "AreaCode": area_code, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IncomingPhoneNumberInstance( diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py index 12c6f961e..a6ced8285 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py @@ -320,11 +320,10 @@ def create(self, installed_add_on_sid: str) -> AssignedAddOnInstance: "InstalledAddOnSid": installed_add_on_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AssignedAddOnInstance( @@ -348,11 +347,10 @@ async def create_async(self, installed_add_on_sid: str) -> AssignedAddOnInstance "InstalledAddOnSid": installed_add_on_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AssignedAddOnInstance( 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 454872032..ca7baa855 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/local.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/local.py @@ -279,11 +279,10 @@ def create( "BundleSid": bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return LocalInstance( @@ -377,11 +376,10 @@ async def create_async( "BundleSid": bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return LocalInstance( 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 6147d4bfe..830897b17 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py @@ -281,11 +281,10 @@ def create( "BundleSid": bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MobileInstance( @@ -381,11 +380,10 @@ async def create_async( "BundleSid": bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MobileInstance( 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 806b7c050..8625e318c 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 @@ -281,11 +281,10 @@ def create( "BundleSid": bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TollFreeInstance( @@ -381,11 +380,10 @@ async def create_async( "BundleSid": bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TollFreeInstance( diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index ff0ed8561..7eb11d388 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -560,11 +560,10 @@ def create( "ContentSid": content_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( @@ -658,11 +657,10 @@ async def create_async( "ContentSid": content_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( diff --git a/twilio/rest/api/v2010/account/message/feedback.py b/twilio/rest/api/v2010/account/message/feedback.py index 2ccce06a5..797c9a733 100644 --- a/twilio/rest/api/v2010/account/message/feedback.py +++ b/twilio/rest/api/v2010/account/message/feedback.py @@ -111,11 +111,10 @@ def create( "Outcome": outcome, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FeedbackInstance( @@ -141,11 +140,10 @@ async def create_async( "Outcome": outcome, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FeedbackInstance( diff --git a/twilio/rest/api/v2010/account/new_key.py b/twilio/rest/api/v2010/account/new_key.py index 015249ddf..fcefed5b6 100644 --- a/twilio/rest/api/v2010/account/new_key.py +++ b/twilio/rest/api/v2010/account/new_key.py @@ -91,11 +91,10 @@ def create( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NewKeyInstance( @@ -118,11 +117,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NewKeyInstance( diff --git a/twilio/rest/api/v2010/account/new_signing_key.py b/twilio/rest/api/v2010/account/new_signing_key.py index 6bfa32324..bb9b0f2e2 100644 --- a/twilio/rest/api/v2010/account/new_signing_key.py +++ b/twilio/rest/api/v2010/account/new_signing_key.py @@ -91,11 +91,10 @@ def create( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NewSigningKeyInstance( @@ -118,11 +117,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NewSigningKeyInstance( diff --git a/twilio/rest/api/v2010/account/queue/__init__.py b/twilio/rest/api/v2010/account/queue/__init__.py index 4e6c87baa..4031ba819 100644 --- a/twilio/rest/api/v2010/account/queue/__init__.py +++ b/twilio/rest/api/v2010/account/queue/__init__.py @@ -405,11 +405,10 @@ def create( "MaxSize": max_size, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return QueueInstance( @@ -434,11 +433,10 @@ async def create_async( "MaxSize": max_size, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return QueueInstance( diff --git a/twilio/rest/api/v2010/account/recording/__init__.py b/twilio/rest/api/v2010/account/recording/__init__.py index bc1ddccb7..1766600ec 100644 --- a/twilio/rest/api/v2010/account/recording/__init__.py +++ b/twilio/rest/api/v2010/account/recording/__init__.py @@ -57,7 +57,7 @@ class Status(object): :ivar price: The one-time cost of creating the recording in the `price_unit` currency. :ivar price_unit: The currency used in the `price` property. Example: `USD`. :ivar status: - :ivar channels: The number of channels in the final recording file. Can be: `1` or `2`. You can split a call with two legs into two separate recording channels if you record using [TwiML Dial](https://www.twilio.com/docs/voice/twiml/dial#record) or the [Outbound Rest API](https://www.twilio.com/docs/voice/make-calls#manage-your-outbound-call). + :ivar channels: The number of channels in the final recording file. Can be: `1` or `2`. :ivar source: :ivar error_code: The error code that describes why the recording is `absent`. The error code is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors). This value is null if the recording `status` is not `absent`. :ivar uri: The URI of the resource, relative to `https://api.twilio.com`. diff --git a/twilio/rest/api/v2010/account/sip/credential_list/__init__.py b/twilio/rest/api/v2010/account/sip/credential_list/__init__.py index 634500f8c..30bb7094e 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/__init__.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/__init__.py @@ -375,11 +375,10 @@ def create(self, friendly_name: str) -> CredentialListInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialListInstance( @@ -400,11 +399,10 @@ async def create_async(self, friendly_name: str) -> CredentialListInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialListInstance( diff --git a/twilio/rest/api/v2010/account/sip/credential_list/credential.py b/twilio/rest/api/v2010/account/sip/credential_list/credential.py index 3d2c24b99..1e46bfe16 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/credential.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/credential.py @@ -374,11 +374,10 @@ def create(self, username: str, password: str) -> CredentialInstance: "Password": password, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance( @@ -404,11 +403,10 @@ async def create_async(self, username: str, password: str) -> CredentialInstance "Password": password, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance( diff --git a/twilio/rest/api/v2010/account/sip/domain/__init__.py b/twilio/rest/api/v2010/account/sip/domain/__init__.py index b46962838..9ea726043 100644 --- a/twilio/rest/api/v2010/account/sip/domain/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/__init__.py @@ -658,11 +658,10 @@ def create( "EmergencyCallerSid": emergency_caller_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DomainInstance( @@ -724,11 +723,10 @@ async def create_async( "EmergencyCallerSid": emergency_caller_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DomainInstance( diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py index 81bb5b0b0..ff6fd5136 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py @@ -288,11 +288,10 @@ def create( "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthCallsCredentialListMappingInstance( @@ -318,11 +317,10 @@ async def create_async( "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthCallsCredentialListMappingInstance( diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py index a690ef4b1..82099164e 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py @@ -292,11 +292,10 @@ def create( "IpAccessControlListSid": ip_access_control_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthCallsIpAccessControlListMappingInstance( @@ -322,11 +321,10 @@ async def create_async( "IpAccessControlListSid": ip_access_control_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthCallsIpAccessControlListMappingInstance( diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py index 2b03bb299..22acb7ef1 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py @@ -288,11 +288,10 @@ def create( "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthRegistrationsCredentialListMappingInstance( @@ -318,11 +317,10 @@ async def create_async( "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthRegistrationsCredentialListMappingInstance( diff --git a/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py index f7838bfc5..e20e08e0f 100644 --- a/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py @@ -284,11 +284,10 @@ def create(self, credential_list_sid: str) -> CredentialListMappingInstance: "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialListMappingInstance( @@ -314,11 +313,10 @@ async def create_async( "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialListMappingInstance( diff --git a/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py index c619be386..607bb6ce1 100644 --- a/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py @@ -290,11 +290,10 @@ def create( "IpAccessControlListSid": ip_access_control_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAccessControlListMappingInstance( @@ -320,11 +319,10 @@ async def create_async( "IpAccessControlListSid": ip_access_control_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAccessControlListMappingInstance( diff --git a/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py b/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py index 7c2fd8214..cf75721a9 100644 --- a/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py +++ b/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py @@ -379,11 +379,10 @@ def create(self, friendly_name: str) -> IpAccessControlListInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAccessControlListInstance( @@ -404,11 +403,10 @@ async def create_async(self, friendly_name: str) -> IpAccessControlListInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAccessControlListInstance( diff --git a/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py b/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py index 251bae965..106bd7400 100644 --- a/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py +++ b/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py @@ -425,11 +425,10 @@ def create( "CidrPrefixLength": cidr_prefix_length, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAddressInstance( @@ -462,11 +461,10 @@ async def create_async( "CidrPrefixLength": cidr_prefix_length, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAddressInstance( diff --git a/twilio/rest/api/v2010/account/token.py b/twilio/rest/api/v2010/account/token.py index ec5acac97..6d5edcf3e 100644 --- a/twilio/rest/api/v2010/account/token.py +++ b/twilio/rest/api/v2010/account/token.py @@ -93,11 +93,10 @@ def create(self, ttl: Union[int, object] = values.unset) -> TokenInstance: "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TokenInstance( @@ -120,11 +119,10 @@ async def create_async( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TokenInstance( diff --git a/twilio/rest/api/v2010/account/usage/trigger.py b/twilio/rest/api/v2010/account/usage/trigger.py index 66e86602a..c3a1b241c 100644 --- a/twilio/rest/api/v2010/account/usage/trigger.py +++ b/twilio/rest/api/v2010/account/usage/trigger.py @@ -766,11 +766,10 @@ def create( "TriggerBy": trigger_by, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TriggerInstance( @@ -812,11 +811,10 @@ async def create_async( "TriggerBy": trigger_by, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TriggerInstance( diff --git a/twilio/rest/api/v2010/account/validation_request.py b/twilio/rest/api/v2010/account/validation_request.py index a949df2d0..261322712 100644 --- a/twilio/rest/api/v2010/account/validation_request.py +++ b/twilio/rest/api/v2010/account/validation_request.py @@ -104,11 +104,10 @@ def create( "StatusCallbackMethod": status_callback_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ValidationRequestInstance( @@ -147,11 +146,10 @@ async def create_async( "StatusCallbackMethod": status_callback_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ValidationRequestInstance( diff --git a/twilio/rest/bulkexports/v1/export/export_custom_job.py b/twilio/rest/bulkexports/v1/export/export_custom_job.py index 758398eba..9a81fb23c 100644 --- a/twilio/rest/bulkexports/v1/export/export_custom_job.py +++ b/twilio/rest/bulkexports/v1/export/export_custom_job.py @@ -138,11 +138,10 @@ def create( "Email": email, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExportCustomJobInstance( @@ -181,11 +180,10 @@ async def create_async( "Email": email, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExportCustomJobInstance( diff --git a/twilio/rest/chat/v1/credential.py b/twilio/rest/chat/v1/credential.py index 68ec9f4b4..6bb8b3f98 100644 --- a/twilio/rest/chat/v1/credential.py +++ b/twilio/rest/chat/v1/credential.py @@ -420,11 +420,10 @@ def create( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) @@ -464,11 +463,10 @@ async def create_async( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) diff --git a/twilio/rest/chat/v1/service/__init__.py b/twilio/rest/chat/v1/service/__init__.py index 1e2a5884a..71825fe57 100644 --- a/twilio/rest/chat/v1/service/__init__.py +++ b/twilio/rest/chat/v1/service/__init__.py @@ -1089,11 +1089,10 @@ def create(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -1112,11 +1111,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/chat/v1/service/channel/__init__.py b/twilio/rest/chat/v1/service/channel/__init__.py index 158561394..02c42f65c 100644 --- a/twilio/rest/chat/v1/service/channel/__init__.py +++ b/twilio/rest/chat/v1/service/channel/__init__.py @@ -484,11 +484,10 @@ def create( "Type": type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance( @@ -521,11 +520,10 @@ async def create_async( "Type": type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance( diff --git a/twilio/rest/chat/v1/service/channel/invite.py b/twilio/rest/chat/v1/service/channel/invite.py index 6beccffae..c80732a2c 100644 --- a/twilio/rest/chat/v1/service/channel/invite.py +++ b/twilio/rest/chat/v1/service/channel/invite.py @@ -296,11 +296,10 @@ def create( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( @@ -328,11 +327,10 @@ async def create_async( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( diff --git a/twilio/rest/chat/v1/service/channel/member.py b/twilio/rest/chat/v1/service/channel/member.py index f0cd21448..405662f02 100644 --- a/twilio/rest/chat/v1/service/channel/member.py +++ b/twilio/rest/chat/v1/service/channel/member.py @@ -406,11 +406,10 @@ def create( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MemberInstance( @@ -438,11 +437,10 @@ async def create_async( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MemberInstance( diff --git a/twilio/rest/chat/v1/service/channel/message.py b/twilio/rest/chat/v1/service/channel/message.py index f524c9238..34d9e01fb 100644 --- a/twilio/rest/chat/v1/service/channel/message.py +++ b/twilio/rest/chat/v1/service/channel/message.py @@ -416,11 +416,10 @@ def create( "Attributes": attributes, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( @@ -453,11 +452,10 @@ async def create_async( "Attributes": attributes, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( diff --git a/twilio/rest/chat/v1/service/role.py b/twilio/rest/chat/v1/service/role.py index 1913986a4..3ed57a6ee 100644 --- a/twilio/rest/chat/v1/service/role.py +++ b/twilio/rest/chat/v1/service/role.py @@ -361,11 +361,10 @@ def create( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -392,11 +391,10 @@ async def create_async( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( diff --git a/twilio/rest/chat/v1/service/user/__init__.py b/twilio/rest/chat/v1/service/user/__init__.py index b06509668..13c4b9bef 100644 --- a/twilio/rest/chat/v1/service/user/__init__.py +++ b/twilio/rest/chat/v1/service/user/__init__.py @@ -433,11 +433,10 @@ def create( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserInstance( @@ -470,11 +469,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserInstance( diff --git a/twilio/rest/chat/v2/credential.py b/twilio/rest/chat/v2/credential.py index 8011ed0e1..b098f6820 100644 --- a/twilio/rest/chat/v2/credential.py +++ b/twilio/rest/chat/v2/credential.py @@ -420,11 +420,10 @@ def create( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) @@ -464,11 +463,10 @@ async def create_async( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) diff --git a/twilio/rest/chat/v2/service/__init__.py b/twilio/rest/chat/v2/service/__init__.py index f6fa9e2c4..376043aed 100644 --- a/twilio/rest/chat/v2/service/__init__.py +++ b/twilio/rest/chat/v2/service/__init__.py @@ -858,11 +858,10 @@ def create(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -881,11 +880,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/chat/v2/service/channel/__init__.py b/twilio/rest/chat/v2/service/channel/__init__.py index 2b49faf26..b3796c30d 100644 --- a/twilio/rest/chat/v2/service/channel/__init__.py +++ b/twilio/rest/chat/v2/service/channel/__init__.py @@ -622,6 +622,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -675,6 +676,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/chat/v2/service/channel/invite.py b/twilio/rest/chat/v2/service/channel/invite.py index 2c7333786..d0ef32e34 100644 --- a/twilio/rest/chat/v2/service/channel/invite.py +++ b/twilio/rest/chat/v2/service/channel/invite.py @@ -296,11 +296,10 @@ def create( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( @@ -328,11 +327,10 @@ async def create_async( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( diff --git a/twilio/rest/chat/v2/service/channel/member.py b/twilio/rest/chat/v2/service/channel/member.py index c71d3e345..95e737b82 100644 --- a/twilio/rest/chat/v2/service/channel/member.py +++ b/twilio/rest/chat/v2/service/channel/member.py @@ -551,6 +551,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -609,6 +610,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/chat/v2/service/channel/message.py b/twilio/rest/chat/v2/service/channel/message.py index e98f526c7..1b2892176 100644 --- a/twilio/rest/chat/v2/service/channel/message.py +++ b/twilio/rest/chat/v2/service/channel/message.py @@ -553,6 +553,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -609,6 +610,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/chat/v2/service/channel/webhook.py b/twilio/rest/chat/v2/service/channel/webhook.py index ca738bac4..bc3819825 100644 --- a/twilio/rest/chat/v2/service/channel/webhook.py +++ b/twilio/rest/chat/v2/service/channel/webhook.py @@ -485,11 +485,10 @@ def create( "Configuration.RetryCount": configuration_retry_count, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -538,11 +537,10 @@ async def create_async( "Configuration.RetryCount": configuration_retry_count, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( diff --git a/twilio/rest/chat/v2/service/role.py b/twilio/rest/chat/v2/service/role.py index 5bb373c9a..bcc0b6e5a 100644 --- a/twilio/rest/chat/v2/service/role.py +++ b/twilio/rest/chat/v2/service/role.py @@ -361,11 +361,10 @@ def create( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -392,11 +391,10 @@ async def create_async( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( diff --git a/twilio/rest/chat/v2/service/user/__init__.py b/twilio/rest/chat/v2/service/user/__init__.py index 2c4ac5a3b..768b78876 100644 --- a/twilio/rest/chat/v2/service/user/__init__.py +++ b/twilio/rest/chat/v2/service/user/__init__.py @@ -491,6 +491,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -535,6 +536,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index 72e1e8214..8a1c4212d 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -25,22 +25,6 @@ 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. @@ -49,7 +33,7 @@ class QuickReplyActionType(object): :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-api/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content/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 """ @@ -291,451 +275,6 @@ 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 CatalogItem(object): - """ - :ivar id: - :ivar section_title: - :ivar name: - :ivar media_url: - :ivar price: - :ivar description: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.id: Optional[str] = payload.get("id") - self.section_title: Optional[str] = payload.get("section_title") - self.name: Optional[str] = payload.get("name") - self.media_url: Optional[str] = payload.get("media_url") - self.price: Optional[float] = payload.get("price") - self.description: Optional[str] = payload.get("description") - - def to_dict(self): - return { - "id": self.id, - "section_title": self.section_title, - "name": self.name, - "media_url": self.media_url, - "price": self.price, - "description": self.description, - } - - 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 TwilioCatalog(object): - """ - :ivar title: - :ivar body: - :ivar subtitle: - :ivar id: - :ivar items: - :ivar dynamic_items: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.title: Optional[str] = payload.get("title") - self.body: Optional[str] = payload.get("body") - self.subtitle: Optional[str] = payload.get("subtitle") - self.id: Optional[str] = payload.get("id") - self.items: Optional[List[ContentList.CatalogItem]] = payload.get("items") - self.dynamic_items: Optional[str] = payload.get("dynamic_items") - - def to_dict(self): - return { - "title": self.title, - "body": self.body, - "subtitle": self.subtitle, - "id": self.id, - "items": [items.to_dict() for items in self.items], - "dynamic_items": self.dynamic_items, - } - - 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 twilio_catalog: - :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.twilio_catalog: Optional[ContentList.TwilioCatalog] = payload.get( - "twilio_catalog" - ) - 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(), - "twilio_catalog": self.twilio_catalog.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 @@ -747,17 +286,18 @@ def __init__(self, version: Version): self._uri = "/Content" - def create(self, content_create_request: ContentCreateRequest) -> ContentInstance: + def create(self, body: Union[object, object] = values.unset) -> ContentInstance: """ Create the ContentInstance - :param content_create_request: + :param body: :returns: The created ContentInstance """ - data = content_create_request.to_dict() + data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -766,18 +306,19 @@ def create(self, content_create_request: ContentCreateRequest) -> ContentInstanc return ContentInstance(self._version, payload) async def create_async( - self, content_create_request: ContentCreateRequest + self, body: Union[object, object] = values.unset ) -> ContentInstance: """ Asynchronously create the ContentInstance - :param content_create_request: + :param body: :returns: The created ContentInstance """ - data = content_create_request.to_dict() + data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/content/v1/content/approval_create.py b/twilio/rest/content/v1/content/approval_create.py index ddd922afc..137c0a6d0 100644 --- a/twilio/rest/content/v1/content/approval_create.py +++ b/twilio/rest/content/v1/content/approval_create.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 @@ -29,7 +30,7 @@ class ApprovalCreateInstance(InstanceResource): :ivar allow_category_change: """ - def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): + def __init__(self, version: Version, payload: Dict[str, Any], sid: str): super().__init__(version) self.name: Optional[str] = payload.get("name") @@ -42,7 +43,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): ) self._solution = { - "content_sid": content_sid, + "sid": sid, } def __repr__(self) -> str: @@ -57,84 +58,63 @@ def __repr__(self) -> str: 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], content_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, content_sid: str): + def __init__(self, version: Version, sid: str): """ Initialize the ApprovalCreateList :param version: Version that contains the resource - :param content_sid: + :param sid: """ super().__init__(version) # Path Solution self._solution = { - "content_sid": content_sid, + "sid": sid, } - self._uri = "/Content/{content_sid}/ApprovalRequests/whatsapp".format( - **self._solution - ) + self._uri = "/Content/{sid}/ApprovalRequests/whatsapp".format(**self._solution) def create( - self, content_approval_request: ContentApprovalRequest + self, body: Union[object, object] = values.unset ) -> ApprovalCreateInstance: """ Create the ApprovalCreateInstance - :param content_approval_request: + :param body: :returns: The created ApprovalCreateInstance """ - data = content_approval_request.to_dict() + data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) - return ApprovalCreateInstance( - self._version, payload, content_sid=self._solution["content_sid"] - ) + return ApprovalCreateInstance(self._version, payload, sid=self._solution["sid"]) async def create_async( - self, content_approval_request: ContentApprovalRequest + self, body: Union[object, object] = values.unset ) -> ApprovalCreateInstance: """ Asynchronously create the ApprovalCreateInstance - :param content_approval_request: + :param body: :returns: The created ApprovalCreateInstance """ - data = content_approval_request.to_dict() + data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + 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, content_sid=self._solution["content_sid"] - ) + return ApprovalCreateInstance(self._version, payload, sid=self._solution["sid"]) def __repr__(self) -> str: """ diff --git a/twilio/rest/content/v1/content/approval_fetch.py b/twilio/rest/content/v1/content/approval_fetch.py index f679a920a..f35ef6a48 100644 --- a/twilio/rest/content/v1/content/approval_fetch.py +++ b/twilio/rest/content/v1/content/approval_fetch.py @@ -27,7 +27,7 @@ class ApprovalFetchInstance(InstanceResource): :ivar url: The URL of the resource, relative to `https://content.twilio.com`. """ - def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): + def __init__(self, version: Version, payload: Dict[str, Any], sid: str): super().__init__(version) self.sid: Optional[str] = payload.get("sid") @@ -36,7 +36,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): self.url: Optional[str] = payload.get("url") self._solution = { - "content_sid": content_sid, + "sid": sid, } self._context: Optional[ApprovalFetchContext] = None @@ -51,7 +51,7 @@ def _proxy(self) -> "ApprovalFetchContext": if self._context is None: self._context = ApprovalFetchContext( self._version, - content_sid=self._solution["content_sid"], + sid=self._solution["sid"], ) return self._context @@ -85,20 +85,20 @@ def __repr__(self) -> str: class ApprovalFetchContext(InstanceContext): - def __init__(self, version: Version, content_sid: str): + def __init__(self, version: Version, sid: str): """ Initialize the ApprovalFetchContext :param version: Version that contains the resource - :param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + :param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. """ super().__init__(version) # Path Solution self._solution = { - "content_sid": content_sid, + "sid": sid, } - self._uri = "/Content/{content_sid}/ApprovalRequests".format(**self._solution) + self._uri = "/Content/{sid}/ApprovalRequests".format(**self._solution) def fetch(self) -> ApprovalFetchInstance: """ @@ -116,7 +116,7 @@ def fetch(self) -> ApprovalFetchInstance: return ApprovalFetchInstance( self._version, payload, - content_sid=self._solution["content_sid"], + sid=self._solution["sid"], ) async def fetch_async(self) -> ApprovalFetchInstance: @@ -135,7 +135,7 @@ async def fetch_async(self) -> ApprovalFetchInstance: return ApprovalFetchInstance( self._version, payload, - content_sid=self._solution["content_sid"], + sid=self._solution["sid"], ) def __repr__(self) -> str: @@ -150,19 +150,19 @@ def __repr__(self) -> str: class ApprovalFetchList(ListResource): - def __init__(self, version: Version, content_sid: str): + def __init__(self, version: Version, sid: str): """ Initialize the ApprovalFetchList :param version: Version that contains the resource - :param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + :param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. """ super().__init__(version) # Path Solution self._solution = { - "content_sid": content_sid, + "sid": sid, } def get(self) -> ApprovalFetchContext: @@ -170,18 +170,14 @@ def get(self) -> ApprovalFetchContext: Constructs a ApprovalFetchContext """ - return ApprovalFetchContext( - self._version, content_sid=self._solution["content_sid"] - ) + return ApprovalFetchContext(self._version, sid=self._solution["sid"]) def __call__(self) -> ApprovalFetchContext: """ Constructs a ApprovalFetchContext """ - return ApprovalFetchContext( - self._version, content_sid=self._solution["content_sid"] - ) + return ApprovalFetchContext(self._version, sid=self._solution["sid"]) def __repr__(self) -> str: """ diff --git a/twilio/rest/content/v1/content_and_approvals.py b/twilio/rest/content/v1/content_and_approvals.py index de40cfc17..e2d6d72aa 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-api/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content/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 86cdb0806..58bd74be4 100644 --- a/twilio/rest/conversations/v1/address_configuration.py +++ b/twilio/rest/conversations/v1/address_configuration.py @@ -526,11 +526,10 @@ def create( "AddressCountry": address_country, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AddressConfigurationInstance(self._version, payload) @@ -593,11 +592,10 @@ async def create_async( "AddressCountry": address_country, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AddressConfigurationInstance(self._version, payload) diff --git a/twilio/rest/conversations/v1/conversation/__init__.py b/twilio/rest/conversations/v1/conversation/__init__.py index 4c9b8809a..4eb14b769 100644 --- a/twilio/rest/conversations/v1/conversation/__init__.py +++ b/twilio/rest/conversations/v1/conversation/__init__.py @@ -639,6 +639,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -702,6 +703,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/conversations/v1/conversation/message/__init__.py b/twilio/rest/conversations/v1/conversation/message/__init__.py index e3e9dea1b..8488bee00 100644 --- a/twilio/rest/conversations/v1/conversation/message/__init__.py +++ b/twilio/rest/conversations/v1/conversation/message/__init__.py @@ -566,6 +566,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -625,6 +626,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/conversations/v1/conversation/participant.py b/twilio/rest/conversations/v1/conversation/participant.py index 499bdbf30..92f8e5de4 100644 --- a/twilio/rest/conversations/v1/conversation/participant.py +++ b/twilio/rest/conversations/v1/conversation/participant.py @@ -568,6 +568,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -624,6 +625,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/conversations/v1/conversation/webhook.py b/twilio/rest/conversations/v1/conversation/webhook.py index 623887986..b961b832a 100644 --- a/twilio/rest/conversations/v1/conversation/webhook.py +++ b/twilio/rest/conversations/v1/conversation/webhook.py @@ -455,11 +455,10 @@ def create( "Configuration.ReplayAfter": configuration_replay_after, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -505,11 +504,10 @@ async def create_async( "Configuration.ReplayAfter": configuration_replay_after, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( diff --git a/twilio/rest/conversations/v1/credential.py b/twilio/rest/conversations/v1/credential.py index 120710f7e..c8cd78ab0 100644 --- a/twilio/rest/conversations/v1/credential.py +++ b/twilio/rest/conversations/v1/credential.py @@ -432,11 +432,10 @@ def create( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) @@ -476,11 +475,10 @@ async def create_async( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) diff --git a/twilio/rest/conversations/v1/role.py b/twilio/rest/conversations/v1/role.py index b5d4d2c6d..301063800 100644 --- a/twilio/rest/conversations/v1/role.py +++ b/twilio/rest/conversations/v1/role.py @@ -334,11 +334,10 @@ def create( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance(self._version, payload) @@ -363,11 +362,10 @@ async def create_async( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance(self._version, payload) diff --git a/twilio/rest/conversations/v1/service/__init__.py b/twilio/rest/conversations/v1/service/__init__.py index 2a9f12090..a06afa2f7 100644 --- a/twilio/rest/conversations/v1/service/__init__.py +++ b/twilio/rest/conversations/v1/service/__init__.py @@ -380,11 +380,10 @@ def create(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -403,11 +402,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/conversations/v1/service/conversation/__init__.py b/twilio/rest/conversations/v1/service/conversation/__init__.py index 69e87e5ee..139bdcb5c 100644 --- a/twilio/rest/conversations/v1/service/conversation/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/__init__.py @@ -675,6 +675,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -740,6 +741,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/conversations/v1/service/conversation/message/__init__.py b/twilio/rest/conversations/v1/service/conversation/message/__init__.py index 753df1835..32f480bc5 100644 --- a/twilio/rest/conversations/v1/service/conversation/message/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/message/__init__.py @@ -585,6 +585,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -647,6 +648,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/conversations/v1/service/conversation/participant.py b/twilio/rest/conversations/v1/service/conversation/participant.py index 6f6eee61e..530bce26f 100644 --- a/twilio/rest/conversations/v1/service/conversation/participant.py +++ b/twilio/rest/conversations/v1/service/conversation/participant.py @@ -586,6 +586,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -645,6 +646,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/conversations/v1/service/conversation/webhook.py b/twilio/rest/conversations/v1/service/conversation/webhook.py index 83b267406..327dc9f02 100644 --- a/twilio/rest/conversations/v1/service/conversation/webhook.py +++ b/twilio/rest/conversations/v1/service/conversation/webhook.py @@ -473,11 +473,10 @@ def create( "Configuration.ReplayAfter": configuration_replay_after, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -526,11 +525,10 @@ async def create_async( "Configuration.ReplayAfter": configuration_replay_after, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( diff --git a/twilio/rest/conversations/v1/service/role.py b/twilio/rest/conversations/v1/service/role.py index 3c0a0fc90..170512a2b 100644 --- a/twilio/rest/conversations/v1/service/role.py +++ b/twilio/rest/conversations/v1/service/role.py @@ -361,11 +361,10 @@ def create( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -392,11 +391,10 @@ async def create_async( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( diff --git a/twilio/rest/conversations/v1/service/user/__init__.py b/twilio/rest/conversations/v1/service/user/__init__.py index 37a8d2e4f..4d4df0398 100644 --- a/twilio/rest/conversations/v1/service/user/__init__.py +++ b/twilio/rest/conversations/v1/service/user/__init__.py @@ -503,6 +503,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -547,6 +548,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/conversations/v1/user/__init__.py b/twilio/rest/conversations/v1/user/__init__.py index d8017c510..a05deeda4 100644 --- a/twilio/rest/conversations/v1/user/__init__.py +++ b/twilio/rest/conversations/v1/user/__init__.py @@ -473,6 +473,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -515,6 +516,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/events/v1/event_type.py b/twilio/rest/events/v1/event_type.py index 7215df8f2..a019a82a9 100644 --- a/twilio/rest/events/v1/event_type.py +++ b/twilio/rest/events/v1/event_type.py @@ -29,6 +29,8 @@ class EventTypeInstance(InstanceResource): :ivar date_created: The date that this Event Type was created, given in ISO 8601 format. :ivar date_updated: The date that this Event Type was updated, given in ISO 8601 format. :ivar description: A human readable description for this Event Type. + :ivar status: A string that describes how this Event Type can be used. For example: `available`, `deprecated`, `restricted`, `discontinued`. When the status is `available`, the Event Type can be used normally. + :ivar documentation_url: The URL to the documentation or to the most relevant Twilio Changelog entry of this Event Type. :ivar url: The URL of this resource. :ivar links: """ @@ -47,6 +49,8 @@ def __init__( payload.get("date_updated") ) self.description: Optional[str] = payload.get("description") + self.status: Optional[str] = payload.get("status") + self.documentation_url: Optional[str] = payload.get("documentation_url") self.url: Optional[str] = payload.get("url") self.links: Optional[Dict[str, object]] = payload.get("links") diff --git a/twilio/rest/events/v1/sink/__init__.py b/twilio/rest/events/v1/sink/__init__.py index b09b5edec..9098c51bd 100644 --- a/twilio/rest/events/v1/sink/__init__.py +++ b/twilio/rest/events/v1/sink/__init__.py @@ -389,11 +389,10 @@ def create( "SinkType": sink_type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SinkInstance(self._version, payload) @@ -421,11 +420,10 @@ async def create_async( "SinkType": sink_type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SinkInstance(self._version, payload) diff --git a/twilio/rest/events/v1/sink/sink_test.py b/twilio/rest/events/v1/sink/sink_test.py index adf04f582..150e7deab 100644 --- a/twilio/rest/events/v1/sink/sink_test.py +++ b/twilio/rest/events/v1/sink/sink_test.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -69,10 +70,9 @@ def create(self) -> SinkTestInstance: :returns: The created SinkTestInstance """ - payload = self._version.create( - method="POST", - uri=self._uri, - ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = self._version.create(method="POST", uri=self._uri, headers=headers) return SinkTestInstance(self._version, payload, sid=self._solution["sid"]) @@ -84,9 +84,10 @@ async def create_async(self) -> SinkTestInstance: :returns: The created SinkTestInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, headers=headers ) return SinkTestInstance(self._version, payload, sid=self._solution["sid"]) diff --git a/twilio/rest/events/v1/sink/sink_validate.py b/twilio/rest/events/v1/sink/sink_validate.py index 4c24dd76b..8c6565a00 100644 --- a/twilio/rest/events/v1/sink/sink_validate.py +++ b/twilio/rest/events/v1/sink/sink_validate.py @@ -76,11 +76,10 @@ def create(self, test_id: str) -> SinkValidateInstance: "TestId": test_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SinkValidateInstance(self._version, payload, sid=self._solution["sid"]) @@ -99,11 +98,10 @@ async def create_async(self, test_id: str) -> SinkValidateInstance: "TestId": test_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SinkValidateInstance(self._version, payload, sid=self._solution["sid"]) diff --git a/twilio/rest/events/v1/subscription/__init__.py b/twilio/rest/events/v1/subscription/__init__.py index 666b26aa7..2f6d7e91a 100644 --- a/twilio/rest/events/v1/subscription/__init__.py +++ b/twilio/rest/events/v1/subscription/__init__.py @@ -373,11 +373,10 @@ def create( "Types": serialize.map(types, lambda e: serialize.object(e)), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscriptionInstance(self._version, payload) @@ -402,11 +401,10 @@ async def create_async( "Types": serialize.map(types, lambda e: serialize.object(e)), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscriptionInstance(self._version, payload) diff --git a/twilio/rest/events/v1/subscription/subscribed_event.py b/twilio/rest/events/v1/subscription/subscribed_event.py index 80c9ce149..8547fd486 100644 --- a/twilio/rest/events/v1/subscription/subscribed_event.py +++ b/twilio/rest/events/v1/subscription/subscribed_event.py @@ -355,11 +355,10 @@ def create( "SchemaVersion": schema_version, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscribedEventInstance( @@ -384,11 +383,10 @@ async def create_async( "SchemaVersion": schema_version, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscribedEventInstance( diff --git a/twilio/rest/flex_api/v1/assessments.py b/twilio/rest/flex_api/v1/assessments.py index 23648b104..b24d9113d 100644 --- a/twilio/rest/flex_api/v1/assessments.py +++ b/twilio/rest/flex_api/v1/assessments.py @@ -326,6 +326,7 @@ def create( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -384,6 +385,7 @@ async def create_async( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/channel.py b/twilio/rest/flex_api/v1/channel.py index f362d5b01..bf4feb99e 100644 --- a/twilio/rest/flex_api/v1/channel.py +++ b/twilio/rest/flex_api/v1/channel.py @@ -283,11 +283,10 @@ def create( "LongLived": serialize.boolean_to_string(long_lived), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance(self._version, payload) @@ -336,11 +335,10 @@ async def create_async( "LongLived": serialize.boolean_to_string(long_lived), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance(self._version, payload) diff --git a/twilio/rest/flex_api/v1/flex_flow.py b/twilio/rest/flex_api/v1/flex_flow.py index b11482937..531dd470b 100644 --- a/twilio/rest/flex_api/v1/flex_flow.py +++ b/twilio/rest/flex_api/v1/flex_flow.py @@ -622,11 +622,10 @@ def create( "Integration.RetryCount": integration_retry_count, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlexFlowInstance(self._version, payload) @@ -700,11 +699,10 @@ async def create_async( "Integration.RetryCount": integration_retry_count, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlexFlowInstance(self._version, payload) diff --git a/twilio/rest/flex_api/v1/insights_assessments_comment.py b/twilio/rest/flex_api/v1/insights_assessments_comment.py index eed32fefb..faeb6ae62 100644 --- a/twilio/rest/flex_api/v1/insights_assessments_comment.py +++ b/twilio/rest/flex_api/v1/insights_assessments_comment.py @@ -134,6 +134,7 @@ def create( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -180,6 +181,7 @@ async def create_async( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/insights_questionnaires.py b/twilio/rest/flex_api/v1/insights_questionnaires.py index 807f12995..1724e2a25 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires.py @@ -454,6 +454,7 @@ def create( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -494,6 +495,7 @@ async def create_async( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_category.py b/twilio/rest/flex_api/v1/insights_questionnaires_category.py index 28057dbc0..aba8eb8bd 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_category.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_category.py @@ -313,6 +313,7 @@ def create( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -342,6 +343,7 @@ async def create_async( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_question.py b/twilio/rest/flex_api/v1/insights_questionnaires_question.py index e4f2f4a4f..363d5c07b 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_question.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_question.py @@ -395,6 +395,7 @@ def create( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -438,6 +439,7 @@ async def create_async( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/insights_settings_answer_sets.py b/twilio/rest/flex_api/v1/insights_settings_answer_sets.py index 767737da6..d426e215a 100644 --- a/twilio/rest/flex_api/v1/insights_settings_answer_sets.py +++ b/twilio/rest/flex_api/v1/insights_settings_answer_sets.py @@ -75,6 +75,7 @@ def fetch( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -94,6 +95,7 @@ async def fetch_async( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/insights_settings_comment.py b/twilio/rest/flex_api/v1/insights_settings_comment.py index 5d41e8d3b..548b27918 100644 --- a/twilio/rest/flex_api/v1/insights_settings_comment.py +++ b/twilio/rest/flex_api/v1/insights_settings_comment.py @@ -69,6 +69,7 @@ def fetch( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -88,6 +89,7 @@ async def fetch_async( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/interaction/__init__.py b/twilio/rest/flex_api/v1/interaction/__init__.py index 069b05309..468b3134e 100644 --- a/twilio/rest/flex_api/v1/interaction/__init__.py +++ b/twilio/rest/flex_api/v1/interaction/__init__.py @@ -218,11 +218,10 @@ def create( "InteractionContextSid": interaction_context_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionInstance(self._version, payload) @@ -250,11 +249,10 @@ async def create_async( "InteractionContextSid": interaction_context_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionInstance(self._version, payload) diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py index 5292297b9..2ffa14b1d 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py @@ -122,11 +122,10 @@ def create(self, routing: object) -> InteractionChannelInviteInstance: "Routing": serialize.object(routing), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionChannelInviteInstance( @@ -150,11 +149,10 @@ async def create_async(self, routing: object) -> InteractionChannelInviteInstanc "Routing": serialize.object(routing), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionChannelInviteInstance( 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 ba9f80f9a..225ca3efa 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 @@ -296,11 +296,10 @@ def create( "RoutingProperties": serialize.object(routing_properties), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionChannelParticipantInstance( @@ -333,11 +332,10 @@ async def create_async( "RoutingProperties": serialize.object(routing_properties), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionChannelParticipantInstance( diff --git a/twilio/rest/flex_api/v1/plugin/__init__.py b/twilio/rest/flex_api/v1/plugin/__init__.py index 09244d42d..b6baf8f93 100644 --- a/twilio/rest/flex_api/v1/plugin/__init__.py +++ b/twilio/rest/flex_api/v1/plugin/__init__.py @@ -381,6 +381,7 @@ def create( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -418,6 +419,7 @@ async def create_async( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/plugin/plugin_versions.py b/twilio/rest/flex_api/v1/plugin/plugin_versions.py index 1e5b5683b..3da4de3ac 100644 --- a/twilio/rest/flex_api/v1/plugin/plugin_versions.py +++ b/twilio/rest/flex_api/v1/plugin/plugin_versions.py @@ -283,6 +283,7 @@ def create( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -331,6 +332,7 @@ async def create_async( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/plugin_configuration/__init__.py b/twilio/rest/flex_api/v1/plugin_configuration/__init__.py index ebe173985..9b7669524 100644 --- a/twilio/rest/flex_api/v1/plugin_configuration/__init__.py +++ b/twilio/rest/flex_api/v1/plugin_configuration/__init__.py @@ -271,6 +271,7 @@ def create( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -308,6 +309,7 @@ async def create_async( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/plugin_release.py b/twilio/rest/flex_api/v1/plugin_release.py index f2e8efd30..e33918329 100644 --- a/twilio/rest/flex_api/v1/plugin_release.py +++ b/twilio/rest/flex_api/v1/plugin_release.py @@ -233,6 +233,7 @@ def create( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -262,6 +263,7 @@ async def create_async( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/web_channel.py b/twilio/rest/flex_api/v1/web_channel.py index ddf9c8f90..a96698f8c 100644 --- a/twilio/rest/flex_api/v1/web_channel.py +++ b/twilio/rest/flex_api/v1/web_channel.py @@ -363,11 +363,10 @@ def create( "PreEngagementData": pre_engagement_data, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebChannelInstance(self._version, payload) @@ -404,11 +403,10 @@ async def create_async( "PreEngagementData": pre_engagement_data, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebChannelInstance(self._version, payload) diff --git a/twilio/rest/flex_api/v2/web_channels.py b/twilio/rest/flex_api/v2/web_channels.py index a4b7b0c31..153f59cae 100644 --- a/twilio/rest/flex_api/v2/web_channels.py +++ b/twilio/rest/flex_api/v2/web_channels.py @@ -86,6 +86,7 @@ def create( headers = values.of( { "Ui-Version": ui_version, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -126,6 +127,7 @@ async def create_async( headers = values.of( { "Ui-Version": ui_version, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/intelligence/v2/custom_operator.py b/twilio/rest/intelligence/v2/custom_operator.py index 6966dc5d0..af5239b12 100644 --- a/twilio/rest/intelligence/v2/custom_operator.py +++ b/twilio/rest/intelligence/v2/custom_operator.py @@ -384,11 +384,10 @@ def create( "Config": serialize.object(config), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomOperatorInstance(self._version, payload) @@ -413,11 +412,10 @@ async def create_async( "Config": serialize.object(config), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomOperatorInstance(self._version, payload) diff --git a/twilio/rest/intelligence/v2/service.py b/twilio/rest/intelligence/v2/service.py index 7ded7b9b7..8f5633d0f 100644 --- a/twilio/rest/intelligence/v2/service.py +++ b/twilio/rest/intelligence/v2/service.py @@ -486,11 +486,10 @@ def create( "WebhookHttpMethod": webhook_http_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -536,11 +535,10 @@ async def create_async( "WebhookHttpMethod": webhook_http_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/intelligence/v2/transcript/__init__.py b/twilio/rest/intelligence/v2/transcript/__init__.py index 30b97f89b..bc71542bc 100644 --- a/twilio/rest/intelligence/v2/transcript/__init__.py +++ b/twilio/rest/intelligence/v2/transcript/__init__.py @@ -353,11 +353,10 @@ def create( "MediaStartTime": serialize.iso8601_datetime(media_start_time), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TranscriptInstance(self._version, payload) @@ -388,11 +387,10 @@ async def create_async( "MediaStartTime": serialize.iso8601_datetime(media_start_time), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TranscriptInstance(self._version, payload) diff --git a/twilio/rest/ip_messaging/v1/credential.py b/twilio/rest/ip_messaging/v1/credential.py index eac8e38cf..279aef786 100644 --- a/twilio/rest/ip_messaging/v1/credential.py +++ b/twilio/rest/ip_messaging/v1/credential.py @@ -420,11 +420,10 @@ def create( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) @@ -464,11 +463,10 @@ async def create_async( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) diff --git a/twilio/rest/ip_messaging/v1/service/__init__.py b/twilio/rest/ip_messaging/v1/service/__init__.py index ad4f00251..e0b52e273 100644 --- a/twilio/rest/ip_messaging/v1/service/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/__init__.py @@ -1089,11 +1089,10 @@ def create(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -1112,11 +1111,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/ip_messaging/v1/service/channel/__init__.py b/twilio/rest/ip_messaging/v1/service/channel/__init__.py index ef469e97f..57d2d245e 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/channel/__init__.py @@ -484,11 +484,10 @@ def create( "Type": type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance( @@ -521,11 +520,10 @@ async def create_async( "Type": type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance( diff --git a/twilio/rest/ip_messaging/v1/service/channel/invite.py b/twilio/rest/ip_messaging/v1/service/channel/invite.py index 7078058a4..f4c3476ed 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v1/service/channel/invite.py @@ -296,11 +296,10 @@ def create( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( @@ -328,11 +327,10 @@ async def create_async( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( diff --git a/twilio/rest/ip_messaging/v1/service/channel/member.py b/twilio/rest/ip_messaging/v1/service/channel/member.py index c52fde5a8..4452699ce 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/member.py +++ b/twilio/rest/ip_messaging/v1/service/channel/member.py @@ -406,11 +406,10 @@ def create( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MemberInstance( @@ -438,11 +437,10 @@ async def create_async( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MemberInstance( diff --git a/twilio/rest/ip_messaging/v1/service/channel/message.py b/twilio/rest/ip_messaging/v1/service/channel/message.py index f9f2a2b1a..5d3f2eb57 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/message.py +++ b/twilio/rest/ip_messaging/v1/service/channel/message.py @@ -416,11 +416,10 @@ def create( "Attributes": attributes, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( @@ -453,11 +452,10 @@ async def create_async( "Attributes": attributes, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( diff --git a/twilio/rest/ip_messaging/v1/service/role.py b/twilio/rest/ip_messaging/v1/service/role.py index 935a99e18..5f5b19cfe 100644 --- a/twilio/rest/ip_messaging/v1/service/role.py +++ b/twilio/rest/ip_messaging/v1/service/role.py @@ -361,11 +361,10 @@ def create( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -392,11 +391,10 @@ async def create_async( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( diff --git a/twilio/rest/ip_messaging/v1/service/user/__init__.py b/twilio/rest/ip_messaging/v1/service/user/__init__.py index ef24fa776..91364d8f9 100644 --- a/twilio/rest/ip_messaging/v1/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/user/__init__.py @@ -433,11 +433,10 @@ def create( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserInstance( @@ -470,11 +469,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserInstance( diff --git a/twilio/rest/ip_messaging/v2/credential.py b/twilio/rest/ip_messaging/v2/credential.py index beec9fbeb..5d4e14f98 100644 --- a/twilio/rest/ip_messaging/v2/credential.py +++ b/twilio/rest/ip_messaging/v2/credential.py @@ -420,11 +420,10 @@ def create( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) @@ -464,11 +463,10 @@ async def create_async( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) diff --git a/twilio/rest/ip_messaging/v2/service/__init__.py b/twilio/rest/ip_messaging/v2/service/__init__.py index b107a1197..347581162 100644 --- a/twilio/rest/ip_messaging/v2/service/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/__init__.py @@ -858,11 +858,10 @@ def create(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -881,11 +880,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/ip_messaging/v2/service/channel/__init__.py b/twilio/rest/ip_messaging/v2/service/channel/__init__.py index c4e03d453..29ee9ddd6 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/channel/__init__.py @@ -622,6 +622,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -675,6 +676,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/ip_messaging/v2/service/channel/invite.py b/twilio/rest/ip_messaging/v2/service/channel/invite.py index 0f863d70f..a40c47a12 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v2/service/channel/invite.py @@ -296,11 +296,10 @@ def create( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( @@ -328,11 +327,10 @@ async def create_async( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( diff --git a/twilio/rest/ip_messaging/v2/service/channel/member.py b/twilio/rest/ip_messaging/v2/service/channel/member.py index 5de4520ed..9511a2bf6 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/member.py +++ b/twilio/rest/ip_messaging/v2/service/channel/member.py @@ -551,6 +551,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -609,6 +610,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/ip_messaging/v2/service/channel/message.py b/twilio/rest/ip_messaging/v2/service/channel/message.py index 057571c2a..742011711 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/message.py +++ b/twilio/rest/ip_messaging/v2/service/channel/message.py @@ -553,6 +553,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -609,6 +610,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/ip_messaging/v2/service/channel/webhook.py b/twilio/rest/ip_messaging/v2/service/channel/webhook.py index 633acfd51..db23dd66a 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/webhook.py +++ b/twilio/rest/ip_messaging/v2/service/channel/webhook.py @@ -485,11 +485,10 @@ def create( "Configuration.RetryCount": configuration_retry_count, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -538,11 +537,10 @@ async def create_async( "Configuration.RetryCount": configuration_retry_count, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( diff --git a/twilio/rest/ip_messaging/v2/service/role.py b/twilio/rest/ip_messaging/v2/service/role.py index 91fc1af93..0acf77983 100644 --- a/twilio/rest/ip_messaging/v2/service/role.py +++ b/twilio/rest/ip_messaging/v2/service/role.py @@ -361,11 +361,10 @@ def create( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -392,11 +391,10 @@ async def create_async( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( diff --git a/twilio/rest/ip_messaging/v2/service/user/__init__.py b/twilio/rest/ip_messaging/v2/service/user/__init__.py index 1b3ba1b39..3af3121fa 100644 --- a/twilio/rest/ip_messaging/v2/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/user/__init__.py @@ -491,6 +491,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -535,6 +536,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/marketplace/v1/installed_add_on/__init__.py b/twilio/rest/marketplace/v1/installed_add_on/__init__.py index 0aad53d8e..df67c01d8 100644 --- a/twilio/rest/marketplace/v1/installed_add_on/__init__.py +++ b/twilio/rest/marketplace/v1/installed_add_on/__init__.py @@ -410,11 +410,10 @@ def create( "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnInstance(self._version, payload) @@ -447,11 +446,10 @@ async def create_async( "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnInstance(self._version, payload) diff --git a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py index 6fff4979f..3d8d694a2 100644 --- a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py +++ b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional -from twilio.base import deserialize +from twilio.base import deserialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -120,7 +120,8 @@ def create( """ data = create_marketplace_billing_usage_request.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -145,7 +146,8 @@ async def create_async( """ data = create_marketplace_billing_usage_request.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/messaging/v1/brand_registration/__init__.py b/twilio/rest/messaging/v1/brand_registration/__init__.py index b02af9491..b6ac29006 100644 --- a/twilio/rest/messaging/v1/brand_registration/__init__.py +++ b/twilio/rest/messaging/v1/brand_registration/__init__.py @@ -390,11 +390,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BrandRegistrationInstance(self._version, payload) @@ -430,11 +429,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BrandRegistrationInstance(self._version, payload) diff --git a/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py b/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py index 20ce245b3..74631cea7 100644 --- a/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py +++ b/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -77,10 +78,9 @@ def create(self) -> BrandRegistrationOtpInstance: :returns: The created BrandRegistrationOtpInstance """ - payload = self._version.create( - method="POST", - uri=self._uri, - ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = self._version.create(method="POST", uri=self._uri, headers=headers) return BrandRegistrationOtpInstance( self._version, @@ -96,9 +96,10 @@ async def create_async(self) -> BrandRegistrationOtpInstance: :returns: The created BrandRegistrationOtpInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, headers=headers ) return BrandRegistrationOtpInstance( diff --git a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py index c801cb12b..37fe4ed8d 100644 --- a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py +++ b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py @@ -250,11 +250,10 @@ def create( "VettingId": vetting_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BrandVettingInstance( @@ -281,11 +280,10 @@ async def create_async( "VettingId": vetting_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BrandVettingInstance( diff --git a/twilio/rest/messaging/v1/external_campaign.py b/twilio/rest/messaging/v1/external_campaign.py index b70d8a4ee..88262f978 100644 --- a/twilio/rest/messaging/v1/external_campaign.py +++ b/twilio/rest/messaging/v1/external_campaign.py @@ -82,11 +82,10 @@ def create( "MessagingServiceSid": messaging_service_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExternalCampaignInstance(self._version, payload) @@ -109,11 +108,10 @@ async def create_async( "MessagingServiceSid": messaging_service_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExternalCampaignInstance(self._version, payload) diff --git a/twilio/rest/messaging/v1/service/__init__.py b/twilio/rest/messaging/v1/service/__init__.py index 75c798f4c..0fbb3dd10 100644 --- a/twilio/rest/messaging/v1/service/__init__.py +++ b/twilio/rest/messaging/v1/service/__init__.py @@ -766,11 +766,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -845,11 +844,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/messaging/v1/service/alpha_sender.py b/twilio/rest/messaging/v1/service/alpha_sender.py index 38d2d0d5e..0173c9809 100644 --- a/twilio/rest/messaging/v1/service/alpha_sender.py +++ b/twilio/rest/messaging/v1/service/alpha_sender.py @@ -272,11 +272,10 @@ def create(self, alpha_sender: str) -> AlphaSenderInstance: "AlphaSender": alpha_sender, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AlphaSenderInstance( @@ -297,11 +296,10 @@ async def create_async(self, alpha_sender: str) -> AlphaSenderInstance: "AlphaSender": alpha_sender, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AlphaSenderInstance( diff --git a/twilio/rest/messaging/v1/service/phone_number.py b/twilio/rest/messaging/v1/service/phone_number.py index 8b0b4c090..10d30ab7f 100644 --- a/twilio/rest/messaging/v1/service/phone_number.py +++ b/twilio/rest/messaging/v1/service/phone_number.py @@ -274,11 +274,10 @@ def create(self, phone_number_sid: str) -> PhoneNumberInstance: "PhoneNumberSid": phone_number_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( @@ -299,11 +298,10 @@ async def create_async(self, phone_number_sid: str) -> PhoneNumberInstance: "PhoneNumberSid": phone_number_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( diff --git a/twilio/rest/messaging/v1/service/short_code.py b/twilio/rest/messaging/v1/service/short_code.py index 653787589..c8f1b3e3c 100644 --- a/twilio/rest/messaging/v1/service/short_code.py +++ b/twilio/rest/messaging/v1/service/short_code.py @@ -272,11 +272,10 @@ def create(self, short_code_sid: str) -> ShortCodeInstance: "ShortCodeSid": short_code_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ShortCodeInstance( @@ -297,11 +296,10 @@ async def create_async(self, short_code_sid: str) -> ShortCodeInstance: "ShortCodeSid": short_code_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ShortCodeInstance( 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 9034e4e2e..ad31c6a4b 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person.py @@ -532,11 +532,10 @@ def create( "DirectLending": serialize.boolean_to_string(direct_lending), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UsAppToPersonInstance( @@ -607,11 +606,10 @@ async def create_async( "DirectLending": serialize.boolean_to_string(direct_lending), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UsAppToPersonInstance( diff --git a/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py b/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py index debcf940d..1f0d85704 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py @@ -79,6 +79,7 @@ def fetch( :param brand_registration_sid: The unique string to identify the A2P brand. :returns: The fetched UsAppToPersonUsecaseInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { @@ -86,7 +87,9 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=params) + payload = self._version.fetch( + method="GET", uri=self._uri, headers=headers, params=params + ) return UsAppToPersonUsecaseInstance( self._version, @@ -103,6 +106,7 @@ async def fetch_async( :param brand_registration_sid: The unique string to identify the A2P brand. :returns: The fetched UsAppToPersonUsecaseInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { @@ -111,7 +115,7 @@ async def fetch_async( ) payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=params + method="GET", uri=self._uri, headers=headers, params=params ) return UsAppToPersonUsecaseInstance( diff --git a/twilio/rest/messaging/v1/tollfree_verification.py b/twilio/rest/messaging/v1/tollfree_verification.py index f8c639286..98887c766 100644 --- a/twilio/rest/messaging/v1/tollfree_verification.py +++ b/twilio/rest/messaging/v1/tollfree_verification.py @@ -757,11 +757,10 @@ def create( "ExternalReferenceId": external_reference_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TollfreeVerificationInstance(self._version, payload) @@ -849,11 +848,10 @@ async def create_async( "ExternalReferenceId": external_reference_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TollfreeVerificationInstance(self._version, payload) diff --git a/twilio/rest/messaging/v1/usecase.py b/twilio/rest/messaging/v1/usecase.py index d7223f363..118c9c895 100644 --- a/twilio/rest/messaging/v1/usecase.py +++ b/twilio/rest/messaging/v1/usecase.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, List, Optional +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -59,8 +60,9 @@ def fetch(self) -> UsecaseInstance: :returns: The fetched UsecaseInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = self._version.fetch(method="GET", uri=self._uri) + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UsecaseInstance(self._version, payload) @@ -71,8 +73,11 @@ async def fetch_async(self) -> UsecaseInstance: :returns: The fetched UsecaseInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = await self._version.fetch_async(method="GET", uri=self._uri) + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) return UsecaseInstance(self._version, payload) diff --git a/twilio/rest/microvisor/v1/account_config.py b/twilio/rest/microvisor/v1/account_config.py index 3d37b01cd..0abe5f928 100644 --- a/twilio/rest/microvisor/v1/account_config.py +++ b/twilio/rest/microvisor/v1/account_config.py @@ -313,11 +313,10 @@ def create(self, key: str, value: str) -> AccountConfigInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountConfigInstance(self._version, payload) @@ -338,11 +337,10 @@ async def create_async(self, key: str, value: str) -> AccountConfigInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountConfigInstance(self._version, payload) diff --git a/twilio/rest/microvisor/v1/account_secret.py b/twilio/rest/microvisor/v1/account_secret.py index cca0e1d77..e85a78bc5 100644 --- a/twilio/rest/microvisor/v1/account_secret.py +++ b/twilio/rest/microvisor/v1/account_secret.py @@ -311,11 +311,10 @@ def create(self, key: str, value: str) -> AccountSecretInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountSecretInstance(self._version, payload) @@ -336,11 +335,10 @@ async def create_async(self, key: str, value: str) -> AccountSecretInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountSecretInstance(self._version, payload) diff --git a/twilio/rest/microvisor/v1/device/device_config.py b/twilio/rest/microvisor/v1/device/device_config.py index 3607e971f..b4759e90b 100644 --- a/twilio/rest/microvisor/v1/device/device_config.py +++ b/twilio/rest/microvisor/v1/device/device_config.py @@ -342,11 +342,10 @@ def create(self, key: str, value: str) -> DeviceConfigInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceConfigInstance( @@ -369,11 +368,10 @@ async def create_async(self, key: str, value: str) -> DeviceConfigInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceConfigInstance( diff --git a/twilio/rest/microvisor/v1/device/device_secret.py b/twilio/rest/microvisor/v1/device/device_secret.py index 0ab9b1c72..f89a6c0e9 100644 --- a/twilio/rest/microvisor/v1/device/device_secret.py +++ b/twilio/rest/microvisor/v1/device/device_secret.py @@ -340,11 +340,10 @@ def create(self, key: str, value: str) -> DeviceSecretInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceSecretInstance( @@ -367,11 +366,10 @@ async def create_async(self, key: str, value: str) -> DeviceSecretInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceSecretInstance( diff --git a/twilio/rest/notify/v1/credential.py b/twilio/rest/notify/v1/credential.py index 5cb86363a..d894a9a70 100644 --- a/twilio/rest/notify/v1/credential.py +++ b/twilio/rest/notify/v1/credential.py @@ -420,11 +420,10 @@ def create( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) @@ -464,11 +463,10 @@ async def create_async( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) diff --git a/twilio/rest/notify/v1/service/__init__.py b/twilio/rest/notify/v1/service/__init__.py index 0cd9adb68..2654c97c1 100644 --- a/twilio/rest/notify/v1/service/__init__.py +++ b/twilio/rest/notify/v1/service/__init__.py @@ -616,11 +616,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -683,11 +682,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/notify/v1/service/binding.py b/twilio/rest/notify/v1/service/binding.py index a6b1e3f08..845f720dc 100644 --- a/twilio/rest/notify/v1/service/binding.py +++ b/twilio/rest/notify/v1/service/binding.py @@ -314,11 +314,10 @@ def create( "Endpoint": endpoint, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BindingInstance( @@ -360,11 +359,10 @@ async def create_async( "Endpoint": endpoint, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BindingInstance( diff --git a/twilio/rest/notify/v1/service/notification.py b/twilio/rest/notify/v1/service/notification.py index e2482be10..ec31b423a 100644 --- a/twilio/rest/notify/v1/service/notification.py +++ b/twilio/rest/notify/v1/service/notification.py @@ -180,11 +180,10 @@ def create( "Tag": serialize.map(tag, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NotificationInstance( @@ -259,11 +258,10 @@ async def create_async( "Tag": serialize.map(tag, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NotificationInstance( diff --git a/twilio/rest/numbers/v1/bulk_eligibility.py b/twilio/rest/numbers/v1/bulk_eligibility.py index 0e92b5b07..97b358b71 100644 --- a/twilio/rest/numbers/v1/bulk_eligibility.py +++ b/twilio/rest/numbers/v1/bulk_eligibility.py @@ -192,7 +192,8 @@ def create( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -212,7 +213,8 @@ async def create_async( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/numbers/v1/eligibility.py b/twilio/rest/numbers/v1/eligibility.py index 91a2c7326..007a019f5 100644 --- a/twilio/rest/numbers/v1/eligibility.py +++ b/twilio/rest/numbers/v1/eligibility.py @@ -63,7 +63,8 @@ def create(self, body: Union[object, object] = values.unset) -> EligibilityInsta """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -83,7 +84,8 @@ async def create_async( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py index e9988a7d6..50b3e328e 100644 --- a/twilio/rest/numbers/v1/porting_port_in.py +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -34,6 +34,7 @@ class PortingPortInInstance(InstanceResource): :ivar losing_carrier_information: The information for the losing carrier. :ivar phone_numbers: The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212). :ivar documents: The list of documents SID referencing a utility bills + :ivar date_created: """ def __init__( @@ -69,6 +70,9 @@ def __init__( "phone_numbers" ) self.documents: Optional[List[str]] = payload.get("documents") + self.date_created: Optional[date] = deserialize.iso8601_date( + payload.get("date_created") + ) self._solution = { "port_in_request_sid": port_in_request_sid or self.port_in_request_sid, @@ -250,7 +254,8 @@ def create( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -270,7 +275,8 @@ async def create_async( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/numbers/v1/porting_port_in_phone_number.py b/twilio/rest/numbers/v1/porting_port_in_phone_number.py index 48b90eea4..f5d881a65 100644 --- a/twilio/rest/numbers/v1/porting_port_in_phone_number.py +++ b/twilio/rest/numbers/v1/porting_port_in_phone_number.py @@ -31,12 +31,15 @@ class PortingPortInPhoneNumberInstance(InstanceResource): :ivar date_created: The date when the phone number was created. :ivar country: The country of the phone number. :ivar missing_required_fields: The phone number is missing required fields. - :ivar status_last_time_updated_timestamp: The timestamp when the status was last updated. + :ivar last_updated: The timestamp when the status was last updated. :ivar phone_number: The phone number. :ivar portable: The phone number is portable. :ivar not_portability_reason: The reason why the phone number is not portable. :ivar not_portability_reason_code: The code of the reason why the phone number is not portable. :ivar port_in_phone_number_status: The status of the phone number in the port in request. + :ivar port_out_pin: The pin required for the losing carrier to port out the phone number. + :ivar rejection_reason: The rejection reason returned by the vendor. + :ivar rejection_reason_code: The rejection reason code returned by the vendor. """ def __init__( @@ -60,22 +63,27 @@ def __init__( self.missing_required_fields: Optional[bool] = payload.get( "missing_required_fields" ) - self.status_last_time_updated_timestamp: Optional[datetime] = ( - deserialize.iso8601_datetime( - payload.get("status_last_time_updated_timestamp") - ) + self.last_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("last_updated") ) self.phone_number: Optional[str] = payload.get("phone_number") self.portable: Optional[bool] = payload.get("portable") self.not_portability_reason: Optional[str] = payload.get( "not_portability_reason" ) - self.not_portability_reason_code: Optional[str] = payload.get( - "not_portability_reason_code" + self.not_portability_reason_code: Optional[int] = deserialize.integer( + payload.get("not_portability_reason_code") ) self.port_in_phone_number_status: Optional[str] = payload.get( "port_in_phone_number_status" ) + self.port_out_pin: Optional[int] = deserialize.integer( + payload.get("port_out_pin") + ) + self.rejection_reason: Optional[str] = payload.get("rejection_reason") + self.rejection_reason_code: Optional[int] = deserialize.integer( + payload.get("rejection_reason_code") + ) self._solution = { "port_in_request_sid": port_in_request_sid or self.port_in_request_sid, diff --git a/twilio/rest/numbers/v1/porting_portability.py b/twilio/rest/numbers/v1/porting_portability.py index f1cf0cb8c..d4f92ba7d 100644 --- a/twilio/rest/numbers/v1/porting_portability.py +++ b/twilio/rest/numbers/v1/porting_portability.py @@ -37,8 +37,6 @@ class NumberType(object): :ivar not_portable_reason_code: The Portability Reason Code for the phone number if it cannot be ported into Twilio, `null` otherwise. One of `22131`, `22132`, `22130`, `22133`, `22102` or `22135`. :ivar number_type: :ivar country: Country the phone number belongs to. - :ivar messaging_carrier: Current messaging carrier of the phone number - :ivar voice_carrier: Current voice carrier of the phone number :ivar url: This is the url of the request that you're trying to reach out to locate the resource. """ @@ -64,8 +62,6 @@ def __init__( payload.get("number_type") ) self.country: Optional[str] = payload.get("country") - self.messaging_carrier: Optional[str] = payload.get("messaging_carrier") - self.voice_carrier: Optional[str] = payload.get("voice_carrier") self.url: Optional[str] = payload.get("url") self._solution = { diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration.py b/twilio/rest/numbers/v1/porting_webhook_configuration.py index d1daabfd7..ea6d9bd2e 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration.py @@ -71,7 +71,8 @@ def create( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -91,7 +92,8 @@ async def create_async( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py index 46c053b65..0119fe002 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional -from twilio.base import deserialize +from twilio.base import deserialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -75,8 +75,9 @@ def fetch(self) -> PortingWebhookConfigurationFetchInstance: :returns: The fetched PortingWebhookConfigurationFetchInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = self._version.fetch(method="GET", uri=self._uri) + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return PortingWebhookConfigurationFetchInstance(self._version, payload) @@ -87,8 +88,11 @@ async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: :returns: The fetched PortingWebhookConfigurationFetchInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = await self._version.fetch_async(method="GET", uri=self._uri) + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) return PortingWebhookConfigurationFetchInstance(self._version, payload) diff --git a/twilio/rest/numbers/v1/signing_request_configuration.py b/twilio/rest/numbers/v1/signing_request_configuration.py index 1b70ba88c..541062ec6 100644 --- a/twilio/rest/numbers/v1/signing_request_configuration.py +++ b/twilio/rest/numbers/v1/signing_request_configuration.py @@ -79,7 +79,8 @@ def create( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -99,7 +100,8 @@ async def create_async( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/numbers/v2/authorization_document/__init__.py b/twilio/rest/numbers/v2/authorization_document/__init__.py index 7e0a4d918..f56071878 100644 --- a/twilio/rest/numbers/v2/authorization_document/__init__.py +++ b/twilio/rest/numbers/v2/authorization_document/__init__.py @@ -313,11 +313,10 @@ def create( "CcEmails": serialize.map(cc_emails, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthorizationDocumentInstance(self._version, payload) @@ -356,11 +355,10 @@ async def create_async( "CcEmails": serialize.map(cc_emails, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthorizationDocumentInstance(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 30a57e28f..325ffe8e7 100644 --- a/twilio/rest/numbers/v2/bulk_hosted_number_order.py +++ b/twilio/rest/numbers/v2/bulk_hosted_number_order.py @@ -230,7 +230,8 @@ def create( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -250,7 +251,8 @@ async def create_async( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/numbers/v2/hosted_number_order.py b/twilio/rest/numbers/v2/hosted_number_order.py index 2063e7a87..b2660cfc3 100644 --- a/twilio/rest/numbers/v2/hosted_number_order.py +++ b/twilio/rest/numbers/v2/hosted_number_order.py @@ -339,11 +339,10 @@ def create( "ContactTitle": contact_title, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return HostedNumberOrderInstance(self._version, payload) @@ -410,11 +409,10 @@ async def create_async( "ContactTitle": contact_title, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return HostedNumberOrderInstance(self._version, payload) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py index d37caa0fb..ccdcbb3f3 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py @@ -514,11 +514,10 @@ def create( "NumberType": number_type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BundleInstance(self._version, payload) @@ -558,11 +557,10 @@ async def create_async( "NumberType": number_type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BundleInstance(self._version, payload) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py index a8cf77fd1..860a6f186 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py @@ -136,11 +136,10 @@ def create( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BundleCopyInstance( @@ -163,11 +162,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BundleCopyInstance( diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py index 39aae3b6e..83d061cda 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py @@ -231,10 +231,9 @@ def create(self) -> EvaluationInstance: :returns: The created EvaluationInstance """ - payload = self._version.create( - method="POST", - uri=self._uri, - ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = self._version.create(method="POST", uri=self._uri, headers=headers) return EvaluationInstance( self._version, payload, bundle_sid=self._solution["bundle_sid"] @@ -248,9 +247,10 @@ async def create_async(self) -> EvaluationInstance: :returns: The created EvaluationInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, headers=headers ) return EvaluationInstance( diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py index d22fc3139..5fa77e7f9 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py @@ -270,11 +270,10 @@ def create(self, object_sid: str) -> ItemAssignmentInstance: "ObjectSid": object_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ItemAssignmentInstance( @@ -295,11 +294,10 @@ async def create_async(self, object_sid: str) -> ItemAssignmentInstance: "ObjectSid": object_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ItemAssignmentInstance( diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py index 09e2823ad..2e2bc6c29 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py @@ -112,11 +112,10 @@ def create(self, from_bundle_sid: str) -> ReplaceItemsInstance: "FromBundleSid": from_bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ReplaceItemsInstance( @@ -137,11 +136,10 @@ async def create_async(self, from_bundle_sid: str) -> ReplaceItemsInstance: "FromBundleSid": from_bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ReplaceItemsInstance( diff --git a/twilio/rest/numbers/v2/regulatory_compliance/end_user.py b/twilio/rest/numbers/v2/regulatory_compliance/end_user.py index 3f9e5ec85..7886494d5 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/end_user.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/end_user.py @@ -359,11 +359,10 @@ def create( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EndUserInstance(self._version, payload) @@ -391,11 +390,10 @@ async def create_async( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EndUserInstance(self._version, payload) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py index f2cd4e13d..afa6579a1 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py @@ -377,11 +377,10 @@ def create( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SupportingDocumentInstance(self._version, payload) @@ -409,11 +408,10 @@ async def create_async( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SupportingDocumentInstance(self._version, payload) diff --git a/twilio/rest/oauth/v1/authorize.py b/twilio/rest/oauth/v1/authorize.py index 9798a73f3..19341db74 100644 --- a/twilio/rest/oauth/v1/authorize.py +++ b/twilio/rest/oauth/v1/authorize.py @@ -67,6 +67,7 @@ def fetch( :param response_type: Response Type:param client_id: The Client Identifier:param redirect_uri: The url to which response will be redirected to:param scope: The scope of the access request:param state: An opaque value which can be used to maintain state between the request and callback :returns: The fetched AuthorizeInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { @@ -78,7 +79,9 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=params) + payload = self._version.fetch( + method="GET", uri=self._uri, headers=headers, params=params + ) return AuthorizeInstance(self._version, payload) @@ -96,6 +99,7 @@ async def fetch_async( :param response_type: Response Type:param client_id: The Client Identifier:param redirect_uri: The url to which response will be redirected to:param scope: The scope of the access request:param state: An opaque value which can be used to maintain state between the request and callback :returns: The fetched AuthorizeInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { @@ -108,7 +112,7 @@ async def fetch_async( ) payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=params + method="GET", uri=self._uri, headers=headers, params=params ) return AuthorizeInstance(self._version, payload) diff --git a/twilio/rest/oauth/v1/token.py b/twilio/rest/oauth/v1/token.py index 42884f089..0d5377a9f 100644 --- a/twilio/rest/oauth/v1/token.py +++ b/twilio/rest/oauth/v1/token.py @@ -99,11 +99,10 @@ def create( "Scope": scope, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TokenInstance(self._version, payload) @@ -146,11 +145,10 @@ async def create_async( "Scope": scope, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TokenInstance(self._version, payload) diff --git a/twilio/rest/preview/deployed_devices/fleet/__init__.py b/twilio/rest/preview/deployed_devices/fleet/__init__.py index 0f5c28446..f7321fdb2 100644 --- a/twilio/rest/preview/deployed_devices/fleet/__init__.py +++ b/twilio/rest/preview/deployed_devices/fleet/__init__.py @@ -434,11 +434,10 @@ def create(self, friendly_name: Union[str, object] = values.unset) -> FleetInsta "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FleetInstance(self._version, payload) @@ -459,11 +458,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FleetInstance(self._version, payload) diff --git a/twilio/rest/preview/deployed_devices/fleet/certificate.py b/twilio/rest/preview/deployed_devices/fleet/certificate.py index 1511a0613..895bdc568 100644 --- a/twilio/rest/preview/deployed_devices/fleet/certificate.py +++ b/twilio/rest/preview/deployed_devices/fleet/certificate.py @@ -383,11 +383,10 @@ def create( "DeviceSid": device_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CertificateInstance( @@ -417,11 +416,10 @@ async def create_async( "DeviceSid": device_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CertificateInstance( diff --git a/twilio/rest/preview/deployed_devices/fleet/deployment.py b/twilio/rest/preview/deployed_devices/fleet/deployment.py index 5c0d109ea..80f9f2372 100644 --- a/twilio/rest/preview/deployed_devices/fleet/deployment.py +++ b/twilio/rest/preview/deployed_devices/fleet/deployment.py @@ -378,11 +378,10 @@ def create( "SyncServiceSid": sync_service_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeploymentInstance( @@ -409,11 +408,10 @@ async def create_async( "SyncServiceSid": sync_service_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeploymentInstance( diff --git a/twilio/rest/preview/deployed_devices/fleet/device.py b/twilio/rest/preview/deployed_devices/fleet/device.py index 7e9b81814..3cacc88f2 100644 --- a/twilio/rest/preview/deployed_devices/fleet/device.py +++ b/twilio/rest/preview/deployed_devices/fleet/device.py @@ -421,11 +421,10 @@ def create( "Enabled": serialize.boolean_to_string(enabled), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceInstance( @@ -461,11 +460,10 @@ async def create_async( "Enabled": serialize.boolean_to_string(enabled), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceInstance( diff --git a/twilio/rest/preview/deployed_devices/fleet/key.py b/twilio/rest/preview/deployed_devices/fleet/key.py index eabfc456c..1b7c06e1f 100644 --- a/twilio/rest/preview/deployed_devices/fleet/key.py +++ b/twilio/rest/preview/deployed_devices/fleet/key.py @@ -380,11 +380,10 @@ def create( "DeviceSid": device_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return KeyInstance( @@ -411,11 +410,10 @@ async def create_async( "DeviceSid": device_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return KeyInstance( diff --git a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py index 162d0b11a..79fe4bedd 100644 --- a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py +++ b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py @@ -433,11 +433,10 @@ def create( "CcEmails": serialize.map(cc_emails, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthorizationDocumentInstance(self._version, payload) @@ -476,11 +475,10 @@ async def create_async( "CcEmails": serialize.map(cc_emails, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthorizationDocumentInstance(self._version, payload) diff --git a/twilio/rest/preview/hosted_numbers/hosted_number_order.py b/twilio/rest/preview/hosted_numbers/hosted_number_order.py index 7e68f57b5..7010b1b3e 100644 --- a/twilio/rest/preview/hosted_numbers/hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/hosted_number_order.py @@ -568,11 +568,10 @@ def create( "VerificationDocumentSid": verification_document_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return HostedNumberOrderInstance(self._version, payload) @@ -644,11 +643,10 @@ async def create_async( "VerificationDocumentSid": verification_document_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return HostedNumberOrderInstance(self._version, payload) diff --git a/twilio/rest/preview/marketplace/installed_add_on/__init__.py b/twilio/rest/preview/marketplace/installed_add_on/__init__.py index d067f9fe7..731e84c80 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/installed_add_on/__init__.py @@ -387,11 +387,10 @@ def create( "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnInstance(self._version, payload) @@ -424,11 +423,10 @@ async def create_async( "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnInstance(self._version, payload) diff --git a/twilio/rest/preview/sync/service/__init__.py b/twilio/rest/preview/sync/service/__init__.py index cb8cdf791..23f805a87 100644 --- a/twilio/rest/preview/sync/service/__init__.py +++ b/twilio/rest/preview/sync/service/__init__.py @@ -457,11 +457,10 @@ def create( "AclEnabled": serialize.boolean_to_string(acl_enabled), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -494,11 +493,10 @@ async def create_async( "AclEnabled": serialize.boolean_to_string(acl_enabled), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/preview/sync/service/document/__init__.py b/twilio/rest/preview/sync/service/document/__init__.py index e7ab4ae8b..c7033e2fd 100644 --- a/twilio/rest/preview/sync/service/document/__init__.py +++ b/twilio/rest/preview/sync/service/document/__init__.py @@ -405,11 +405,10 @@ def create( "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DocumentInstance( @@ -436,11 +435,10 @@ async def create_async( "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DocumentInstance( diff --git a/twilio/rest/preview/sync/service/sync_list/__init__.py b/twilio/rest/preview/sync/service/sync_list/__init__.py index fcd2f28ff..4b920e019 100644 --- a/twilio/rest/preview/sync/service/sync_list/__init__.py +++ b/twilio/rest/preview/sync/service/sync_list/__init__.py @@ -323,11 +323,10 @@ def create( "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListInstance( @@ -350,11 +349,10 @@ async def create_async( "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListInstance( diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_item.py b/twilio/rest/preview/sync/service/sync_list/sync_list_item.py index 0cefd6c66..b84411e8a 100644 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_item.py +++ b/twilio/rest/preview/sync/service/sync_list/sync_list_item.py @@ -415,11 +415,10 @@ def create(self, data: object) -> SyncListItemInstance: "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListItemInstance( @@ -443,11 +442,10 @@ async def create_async(self, data: object) -> SyncListItemInstance: "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListItemInstance( diff --git a/twilio/rest/preview/sync/service/sync_map/__init__.py b/twilio/rest/preview/sync/service/sync_map/__init__.py index 1d7993624..19c29f326 100644 --- a/twilio/rest/preview/sync/service/sync_map/__init__.py +++ b/twilio/rest/preview/sync/service/sync_map/__init__.py @@ -321,11 +321,10 @@ def create(self, unique_name: Union[str, object] = values.unset) -> SyncMapInsta "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapInstance( @@ -348,11 +347,10 @@ async def create_async( "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapInstance( diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_item.py b/twilio/rest/preview/sync/service/sync_map/sync_map_item.py index 322c8ed22..78682fe58 100644 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_item.py +++ b/twilio/rest/preview/sync/service/sync_map/sync_map_item.py @@ -417,11 +417,10 @@ def create(self, key: str, data: object) -> SyncMapItemInstance: "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapItemInstance( @@ -447,11 +446,10 @@ async def create_async(self, key: str, data: object) -> SyncMapItemInstance: "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapItemInstance( diff --git a/twilio/rest/preview/wireless/command.py b/twilio/rest/preview/wireless/command.py index 755256bb6..b91d1969e 100644 --- a/twilio/rest/preview/wireless/command.py +++ b/twilio/rest/preview/wireless/command.py @@ -238,11 +238,10 @@ def create( "IncludeSid": include_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CommandInstance(self._version, payload) @@ -282,11 +281,10 @@ async def create_async( "IncludeSid": include_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CommandInstance(self._version, payload) diff --git a/twilio/rest/preview/wireless/rate_plan.py b/twilio/rest/preview/wireless/rate_plan.py index f3484efa6..b9ca020da 100644 --- a/twilio/rest/preview/wireless/rate_plan.py +++ b/twilio/rest/preview/wireless/rate_plan.py @@ -395,11 +395,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RatePlanInstance(self._version, payload) @@ -452,11 +451,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RatePlanInstance(self._version, payload) diff --git a/twilio/rest/proxy/v1/service/__init__.py b/twilio/rest/proxy/v1/service/__init__.py index 6be2def24..7337294a6 100644 --- a/twilio/rest/proxy/v1/service/__init__.py +++ b/twilio/rest/proxy/v1/service/__init__.py @@ -548,11 +548,10 @@ def create( "ChatInstanceSid": chat_instance_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -597,11 +596,10 @@ async def create_async( "ChatInstanceSid": chat_instance_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/proxy/v1/service/phone_number.py b/twilio/rest/proxy/v1/service/phone_number.py index 366b9ba11..05b903360 100644 --- a/twilio/rest/proxy/v1/service/phone_number.py +++ b/twilio/rest/proxy/v1/service/phone_number.py @@ -375,11 +375,10 @@ def create( "IsReserved": serialize.boolean_to_string(is_reserved), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( @@ -409,11 +408,10 @@ async def create_async( "IsReserved": serialize.boolean_to_string(is_reserved), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( diff --git a/twilio/rest/proxy/v1/service/session/__init__.py b/twilio/rest/proxy/v1/service/session/__init__.py index 26ff17788..cfd547b1e 100644 --- a/twilio/rest/proxy/v1/service/session/__init__.py +++ b/twilio/rest/proxy/v1/service/session/__init__.py @@ -486,11 +486,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SessionInstance( @@ -531,11 +530,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SessionInstance( diff --git a/twilio/rest/proxy/v1/service/session/participant/__init__.py b/twilio/rest/proxy/v1/service/session/participant/__init__.py index 266396f08..e2eb3eaae 100644 --- a/twilio/rest/proxy/v1/service/session/participant/__init__.py +++ b/twilio/rest/proxy/v1/service/session/participant/__init__.py @@ -340,11 +340,10 @@ def create( "ProxyIdentifierSid": proxy_identifier_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ParticipantInstance( @@ -380,11 +379,10 @@ async def create_async( "ProxyIdentifierSid": proxy_identifier_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ParticipantInstance( diff --git a/twilio/rest/proxy/v1/service/session/participant/message_interaction.py b/twilio/rest/proxy/v1/service/session/participant/message_interaction.py index b260b4693..55ff64074 100644 --- a/twilio/rest/proxy/v1/service/session/participant/message_interaction.py +++ b/twilio/rest/proxy/v1/service/session/participant/message_interaction.py @@ -332,11 +332,10 @@ def create( "MediaUrl": serialize.map(media_url, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInteractionInstance( @@ -367,11 +366,10 @@ async def create_async( "MediaUrl": serialize.map(media_url, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInteractionInstance( diff --git a/twilio/rest/proxy/v1/service/short_code.py b/twilio/rest/proxy/v1/service/short_code.py index 712d6f82f..e26514bff 100644 --- a/twilio/rest/proxy/v1/service/short_code.py +++ b/twilio/rest/proxy/v1/service/short_code.py @@ -360,11 +360,10 @@ def create(self, sid: str) -> ShortCodeInstance: "Sid": sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ShortCodeInstance( @@ -385,11 +384,10 @@ async def create_async(self, sid: str) -> ShortCodeInstance: "Sid": sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ShortCodeInstance( diff --git a/twilio/rest/serverless/v1/service/__init__.py b/twilio/rest/serverless/v1/service/__init__.py index 0fe404c8f..1658e671f 100644 --- a/twilio/rest/serverless/v1/service/__init__.py +++ b/twilio/rest/serverless/v1/service/__init__.py @@ -460,11 +460,10 @@ def create( "UiEditable": serialize.boolean_to_string(ui_editable), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -495,11 +494,10 @@ async def create_async( "UiEditable": serialize.boolean_to_string(ui_editable), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/serverless/v1/service/asset/__init__.py b/twilio/rest/serverless/v1/service/asset/__init__.py index 2049c9d46..4e413db1d 100644 --- a/twilio/rest/serverless/v1/service/asset/__init__.py +++ b/twilio/rest/serverless/v1/service/asset/__init__.py @@ -371,11 +371,10 @@ def create(self, friendly_name: str) -> AssetInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AssetInstance( @@ -396,11 +395,10 @@ async def create_async(self, friendly_name: str) -> AssetInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AssetInstance( diff --git a/twilio/rest/serverless/v1/service/build/__init__.py b/twilio/rest/serverless/v1/service/build/__init__.py index fa7a7947a..90e5ccec4 100644 --- a/twilio/rest/serverless/v1/service/build/__init__.py +++ b/twilio/rest/serverless/v1/service/build/__init__.py @@ -313,10 +313,12 @@ def create(self, asset_versions: Union[List[str], object]=values.unset, function 'Dependencies': dependencies, 'Runtime': runtime, }) + headers = values.of({ + 'Content-Type': 'application/x-www-form-urlencoded' + }) - - payload = self._version.create(method='POST', uri=self._uri, data=data,) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers) return BuildInstance(self._version, payload, service_sid=self._solution['service_sid']) @@ -338,10 +340,12 @@ async def create_async(self, asset_versions: Union[List[str], object]=values.uns 'Dependencies': dependencies, 'Runtime': runtime, }) + headers = values.of({ + 'Content-Type': 'application/x-www-form-urlencoded' + }) - - payload = await self._version.create_async(method='POST', uri=self._uri, data=data,) + payload = await self._version.create_async(method='POST', uri=self._uri, data=data, headers=headers) return BuildInstance(self._version, payload, service_sid=self._solution['service_sid']) diff --git a/twilio/rest/serverless/v1/service/environment/__init__.py b/twilio/rest/serverless/v1/service/environment/__init__.py index 46b7ddacf..e9df6ecb2 100644 --- a/twilio/rest/serverless/v1/service/environment/__init__.py +++ b/twilio/rest/serverless/v1/service/environment/__init__.py @@ -349,11 +349,10 @@ def create( "DomainSuffix": domain_suffix, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EnvironmentInstance( @@ -378,11 +377,10 @@ async def create_async( "DomainSuffix": domain_suffix, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EnvironmentInstance( diff --git a/twilio/rest/serverless/v1/service/environment/deployment.py b/twilio/rest/serverless/v1/service/environment/deployment.py index 1ff896f93..63ef1b461 100644 --- a/twilio/rest/serverless/v1/service/environment/deployment.py +++ b/twilio/rest/serverless/v1/service/environment/deployment.py @@ -250,11 +250,10 @@ def create( "BuildSid": build_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeploymentInstance( @@ -280,11 +279,10 @@ async def create_async( "BuildSid": build_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeploymentInstance( diff --git a/twilio/rest/serverless/v1/service/environment/variable.py b/twilio/rest/serverless/v1/service/environment/variable.py index f69c129f8..99027536f 100644 --- a/twilio/rest/serverless/v1/service/environment/variable.py +++ b/twilio/rest/serverless/v1/service/environment/variable.py @@ -398,11 +398,10 @@ def create(self, key: str, value: str) -> VariableInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VariableInstance( @@ -428,11 +427,10 @@ async def create_async(self, key: str, value: str) -> VariableInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VariableInstance( diff --git a/twilio/rest/serverless/v1/service/function/__init__.py b/twilio/rest/serverless/v1/service/function/__init__.py index 71bbad846..25a3ef935 100644 --- a/twilio/rest/serverless/v1/service/function/__init__.py +++ b/twilio/rest/serverless/v1/service/function/__init__.py @@ -373,11 +373,10 @@ def create(self, friendly_name: str) -> FunctionInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FunctionInstance( @@ -398,11 +397,10 @@ async def create_async(self, friendly_name: str) -> FunctionInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FunctionInstance( diff --git a/twilio/rest/studio/v1/flow/engagement/__init__.py b/twilio/rest/studio/v1/flow/engagement/__init__.py index f6d95abd5..db0c846e5 100644 --- a/twilio/rest/studio/v1/flow/engagement/__init__.py +++ b/twilio/rest/studio/v1/flow/engagement/__init__.py @@ -336,11 +336,10 @@ def create( "Parameters": serialize.object(parameters), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EngagementInstance( @@ -367,11 +366,10 @@ async def create_async( "Parameters": serialize.object(parameters), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EngagementInstance( diff --git a/twilio/rest/studio/v1/flow/execution/__init__.py b/twilio/rest/studio/v1/flow/execution/__init__.py index 57239e515..6a32cb302 100644 --- a/twilio/rest/studio/v1/flow/execution/__init__.py +++ b/twilio/rest/studio/v1/flow/execution/__init__.py @@ -416,11 +416,10 @@ def create( "Parameters": serialize.object(parameters), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExecutionInstance( @@ -447,11 +446,10 @@ async def create_async( "Parameters": serialize.object(parameters), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExecutionInstance( diff --git a/twilio/rest/studio/v2/flow/__init__.py b/twilio/rest/studio/v2/flow/__init__.py index 21138d29c..057c94969 100644 --- a/twilio/rest/studio/v2/flow/__init__.py +++ b/twilio/rest/studio/v2/flow/__init__.py @@ -464,11 +464,10 @@ def create( "CommitMessage": commit_message, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlowInstance(self._version, payload) @@ -499,11 +498,10 @@ async def create_async( "CommitMessage": commit_message, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlowInstance(self._version, payload) diff --git a/twilio/rest/studio/v2/flow/execution/__init__.py b/twilio/rest/studio/v2/flow/execution/__init__.py index 38d3b2b53..18dcbf062 100644 --- a/twilio/rest/studio/v2/flow/execution/__init__.py +++ b/twilio/rest/studio/v2/flow/execution/__init__.py @@ -414,11 +414,10 @@ def create( "Parameters": serialize.object(parameters), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExecutionInstance( @@ -445,11 +444,10 @@ async def create_async( "Parameters": serialize.object(parameters), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExecutionInstance( diff --git a/twilio/rest/studio/v2/flow_validate.py b/twilio/rest/studio/v2/flow_validate.py index 43f226e15..34f37e152 100644 --- a/twilio/rest/studio/v2/flow_validate.py +++ b/twilio/rest/studio/v2/flow_validate.py @@ -84,11 +84,10 @@ def update( "CommitMessage": commit_message, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlowValidateInstance(self._version, payload) @@ -119,11 +118,10 @@ async def update_async( "CommitMessage": commit_message, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlowValidateInstance(self._version, payload) diff --git a/twilio/rest/supersim/v1/esim_profile.py b/twilio/rest/supersim/v1/esim_profile.py index 847bcae33..7e176bba7 100644 --- a/twilio/rest/supersim/v1/esim_profile.py +++ b/twilio/rest/supersim/v1/esim_profile.py @@ -244,11 +244,10 @@ def create( "Eid": eid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EsimProfileInstance(self._version, payload) @@ -279,11 +278,10 @@ async def create_async( "Eid": eid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EsimProfileInstance(self._version, payload) diff --git a/twilio/rest/supersim/v1/fleet.py b/twilio/rest/supersim/v1/fleet.py index 2003eb77b..2b9fbff44 100644 --- a/twilio/rest/supersim/v1/fleet.py +++ b/twilio/rest/supersim/v1/fleet.py @@ -412,11 +412,10 @@ def create( "SmsCommandsMethod": sms_commands_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FleetInstance(self._version, payload) @@ -462,11 +461,10 @@ async def create_async( "SmsCommandsMethod": sms_commands_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FleetInstance(self._version, payload) diff --git a/twilio/rest/supersim/v1/ip_command.py b/twilio/rest/supersim/v1/ip_command.py index b7610efec..db6ac2643 100644 --- a/twilio/rest/supersim/v1/ip_command.py +++ b/twilio/rest/supersim/v1/ip_command.py @@ -260,11 +260,10 @@ def create( "CallbackMethod": callback_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpCommandInstance(self._version, payload) @@ -301,11 +300,10 @@ async def create_async( "CallbackMethod": callback_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpCommandInstance(self._version, payload) diff --git a/twilio/rest/supersim/v1/network_access_profile/__init__.py b/twilio/rest/supersim/v1/network_access_profile/__init__.py index d0b537469..4937ac50d 100644 --- a/twilio/rest/supersim/v1/network_access_profile/__init__.py +++ b/twilio/rest/supersim/v1/network_access_profile/__init__.py @@ -319,11 +319,10 @@ def create( "Networks": serialize.map(networks, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NetworkAccessProfileInstance(self._version, payload) @@ -348,11 +347,10 @@ async def create_async( "Networks": serialize.map(networks, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NetworkAccessProfileInstance(self._version, payload) diff --git a/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py b/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py index 50a259550..cbe4d5c0e 100644 --- a/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py +++ b/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py @@ -279,11 +279,10 @@ def create(self, network: str) -> NetworkAccessProfileNetworkInstance: "Network": network, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NetworkAccessProfileNetworkInstance( @@ -306,11 +305,10 @@ async def create_async(self, network: str) -> NetworkAccessProfileNetworkInstanc "Network": network, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NetworkAccessProfileNetworkInstance( diff --git a/twilio/rest/supersim/v1/sim/__init__.py b/twilio/rest/supersim/v1/sim/__init__.py index b1ba64733..1452f1eac 100644 --- a/twilio/rest/supersim/v1/sim/__init__.py +++ b/twilio/rest/supersim/v1/sim/__init__.py @@ -413,11 +413,10 @@ def create(self, iccid: str, registration_code: str) -> SimInstance: "RegistrationCode": registration_code, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SimInstance(self._version, payload) @@ -438,11 +437,10 @@ async def create_async(self, iccid: str, registration_code: str) -> SimInstance: "RegistrationCode": registration_code, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SimInstance(self._version, payload) diff --git a/twilio/rest/supersim/v1/sms_command.py b/twilio/rest/supersim/v1/sms_command.py index 0eb209410..26d39a0bf 100644 --- a/twilio/rest/supersim/v1/sms_command.py +++ b/twilio/rest/supersim/v1/sms_command.py @@ -239,11 +239,10 @@ def create( "CallbackUrl": callback_url, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SmsCommandInstance(self._version, payload) @@ -274,11 +273,10 @@ async def create_async( "CallbackUrl": callback_url, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SmsCommandInstance(self._version, payload) diff --git a/twilio/rest/sync/v1/service/__init__.py b/twilio/rest/sync/v1/service/__init__.py index 0bf1045f2..02d4e8f7e 100644 --- a/twilio/rest/sync/v1/service/__init__.py +++ b/twilio/rest/sync/v1/service/__init__.py @@ -549,11 +549,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -599,11 +598,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/sync/v1/service/document/__init__.py b/twilio/rest/sync/v1/service/document/__init__.py index f3b89cfe6..033f27cf4 100644 --- a/twilio/rest/sync/v1/service/document/__init__.py +++ b/twilio/rest/sync/v1/service/document/__init__.py @@ -432,11 +432,10 @@ def create( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DocumentInstance( @@ -466,11 +465,10 @@ async def create_async( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DocumentInstance( diff --git a/twilio/rest/sync/v1/service/sync_list/__init__.py b/twilio/rest/sync/v1/service/sync_list/__init__.py index 7e9ca672c..235fcbd1b 100644 --- a/twilio/rest/sync/v1/service/sync_list/__init__.py +++ b/twilio/rest/sync/v1/service/sync_list/__init__.py @@ -436,11 +436,10 @@ def create( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListInstance( @@ -470,11 +469,10 @@ async def create_async( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListInstance( diff --git a/twilio/rest/sync/v1/service/sync_list/sync_list_item.py b/twilio/rest/sync/v1/service/sync_list/sync_list_item.py index 02dafcd49..0db046e1a 100644 --- a/twilio/rest/sync/v1/service/sync_list/sync_list_item.py +++ b/twilio/rest/sync/v1/service/sync_list/sync_list_item.py @@ -475,11 +475,10 @@ def create( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListItemInstance( @@ -515,11 +514,10 @@ async def create_async( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListItemInstance( diff --git a/twilio/rest/sync/v1/service/sync_map/__init__.py b/twilio/rest/sync/v1/service/sync_map/__init__.py index 1a68e8ef4..1c6b5c9a0 100644 --- a/twilio/rest/sync/v1/service/sync_map/__init__.py +++ b/twilio/rest/sync/v1/service/sync_map/__init__.py @@ -436,11 +436,10 @@ def create( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapInstance( @@ -470,11 +469,10 @@ async def create_async( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapInstance( diff --git a/twilio/rest/sync/v1/service/sync_map/sync_map_item.py b/twilio/rest/sync/v1/service/sync_map/sync_map_item.py index 7c621f8ad..c5381fc59 100644 --- a/twilio/rest/sync/v1/service/sync_map/sync_map_item.py +++ b/twilio/rest/sync/v1/service/sync_map/sync_map_item.py @@ -478,11 +478,10 @@ def create( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapItemInstance( @@ -521,11 +520,10 @@ async def create_async( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapItemInstance( diff --git a/twilio/rest/sync/v1/service/sync_stream/__init__.py b/twilio/rest/sync/v1/service/sync_stream/__init__.py index aa10d164a..c9b98ab7d 100644 --- a/twilio/rest/sync/v1/service/sync_stream/__init__.py +++ b/twilio/rest/sync/v1/service/sync_stream/__init__.py @@ -387,11 +387,10 @@ def create( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncStreamInstance( @@ -418,11 +417,10 @@ async def create_async( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncStreamInstance( diff --git a/twilio/rest/sync/v1/service/sync_stream/stream_message.py b/twilio/rest/sync/v1/service/sync_stream/stream_message.py index 88a7604a7..baca803f9 100644 --- a/twilio/rest/sync/v1/service/sync_stream/stream_message.py +++ b/twilio/rest/sync/v1/service/sync_stream/stream_message.py @@ -89,11 +89,10 @@ def create(self, data: object) -> StreamMessageInstance: "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return StreamMessageInstance( @@ -117,11 +116,10 @@ async def create_async(self, data: object) -> StreamMessageInstance: "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return StreamMessageInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/__init__.py b/twilio/rest/taskrouter/v1/workspace/__init__.py index f1202197c..60085c118 100644 --- a/twilio/rest/taskrouter/v1/workspace/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/__init__.py @@ -671,11 +671,10 @@ def create( "PrioritizeQueueOrder": prioritize_queue_order, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkspaceInstance(self._version, payload) @@ -714,11 +713,10 @@ async def create_async( "PrioritizeQueueOrder": prioritize_queue_order, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkspaceInstance(self._version, payload) diff --git a/twilio/rest/taskrouter/v1/workspace/activity.py b/twilio/rest/taskrouter/v1/workspace/activity.py index bae49d5ef..e211ef9f7 100644 --- a/twilio/rest/taskrouter/v1/workspace/activity.py +++ b/twilio/rest/taskrouter/v1/workspace/activity.py @@ -364,11 +364,10 @@ def create( "Available": serialize.boolean_to_string(available), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ActivityInstance( @@ -393,11 +392,10 @@ async def create_async( "Available": serialize.boolean_to_string(available), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ActivityInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index 9d35415ae..f71c4bd68 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -555,11 +555,10 @@ def create( "TaskQueueSid": task_queue_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskInstance( @@ -607,11 +606,10 @@ async def create_async( "TaskQueueSid": task_queue_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/task_channel.py b/twilio/rest/taskrouter/v1/workspace/task_channel.py index 099f85efb..95a7e5efa 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/task_channel.py @@ -395,11 +395,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskChannelInstance( @@ -431,11 +430,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskChannelInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py index 794fd216d..027cf8dbf 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py @@ -555,11 +555,10 @@ def create( "AssignmentActivitySid": assignment_activity_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskQueueInstance( @@ -598,11 +597,10 @@ async def create_async( "AssignmentActivitySid": assignment_activity_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskQueueInstance( 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 a1c44b164..9ccef4577 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 @@ -92,7 +92,8 @@ def create( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -114,7 +115,8 @@ async def create_async( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py index a236fcae8..8f6ff4c7e 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py @@ -535,11 +535,10 @@ def create( "Attributes": attributes, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkerInstance( @@ -569,11 +568,10 @@ async def create_async( "Attributes": attributes, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkerInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py index f01e76d37..96d7aabf0 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py @@ -526,11 +526,10 @@ def create( "TaskReservationTimeout": task_reservation_timeout, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkflowInstance( @@ -566,11 +565,10 @@ async def create_async( "TaskReservationTimeout": task_reservation_timeout, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkflowInstance( diff --git a/twilio/rest/trunking/v1/trunk/__init__.py b/twilio/rest/trunking/v1/trunk/__init__.py index 16125ead0..b1bfdba11 100644 --- a/twilio/rest/trunking/v1/trunk/__init__.py +++ b/twilio/rest/trunking/v1/trunk/__init__.py @@ -591,11 +591,10 @@ def create( "TransferCallerId": transfer_caller_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrunkInstance(self._version, payload) @@ -640,11 +639,10 @@ async def create_async( "TransferCallerId": transfer_caller_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrunkInstance(self._version, payload) diff --git a/twilio/rest/trunking/v1/trunk/credential_list.py b/twilio/rest/trunking/v1/trunk/credential_list.py index 7dc043d28..e04bb3072 100644 --- a/twilio/rest/trunking/v1/trunk/credential_list.py +++ b/twilio/rest/trunking/v1/trunk/credential_list.py @@ -268,11 +268,10 @@ def create(self, credential_list_sid: str) -> CredentialListInstance: "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialListInstance( @@ -293,11 +292,10 @@ async def create_async(self, credential_list_sid: str) -> CredentialListInstance "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialListInstance( diff --git a/twilio/rest/trunking/v1/trunk/ip_access_control_list.py b/twilio/rest/trunking/v1/trunk/ip_access_control_list.py index b361e7fe9..957084cb6 100644 --- a/twilio/rest/trunking/v1/trunk/ip_access_control_list.py +++ b/twilio/rest/trunking/v1/trunk/ip_access_control_list.py @@ -270,11 +270,10 @@ def create(self, ip_access_control_list_sid: str) -> IpAccessControlListInstance "IpAccessControlListSid": ip_access_control_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAccessControlListInstance( @@ -297,11 +296,10 @@ async def create_async( "IpAccessControlListSid": ip_access_control_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAccessControlListInstance( diff --git a/twilio/rest/trunking/v1/trunk/origination_url.py b/twilio/rest/trunking/v1/trunk/origination_url.py index bcf0c5205..e8e77180e 100644 --- a/twilio/rest/trunking/v1/trunk/origination_url.py +++ b/twilio/rest/trunking/v1/trunk/origination_url.py @@ -429,11 +429,10 @@ def create( "SipUrl": sip_url, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return OriginationUrlInstance( @@ -469,11 +468,10 @@ async def create_async( "SipUrl": sip_url, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return OriginationUrlInstance( diff --git a/twilio/rest/trunking/v1/trunk/phone_number.py b/twilio/rest/trunking/v1/trunk/phone_number.py index 7f0adbeef..75cb5f6c6 100644 --- a/twilio/rest/trunking/v1/trunk/phone_number.py +++ b/twilio/rest/trunking/v1/trunk/phone_number.py @@ -319,11 +319,10 @@ def create(self, phone_number_sid: str) -> PhoneNumberInstance: "PhoneNumberSid": phone_number_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( @@ -344,11 +343,10 @@ async def create_async(self, phone_number_sid: str) -> PhoneNumberInstance: "PhoneNumberSid": phone_number_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( diff --git a/twilio/rest/trusthub/v1/compliance_inquiries.py b/twilio/rest/trusthub/v1/compliance_inquiries.py index b1b52a4f7..6fe6c297b 100644 --- a/twilio/rest/trusthub/v1/compliance_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_inquiries.py @@ -209,11 +209,10 @@ def create( "NotificationEmail": notification_email, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceInquiriesInstance(self._version, payload) @@ -238,11 +237,10 @@ async def create_async( "NotificationEmail": notification_email, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceInquiriesInstance(self._version, payload) diff --git a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py index c279bce12..2f6c46534 100644 --- a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py @@ -378,11 +378,10 @@ def create( "ThemeSetId": theme_set_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceRegistrationInquiriesInstance(self._version, payload) @@ -527,11 +526,10 @@ async def create_async( "ThemeSetId": theme_set_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceRegistrationInquiriesInstance(self._version, payload) diff --git a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py index 490f68b4e..4d8988ab4 100644 --- a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py @@ -93,6 +93,7 @@ def create( business_contact_email: Union[str, object] = values.unset, business_contact_phone: Union[str, object] = values.unset, theme_set_id: Union[str, object] = values.unset, + skip_messaging_use_case: Union[bool, object] = values.unset, ) -> ComplianceTollfreeInquiriesInstance: """ Create the ComplianceTollfreeInquiriesInstance @@ -119,6 +120,7 @@ def create( :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 theme_set_id: Theme id for styling the inquiry form. + :param skip_messaging_use_case: Skip the messaging use case screen of the inquiry form. :returns: The created ComplianceTollfreeInquiriesInstance """ @@ -147,13 +149,15 @@ def create( "BusinessContactEmail": business_contact_email, "BusinessContactPhone": business_contact_phone, "ThemeSetId": theme_set_id, + "SkipMessagingUseCase": serialize.boolean_to_string( + skip_messaging_use_case + ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceTollfreeInquiriesInstance(self._version, payload) @@ -184,6 +188,7 @@ async def create_async( business_contact_email: Union[str, object] = values.unset, business_contact_phone: Union[str, object] = values.unset, theme_set_id: Union[str, object] = values.unset, + skip_messaging_use_case: Union[bool, object] = values.unset, ) -> ComplianceTollfreeInquiriesInstance: """ Asynchronously create the ComplianceTollfreeInquiriesInstance @@ -210,6 +215,7 @@ async def create_async( :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 theme_set_id: Theme id for styling the inquiry form. + :param skip_messaging_use_case: Skip the messaging use case screen of the inquiry form. :returns: The created ComplianceTollfreeInquiriesInstance """ @@ -238,13 +244,15 @@ async def create_async( "BusinessContactEmail": business_contact_email, "BusinessContactPhone": business_contact_phone, "ThemeSetId": theme_set_id, + "SkipMessagingUseCase": serialize.boolean_to_string( + skip_messaging_use_case + ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceTollfreeInquiriesInstance(self._version, payload) diff --git a/twilio/rest/trusthub/v1/customer_profiles/__init__.py b/twilio/rest/trusthub/v1/customer_profiles/__init__.py index 536509277..5079b89e6 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/__init__.py +++ b/twilio/rest/trusthub/v1/customer_profiles/__init__.py @@ -493,11 +493,10 @@ def create( "StatusCallback": status_callback, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesInstance(self._version, payload) @@ -528,11 +527,10 @@ async def create_async( "StatusCallback": status_callback, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesInstance(self._version, payload) diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py index 4cb14c5cc..0369e51d5 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py @@ -282,11 +282,10 @@ def create( "ChannelEndpointSid": channel_endpoint_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesChannelEndpointAssignmentInstance( @@ -313,11 +312,10 @@ async def create_async( "ChannelEndpointSid": channel_endpoint_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesChannelEndpointAssignmentInstance( diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py index 5a19ccaab..8fbb523b8 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py @@ -282,11 +282,10 @@ def create(self, object_sid: str) -> CustomerProfilesEntityAssignmentsInstance: "ObjectSid": object_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesEntityAssignmentsInstance( @@ -311,11 +310,10 @@ async def create_async( "ObjectSid": object_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesEntityAssignmentsInstance( diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py index 60538ee22..b5c3ba746 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py @@ -245,11 +245,10 @@ def create(self, policy_sid: str) -> CustomerProfilesEvaluationsInstance: "PolicySid": policy_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesEvaluationsInstance( @@ -274,11 +273,10 @@ async def create_async( "PolicySid": policy_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesEvaluationsInstance( diff --git a/twilio/rest/trusthub/v1/end_user.py b/twilio/rest/trusthub/v1/end_user.py index b8b08d65c..42bdb155e 100644 --- a/twilio/rest/trusthub/v1/end_user.py +++ b/twilio/rest/trusthub/v1/end_user.py @@ -354,11 +354,10 @@ def create( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EndUserInstance(self._version, payload) @@ -386,11 +385,10 @@ async def create_async( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EndUserInstance(self._version, payload) diff --git a/twilio/rest/trusthub/v1/supporting_document.py b/twilio/rest/trusthub/v1/supporting_document.py index a18293fd8..2336e1fef 100644 --- a/twilio/rest/trusthub/v1/supporting_document.py +++ b/twilio/rest/trusthub/v1/supporting_document.py @@ -373,11 +373,10 @@ def create( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SupportingDocumentInstance(self._version, payload) @@ -405,11 +404,10 @@ async def create_async( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SupportingDocumentInstance(self._version, payload) diff --git a/twilio/rest/trusthub/v1/trust_products/__init__.py b/twilio/rest/trusthub/v1/trust_products/__init__.py index 35f233cc7..c819eb0a0 100644 --- a/twilio/rest/trusthub/v1/trust_products/__init__.py +++ b/twilio/rest/trusthub/v1/trust_products/__init__.py @@ -483,11 +483,10 @@ def create( "StatusCallback": status_callback, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsInstance(self._version, payload) @@ -518,11 +517,10 @@ async def create_async( "StatusCallback": status_callback, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsInstance(self._version, payload) diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py b/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py index ef2b589ff..df69d31dd 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py @@ -284,11 +284,10 @@ def create( "ChannelEndpointSid": channel_endpoint_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsChannelEndpointAssignmentInstance( @@ -315,11 +314,10 @@ async def create_async( "ChannelEndpointSid": channel_endpoint_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsChannelEndpointAssignmentInstance( diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py b/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py index 16f07a892..57e1b3119 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py @@ -276,11 +276,10 @@ def create(self, object_sid: str) -> TrustProductsEntityAssignmentsInstance: "ObjectSid": object_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsEntityAssignmentsInstance( @@ -305,11 +304,10 @@ async def create_async( "ObjectSid": object_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsEntityAssignmentsInstance( diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py b/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py index dfb929bac..3088a2b1b 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py @@ -241,11 +241,10 @@ def create(self, policy_sid: str) -> TrustProductsEvaluationsInstance: "PolicySid": policy_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsEvaluationsInstance( @@ -268,11 +267,10 @@ async def create_async(self, policy_sid: str) -> TrustProductsEvaluationsInstanc "PolicySid": policy_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsEvaluationsInstance( diff --git a/twilio/rest/verify/v2/safelist.py b/twilio/rest/verify/v2/safelist.py index fb71369fb..0ee946a34 100644 --- a/twilio/rest/verify/v2/safelist.py +++ b/twilio/rest/verify/v2/safelist.py @@ -221,11 +221,10 @@ def create(self, phone_number: str) -> SafelistInstance: "PhoneNumber": phone_number, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SafelistInstance(self._version, payload) @@ -244,11 +243,10 @@ async def create_async(self, phone_number: str) -> SafelistInstance: "PhoneNumber": phone_number, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SafelistInstance(self._version, payload) diff --git a/twilio/rest/verify/v2/service/__init__.py b/twilio/rest/verify/v2/service/__init__.py index 36d7c1058..69a6cf853 100644 --- a/twilio/rest/verify/v2/service/__init__.py +++ b/twilio/rest/verify/v2/service/__init__.py @@ -821,11 +821,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -910,11 +909,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/verify/v2/service/access_token.py b/twilio/rest/verify/v2/service/access_token.py index 0bb888a08..917abbc96 100644 --- a/twilio/rest/verify/v2/service/access_token.py +++ b/twilio/rest/verify/v2/service/access_token.py @@ -228,11 +228,10 @@ def create( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccessTokenInstance( @@ -265,11 +264,10 @@ async def create_async( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccessTokenInstance( diff --git a/twilio/rest/verify/v2/service/entity/__init__.py b/twilio/rest/verify/v2/service/entity/__init__.py index 41541a4ca..7371edc08 100644 --- a/twilio/rest/verify/v2/service/entity/__init__.py +++ b/twilio/rest/verify/v2/service/entity/__init__.py @@ -339,11 +339,10 @@ def create(self, identity: str) -> EntityInstance: "Identity": identity, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EntityInstance( @@ -364,11 +363,10 @@ async def create_async(self, identity: str) -> EntityInstance: "Identity": identity, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EntityInstance( diff --git a/twilio/rest/verify/v2/service/entity/challenge/__init__.py b/twilio/rest/verify/v2/service/entity/challenge/__init__.py index ab8c7f8d1..9ca2e4089 100644 --- a/twilio/rest/verify/v2/service/entity/challenge/__init__.py +++ b/twilio/rest/verify/v2/service/entity/challenge/__init__.py @@ -444,11 +444,10 @@ def create( "AuthPayload": auth_payload, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChallengeInstance( @@ -492,11 +491,10 @@ async def create_async( "AuthPayload": auth_payload, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChallengeInstance( diff --git a/twilio/rest/verify/v2/service/entity/challenge/notification.py b/twilio/rest/verify/v2/service/entity/challenge/notification.py index 0cfae0a60..eadf42b81 100644 --- a/twilio/rest/verify/v2/service/entity/challenge/notification.py +++ b/twilio/rest/verify/v2/service/entity/challenge/notification.py @@ -112,11 +112,10 @@ def create(self, ttl: Union[int, object] = values.unset) -> NotificationInstance "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NotificationInstance( @@ -143,11 +142,10 @@ async def create_async( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NotificationInstance( diff --git a/twilio/rest/verify/v2/service/entity/new_factor.py b/twilio/rest/verify/v2/service/entity/new_factor.py index 7b260a4a3..c88a94585 100644 --- a/twilio/rest/verify/v2/service/entity/new_factor.py +++ b/twilio/rest/verify/v2/service/entity/new_factor.py @@ -181,11 +181,10 @@ def create( "Metadata": serialize.object(metadata), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NewFactorInstance( @@ -253,11 +252,10 @@ async def create_async( "Metadata": serialize.object(metadata), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NewFactorInstance( diff --git a/twilio/rest/verify/v2/service/messaging_configuration.py b/twilio/rest/verify/v2/service/messaging_configuration.py index f412aba1e..b84177033 100644 --- a/twilio/rest/verify/v2/service/messaging_configuration.py +++ b/twilio/rest/verify/v2/service/messaging_configuration.py @@ -358,11 +358,10 @@ def create( "MessagingServiceSid": messaging_service_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessagingConfigurationInstance( @@ -387,11 +386,10 @@ async def create_async( "MessagingServiceSid": messaging_service_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessagingConfigurationInstance( diff --git a/twilio/rest/verify/v2/service/rate_limit/__init__.py b/twilio/rest/verify/v2/service/rate_limit/__init__.py index 2d4a18bf0..bdd165858 100644 --- a/twilio/rest/verify/v2/service/rate_limit/__init__.py +++ b/twilio/rest/verify/v2/service/rate_limit/__init__.py @@ -385,11 +385,10 @@ def create( "Description": description, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RateLimitInstance( @@ -414,11 +413,10 @@ async def create_async( "Description": description, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RateLimitInstance( diff --git a/twilio/rest/verify/v2/service/rate_limit/bucket.py b/twilio/rest/verify/v2/service/rate_limit/bucket.py index ca4ffaf77..dee84901e 100644 --- a/twilio/rest/verify/v2/service/rate_limit/bucket.py +++ b/twilio/rest/verify/v2/service/rate_limit/bucket.py @@ -400,11 +400,10 @@ def create(self, max: int, interval: int) -> BucketInstance: "Interval": interval, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BucketInstance( @@ -430,11 +429,10 @@ async def create_async(self, max: int, interval: int) -> BucketInstance: "Interval": interval, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BucketInstance( diff --git a/twilio/rest/verify/v2/service/verification.py b/twilio/rest/verify/v2/service/verification.py index 3ab719551..c8deef535 100644 --- a/twilio/rest/verify/v2/service/verification.py +++ b/twilio/rest/verify/v2/service/verification.py @@ -373,11 +373,10 @@ def create( "Tags": tags, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VerificationInstance( @@ -449,11 +448,10 @@ async def create_async( "Tags": tags, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VerificationInstance( diff --git a/twilio/rest/verify/v2/service/verification_check.py b/twilio/rest/verify/v2/service/verification_check.py index 9744b1bba..af216a39f 100644 --- a/twilio/rest/verify/v2/service/verification_check.py +++ b/twilio/rest/verify/v2/service/verification_check.py @@ -130,11 +130,10 @@ def create( "Payee": payee, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VerificationCheckInstance( @@ -170,11 +169,10 @@ async def create_async( "Payee": payee, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VerificationCheckInstance( diff --git a/twilio/rest/verify/v2/service/webhook.py b/twilio/rest/verify/v2/service/webhook.py index 4f8772574..67ffced26 100644 --- a/twilio/rest/verify/v2/service/webhook.py +++ b/twilio/rest/verify/v2/service/webhook.py @@ -446,11 +446,10 @@ def create( "Version": version, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -486,11 +485,10 @@ async def create_async( "Version": version, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( diff --git a/twilio/rest/video/v1/composition.py b/twilio/rest/video/v1/composition.py index 30aa33fff..8add1e74e 100644 --- a/twilio/rest/video/v1/composition.py +++ b/twilio/rest/video/v1/composition.py @@ -328,11 +328,10 @@ def create( "Trim": serialize.boolean_to_string(trim), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CompositionInstance(self._version, payload) @@ -380,11 +379,10 @@ async def create_async( "Trim": serialize.boolean_to_string(trim), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CompositionInstance(self._version, payload) diff --git a/twilio/rest/video/v1/composition_hook.py b/twilio/rest/video/v1/composition_hook.py index 027a27f74..0f833f793 100644 --- a/twilio/rest/video/v1/composition_hook.py +++ b/twilio/rest/video/v1/composition_hook.py @@ -504,11 +504,10 @@ def create( "Trim": serialize.boolean_to_string(trim), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CompositionHookInstance(self._version, payload) @@ -559,11 +558,10 @@ async def create_async( "Trim": serialize.boolean_to_string(trim), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CompositionHookInstance(self._version, payload) diff --git a/twilio/rest/video/v1/room/__init__.py b/twilio/rest/video/v1/room/__init__.py index a8ffdb895..c735e5516 100644 --- a/twilio/rest/video/v1/room/__init__.py +++ b/twilio/rest/video/v1/room/__init__.py @@ -456,11 +456,10 @@ def create( "LargeRoom": serialize.boolean_to_string(large_room), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoomInstance(self._version, payload) @@ -526,11 +525,10 @@ async def create_async( "LargeRoom": serialize.boolean_to_string(large_room), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoomInstance(self._version, payload) diff --git a/twilio/rest/video/v1/room/participant/subscribe_rules.py b/twilio/rest/video/v1/room/participant/subscribe_rules.py index e07d3b5ff..a15503849 100644 --- a/twilio/rest/video/v1/room/participant/subscribe_rules.py +++ b/twilio/rest/video/v1/room/participant/subscribe_rules.py @@ -95,8 +95,9 @@ def fetch(self) -> SubscribeRulesInstance: :returns: The fetched SubscribeRulesInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = self._version.fetch(method="GET", uri=self._uri) + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SubscribeRulesInstance( self._version, @@ -112,8 +113,11 @@ async def fetch_async(self) -> SubscribeRulesInstance: :returns: The fetched SubscribeRulesInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = await self._version.fetch_async(method="GET", uri=self._uri) + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) return SubscribeRulesInstance( self._version, @@ -138,11 +142,10 @@ def update( "Rules": serialize.object(rules), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscribeRulesInstance( @@ -168,11 +171,10 @@ async def update_async( "Rules": serialize.object(rules), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscribeRulesInstance( diff --git a/twilio/rest/video/v1/room/recording_rules.py b/twilio/rest/video/v1/room/recording_rules.py index c94bbf149..f85ebe896 100644 --- a/twilio/rest/video/v1/room/recording_rules.py +++ b/twilio/rest/video/v1/room/recording_rules.py @@ -80,8 +80,9 @@ def fetch(self) -> RecordingRulesInstance: :returns: The fetched RecordingRulesInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = self._version.fetch(method="GET", uri=self._uri) + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RecordingRulesInstance( self._version, payload, room_sid=self._solution["room_sid"] @@ -94,8 +95,11 @@ async def fetch_async(self) -> RecordingRulesInstance: :returns: The fetched RecordingRulesInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = await self._version.fetch_async(method="GET", uri=self._uri) + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) return RecordingRulesInstance( self._version, payload, room_sid=self._solution["room_sid"] @@ -117,11 +121,10 @@ def update( "Rules": serialize.object(rules), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RecordingRulesInstance( @@ -144,11 +147,10 @@ async def update_async( "Rules": serialize.object(rules), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RecordingRulesInstance( diff --git a/twilio/rest/voice/v1/byoc_trunk.py b/twilio/rest/voice/v1/byoc_trunk.py index a85cae660..1c3e301d7 100644 --- a/twilio/rest/voice/v1/byoc_trunk.py +++ b/twilio/rest/voice/v1/byoc_trunk.py @@ -487,11 +487,10 @@ def create( "FromDomainSid": from_domain_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ByocTrunkInstance(self._version, payload) @@ -540,11 +539,10 @@ async def create_async( "FromDomainSid": from_domain_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ByocTrunkInstance(self._version, payload) diff --git a/twilio/rest/voice/v1/connection_policy/__init__.py b/twilio/rest/voice/v1/connection_policy/__init__.py index d1d8aac89..4e65be651 100644 --- a/twilio/rest/voice/v1/connection_policy/__init__.py +++ b/twilio/rest/voice/v1/connection_policy/__init__.py @@ -357,11 +357,10 @@ def create( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConnectionPolicyInstance(self._version, payload) @@ -382,11 +381,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConnectionPolicyInstance(self._version, payload) 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 2fa490880..05daee6c7 100644 --- a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py +++ b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py @@ -435,11 +435,10 @@ def create( "Enabled": serialize.boolean_to_string(enabled), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConnectionPolicyTargetInstance( @@ -477,11 +476,10 @@ async def create_async( "Enabled": serialize.boolean_to_string(enabled), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConnectionPolicyTargetInstance( diff --git a/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py b/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py index 60aa2642f..5b0d35d3d 100644 --- a/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py +++ b/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py @@ -71,11 +71,10 @@ def create(self, update_request: str) -> BulkCountryUpdateInstance: "UpdateRequest": update_request, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BulkCountryUpdateInstance(self._version, payload) @@ -94,11 +93,10 @@ async def create_async(self, update_request: str) -> BulkCountryUpdateInstance: "UpdateRequest": update_request, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BulkCountryUpdateInstance(self._version, payload) diff --git a/twilio/rest/voice/v1/ip_record.py b/twilio/rest/voice/v1/ip_record.py index ee409ba78..5c103bf98 100644 --- a/twilio/rest/voice/v1/ip_record.py +++ b/twilio/rest/voice/v1/ip_record.py @@ -340,11 +340,10 @@ def create( "CidrPrefixLength": cidr_prefix_length, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpRecordInstance(self._version, payload) @@ -372,11 +371,10 @@ async def create_async( "CidrPrefixLength": cidr_prefix_length, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpRecordInstance(self._version, payload) diff --git a/twilio/rest/voice/v1/source_ip_mapping.py b/twilio/rest/voice/v1/source_ip_mapping.py index 8a0d4a912..50e2bbe36 100644 --- a/twilio/rest/voice/v1/source_ip_mapping.py +++ b/twilio/rest/voice/v1/source_ip_mapping.py @@ -325,11 +325,10 @@ def create( "SipDomainSid": sip_domain_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SourceIpMappingInstance(self._version, payload) @@ -352,11 +351,10 @@ async def create_async( "SipDomainSid": sip_domain_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SourceIpMappingInstance(self._version, payload) diff --git a/twilio/rest/wireless/v1/command.py b/twilio/rest/wireless/v1/command.py index f310db891..3dc78e9b8 100644 --- a/twilio/rest/wireless/v1/command.py +++ b/twilio/rest/wireless/v1/command.py @@ -308,11 +308,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CommandInstance(self._version, payload) @@ -354,11 +353,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CommandInstance(self._version, payload) diff --git a/twilio/rest/wireless/v1/rate_plan.py b/twilio/rest/wireless/v1/rate_plan.py index 0ee1e205a..5370ef2ae 100644 --- a/twilio/rest/wireless/v1/rate_plan.py +++ b/twilio/rest/wireless/v1/rate_plan.py @@ -406,11 +406,10 @@ def create( "InternationalRoamingDataLimit": international_roaming_data_limit, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RatePlanInstance(self._version, payload) @@ -466,11 +465,10 @@ async def create_async( "InternationalRoamingDataLimit": international_roaming_data_limit, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RatePlanInstance(self._version, payload)