diff --git a/CHANGES.md b/CHANGES.md index 1dfa5043a..a9e681101 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,60 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-07-02] Version 9.2.3 +-------------------------- +**Intelligence** +- Deprecate account flag api.twilio-intelligence.v2 + + +[2024-06-27] Version 9.2.2 +-------------------------- +**Api** +- Add `transcription` resource + +**Flex** +- Changed mount name for flex_team v2 api + +**Intelligence** +- Add `X-Rate-Limit-Limit`, `X-Rate-Limit-Remaining`, and `X-Rate-Limit-Config` as Response Headers to Operator resources + +**Numbers** +- Added include_constraints query parameter to the Regulations API + +**Twiml** +- Add support for `` noun + + +[2024-06-21] Version 9.2.1 +-------------------------- +**Api** +- Add beta feature request managed cert + + +[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/setup.py b/setup.py index 9d8084608..8fee9aa18 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.1.1", + version="9.2.3", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 00a5b6d72..bb8cd36f5 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "1", "1") +__version_info__ = ("9", "2", "3") __version__ = ".".join(__version_info__) diff --git a/twilio/base/client_base.py b/twilio/base/client_base.py index c9e0f9c48..5f17c7540 100644 --- a/twilio/base/client_base.py +++ b/twilio/base/client_base.py @@ -184,7 +184,7 @@ def get_headers( # Types, encodings, etc. headers["Accept-Charset"] = "utf-8" - if method == "POST" and "Content-Type" not in headers: + if (method == "POST" or method == "PUT") and ("Content-Type" not in headers): headers["Content-Type"] = "application/x-www-form-urlencoded" if "Accept" not in headers: headers["Accept"] = "application/json" diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index e6e57bafd..6da8da4a1 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -23,6 +23,7 @@ from twilio.rest.events import Events from twilio.rest.flex_api import FlexApi from twilio.rest.frontline_api import FrontlineApi + from twilio.rest.preview_iam import PreviewIam from twilio.rest.insights import Insights from twilio.rest.intelligence import Intelligence from twilio.rest.ip_messaging import IpMessaging @@ -131,6 +132,7 @@ def __init__( self._events: Optional["Events"] = None self._flex_api: Optional["FlexApi"] = None self._frontline_api: Optional["FrontlineApi"] = None + self._preview_iam: Optional["PreviewIam"] = None self._insights: Optional["Insights"] = None self._intelligence: Optional["Intelligence"] = None self._ip_messaging: Optional["IpMessaging"] = None @@ -276,6 +278,19 @@ def frontline_api(self) -> "FrontlineApi": self._frontline_api = FrontlineApi(self) return self._frontline_api + @property + def preview_iam(self) -> "PreviewIam": + """ + Access the PreviewIam Twilio Domain + + :returns: PreviewIam Twilio Domain + """ + if self._preview_iam is None: + from twilio.rest.preview_iam import PreviewIam + + self._preview_iam = PreviewIam(self) + return self._preview_iam + @property def insights(self) -> "Insights": """ 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..ff9e98b09 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -26,6 +26,7 @@ from twilio.rest.api.v2010.account.call.recording import RecordingList from twilio.rest.api.v2010.account.call.siprec import SiprecList from twilio.rest.api.v2010.account.call.stream import StreamList +from twilio.rest.api.v2010.account.call.transcription import TranscriptionList from twilio.rest.api.v2010.account.call.user_defined_message import ( UserDefinedMessageList, ) @@ -65,7 +66,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. @@ -303,6 +304,13 @@ def streams(self) -> StreamList: """ return self._proxy.streams + @property + def transcriptions(self) -> TranscriptionList: + """ + Access the transcriptions + """ + return self._proxy.transcriptions + @property def user_defined_messages(self) -> UserDefinedMessageList: """ @@ -352,6 +360,7 @@ def __init__(self, version: Version, account_sid: str, sid: str): self._recordings: Optional[RecordingList] = None self._siprec: Optional[SiprecList] = None self._streams: Optional[StreamList] = None + self._transcriptions: Optional[TranscriptionList] = None self._user_defined_messages: Optional[UserDefinedMessageList] = None self._user_defined_message_subscriptions: Optional[ UserDefinedMessageSubscriptionList @@ -607,6 +616,19 @@ def streams(self) -> StreamList: ) return self._streams + @property + def transcriptions(self) -> TranscriptionList: + """ + Access the transcriptions + """ + if self._transcriptions is None: + self._transcriptions = TranscriptionList( + self._version, + self._solution["account_sid"], + self._solution["sid"], + ) + return self._transcriptions + @property def user_defined_messages(self) -> UserDefinedMessageList: """ @@ -807,11 +829,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 +962,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/transcription.py b/twilio/rest/api/v2010/account/call/transcription.py new file mode 100644 index 000000000..96554eaa0 --- /dev/null +++ b/twilio/rest/api/v2010/account/call/transcription.py @@ -0,0 +1,1605 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Api + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, serialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class TranscriptionInstance(InstanceResource): + + class Status(object): + IN_PROGRESS = "in-progress" + STOPPED = "stopped" + + class Track(object): + INBOUND_TRACK = "inbound_track" + OUTBOUND_TRACK = "outbound_track" + BOTH_TRACKS = "both_tracks" + + class UpdateStatus(object): + STOPPED = "stopped" + + """ + :ivar sid: The SID of the Transcription resource. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Transcription resource. + :ivar call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Transcription resource is associated with. + :ivar name: The user-specified name of this Transcription, if one was given when the Transcription was created. This may be used to stop the Transcription. + :ivar status: + :ivar date_updated: The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar uri: + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + account_sid: str, + call_sid: str, + sid: Optional[str] = None, + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.call_sid: Optional[str] = payload.get("call_sid") + self.name: Optional[str] = payload.get("name") + self.status: Optional["TranscriptionInstance.Status"] = payload.get("status") + self.date_updated: Optional[datetime] = deserialize.rfc2822_datetime( + payload.get("date_updated") + ) + self.uri: Optional[str] = payload.get("uri") + + self._solution = { + "account_sid": account_sid, + "call_sid": call_sid, + "sid": sid or self.sid, + } + self._context: Optional[TranscriptionContext] = None + + @property + def _proxy(self) -> "TranscriptionContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: TranscriptionContext for this TranscriptionInstance + """ + if self._context is None: + self._context = TranscriptionContext( + self._version, + account_sid=self._solution["account_sid"], + call_sid=self._solution["call_sid"], + sid=self._solution["sid"], + ) + return self._context + + def update( + self, status: "TranscriptionInstance.UpdateStatus" + ) -> "TranscriptionInstance": + """ + Update the TranscriptionInstance + + :param status: + + :returns: The updated TranscriptionInstance + """ + return self._proxy.update( + status=status, + ) + + async def update_async( + self, status: "TranscriptionInstance.UpdateStatus" + ) -> "TranscriptionInstance": + """ + Asynchronous coroutine to update the TranscriptionInstance + + :param status: + + :returns: The updated TranscriptionInstance + """ + return await self._proxy.update_async( + status=status, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class TranscriptionContext(InstanceContext): + + def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): + """ + Initialize the TranscriptionContext + + :param version: Version that contains the resource + :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Transcription resource. + :param call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Transcription resource is associated with. + :param sid: The SID of the Transcription resource, or the `name` used when creating the resource + """ + super().__init__(version) + + # Path Solution + self._solution = { + "account_sid": account_sid, + "call_sid": call_sid, + "sid": sid, + } + self._uri = ( + "/Accounts/{account_sid}/Calls/{call_sid}/Transcriptions/{sid}.json".format( + **self._solution + ) + ) + + def update( + self, status: "TranscriptionInstance.UpdateStatus" + ) -> TranscriptionInstance: + """ + Update the TranscriptionInstance + + :param status: + + :returns: The updated TranscriptionInstance + """ + data = values.of( + { + "Status": status, + } + ) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return TranscriptionInstance( + self._version, + payload, + account_sid=self._solution["account_sid"], + call_sid=self._solution["call_sid"], + sid=self._solution["sid"], + ) + + async def update_async( + self, status: "TranscriptionInstance.UpdateStatus" + ) -> TranscriptionInstance: + """ + Asynchronous coroutine to update the TranscriptionInstance + + :param status: + + :returns: The updated TranscriptionInstance + """ + data = values.of( + { + "Status": status, + } + ) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return TranscriptionInstance( + self._version, + payload, + account_sid=self._solution["account_sid"], + call_sid=self._solution["call_sid"], + sid=self._solution["sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class TranscriptionList(ListResource): + + def __init__(self, version: Version, account_sid: str, call_sid: str): + """ + Initialize the TranscriptionList + + :param version: Version that contains the resource + :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Transcription resource. + :param call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Transcription resource is associated with. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "account_sid": account_sid, + "call_sid": call_sid, + } + self._uri = ( + "/Accounts/{account_sid}/Calls/{call_sid}/Transcriptions.json".format( + **self._solution + ) + ) + + def create( + self, + name: Union[str, object] = values.unset, + track: Union["TranscriptionInstance.Track", object] = values.unset, + status_callback_url: Union[str, object] = values.unset, + status_callback_method: Union[str, object] = values.unset, + inbound_track_label: Union[str, object] = values.unset, + outbound_track_label: Union[str, object] = values.unset, + partial_results: Union[bool, object] = values.unset, + language_code: Union[str, object] = values.unset, + transcription_engine: Union[str, object] = values.unset, + profanity_filter: Union[bool, object] = values.unset, + speech_model: Union[str, object] = values.unset, + hints: Union[str, object] = values.unset, + enable_automatic_punctuation: Union[bool, object] = values.unset, + parameter1_name: Union[str, object] = values.unset, + parameter1_value: Union[str, object] = values.unset, + parameter2_name: Union[str, object] = values.unset, + parameter2_value: Union[str, object] = values.unset, + parameter3_name: Union[str, object] = values.unset, + parameter3_value: Union[str, object] = values.unset, + parameter4_name: Union[str, object] = values.unset, + parameter4_value: Union[str, object] = values.unset, + parameter5_name: Union[str, object] = values.unset, + parameter5_value: Union[str, object] = values.unset, + parameter6_name: Union[str, object] = values.unset, + parameter6_value: Union[str, object] = values.unset, + parameter7_name: Union[str, object] = values.unset, + parameter7_value: Union[str, object] = values.unset, + parameter8_name: Union[str, object] = values.unset, + parameter8_value: Union[str, object] = values.unset, + parameter9_name: Union[str, object] = values.unset, + parameter9_value: Union[str, object] = values.unset, + parameter10_name: Union[str, object] = values.unset, + parameter10_value: Union[str, object] = values.unset, + parameter11_name: Union[str, object] = values.unset, + parameter11_value: Union[str, object] = values.unset, + parameter12_name: Union[str, object] = values.unset, + parameter12_value: Union[str, object] = values.unset, + parameter13_name: Union[str, object] = values.unset, + parameter13_value: Union[str, object] = values.unset, + parameter14_name: Union[str, object] = values.unset, + parameter14_value: Union[str, object] = values.unset, + parameter15_name: Union[str, object] = values.unset, + parameter15_value: Union[str, object] = values.unset, + parameter16_name: Union[str, object] = values.unset, + parameter16_value: Union[str, object] = values.unset, + parameter17_name: Union[str, object] = values.unset, + parameter17_value: Union[str, object] = values.unset, + parameter18_name: Union[str, object] = values.unset, + parameter18_value: Union[str, object] = values.unset, + parameter19_name: Union[str, object] = values.unset, + parameter19_value: Union[str, object] = values.unset, + parameter20_name: Union[str, object] = values.unset, + parameter20_value: Union[str, object] = values.unset, + parameter21_name: Union[str, object] = values.unset, + parameter21_value: Union[str, object] = values.unset, + parameter22_name: Union[str, object] = values.unset, + parameter22_value: Union[str, object] = values.unset, + parameter23_name: Union[str, object] = values.unset, + parameter23_value: Union[str, object] = values.unset, + parameter24_name: Union[str, object] = values.unset, + parameter24_value: Union[str, object] = values.unset, + parameter25_name: Union[str, object] = values.unset, + parameter25_value: Union[str, object] = values.unset, + parameter26_name: Union[str, object] = values.unset, + parameter26_value: Union[str, object] = values.unset, + parameter27_name: Union[str, object] = values.unset, + parameter27_value: Union[str, object] = values.unset, + parameter28_name: Union[str, object] = values.unset, + parameter28_value: Union[str, object] = values.unset, + parameter29_name: Union[str, object] = values.unset, + parameter29_value: Union[str, object] = values.unset, + parameter30_name: Union[str, object] = values.unset, + parameter30_value: Union[str, object] = values.unset, + parameter31_name: Union[str, object] = values.unset, + parameter31_value: Union[str, object] = values.unset, + parameter32_name: Union[str, object] = values.unset, + parameter32_value: Union[str, object] = values.unset, + parameter33_name: Union[str, object] = values.unset, + parameter33_value: Union[str, object] = values.unset, + parameter34_name: Union[str, object] = values.unset, + parameter34_value: Union[str, object] = values.unset, + parameter35_name: Union[str, object] = values.unset, + parameter35_value: Union[str, object] = values.unset, + parameter36_name: Union[str, object] = values.unset, + parameter36_value: Union[str, object] = values.unset, + parameter37_name: Union[str, object] = values.unset, + parameter37_value: Union[str, object] = values.unset, + parameter38_name: Union[str, object] = values.unset, + parameter38_value: Union[str, object] = values.unset, + parameter39_name: Union[str, object] = values.unset, + parameter39_value: Union[str, object] = values.unset, + parameter40_name: Union[str, object] = values.unset, + parameter40_value: Union[str, object] = values.unset, + parameter41_name: Union[str, object] = values.unset, + parameter41_value: Union[str, object] = values.unset, + parameter42_name: Union[str, object] = values.unset, + parameter42_value: Union[str, object] = values.unset, + parameter43_name: Union[str, object] = values.unset, + parameter43_value: Union[str, object] = values.unset, + parameter44_name: Union[str, object] = values.unset, + parameter44_value: Union[str, object] = values.unset, + parameter45_name: Union[str, object] = values.unset, + parameter45_value: Union[str, object] = values.unset, + parameter46_name: Union[str, object] = values.unset, + parameter46_value: Union[str, object] = values.unset, + parameter47_name: Union[str, object] = values.unset, + parameter47_value: Union[str, object] = values.unset, + parameter48_name: Union[str, object] = values.unset, + parameter48_value: Union[str, object] = values.unset, + parameter49_name: Union[str, object] = values.unset, + parameter49_value: Union[str, object] = values.unset, + parameter50_name: Union[str, object] = values.unset, + parameter50_value: Union[str, object] = values.unset, + parameter51_name: Union[str, object] = values.unset, + parameter51_value: Union[str, object] = values.unset, + parameter52_name: Union[str, object] = values.unset, + parameter52_value: Union[str, object] = values.unset, + parameter53_name: Union[str, object] = values.unset, + parameter53_value: Union[str, object] = values.unset, + parameter54_name: Union[str, object] = values.unset, + parameter54_value: Union[str, object] = values.unset, + parameter55_name: Union[str, object] = values.unset, + parameter55_value: Union[str, object] = values.unset, + parameter56_name: Union[str, object] = values.unset, + parameter56_value: Union[str, object] = values.unset, + parameter57_name: Union[str, object] = values.unset, + parameter57_value: Union[str, object] = values.unset, + parameter58_name: Union[str, object] = values.unset, + parameter58_value: Union[str, object] = values.unset, + parameter59_name: Union[str, object] = values.unset, + parameter59_value: Union[str, object] = values.unset, + parameter60_name: Union[str, object] = values.unset, + parameter60_value: Union[str, object] = values.unset, + parameter61_name: Union[str, object] = values.unset, + parameter61_value: Union[str, object] = values.unset, + parameter62_name: Union[str, object] = values.unset, + parameter62_value: Union[str, object] = values.unset, + parameter63_name: Union[str, object] = values.unset, + parameter63_value: Union[str, object] = values.unset, + parameter64_name: Union[str, object] = values.unset, + parameter64_value: Union[str, object] = values.unset, + parameter65_name: Union[str, object] = values.unset, + parameter65_value: Union[str, object] = values.unset, + parameter66_name: Union[str, object] = values.unset, + parameter66_value: Union[str, object] = values.unset, + parameter67_name: Union[str, object] = values.unset, + parameter67_value: Union[str, object] = values.unset, + parameter68_name: Union[str, object] = values.unset, + parameter68_value: Union[str, object] = values.unset, + parameter69_name: Union[str, object] = values.unset, + parameter69_value: Union[str, object] = values.unset, + parameter70_name: Union[str, object] = values.unset, + parameter70_value: Union[str, object] = values.unset, + parameter71_name: Union[str, object] = values.unset, + parameter71_value: Union[str, object] = values.unset, + parameter72_name: Union[str, object] = values.unset, + parameter72_value: Union[str, object] = values.unset, + parameter73_name: Union[str, object] = values.unset, + parameter73_value: Union[str, object] = values.unset, + parameter74_name: Union[str, object] = values.unset, + parameter74_value: Union[str, object] = values.unset, + parameter75_name: Union[str, object] = values.unset, + parameter75_value: Union[str, object] = values.unset, + parameter76_name: Union[str, object] = values.unset, + parameter76_value: Union[str, object] = values.unset, + parameter77_name: Union[str, object] = values.unset, + parameter77_value: Union[str, object] = values.unset, + parameter78_name: Union[str, object] = values.unset, + parameter78_value: Union[str, object] = values.unset, + parameter79_name: Union[str, object] = values.unset, + parameter79_value: Union[str, object] = values.unset, + parameter80_name: Union[str, object] = values.unset, + parameter80_value: Union[str, object] = values.unset, + parameter81_name: Union[str, object] = values.unset, + parameter81_value: Union[str, object] = values.unset, + parameter82_name: Union[str, object] = values.unset, + parameter82_value: Union[str, object] = values.unset, + parameter83_name: Union[str, object] = values.unset, + parameter83_value: Union[str, object] = values.unset, + parameter84_name: Union[str, object] = values.unset, + parameter84_value: Union[str, object] = values.unset, + parameter85_name: Union[str, object] = values.unset, + parameter85_value: Union[str, object] = values.unset, + parameter86_name: Union[str, object] = values.unset, + parameter86_value: Union[str, object] = values.unset, + parameter87_name: Union[str, object] = values.unset, + parameter87_value: Union[str, object] = values.unset, + parameter88_name: Union[str, object] = values.unset, + parameter88_value: Union[str, object] = values.unset, + parameter89_name: Union[str, object] = values.unset, + parameter89_value: Union[str, object] = values.unset, + parameter90_name: Union[str, object] = values.unset, + parameter90_value: Union[str, object] = values.unset, + parameter91_name: Union[str, object] = values.unset, + parameter91_value: Union[str, object] = values.unset, + parameter92_name: Union[str, object] = values.unset, + parameter92_value: Union[str, object] = values.unset, + parameter93_name: Union[str, object] = values.unset, + parameter93_value: Union[str, object] = values.unset, + parameter94_name: Union[str, object] = values.unset, + parameter94_value: Union[str, object] = values.unset, + parameter95_name: Union[str, object] = values.unset, + parameter95_value: Union[str, object] = values.unset, + parameter96_name: Union[str, object] = values.unset, + parameter96_value: Union[str, object] = values.unset, + parameter97_name: Union[str, object] = values.unset, + parameter97_value: Union[str, object] = values.unset, + parameter98_name: Union[str, object] = values.unset, + parameter98_value: Union[str, object] = values.unset, + parameter99_name: Union[str, object] = values.unset, + parameter99_value: Union[str, object] = values.unset, + ) -> TranscriptionInstance: + """ + Create the TranscriptionInstance + + :param name: The user-specified name of this Transcription, if one was given when the Transcription was created. This may be used to stop the Transcription. + :param track: + :param status_callback_url: Absolute URL of the status callback. + :param status_callback_method: The http method for the status_callback (one of GET, POST). + :param inbound_track_label: Friendly name given to the Inbound Track + :param outbound_track_label: Friendly name given to the Outbound Track + :param partial_results: Indicates if partial results are going to be send to the customer + :param language_code: Language code used by the transcription engine, specified in [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) format + :param transcription_engine: Definition of the transcription engine to be used, between those supported by Twilio + :param profanity_filter: indicates if the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks + :param speech_model: Recognition model used by the transcription engine, between those supported by the provider + :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. + :param enable_automatic_punctuation: The provider will adds punctuation to recognition result hypotheses + :param parameter1_name: Parameter name + :param parameter1_value: Parameter value + :param parameter2_name: Parameter name + :param parameter2_value: Parameter value + :param parameter3_name: Parameter name + :param parameter3_value: Parameter value + :param parameter4_name: Parameter name + :param parameter4_value: Parameter value + :param parameter5_name: Parameter name + :param parameter5_value: Parameter value + :param parameter6_name: Parameter name + :param parameter6_value: Parameter value + :param parameter7_name: Parameter name + :param parameter7_value: Parameter value + :param parameter8_name: Parameter name + :param parameter8_value: Parameter value + :param parameter9_name: Parameter name + :param parameter9_value: Parameter value + :param parameter10_name: Parameter name + :param parameter10_value: Parameter value + :param parameter11_name: Parameter name + :param parameter11_value: Parameter value + :param parameter12_name: Parameter name + :param parameter12_value: Parameter value + :param parameter13_name: Parameter name + :param parameter13_value: Parameter value + :param parameter14_name: Parameter name + :param parameter14_value: Parameter value + :param parameter15_name: Parameter name + :param parameter15_value: Parameter value + :param parameter16_name: Parameter name + :param parameter16_value: Parameter value + :param parameter17_name: Parameter name + :param parameter17_value: Parameter value + :param parameter18_name: Parameter name + :param parameter18_value: Parameter value + :param parameter19_name: Parameter name + :param parameter19_value: Parameter value + :param parameter20_name: Parameter name + :param parameter20_value: Parameter value + :param parameter21_name: Parameter name + :param parameter21_value: Parameter value + :param parameter22_name: Parameter name + :param parameter22_value: Parameter value + :param parameter23_name: Parameter name + :param parameter23_value: Parameter value + :param parameter24_name: Parameter name + :param parameter24_value: Parameter value + :param parameter25_name: Parameter name + :param parameter25_value: Parameter value + :param parameter26_name: Parameter name + :param parameter26_value: Parameter value + :param parameter27_name: Parameter name + :param parameter27_value: Parameter value + :param parameter28_name: Parameter name + :param parameter28_value: Parameter value + :param parameter29_name: Parameter name + :param parameter29_value: Parameter value + :param parameter30_name: Parameter name + :param parameter30_value: Parameter value + :param parameter31_name: Parameter name + :param parameter31_value: Parameter value + :param parameter32_name: Parameter name + :param parameter32_value: Parameter value + :param parameter33_name: Parameter name + :param parameter33_value: Parameter value + :param parameter34_name: Parameter name + :param parameter34_value: Parameter value + :param parameter35_name: Parameter name + :param parameter35_value: Parameter value + :param parameter36_name: Parameter name + :param parameter36_value: Parameter value + :param parameter37_name: Parameter name + :param parameter37_value: Parameter value + :param parameter38_name: Parameter name + :param parameter38_value: Parameter value + :param parameter39_name: Parameter name + :param parameter39_value: Parameter value + :param parameter40_name: Parameter name + :param parameter40_value: Parameter value + :param parameter41_name: Parameter name + :param parameter41_value: Parameter value + :param parameter42_name: Parameter name + :param parameter42_value: Parameter value + :param parameter43_name: Parameter name + :param parameter43_value: Parameter value + :param parameter44_name: Parameter name + :param parameter44_value: Parameter value + :param parameter45_name: Parameter name + :param parameter45_value: Parameter value + :param parameter46_name: Parameter name + :param parameter46_value: Parameter value + :param parameter47_name: Parameter name + :param parameter47_value: Parameter value + :param parameter48_name: Parameter name + :param parameter48_value: Parameter value + :param parameter49_name: Parameter name + :param parameter49_value: Parameter value + :param parameter50_name: Parameter name + :param parameter50_value: Parameter value + :param parameter51_name: Parameter name + :param parameter51_value: Parameter value + :param parameter52_name: Parameter name + :param parameter52_value: Parameter value + :param parameter53_name: Parameter name + :param parameter53_value: Parameter value + :param parameter54_name: Parameter name + :param parameter54_value: Parameter value + :param parameter55_name: Parameter name + :param parameter55_value: Parameter value + :param parameter56_name: Parameter name + :param parameter56_value: Parameter value + :param parameter57_name: Parameter name + :param parameter57_value: Parameter value + :param parameter58_name: Parameter name + :param parameter58_value: Parameter value + :param parameter59_name: Parameter name + :param parameter59_value: Parameter value + :param parameter60_name: Parameter name + :param parameter60_value: Parameter value + :param parameter61_name: Parameter name + :param parameter61_value: Parameter value + :param parameter62_name: Parameter name + :param parameter62_value: Parameter value + :param parameter63_name: Parameter name + :param parameter63_value: Parameter value + :param parameter64_name: Parameter name + :param parameter64_value: Parameter value + :param parameter65_name: Parameter name + :param parameter65_value: Parameter value + :param parameter66_name: Parameter name + :param parameter66_value: Parameter value + :param parameter67_name: Parameter name + :param parameter67_value: Parameter value + :param parameter68_name: Parameter name + :param parameter68_value: Parameter value + :param parameter69_name: Parameter name + :param parameter69_value: Parameter value + :param parameter70_name: Parameter name + :param parameter70_value: Parameter value + :param parameter71_name: Parameter name + :param parameter71_value: Parameter value + :param parameter72_name: Parameter name + :param parameter72_value: Parameter value + :param parameter73_name: Parameter name + :param parameter73_value: Parameter value + :param parameter74_name: Parameter name + :param parameter74_value: Parameter value + :param parameter75_name: Parameter name + :param parameter75_value: Parameter value + :param parameter76_name: Parameter name + :param parameter76_value: Parameter value + :param parameter77_name: Parameter name + :param parameter77_value: Parameter value + :param parameter78_name: Parameter name + :param parameter78_value: Parameter value + :param parameter79_name: Parameter name + :param parameter79_value: Parameter value + :param parameter80_name: Parameter name + :param parameter80_value: Parameter value + :param parameter81_name: Parameter name + :param parameter81_value: Parameter value + :param parameter82_name: Parameter name + :param parameter82_value: Parameter value + :param parameter83_name: Parameter name + :param parameter83_value: Parameter value + :param parameter84_name: Parameter name + :param parameter84_value: Parameter value + :param parameter85_name: Parameter name + :param parameter85_value: Parameter value + :param parameter86_name: Parameter name + :param parameter86_value: Parameter value + :param parameter87_name: Parameter name + :param parameter87_value: Parameter value + :param parameter88_name: Parameter name + :param parameter88_value: Parameter value + :param parameter89_name: Parameter name + :param parameter89_value: Parameter value + :param parameter90_name: Parameter name + :param parameter90_value: Parameter value + :param parameter91_name: Parameter name + :param parameter91_value: Parameter value + :param parameter92_name: Parameter name + :param parameter92_value: Parameter value + :param parameter93_name: Parameter name + :param parameter93_value: Parameter value + :param parameter94_name: Parameter name + :param parameter94_value: Parameter value + :param parameter95_name: Parameter name + :param parameter95_value: Parameter value + :param parameter96_name: Parameter name + :param parameter96_value: Parameter value + :param parameter97_name: Parameter name + :param parameter97_value: Parameter value + :param parameter98_name: Parameter name + :param parameter98_value: Parameter value + :param parameter99_name: Parameter name + :param parameter99_value: Parameter value + + :returns: The created TranscriptionInstance + """ + + data = values.of( + { + "Name": name, + "Track": track, + "StatusCallbackUrl": status_callback_url, + "StatusCallbackMethod": status_callback_method, + "InboundTrackLabel": inbound_track_label, + "OutboundTrackLabel": outbound_track_label, + "PartialResults": serialize.boolean_to_string(partial_results), + "LanguageCode": language_code, + "TranscriptionEngine": transcription_engine, + "ProfanityFilter": serialize.boolean_to_string(profanity_filter), + "SpeechModel": speech_model, + "Hints": hints, + "EnableAutomaticPunctuation": serialize.boolean_to_string( + enable_automatic_punctuation + ), + "Parameter1.Name": parameter1_name, + "Parameter1.Value": parameter1_value, + "Parameter2.Name": parameter2_name, + "Parameter2.Value": parameter2_value, + "Parameter3.Name": parameter3_name, + "Parameter3.Value": parameter3_value, + "Parameter4.Name": parameter4_name, + "Parameter4.Value": parameter4_value, + "Parameter5.Name": parameter5_name, + "Parameter5.Value": parameter5_value, + "Parameter6.Name": parameter6_name, + "Parameter6.Value": parameter6_value, + "Parameter7.Name": parameter7_name, + "Parameter7.Value": parameter7_value, + "Parameter8.Name": parameter8_name, + "Parameter8.Value": parameter8_value, + "Parameter9.Name": parameter9_name, + "Parameter9.Value": parameter9_value, + "Parameter10.Name": parameter10_name, + "Parameter10.Value": parameter10_value, + "Parameter11.Name": parameter11_name, + "Parameter11.Value": parameter11_value, + "Parameter12.Name": parameter12_name, + "Parameter12.Value": parameter12_value, + "Parameter13.Name": parameter13_name, + "Parameter13.Value": parameter13_value, + "Parameter14.Name": parameter14_name, + "Parameter14.Value": parameter14_value, + "Parameter15.Name": parameter15_name, + "Parameter15.Value": parameter15_value, + "Parameter16.Name": parameter16_name, + "Parameter16.Value": parameter16_value, + "Parameter17.Name": parameter17_name, + "Parameter17.Value": parameter17_value, + "Parameter18.Name": parameter18_name, + "Parameter18.Value": parameter18_value, + "Parameter19.Name": parameter19_name, + "Parameter19.Value": parameter19_value, + "Parameter20.Name": parameter20_name, + "Parameter20.Value": parameter20_value, + "Parameter21.Name": parameter21_name, + "Parameter21.Value": parameter21_value, + "Parameter22.Name": parameter22_name, + "Parameter22.Value": parameter22_value, + "Parameter23.Name": parameter23_name, + "Parameter23.Value": parameter23_value, + "Parameter24.Name": parameter24_name, + "Parameter24.Value": parameter24_value, + "Parameter25.Name": parameter25_name, + "Parameter25.Value": parameter25_value, + "Parameter26.Name": parameter26_name, + "Parameter26.Value": parameter26_value, + "Parameter27.Name": parameter27_name, + "Parameter27.Value": parameter27_value, + "Parameter28.Name": parameter28_name, + "Parameter28.Value": parameter28_value, + "Parameter29.Name": parameter29_name, + "Parameter29.Value": parameter29_value, + "Parameter30.Name": parameter30_name, + "Parameter30.Value": parameter30_value, + "Parameter31.Name": parameter31_name, + "Parameter31.Value": parameter31_value, + "Parameter32.Name": parameter32_name, + "Parameter32.Value": parameter32_value, + "Parameter33.Name": parameter33_name, + "Parameter33.Value": parameter33_value, + "Parameter34.Name": parameter34_name, + "Parameter34.Value": parameter34_value, + "Parameter35.Name": parameter35_name, + "Parameter35.Value": parameter35_value, + "Parameter36.Name": parameter36_name, + "Parameter36.Value": parameter36_value, + "Parameter37.Name": parameter37_name, + "Parameter37.Value": parameter37_value, + "Parameter38.Name": parameter38_name, + "Parameter38.Value": parameter38_value, + "Parameter39.Name": parameter39_name, + "Parameter39.Value": parameter39_value, + "Parameter40.Name": parameter40_name, + "Parameter40.Value": parameter40_value, + "Parameter41.Name": parameter41_name, + "Parameter41.Value": parameter41_value, + "Parameter42.Name": parameter42_name, + "Parameter42.Value": parameter42_value, + "Parameter43.Name": parameter43_name, + "Parameter43.Value": parameter43_value, + "Parameter44.Name": parameter44_name, + "Parameter44.Value": parameter44_value, + "Parameter45.Name": parameter45_name, + "Parameter45.Value": parameter45_value, + "Parameter46.Name": parameter46_name, + "Parameter46.Value": parameter46_value, + "Parameter47.Name": parameter47_name, + "Parameter47.Value": parameter47_value, + "Parameter48.Name": parameter48_name, + "Parameter48.Value": parameter48_value, + "Parameter49.Name": parameter49_name, + "Parameter49.Value": parameter49_value, + "Parameter50.Name": parameter50_name, + "Parameter50.Value": parameter50_value, + "Parameter51.Name": parameter51_name, + "Parameter51.Value": parameter51_value, + "Parameter52.Name": parameter52_name, + "Parameter52.Value": parameter52_value, + "Parameter53.Name": parameter53_name, + "Parameter53.Value": parameter53_value, + "Parameter54.Name": parameter54_name, + "Parameter54.Value": parameter54_value, + "Parameter55.Name": parameter55_name, + "Parameter55.Value": parameter55_value, + "Parameter56.Name": parameter56_name, + "Parameter56.Value": parameter56_value, + "Parameter57.Name": parameter57_name, + "Parameter57.Value": parameter57_value, + "Parameter58.Name": parameter58_name, + "Parameter58.Value": parameter58_value, + "Parameter59.Name": parameter59_name, + "Parameter59.Value": parameter59_value, + "Parameter60.Name": parameter60_name, + "Parameter60.Value": parameter60_value, + "Parameter61.Name": parameter61_name, + "Parameter61.Value": parameter61_value, + "Parameter62.Name": parameter62_name, + "Parameter62.Value": parameter62_value, + "Parameter63.Name": parameter63_name, + "Parameter63.Value": parameter63_value, + "Parameter64.Name": parameter64_name, + "Parameter64.Value": parameter64_value, + "Parameter65.Name": parameter65_name, + "Parameter65.Value": parameter65_value, + "Parameter66.Name": parameter66_name, + "Parameter66.Value": parameter66_value, + "Parameter67.Name": parameter67_name, + "Parameter67.Value": parameter67_value, + "Parameter68.Name": parameter68_name, + "Parameter68.Value": parameter68_value, + "Parameter69.Name": parameter69_name, + "Parameter69.Value": parameter69_value, + "Parameter70.Name": parameter70_name, + "Parameter70.Value": parameter70_value, + "Parameter71.Name": parameter71_name, + "Parameter71.Value": parameter71_value, + "Parameter72.Name": parameter72_name, + "Parameter72.Value": parameter72_value, + "Parameter73.Name": parameter73_name, + "Parameter73.Value": parameter73_value, + "Parameter74.Name": parameter74_name, + "Parameter74.Value": parameter74_value, + "Parameter75.Name": parameter75_name, + "Parameter75.Value": parameter75_value, + "Parameter76.Name": parameter76_name, + "Parameter76.Value": parameter76_value, + "Parameter77.Name": parameter77_name, + "Parameter77.Value": parameter77_value, + "Parameter78.Name": parameter78_name, + "Parameter78.Value": parameter78_value, + "Parameter79.Name": parameter79_name, + "Parameter79.Value": parameter79_value, + "Parameter80.Name": parameter80_name, + "Parameter80.Value": parameter80_value, + "Parameter81.Name": parameter81_name, + "Parameter81.Value": parameter81_value, + "Parameter82.Name": parameter82_name, + "Parameter82.Value": parameter82_value, + "Parameter83.Name": parameter83_name, + "Parameter83.Value": parameter83_value, + "Parameter84.Name": parameter84_name, + "Parameter84.Value": parameter84_value, + "Parameter85.Name": parameter85_name, + "Parameter85.Value": parameter85_value, + "Parameter86.Name": parameter86_name, + "Parameter86.Value": parameter86_value, + "Parameter87.Name": parameter87_name, + "Parameter87.Value": parameter87_value, + "Parameter88.Name": parameter88_name, + "Parameter88.Value": parameter88_value, + "Parameter89.Name": parameter89_name, + "Parameter89.Value": parameter89_value, + "Parameter90.Name": parameter90_name, + "Parameter90.Value": parameter90_value, + "Parameter91.Name": parameter91_name, + "Parameter91.Value": parameter91_value, + "Parameter92.Name": parameter92_name, + "Parameter92.Value": parameter92_value, + "Parameter93.Name": parameter93_name, + "Parameter93.Value": parameter93_value, + "Parameter94.Name": parameter94_name, + "Parameter94.Value": parameter94_value, + "Parameter95.Name": parameter95_name, + "Parameter95.Value": parameter95_value, + "Parameter96.Name": parameter96_name, + "Parameter96.Value": parameter96_value, + "Parameter97.Name": parameter97_name, + "Parameter97.Value": parameter97_value, + "Parameter98.Name": parameter98_name, + "Parameter98.Value": parameter98_value, + "Parameter99.Name": parameter99_name, + "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, headers=headers + ) + + return TranscriptionInstance( + self._version, + payload, + account_sid=self._solution["account_sid"], + call_sid=self._solution["call_sid"], + ) + + async def create_async( + self, + name: Union[str, object] = values.unset, + track: Union["TranscriptionInstance.Track", object] = values.unset, + status_callback_url: Union[str, object] = values.unset, + status_callback_method: Union[str, object] = values.unset, + inbound_track_label: Union[str, object] = values.unset, + outbound_track_label: Union[str, object] = values.unset, + partial_results: Union[bool, object] = values.unset, + language_code: Union[str, object] = values.unset, + transcription_engine: Union[str, object] = values.unset, + profanity_filter: Union[bool, object] = values.unset, + speech_model: Union[str, object] = values.unset, + hints: Union[str, object] = values.unset, + enable_automatic_punctuation: Union[bool, object] = values.unset, + parameter1_name: Union[str, object] = values.unset, + parameter1_value: Union[str, object] = values.unset, + parameter2_name: Union[str, object] = values.unset, + parameter2_value: Union[str, object] = values.unset, + parameter3_name: Union[str, object] = values.unset, + parameter3_value: Union[str, object] = values.unset, + parameter4_name: Union[str, object] = values.unset, + parameter4_value: Union[str, object] = values.unset, + parameter5_name: Union[str, object] = values.unset, + parameter5_value: Union[str, object] = values.unset, + parameter6_name: Union[str, object] = values.unset, + parameter6_value: Union[str, object] = values.unset, + parameter7_name: Union[str, object] = values.unset, + parameter7_value: Union[str, object] = values.unset, + parameter8_name: Union[str, object] = values.unset, + parameter8_value: Union[str, object] = values.unset, + parameter9_name: Union[str, object] = values.unset, + parameter9_value: Union[str, object] = values.unset, + parameter10_name: Union[str, object] = values.unset, + parameter10_value: Union[str, object] = values.unset, + parameter11_name: Union[str, object] = values.unset, + parameter11_value: Union[str, object] = values.unset, + parameter12_name: Union[str, object] = values.unset, + parameter12_value: Union[str, object] = values.unset, + parameter13_name: Union[str, object] = values.unset, + parameter13_value: Union[str, object] = values.unset, + parameter14_name: Union[str, object] = values.unset, + parameter14_value: Union[str, object] = values.unset, + parameter15_name: Union[str, object] = values.unset, + parameter15_value: Union[str, object] = values.unset, + parameter16_name: Union[str, object] = values.unset, + parameter16_value: Union[str, object] = values.unset, + parameter17_name: Union[str, object] = values.unset, + parameter17_value: Union[str, object] = values.unset, + parameter18_name: Union[str, object] = values.unset, + parameter18_value: Union[str, object] = values.unset, + parameter19_name: Union[str, object] = values.unset, + parameter19_value: Union[str, object] = values.unset, + parameter20_name: Union[str, object] = values.unset, + parameter20_value: Union[str, object] = values.unset, + parameter21_name: Union[str, object] = values.unset, + parameter21_value: Union[str, object] = values.unset, + parameter22_name: Union[str, object] = values.unset, + parameter22_value: Union[str, object] = values.unset, + parameter23_name: Union[str, object] = values.unset, + parameter23_value: Union[str, object] = values.unset, + parameter24_name: Union[str, object] = values.unset, + parameter24_value: Union[str, object] = values.unset, + parameter25_name: Union[str, object] = values.unset, + parameter25_value: Union[str, object] = values.unset, + parameter26_name: Union[str, object] = values.unset, + parameter26_value: Union[str, object] = values.unset, + parameter27_name: Union[str, object] = values.unset, + parameter27_value: Union[str, object] = values.unset, + parameter28_name: Union[str, object] = values.unset, + parameter28_value: Union[str, object] = values.unset, + parameter29_name: Union[str, object] = values.unset, + parameter29_value: Union[str, object] = values.unset, + parameter30_name: Union[str, object] = values.unset, + parameter30_value: Union[str, object] = values.unset, + parameter31_name: Union[str, object] = values.unset, + parameter31_value: Union[str, object] = values.unset, + parameter32_name: Union[str, object] = values.unset, + parameter32_value: Union[str, object] = values.unset, + parameter33_name: Union[str, object] = values.unset, + parameter33_value: Union[str, object] = values.unset, + parameter34_name: Union[str, object] = values.unset, + parameter34_value: Union[str, object] = values.unset, + parameter35_name: Union[str, object] = values.unset, + parameter35_value: Union[str, object] = values.unset, + parameter36_name: Union[str, object] = values.unset, + parameter36_value: Union[str, object] = values.unset, + parameter37_name: Union[str, object] = values.unset, + parameter37_value: Union[str, object] = values.unset, + parameter38_name: Union[str, object] = values.unset, + parameter38_value: Union[str, object] = values.unset, + parameter39_name: Union[str, object] = values.unset, + parameter39_value: Union[str, object] = values.unset, + parameter40_name: Union[str, object] = values.unset, + parameter40_value: Union[str, object] = values.unset, + parameter41_name: Union[str, object] = values.unset, + parameter41_value: Union[str, object] = values.unset, + parameter42_name: Union[str, object] = values.unset, + parameter42_value: Union[str, object] = values.unset, + parameter43_name: Union[str, object] = values.unset, + parameter43_value: Union[str, object] = values.unset, + parameter44_name: Union[str, object] = values.unset, + parameter44_value: Union[str, object] = values.unset, + parameter45_name: Union[str, object] = values.unset, + parameter45_value: Union[str, object] = values.unset, + parameter46_name: Union[str, object] = values.unset, + parameter46_value: Union[str, object] = values.unset, + parameter47_name: Union[str, object] = values.unset, + parameter47_value: Union[str, object] = values.unset, + parameter48_name: Union[str, object] = values.unset, + parameter48_value: Union[str, object] = values.unset, + parameter49_name: Union[str, object] = values.unset, + parameter49_value: Union[str, object] = values.unset, + parameter50_name: Union[str, object] = values.unset, + parameter50_value: Union[str, object] = values.unset, + parameter51_name: Union[str, object] = values.unset, + parameter51_value: Union[str, object] = values.unset, + parameter52_name: Union[str, object] = values.unset, + parameter52_value: Union[str, object] = values.unset, + parameter53_name: Union[str, object] = values.unset, + parameter53_value: Union[str, object] = values.unset, + parameter54_name: Union[str, object] = values.unset, + parameter54_value: Union[str, object] = values.unset, + parameter55_name: Union[str, object] = values.unset, + parameter55_value: Union[str, object] = values.unset, + parameter56_name: Union[str, object] = values.unset, + parameter56_value: Union[str, object] = values.unset, + parameter57_name: Union[str, object] = values.unset, + parameter57_value: Union[str, object] = values.unset, + parameter58_name: Union[str, object] = values.unset, + parameter58_value: Union[str, object] = values.unset, + parameter59_name: Union[str, object] = values.unset, + parameter59_value: Union[str, object] = values.unset, + parameter60_name: Union[str, object] = values.unset, + parameter60_value: Union[str, object] = values.unset, + parameter61_name: Union[str, object] = values.unset, + parameter61_value: Union[str, object] = values.unset, + parameter62_name: Union[str, object] = values.unset, + parameter62_value: Union[str, object] = values.unset, + parameter63_name: Union[str, object] = values.unset, + parameter63_value: Union[str, object] = values.unset, + parameter64_name: Union[str, object] = values.unset, + parameter64_value: Union[str, object] = values.unset, + parameter65_name: Union[str, object] = values.unset, + parameter65_value: Union[str, object] = values.unset, + parameter66_name: Union[str, object] = values.unset, + parameter66_value: Union[str, object] = values.unset, + parameter67_name: Union[str, object] = values.unset, + parameter67_value: Union[str, object] = values.unset, + parameter68_name: Union[str, object] = values.unset, + parameter68_value: Union[str, object] = values.unset, + parameter69_name: Union[str, object] = values.unset, + parameter69_value: Union[str, object] = values.unset, + parameter70_name: Union[str, object] = values.unset, + parameter70_value: Union[str, object] = values.unset, + parameter71_name: Union[str, object] = values.unset, + parameter71_value: Union[str, object] = values.unset, + parameter72_name: Union[str, object] = values.unset, + parameter72_value: Union[str, object] = values.unset, + parameter73_name: Union[str, object] = values.unset, + parameter73_value: Union[str, object] = values.unset, + parameter74_name: Union[str, object] = values.unset, + parameter74_value: Union[str, object] = values.unset, + parameter75_name: Union[str, object] = values.unset, + parameter75_value: Union[str, object] = values.unset, + parameter76_name: Union[str, object] = values.unset, + parameter76_value: Union[str, object] = values.unset, + parameter77_name: Union[str, object] = values.unset, + parameter77_value: Union[str, object] = values.unset, + parameter78_name: Union[str, object] = values.unset, + parameter78_value: Union[str, object] = values.unset, + parameter79_name: Union[str, object] = values.unset, + parameter79_value: Union[str, object] = values.unset, + parameter80_name: Union[str, object] = values.unset, + parameter80_value: Union[str, object] = values.unset, + parameter81_name: Union[str, object] = values.unset, + parameter81_value: Union[str, object] = values.unset, + parameter82_name: Union[str, object] = values.unset, + parameter82_value: Union[str, object] = values.unset, + parameter83_name: Union[str, object] = values.unset, + parameter83_value: Union[str, object] = values.unset, + parameter84_name: Union[str, object] = values.unset, + parameter84_value: Union[str, object] = values.unset, + parameter85_name: Union[str, object] = values.unset, + parameter85_value: Union[str, object] = values.unset, + parameter86_name: Union[str, object] = values.unset, + parameter86_value: Union[str, object] = values.unset, + parameter87_name: Union[str, object] = values.unset, + parameter87_value: Union[str, object] = values.unset, + parameter88_name: Union[str, object] = values.unset, + parameter88_value: Union[str, object] = values.unset, + parameter89_name: Union[str, object] = values.unset, + parameter89_value: Union[str, object] = values.unset, + parameter90_name: Union[str, object] = values.unset, + parameter90_value: Union[str, object] = values.unset, + parameter91_name: Union[str, object] = values.unset, + parameter91_value: Union[str, object] = values.unset, + parameter92_name: Union[str, object] = values.unset, + parameter92_value: Union[str, object] = values.unset, + parameter93_name: Union[str, object] = values.unset, + parameter93_value: Union[str, object] = values.unset, + parameter94_name: Union[str, object] = values.unset, + parameter94_value: Union[str, object] = values.unset, + parameter95_name: Union[str, object] = values.unset, + parameter95_value: Union[str, object] = values.unset, + parameter96_name: Union[str, object] = values.unset, + parameter96_value: Union[str, object] = values.unset, + parameter97_name: Union[str, object] = values.unset, + parameter97_value: Union[str, object] = values.unset, + parameter98_name: Union[str, object] = values.unset, + parameter98_value: Union[str, object] = values.unset, + parameter99_name: Union[str, object] = values.unset, + parameter99_value: Union[str, object] = values.unset, + ) -> TranscriptionInstance: + """ + Asynchronously create the TranscriptionInstance + + :param name: The user-specified name of this Transcription, if one was given when the Transcription was created. This may be used to stop the Transcription. + :param track: + :param status_callback_url: Absolute URL of the status callback. + :param status_callback_method: The http method for the status_callback (one of GET, POST). + :param inbound_track_label: Friendly name given to the Inbound Track + :param outbound_track_label: Friendly name given to the Outbound Track + :param partial_results: Indicates if partial results are going to be send to the customer + :param language_code: Language code used by the transcription engine, specified in [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) format + :param transcription_engine: Definition of the transcription engine to be used, between those supported by Twilio + :param profanity_filter: indicates if the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks + :param speech_model: Recognition model used by the transcription engine, between those supported by the provider + :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. + :param enable_automatic_punctuation: The provider will adds punctuation to recognition result hypotheses + :param parameter1_name: Parameter name + :param parameter1_value: Parameter value + :param parameter2_name: Parameter name + :param parameter2_value: Parameter value + :param parameter3_name: Parameter name + :param parameter3_value: Parameter value + :param parameter4_name: Parameter name + :param parameter4_value: Parameter value + :param parameter5_name: Parameter name + :param parameter5_value: Parameter value + :param parameter6_name: Parameter name + :param parameter6_value: Parameter value + :param parameter7_name: Parameter name + :param parameter7_value: Parameter value + :param parameter8_name: Parameter name + :param parameter8_value: Parameter value + :param parameter9_name: Parameter name + :param parameter9_value: Parameter value + :param parameter10_name: Parameter name + :param parameter10_value: Parameter value + :param parameter11_name: Parameter name + :param parameter11_value: Parameter value + :param parameter12_name: Parameter name + :param parameter12_value: Parameter value + :param parameter13_name: Parameter name + :param parameter13_value: Parameter value + :param parameter14_name: Parameter name + :param parameter14_value: Parameter value + :param parameter15_name: Parameter name + :param parameter15_value: Parameter value + :param parameter16_name: Parameter name + :param parameter16_value: Parameter value + :param parameter17_name: Parameter name + :param parameter17_value: Parameter value + :param parameter18_name: Parameter name + :param parameter18_value: Parameter value + :param parameter19_name: Parameter name + :param parameter19_value: Parameter value + :param parameter20_name: Parameter name + :param parameter20_value: Parameter value + :param parameter21_name: Parameter name + :param parameter21_value: Parameter value + :param parameter22_name: Parameter name + :param parameter22_value: Parameter value + :param parameter23_name: Parameter name + :param parameter23_value: Parameter value + :param parameter24_name: Parameter name + :param parameter24_value: Parameter value + :param parameter25_name: Parameter name + :param parameter25_value: Parameter value + :param parameter26_name: Parameter name + :param parameter26_value: Parameter value + :param parameter27_name: Parameter name + :param parameter27_value: Parameter value + :param parameter28_name: Parameter name + :param parameter28_value: Parameter value + :param parameter29_name: Parameter name + :param parameter29_value: Parameter value + :param parameter30_name: Parameter name + :param parameter30_value: Parameter value + :param parameter31_name: Parameter name + :param parameter31_value: Parameter value + :param parameter32_name: Parameter name + :param parameter32_value: Parameter value + :param parameter33_name: Parameter name + :param parameter33_value: Parameter value + :param parameter34_name: Parameter name + :param parameter34_value: Parameter value + :param parameter35_name: Parameter name + :param parameter35_value: Parameter value + :param parameter36_name: Parameter name + :param parameter36_value: Parameter value + :param parameter37_name: Parameter name + :param parameter37_value: Parameter value + :param parameter38_name: Parameter name + :param parameter38_value: Parameter value + :param parameter39_name: Parameter name + :param parameter39_value: Parameter value + :param parameter40_name: Parameter name + :param parameter40_value: Parameter value + :param parameter41_name: Parameter name + :param parameter41_value: Parameter value + :param parameter42_name: Parameter name + :param parameter42_value: Parameter value + :param parameter43_name: Parameter name + :param parameter43_value: Parameter value + :param parameter44_name: Parameter name + :param parameter44_value: Parameter value + :param parameter45_name: Parameter name + :param parameter45_value: Parameter value + :param parameter46_name: Parameter name + :param parameter46_value: Parameter value + :param parameter47_name: Parameter name + :param parameter47_value: Parameter value + :param parameter48_name: Parameter name + :param parameter48_value: Parameter value + :param parameter49_name: Parameter name + :param parameter49_value: Parameter value + :param parameter50_name: Parameter name + :param parameter50_value: Parameter value + :param parameter51_name: Parameter name + :param parameter51_value: Parameter value + :param parameter52_name: Parameter name + :param parameter52_value: Parameter value + :param parameter53_name: Parameter name + :param parameter53_value: Parameter value + :param parameter54_name: Parameter name + :param parameter54_value: Parameter value + :param parameter55_name: Parameter name + :param parameter55_value: Parameter value + :param parameter56_name: Parameter name + :param parameter56_value: Parameter value + :param parameter57_name: Parameter name + :param parameter57_value: Parameter value + :param parameter58_name: Parameter name + :param parameter58_value: Parameter value + :param parameter59_name: Parameter name + :param parameter59_value: Parameter value + :param parameter60_name: Parameter name + :param parameter60_value: Parameter value + :param parameter61_name: Parameter name + :param parameter61_value: Parameter value + :param parameter62_name: Parameter name + :param parameter62_value: Parameter value + :param parameter63_name: Parameter name + :param parameter63_value: Parameter value + :param parameter64_name: Parameter name + :param parameter64_value: Parameter value + :param parameter65_name: Parameter name + :param parameter65_value: Parameter value + :param parameter66_name: Parameter name + :param parameter66_value: Parameter value + :param parameter67_name: Parameter name + :param parameter67_value: Parameter value + :param parameter68_name: Parameter name + :param parameter68_value: Parameter value + :param parameter69_name: Parameter name + :param parameter69_value: Parameter value + :param parameter70_name: Parameter name + :param parameter70_value: Parameter value + :param parameter71_name: Parameter name + :param parameter71_value: Parameter value + :param parameter72_name: Parameter name + :param parameter72_value: Parameter value + :param parameter73_name: Parameter name + :param parameter73_value: Parameter value + :param parameter74_name: Parameter name + :param parameter74_value: Parameter value + :param parameter75_name: Parameter name + :param parameter75_value: Parameter value + :param parameter76_name: Parameter name + :param parameter76_value: Parameter value + :param parameter77_name: Parameter name + :param parameter77_value: Parameter value + :param parameter78_name: Parameter name + :param parameter78_value: Parameter value + :param parameter79_name: Parameter name + :param parameter79_value: Parameter value + :param parameter80_name: Parameter name + :param parameter80_value: Parameter value + :param parameter81_name: Parameter name + :param parameter81_value: Parameter value + :param parameter82_name: Parameter name + :param parameter82_value: Parameter value + :param parameter83_name: Parameter name + :param parameter83_value: Parameter value + :param parameter84_name: Parameter name + :param parameter84_value: Parameter value + :param parameter85_name: Parameter name + :param parameter85_value: Parameter value + :param parameter86_name: Parameter name + :param parameter86_value: Parameter value + :param parameter87_name: Parameter name + :param parameter87_value: Parameter value + :param parameter88_name: Parameter name + :param parameter88_value: Parameter value + :param parameter89_name: Parameter name + :param parameter89_value: Parameter value + :param parameter90_name: Parameter name + :param parameter90_value: Parameter value + :param parameter91_name: Parameter name + :param parameter91_value: Parameter value + :param parameter92_name: Parameter name + :param parameter92_value: Parameter value + :param parameter93_name: Parameter name + :param parameter93_value: Parameter value + :param parameter94_name: Parameter name + :param parameter94_value: Parameter value + :param parameter95_name: Parameter name + :param parameter95_value: Parameter value + :param parameter96_name: Parameter name + :param parameter96_value: Parameter value + :param parameter97_name: Parameter name + :param parameter97_value: Parameter value + :param parameter98_name: Parameter name + :param parameter98_value: Parameter value + :param parameter99_name: Parameter name + :param parameter99_value: Parameter value + + :returns: The created TranscriptionInstance + """ + + data = values.of( + { + "Name": name, + "Track": track, + "StatusCallbackUrl": status_callback_url, + "StatusCallbackMethod": status_callback_method, + "InboundTrackLabel": inbound_track_label, + "OutboundTrackLabel": outbound_track_label, + "PartialResults": serialize.boolean_to_string(partial_results), + "LanguageCode": language_code, + "TranscriptionEngine": transcription_engine, + "ProfanityFilter": serialize.boolean_to_string(profanity_filter), + "SpeechModel": speech_model, + "Hints": hints, + "EnableAutomaticPunctuation": serialize.boolean_to_string( + enable_automatic_punctuation + ), + "Parameter1.Name": parameter1_name, + "Parameter1.Value": parameter1_value, + "Parameter2.Name": parameter2_name, + "Parameter2.Value": parameter2_value, + "Parameter3.Name": parameter3_name, + "Parameter3.Value": parameter3_value, + "Parameter4.Name": parameter4_name, + "Parameter4.Value": parameter4_value, + "Parameter5.Name": parameter5_name, + "Parameter5.Value": parameter5_value, + "Parameter6.Name": parameter6_name, + "Parameter6.Value": parameter6_value, + "Parameter7.Name": parameter7_name, + "Parameter7.Value": parameter7_value, + "Parameter8.Name": parameter8_name, + "Parameter8.Value": parameter8_value, + "Parameter9.Name": parameter9_name, + "Parameter9.Value": parameter9_value, + "Parameter10.Name": parameter10_name, + "Parameter10.Value": parameter10_value, + "Parameter11.Name": parameter11_name, + "Parameter11.Value": parameter11_value, + "Parameter12.Name": parameter12_name, + "Parameter12.Value": parameter12_value, + "Parameter13.Name": parameter13_name, + "Parameter13.Value": parameter13_value, + "Parameter14.Name": parameter14_name, + "Parameter14.Value": parameter14_value, + "Parameter15.Name": parameter15_name, + "Parameter15.Value": parameter15_value, + "Parameter16.Name": parameter16_name, + "Parameter16.Value": parameter16_value, + "Parameter17.Name": parameter17_name, + "Parameter17.Value": parameter17_value, + "Parameter18.Name": parameter18_name, + "Parameter18.Value": parameter18_value, + "Parameter19.Name": parameter19_name, + "Parameter19.Value": parameter19_value, + "Parameter20.Name": parameter20_name, + "Parameter20.Value": parameter20_value, + "Parameter21.Name": parameter21_name, + "Parameter21.Value": parameter21_value, + "Parameter22.Name": parameter22_name, + "Parameter22.Value": parameter22_value, + "Parameter23.Name": parameter23_name, + "Parameter23.Value": parameter23_value, + "Parameter24.Name": parameter24_name, + "Parameter24.Value": parameter24_value, + "Parameter25.Name": parameter25_name, + "Parameter25.Value": parameter25_value, + "Parameter26.Name": parameter26_name, + "Parameter26.Value": parameter26_value, + "Parameter27.Name": parameter27_name, + "Parameter27.Value": parameter27_value, + "Parameter28.Name": parameter28_name, + "Parameter28.Value": parameter28_value, + "Parameter29.Name": parameter29_name, + "Parameter29.Value": parameter29_value, + "Parameter30.Name": parameter30_name, + "Parameter30.Value": parameter30_value, + "Parameter31.Name": parameter31_name, + "Parameter31.Value": parameter31_value, + "Parameter32.Name": parameter32_name, + "Parameter32.Value": parameter32_value, + "Parameter33.Name": parameter33_name, + "Parameter33.Value": parameter33_value, + "Parameter34.Name": parameter34_name, + "Parameter34.Value": parameter34_value, + "Parameter35.Name": parameter35_name, + "Parameter35.Value": parameter35_value, + "Parameter36.Name": parameter36_name, + "Parameter36.Value": parameter36_value, + "Parameter37.Name": parameter37_name, + "Parameter37.Value": parameter37_value, + "Parameter38.Name": parameter38_name, + "Parameter38.Value": parameter38_value, + "Parameter39.Name": parameter39_name, + "Parameter39.Value": parameter39_value, + "Parameter40.Name": parameter40_name, + "Parameter40.Value": parameter40_value, + "Parameter41.Name": parameter41_name, + "Parameter41.Value": parameter41_value, + "Parameter42.Name": parameter42_name, + "Parameter42.Value": parameter42_value, + "Parameter43.Name": parameter43_name, + "Parameter43.Value": parameter43_value, + "Parameter44.Name": parameter44_name, + "Parameter44.Value": parameter44_value, + "Parameter45.Name": parameter45_name, + "Parameter45.Value": parameter45_value, + "Parameter46.Name": parameter46_name, + "Parameter46.Value": parameter46_value, + "Parameter47.Name": parameter47_name, + "Parameter47.Value": parameter47_value, + "Parameter48.Name": parameter48_name, + "Parameter48.Value": parameter48_value, + "Parameter49.Name": parameter49_name, + "Parameter49.Value": parameter49_value, + "Parameter50.Name": parameter50_name, + "Parameter50.Value": parameter50_value, + "Parameter51.Name": parameter51_name, + "Parameter51.Value": parameter51_value, + "Parameter52.Name": parameter52_name, + "Parameter52.Value": parameter52_value, + "Parameter53.Name": parameter53_name, + "Parameter53.Value": parameter53_value, + "Parameter54.Name": parameter54_name, + "Parameter54.Value": parameter54_value, + "Parameter55.Name": parameter55_name, + "Parameter55.Value": parameter55_value, + "Parameter56.Name": parameter56_name, + "Parameter56.Value": parameter56_value, + "Parameter57.Name": parameter57_name, + "Parameter57.Value": parameter57_value, + "Parameter58.Name": parameter58_name, + "Parameter58.Value": parameter58_value, + "Parameter59.Name": parameter59_name, + "Parameter59.Value": parameter59_value, + "Parameter60.Name": parameter60_name, + "Parameter60.Value": parameter60_value, + "Parameter61.Name": parameter61_name, + "Parameter61.Value": parameter61_value, + "Parameter62.Name": parameter62_name, + "Parameter62.Value": parameter62_value, + "Parameter63.Name": parameter63_name, + "Parameter63.Value": parameter63_value, + "Parameter64.Name": parameter64_name, + "Parameter64.Value": parameter64_value, + "Parameter65.Name": parameter65_name, + "Parameter65.Value": parameter65_value, + "Parameter66.Name": parameter66_name, + "Parameter66.Value": parameter66_value, + "Parameter67.Name": parameter67_name, + "Parameter67.Value": parameter67_value, + "Parameter68.Name": parameter68_name, + "Parameter68.Value": parameter68_value, + "Parameter69.Name": parameter69_name, + "Parameter69.Value": parameter69_value, + "Parameter70.Name": parameter70_name, + "Parameter70.Value": parameter70_value, + "Parameter71.Name": parameter71_name, + "Parameter71.Value": parameter71_value, + "Parameter72.Name": parameter72_name, + "Parameter72.Value": parameter72_value, + "Parameter73.Name": parameter73_name, + "Parameter73.Value": parameter73_value, + "Parameter74.Name": parameter74_name, + "Parameter74.Value": parameter74_value, + "Parameter75.Name": parameter75_name, + "Parameter75.Value": parameter75_value, + "Parameter76.Name": parameter76_name, + "Parameter76.Value": parameter76_value, + "Parameter77.Name": parameter77_name, + "Parameter77.Value": parameter77_value, + "Parameter78.Name": parameter78_name, + "Parameter78.Value": parameter78_value, + "Parameter79.Name": parameter79_name, + "Parameter79.Value": parameter79_value, + "Parameter80.Name": parameter80_name, + "Parameter80.Value": parameter80_value, + "Parameter81.Name": parameter81_name, + "Parameter81.Value": parameter81_value, + "Parameter82.Name": parameter82_name, + "Parameter82.Value": parameter82_value, + "Parameter83.Name": parameter83_name, + "Parameter83.Value": parameter83_value, + "Parameter84.Name": parameter84_name, + "Parameter84.Value": parameter84_value, + "Parameter85.Name": parameter85_name, + "Parameter85.Value": parameter85_value, + "Parameter86.Name": parameter86_name, + "Parameter86.Value": parameter86_value, + "Parameter87.Name": parameter87_name, + "Parameter87.Value": parameter87_value, + "Parameter88.Name": parameter88_name, + "Parameter88.Value": parameter88_value, + "Parameter89.Name": parameter89_name, + "Parameter89.Value": parameter89_value, + "Parameter90.Name": parameter90_name, + "Parameter90.Value": parameter90_value, + "Parameter91.Name": parameter91_name, + "Parameter91.Value": parameter91_value, + "Parameter92.Name": parameter92_name, + "Parameter92.Value": parameter92_value, + "Parameter93.Name": parameter93_name, + "Parameter93.Value": parameter93_value, + "Parameter94.Name": parameter94_name, + "Parameter94.Value": parameter94_value, + "Parameter95.Name": parameter95_name, + "Parameter95.Value": parameter95_value, + "Parameter96.Name": parameter96_name, + "Parameter96.Value": parameter96_value, + "Parameter97.Name": parameter97_name, + "Parameter97.Value": parameter97_value, + "Parameter98.Name": parameter98_name, + "Parameter98.Value": parameter98_value, + "Parameter99.Name": parameter99_name, + "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, headers=headers + ) + + return TranscriptionInstance( + self._version, + payload, + account_sid=self._solution["account_sid"], + call_sid=self._solution["call_sid"], + ) + + def get(self, sid: str) -> TranscriptionContext: + """ + Constructs a TranscriptionContext + + :param sid: The SID of the Transcription resource, or the `name` used when creating the resource + """ + return TranscriptionContext( + self._version, + account_sid=self._solution["account_sid"], + call_sid=self._solution["call_sid"], + sid=sid, + ) + + def __call__(self, sid: str) -> TranscriptionContext: + """ + Constructs a TranscriptionContext + + :param sid: The SID of the Transcription resource, or the `name` used when creating the resource + """ + return TranscriptionContext( + self._version, + account_sid=self._solution["account_sid"], + call_sid=self._solution["call_sid"], + sid=sid, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/api/v2010/account/call/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..0fcbd1c19 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -306,7 +306,7 @@ def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): def to_dict(self): return { - "type": self.type.to_dict(), + "type": self.type, "copy_code_text": self.copy_code_text, } @@ -331,7 +331,7 @@ def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): def to_dict(self): return { - "type": self.type.to_dict(), + "type": self.type, "title": self.title, "url": self.url, "phone": self.phone, @@ -357,7 +357,7 @@ def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): def to_dict(self): return { - "type": self.type.to_dict(), + "type": self.type, "title": self.title, "url": self.url, "phone": self.phone, @@ -453,7 +453,7 @@ def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): def to_dict(self): return { - "type": self.type.to_dict(), + "type": self.type, "title": self.title, "id": self.id, } @@ -757,7 +757,8 @@ def create(self, content_create_request: ContentCreateRequest) -> ContentInstanc """ data = content_create_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 @@ -777,7 +778,8 @@ async def create_async( """ data = content_create_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/content/v1/content/approval_create.py b/twilio/rest/content/v1/content/approval_create.py index ddd922afc..6e28052e0 100644 --- a/twilio/rest/content/v1/content/approval_create.py +++ b/twilio/rest/content/v1/content/approval_create.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 @@ -104,7 +105,8 @@ def create( """ data = content_approval_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 @@ -126,7 +128,8 @@ async def create_async( """ data = content_approval_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/content/v1/legacy_content.py b/twilio/rest/content/v1/legacy_content.py index 5705c33b0..cfb4ac698 100644 --- a/twilio/rest/content/v1/legacy_content.py +++ b/twilio/rest/content/v1/legacy_content.py @@ -31,7 +31,7 @@ class LegacyContentInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar legacy_template_name: The string name of the legacy content template associated with this Content resource, unique across all template names for its account. Only lowercase letters, numbers and underscores are allowed :ivar legacy_body: The string body field of the legacy content template associated with this Content resource :ivar url: The URL of the resource, relative to `https://content.twilio.com`. 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..3f9415ed4 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 @@ -52,7 +52,7 @@ def __repr__(self) -> str: class InstalledAddOnUsageList(ListResource): - class CreateMarketplaceBillingUsageRequest(object): + class CreateBillingUsageRequest(object): """ :ivar billable_items: """ @@ -60,9 +60,7 @@ class CreateMarketplaceBillingUsageRequest(object): def __init__(self, payload: Dict[str, Any], installed_add_on_sid: str): self.billable_items: Optional[ - List[ - InstalledAddOnUsageList.CreateMarketplaceBillingUsageRequestBillableItems - ] + List[InstalledAddOnUsageList.CreateBillingUsageRequestBillableItems] ] = payload.get("billable_items") def to_dict(self): @@ -72,7 +70,7 @@ def to_dict(self): ], } - class CreateMarketplaceBillingUsageRequestBillableItems(object): + class CreateBillingUsageRequestBillableItems(object): """ :ivar quantity: :ivar sid: @@ -108,19 +106,19 @@ def __init__(self, version: Version, installed_add_on_sid: str): ) def create( - self, - create_marketplace_billing_usage_request: CreateMarketplaceBillingUsageRequest, + self, create_billing_usage_request: CreateBillingUsageRequest ) -> InstalledAddOnUsageInstance: """ Create the InstalledAddOnUsageInstance - :param create_marketplace_billing_usage_request: + :param create_billing_usage_request: :returns: The created InstalledAddOnUsageInstance """ - data = create_marketplace_billing_usage_request.to_dict() + data = create_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 @@ -133,19 +131,19 @@ def create( ) async def create_async( - self, - create_marketplace_billing_usage_request: CreateMarketplaceBillingUsageRequest, + self, create_billing_usage_request: CreateBillingUsageRequest ) -> InstalledAddOnUsageInstance: """ Asynchronously create the InstalledAddOnUsageInstance - :param create_marketplace_billing_usage_request: + :param create_billing_usage_request: :returns: The created InstalledAddOnUsageInstance """ - data = create_marketplace_billing_usage_request.to_dict() + data = create_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/__init__.py b/twilio/rest/numbers/v1/__init__.py index 043364c3d..68f078a88 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,12 +28,10 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) -from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( - PortingWebhookConfigurationFetchList, -) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) +from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -58,12 +56,10 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None - self._porting_webhook_configuration_fetch: Optional[ - PortingWebhookConfigurationFetchList - ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None + self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -111,22 +107,18 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete - @property - def porting_webhook_configuration_fetch( - self, - ) -> PortingWebhookConfigurationFetchList: - if self._porting_webhook_configuration_fetch is None: - self._porting_webhook_configuration_fetch = ( - PortingWebhookConfigurationFetchList(self) - ) - return self._porting_webhook_configuration_fetch - @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations + @property + def webhook(self) -> WebhookList: + if self._webhook is None: + self._webhook = WebhookList(self) + return self._webhook + def __repr__(self) -> str: """ Provide a friendly representation 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/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/v1/porting_webhook_configuration_fetch.py b/twilio/rest/numbers/v1/webhook.py similarity index 71% rename from twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py rename to twilio/rest/numbers/v1/webhook.py index 46c053b65..0986db12f 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py +++ b/twilio/rest/numbers/v1/webhook.py @@ -14,14 +14,14 @@ 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 from twilio.base.version import Version -class PortingWebhookConfigurationFetchInstance(InstanceResource): +class WebhookInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: Webhook URL to send a request when a port in request or port in phone number event happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class PortingWebhookConfigurationFetchList(ListResource): +class WebhookList(ListResource): def __init__(self, version: Version): """ - Initialize the PortingWebhookConfigurationFetchList + Initialize the WebhookList :param version: Version that contains the resource @@ -68,29 +68,33 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> PortingWebhookConfigurationFetchInstance: + def fetch(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ + 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) + return WebhookInstance(self._version, payload) - async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: + async def fetch_async(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ + 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) + return WebhookInstance(self._version, payload) def __repr__(self) -> str: """ @@ -98,4 +102,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" 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/regulation.py b/twilio/rest/numbers/v2/regulatory_compliance/regulation.py index 9d9a50881..706853bce 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/regulation.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/regulation.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -72,23 +72,33 @@ def _proxy(self) -> "RegulationContext": ) return self._context - def fetch(self) -> "RegulationInstance": + def fetch( + self, include_constraints: Union[bool, object] = values.unset + ) -> "RegulationInstance": """ Fetch the RegulationInstance + :param include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :returns: The fetched RegulationInstance """ - return self._proxy.fetch() + return self._proxy.fetch( + include_constraints=include_constraints, + ) - async def fetch_async(self) -> "RegulationInstance": + async def fetch_async( + self, include_constraints: Union[bool, object] = values.unset + ) -> "RegulationInstance": """ Asynchronous coroutine to fetch the RegulationInstance + :param include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :returns: The fetched RegulationInstance """ - return await self._proxy.fetch_async() + return await self._proxy.fetch_async( + include_constraints=include_constraints, + ) def __repr__(self) -> str: """ @@ -117,36 +127,50 @@ def __init__(self, version: Version, sid: str): } self._uri = "/RegulatoryCompliance/Regulations/{sid}".format(**self._solution) - def fetch(self) -> RegulationInstance: + def fetch( + self, include_constraints: Union[bool, object] = values.unset + ) -> RegulationInstance: """ Fetch the RegulationInstance + :param include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :returns: The fetched RegulationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, + data = values.of( + { + "IncludeConstraints": serialize.boolean_to_string(include_constraints), + } ) + payload = self._version.fetch(method="GET", uri=self._uri, params=data) + return RegulationInstance( self._version, payload, sid=self._solution["sid"], ) - async def fetch_async(self) -> RegulationInstance: + async def fetch_async( + self, include_constraints: Union[bool, object] = values.unset + ) -> RegulationInstance: """ Asynchronous coroutine to fetch the RegulationInstance + :param include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :returns: The fetched RegulationInstance """ + data = values.of( + { + "IncludeConstraints": serialize.boolean_to_string(include_constraints), + } + ) + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, params=data ) return RegulationInstance( @@ -202,6 +226,7 @@ def stream( end_user_type: Union["RegulationInstance.EndUserType", object] = values.unset, iso_country: Union[str, object] = values.unset, number_type: Union[str, object] = values.unset, + include_constraints: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[RegulationInstance]: @@ -214,6 +239,7 @@ def stream( :param "RegulationInstance.EndUserType" end_user_type: The type of End User the regulation requires - can be `individual` or `business`. :param str iso_country: The ISO country code of the phone number's country. :param str number_type: The type of phone number that the regulatory requiremnt is restricting. + :param bool include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -228,6 +254,7 @@ def stream( end_user_type=end_user_type, iso_country=iso_country, number_type=number_type, + include_constraints=include_constraints, page_size=limits["page_size"], ) @@ -238,6 +265,7 @@ async def stream_async( end_user_type: Union["RegulationInstance.EndUserType", object] = values.unset, iso_country: Union[str, object] = values.unset, number_type: Union[str, object] = values.unset, + include_constraints: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[RegulationInstance]: @@ -250,6 +278,7 @@ async def stream_async( :param "RegulationInstance.EndUserType" end_user_type: The type of End User the regulation requires - can be `individual` or `business`. :param str iso_country: The ISO country code of the phone number's country. :param str number_type: The type of phone number that the regulatory requiremnt is restricting. + :param bool include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -264,6 +293,7 @@ async def stream_async( end_user_type=end_user_type, iso_country=iso_country, number_type=number_type, + include_constraints=include_constraints, page_size=limits["page_size"], ) @@ -274,6 +304,7 @@ def list( end_user_type: Union["RegulationInstance.EndUserType", object] = values.unset, iso_country: Union[str, object] = values.unset, number_type: Union[str, object] = values.unset, + include_constraints: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[RegulationInstance]: @@ -285,6 +316,7 @@ def list( :param "RegulationInstance.EndUserType" end_user_type: The type of End User the regulation requires - can be `individual` or `business`. :param str iso_country: The ISO country code of the phone number's country. :param str number_type: The type of phone number that the regulatory requiremnt is restricting. + :param bool include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -299,6 +331,7 @@ def list( end_user_type=end_user_type, iso_country=iso_country, number_type=number_type, + include_constraints=include_constraints, limit=limit, page_size=page_size, ) @@ -309,6 +342,7 @@ async def list_async( end_user_type: Union["RegulationInstance.EndUserType", object] = values.unset, iso_country: Union[str, object] = values.unset, number_type: Union[str, object] = values.unset, + include_constraints: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[RegulationInstance]: @@ -320,6 +354,7 @@ async def list_async( :param "RegulationInstance.EndUserType" end_user_type: The type of End User the regulation requires - can be `individual` or `business`. :param str iso_country: The ISO country code of the phone number's country. :param str number_type: The type of phone number that the regulatory requiremnt is restricting. + :param bool include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -335,6 +370,7 @@ async def list_async( end_user_type=end_user_type, iso_country=iso_country, number_type=number_type, + include_constraints=include_constraints, limit=limit, page_size=page_size, ) @@ -345,6 +381,7 @@ def page( end_user_type: Union["RegulationInstance.EndUserType", object] = values.unset, iso_country: Union[str, object] = values.unset, number_type: Union[str, object] = values.unset, + include_constraints: Union[bool, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -356,6 +393,7 @@ def page( :param end_user_type: The type of End User the regulation requires - can be `individual` or `business`. :param iso_country: The ISO country code of the phone number's country. :param number_type: The type of phone number that the regulatory requiremnt is restricting. + :param include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -367,6 +405,7 @@ def page( "EndUserType": end_user_type, "IsoCountry": iso_country, "NumberType": number_type, + "IncludeConstraints": serialize.boolean_to_string(include_constraints), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -381,6 +420,7 @@ async def page_async( end_user_type: Union["RegulationInstance.EndUserType", object] = values.unset, iso_country: Union[str, object] = values.unset, number_type: Union[str, object] = values.unset, + include_constraints: Union[bool, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -392,6 +432,7 @@ async def page_async( :param end_user_type: The type of End User the regulation requires - can be `individual` or `business`. :param iso_country: The ISO country code of the phone number's country. :param number_type: The type of phone number that the regulatory requiremnt is restricting. + :param include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -403,6 +444,7 @@ async def page_async( "EndUserType": end_user_type, "IsoCountry": iso_country, "NumberType": number_type, + "IncludeConstraints": serialize.boolean_to_string(include_constraints), "PageToken": page_token, "Page": page_number, "PageSize": page_size, 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) diff --git a/twilio/twiml/voice_response.py b/twilio/twiml/voice_response.py index 6beb109dc..c6d453e14 100644 --- a/twilio/twiml/voice_response.py +++ b/twilio/twiml/voice_response.py @@ -663,13 +663,81 @@ def siprec( ) ) + def transcription( + self, + name=None, + track=None, + status_callback_url=None, + status_callback_method=None, + inbound_track_label=None, + outbound_track_label=None, + partial_results=None, + language_code=None, + transcription_engine=None, + profanity_filter=None, + speech_model=None, + hints=None, + enable_automatic_punctuation=None, + **kwargs + ): + """ + Create a element -class Siprec(TwiML): - """ TwiML Noun""" + :param name: Friendly name given to the Transcription + :param track: Track to be analyze by the provider + :param status_callback_url: Status Callback URL + :param status_callback_method: Status Callback URL method + :param inbound_track_label: Friendly name given to the Inbound Track + :param outbound_track_label: Friendly name given to the Outbound Track Label + :param partial_results: Indicates if partial results are going to be send to the customer + :param language_code: Language Code used by the transcription engine + :param transcription_engine: Transcription Engine to be used + :param profanity_filter: Enable Profanity Filter + :param speech_model: Speech Model used by the transcription engine + :param hints: Hints to be provided to the transcription engine + :param enable_automatic_punctuation: Enable Automatic Punctuation + :param kwargs: additional attributes + + :returns: element + """ + return self.nest( + Transcription( + name=name, + track=track, + status_callback_url=status_callback_url, + status_callback_method=status_callback_method, + inbound_track_label=inbound_track_label, + outbound_track_label=outbound_track_label, + partial_results=partial_results, + language_code=language_code, + transcription_engine=transcription_engine, + profanity_filter=profanity_filter, + speech_model=speech_model, + hints=hints, + enable_automatic_punctuation=enable_automatic_punctuation, + **kwargs + ) + ) + + +class Transcription(TwiML): + """ TwiML Noun""" def __init__(self, **kwargs): - super(Siprec, self).__init__(**kwargs) - self.name = "Siprec" + super(Transcription, self).__init__(**kwargs) + self.name = "Transcription" + + def config(self, name=None, value=None, **kwargs): + """ + Create a element + + :param name: The name of the custom config + :param value: The value of the custom config + :param kwargs: additional attributes + + :returns: element + """ + return self.nest(Config(name=name, value=value, **kwargs)) def parameter(self, name=None, value=None, **kwargs): """ @@ -692,6 +760,34 @@ def __init__(self, **kwargs): self.name = "Parameter" +class Config(TwiML): + """ TwiML Noun""" + + def __init__(self, **kwargs): + super(Config, self).__init__(**kwargs) + self.name = "Config" + + +class Siprec(TwiML): + """ TwiML Noun""" + + def __init__(self, **kwargs): + super(Siprec, self).__init__(**kwargs) + self.name = "Siprec" + + def parameter(self, name=None, value=None, **kwargs): + """ + Create a element + + :param name: The name of the custom parameter + :param value: The value of the custom parameter + :param kwargs: additional attributes + + :returns: element + """ + return self.nest(Parameter(name=name, value=value, **kwargs)) + + class Stream(TwiML): """ TwiML Noun""" @@ -786,6 +882,62 @@ def siprec( ) ) + def transcription( + self, + name=None, + track=None, + status_callback_url=None, + status_callback_method=None, + inbound_track_label=None, + outbound_track_label=None, + partial_results=None, + language_code=None, + transcription_engine=None, + profanity_filter=None, + speech_model=None, + hints=None, + enable_automatic_punctuation=None, + **kwargs + ): + """ + Create a element + + :param name: Friendly name given to the Transcription + :param track: Track to be analyze by the provider + :param status_callback_url: Status Callback URL + :param status_callback_method: Status Callback URL method + :param inbound_track_label: Friendly name given to the Inbound Track + :param outbound_track_label: Friendly name given to the Outbound Track Label + :param partial_results: Indicates if partial results are going to be send to the customer + :param language_code: Language Code used by the transcription engine + :param transcription_engine: Transcription Engine to be used + :param profanity_filter: Enable Profanity Filter + :param speech_model: Speech Model used by the transcription engine + :param hints: Hints to be provided to the transcription engine + :param enable_automatic_punctuation: Enable Automatic Punctuation + :param kwargs: additional attributes + + :returns: element + """ + return self.nest( + Transcription( + name=name, + track=track, + status_callback_url=status_callback_url, + status_callback_method=status_callback_method, + inbound_track_label=inbound_track_label, + outbound_track_label=outbound_track_label, + partial_results=partial_results, + language_code=language_code, + transcription_engine=transcription_engine, + profanity_filter=profanity_filter, + speech_model=speech_model, + hints=hints, + enable_automatic_punctuation=enable_automatic_punctuation, + **kwargs + ) + ) + class Prompt(TwiML): """ Twiml Verb""" @@ -2614,14 +2766,6 @@ def parameter(self, name=None, value=None, **kwargs): return self.nest(Parameter(name=name, value=value, **kwargs)) -class Config(TwiML): - """ TwiML Noun""" - - def __init__(self, **kwargs): - super(Config, self).__init__(**kwargs) - self.name = "Config" - - class Autopilot(TwiML): """ TwiML Noun"""