From 3509e61adeb10c9d1ddcb75d13c0dd7df67585a2 Mon Sep 17 00:00:00 2001 From: Manisha Singh Date: Fri, 1 Dec 2023 11:06:19 +0530 Subject: [PATCH 01/13] feat: json content type (#737) * feat: add application/json support for client * feat: add application/json support for client * feat: add application/json support for client * feat: add application/json support for client * feat: add application/json support for client --- twilio/http/http_client.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/twilio/http/http_client.py b/twilio/http/http_client.py index bfc38feaf7..7a1715ad49 100644 --- a/twilio/http/http_client.py +++ b/twilio/http/http_client.py @@ -27,11 +27,10 @@ def __init__( ): """ Constructor for the TwilioHttpClient - :param pool_connections :param request_hooks :param timeout: Timeout for the requests. - Timeout should never be zero (0) or less. + Timeout should never be zero (0) or less :param logger :param proxy: Http proxy for the requests session :param max_retries: Maximum number of retries each request should attempt @@ -65,10 +64,10 @@ def request( :param headers: HTTP Headers to send with the request :param auth: Basic Auth arguments :param timeout: Socket/Read timeout for the request - :param allow_redirects: Whether or not to allow redirects + :param allow_redirects: Whether to allow redirects See the requests documentation for explanation of all these parameters - :return: An http response + :return: An HTTP response """ if timeout is None: timeout = self.timeout @@ -79,12 +78,14 @@ def request( "method": method.upper(), "url": url, "params": params, - "data": data, "headers": headers, "auth": auth, "hooks": self.request_hooks, } - + if headers and headers.get("Content-Type") == "application/json": + kwargs["json"] = data + else: + kwargs["data"] = data self.log_request(kwargs) self._test_only_last_response = None From 01077998c7b89449717e2ca34040f7694e2fcb8f Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Wed, 6 Dec 2023 17:57:12 +0530 Subject: [PATCH 02/13] chore: updated changelogs for rc-branch --- CHANGES.md | 4 ++++ UPGRADE.md | 10 ++++++++++ setup.py | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 12b45c6b05..3054ab1962 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,10 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2023-12-06] Version 9.0.0-rc.0 +--------------------------- +- Release Candidate preparation + [2023-11-17] Version 8.10.2 --------------------------- **Library - Chore** diff --git a/UPGRADE.md b/UPGRADE.md index 79bdb48cc5..4bf1602c61 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -3,6 +3,16 @@ _`MAJOR` version bumps will have upgrade notes posted here._ +## [2023-12-06] 8.x.x to 9.x.x-rc.x + +--- +### Overview + +#### Twilio Python Helper Library’s major version 9.0.0-rc.x is now available. We ensured that you can upgrade to Python helper Library 9.0.0-rc.x version without any breaking changes + +Support for JSON payloads has been added in the request body + + ## [2023-04-05] 7.x.x to 8.x.x - **Supported Python versions updated** diff --git a/setup.py b/setup.py index 0c3f8983a8..0ac07a566a 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="8.10.2", + version="9.0.0-rc", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", From 568048c313d27e8f452798cb80638fb70983fee2 Mon Sep 17 00:00:00 2001 From: Manisha Singh Date: Wed, 13 Dec 2023 18:13:22 +0530 Subject: [PATCH 03/13] chore: add domain detail (#739) * feat: add domain detail to twilio python * feat: add domain detail to twilio python * feat: add domain detail to twilio python * feat: add domain detail to twilio python --- twilio/rest/__init__.py | 15 ++ .../preview_messaging/PreviewMessagingBase.py | 43 ++++ twilio/rest/preview_messaging/__init__.py | 13 + twilio/rest/preview_messaging/v1/__init__.py | 50 ++++ twilio/rest/preview_messaging/v1/broadcast.py | 126 ++++++++++ twilio/rest/preview_messaging/v1/message.py | 237 ++++++++++++++++++ 6 files changed, 484 insertions(+) create mode 100644 twilio/rest/preview_messaging/PreviewMessagingBase.py create mode 100644 twilio/rest/preview_messaging/__init__.py create mode 100644 twilio/rest/preview_messaging/v1/__init__.py create mode 100644 twilio/rest/preview_messaging/v1/broadcast.py create mode 100644 twilio/rest/preview_messaging/v1/message.py diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 1206b29b0b..044537c41a 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -34,6 +34,7 @@ from twilio.rest.notify import Notify from twilio.rest.numbers import Numbers from twilio.rest.preview import Preview + from twilio.rest.preview_messaging import PreviewMessaging from twilio.rest.pricing import Pricing from twilio.rest.proxy import Proxy from twilio.rest.routes import Routes @@ -142,6 +143,7 @@ def __init__( self._notify: Optional["Notify"] = None self._numbers: Optional["Numbers"] = None self._preview: Optional["Preview"] = None + self._preview_messaging: Optional["PreviewMessaging"] = None self._pricing: Optional["Pricing"] = None self._proxy: Optional["Proxy"] = None self._routes: Optional["Routes"] = None @@ -430,6 +432,19 @@ def preview(self) -> "Preview": self._preview = Preview(self) return self._preview + @property + def preview_messaging(self) -> "PreviewMessaging": + """ + Access the Preview Messaging Twilio Domain + + :returns: Preview Messaging Twilio Domain + """ + if self._preview_messaging is None: + from twilio.rest.preview_messaging import PreviewMessaging + + self._preview_messaging = PreviewMessaging(self) + return self._preview_messaging + @property def pricing(self) -> "Pricing": """ diff --git a/twilio/rest/preview_messaging/PreviewMessagingBase.py b/twilio/rest/preview_messaging/PreviewMessagingBase.py new file mode 100644 index 0000000000..3b03fb7c0e --- /dev/null +++ b/twilio/rest/preview_messaging/PreviewMessagingBase.py @@ -0,0 +1,43 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional + +from twilio.base.domain import Domain +from twilio.rest import Client +from twilio.rest.preview_messaging.v1 import V1 + + +class PreviewMessagingBase(Domain): + def __init__(self, twilio: Client): + """ + Initialize the Preview Messaging Domain + + :returns: Domain for Preview Messaging + """ + super().__init__(twilio, "https://preview.messaging.twilio.com") + self._v1: Optional[V1] = None + + @property + def v1(self) -> V1: + """ + :returns: Versions v1 of Preview Messaging + """ + if self._v1 is None: + self._v1 = V1(self) + return self._v1 + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_messaging/__init__.py b/twilio/rest/preview_messaging/__init__.py new file mode 100644 index 0000000000..73bf67969d --- /dev/null +++ b/twilio/rest/preview_messaging/__init__.py @@ -0,0 +1,13 @@ +from twilio.rest.preview_messaging.PreviewMessagingBase import PreviewMessagingBase +from twilio.rest.preview_messaging.v1.broadcast import BroadcastList +from twilio.rest.preview_messaging.v1.message import MessageList + + +class PreviewMessaging(PreviewMessagingBase): + @property + def broadcast(self) -> BroadcastList: + return self.v1.broadcasts + + @property + def messages(self) -> MessageList: + return self.v1.messages diff --git a/twilio/rest/preview_messaging/v1/__init__.py b/twilio/rest/preview_messaging/v1/__init__.py new file mode 100644 index 0000000000..0e1e182d49 --- /dev/null +++ b/twilio/rest/preview_messaging/v1/__init__.py @@ -0,0 +1,50 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Bulk Messaging and Broadcast + Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.preview_messaging.v1.broadcast import BroadcastList +from twilio.rest.preview_messaging.v1.message import MessageList + + +class V1(Version): + def __init__(self, domain: Domain): + """ + Initialize the V1 version of PreviewMessaging + + :param domain: The Twilio.preview_messaging domain + """ + super().__init__(domain, "v1") + self._broadcasts: Optional[BroadcastList] = None + self._messages: Optional[MessageList] = None + + @property + def broadcasts(self) -> BroadcastList: + if self._broadcasts is None: + self._broadcasts = BroadcastList(self) + return self._broadcasts + + @property + def messages(self) -> MessageList: + if self._messages is None: + self._messages = MessageList(self) + return self._messages + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_messaging/v1/broadcast.py b/twilio/rest/preview_messaging/v1/broadcast.py new file mode 100644 index 0000000000..3c8e1819d6 --- /dev/null +++ b/twilio/rest/preview_messaging/v1/broadcast.py @@ -0,0 +1,126 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Bulk Messaging and Broadcast + Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class BroadcastInstance(InstanceResource): + + """ + :ivar broadcast_sid: Numeric ID indentifying individual Broadcast requests + :ivar created_date: Timestamp of when the Broadcast was created + :ivar updated_date: Timestamp of when the Broadcast was last updated + :ivar broadcast_status: Status of the Broadcast request. Valid values are None, Pending-Upload, Uploaded, Queued, Executing, Execution-Failure, Execution-Completed, Cancelation-Requested, and Canceled + :ivar execution_details: + :ivar results_file: Path to a file detailing successful requests and errors from Broadcast execution + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.broadcast_sid: Optional[str] = payload.get("broadcast_sid") + self.created_date: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("created_date") + ) + self.updated_date: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("updated_date") + ) + self.broadcast_status: Optional[str] = payload.get("broadcast_status") + self.execution_details: Optional[str] = payload.get("execution_details") + self.results_file: Optional[str] = payload.get("results_file") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class BroadcastList(ListResource): + def __init__(self, version: Version): + """ + Initialize the BroadcastList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Broadcasts" + + def create( + self, x_twilio_request_key: Union[str, object] = values.unset + ) -> BroadcastInstance: + """ + Create the BroadcastInstance + + :param x_twilio_request_key: Idempotency key provided by the client + + :returns: The created BroadcastInstance + """ + + data = values.of({}) + headers = values.of( + { + "X-Twilio-Request-Key": x_twilio_request_key, + } + ) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return BroadcastInstance(self._version, payload) + + async def create_async( + self, x_twilio_request_key: Union[str, object] = values.unset + ) -> BroadcastInstance: + """ + Asynchronously create the BroadcastInstance + + :param x_twilio_request_key: Idempotency key provided by the client + + :returns: The created BroadcastInstance + """ + + data = values.of({}) + headers = values.of( + { + "X-Twilio-Request-Key": x_twilio_request_key, + } + ) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return BroadcastInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_messaging/v1/message.py b/twilio/rest/preview_messaging/v1/message.py new file mode 100644 index 0000000000..2d83b93382 --- /dev/null +++ b/twilio/rest/preview_messaging/v1/message.py @@ -0,0 +1,237 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Bulk Messaging and Broadcast + Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + + +from typing import Any, Dict, List, Optional +from twilio.base import deserialize + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class MessageInstance(InstanceResource): + + """ + :ivar total_message_count: The number of Messages processed in the request, equal to the sum of success_count and error_count. + :ivar success_count: The number of Messages successfully created. + :ivar error_count: The number of Messages unsuccessfully processed in the request. + :ivar message_receipts: + :ivar failed_message_receipts: + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.total_message_count: Optional[int] = deserialize.integer( + payload.get("total_message_count") + ) + self.success_count: Optional[int] = deserialize.integer( + payload.get("success_count") + ) + self.error_count: Optional[int] = deserialize.integer( + payload.get("error_count") + ) + self.message_receipts: Optional[List[str]] = payload.get("message_receipts") + self.failed_message_receipts: Optional[List[str]] = payload.get( + "failed_message_receipts" + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class MessageList(ListResource): + class CreateMessagesRequest(object): + """ + :ivar messages: + :ivar from_: A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty. + :ivar messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured and leave the `from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery. + :ivar body: The text of the message you want to send. Can be up to 1,600 characters in length. + :ivar content_sid: The SID of the preconfigured [Content Template](https://www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided `ContentVariables`. This Twilio product is currently in Private Beta. + :ivar media_url: The URL of the media to send with the message. The media can be of type `gif`, `png`, and `jpeg` and will be formatted correctly on the recipient's device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple `media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada. + :ivar status_callback: The URL we should call using the \"status_callback_method\" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](https://www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including \"MessageSid\", \"MessageStatus\", and \"ErrorCode\". If you include this parameter with the \"messaging_service_sid\", we use this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed. + :ivar validity_period: How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds. + :ivar send_at: The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format. + :ivar schedule_type: This parameter indicates your intent to schedule a message. Pass the value `fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter. + :ivar shorten_urls: Determines the usage of Click Tracking. Setting it to `true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`. + :ivar send_as_mms: If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media. + :ivar max_price: The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked. + :ivar attempt: Total number of attempts made ( including this ) to send out the message regardless of the provider used + :ivar smart_encoded: This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false. + :ivar force_delivery: This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline. + :ivar application_sid: The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application's message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application's message_status_callback parameter will be used. + """ + + def __init__(self, payload: Dict[str, Any]): + self.messages: Optional[MessageList.MessagingV1Message] = payload.get( + "messages" + ) + self.from_: Optional[str] = payload.get("from_") + self.messaging_service_sid: Optional[str] = payload.get( + "messaging_service_sid" + ) + self.body: Optional[str] = payload.get("body") + self.content_sid: Optional[str] = payload.get("content_sid") + self.media_url: Optional[str] = payload.get("media_url") + self.status_callback: Optional[str] = payload.get("status_callback") + self.validity_period: Optional[int] = payload.get("validity_period") + self.send_at: Optional[str] = payload.get("send_at") + self.schedule_type: Optional[str] = payload.get("schedule_type") + self.shorten_urls: Optional[bool] = payload.get("shorten_urls") + self.send_as_mms: Optional[bool] = payload.get("send_as_mms") + self.max_price: Optional[float] = payload.get("max_price") + self.attempt: Optional[int] = payload.get("attempt") + self.smart_encoded: Optional[bool] = payload.get("smart_encoded") + self.force_delivery: Optional[bool] = payload.get("force_delivery") + self.application_sid: Optional[str] = payload.get("application_sid") + + def to_dict(self): + return { + "messages": [messages.to_dict() for messages in self.messages], + "from": self.from_, + "messaging_service_sid": self.messaging_service_sid, + "body": self.body, + "content_sid": self.content_sid, + "media_url": self.media_url, + "status_callback": self.status_callback, + "validity_period": self.validity_period, + "send_at": self.send_at, + "schedule_type": self.schedule_type, + "shorten_urls": self.shorten_urls, + "send_as_mms": self.send_as_mms, + "max_price": self.max_price, + "attempt": self.attempt, + "smart_encoded": self.smart_encoded, + "force_delivery": self.force_delivery, + "application_sid": self.application_sid, + } + + class MessagingV1FailedMessageReceipt(object): + """ + :ivar to: The recipient phone number + :ivar error_message: The description of the error_code + :ivar error_code: The error code associated with the message creation attempt + """ + + def __init__(self, payload: Dict[str, Any]): + self.to: Optional[str] = payload.get("to") + self.error_message: Optional[str] = payload.get("error_message") + self.error_code: Optional[int] = payload.get("error_code") + + def to_dict(self): + return { + "to": self.to, + "error_message": self.error_message, + "error_code": self.error_code, + } + + class MessagingV1Message(object): + """ + :ivar to: The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format for SMS/MMS or [Channel user address](https://www.twilio.com/docs/sms/channels#channel-addresses) for other 3rd-party channels. + :ivar body: The text of the message you want to send. Can be up to 1,600 characters in length. Overrides the request-level body and content template if provided. + :ivar content_variables: Key-value pairs of variable names to substitution values. Refer to the [Twilio Content API Resources](https://www.twilio.com/docs/content-api/content-api-resources#send-a-message-with-preconfigured-content) for more details. + """ + + def __init__(self, payload: Dict[str, Any]): + self.to: Optional[str] = payload.get("to") + self.body: Optional[str] = payload.get("body") + self.content_variables: Optional[dict[str, str]] = payload.get( + "content_variables" + ) + + def to_dict(self): + return { + "to": self.to, + "body": self.body, + "content_variables": self.content_variables, + } + + class MessagingV1MessageReceipt(object): + """ + :ivar to: The recipient phone number + :ivar sid: The unique string that identifies the resource + """ + + def __init__(self, payload: Dict[str, Any]): + self.to: Optional[str] = payload.get("to") + self.sid: Optional[str] = payload.get("sid") + + def to_dict(self): + return { + "to": self.to, + "sid": self.sid, + } + + def __init__(self, version: Version): + """ + Initialize the MessageList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Messages" + + def create(self, create_messages_request: CreateMessagesRequest) -> MessageInstance: + """ + Create the MessageInstance + + :param create_messages_request: + + :returns: The created MessageInstance + """ + data = create_messages_request.to_dict() + + headers = {"Content-Type": "application/json"} + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return MessageInstance(self._version, payload) + + async def create_async( + self, create_messages_request: CreateMessagesRequest + ) -> MessageInstance: + """ + Asynchronously create the MessageInstance + + :param create_messages_request: + + :returns: The created MessageInstance + """ + + data = create_messages_request.to_dict() + headers = {"Content-Type": "application/json"} + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return MessageInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" From 343a3b22a1a3c4e70f092595e597b21f1e2f5aa5 Mon Sep 17 00:00:00 2001 From: sbansla Date: Thu, 4 Jan 2024 14:08:40 +0530 Subject: [PATCH 04/13] corrected rc version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0ac07a566a..a4708e3d57 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.0.0-rc", + version="9.0.0-rc.0", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", From 22c6cb0e35ab68249f4c81aabce97354e11d5d1c Mon Sep 17 00:00:00 2001 From: Shubham Date: Thu, 4 Jan 2024 15:32:23 +0530 Subject: [PATCH 05/13] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a4708e3d57..12c0b48339 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.0.0-rc.0", + version="9.0.0-rc.0", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", From 5a4bddc9999904a3d5c93a47bab593bae5386ee6 Mon Sep 17 00:00:00 2001 From: Shubham Date: Thu, 4 Jan 2024 15:35:06 +0530 Subject: [PATCH 06/13] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 12c0b48339..a4708e3d57 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.0.0-rc.0", + version="9.0.0-rc.0", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", From 399e1e34a27931d05a1f2648c5e3fab191b3d51c Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Mon, 8 Jan 2024 12:56:42 +0530 Subject: [PATCH 07/13] chore: corrected cluster test --- tests/cluster/test_webhook.py | 163 ++++++++++++++++------------------ 1 file changed, 79 insertions(+), 84 deletions(-) diff --git a/tests/cluster/test_webhook.py b/tests/cluster/test_webhook.py index 37c0dda3b1..307cf3d397 100644 --- a/tests/cluster/test_webhook.py +++ b/tests/cluster/test_webhook.py @@ -1,12 +1,7 @@ import os -import unittest -import time -import _thread -from http.server import BaseHTTPRequestHandler, HTTPServer -from pyngrok import ngrok +from http.server import BaseHTTPRequestHandler from twilio.request_validator import RequestValidator -from twilio.rest import Client class RequestHandler(BaseHTTPRequestHandler): @@ -34,81 +29,81 @@ def process_request(self): ) -class WebhookTest(unittest.TestCase): - def setUp(self): - api_key = os.environ["TWILIO_API_KEY"] - api_secret = os.environ["TWILIO_API_SECRET"] - account_sid = os.environ["TWILIO_ACCOUNT_SID"] - self.client = Client(api_key, api_secret, account_sid) - - portNumber = 7777 - self.validation_server = HTTPServer(("", portNumber), RequestHandler) - self.tunnel = ngrok.connect(portNumber) - self.flow_sid = "" - _thread.start_new_thread(self.start_http_server, ()) - - def start_http_server(self): - self.validation_server.serve_forever() - - def tearDown(self): - self.client.studio.v2.flows(self.flow_sid).delete() - ngrok.kill() - self.validation_server.shutdown() - self.validation_server.server_close() - - def create_studio_flow(self, url, method): - flow = self.client.studio.v2.flows.create( - friendly_name="Python Cluster Test Flow", - status="published", - definition={ - "description": "Studio Flow", - "states": [ - { - "name": "Trigger", - "type": "trigger", - "transitions": [ - { - "next": "httpRequest", - "event": "incomingRequest", - }, - ], - "properties": {}, - }, - { - "name": "httpRequest", - "type": "make-http-request", - "transitions": [], - "properties": { - "method": method, - "content_type": "application/x-www-form-urlencoded;charset=utf-8", - "url": url, - }, - }, - ], - "initial_state": "Trigger", - "flags": { - "allow_concurrent_calls": True, - }, - }, - ) - return flow - - def validate(self, method): - flow = self.create_studio_flow(url=self.tunnel.public_url, method=method) - self.flow_sid = flow.sid - time.sleep(5) - self.client.studio.v2.flows(self.flow_sid).executions.create( - to="to", from_="from" - ) - - def test_get(self): - time.sleep(5) - self.validate("GET") - time.sleep(5) - self.assertEqual(RequestHandler.is_request_valid, True) - - def test_post(self): - time.sleep(5) - self.validate("POST") - time.sleep(5) - self.assertEqual(RequestHandler.is_request_valid, True) +# class WebhookTest(unittest.TestCase): +# def setUp(self): +# api_key = os.environ["TWILIO_API_KEY"] +# api_secret = os.environ["TWILIO_API_SECRET"] +# account_sid = os.environ["TWILIO_ACCOUNT_SID"] +# self.client = Client(api_key, api_secret, account_sid) +# +# portNumber = 7777 +# self.validation_server = HTTPServer(("", portNumber), RequestHandler) +# self.tunnel = ngrok.connect(portNumber) +# self.flow_sid = "" +# _thread.start_new_thread(self.start_http_server, ()) +# +# def start_http_server(self): +# self.validation_server.serve_forever() +# +# def tearDown(self): +# self.client.studio.v2.flows(self.flow_sid).delete() +# ngrok.kill() +# self.validation_server.shutdown() +# self.validation_server.server_close() +# +# def create_studio_flow(self, url, method): +# flow = self.client.studio.v2.flows.create( +# friendly_name="Python Cluster Test Flow", +# status="published", +# definition={ +# "description": "Studio Flow", +# "states": [ +# { +# "name": "Trigger", +# "type": "trigger", +# "transitions": [ +# { +# "next": "httpRequest", +# "event": "incomingRequest", +# }, +# ], +# "properties": {}, +# }, +# { +# "name": "httpRequest", +# "type": "make-http-request", +# "transitions": [], +# "properties": { +# "method": method, +# "content_type": "application/x-www-form-urlencoded;charset=utf-8", +# "url": url, +# }, +# }, +# ], +# "initial_state": "Trigger", +# "flags": { +# "allow_concurrent_calls": True, +# }, +# }, +# ) +# return flow +# +# def validate(self, method): +# flow = self.create_studio_flow(url=self.tunnel.public_url, method=method) +# self.flow_sid = flow.sid +# time.sleep(5) +# self.client.studio.v2.flows(self.flow_sid).executions.create( +# to="to", from_="from" +# ) +# +# def test_get(self): +# time.sleep(5) +# self.validate("GET") +# time.sleep(5) +# self.assertEqual(RequestHandler.is_request_valid, True) +# +# def test_post(self): +# time.sleep(5) +# self.validate("POST") +# time.sleep(5) +# self.assertEqual(RequestHandler.is_request_valid, True) From 429765902549dbc4cad00c25f1856b0815677167 Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 8 Jan 2024 08:11:48 +0000 Subject: [PATCH 08/13] [Librarian] Regenerated @ 517c6276943255de674e1d20cdae01266b89160c dc7e93834d14ebcc1f96c25b9fbc8af35330f99a --- CHANGES.md | 6 + twilio/rest/__init__.py | 30 +-- twilio/rest/accounts/v1/credential/aws.py | 2 + .../rest/accounts/v1/credential/public_key.py | 2 + twilio/rest/accounts/v1/safelist.py | 2 + twilio/rest/api/v2010/account/__init__.py | 2 + .../api/v2010/account/address/__init__.py | 2 + twilio/rest/api/v2010/account/application.py | 2 + .../v2010/account/authorized_connect_app.py | 11 +- .../rest/api/v2010/account/call/__init__.py | 74 +----- .../v2010/account/call/feedback_summary.py | 4 +- twilio/rest/api/v2010/account/call/payment.py | 2 + .../rest/api/v2010/account/call/recording.py | 2 + twilio/rest/api/v2010/account/call/siprec.py | 2 + twilio/rest/api/v2010/account/call/stream.py | 2 + .../account/call/user_defined_message.py | 2 + .../call/user_defined_message_subscription.py | 2 + .../api/v2010/account/conference/__init__.py | 72 ------ .../v2010/account/conference/participant.py | 2 + .../account/incoming_phone_number/__init__.py | 2 + .../assigned_add_on/__init__.py | 2 + .../account/incoming_phone_number/local.py | 2 + .../account/incoming_phone_number/mobile.py | 2 + .../incoming_phone_number/toll_free.py | 2 + .../api/v2010/account/message/__init__.py | 48 +--- .../api/v2010/account/message/feedback.py | 2 + twilio/rest/api/v2010/account/new_key.py | 2 + .../rest/api/v2010/account/new_signing_key.py | 2 + .../rest/api/v2010/account/queue/__init__.py | 2 + .../account/sip/credential_list/__init__.py | 2 + .../account/sip/credential_list/credential.py | 2 + .../api/v2010/account/sip/domain/__init__.py | 2 + .../auth_calls_credential_list_mapping.py | 2 + ...th_calls_ip_access_control_list_mapping.py | 2 + ...h_registrations_credential_list_mapping.py | 2 + .../sip/domain/credential_list_mapping.py | 2 + .../domain/ip_access_control_list_mapping.py | 2 + .../sip/ip_access_control_list/__init__.py | 2 + .../sip/ip_access_control_list/ip_address.py | 2 + twilio/rest/api/v2010/account/token.py | 2 + .../rest/api/v2010/account/usage/trigger.py | 2 + .../api/v2010/account/validation_request.py | 2 + .../rest/autopilot/v1/assistant/__init__.py | 2 + .../v1/assistant/field_type/__init__.py | 2 + .../v1/assistant/field_type/field_value.py | 2 + .../autopilot/v1/assistant/model_build.py | 2 + twilio/rest/autopilot/v1/assistant/query.py | 2 + .../autopilot/v1/assistant/task/__init__.py | 2 + .../rest/autopilot/v1/assistant/task/field.py | 2 + .../autopilot/v1/assistant/task/sample.py | 2 + twilio/rest/autopilot/v1/assistant/webhook.py | 2 + .../v1/export/export_custom_job.py | 2 + twilio/rest/chat/v1/credential.py | 2 + twilio/rest/chat/v1/service/__init__.py | 2 + .../rest/chat/v1/service/channel/__init__.py | 2 + twilio/rest/chat/v1/service/channel/invite.py | 2 + twilio/rest/chat/v1/service/channel/member.py | 2 + .../rest/chat/v1/service/channel/message.py | 2 + twilio/rest/chat/v1/service/role.py | 2 + twilio/rest/chat/v1/service/user/__init__.py | 2 + twilio/rest/chat/v2/credential.py | 2 + twilio/rest/chat/v2/service/__init__.py | 2 + .../rest/chat/v2/service/channel/__init__.py | 2 + twilio/rest/chat/v2/service/channel/invite.py | 2 + twilio/rest/chat/v2/service/channel/member.py | 2 + .../rest/chat/v2/service/channel/message.py | 2 + .../rest/chat/v2/service/channel/webhook.py | 2 + twilio/rest/chat/v2/service/role.py | 2 + twilio/rest/chat/v2/service/user/__init__.py | 2 + twilio/rest/content/v1/content/__init__.py | 2 +- .../rest/content/v1/content_and_approvals.py | 2 +- twilio/rest/content/v1/legacy_content.py | 2 +- .../conversations/v1/address_configuration.py | 2 + .../conversations/v1/conversation/__init__.py | 2 + .../v1/conversation/message/__init__.py | 10 +- .../v1/conversation/participant.py | 2 + .../conversations/v1/conversation/webhook.py | 2 + twilio/rest/conversations/v1/credential.py | 2 + twilio/rest/conversations/v1/role.py | 2 + .../rest/conversations/v1/service/__init__.py | 2 + .../v1/service/conversation/__init__.py | 2 + .../service/conversation/message/__init__.py | 10 +- .../v1/service/conversation/participant.py | 2 + .../v1/service/conversation/webhook.py | 2 + twilio/rest/conversations/v1/service/role.py | 2 + .../conversations/v1/service/user/__init__.py | 2 + twilio/rest/conversations/v1/user/__init__.py | 2 + twilio/rest/events/v1/sink/__init__.py | 2 + twilio/rest/events/v1/sink/sink_validate.py | 2 + .../rest/events/v1/subscription/__init__.py | 2 + .../v1/subscription/subscribed_event.py | 16 +- twilio/rest/flex_api/v1/assessments.py | 2 + twilio/rest/flex_api/v1/channel.py | 2 + twilio/rest/flex_api/v1/configuration.py | 64 +++++- twilio/rest/flex_api/v1/flex_flow.py | 2 + .../v1/insights_assessments_comment.py | 2 + .../flex_api/v1/insights_conversations.py | 2 +- .../flex_api/v1/insights_questionnaires.py | 4 +- .../v1/insights_questionnaires_category.py | 2 + .../v1/insights_questionnaires_question.py | 2 + .../rest/flex_api/v1/interaction/__init__.py | 2 + .../interaction_channel_invite.py | 2 + .../interaction_channel_participant.py | 2 + twilio/rest/flex_api/v1/web_channel.py | 2 + twilio/rest/flex_api/v2/web_channels.py | 2 + twilio/rest/intelligence/v2/service.py | 16 +- .../intelligence/v2/transcript/__init__.py | 4 +- .../v2/transcript/operator_result.py | 2 +- twilio/rest/ip_messaging/v1/credential.py | 2 + .../rest/ip_messaging/v1/service/__init__.py | 2 + .../v1/service/channel/__init__.py | 2 + .../ip_messaging/v1/service/channel/invite.py | 2 + .../ip_messaging/v1/service/channel/member.py | 2 + .../v1/service/channel/message.py | 2 + twilio/rest/ip_messaging/v1/service/role.py | 2 + .../ip_messaging/v1/service/user/__init__.py | 2 + twilio/rest/ip_messaging/v2/credential.py | 2 + .../rest/ip_messaging/v2/service/__init__.py | 2 + .../v2/service/channel/__init__.py | 2 + .../ip_messaging/v2/service/channel/invite.py | 2 + .../ip_messaging/v2/service/channel/member.py | 2 + .../v2/service/channel/message.py | 2 + .../v2/service/channel/webhook.py | 2 + twilio/rest/ip_messaging/v2/service/role.py | 2 + .../ip_messaging/v2/service/user/__init__.py | 2 + twilio/rest/media/v1/media_processor.py | 2 + .../rest/media/v1/player_streamer/__init__.py | 2 + .../v1/brand_registration/__init__.py | 2 + .../v1/brand_registration/brand_vetting.py | 2 + twilio/rest/messaging/v1/external_campaign.py | 2 + twilio/rest/messaging/v1/service/__init__.py | 2 + .../rest/messaging/v1/service/alpha_sender.py | 2 + .../rest/messaging/v1/service/phone_number.py | 2 + .../rest/messaging/v1/service/short_code.py | 2 + .../messaging/v1/service/us_app_to_person.py | 4 +- .../v1/service/us_app_to_person_usecase.py | 2 +- .../messaging/v1/tollfree_verification.py | 2 + twilio/rest/messaging/v1/usecase.py | 2 +- twilio/rest/microvisor/v1/account_config.py | 2 + twilio/rest/microvisor/v1/account_secret.py | 2 + .../microvisor/v1/device/device_config.py | 2 + .../microvisor/v1/device/device_secret.py | 2 + twilio/rest/notify/v1/credential.py | 2 + twilio/rest/notify/v1/service/__init__.py | 16 +- twilio/rest/notify/v1/service/binding.py | 2 + twilio/rest/notify/v1/service/notification.py | 6 +- twilio/rest/numbers/v1/__init__.py | 16 +- twilio/rest/numbers/v1/bulk_eligibility.py | 34 ++- twilio/rest/numbers/v1/eligibility.py | 92 ++++++++ .../numbers/v1/porting_bulk_portability.py | 6 +- twilio/rest/numbers/v1/porting_port_in.py | 94 ++++++++ .../rest/numbers/v1/porting_port_in_fetch.py | 217 ------------------ .../v2/authorization_document/__init__.py | 2 + .../numbers/v2/bulk_hosted_number_order.py | 34 ++- twilio/rest/numbers/v2/hosted_number_order.py | 2 + .../regulatory_compliance/bundle/__init__.py | 38 +-- .../bundle/bundle_copy.py | 2 + .../bundle/evaluation.py | 2 +- .../bundle/item_assignment.py | 2 + .../bundle/replace_items.py | 2 + .../v2/regulatory_compliance/end_user.py | 2 + .../v2/regulatory_compliance/end_user_type.py | 2 +- .../supporting_document.py | 2 + .../supporting_document_type.py | 2 +- .../deployed_devices/fleet/__init__.py | 2 + .../deployed_devices/fleet/certificate.py | 2 + .../deployed_devices/fleet/deployment.py | 2 + .../preview/deployed_devices/fleet/device.py | 2 + .../preview/deployed_devices/fleet/key.py | 2 + .../authorization_document/__init__.py | 2 + .../hosted_numbers/hosted_number_order.py | 2 + .../marketplace/installed_add_on/__init__.py | 2 + twilio/rest/preview/sync/service/__init__.py | 2 + .../preview/sync/service/document/__init__.py | 2 + .../sync/service/sync_list/__init__.py | 2 + .../sync/service/sync_list/sync_list_item.py | 2 + .../preview/sync/service/sync_map/__init__.py | 2 + .../sync/service/sync_map/sync_map_item.py | 2 + .../preview/understand/assistant/__init__.py | 2 + .../assistant/field_type/__init__.py | 2 + .../assistant/field_type/field_value.py | 2 + .../understand/assistant/model_build.py | 2 + .../preview/understand/assistant/query.py | 2 + .../understand/assistant/task/__init__.py | 2 + .../understand/assistant/task/field.py | 2 + .../understand/assistant/task/sample.py | 2 + twilio/rest/preview/wireless/command.py | 2 + twilio/rest/preview/wireless/rate_plan.py | 2 + .../preview_messaging/PreviewMessagingBase.py | 6 +- twilio/rest/preview_messaging/v1/message.py | 39 +--- twilio/rest/proxy/v1/service/__init__.py | 2 + twilio/rest/proxy/v1/service/phone_number.py | 2 + .../rest/proxy/v1/service/session/__init__.py | 2 + .../service/session/participant/__init__.py | 2 + .../participant/message_interaction.py | 2 + twilio/rest/proxy/v1/service/short_code.py | 2 + twilio/rest/serverless/v1/service/__init__.py | 2 + .../serverless/v1/service/asset/__init__.py | 2 + .../serverless/v1/service/build/__init__.py | 10 +- .../v1/service/build/build_status.py | 2 +- .../v1/service/environment/__init__.py | 2 + .../v1/service/environment/deployment.py | 2 + .../v1/service/environment/variable.py | 2 + .../v1/service/function/__init__.py | 2 + .../studio/v1/flow/engagement/__init__.py | 2 + .../rest/studio/v1/flow/execution/__init__.py | 2 + twilio/rest/studio/v2/flow/__init__.py | 6 +- .../rest/studio/v2/flow/execution/__init__.py | 2 + twilio/rest/studio/v2/flow/flow_revision.py | 2 +- twilio/rest/supersim/v1/esim_profile.py | 16 +- twilio/rest/supersim/v1/fleet.py | 2 + twilio/rest/supersim/v1/ip_command.py | 2 + twilio/rest/supersim/v1/network.py | 2 +- .../v1/network_access_profile/__init__.py | 2 + .../network_access_profile_network.py | 4 +- twilio/rest/supersim/v1/settings_update.py | 2 +- twilio/rest/supersim/v1/sim/__init__.py | 2 + twilio/rest/supersim/v1/sms_command.py | 2 + twilio/rest/sync/v1/service/__init__.py | 2 + .../rest/sync/v1/service/document/__init__.py | 2 + .../sync/v1/service/sync_list/__init__.py | 2 + .../v1/service/sync_list/sync_list_item.py | 2 + .../rest/sync/v1/service/sync_map/__init__.py | 2 + .../sync/v1/service/sync_map/sync_map_item.py | 2 + .../sync/v1/service/sync_stream/__init__.py | 2 + .../v1/service/sync_stream/stream_message.py | 2 + .../rest/taskrouter/v1/workspace/__init__.py | 2 + .../rest/taskrouter/v1/workspace/activity.py | 2 + .../taskrouter/v1/workspace/task/__init__.py | 2 + .../v1/workspace/task/reservation.py | 12 - .../taskrouter/v1/workspace/task_channel.py | 2 + .../v1/workspace/task_queue/__init__.py | 19 ++ .../task_queue_bulk_real_time_statistics.py | 124 ++++++++++ .../task_queue_real_time_statistics.py | 2 +- .../v1/workspace/worker/__init__.py | 2 + .../v1/workspace/worker/reservation.py | 12 - .../worker/workers_cumulative_statistics.py | 2 +- .../worker/workers_real_time_statistics.py | 2 +- .../v1/workspace/workflow/__init__.py | 2 + .../workspace_real_time_statistics.py | 2 +- twilio/rest/trunking/v1/trunk/__init__.py | 2 + .../rest/trunking/v1/trunk/credential_list.py | 2 + .../v1/trunk/ip_access_control_list.py | 2 + .../rest/trunking/v1/trunk/origination_url.py | 2 + twilio/rest/trunking/v1/trunk/phone_number.py | 2 + .../rest/trusthub/v1/compliance_inquiries.py | 2 + .../v1/compliance_tollfree_inquiries.py | 142 +----------- .../trusthub/v1/customer_profiles/__init__.py | 2 + ...er_profiles_channel_endpoint_assignment.py | 2 + .../customer_profiles_entity_assignments.py | 2 + .../customer_profiles_evaluations.py | 4 +- twilio/rest/trusthub/v1/end_user.py | 2 + twilio/rest/trusthub/v1/end_user_type.py | 2 +- .../rest/trusthub/v1/supporting_document.py | 2 + .../trusthub/v1/supporting_document_type.py | 2 +- .../trusthub/v1/trust_products/__init__.py | 2 + ...st_products_channel_endpoint_assignment.py | 2 + .../trust_products_entity_assignments.py | 2 + .../trust_products_evaluations.py | 4 +- twilio/rest/verify/v2/safelist.py | 2 + twilio/rest/verify/v2/service/__init__.py | 24 +- twilio/rest/verify/v2/service/access_token.py | 2 + .../rest/verify/v2/service/entity/__init__.py | 2 + .../v2/service/entity/challenge/__init__.py | 2 + .../service/entity/challenge/notification.py | 2 + .../verify/v2/service/entity/new_factor.py | 2 + .../v2/service/messaging_configuration.py | 2 + .../verify/v2/service/rate_limit/__init__.py | 2 + .../verify/v2/service/rate_limit/bucket.py | 2 + twilio/rest/verify/v2/service/verification.py | 4 +- .../verify/v2/service/verification_check.py | 4 +- twilio/rest/verify/v2/service/webhook.py | 2 + twilio/rest/video/v1/composition.py | 2 + twilio/rest/video/v1/composition_hook.py | 2 + twilio/rest/video/v1/room/__init__.py | 2 + twilio/rest/voice/v1/byoc_trunk.py | 2 + .../voice/v1/connection_policy/__init__.py | 2 + .../connection_policy_target.py | 2 + .../bulk_country_update.py | 2 + twilio/rest/voice/v1/ip_record.py | 2 + twilio/rest/voice/v1/source_ip_mapping.py | 2 + twilio/rest/wireless/v1/command.py | 2 + twilio/rest/wireless/v1/rate_plan.py | 2 + 283 files changed, 1079 insertions(+), 761 deletions(-) create mode 100644 twilio/rest/numbers/v1/eligibility.py create mode 100644 twilio/rest/numbers/v1/porting_port_in.py delete mode 100644 twilio/rest/numbers/v1/porting_port_in_fetch.py create mode 100644 twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py diff --git a/CHANGES.md b/CHANGES.md index 7289bdc507..cb2ea55e6c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,12 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-01-08] Version 9.0.0-rc.1 +------------------------------- +**Library - Chore** +- [PR #743](https://github.com/twilio/twilio-python/pull/743): sync with main. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + + [2023-12-06] Version 9.0.0-rc.0 --------------------------- - Release Candidate preparation diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 044537c41a..3ff1070399 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -28,13 +28,13 @@ from twilio.rest.ip_messaging import IpMessaging from twilio.rest.lookups import Lookups from twilio.rest.media import Media + from twilio.rest.preview_messaging import PreviewMessaging from twilio.rest.messaging import Messaging from twilio.rest.microvisor import Microvisor from twilio.rest.monitor import Monitor from twilio.rest.notify import Notify from twilio.rest.numbers import Numbers from twilio.rest.preview import Preview - from twilio.rest.preview_messaging import PreviewMessaging from twilio.rest.pricing import Pricing from twilio.rest.proxy import Proxy from twilio.rest.routes import Routes @@ -137,13 +137,13 @@ def __init__( self._ip_messaging: Optional["IpMessaging"] = None self._lookups: Optional["Lookups"] = None self._media: Optional["Media"] = None + self._preview_messaging: Optional["PreviewMessaging"] = None self._messaging: Optional["Messaging"] = None self._microvisor: Optional["Microvisor"] = None self._monitor: Optional["Monitor"] = None self._notify: Optional["Notify"] = None self._numbers: Optional["Numbers"] = None self._preview: Optional["Preview"] = None - self._preview_messaging: Optional["PreviewMessaging"] = None self._pricing: Optional["Pricing"] = None self._proxy: Optional["Proxy"] = None self._routes: Optional["Routes"] = None @@ -354,6 +354,19 @@ def media(self) -> "Media": self._media = Media(self) return self._media + @property + def preview_messaging(self) -> "PreviewMessaging": + """ + Access the PreviewMessaging Twilio Domain + + :returns: PreviewMessaging Twilio Domain + """ + if self._preview_messaging is None: + from twilio.rest.preview_messaging import PreviewMessaging + + self._preview_messaging = PreviewMessaging(self) + return self._preview_messaging + @property def messaging(self) -> "Messaging": """ @@ -432,19 +445,6 @@ def preview(self) -> "Preview": self._preview = Preview(self) return self._preview - @property - def preview_messaging(self) -> "PreviewMessaging": - """ - Access the Preview Messaging Twilio Domain - - :returns: Preview Messaging Twilio Domain - """ - if self._preview_messaging is None: - from twilio.rest.preview_messaging import PreviewMessaging - - self._preview_messaging = PreviewMessaging(self) - return self._preview_messaging - @property def pricing(self) -> "Pricing": """ diff --git a/twilio/rest/accounts/v1/credential/aws.py b/twilio/rest/accounts/v1/credential/aws.py index 0e17164ecb..ae1efb6a1b 100644 --- a/twilio/rest/accounts/v1/credential/aws.py +++ b/twilio/rest/accounts/v1/credential/aws.py @@ -321,6 +321,7 @@ def create( :returns: The created AwsInstance """ + data = values.of( { "Credentials": credentials, @@ -352,6 +353,7 @@ async def create_async( :returns: The created AwsInstance """ + data = values.of( { "Credentials": credentials, diff --git a/twilio/rest/accounts/v1/credential/public_key.py b/twilio/rest/accounts/v1/credential/public_key.py index f78a6728c1..2177ebced2 100644 --- a/twilio/rest/accounts/v1/credential/public_key.py +++ b/twilio/rest/accounts/v1/credential/public_key.py @@ -325,6 +325,7 @@ def create( :returns: The created PublicKeyInstance """ + data = values.of( { "PublicKey": public_key, @@ -356,6 +357,7 @@ async def create_async( :returns: The created PublicKeyInstance """ + data = values.of( { "PublicKey": public_key, diff --git a/twilio/rest/accounts/v1/safelist.py b/twilio/rest/accounts/v1/safelist.py index ce4f33ebae..9ba12c1e99 100644 --- a/twilio/rest/accounts/v1/safelist.py +++ b/twilio/rest/accounts/v1/safelist.py @@ -64,6 +64,7 @@ def create(self, phone_number: str) -> SafelistInstance: :returns: The created SafelistInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -86,6 +87,7 @@ async def create_async(self, phone_number: str) -> SafelistInstance: :returns: The created SafelistInstance """ + data = values.of( { "PhoneNumber": phone_number, diff --git a/twilio/rest/api/v2010/account/__init__.py b/twilio/rest/api/v2010/account/__init__.py index fafb4f573c..d45ee80182 100644 --- a/twilio/rest/api/v2010/account/__init__.py +++ b/twilio/rest/api/v2010/account/__init__.py @@ -821,6 +821,7 @@ def create( :returns: The created AccountInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -845,6 +846,7 @@ async def create_async( :returns: The created AccountInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/api/v2010/account/address/__init__.py b/twilio/rest/api/v2010/account/address/__init__.py index 224601e270..2c52ef902d 100644 --- a/twilio/rest/api/v2010/account/address/__init__.py +++ b/twilio/rest/api/v2010/account/address/__init__.py @@ -513,6 +513,7 @@ def create( :returns: The created AddressInstance """ + data = values.of( { "CustomerName": customer_name, @@ -567,6 +568,7 @@ async def create_async( :returns: The created AddressInstance """ + data = values.of( { "CustomerName": customer_name, diff --git a/twilio/rest/api/v2010/account/application.py b/twilio/rest/api/v2010/account/application.py index 5179d5d55b..d11dc6f7cc 100644 --- a/twilio/rest/api/v2010/account/application.py +++ b/twilio/rest/api/v2010/account/application.py @@ -602,6 +602,7 @@ def create( :returns: The created ApplicationInstance """ + data = values.of( { "ApiVersion": api_version, @@ -674,6 +675,7 @@ async def create_async( :returns: The created ApplicationInstance """ + data = values.of( { "ApiVersion": api_version, diff --git a/twilio/rest/api/v2010/account/authorized_connect_app.py b/twilio/rest/api/v2010/account/authorized_connect_app.py index a62da5a760..4d71766b62 100644 --- a/twilio/rest/api/v2010/account/authorized_connect_app.py +++ b/twilio/rest/api/v2010/account/authorized_connect_app.py @@ -13,8 +13,9 @@ """ +from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -34,6 +35,8 @@ class Permission(object): :ivar connect_app_friendly_name: The name of the Connect App. :ivar connect_app_homepage_url: The public URL for the Connect App. :ivar connect_app_sid: The SID that we assigned to the Connect App. + :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar permissions: The set of permissions that you authorized for the Connect App. Can be: `get-all` or `post-all`. :ivar uri: The URI of the resource, relative to `https://api.twilio.com`. """ @@ -61,6 +64,12 @@ def __init__( "connect_app_homepage_url" ) self.connect_app_sid: Optional[str] = payload.get("connect_app_sid") + self.date_created: Optional[datetime] = deserialize.rfc2822_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.rfc2822_datetime( + payload.get("date_updated") + ) self.permissions: Optional[ List["AuthorizedConnectAppInstance.Permission"] ] = payload.get("permissions") diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index 7c969eff7d..ad669dd724 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -785,6 +785,7 @@ def create( :returns: The created CallInstance """ + data = values.of( { "To": to, @@ -918,6 +919,7 @@ async def create_async( :returns: The created CallInstance """ + data = values.of( { "To": to, @@ -979,11 +981,7 @@ def stream( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[CallInstance]: @@ -998,11 +996,7 @@ def stream( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1019,11 +1013,7 @@ def stream( parent_call_sid=parent_call_sid, status=status, start_time=start_time, - start_time_before=start_time_before, - start_time_after=start_time_after, end_time=end_time, - end_time_before=end_time_before, - end_time_after=end_time_after, page_size=limits["page_size"], ) @@ -1036,11 +1026,7 @@ async def stream_async( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[CallInstance]: @@ -1055,11 +1041,7 @@ async def stream_async( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1076,11 +1058,7 @@ async def stream_async( parent_call_sid=parent_call_sid, status=status, start_time=start_time, - start_time_before=start_time_before, - start_time_after=start_time_after, end_time=end_time, - end_time_before=end_time_before, - end_time_after=end_time_after, page_size=limits["page_size"], ) @@ -1093,11 +1071,7 @@ def list( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[CallInstance]: @@ -1111,11 +1085,7 @@ def list( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1132,11 +1102,7 @@ def list( parent_call_sid=parent_call_sid, status=status, start_time=start_time, - start_time_before=start_time_before, - start_time_after=start_time_after, end_time=end_time, - end_time_before=end_time_before, - end_time_after=end_time_after, limit=limit, page_size=page_size, ) @@ -1149,11 +1115,7 @@ async def list_async( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[CallInstance]: @@ -1167,11 +1129,7 @@ async def list_async( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1189,11 +1147,7 @@ async def list_async( parent_call_sid=parent_call_sid, status=status, start_time=start_time, - start_time_before=start_time_before, - start_time_after=start_time_after, end_time=end_time, - end_time_before=end_time_before, - end_time_after=end_time_after, limit=limit, page_size=page_size, ) @@ -1206,11 +1160,7 @@ def page( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -1224,11 +1174,7 @@ def page( :param parent_call_sid: Only include calls spawned by calls with this SID. :param status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -1242,11 +1188,7 @@ def page( "ParentCallSid": parent_call_sid, "Status": status, "StartTime": serialize.iso8601_datetime(start_time), - "StartTime<": serialize.iso8601_datetime(start_time_before), - "StartTime>": serialize.iso8601_datetime(start_time_after), "EndTime": serialize.iso8601_datetime(end_time), - "EndTime<": serialize.iso8601_datetime(end_time_before), - "EndTime>": serialize.iso8601_datetime(end_time_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -1263,11 +1205,7 @@ async def page_async( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -1281,11 +1219,7 @@ async def page_async( :param parent_call_sid: Only include calls spawned by calls with this SID. :param status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -1299,11 +1233,7 @@ async def page_async( "ParentCallSid": parent_call_sid, "Status": status, "StartTime": serialize.iso8601_datetime(start_time), - "StartTime<": serialize.iso8601_datetime(start_time_before), - "StartTime>": serialize.iso8601_datetime(start_time_after), "EndTime": serialize.iso8601_datetime(end_time), - "EndTime<": serialize.iso8601_datetime(end_time_before), - "EndTime>": serialize.iso8601_datetime(end_time_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/call/feedback_summary.py b/twilio/rest/api/v2010/account/call/feedback_summary.py index fcfb4e0ab1..a856fda5ac 100644 --- a/twilio/rest/api/v2010/account/call/feedback_summary.py +++ b/twilio/rest/api/v2010/account/call/feedback_summary.py @@ -70,7 +70,7 @@ def __init__( payload.get("end_date") ) self.include_subaccounts: Optional[bool] = payload.get("include_subaccounts") - self.issues: Optional[List[object]] = payload.get("issues") + self.issues: Optional[List[Dict[str, object]]] = payload.get("issues") self.quality_score_average: Optional[float] = deserialize.decimal( payload.get("quality_score_average") ) @@ -286,6 +286,7 @@ def create( :returns: The created FeedbackSummaryInstance """ + data = values.of( { "StartDate": serialize.iso8601_date(start_date), @@ -325,6 +326,7 @@ async def create_async( :returns: The created FeedbackSummaryInstance """ + data = values.of( { "StartDate": serialize.iso8601_date(start_date), diff --git a/twilio/rest/api/v2010/account/call/payment.py b/twilio/rest/api/v2010/account/call/payment.py index 10d00441ba..2233971912 100644 --- a/twilio/rest/api/v2010/account/call/payment.py +++ b/twilio/rest/api/v2010/account/call/payment.py @@ -338,6 +338,7 @@ def create( :returns: The created PaymentInstance """ + data = values.of( { "IdempotencyKey": idempotency_key, @@ -415,6 +416,7 @@ async def create_async( :returns: The created PaymentInstance """ + data = values.of( { "IdempotencyKey": idempotency_key, diff --git a/twilio/rest/api/v2010/account/call/recording.py b/twilio/rest/api/v2010/account/call/recording.py index 7ca36f3e00..99ed688ea2 100644 --- a/twilio/rest/api/v2010/account/call/recording.py +++ b/twilio/rest/api/v2010/account/call/recording.py @@ -438,6 +438,7 @@ def create( :returns: The created RecordingInstance """ + data = values.of( { "RecordingStatusCallbackEvent": serialize.map( @@ -485,6 +486,7 @@ async def create_async( :returns: The created RecordingInstance """ + data = values.of( { "RecordingStatusCallbackEvent": serialize.map( diff --git a/twilio/rest/api/v2010/account/call/siprec.py b/twilio/rest/api/v2010/account/call/siprec.py index 86bfd5c6bc..23b8cfbe35 100644 --- a/twilio/rest/api/v2010/account/call/siprec.py +++ b/twilio/rest/api/v2010/account/call/siprec.py @@ -651,6 +651,7 @@ def create( :returns: The created SiprecInstance """ + data = values.of( { "Name": name, @@ -1287,6 +1288,7 @@ async def create_async( :returns: The created SiprecInstance """ + data = values.of( { "Name": name, diff --git a/twilio/rest/api/v2010/account/call/stream.py b/twilio/rest/api/v2010/account/call/stream.py index 1999e9379b..949d6dc197 100644 --- a/twilio/rest/api/v2010/account/call/stream.py +++ b/twilio/rest/api/v2010/account/call/stream.py @@ -653,6 +653,7 @@ def create( :returns: The created StreamInstance """ + data = values.of( { "Url": url, @@ -1289,6 +1290,7 @@ async def create_async( :returns: The created StreamInstance """ + data = values.of( { "Url": url, 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 0beef389d7..2aef221eb5 100644 --- a/twilio/rest/api/v2010/account/call/user_defined_message.py +++ b/twilio/rest/api/v2010/account/call/user_defined_message.py @@ -92,6 +92,7 @@ def create( :returns: The created UserDefinedMessageInstance """ + data = values.of( { "Content": content, @@ -123,6 +124,7 @@ async def create_async( :returns: The created UserDefinedMessageInstance """ + data = values.of( { "Content": content, 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 c34905dcdb..8d90b7bf5e 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 @@ -198,6 +198,7 @@ def create( :returns: The created UserDefinedMessageSubscriptionInstance """ + data = values.of( { "Callback": callback, @@ -234,6 +235,7 @@ async def create_async( :returns: The created UserDefinedMessageSubscriptionInstance """ + data = values.of( { "Callback": callback, diff --git a/twilio/rest/api/v2010/account/conference/__init__.py b/twilio/rest/api/v2010/account/conference/__init__.py index 062c7013ed..776ee6c4ad 100644 --- a/twilio/rest/api/v2010/account/conference/__init__.py +++ b/twilio/rest/api/v2010/account/conference/__init__.py @@ -409,11 +409,7 @@ def __init__(self, version: Version, account_sid: str): def stream( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -426,11 +422,7 @@ def stream( The results are returned as a generator, so this operation is memory efficient. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. stream() @@ -445,11 +437,7 @@ def stream( limits = self._version.read_limits(limit, page_size) page = self.page( date_created=date_created, - date_created_before=date_created_before, - date_created_after=date_created_after, date_updated=date_updated, - date_updated_before=date_updated_before, - date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, page_size=limits["page_size"], @@ -460,11 +448,7 @@ def stream( async def stream_async( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -477,11 +461,7 @@ async def stream_async( The results are returned as a generator, so this operation is memory efficient. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. stream() @@ -496,11 +476,7 @@ async def stream_async( limits = self._version.read_limits(limit, page_size) page = await self.page_async( date_created=date_created, - date_created_before=date_created_before, - date_created_after=date_created_after, date_updated=date_updated, - date_updated_before=date_updated_before, - date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, page_size=limits["page_size"], @@ -511,11 +487,7 @@ async def stream_async( def list( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -527,11 +499,7 @@ def list( memory before returning. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. list() guarantees @@ -546,11 +514,7 @@ def list( return list( self.stream( date_created=date_created, - date_created_before=date_created_before, - date_created_after=date_created_after, date_updated=date_updated, - date_updated_before=date_updated_before, - date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, limit=limit, @@ -561,11 +525,7 @@ def list( async def list_async( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -577,11 +537,7 @@ async def list_async( memory before returning. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. list() guarantees @@ -597,11 +553,7 @@ async def list_async( record async for record in await self.stream_async( date_created=date_created, - date_created_before=date_created_before, - date_created_after=date_created_after, date_updated=date_updated, - date_updated_before=date_updated_before, - date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, limit=limit, @@ -612,11 +564,7 @@ async def list_async( def page( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, page_token: Union[str, object] = values.unset, @@ -628,11 +576,7 @@ def page( Request is executed immediately :param date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param friendly_name: The string that identifies the Conference resources to read. :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param page_token: PageToken provided by the API @@ -644,11 +588,7 @@ def page( data = values.of( { "DateCreated": serialize.iso8601_date(date_created), - "DateCreated<": serialize.iso8601_date(date_created_before), - "DateCreated>": serialize.iso8601_date(date_created_after), "DateUpdated": serialize.iso8601_date(date_updated), - "DateUpdated<": serialize.iso8601_date(date_updated_before), - "DateUpdated>": serialize.iso8601_date(date_updated_after), "FriendlyName": friendly_name, "Status": status, "PageToken": page_token, @@ -663,11 +603,7 @@ def page( async def page_async( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, page_token: Union[str, object] = values.unset, @@ -679,11 +615,7 @@ async def page_async( Request is executed immediately :param date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param friendly_name: The string that identifies the Conference resources to read. :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param page_token: PageToken provided by the API @@ -695,11 +627,7 @@ async def page_async( data = values.of( { "DateCreated": serialize.iso8601_date(date_created), - "DateCreated<": serialize.iso8601_date(date_created_before), - "DateCreated>": serialize.iso8601_date(date_created_after), "DateUpdated": serialize.iso8601_date(date_updated), - "DateUpdated<": serialize.iso8601_date(date_updated_before), - "DateUpdated>": serialize.iso8601_date(date_updated_after), "FriendlyName": friendly_name, "Status": status, "PageToken": page_token, diff --git a/twilio/rest/api/v2010/account/conference/participant.py b/twilio/rest/api/v2010/account/conference/participant.py index f1fa87fd88..c14ae1d5fa 100644 --- a/twilio/rest/api/v2010/account/conference/participant.py +++ b/twilio/rest/api/v2010/account/conference/participant.py @@ -627,6 +627,7 @@ def create( :returns: The created ParticipantInstance """ + data = values.of( { "From": from_, @@ -808,6 +809,7 @@ async def create_async( :returns: The created ParticipantInstance """ + data = values.of( { "From": from_, 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 121d2f03c8..f26c7589b2 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py @@ -807,6 +807,7 @@ def create( :returns: The created IncomingPhoneNumberInstance """ + data = values.of( { "ApiVersion": api_version, @@ -907,6 +908,7 @@ async def create_async( :returns: The created IncomingPhoneNumberInstance """ + data = values.of( { "ApiVersion": api_version, 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 4b04d75256..645d0e846c 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 @@ -313,6 +313,7 @@ def create(self, installed_add_on_sid: str) -> AssignedAddOnInstance: :returns: The created AssignedAddOnInstance """ + data = values.of( { "InstalledAddOnSid": installed_add_on_sid, @@ -340,6 +341,7 @@ async def create_async(self, installed_add_on_sid: str) -> AssignedAddOnInstance :returns: The created AssignedAddOnInstance """ + data = values.of( { "InstalledAddOnSid": installed_add_on_sid, 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 4af79dcf8a..eb69e05c08 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/local.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/local.py @@ -247,6 +247,7 @@ def create( :returns: The created LocalInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -342,6 +343,7 @@ async def create_async( :returns: The created LocalInstance """ + data = values.of( { "PhoneNumber": phone_number, 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 2ab5a652c5..7acd28c0f0 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py @@ -249,6 +249,7 @@ def create( :returns: The created MobileInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -346,6 +347,7 @@ async def create_async( :returns: The created MobileInstance """ + data = values.of( { "PhoneNumber": phone_number, 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 3b995504a5..7d8592e90a 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 @@ -249,6 +249,7 @@ def create( :returns: The created TollFreeInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -346,6 +347,7 @@ async def create_async( :returns: The created TollFreeInstance """ + data = values.of( { "PhoneNumber": phone_number, diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index c521973e9c..ac76c085ae 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -529,6 +529,7 @@ def create( :returns: The created MessageInstance """ + data = values.of( { "To": to, @@ -626,6 +627,7 @@ async def create_async( :returns: The created MessageInstance """ + data = values.of( { "To": to, @@ -669,8 +671,6 @@ def stream( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[MessageInstance]: @@ -683,8 +683,6 @@ def stream( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -696,12 +694,7 @@ def stream( """ limits = self._version.read_limits(limit, page_size) page = self.page( - to=to, - from_=from_, - date_sent=date_sent, - date_sent_before=date_sent_before, - date_sent_after=date_sent_after, - page_size=limits["page_size"], + to=to, from_=from_, date_sent=date_sent, page_size=limits["page_size"] ) return self._version.stream(page, limits["limit"]) @@ -711,8 +704,6 @@ async def stream_async( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[MessageInstance]: @@ -725,8 +716,6 @@ async def stream_async( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -738,12 +727,7 @@ async def stream_async( """ limits = self._version.read_limits(limit, page_size) page = await self.page_async( - to=to, - from_=from_, - date_sent=date_sent, - date_sent_before=date_sent_before, - date_sent_after=date_sent_after, - page_size=limits["page_size"], + to=to, from_=from_, date_sent=date_sent, page_size=limits["page_size"] ) return self._version.stream_async(page, limits["limit"]) @@ -753,8 +737,6 @@ def list( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[MessageInstance]: @@ -766,8 +748,6 @@ def list( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -782,8 +762,6 @@ def list( to=to, from_=from_, date_sent=date_sent, - date_sent_before=date_sent_before, - date_sent_after=date_sent_after, limit=limit, page_size=page_size, ) @@ -794,8 +772,6 @@ async def list_async( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[MessageInstance]: @@ -807,8 +783,6 @@ async def list_async( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -824,8 +798,6 @@ async def list_async( to=to, from_=from_, date_sent=date_sent, - date_sent_before=date_sent_before, - date_sent_after=date_sent_after, limit=limit, page_size=page_size, ) @@ -836,8 +808,6 @@ def page( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -849,8 +819,6 @@ def page( :param to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -862,8 +830,6 @@ def page( "To": to, "From": from_, "DateSent": serialize.iso8601_datetime(date_sent), - "DateSent<": serialize.iso8601_datetime(date_sent_before), - "DateSent>": serialize.iso8601_datetime(date_sent_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -878,8 +844,6 @@ async def page_async( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -891,8 +855,6 @@ async def page_async( :param to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -904,8 +866,6 @@ async def page_async( "To": to, "From": from_, "DateSent": serialize.iso8601_datetime(date_sent), - "DateSent<": serialize.iso8601_datetime(date_sent_before), - "DateSent>": serialize.iso8601_datetime(date_sent_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/message/feedback.py b/twilio/rest/api/v2010/account/message/feedback.py index 7c371ee883..61a23207c3 100644 --- a/twilio/rest/api/v2010/account/message/feedback.py +++ b/twilio/rest/api/v2010/account/message/feedback.py @@ -104,6 +104,7 @@ def create( :returns: The created FeedbackInstance """ + data = values.of( { "Outcome": outcome, @@ -133,6 +134,7 @@ async def create_async( :returns: The created FeedbackInstance """ + data = values.of( { "Outcome": outcome, diff --git a/twilio/rest/api/v2010/account/new_key.py b/twilio/rest/api/v2010/account/new_key.py index e7af236ebe..2f1015cf00 100644 --- a/twilio/rest/api/v2010/account/new_key.py +++ b/twilio/rest/api/v2010/account/new_key.py @@ -86,6 +86,7 @@ def create( :returns: The created NewKeyInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -112,6 +113,7 @@ async def create_async( :returns: The created NewKeyInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/api/v2010/account/new_signing_key.py b/twilio/rest/api/v2010/account/new_signing_key.py index d24e833b86..45f32b50d0 100644 --- a/twilio/rest/api/v2010/account/new_signing_key.py +++ b/twilio/rest/api/v2010/account/new_signing_key.py @@ -86,6 +86,7 @@ def create( :returns: The created NewSigningKeyInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -112,6 +113,7 @@ async def create_async( :returns: The created NewSigningKeyInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/api/v2010/account/queue/__init__.py b/twilio/rest/api/v2010/account/queue/__init__.py index 73589708fb..0d4530a4b2 100644 --- a/twilio/rest/api/v2010/account/queue/__init__.py +++ b/twilio/rest/api/v2010/account/queue/__init__.py @@ -397,6 +397,7 @@ def create( :returns: The created QueueInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -425,6 +426,7 @@ async def create_async( :returns: The created QueueInstance """ + data = values.of( { "FriendlyName": friendly_name, 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 08ac5bcfe6..e026e652df 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/__init__.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/__init__.py @@ -368,6 +368,7 @@ def create(self, friendly_name: str) -> CredentialListInstance: :returns: The created CredentialListInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -392,6 +393,7 @@ async def create_async(self, friendly_name: str) -> CredentialListInstance: :returns: The created CredentialListInstance """ + data = values.of( { "FriendlyName": friendly_name, 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 585950c25c..e40caaa329 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/credential.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/credential.py @@ -366,6 +366,7 @@ def create(self, username: str, password: str) -> CredentialInstance: :returns: The created CredentialInstance """ + data = values.of( { "Username": username, @@ -395,6 +396,7 @@ async def create_async(self, username: str, password: str) -> CredentialInstance :returns: The created CredentialInstance """ + data = values.of( { "Username": username, diff --git a/twilio/rest/api/v2010/account/sip/domain/__init__.py b/twilio/rest/api/v2010/account/sip/domain/__init__.py index 29a2aaeb2a..71174f32be 100644 --- a/twilio/rest/api/v2010/account/sip/domain/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/__init__.py @@ -633,6 +633,7 @@ def create( :returns: The created DomainInstance """ + data = values.of( { "DomainName": domain_name, @@ -696,6 +697,7 @@ async def create_async( :returns: The created DomainInstance """ + data = values.of( { "DomainName": domain_name, 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 c9cade64f9..3ddec185c3 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 @@ -281,6 +281,7 @@ def create( :returns: The created AuthCallsCredentialListMappingInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, @@ -310,6 +311,7 @@ async def create_async( :returns: The created AuthCallsCredentialListMappingInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, 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 f83393c377..c410104410 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 @@ -285,6 +285,7 @@ def create( :returns: The created AuthCallsIpAccessControlListMappingInstance """ + data = values.of( { "IpAccessControlListSid": ip_access_control_list_sid, @@ -314,6 +315,7 @@ async def create_async( :returns: The created AuthCallsIpAccessControlListMappingInstance """ + data = values.of( { "IpAccessControlListSid": ip_access_control_list_sid, 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 a63a6e3290..37f05c7587 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 @@ -281,6 +281,7 @@ def create( :returns: The created AuthRegistrationsCredentialListMappingInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, @@ -310,6 +311,7 @@ async def create_async( :returns: The created AuthRegistrationsCredentialListMappingInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, 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 248e0ca37b..81fb012810 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 @@ -277,6 +277,7 @@ def create(self, credential_list_sid: str) -> CredentialListMappingInstance: :returns: The created CredentialListMappingInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, @@ -306,6 +307,7 @@ async def create_async( :returns: The created CredentialListMappingInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, 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 cfe65e99dc..bbea7ade36 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 @@ -283,6 +283,7 @@ def create( :returns: The created IpAccessControlListMappingInstance """ + data = values.of( { "IpAccessControlListSid": ip_access_control_list_sid, @@ -312,6 +313,7 @@ async def create_async( :returns: The created IpAccessControlListMappingInstance """ + data = values.of( { "IpAccessControlListSid": ip_access_control_list_sid, 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 fac56d8573..33b219f39b 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 @@ -372,6 +372,7 @@ def create(self, friendly_name: str) -> IpAccessControlListInstance: :returns: The created IpAccessControlListInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -396,6 +397,7 @@ async def create_async(self, friendly_name: str) -> IpAccessControlListInstance: :returns: The created IpAccessControlListInstance """ + data = values.of( { "FriendlyName": friendly_name, 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 2ce7f69f18..362b645fa3 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 @@ -416,6 +416,7 @@ def create( :returns: The created IpAddressInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -452,6 +453,7 @@ async def create_async( :returns: The created IpAddressInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/api/v2010/account/token.py b/twilio/rest/api/v2010/account/token.py index 744bedd295..3d00c3cf0c 100644 --- a/twilio/rest/api/v2010/account/token.py +++ b/twilio/rest/api/v2010/account/token.py @@ -88,6 +88,7 @@ def create(self, ttl: Union[int, object] = values.unset) -> TokenInstance: :returns: The created TokenInstance """ + data = values.of( { "Ttl": ttl, @@ -114,6 +115,7 @@ async def create_async( :returns: The created TokenInstance """ + data = values.of( { "Ttl": ttl, diff --git a/twilio/rest/api/v2010/account/usage/trigger.py b/twilio/rest/api/v2010/account/usage/trigger.py index bd165916e2..67fd82f780 100644 --- a/twilio/rest/api/v2010/account/usage/trigger.py +++ b/twilio/rest/api/v2010/account/usage/trigger.py @@ -751,6 +751,7 @@ def create( :returns: The created TriggerInstance """ + data = values.of( { "CallbackUrl": callback_url, @@ -796,6 +797,7 @@ async def create_async( :returns: The created TriggerInstance """ + data = values.of( { "CallbackUrl": callback_url, diff --git a/twilio/rest/api/v2010/account/validation_request.py b/twilio/rest/api/v2010/account/validation_request.py index 84ef8ee253..d126cea26c 100644 --- a/twilio/rest/api/v2010/account/validation_request.py +++ b/twilio/rest/api/v2010/account/validation_request.py @@ -94,6 +94,7 @@ def create( :returns: The created ValidationRequestInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -136,6 +137,7 @@ async def create_async( :returns: The created ValidationRequestInstance """ + data = values.of( { "PhoneNumber": phone_number, diff --git a/twilio/rest/autopilot/v1/assistant/__init__.py b/twilio/rest/autopilot/v1/assistant/__init__.py index a25268fc45..0420e5a1de 100644 --- a/twilio/rest/autopilot/v1/assistant/__init__.py +++ b/twilio/rest/autopilot/v1/assistant/__init__.py @@ -608,6 +608,7 @@ def create( :returns: The created AssistantInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -651,6 +652,7 @@ async def create_async( :returns: The created AssistantInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/autopilot/v1/assistant/field_type/__init__.py b/twilio/rest/autopilot/v1/assistant/field_type/__init__.py index 4639a6e962..3dcee087b4 100644 --- a/twilio/rest/autopilot/v1/assistant/field_type/__init__.py +++ b/twilio/rest/autopilot/v1/assistant/field_type/__init__.py @@ -395,6 +395,7 @@ def create( :returns: The created FieldTypeInstance """ + data = values.of( { "UniqueName": unique_name, @@ -423,6 +424,7 @@ async def create_async( :returns: The created FieldTypeInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/autopilot/v1/assistant/field_type/field_value.py b/twilio/rest/autopilot/v1/assistant/field_type/field_value.py index 38cb71161f..ba38a9f3ce 100644 --- a/twilio/rest/autopilot/v1/assistant/field_type/field_value.py +++ b/twilio/rest/autopilot/v1/assistant/field_type/field_value.py @@ -289,6 +289,7 @@ def create( :returns: The created FieldValueInstance """ + data = values.of( { "Language": language, @@ -322,6 +323,7 @@ async def create_async( :returns: The created FieldValueInstance """ + data = values.of( { "Language": language, diff --git a/twilio/rest/autopilot/v1/assistant/model_build.py b/twilio/rest/autopilot/v1/assistant/model_build.py index ccfb8a1c36..49db853f62 100644 --- a/twilio/rest/autopilot/v1/assistant/model_build.py +++ b/twilio/rest/autopilot/v1/assistant/model_build.py @@ -368,6 +368,7 @@ def create( :returns: The created ModelBuildInstance """ + data = values.of( { "StatusCallback": status_callback, @@ -398,6 +399,7 @@ async def create_async( :returns: The created ModelBuildInstance """ + data = values.of( { "StatusCallback": status_callback, diff --git a/twilio/rest/autopilot/v1/assistant/query.py b/twilio/rest/autopilot/v1/assistant/query.py index 500f6bb7f7..0edad0924b 100644 --- a/twilio/rest/autopilot/v1/assistant/query.py +++ b/twilio/rest/autopilot/v1/assistant/query.py @@ -386,6 +386,7 @@ def create( :returns: The created QueryInstance """ + data = values.of( { "Language": language, @@ -422,6 +423,7 @@ async def create_async( :returns: The created QueryInstance """ + data = values.of( { "Language": language, diff --git a/twilio/rest/autopilot/v1/assistant/task/__init__.py b/twilio/rest/autopilot/v1/assistant/task/__init__.py index c90b412acf..67c4f17920 100644 --- a/twilio/rest/autopilot/v1/assistant/task/__init__.py +++ b/twilio/rest/autopilot/v1/assistant/task/__init__.py @@ -491,6 +491,7 @@ def create( :returns: The created TaskInstance """ + data = values.of( { "UniqueName": unique_name, @@ -527,6 +528,7 @@ async def create_async( :returns: The created TaskInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/autopilot/v1/assistant/task/field.py b/twilio/rest/autopilot/v1/assistant/task/field.py index dc48c44659..b146201d5a 100644 --- a/twilio/rest/autopilot/v1/assistant/task/field.py +++ b/twilio/rest/autopilot/v1/assistant/task/field.py @@ -282,6 +282,7 @@ def create(self, field_type: str, unique_name: str) -> FieldInstance: :returns: The created FieldInstance """ + data = values.of( { "FieldType": field_type, @@ -311,6 +312,7 @@ async def create_async(self, field_type: str, unique_name: str) -> FieldInstance :returns: The created FieldInstance """ + data = values.of( { "FieldType": field_type, diff --git a/twilio/rest/autopilot/v1/assistant/task/sample.py b/twilio/rest/autopilot/v1/assistant/task/sample.py index ce413aeaa1..924ccb45d6 100644 --- a/twilio/rest/autopilot/v1/assistant/task/sample.py +++ b/twilio/rest/autopilot/v1/assistant/task/sample.py @@ -406,6 +406,7 @@ def create( :returns: The created SampleInstance """ + data = values.of( { "Language": language, @@ -442,6 +443,7 @@ async def create_async( :returns: The created SampleInstance """ + data = values.of( { "Language": language, diff --git a/twilio/rest/autopilot/v1/assistant/webhook.py b/twilio/rest/autopilot/v1/assistant/webhook.py index 8a3e3da2f6..02632d8aa9 100644 --- a/twilio/rest/autopilot/v1/assistant/webhook.py +++ b/twilio/rest/autopilot/v1/assistant/webhook.py @@ -404,6 +404,7 @@ def create( :returns: The created WebhookInstance """ + data = values.of( { "UniqueName": unique_name, @@ -440,6 +441,7 @@ async def create_async( :returns: The created WebhookInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/bulkexports/v1/export/export_custom_job.py b/twilio/rest/bulkexports/v1/export/export_custom_job.py index 2c571489d6..abb3015e42 100644 --- a/twilio/rest/bulkexports/v1/export/export_custom_job.py +++ b/twilio/rest/bulkexports/v1/export/export_custom_job.py @@ -127,6 +127,7 @@ def create( :returns: The created ExportCustomJobInstance """ + data = values.of( { "StartDay": start_day, @@ -169,6 +170,7 @@ async def create_async( :returns: The created ExportCustomJobInstance """ + data = values.of( { "StartDay": start_day, diff --git a/twilio/rest/chat/v1/credential.py b/twilio/rest/chat/v1/credential.py index ecdf1d58e2..bf6350120a 100644 --- a/twilio/rest/chat/v1/credential.py +++ b/twilio/rest/chat/v1/credential.py @@ -405,6 +405,7 @@ def create( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, @@ -448,6 +449,7 @@ async def create_async( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/chat/v1/service/__init__.py b/twilio/rest/chat/v1/service/__init__.py index f8a377057c..be4e946817 100644 --- a/twilio/rest/chat/v1/service/__init__.py +++ b/twilio/rest/chat/v1/service/__init__.py @@ -1062,6 +1062,7 @@ def create(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -1084,6 +1085,7 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/chat/v1/service/channel/__init__.py b/twilio/rest/chat/v1/service/channel/__init__.py index e04d95a433..46223702b5 100644 --- a/twilio/rest/chat/v1/service/channel/__init__.py +++ b/twilio/rest/chat/v1/service/channel/__init__.py @@ -472,6 +472,7 @@ def create( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -508,6 +509,7 @@ async def create_async( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/chat/v1/service/channel/invite.py b/twilio/rest/chat/v1/service/channel/invite.py index e3dbbae07f..3894abe546 100644 --- a/twilio/rest/chat/v1/service/channel/invite.py +++ b/twilio/rest/chat/v1/service/channel/invite.py @@ -288,6 +288,7 @@ def create( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, @@ -319,6 +320,7 @@ async def create_async( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/chat/v1/service/channel/member.py b/twilio/rest/chat/v1/service/channel/member.py index 62e3912bf9..dc56780e72 100644 --- a/twilio/rest/chat/v1/service/channel/member.py +++ b/twilio/rest/chat/v1/service/channel/member.py @@ -398,6 +398,7 @@ def create( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, @@ -429,6 +430,7 @@ async def create_async( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/chat/v1/service/channel/message.py b/twilio/rest/chat/v1/service/channel/message.py index ad45b6eb59..6fea6a1800 100644 --- a/twilio/rest/chat/v1/service/channel/message.py +++ b/twilio/rest/chat/v1/service/channel/message.py @@ -405,6 +405,7 @@ def create( :returns: The created MessageInstance """ + data = values.of( { "Body": body, @@ -441,6 +442,7 @@ async def create_async( :returns: The created MessageInstance """ + data = values.of( { "Body": body, diff --git a/twilio/rest/chat/v1/service/role.py b/twilio/rest/chat/v1/service/role.py index e1a5e5cd53..913969fa9c 100644 --- a/twilio/rest/chat/v1/service/role.py +++ b/twilio/rest/chat/v1/service/role.py @@ -350,6 +350,7 @@ def create( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -380,6 +381,7 @@ async def create_async( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/chat/v1/service/user/__init__.py b/twilio/rest/chat/v1/service/user/__init__.py index fd6e9d6c44..316e773b0b 100644 --- a/twilio/rest/chat/v1/service/user/__init__.py +++ b/twilio/rest/chat/v1/service/user/__init__.py @@ -423,6 +423,7 @@ def create( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -459,6 +460,7 @@ async def create_async( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/chat/v2/credential.py b/twilio/rest/chat/v2/credential.py index 4a3df30e93..1e49f78db3 100644 --- a/twilio/rest/chat/v2/credential.py +++ b/twilio/rest/chat/v2/credential.py @@ -405,6 +405,7 @@ def create( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, @@ -448,6 +449,7 @@ async def create_async( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/chat/v2/service/__init__.py b/twilio/rest/chat/v2/service/__init__.py index 208805c7b7..59d8b8a5f5 100644 --- a/twilio/rest/chat/v2/service/__init__.py +++ b/twilio/rest/chat/v2/service/__init__.py @@ -823,6 +823,7 @@ def create(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -845,6 +846,7 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/chat/v2/service/channel/__init__.py b/twilio/rest/chat/v2/service/channel/__init__.py index 14387550c9..e785020790 100644 --- a/twilio/rest/chat/v2/service/channel/__init__.py +++ b/twilio/rest/chat/v2/service/channel/__init__.py @@ -604,6 +604,7 @@ def create( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -656,6 +657,7 @@ async def create_async( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/chat/v2/service/channel/invite.py b/twilio/rest/chat/v2/service/channel/invite.py index 3b89e94f85..bf4e7fbc5c 100644 --- a/twilio/rest/chat/v2/service/channel/invite.py +++ b/twilio/rest/chat/v2/service/channel/invite.py @@ -288,6 +288,7 @@ def create( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, @@ -319,6 +320,7 @@ async def create_async( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/chat/v2/service/channel/member.py b/twilio/rest/chat/v2/service/channel/member.py index 0a43c7bd4b..54e2aa407c 100644 --- a/twilio/rest/chat/v2/service/channel/member.py +++ b/twilio/rest/chat/v2/service/channel/member.py @@ -531,6 +531,7 @@ def create( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, @@ -588,6 +589,7 @@ async def create_async( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/chat/v2/service/channel/message.py b/twilio/rest/chat/v2/service/channel/message.py index bda88dfab8..3e1b289fd7 100644 --- a/twilio/rest/chat/v2/service/channel/message.py +++ b/twilio/rest/chat/v2/service/channel/message.py @@ -535,6 +535,7 @@ def create( :returns: The created MessageInstance """ + data = values.of( { "From": from_, @@ -590,6 +591,7 @@ async def create_async( :returns: The created MessageInstance """ + data = values.of( { "From": from_, diff --git a/twilio/rest/chat/v2/service/channel/webhook.py b/twilio/rest/chat/v2/service/channel/webhook.py index 6e05e41742..e20ca22432 100644 --- a/twilio/rest/chat/v2/service/channel/webhook.py +++ b/twilio/rest/chat/v2/service/channel/webhook.py @@ -466,6 +466,7 @@ def create( :returns: The created WebhookInstance """ + data = values.of( { "Type": type, @@ -518,6 +519,7 @@ async def create_async( :returns: The created WebhookInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/chat/v2/service/role.py b/twilio/rest/chat/v2/service/role.py index 7f77ee6e4b..4d636c71f2 100644 --- a/twilio/rest/chat/v2/service/role.py +++ b/twilio/rest/chat/v2/service/role.py @@ -350,6 +350,7 @@ def create( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -380,6 +381,7 @@ async def create_async( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/chat/v2/service/user/__init__.py b/twilio/rest/chat/v2/service/user/__init__.py index 9e593863fc..1c9e780d43 100644 --- a/twilio/rest/chat/v2/service/user/__init__.py +++ b/twilio/rest/chat/v2/service/user/__init__.py @@ -476,6 +476,7 @@ def create( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -519,6 +520,7 @@ async def create_async( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index 860d76fe33..b0eaaa0fad 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -34,7 +34,7 @@ class ContentInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar url: The URL of the resource, relative to `https://content.twilio.com`. :ivar links: A list of links related to the Content resource, such as approval_fetch and approval_create """ diff --git a/twilio/rest/content/v1/content_and_approvals.py b/twilio/rest/content/v1/content_and_approvals.py index f7bb8a53f9..914376ea0b 100644 --- a/twilio/rest/content/v1/content_and_approvals.py +++ b/twilio/rest/content/v1/content_and_approvals.py @@ -33,7 +33,7 @@ class ContentAndApprovalsInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar approval_requests: The submitted information and approval request status of the Content resource. """ diff --git a/twilio/rest/content/v1/legacy_content.py b/twilio/rest/content/v1/legacy_content.py index 73df905114..9a1370b98a 100644 --- a/twilio/rest/content/v1/legacy_content.py +++ b/twilio/rest/content/v1/legacy_content.py @@ -33,7 +33,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 ccaf87dee6..5cfc0b9c84 100644 --- a/twilio/rest/conversations/v1/address_configuration.py +++ b/twilio/rest/conversations/v1/address_configuration.py @@ -498,6 +498,7 @@ def create( :returns: The created AddressConfigurationInstance """ + data = values.of( { "Type": type, @@ -562,6 +563,7 @@ async def create_async( :returns: The created AddressConfigurationInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/conversations/v1/conversation/__init__.py b/twilio/rest/conversations/v1/conversation/__init__.py index 88e12f1ccd..e7ac784be1 100644 --- a/twilio/rest/conversations/v1/conversation/__init__.py +++ b/twilio/rest/conversations/v1/conversation/__init__.py @@ -617,6 +617,7 @@ def create( :returns: The created ConversationInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -679,6 +680,7 @@ async def create_async( :returns: The created ConversationInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/conversations/v1/conversation/message/__init__.py b/twilio/rest/conversations/v1/conversation/message/__init__.py index 28b875e229..6ee1b8e49e 100644 --- a/twilio/rest/conversations/v1/conversation/message/__init__.py +++ b/twilio/rest/conversations/v1/conversation/message/__init__.py @@ -50,7 +50,7 @@ class WebhookEnabledType(object): :ivar url: An absolute API resource API URL for this message. :ivar delivery: An object that contains the summary of delivery statuses for the message to non-chat participants. :ivar links: Contains an absolute API resource URL to access the delivery & read receipts of this message. - :ivar content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template. + :ivar content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template. """ def __init__( @@ -68,7 +68,7 @@ def __init__( self.index: Optional[int] = deserialize.integer(payload.get("index")) self.author: Optional[str] = payload.get("author") self.body: Optional[str] = payload.get("body") - self.media: Optional[List[object]] = payload.get("media") + self.media: Optional[List[Dict[str, object]]] = payload.get("media") self.attributes: Optional[str] = payload.get("attributes") self.participant_sid: Optional[str] = payload.get("participant_sid") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( @@ -540,12 +540,13 @@ def create( :param date_updated: The date that this resource was last updated. `null` if the message has not been edited. :param attributes: A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. :param media_sid: The Media SID to be attached to the new Message. - :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. :param content_variables: A structurally valid JSON string that contains values to resolve Rich Content template variables. :param subject: The subject of the message, can be up to 256 characters long. :returns: The created MessageInstance """ + data = values.of( { "Author": author, @@ -598,12 +599,13 @@ async def create_async( :param date_updated: The date that this resource was last updated. `null` if the message has not been edited. :param attributes: A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. :param media_sid: The Media SID to be attached to the new Message. - :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. :param content_variables: A structurally valid JSON string that contains values to resolve Rich Content template variables. :param subject: The subject of the message, can be up to 256 characters long. :returns: The created MessageInstance """ + data = values.of( { "Author": author, diff --git a/twilio/rest/conversations/v1/conversation/participant.py b/twilio/rest/conversations/v1/conversation/participant.py index 3f17d0a4e2..a05f4085d7 100644 --- a/twilio/rest/conversations/v1/conversation/participant.py +++ b/twilio/rest/conversations/v1/conversation/participant.py @@ -549,6 +549,7 @@ def create( :returns: The created ParticipantInstance """ + data = values.of( { "Identity": identity, @@ -604,6 +605,7 @@ async def create_async( :returns: The created ParticipantInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/conversations/v1/conversation/webhook.py b/twilio/rest/conversations/v1/conversation/webhook.py index 8b7493388a..ddd49ede23 100644 --- a/twilio/rest/conversations/v1/conversation/webhook.py +++ b/twilio/rest/conversations/v1/conversation/webhook.py @@ -436,6 +436,7 @@ def create( :returns: The created WebhookInstance """ + data = values.of( { "Target": target, @@ -485,6 +486,7 @@ async def create_async( :returns: The created WebhookInstance """ + data = values.of( { "Target": target, diff --git a/twilio/rest/conversations/v1/credential.py b/twilio/rest/conversations/v1/credential.py index 0b6dfd8289..c8b680a9c4 100644 --- a/twilio/rest/conversations/v1/credential.py +++ b/twilio/rest/conversations/v1/credential.py @@ -417,6 +417,7 @@ def create( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, @@ -460,6 +461,7 @@ async def create_async( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/conversations/v1/role.py b/twilio/rest/conversations/v1/role.py index fb7626ce0c..61e10ffec0 100644 --- a/twilio/rest/conversations/v1/role.py +++ b/twilio/rest/conversations/v1/role.py @@ -323,6 +323,7 @@ def create( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -351,6 +352,7 @@ async def create_async( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/conversations/v1/service/__init__.py b/twilio/rest/conversations/v1/service/__init__.py index ad4066710f..924df1fd27 100644 --- a/twilio/rest/conversations/v1/service/__init__.py +++ b/twilio/rest/conversations/v1/service/__init__.py @@ -373,6 +373,7 @@ def create(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -395,6 +396,7 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/conversations/v1/service/conversation/__init__.py b/twilio/rest/conversations/v1/service/conversation/__init__.py index b3719682ab..0fef1cffaf 100644 --- a/twilio/rest/conversations/v1/service/conversation/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/__init__.py @@ -653,6 +653,7 @@ def create( :returns: The created ConversationInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -717,6 +718,7 @@ async def create_async( :returns: The created ConversationInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/conversations/v1/service/conversation/message/__init__.py b/twilio/rest/conversations/v1/service/conversation/message/__init__.py index a3cf06e06c..06b72492c8 100644 --- a/twilio/rest/conversations/v1/service/conversation/message/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/message/__init__.py @@ -51,7 +51,7 @@ class WebhookEnabledType(object): :ivar delivery: An object that contains the summary of delivery statuses for the message to non-chat participants. :ivar url: An absolute API resource URL for this message. :ivar links: Contains an absolute API resource URL to access the delivery & read receipts of this message. - :ivar content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template. + :ivar content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template. """ def __init__( @@ -71,7 +71,7 @@ def __init__( self.index: Optional[int] = deserialize.integer(payload.get("index")) self.author: Optional[str] = payload.get("author") self.body: Optional[str] = payload.get("body") - self.media: Optional[List[object]] = payload.get("media") + self.media: Optional[List[Dict[str, object]]] = payload.get("media") self.attributes: Optional[str] = payload.get("attributes") self.participant_sid: Optional[str] = payload.get("participant_sid") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( @@ -559,12 +559,13 @@ def create( :param date_updated: The date that this resource was last updated. `null` if the message has not been edited. :param attributes: A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. :param media_sid: The Media SID to be attached to the new Message. - :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. :param content_variables: A structurally valid JSON string that contains values to resolve Rich Content template variables. :param subject: The subject of the message, can be up to 256 characters long. :returns: The created MessageInstance """ + data = values.of( { "Author": author, @@ -620,12 +621,13 @@ async def create_async( :param date_updated: The date that this resource was last updated. `null` if the message has not been edited. :param attributes: A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. :param media_sid: The Media SID to be attached to the new Message. - :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. :param content_variables: A structurally valid JSON string that contains values to resolve Rich Content template variables. :param subject: The subject of the message, can be up to 256 characters long. :returns: The created MessageInstance """ + data = values.of( { "Author": author, diff --git a/twilio/rest/conversations/v1/service/conversation/participant.py b/twilio/rest/conversations/v1/service/conversation/participant.py index cf394affbc..cf4fba5fa4 100644 --- a/twilio/rest/conversations/v1/service/conversation/participant.py +++ b/twilio/rest/conversations/v1/service/conversation/participant.py @@ -567,6 +567,7 @@ def create( :returns: The created ParticipantInstance """ + data = values.of( { "Identity": identity, @@ -625,6 +626,7 @@ async def create_async( :returns: The created ParticipantInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/conversations/v1/service/conversation/webhook.py b/twilio/rest/conversations/v1/service/conversation/webhook.py index 88e848f351..5dace89d67 100644 --- a/twilio/rest/conversations/v1/service/conversation/webhook.py +++ b/twilio/rest/conversations/v1/service/conversation/webhook.py @@ -454,6 +454,7 @@ def create( :returns: The created WebhookInstance """ + data = values.of( { "Target": target, @@ -506,6 +507,7 @@ async def create_async( :returns: The created WebhookInstance """ + data = values.of( { "Target": target, diff --git a/twilio/rest/conversations/v1/service/role.py b/twilio/rest/conversations/v1/service/role.py index 2ae2c16fb1..2adbfc131b 100644 --- a/twilio/rest/conversations/v1/service/role.py +++ b/twilio/rest/conversations/v1/service/role.py @@ -350,6 +350,7 @@ def create( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -380,6 +381,7 @@ async def create_async( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/conversations/v1/service/user/__init__.py b/twilio/rest/conversations/v1/service/user/__init__.py index 01e0d34522..0f5e24b392 100644 --- a/twilio/rest/conversations/v1/service/user/__init__.py +++ b/twilio/rest/conversations/v1/service/user/__init__.py @@ -488,6 +488,7 @@ def create( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -531,6 +532,7 @@ async def create_async( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/conversations/v1/user/__init__.py b/twilio/rest/conversations/v1/user/__init__.py index 25eafb1c34..6b922afa7b 100644 --- a/twilio/rest/conversations/v1/user/__init__.py +++ b/twilio/rest/conversations/v1/user/__init__.py @@ -458,6 +458,7 @@ def create( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -499,6 +500,7 @@ async def create_async( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/events/v1/sink/__init__.py b/twilio/rest/events/v1/sink/__init__.py index 5a7626ad83..89289ede30 100644 --- a/twilio/rest/events/v1/sink/__init__.py +++ b/twilio/rest/events/v1/sink/__init__.py @@ -378,6 +378,7 @@ def create( :returns: The created SinkInstance """ + data = values.of( { "Description": description, @@ -409,6 +410,7 @@ async def create_async( :returns: The created SinkInstance """ + data = values.of( { "Description": description, diff --git a/twilio/rest/events/v1/sink/sink_validate.py b/twilio/rest/events/v1/sink/sink_validate.py index 8539a1ef41..792d8c4553 100644 --- a/twilio/rest/events/v1/sink/sink_validate.py +++ b/twilio/rest/events/v1/sink/sink_validate.py @@ -71,6 +71,7 @@ def create(self, test_id: str) -> SinkValidateInstance: :returns: The created SinkValidateInstance """ + data = values.of( { "TestId": test_id, @@ -93,6 +94,7 @@ async def create_async(self, test_id: str) -> SinkValidateInstance: :returns: The created SinkValidateInstance """ + data = values.of( { "TestId": test_id, diff --git a/twilio/rest/events/v1/subscription/__init__.py b/twilio/rest/events/v1/subscription/__init__.py index 458177d487..cbe79a985d 100644 --- a/twilio/rest/events/v1/subscription/__init__.py +++ b/twilio/rest/events/v1/subscription/__init__.py @@ -364,6 +364,7 @@ def create( :returns: The created SubscriptionInstance """ + data = values.of( { "Description": description, @@ -392,6 +393,7 @@ async def create_async( :returns: The created SubscriptionInstance """ + data = values.of( { "Description": description, diff --git a/twilio/rest/events/v1/subscription/subscribed_event.py b/twilio/rest/events/v1/subscription/subscribed_event.py index 7cccb1cb8c..4733b8e92c 100644 --- a/twilio/rest/events/v1/subscription/subscribed_event.py +++ b/twilio/rest/events/v1/subscription/subscribed_event.py @@ -27,7 +27,7 @@ class SubscribedEventInstance(InstanceResource): """ :ivar account_sid: The unique SID identifier of the Account. :ivar type: Type of event being subscribed to. - :ivar schema_version: The schema version that the Subscription should use. + :ivar schema_version: The schema version that the subscription should use. :ivar subscription_sid: The unique SID identifier of the Subscription. :ivar url: The URL of this resource. """ @@ -113,7 +113,7 @@ def update( """ Update the SubscribedEventInstance - :param schema_version: The schema version that the Subscription should use. + :param schema_version: The schema version that the subscription should use. :returns: The updated SubscribedEventInstance """ @@ -127,7 +127,7 @@ async def update_async( """ Asynchronous coroutine to update the SubscribedEventInstance - :param schema_version: The schema version that the Subscription should use. + :param schema_version: The schema version that the subscription should use. :returns: The updated SubscribedEventInstance """ @@ -235,7 +235,7 @@ def update( """ Update the SubscribedEventInstance - :param schema_version: The schema version that the Subscription should use. + :param schema_version: The schema version that the subscription should use. :returns: The updated SubscribedEventInstance """ @@ -264,7 +264,7 @@ async def update_async( """ Asynchronous coroutine to update the SubscribedEventInstance - :param schema_version: The schema version that the Subscription should use. + :param schema_version: The schema version that the subscription should use. :returns: The updated SubscribedEventInstance """ @@ -343,10 +343,11 @@ def create( Create the SubscribedEventInstance :param type: Type of event being subscribed to. - :param schema_version: The schema version that the Subscription should use. + :param schema_version: The schema version that the subscription should use. :returns: The created SubscribedEventInstance """ + data = values.of( { "Type": type, @@ -371,10 +372,11 @@ async def create_async( Asynchronously create the SubscribedEventInstance :param type: Type of event being subscribed to. - :param schema_version: The schema version that the Subscription should use. + :param schema_version: The schema version that the subscription should use. :returns: The created SubscribedEventInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/flex_api/v1/assessments.py b/twilio/rest/flex_api/v1/assessments.py index 036d0248c4..b6b2e626ad 100644 --- a/twilio/rest/flex_api/v1/assessments.py +++ b/twilio/rest/flex_api/v1/assessments.py @@ -307,6 +307,7 @@ def create( :returns: The created AssessmentsInstance """ + data = values.of( { "CategorySid": category_sid, @@ -364,6 +365,7 @@ async def create_async( :returns: The created AssessmentsInstance """ + data = values.of( { "CategorySid": category_sid, diff --git a/twilio/rest/flex_api/v1/channel.py b/twilio/rest/flex_api/v1/channel.py index cf2d765879..a9151604eb 100644 --- a/twilio/rest/flex_api/v1/channel.py +++ b/twilio/rest/flex_api/v1/channel.py @@ -267,6 +267,7 @@ def create( :returns: The created ChannelInstance """ + data = values.of( { "FlexFlowSid": flex_flow_sid, @@ -319,6 +320,7 @@ async def create_async( :returns: The created ChannelInstance """ + data = values.of( { "FlexFlowSid": flex_flow_sid, diff --git a/twilio/rest/flex_api/v1/configuration.py b/twilio/rest/flex_api/v1/configuration.py index 24edb5eaa4..c8ab6554bb 100644 --- a/twilio/rest/flex_api/v1/configuration.py +++ b/twilio/rest/flex_api/v1/configuration.py @@ -100,10 +100,10 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.taskrouter_target_taskqueue_sid: Optional[str] = payload.get( "taskrouter_target_taskqueue_sid" ) - self.taskrouter_taskqueues: Optional[List[object]] = payload.get( + self.taskrouter_taskqueues: Optional[List[Dict[str, object]]] = payload.get( "taskrouter_taskqueues" ) - self.taskrouter_skills: Optional[List[object]] = payload.get( + self.taskrouter_skills: Optional[List[Dict[str, object]]] = payload.get( "taskrouter_skills" ) self.taskrouter_worker_channels: Optional[Dict[str, object]] = payload.get( @@ -152,7 +152,9 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.plugin_service_attributes: Optional[Dict[str, object]] = payload.get( "plugin_service_attributes" ) - self.integrations: Optional[List[object]] = payload.get("integrations") + self.integrations: Optional[List[Dict[str, object]]] = payload.get( + "integrations" + ) self.outbound_call_flows: Optional[Dict[str, object]] = payload.get( "outbound_call_flows" ) @@ -172,7 +174,9 @@ def __init__(self, version: Version, payload: Dict[str, Any]): "flex_insights_drilldown" ) self.flex_url: Optional[str] = payload.get("flex_url") - self.channel_configs: Optional[List[object]] = payload.get("channel_configs") + self.channel_configs: Optional[List[Dict[str, object]]] = payload.get( + "channel_configs" + ) self.debugger_integration: Optional[Dict[str, object]] = payload.get( "debugger_integration" ) @@ -231,6 +235,24 @@ async def fetch_async( ui_version=ui_version, ) + def update(self) -> "ConfigurationInstance": + """ + Update the ConfigurationInstance + + + :returns: The updated ConfigurationInstance + """ + return self._proxy.update() + + async def update_async(self) -> "ConfigurationInstance": + """ + Asynchronous coroutine to update the ConfigurationInstance + + + :returns: The updated ConfigurationInstance + """ + return await self._proxy.update_async() + def __repr__(self) -> str: """ Provide a friendly representation @@ -302,6 +324,40 @@ async def fetch_async( payload, ) + def update(self) -> ConfigurationInstance: + """ + Update the ConfigurationInstance + + + :returns: The updated ConfigurationInstance + """ + data = values.of({}) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return ConfigurationInstance(self._version, payload) + + async def update_async(self) -> ConfigurationInstance: + """ + Asynchronous coroutine to update the ConfigurationInstance + + + :returns: The updated ConfigurationInstance + """ + data = values.of({}) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return ConfigurationInstance(self._version, payload) + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/flex_api/v1/flex_flow.py b/twilio/rest/flex_api/v1/flex_flow.py index 45402a43b6..ba4dc4ec60 100644 --- a/twilio/rest/flex_api/v1/flex_flow.py +++ b/twilio/rest/flex_api/v1/flex_flow.py @@ -591,6 +591,7 @@ def create( :returns: The created FlexFlowInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -666,6 +667,7 @@ async def create_async( :returns: The created FlexFlowInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/flex_api/v1/insights_assessments_comment.py b/twilio/rest/flex_api/v1/insights_assessments_comment.py index 127774d572..2d5fd3a431 100644 --- a/twilio/rest/flex_api/v1/insights_assessments_comment.py +++ b/twilio/rest/flex_api/v1/insights_assessments_comment.py @@ -120,6 +120,7 @@ def create( :returns: The created InsightsAssessmentsCommentInstance """ + data = values.of( { "CategoryId": category_id, @@ -165,6 +166,7 @@ async def create_async( :returns: The created InsightsAssessmentsCommentInstance """ + data = values.of( { "CategoryId": category_id, diff --git a/twilio/rest/flex_api/v1/insights_conversations.py b/twilio/rest/flex_api/v1/insights_conversations.py index 204d9807f1..205f43c39b 100644 --- a/twilio/rest/flex_api/v1/insights_conversations.py +++ b/twilio/rest/flex_api/v1/insights_conversations.py @@ -39,7 +39,7 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.segment_count: Optional[int] = deserialize.integer( payload.get("segment_count") ) - self.segments: Optional[List[object]] = payload.get("segments") + self.segments: Optional[List[Dict[str, object]]] = payload.get("segments") def __repr__(self) -> str: """ diff --git a/twilio/rest/flex_api/v1/insights_questionnaires.py b/twilio/rest/flex_api/v1/insights_questionnaires.py index 978bf8807d..f4fedcbe33 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires.py @@ -47,7 +47,7 @@ def __init__( self.name: Optional[str] = payload.get("name") self.description: Optional[str] = payload.get("description") self.active: Optional[bool] = payload.get("active") - self.questions: Optional[List[object]] = payload.get("questions") + self.questions: Optional[List[Dict[str, object]]] = payload.get("questions") self.url: Optional[str] = payload.get("url") self._solution = { @@ -441,6 +441,7 @@ def create( :returns: The created InsightsQuestionnairesInstance """ + data = values.of( { "Name": name, @@ -480,6 +481,7 @@ async def create_async( :returns: The created InsightsQuestionnairesInstance """ + data = values.of( { "Name": name, diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_category.py b/twilio/rest/flex_api/v1/insights_questionnaires_category.py index 2659f277e8..659e10ec6b 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_category.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_category.py @@ -303,6 +303,7 @@ def create( :returns: The created InsightsQuestionnairesCategoryInstance """ + data = values.of( { "Name": name, @@ -331,6 +332,7 @@ async def create_async( :returns: The created InsightsQuestionnairesCategoryInstance """ + data = values.of( { "Name": name, diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_question.py b/twilio/rest/flex_api/v1/insights_questionnaires_question.py index 53405e772e..b8d1fe4251 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_question.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_question.py @@ -381,6 +381,7 @@ def create( :returns: The created InsightsQuestionnairesQuestionInstance """ + data = values.of( { "CategorySid": category_sid, @@ -423,6 +424,7 @@ async def create_async( :returns: The created InsightsQuestionnairesQuestionInstance """ + data = values.of( { "CategorySid": category_sid, diff --git a/twilio/rest/flex_api/v1/interaction/__init__.py b/twilio/rest/flex_api/v1/interaction/__init__.py index 40fe054fdf..7d81b3f019 100644 --- a/twilio/rest/flex_api/v1/interaction/__init__.py +++ b/twilio/rest/flex_api/v1/interaction/__init__.py @@ -210,6 +210,7 @@ def create( :returns: The created InteractionInstance """ + data = values.of( { "Channel": serialize.object(channel), @@ -241,6 +242,7 @@ async def create_async( :returns: The created InteractionInstance """ + data = values.of( { "Channel": serialize.object(channel), 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 b585176ec9..899c78593a 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 @@ -116,6 +116,7 @@ def create(self, routing: object) -> InteractionChannelInviteInstance: :returns: The created InteractionChannelInviteInstance """ + data = values.of( { "Routing": serialize.object(routing), @@ -143,6 +144,7 @@ async def create_async(self, routing: object) -> InteractionChannelInviteInstanc :returns: The created InteractionChannelInviteInstance """ + data = values.of( { "Routing": serialize.object(routing), 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 761516f9fa..6aa291d80b 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 @@ -279,6 +279,7 @@ def create( :returns: The created InteractionChannelParticipantInstance """ + data = values.of( { "Type": type, @@ -312,6 +313,7 @@ async def create_async( :returns: The created InteractionChannelParticipantInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/flex_api/v1/web_channel.py b/twilio/rest/flex_api/v1/web_channel.py index 436c0be8b2..79910f9326 100644 --- a/twilio/rest/flex_api/v1/web_channel.py +++ b/twilio/rest/flex_api/v1/web_channel.py @@ -349,6 +349,7 @@ def create( :returns: The created WebChannelInstance """ + data = values.of( { "FlexFlowSid": flex_flow_sid, @@ -389,6 +390,7 @@ async def create_async( :returns: The created WebChannelInstance """ + data = values.of( { "FlexFlowSid": flex_flow_sid, diff --git a/twilio/rest/flex_api/v2/web_channels.py b/twilio/rest/flex_api/v2/web_channels.py index b8953bd651..56c0fc2188 100644 --- a/twilio/rest/flex_api/v2/web_channels.py +++ b/twilio/rest/flex_api/v2/web_channels.py @@ -73,6 +73,7 @@ def create( :returns: The created WebChannelsInstance """ + data = values.of( { "AddressSid": address_sid, @@ -107,6 +108,7 @@ async def create_async( :returns: The created WebChannelsInstance """ + data = values.of( { "AddressSid": address_sid, diff --git a/twilio/rest/intelligence/v2/service.py b/twilio/rest/intelligence/v2/service.py index 8f7647ed4a..3c870a5486 100644 --- a/twilio/rest/intelligence/v2/service.py +++ b/twilio/rest/intelligence/v2/service.py @@ -34,7 +34,7 @@ class HttpMethod(object): :ivar auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. :ivar media_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. :ivar auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :ivar data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + :ivar data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. :ivar date_created: The date that this Service was created, given in ISO 8601 format. :ivar date_updated: The date that this Service was updated, given in ISO 8601 format. :ivar friendly_name: A human readable description of this resource, up to 64 characters. @@ -148,7 +148,7 @@ def update( :param if_match: The If-Match HTTP request header :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. @@ -190,7 +190,7 @@ async def update_async( :param if_match: The If-Match HTTP request header :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. @@ -320,7 +320,7 @@ def update( :param if_match: The If-Match HTTP request header :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. @@ -374,7 +374,7 @@ async def update_async( :param if_match: The If-Match HTTP request header :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. @@ -467,7 +467,7 @@ def create( :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. @@ -477,6 +477,7 @@ def create( :returns: The created ServiceInstance """ + data = values.of( { "UniqueName": unique_name, @@ -516,7 +517,7 @@ async def create_async( :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. @@ -526,6 +527,7 @@ async def create_async( :returns: The created ServiceInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/intelligence/v2/transcript/__init__.py b/twilio/rest/intelligence/v2/transcript/__init__.py index 72bb4bdc1e..63de42b7b8 100644 --- a/twilio/rest/intelligence/v2/transcript/__init__.py +++ b/twilio/rest/intelligence/v2/transcript/__init__.py @@ -42,7 +42,7 @@ class Status(object): :ivar date_updated: The date that this Transcript was updated, given in ISO 8601 format. :ivar status: :ivar channel: Media Channel describing Transcript Source and Participant Mapping - :ivar data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + :ivar data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. :ivar language_code: The default language code of the audio. :ivar customer_key: :ivar media_start_time: The date that this Transcript's media was started, given in ISO 8601 format. @@ -341,6 +341,7 @@ def create( :returns: The created TranscriptInstance """ + data = values.of( { "ServiceSid": service_sid, @@ -375,6 +376,7 @@ async def create_async( :returns: The created TranscriptInstance """ + data = values.of( { "ServiceSid": service_sid, diff --git a/twilio/rest/intelligence/v2/transcript/operator_result.py b/twilio/rest/intelligence/v2/transcript/operator_result.py index 40e4e58886..3a381333cf 100644 --- a/twilio/rest/intelligence/v2/transcript/operator_result.py +++ b/twilio/rest/intelligence/v2/transcript/operator_result.py @@ -67,7 +67,7 @@ def __init__( payload.get("match_probability") ) self.normalized_result: Optional[str] = payload.get("normalized_result") - self.utterance_results: Optional[List[object]] = payload.get( + self.utterance_results: Optional[List[Dict[str, object]]] = payload.get( "utterance_results" ) self.utterance_match: Optional[bool] = payload.get("utterance_match") diff --git a/twilio/rest/ip_messaging/v1/credential.py b/twilio/rest/ip_messaging/v1/credential.py index 6a193aa1f4..f13fd814f2 100644 --- a/twilio/rest/ip_messaging/v1/credential.py +++ b/twilio/rest/ip_messaging/v1/credential.py @@ -405,6 +405,7 @@ def create( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, @@ -448,6 +449,7 @@ async def create_async( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/ip_messaging/v1/service/__init__.py b/twilio/rest/ip_messaging/v1/service/__init__.py index c07b4cc252..4a2d139391 100644 --- a/twilio/rest/ip_messaging/v1/service/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/__init__.py @@ -1062,6 +1062,7 @@ def create(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -1084,6 +1085,7 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/ip_messaging/v1/service/channel/__init__.py b/twilio/rest/ip_messaging/v1/service/channel/__init__.py index 32961bcff0..c525b08065 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/channel/__init__.py @@ -472,6 +472,7 @@ def create( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -508,6 +509,7 @@ async def create_async( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/ip_messaging/v1/service/channel/invite.py b/twilio/rest/ip_messaging/v1/service/channel/invite.py index 476e89f4c2..0ccb06dfef 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v1/service/channel/invite.py @@ -288,6 +288,7 @@ def create( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, @@ -319,6 +320,7 @@ async def create_async( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/ip_messaging/v1/service/channel/member.py b/twilio/rest/ip_messaging/v1/service/channel/member.py index 2414e72c93..0c6742f683 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/member.py +++ b/twilio/rest/ip_messaging/v1/service/channel/member.py @@ -398,6 +398,7 @@ def create( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, @@ -429,6 +430,7 @@ async def create_async( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/ip_messaging/v1/service/channel/message.py b/twilio/rest/ip_messaging/v1/service/channel/message.py index e562faafb6..462cb94cf0 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/message.py +++ b/twilio/rest/ip_messaging/v1/service/channel/message.py @@ -405,6 +405,7 @@ def create( :returns: The created MessageInstance """ + data = values.of( { "Body": body, @@ -441,6 +442,7 @@ async def create_async( :returns: The created MessageInstance """ + data = values.of( { "Body": body, diff --git a/twilio/rest/ip_messaging/v1/service/role.py b/twilio/rest/ip_messaging/v1/service/role.py index e637e2c900..6767e23160 100644 --- a/twilio/rest/ip_messaging/v1/service/role.py +++ b/twilio/rest/ip_messaging/v1/service/role.py @@ -350,6 +350,7 @@ def create( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -380,6 +381,7 @@ async def create_async( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/ip_messaging/v1/service/user/__init__.py b/twilio/rest/ip_messaging/v1/service/user/__init__.py index e19eb82be6..ffcd24e782 100644 --- a/twilio/rest/ip_messaging/v1/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/user/__init__.py @@ -423,6 +423,7 @@ def create( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -459,6 +460,7 @@ async def create_async( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/ip_messaging/v2/credential.py b/twilio/rest/ip_messaging/v2/credential.py index 3d72b3a0d6..ab21588e34 100644 --- a/twilio/rest/ip_messaging/v2/credential.py +++ b/twilio/rest/ip_messaging/v2/credential.py @@ -405,6 +405,7 @@ def create( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, @@ -448,6 +449,7 @@ async def create_async( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/ip_messaging/v2/service/__init__.py b/twilio/rest/ip_messaging/v2/service/__init__.py index b94def1fa6..4e96b3b2d6 100644 --- a/twilio/rest/ip_messaging/v2/service/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/__init__.py @@ -823,6 +823,7 @@ def create(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -845,6 +846,7 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/ip_messaging/v2/service/channel/__init__.py b/twilio/rest/ip_messaging/v2/service/channel/__init__.py index 55c5b749a5..6f306290f3 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/channel/__init__.py @@ -604,6 +604,7 @@ def create( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -656,6 +657,7 @@ async def create_async( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/ip_messaging/v2/service/channel/invite.py b/twilio/rest/ip_messaging/v2/service/channel/invite.py index aeb07b7b92..71ef25df61 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v2/service/channel/invite.py @@ -288,6 +288,7 @@ def create( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, @@ -319,6 +320,7 @@ async def create_async( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/ip_messaging/v2/service/channel/member.py b/twilio/rest/ip_messaging/v2/service/channel/member.py index b001bc1b49..6b3aa44f67 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/member.py +++ b/twilio/rest/ip_messaging/v2/service/channel/member.py @@ -531,6 +531,7 @@ def create( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, @@ -588,6 +589,7 @@ async def create_async( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/ip_messaging/v2/service/channel/message.py b/twilio/rest/ip_messaging/v2/service/channel/message.py index f55afedbc1..64c4ba977e 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/message.py +++ b/twilio/rest/ip_messaging/v2/service/channel/message.py @@ -535,6 +535,7 @@ def create( :returns: The created MessageInstance """ + data = values.of( { "From": from_, @@ -590,6 +591,7 @@ async def create_async( :returns: The created MessageInstance """ + data = values.of( { "From": from_, diff --git a/twilio/rest/ip_messaging/v2/service/channel/webhook.py b/twilio/rest/ip_messaging/v2/service/channel/webhook.py index 077bbfa8e4..c5c2879b20 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/webhook.py +++ b/twilio/rest/ip_messaging/v2/service/channel/webhook.py @@ -466,6 +466,7 @@ def create( :returns: The created WebhookInstance """ + data = values.of( { "Type": type, @@ -518,6 +519,7 @@ async def create_async( :returns: The created WebhookInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/ip_messaging/v2/service/role.py b/twilio/rest/ip_messaging/v2/service/role.py index c8e3b95611..2a39101b37 100644 --- a/twilio/rest/ip_messaging/v2/service/role.py +++ b/twilio/rest/ip_messaging/v2/service/role.py @@ -350,6 +350,7 @@ def create( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -380,6 +381,7 @@ async def create_async( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/ip_messaging/v2/service/user/__init__.py b/twilio/rest/ip_messaging/v2/service/user/__init__.py index 3acb88284d..5b632c125e 100644 --- a/twilio/rest/ip_messaging/v2/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/user/__init__.py @@ -476,6 +476,7 @@ def create( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -519,6 +520,7 @@ async def create_async( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/media/v1/media_processor.py b/twilio/rest/media/v1/media_processor.py index 16ac32aa2f..da4a3b0c93 100644 --- a/twilio/rest/media/v1/media_processor.py +++ b/twilio/rest/media/v1/media_processor.py @@ -316,6 +316,7 @@ def create( :returns: The created MediaProcessorInstance """ + data = values.of( { "Extension": extension, @@ -356,6 +357,7 @@ async def create_async( :returns: The created MediaProcessorInstance """ + data = values.of( { "Extension": extension, diff --git a/twilio/rest/media/v1/player_streamer/__init__.py b/twilio/rest/media/v1/player_streamer/__init__.py index 6bc535cdfa..1d91e86a44 100644 --- a/twilio/rest/media/v1/player_streamer/__init__.py +++ b/twilio/rest/media/v1/player_streamer/__init__.py @@ -343,6 +343,7 @@ def create( :returns: The created PlayerStreamerInstance """ + data = values.of( { "Video": video, @@ -377,6 +378,7 @@ async def create_async( :returns: The created PlayerStreamerInstance """ + data = values.of( { "Video": video, diff --git a/twilio/rest/messaging/v1/brand_registration/__init__.py b/twilio/rest/messaging/v1/brand_registration/__init__.py index 68a669e3ce..de54a2f2a8 100644 --- a/twilio/rest/messaging/v1/brand_registration/__init__.py +++ b/twilio/rest/messaging/v1/brand_registration/__init__.py @@ -373,6 +373,7 @@ def create( :returns: The created BrandRegistrationInstance """ + data = values.of( { "CustomerProfileBundleSid": customer_profile_bundle_sid, @@ -410,6 +411,7 @@ async def create_async( :returns: The created BrandRegistrationInstance """ + data = values.of( { "CustomerProfileBundleSid": customer_profile_bundle_sid, diff --git a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py index 2fff9ebbed..cc00fbc9ed 100644 --- a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py +++ b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py @@ -240,6 +240,7 @@ def create( :returns: The created BrandVettingInstance """ + data = values.of( { "VettingProvider": vetting_provider, @@ -270,6 +271,7 @@ async def create_async( :returns: The created BrandVettingInstance """ + data = values.of( { "VettingProvider": vetting_provider, diff --git a/twilio/rest/messaging/v1/external_campaign.py b/twilio/rest/messaging/v1/external_campaign.py index 53af9869d3..ce232e9cf9 100644 --- a/twilio/rest/messaging/v1/external_campaign.py +++ b/twilio/rest/messaging/v1/external_campaign.py @@ -76,6 +76,7 @@ def create( :returns: The created ExternalCampaignInstance """ + data = values.of( { "CampaignId": campaign_id, @@ -102,6 +103,7 @@ async def create_async( :returns: The created ExternalCampaignInstance """ + data = values.of( { "CampaignId": campaign_id, diff --git a/twilio/rest/messaging/v1/service/__init__.py b/twilio/rest/messaging/v1/service/__init__.py index d1772d7d76..4d23155880 100644 --- a/twilio/rest/messaging/v1/service/__init__.py +++ b/twilio/rest/messaging/v1/service/__init__.py @@ -724,6 +724,7 @@ def create( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -796,6 +797,7 @@ async def create_async( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/messaging/v1/service/alpha_sender.py b/twilio/rest/messaging/v1/service/alpha_sender.py index 92d81e9fc4..9dca85f801 100644 --- a/twilio/rest/messaging/v1/service/alpha_sender.py +++ b/twilio/rest/messaging/v1/service/alpha_sender.py @@ -265,6 +265,7 @@ def create(self, alpha_sender: str) -> AlphaSenderInstance: :returns: The created AlphaSenderInstance """ + data = values.of( { "AlphaSender": alpha_sender, @@ -289,6 +290,7 @@ async def create_async(self, alpha_sender: str) -> AlphaSenderInstance: :returns: The created AlphaSenderInstance """ + data = values.of( { "AlphaSender": alpha_sender, diff --git a/twilio/rest/messaging/v1/service/phone_number.py b/twilio/rest/messaging/v1/service/phone_number.py index c01c76a3b7..daafa6d788 100644 --- a/twilio/rest/messaging/v1/service/phone_number.py +++ b/twilio/rest/messaging/v1/service/phone_number.py @@ -267,6 +267,7 @@ def create(self, phone_number_sid: str) -> PhoneNumberInstance: :returns: The created PhoneNumberInstance """ + data = values.of( { "PhoneNumberSid": phone_number_sid, @@ -291,6 +292,7 @@ async def create_async(self, phone_number_sid: str) -> PhoneNumberInstance: :returns: The created PhoneNumberInstance """ + data = values.of( { "PhoneNumberSid": phone_number_sid, diff --git a/twilio/rest/messaging/v1/service/short_code.py b/twilio/rest/messaging/v1/service/short_code.py index 104f03f6ec..dbc24cea3f 100644 --- a/twilio/rest/messaging/v1/service/short_code.py +++ b/twilio/rest/messaging/v1/service/short_code.py @@ -265,6 +265,7 @@ def create(self, short_code_sid: str) -> ShortCodeInstance: :returns: The created ShortCodeInstance """ + data = values.of( { "ShortCodeSid": short_code_sid, @@ -289,6 +290,7 @@ async def create_async(self, short_code_sid: str) -> ShortCodeInstance: :returns: The created ShortCodeInstance """ + data = values.of( { "ShortCodeSid": short_code_sid, 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 7ccb534319..5e89c8384a 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person.py @@ -96,7 +96,7 @@ def __init__( ) self.url: Optional[str] = payload.get("url") self.mock: Optional[bool] = payload.get("mock") - self.errors: Optional[List[object]] = payload.get("errors") + self.errors: Optional[List[Dict[str, object]]] = payload.get("errors") self._solution = { "messaging_service_sid": messaging_service_sid, @@ -336,6 +336,7 @@ def create( :returns: The created UsAppToPersonInstance """ + data = values.of( { "BrandRegistrationSid": brand_registration_sid, @@ -401,6 +402,7 @@ async def create_async( :returns: The created UsAppToPersonInstance """ + data = values.of( { "BrandRegistrationSid": brand_registration_sid, 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 41dbec7878..60b8757038 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 @@ -32,7 +32,7 @@ def __init__( ): super().__init__(version) - self.us_app_to_person_usecases: Optional[List[object]] = payload.get( + self.us_app_to_person_usecases: Optional[List[Dict[str, object]]] = payload.get( "us_app_to_person_usecases" ) diff --git a/twilio/rest/messaging/v1/tollfree_verification.py b/twilio/rest/messaging/v1/tollfree_verification.py index 7efbbc78a6..83c0df1a49 100644 --- a/twilio/rest/messaging/v1/tollfree_verification.py +++ b/twilio/rest/messaging/v1/tollfree_verification.py @@ -721,6 +721,7 @@ def create( :returns: The created TollfreeVerificationInstance """ + data = values.of( { "BusinessName": business_name, @@ -812,6 +813,7 @@ async def create_async( :returns: The created TollfreeVerificationInstance """ + data = values.of( { "BusinessName": business_name, diff --git a/twilio/rest/messaging/v1/usecase.py b/twilio/rest/messaging/v1/usecase.py index 4b455d8c67..3fb46b4a2b 100644 --- a/twilio/rest/messaging/v1/usecase.py +++ b/twilio/rest/messaging/v1/usecase.py @@ -29,7 +29,7 @@ class UsecaseInstance(InstanceResource): def __init__(self, version: Version, payload: Dict[str, Any]): super().__init__(version) - self.usecases: Optional[List[object]] = payload.get("usecases") + self.usecases: Optional[List[Dict[str, object]]] = payload.get("usecases") def __repr__(self) -> str: """ diff --git a/twilio/rest/microvisor/v1/account_config.py b/twilio/rest/microvisor/v1/account_config.py index 7d8119a3de..459a95f25f 100644 --- a/twilio/rest/microvisor/v1/account_config.py +++ b/twilio/rest/microvisor/v1/account_config.py @@ -305,6 +305,7 @@ def create(self, key: str, value: str) -> AccountConfigInstance: :returns: The created AccountConfigInstance """ + data = values.of( { "Key": key, @@ -329,6 +330,7 @@ async def create_async(self, key: str, value: str) -> AccountConfigInstance: :returns: The created AccountConfigInstance """ + data = values.of( { "Key": key, diff --git a/twilio/rest/microvisor/v1/account_secret.py b/twilio/rest/microvisor/v1/account_secret.py index a7fc4f8969..eacd4fa526 100644 --- a/twilio/rest/microvisor/v1/account_secret.py +++ b/twilio/rest/microvisor/v1/account_secret.py @@ -303,6 +303,7 @@ def create(self, key: str, value: str) -> AccountSecretInstance: :returns: The created AccountSecretInstance """ + data = values.of( { "Key": key, @@ -327,6 +328,7 @@ async def create_async(self, key: str, value: str) -> AccountSecretInstance: :returns: The created AccountSecretInstance """ + data = values.of( { "Key": key, diff --git a/twilio/rest/microvisor/v1/device/device_config.py b/twilio/rest/microvisor/v1/device/device_config.py index a954727bf0..54424e800b 100644 --- a/twilio/rest/microvisor/v1/device/device_config.py +++ b/twilio/rest/microvisor/v1/device/device_config.py @@ -334,6 +334,7 @@ def create(self, key: str, value: str) -> DeviceConfigInstance: :returns: The created DeviceConfigInstance """ + data = values.of( { "Key": key, @@ -360,6 +361,7 @@ async def create_async(self, key: str, value: str) -> DeviceConfigInstance: :returns: The created DeviceConfigInstance """ + data = values.of( { "Key": key, diff --git a/twilio/rest/microvisor/v1/device/device_secret.py b/twilio/rest/microvisor/v1/device/device_secret.py index 7f2ee0eeb0..124fe0e483 100644 --- a/twilio/rest/microvisor/v1/device/device_secret.py +++ b/twilio/rest/microvisor/v1/device/device_secret.py @@ -332,6 +332,7 @@ def create(self, key: str, value: str) -> DeviceSecretInstance: :returns: The created DeviceSecretInstance """ + data = values.of( { "Key": key, @@ -358,6 +359,7 @@ async def create_async(self, key: str, value: str) -> DeviceSecretInstance: :returns: The created DeviceSecretInstance """ + data = values.of( { "Key": key, diff --git a/twilio/rest/notify/v1/credential.py b/twilio/rest/notify/v1/credential.py index 2b1efcf82a..61f1abd801 100644 --- a/twilio/rest/notify/v1/credential.py +++ b/twilio/rest/notify/v1/credential.py @@ -405,6 +405,7 @@ def create( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, @@ -448,6 +449,7 @@ async def create_async( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/notify/v1/service/__init__.py b/twilio/rest/notify/v1/service/__init__.py index b53ca2658b..5c5d14d066 100644 --- a/twilio/rest/notify/v1/service/__init__.py +++ b/twilio/rest/notify/v1/service/__init__.py @@ -36,7 +36,7 @@ class ServiceInstance(InstanceResource): :ivar apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :ivar gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. :ivar fcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. - :ivar messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. In order to send SMS notifications this parameter has to be set. + :ivar messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. In order to send SMS notifications this parameter has to be set. :ivar facebook_messenger_page_id: Deprecated. :ivar default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :ivar default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -171,7 +171,7 @@ def update( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -225,7 +225,7 @@ async def update_async( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -384,7 +384,7 @@ def update( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -448,7 +448,7 @@ async def update_async( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -576,7 +576,7 @@ def create( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -590,6 +590,7 @@ def create( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -640,7 +641,7 @@ async def create_async( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -654,6 +655,7 @@ async def create_async( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/notify/v1/service/binding.py b/twilio/rest/notify/v1/service/binding.py index dba36be720..1bcb36d247 100644 --- a/twilio/rest/notify/v1/service/binding.py +++ b/twilio/rest/notify/v1/service/binding.py @@ -299,6 +299,7 @@ def create( :returns: The created BindingInstance """ + data = values.of( { "Identity": identity, @@ -344,6 +345,7 @@ async def create_async( :returns: The created BindingInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/notify/v1/service/notification.py b/twilio/rest/notify/v1/service/notification.py index 40234fb072..237e553117 100644 --- a/twilio/rest/notify/v1/service/notification.py +++ b/twilio/rest/notify/v1/service/notification.py @@ -144,7 +144,7 @@ def create( :param data: The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. :param apn: The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. :param gcm: The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). - :param sms: The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/quickstart) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. + :param sms: The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/send-messages) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. :param facebook_messenger: Deprecated. :param fcm: The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. :param segment: The Segment resource is deprecated. Use the `tag` parameter, instead. @@ -156,6 +156,7 @@ def create( :returns: The created NotificationInstance """ + data = values.of( { "Body": body, @@ -222,7 +223,7 @@ async def create_async( :param data: The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. :param apn: The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. :param gcm: The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). - :param sms: The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/quickstart) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. + :param sms: The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/send-messages) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. :param facebook_messenger: Deprecated. :param fcm: The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. :param segment: The Segment resource is deprecated. Use the `tag` parameter, instead. @@ -234,6 +235,7 @@ async def create_async( :returns: The created NotificationInstance """ + data = values.of( { "Body": body, diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index a9285ae496..1619c070f0 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -16,8 +16,9 @@ from twilio.base.version import Version from twilio.base.domain import Domain from twilio.rest.numbers.v1.bulk_eligibility import BulkEligibilityList +from twilio.rest.numbers.v1.eligibility import EligibilityList from twilio.rest.numbers.v1.porting_bulk_portability import PortingBulkPortabilityList -from twilio.rest.numbers.v1.porting_port_in_fetch import PortingPortInFetchList +from twilio.rest.numbers.v1.porting_port_in import PortingPortInList from twilio.rest.numbers.v1.porting_portability import PortingPortabilityList @@ -30,8 +31,9 @@ def __init__(self, domain: Domain): """ super().__init__(domain, "v1") self._bulk_eligibilities: Optional[BulkEligibilityList] = None + self._eligibilities: Optional[EligibilityList] = None self._porting_bulk_portabilities: Optional[PortingBulkPortabilityList] = None - self._porting_port_ins: Optional[PortingPortInFetchList] = None + self._porting_port_ins: Optional[PortingPortInList] = None self._porting_portabilities: Optional[PortingPortabilityList] = None @property @@ -40,6 +42,12 @@ def bulk_eligibilities(self) -> BulkEligibilityList: self._bulk_eligibilities = BulkEligibilityList(self) return self._bulk_eligibilities + @property + def eligibilities(self) -> EligibilityList: + if self._eligibilities is None: + self._eligibilities = EligibilityList(self) + return self._eligibilities + @property def porting_bulk_portabilities(self) -> PortingBulkPortabilityList: if self._porting_bulk_portabilities is None: @@ -47,9 +55,9 @@ def porting_bulk_portabilities(self) -> PortingBulkPortabilityList: return self._porting_bulk_portabilities @property - def porting_port_ins(self) -> PortingPortInFetchList: + def porting_port_ins(self) -> PortingPortInList: if self._porting_port_ins is None: - self._porting_port_ins = PortingPortInFetchList(self) + self._porting_port_ins = PortingPortInList(self) return self._porting_port_ins @property diff --git a/twilio/rest/numbers/v1/bulk_eligibility.py b/twilio/rest/numbers/v1/bulk_eligibility.py index 805f6b1bdc..e68cee2a43 100644 --- a/twilio/rest/numbers/v1/bulk_eligibility.py +++ b/twilio/rest/numbers/v1/bulk_eligibility.py @@ -44,7 +44,7 @@ def __init__( self.request_id: Optional[str] = payload.get("request_id") self.url: Optional[str] = payload.get("url") - self.results: Optional[List[object]] = payload.get("results") + self.results: Optional[List[Dict[str, object]]] = payload.get("results") self.friendly_name: Optional[str] = payload.get("friendly_name") self.status: Optional[str] = payload.get("status") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( @@ -178,6 +178,38 @@ def __init__(self, version: Version): """ super().__init__(version) + self._uri = "/HostedNumber/Eligibility/Bulk" + + def create(self) -> BulkEligibilityInstance: + """ + Create the BulkEligibilityInstance + + + :returns: The created BulkEligibilityInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return BulkEligibilityInstance(self._version, payload) + + async def create_async(self) -> BulkEligibilityInstance: + """ + Asynchronously create the BulkEligibilityInstance + + + :returns: The created BulkEligibilityInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return BulkEligibilityInstance(self._version, payload) + def get(self, request_id: str) -> BulkEligibilityContext: """ Constructs a BulkEligibilityContext diff --git a/twilio/rest/numbers/v1/eligibility.py b/twilio/rest/numbers/v1/eligibility.py new file mode 100644 index 0000000000..6781c3d869 --- /dev/null +++ b/twilio/rest/numbers/v1/eligibility.py @@ -0,0 +1,92 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Numbers + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + + +from typing import Any, Dict, List, Optional + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class EligibilityInstance(InstanceResource): + + """ + :ivar results: The result set that contains the eligibility check response for the requested number, each result has at least the following attributes: phone_number: The requested phone number ,hosting_account_sid: The account sid where the phone number will be hosted, date_last_checked: Datetime (ISO 8601) when the PN was last checked for eligibility, country: Phone number’s country, eligibility_status: Indicates the eligibility status of the PN (Eligible/Ineligible), eligibility_sub_status: Indicates the sub status of the eligibility , ineligibility_reason: Reason for number's ineligibility (if applicable), next_step: Suggested next step in the hosting process based on the eligibility status. + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.results: Optional[List[Dict[str, object]]] = payload.get("results") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class EligibilityList(ListResource): + def __init__(self, version: Version): + """ + Initialize the EligibilityList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/HostedNumber/Eligibility" + + def create(self) -> EligibilityInstance: + """ + Create the EligibilityInstance + + + :returns: The created EligibilityInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return EligibilityInstance(self._version, payload) + + async def create_async(self) -> EligibilityInstance: + """ + Asynchronously create the EligibilityInstance + + + :returns: The created EligibilityInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return EligibilityInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/numbers/v1/porting_bulk_portability.py b/twilio/rest/numbers/v1/porting_bulk_portability.py index 3abc24b6e7..a6c037edb0 100644 --- a/twilio/rest/numbers/v1/porting_bulk_portability.py +++ b/twilio/rest/numbers/v1/porting_bulk_portability.py @@ -48,7 +48,9 @@ def __init__( self.datetime_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("datetime_created") ) - self.phone_numbers: Optional[List[object]] = payload.get("phone_numbers") + self.phone_numbers: Optional[List[Dict[str, object]]] = payload.get( + "phone_numbers" + ) self.url: Optional[str] = payload.get("url") self._solution = { @@ -183,6 +185,7 @@ def create(self, phone_numbers: List[str]) -> PortingBulkPortabilityInstance: :returns: The created PortingBulkPortabilityInstance """ + data = values.of( { "PhoneNumbers": serialize.map(phone_numbers, lambda e: e), @@ -207,6 +210,7 @@ async def create_async( :returns: The created PortingBulkPortabilityInstance """ + data = values.of( { "PhoneNumbers": serialize.map(phone_numbers, lambda e: e), diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py new file mode 100644 index 0000000000..1bc33ac16f --- /dev/null +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -0,0 +1,94 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Numbers + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + + +from typing import Any, Dict, Optional + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class PortingPortInInstance(InstanceResource): + + """ + :ivar port_in_request_sid: The SID of the Port In request, It is the request identifier + :ivar url: + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.port_in_request_sid: Optional[str] = payload.get("port_in_request_sid") + self.url: Optional[str] = payload.get("url") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class PortingPortInList(ListResource): + def __init__(self, version: Version): + """ + Initialize the PortingPortInList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Porting/PortIn" + + def create(self) -> PortingPortInInstance: + """ + Create the PortingPortInInstance + + + :returns: The created PortingPortInInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return PortingPortInInstance(self._version, payload) + + async def create_async(self) -> PortingPortInInstance: + """ + Asynchronously create the PortingPortInInstance + + + :returns: The created PortingPortInInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return PortingPortInInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/numbers/v1/porting_port_in_fetch.py b/twilio/rest/numbers/v1/porting_port_in_fetch.py deleted file mode 100644 index 0ac469fe6f..0000000000 --- a/twilio/rest/numbers/v1/porting_port_in_fetch.py +++ /dev/null @@ -1,217 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Numbers - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import date -from typing import Any, Dict, List, Optional -from twilio.base import deserialize -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class PortingPortInFetchInstance(InstanceResource): - - """ - :ivar port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. - :ivar url: The URL of this Port In request - :ivar account_sid: The Account SID that the numbers will be added to after they are ported into Twilio. - :ivar notification_emails: List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails. - :ivar target_port_in_date: Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation. - :ivar target_port_in_time_range_start: Minimum hour in the future needs to be established with the Ops team for validation. - :ivar target_port_in_time_range_end: Maximum hour in the future needs to be established with the Ops team for validation. - :ivar losing_carrier_information: The information for the losing carrier. - :ivar phone_numbers: The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212). - :ivar documents: The list of documents SID referencing a utility bills - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - port_in_request_sid: Optional[str] = None, - ): - super().__init__(version) - - self.port_in_request_sid: Optional[str] = payload.get("port_in_request_sid") - self.url: Optional[str] = payload.get("url") - self.account_sid: Optional[str] = payload.get("account_sid") - self.notification_emails: Optional[List[str]] = payload.get( - "notification_emails" - ) - self.target_port_in_date: Optional[date] = deserialize.iso8601_date( - payload.get("target_port_in_date") - ) - self.target_port_in_time_range_start: Optional[str] = payload.get( - "target_port_in_time_range_start" - ) - self.target_port_in_time_range_end: Optional[str] = payload.get( - "target_port_in_time_range_end" - ) - self.losing_carrier_information: Optional[Dict[str, object]] = payload.get( - "losing_carrier_information" - ) - self.phone_numbers: Optional[List[object]] = payload.get("phone_numbers") - self.documents: Optional[List[str]] = payload.get("documents") - - self._solution = { - "port_in_request_sid": port_in_request_sid or self.port_in_request_sid, - } - self._context: Optional[PortingPortInFetchContext] = None - - @property - def _proxy(self) -> "PortingPortInFetchContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: PortingPortInFetchContext for this PortingPortInFetchInstance - """ - if self._context is None: - self._context = PortingPortInFetchContext( - self._version, - port_in_request_sid=self._solution["port_in_request_sid"], - ) - return self._context - - def fetch(self) -> "PortingPortInFetchInstance": - """ - Fetch the PortingPortInFetchInstance - - - :returns: The fetched PortingPortInFetchInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "PortingPortInFetchInstance": - """ - Asynchronous coroutine to fetch the PortingPortInFetchInstance - - - :returns: The fetched PortingPortInFetchInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class PortingPortInFetchContext(InstanceContext): - def __init__(self, version: Version, port_in_request_sid: str): - """ - Initialize the PortingPortInFetchContext - - :param version: Version that contains the resource - :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "port_in_request_sid": port_in_request_sid, - } - self._uri = "/Porting/PortIn/{port_in_request_sid}".format(**self._solution) - - def fetch(self) -> PortingPortInFetchInstance: - """ - Fetch the PortingPortInFetchInstance - - - :returns: The fetched PortingPortInFetchInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return PortingPortInFetchInstance( - self._version, - payload, - port_in_request_sid=self._solution["port_in_request_sid"], - ) - - async def fetch_async(self) -> PortingPortInFetchInstance: - """ - Asynchronous coroutine to fetch the PortingPortInFetchInstance - - - :returns: The fetched PortingPortInFetchInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return PortingPortInFetchInstance( - self._version, - payload, - port_in_request_sid=self._solution["port_in_request_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class PortingPortInFetchList(ListResource): - def __init__(self, version: Version): - """ - Initialize the PortingPortInFetchList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - def get(self, port_in_request_sid: str) -> PortingPortInFetchContext: - """ - Constructs a PortingPortInFetchContext - - :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. - """ - return PortingPortInFetchContext( - self._version, port_in_request_sid=port_in_request_sid - ) - - def __call__(self, port_in_request_sid: str) -> PortingPortInFetchContext: - """ - Constructs a PortingPortInFetchContext - - :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. - """ - return PortingPortInFetchContext( - self._version, port_in_request_sid=port_in_request_sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/numbers/v2/authorization_document/__init__.py b/twilio/rest/numbers/v2/authorization_document/__init__.py index f8ac50dcca..c40d44421d 100644 --- a/twilio/rest/numbers/v2/authorization_document/__init__.py +++ b/twilio/rest/numbers/v2/authorization_document/__init__.py @@ -297,6 +297,7 @@ def create( :returns: The created AuthorizationDocumentInstance """ + data = values.of( { "AddressSid": address_sid, @@ -339,6 +340,7 @@ async def create_async( :returns: The created AuthorizationDocumentInstance """ + data = values.of( { "AddressSid": address_sid, diff --git a/twilio/rest/numbers/v2/bulk_hosted_number_order.py b/twilio/rest/numbers/v2/bulk_hosted_number_order.py index 57e8723e7d..e45b86854f 100644 --- a/twilio/rest/numbers/v2/bulk_hosted_number_order.py +++ b/twilio/rest/numbers/v2/bulk_hosted_number_order.py @@ -64,7 +64,7 @@ def __init__( self.total_count: Optional[int] = deserialize.integer( payload.get("total_count") ) - self.results: Optional[List[object]] = payload.get("results") + self.results: Optional[List[Dict[str, object]]] = payload.get("results") self._solution = { "bulk_hosting_sid": bulk_hosting_sid or self.bulk_hosting_sid, @@ -214,6 +214,38 @@ def __init__(self, version: Version): """ super().__init__(version) + self._uri = "/HostedNumber/Orders/Bulk" + + def create(self) -> BulkHostedNumberOrderInstance: + """ + Create the BulkHostedNumberOrderInstance + + + :returns: The created BulkHostedNumberOrderInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return BulkHostedNumberOrderInstance(self._version, payload) + + async def create_async(self) -> BulkHostedNumberOrderInstance: + """ + Asynchronously create the BulkHostedNumberOrderInstance + + + :returns: The created BulkHostedNumberOrderInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return BulkHostedNumberOrderInstance(self._version, payload) + def get(self, bulk_hosting_sid: str) -> BulkHostedNumberOrderContext: """ Constructs a BulkHostedNumberOrderContext diff --git a/twilio/rest/numbers/v2/hosted_number_order.py b/twilio/rest/numbers/v2/hosted_number_order.py index 813b9b4826..81cd7e451b 100644 --- a/twilio/rest/numbers/v2/hosted_number_order.py +++ b/twilio/rest/numbers/v2/hosted_number_order.py @@ -315,6 +315,7 @@ def create( :returns: The created HostedNumberOrderInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -385,6 +386,7 @@ async def create_async( :returns: The created HostedNumberOrderInstance """ + data = values.of( { "PhoneNumber": phone_number, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py index ff7b1d7c01..1f1224fb2a 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py @@ -499,6 +499,7 @@ def create( :returns: The created BundleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -542,6 +543,7 @@ async def create_async( :returns: The created BundleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -573,8 +575,6 @@ def stream( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[BundleInstance]: @@ -593,8 +593,6 @@ def stream( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -615,8 +613,6 @@ def stream( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, - valid_until_date_before=valid_until_date_before, - valid_until_date_after=valid_until_date_after, page_size=limits["page_size"], ) @@ -633,8 +629,6 @@ async def stream_async( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[BundleInstance]: @@ -653,8 +647,6 @@ async def stream_async( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -675,8 +667,6 @@ async def stream_async( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, - valid_until_date_before=valid_until_date_before, - valid_until_date_after=valid_until_date_after, page_size=limits["page_size"], ) @@ -693,8 +683,6 @@ def list( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[BundleInstance]: @@ -712,8 +700,6 @@ def list( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -734,8 +720,6 @@ def list( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, - valid_until_date_before=valid_until_date_before, - valid_until_date_after=valid_until_date_after, limit=limit, page_size=page_size, ) @@ -752,8 +736,6 @@ async def list_async( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[BundleInstance]: @@ -771,8 +753,6 @@ async def list_async( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -794,8 +774,6 @@ async def list_async( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, - valid_until_date_before=valid_until_date_before, - valid_until_date_after=valid_until_date_after, limit=limit, page_size=page_size, ) @@ -812,8 +790,6 @@ def page( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -831,8 +807,6 @@ def page( :param sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -850,8 +824,6 @@ def page( "SortBy": sort_by, "SortDirection": sort_direction, "ValidUntilDate": serialize.iso8601_datetime(valid_until_date), - "ValidUntilDate<": serialize.iso8601_datetime(valid_until_date_before), - "ValidUntilDate>": serialize.iso8601_datetime(valid_until_date_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -872,8 +844,6 @@ async def page_async( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -891,8 +861,6 @@ async def page_async( :param sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -910,8 +878,6 @@ async def page_async( "SortBy": sort_by, "SortDirection": sort_direction, "ValidUntilDate": serialize.iso8601_datetime(valid_until_date), - "ValidUntilDate<": serialize.iso8601_datetime(valid_until_date_before), - "ValidUntilDate>": serialize.iso8601_datetime(valid_until_date_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py index 5a0cf036b9..eb88f7c9bf 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py @@ -128,6 +128,7 @@ def create( :returns: The created BundleCopyInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -154,6 +155,7 @@ async def create_async( :returns: The created BundleCopyInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py index 53ad9d7694..e4c74ec92a 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py @@ -53,7 +53,7 @@ def __init__( self.regulation_sid: Optional[str] = payload.get("regulation_sid") self.bundle_sid: Optional[str] = payload.get("bundle_sid") self.status: Optional["EvaluationInstance.Status"] = payload.get("status") - self.results: Optional[List[object]] = payload.get("results") + self.results: Optional[List[Dict[str, object]]] = payload.get("results") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) 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 f5f36206bf..4d2998ff64 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py @@ -263,6 +263,7 @@ def create(self, object_sid: str) -> ItemAssignmentInstance: :returns: The created ItemAssignmentInstance """ + data = values.of( { "ObjectSid": object_sid, @@ -287,6 +288,7 @@ async def create_async(self, object_sid: str) -> ItemAssignmentInstance: :returns: The created ItemAssignmentInstance """ + data = values.of( { "ObjectSid": object_sid, 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 e8ab99ad71..91d5f18a12 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py @@ -105,6 +105,7 @@ def create(self, from_bundle_sid: str) -> ReplaceItemsInstance: :returns: The created ReplaceItemsInstance """ + data = values.of( { "FromBundleSid": from_bundle_sid, @@ -129,6 +130,7 @@ async def create_async(self, from_bundle_sid: str) -> ReplaceItemsInstance: :returns: The created ReplaceItemsInstance """ + data = values.of( { "FromBundleSid": from_bundle_sid, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/end_user.py b/twilio/rest/numbers/v2/regulatory_compliance/end_user.py index f9bc9d270f..b717cd420e 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/end_user.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/end_user.py @@ -348,6 +348,7 @@ def create( :returns: The created EndUserInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -379,6 +380,7 @@ async def create_async( :returns: The created EndUserInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py b/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py index 0a762cea38..e114558132 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py @@ -40,7 +40,7 @@ def __init__( self.sid: Optional[str] = payload.get("sid") self.friendly_name: Optional[str] = payload.get("friendly_name") self.machine_name: Optional[str] = payload.get("machine_name") - self.fields: Optional[List[object]] = payload.get("fields") + self.fields: Optional[List[Dict[str, object]]] = payload.get("fields") self.url: Optional[str] = payload.get("url") self._solution = { diff --git a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py index e619ecdc26..6a4636198b 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py @@ -366,6 +366,7 @@ def create( :returns: The created SupportingDocumentInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -397,6 +398,7 @@ async def create_async( :returns: The created SupportingDocumentInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py index 65c097b994..811ae1d83e 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py @@ -40,7 +40,7 @@ def __init__( self.sid: Optional[str] = payload.get("sid") self.friendly_name: Optional[str] = payload.get("friendly_name") self.machine_name: Optional[str] = payload.get("machine_name") - self.fields: Optional[List[object]] = payload.get("fields") + self.fields: Optional[List[Dict[str, object]]] = payload.get("fields") self.url: Optional[str] = payload.get("url") self._solution = { diff --git a/twilio/rest/preview/deployed_devices/fleet/__init__.py b/twilio/rest/preview/deployed_devices/fleet/__init__.py index cb0c45498a..b943e670cc 100644 --- a/twilio/rest/preview/deployed_devices/fleet/__init__.py +++ b/twilio/rest/preview/deployed_devices/fleet/__init__.py @@ -427,6 +427,7 @@ def create(self, friendly_name: Union[str, object] = values.unset) -> FleetInsta :returns: The created FleetInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -451,6 +452,7 @@ async def create_async( :returns: The created FleetInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/preview/deployed_devices/fleet/certificate.py b/twilio/rest/preview/deployed_devices/fleet/certificate.py index a6654de67e..f0304d709f 100644 --- a/twilio/rest/preview/deployed_devices/fleet/certificate.py +++ b/twilio/rest/preview/deployed_devices/fleet/certificate.py @@ -374,6 +374,7 @@ def create( :returns: The created CertificateInstance """ + data = values.of( { "CertificateData": certificate_data, @@ -407,6 +408,7 @@ async def create_async( :returns: The created CertificateInstance """ + data = values.of( { "CertificateData": certificate_data, diff --git a/twilio/rest/preview/deployed_devices/fleet/deployment.py b/twilio/rest/preview/deployed_devices/fleet/deployment.py index 5dbda65c66..91272fc308 100644 --- a/twilio/rest/preview/deployed_devices/fleet/deployment.py +++ b/twilio/rest/preview/deployed_devices/fleet/deployment.py @@ -370,6 +370,7 @@ def create( :returns: The created DeploymentInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -400,6 +401,7 @@ async def create_async( :returns: The created DeploymentInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/preview/deployed_devices/fleet/device.py b/twilio/rest/preview/deployed_devices/fleet/device.py index afaa0fce2a..1a992941a2 100644 --- a/twilio/rest/preview/deployed_devices/fleet/device.py +++ b/twilio/rest/preview/deployed_devices/fleet/device.py @@ -410,6 +410,7 @@ def create( :returns: The created DeviceInstance """ + data = values.of( { "UniqueName": unique_name, @@ -449,6 +450,7 @@ async def create_async( :returns: The created DeviceInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/preview/deployed_devices/fleet/key.py b/twilio/rest/preview/deployed_devices/fleet/key.py index 9bcfd8fb0f..e98d8dd696 100644 --- a/twilio/rest/preview/deployed_devices/fleet/key.py +++ b/twilio/rest/preview/deployed_devices/fleet/key.py @@ -372,6 +372,7 @@ def create( :returns: The created KeyInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -402,6 +403,7 @@ async def create_async( :returns: The created KeyInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py index 1cab771279..5ea74ff51e 100644 --- a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py +++ b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py @@ -417,6 +417,7 @@ def create( :returns: The created AuthorizationDocumentInstance """ + data = values.of( { "HostedNumberOrderSids": serialize.map( @@ -459,6 +460,7 @@ async def create_async( :returns: The created AuthorizationDocumentInstance """ + data = values.of( { "HostedNumberOrderSids": serialize.map( diff --git a/twilio/rest/preview/hosted_numbers/hosted_number_order.py b/twilio/rest/preview/hosted_numbers/hosted_number_order.py index 3927202489..8a50a45374 100644 --- a/twilio/rest/preview/hosted_numbers/hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/hosted_number_order.py @@ -543,6 +543,7 @@ def create( :returns: The created HostedNumberOrderInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -618,6 +619,7 @@ async def create_async( :returns: The created HostedNumberOrderInstance """ + data = values.of( { "PhoneNumber": phone_number, diff --git a/twilio/rest/preview/marketplace/installed_add_on/__init__.py b/twilio/rest/preview/marketplace/installed_add_on/__init__.py index 87d0926728..e9a7e8cd7d 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/installed_add_on/__init__.py @@ -375,6 +375,7 @@ def create( :returns: The created InstalledAddOnInstance """ + data = values.of( { "AvailableAddOnSid": available_add_on_sid, @@ -409,6 +410,7 @@ async def create_async( :returns: The created InstalledAddOnInstance """ + data = values.of( { "AvailableAddOnSid": available_add_on_sid, diff --git a/twilio/rest/preview/sync/service/__init__.py b/twilio/rest/preview/sync/service/__init__.py index c9f33d19bf..b3a962fa6f 100644 --- a/twilio/rest/preview/sync/service/__init__.py +++ b/twilio/rest/preview/sync/service/__init__.py @@ -441,6 +441,7 @@ def create( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -475,6 +476,7 @@ async def create_async( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/preview/sync/service/document/__init__.py b/twilio/rest/preview/sync/service/document/__init__.py index ebd08889f9..660aee9b18 100644 --- a/twilio/rest/preview/sync/service/document/__init__.py +++ b/twilio/rest/preview/sync/service/document/__init__.py @@ -397,6 +397,7 @@ def create( :returns: The created DocumentInstance """ + data = values.of( { "UniqueName": unique_name, @@ -427,6 +428,7 @@ async def create_async( :returns: The created DocumentInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/preview/sync/service/sync_list/__init__.py b/twilio/rest/preview/sync/service/sync_list/__init__.py index d3cd34c547..7dfc743963 100644 --- a/twilio/rest/preview/sync/service/sync_list/__init__.py +++ b/twilio/rest/preview/sync/service/sync_list/__init__.py @@ -316,6 +316,7 @@ def create( :returns: The created SyncListInstance """ + data = values.of( { "UniqueName": unique_name, @@ -342,6 +343,7 @@ async def create_async( :returns: The created SyncListInstance """ + data = values.of( { "UniqueName": unique_name, 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 592f84a3c4..d795075fea 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 @@ -406,6 +406,7 @@ def create(self, data: object) -> SyncListItemInstance: :returns: The created SyncListItemInstance """ + data = values.of( { "Data": serialize.object(data), @@ -433,6 +434,7 @@ async def create_async(self, data: object) -> SyncListItemInstance: :returns: The created SyncListItemInstance """ + data = values.of( { "Data": serialize.object(data), diff --git a/twilio/rest/preview/sync/service/sync_map/__init__.py b/twilio/rest/preview/sync/service/sync_map/__init__.py index 47235fd80c..cc5907cf80 100644 --- a/twilio/rest/preview/sync/service/sync_map/__init__.py +++ b/twilio/rest/preview/sync/service/sync_map/__init__.py @@ -314,6 +314,7 @@ def create(self, unique_name: Union[str, object] = values.unset) -> SyncMapInsta :returns: The created SyncMapInstance """ + data = values.of( { "UniqueName": unique_name, @@ -340,6 +341,7 @@ async def create_async( :returns: The created SyncMapInstance """ + data = values.of( { "UniqueName": unique_name, 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 ef42e77d38..20240d1ef9 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 @@ -407,6 +407,7 @@ def create(self, key: str, data: object) -> SyncMapItemInstance: :returns: The created SyncMapItemInstance """ + data = values.of( { "Key": key, @@ -436,6 +437,7 @@ async def create_async(self, key: str, data: object) -> SyncMapItemInstance: :returns: The created SyncMapItemInstance """ + data = values.of( { "Key": key, diff --git a/twilio/rest/preview/understand/assistant/__init__.py b/twilio/rest/preview/understand/assistant/__init__.py index 27970ca4da..9f50e5fff7 100644 --- a/twilio/rest/preview/understand/assistant/__init__.py +++ b/twilio/rest/preview/understand/assistant/__init__.py @@ -612,6 +612,7 @@ def create( :returns: The created AssistantInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -658,6 +659,7 @@ async def create_async( :returns: The created AssistantInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/preview/understand/assistant/field_type/__init__.py b/twilio/rest/preview/understand/assistant/field_type/__init__.py index 0deb38faf1..28cec5ac89 100644 --- a/twilio/rest/preview/understand/assistant/field_type/__init__.py +++ b/twilio/rest/preview/understand/assistant/field_type/__init__.py @@ -397,6 +397,7 @@ def create( :returns: The created FieldTypeInstance """ + data = values.of( { "UniqueName": unique_name, @@ -425,6 +426,7 @@ async def create_async( :returns: The created FieldTypeInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/preview/understand/assistant/field_type/field_value.py b/twilio/rest/preview/understand/assistant/field_type/field_value.py index 87fb7df94b..71bf01bf50 100644 --- a/twilio/rest/preview/understand/assistant/field_type/field_value.py +++ b/twilio/rest/preview/understand/assistant/field_type/field_value.py @@ -289,6 +289,7 @@ def create( :returns: The created FieldValueInstance """ + data = values.of( { "Language": language, @@ -322,6 +323,7 @@ async def create_async( :returns: The created FieldValueInstance """ + data = values.of( { "Language": language, diff --git a/twilio/rest/preview/understand/assistant/model_build.py b/twilio/rest/preview/understand/assistant/model_build.py index 8b45b76dc0..bc30ebdd29 100644 --- a/twilio/rest/preview/understand/assistant/model_build.py +++ b/twilio/rest/preview/understand/assistant/model_build.py @@ -368,6 +368,7 @@ def create( :returns: The created ModelBuildInstance """ + data = values.of( { "StatusCallback": status_callback, @@ -398,6 +399,7 @@ async def create_async( :returns: The created ModelBuildInstance """ + data = values.of( { "StatusCallback": status_callback, diff --git a/twilio/rest/preview/understand/assistant/query.py b/twilio/rest/preview/understand/assistant/query.py index 62fb2e3e11..116c425ffa 100644 --- a/twilio/rest/preview/understand/assistant/query.py +++ b/twilio/rest/preview/understand/assistant/query.py @@ -386,6 +386,7 @@ def create( :returns: The created QueryInstance """ + data = values.of( { "Language": language, @@ -425,6 +426,7 @@ async def create_async( :returns: The created QueryInstance """ + data = values.of( { "Language": language, diff --git a/twilio/rest/preview/understand/assistant/task/__init__.py b/twilio/rest/preview/understand/assistant/task/__init__.py index 135a421ec6..26fa1f74ec 100644 --- a/twilio/rest/preview/understand/assistant/task/__init__.py +++ b/twilio/rest/preview/understand/assistant/task/__init__.py @@ -493,6 +493,7 @@ def create( :returns: The created TaskInstance """ + data = values.of( { "UniqueName": unique_name, @@ -529,6 +530,7 @@ async def create_async( :returns: The created TaskInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/preview/understand/assistant/task/field.py b/twilio/rest/preview/understand/assistant/task/field.py index e8f4aa3a8c..c1f97b6175 100644 --- a/twilio/rest/preview/understand/assistant/task/field.py +++ b/twilio/rest/preview/understand/assistant/task/field.py @@ -282,6 +282,7 @@ def create(self, field_type: str, unique_name: str) -> FieldInstance: :returns: The created FieldInstance """ + data = values.of( { "FieldType": field_type, @@ -311,6 +312,7 @@ async def create_async(self, field_type: str, unique_name: str) -> FieldInstance :returns: The created FieldInstance """ + data = values.of( { "FieldType": field_type, diff --git a/twilio/rest/preview/understand/assistant/task/sample.py b/twilio/rest/preview/understand/assistant/task/sample.py index ef8719c6ac..ba8addfaa2 100644 --- a/twilio/rest/preview/understand/assistant/task/sample.py +++ b/twilio/rest/preview/understand/assistant/task/sample.py @@ -406,6 +406,7 @@ def create( :returns: The created SampleInstance """ + data = values.of( { "Language": language, @@ -442,6 +443,7 @@ async def create_async( :returns: The created SampleInstance """ + data = values.of( { "Language": language, diff --git a/twilio/rest/preview/wireless/command.py b/twilio/rest/preview/wireless/command.py index 4f3e4603af..b8cc4d6a02 100644 --- a/twilio/rest/preview/wireless/command.py +++ b/twilio/rest/preview/wireless/command.py @@ -225,6 +225,7 @@ def create( :returns: The created CommandInstance """ + data = values.of( { "Command": command, @@ -268,6 +269,7 @@ async def create_async( :returns: The created CommandInstance """ + data = values.of( { "Command": command, diff --git a/twilio/rest/preview/wireless/rate_plan.py b/twilio/rest/preview/wireless/rate_plan.py index 04b16f5b38..08ace21fb0 100644 --- a/twilio/rest/preview/wireless/rate_plan.py +++ b/twilio/rest/preview/wireless/rate_plan.py @@ -375,6 +375,7 @@ def create( :returns: The created RatePlanInstance """ + data = values.of( { "UniqueName": unique_name, @@ -429,6 +430,7 @@ async def create_async( :returns: The created RatePlanInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/preview_messaging/PreviewMessagingBase.py b/twilio/rest/preview_messaging/PreviewMessagingBase.py index 3b03fb7c0e..1bd182d820 100644 --- a/twilio/rest/preview_messaging/PreviewMessagingBase.py +++ b/twilio/rest/preview_messaging/PreviewMessagingBase.py @@ -19,9 +19,9 @@ class PreviewMessagingBase(Domain): def __init__(self, twilio: Client): """ - Initialize the Preview Messaging Domain + Initialize the PreviewMessaging Domain - :returns: Domain for Preview Messaging + :returns: Domain for PreviewMessaging """ super().__init__(twilio, "https://preview.messaging.twilio.com") self._v1: Optional[V1] = None @@ -29,7 +29,7 @@ def __init__(self, twilio: Client): @property def v1(self) -> V1: """ - :returns: Versions v1 of Preview Messaging + :returns: Versions v1 of PreviewMessaging """ if self._v1 is None: self._v1 = V1(self) diff --git a/twilio/rest/preview_messaging/v1/message.py b/twilio/rest/preview_messaging/v1/message.py index 2d83b93382..2cce21f8e9 100644 --- a/twilio/rest/preview_messaging/v1/message.py +++ b/twilio/rest/preview_messaging/v1/message.py @@ -81,7 +81,7 @@ class CreateMessagesRequest(object): """ def __init__(self, payload: Dict[str, Any]): - self.messages: Optional[MessageList.MessagingV1Message] = payload.get( + self.messages: Optional[List[MessageList.MessagingV1Message]] = payload.get( "messages" ) self.from_: Optional[str] = payload.get("from_") @@ -90,7 +90,7 @@ def __init__(self, payload: Dict[str, Any]): ) self.body: Optional[str] = payload.get("body") self.content_sid: Optional[str] = payload.get("content_sid") - self.media_url: Optional[str] = payload.get("media_url") + self.media_url: Optional[List[str]] = payload.get("media_url") self.status_callback: Optional[str] = payload.get("status_callback") self.validity_period: Optional[int] = payload.get("validity_period") self.send_at: Optional[str] = payload.get("send_at") @@ -124,25 +124,6 @@ def to_dict(self): "application_sid": self.application_sid, } - class MessagingV1FailedMessageReceipt(object): - """ - :ivar to: The recipient phone number - :ivar error_message: The description of the error_code - :ivar error_code: The error code associated with the message creation attempt - """ - - def __init__(self, payload: Dict[str, Any]): - self.to: Optional[str] = payload.get("to") - self.error_message: Optional[str] = payload.get("error_message") - self.error_code: Optional[int] = payload.get("error_code") - - def to_dict(self): - return { - "to": self.to, - "error_message": self.error_message, - "error_code": self.error_code, - } - class MessagingV1Message(object): """ :ivar to: The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format for SMS/MMS or [Channel user address](https://www.twilio.com/docs/sms/channels#channel-addresses) for other 3rd-party channels. @@ -164,22 +145,6 @@ def to_dict(self): "content_variables": self.content_variables, } - class MessagingV1MessageReceipt(object): - """ - :ivar to: The recipient phone number - :ivar sid: The unique string that identifies the resource - """ - - def __init__(self, payload: Dict[str, Any]): - self.to: Optional[str] = payload.get("to") - self.sid: Optional[str] = payload.get("sid") - - def to_dict(self): - return { - "to": self.to, - "sid": self.sid, - } - def __init__(self, version: Version): """ Initialize the MessageList diff --git a/twilio/rest/proxy/v1/service/__init__.py b/twilio/rest/proxy/v1/service/__init__.py index ec886ad2bb..0cd90e817e 100644 --- a/twilio/rest/proxy/v1/service/__init__.py +++ b/twilio/rest/proxy/v1/service/__init__.py @@ -532,6 +532,7 @@ def create( :returns: The created ServiceInstance """ + data = values.of( { "UniqueName": unique_name, @@ -580,6 +581,7 @@ async def create_async( :returns: The created ServiceInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/proxy/v1/service/phone_number.py b/twilio/rest/proxy/v1/service/phone_number.py index fc8c514f13..ec0af3dde9 100644 --- a/twilio/rest/proxy/v1/service/phone_number.py +++ b/twilio/rest/proxy/v1/service/phone_number.py @@ -366,6 +366,7 @@ def create( :returns: The created PhoneNumberInstance """ + data = values.of( { "Sid": sid, @@ -399,6 +400,7 @@ async def create_async( :returns: The created PhoneNumberInstance """ + data = values.of( { "Sid": sid, diff --git a/twilio/rest/proxy/v1/service/session/__init__.py b/twilio/rest/proxy/v1/service/session/__init__.py index 7ce76fcab5..1c9dc055a9 100644 --- a/twilio/rest/proxy/v1/service/session/__init__.py +++ b/twilio/rest/proxy/v1/service/session/__init__.py @@ -470,6 +470,7 @@ def create( :returns: The created SessionInstance """ + data = values.of( { "UniqueName": unique_name, @@ -514,6 +515,7 @@ async def create_async( :returns: The created SessionInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/proxy/v1/service/session/participant/__init__.py b/twilio/rest/proxy/v1/service/session/participant/__init__.py index ce3c16abd0..a14b19a95b 100644 --- a/twilio/rest/proxy/v1/service/session/participant/__init__.py +++ b/twilio/rest/proxy/v1/service/session/participant/__init__.py @@ -330,6 +330,7 @@ def create( :returns: The created ParticipantInstance """ + data = values.of( { "Identifier": identifier, @@ -369,6 +370,7 @@ async def create_async( :returns: The created ParticipantInstance """ + data = values.of( { "Identifier": identifier, 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 b07b1782fa..d2b60ce95c 100644 --- a/twilio/rest/proxy/v1/service/session/participant/message_interaction.py +++ b/twilio/rest/proxy/v1/service/session/participant/message_interaction.py @@ -322,6 +322,7 @@ def create( :returns: The created MessageInteractionInstance """ + data = values.of( { "Body": body, @@ -356,6 +357,7 @@ async def create_async( :returns: The created MessageInteractionInstance """ + data = values.of( { "Body": body, diff --git a/twilio/rest/proxy/v1/service/short_code.py b/twilio/rest/proxy/v1/service/short_code.py index f440a944ee..ccda96db4e 100644 --- a/twilio/rest/proxy/v1/service/short_code.py +++ b/twilio/rest/proxy/v1/service/short_code.py @@ -353,6 +353,7 @@ def create(self, sid: str) -> ShortCodeInstance: :returns: The created ShortCodeInstance """ + data = values.of( { "Sid": sid, @@ -377,6 +378,7 @@ async def create_async(self, sid: str) -> ShortCodeInstance: :returns: The created ShortCodeInstance """ + data = values.of( { "Sid": sid, diff --git a/twilio/rest/serverless/v1/service/__init__.py b/twilio/rest/serverless/v1/service/__init__.py index 146827d812..ab58c0eb8d 100644 --- a/twilio/rest/serverless/v1/service/__init__.py +++ b/twilio/rest/serverless/v1/service/__init__.py @@ -450,6 +450,7 @@ def create( :returns: The created ServiceInstance """ + data = values.of( { "UniqueName": unique_name, @@ -484,6 +485,7 @@ async def create_async( :returns: The created ServiceInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/serverless/v1/service/asset/__init__.py b/twilio/rest/serverless/v1/service/asset/__init__.py index 7b70adf1c4..38f3598109 100644 --- a/twilio/rest/serverless/v1/service/asset/__init__.py +++ b/twilio/rest/serverless/v1/service/asset/__init__.py @@ -364,6 +364,7 @@ def create(self, friendly_name: str) -> AssetInstance: :returns: The created AssetInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -388,6 +389,7 @@ async def create_async(self, friendly_name: str) -> AssetInstance: :returns: The created AssetInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/serverless/v1/service/build/__init__.py b/twilio/rest/serverless/v1/service/build/__init__.py index e5dbe3f9ef..25997bec2e 100644 --- a/twilio/rest/serverless/v1/service/build/__init__.py +++ b/twilio/rest/serverless/v1/service/build/__init__.py @@ -62,9 +62,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], service_sid: str, self.account_sid: Optional[str] = payload.get("account_sid") self.service_sid: Optional[str] = payload.get("service_sid") self.status: Optional["BuildInstance.Status"] = payload.get("status") - self.asset_versions: Optional[List[object]] = payload.get("asset_versions") - self.function_versions: Optional[List[object]] = payload.get("function_versions") - self.dependencies: Optional[List[object]] = payload.get("dependencies") + self.asset_versions: Optional[List[Dict[str, object]]] = payload.get("asset_versions") + self.function_versions: Optional[List[Dict[str, object]]] = payload.get("function_versions") + self.dependencies: Optional[List[Dict[str, object]]] = payload.get("dependencies") self.runtime: Optional["BuildInstance.Runtime"] = payload.get("runtime") self.date_created: Optional[datetime] = deserialize.iso8601_datetime(payload.get("date_created")) self.date_updated: Optional[datetime] = deserialize.iso8601_datetime(payload.get("date_updated")) @@ -275,7 +275,7 @@ def __repr__(self) -> str: class BuildList(ListResource): - + def __init__(self, version: Version, service_sid: str): """ Initialize the BuildList @@ -306,6 +306,7 @@ def create(self, asset_versions: Union[List[str], object]=values.unset, function :returns: The created BuildInstance """ + data = values.of({ 'AssetVersions': serialize.map(asset_versions, lambda e: e), 'FunctionVersions': serialize.map(function_versions, lambda e: e), @@ -329,6 +330,7 @@ async def create_async(self, asset_versions: Union[List[str], object]=values.uns :returns: The created BuildInstance """ + data = values.of({ 'AssetVersions': serialize.map(asset_versions, lambda e: e), 'FunctionVersions': serialize.map(function_versions, lambda e: e), diff --git a/twilio/rest/serverless/v1/service/build/build_status.py b/twilio/rest/serverless/v1/service/build/build_status.py index c127f89a4f..2613ae3cb6 100644 --- a/twilio/rest/serverless/v1/service/build/build_status.py +++ b/twilio/rest/serverless/v1/service/build/build_status.py @@ -164,7 +164,7 @@ def __repr__(self) -> str: class BuildStatusList(ListResource): - + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the BuildStatusList diff --git a/twilio/rest/serverless/v1/service/environment/__init__.py b/twilio/rest/serverless/v1/service/environment/__init__.py index dac46b9744..235c77739f 100644 --- a/twilio/rest/serverless/v1/service/environment/__init__.py +++ b/twilio/rest/serverless/v1/service/environment/__init__.py @@ -341,6 +341,7 @@ def create( :returns: The created EnvironmentInstance """ + data = values.of( { "UniqueName": unique_name, @@ -369,6 +370,7 @@ async def create_async( :returns: The created EnvironmentInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/serverless/v1/service/environment/deployment.py b/twilio/rest/serverless/v1/service/environment/deployment.py index f0f6b50037..6667bd891c 100644 --- a/twilio/rest/serverless/v1/service/environment/deployment.py +++ b/twilio/rest/serverless/v1/service/environment/deployment.py @@ -243,6 +243,7 @@ def create( :returns: The created DeploymentInstance """ + data = values.of( { "BuildSid": build_sid, @@ -272,6 +273,7 @@ async def create_async( :returns: The created DeploymentInstance """ + data = values.of( { "BuildSid": build_sid, diff --git a/twilio/rest/serverless/v1/service/environment/variable.py b/twilio/rest/serverless/v1/service/environment/variable.py index b619e3a655..b64484f57f 100644 --- a/twilio/rest/serverless/v1/service/environment/variable.py +++ b/twilio/rest/serverless/v1/service/environment/variable.py @@ -390,6 +390,7 @@ def create(self, key: str, value: str) -> VariableInstance: :returns: The created VariableInstance """ + data = values.of( { "Key": key, @@ -419,6 +420,7 @@ async def create_async(self, key: str, value: str) -> VariableInstance: :returns: The created VariableInstance """ + data = values.of( { "Key": key, diff --git a/twilio/rest/serverless/v1/service/function/__init__.py b/twilio/rest/serverless/v1/service/function/__init__.py index 3f2919316d..7b9718e246 100644 --- a/twilio/rest/serverless/v1/service/function/__init__.py +++ b/twilio/rest/serverless/v1/service/function/__init__.py @@ -366,6 +366,7 @@ def create(self, friendly_name: str) -> FunctionInstance: :returns: The created FunctionInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -390,6 +391,7 @@ async def create_async(self, friendly_name: str) -> FunctionInstance: :returns: The created FunctionInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/studio/v1/flow/engagement/__init__.py b/twilio/rest/studio/v1/flow/engagement/__init__.py index e0f56dbaf7..8271fa2c96 100644 --- a/twilio/rest/studio/v1/flow/engagement/__init__.py +++ b/twilio/rest/studio/v1/flow/engagement/__init__.py @@ -325,6 +325,7 @@ def create( :returns: The created EngagementInstance """ + data = values.of( { "To": to, @@ -355,6 +356,7 @@ async def create_async( :returns: The created EngagementInstance """ + data = values.of( { "To": to, diff --git a/twilio/rest/studio/v1/flow/execution/__init__.py b/twilio/rest/studio/v1/flow/execution/__init__.py index d0ad05b67a..c4cfd09c49 100644 --- a/twilio/rest/studio/v1/flow/execution/__init__.py +++ b/twilio/rest/studio/v1/flow/execution/__init__.py @@ -405,6 +405,7 @@ def create( :returns: The created ExecutionInstance """ + data = values.of( { "To": to, @@ -435,6 +436,7 @@ async def create_async( :returns: The created ExecutionInstance """ + data = values.of( { "To": to, diff --git a/twilio/rest/studio/v2/flow/__init__.py b/twilio/rest/studio/v2/flow/__init__.py index 408e29cc7b..dafec94320 100644 --- a/twilio/rest/studio/v2/flow/__init__.py +++ b/twilio/rest/studio/v2/flow/__init__.py @@ -62,8 +62,8 @@ def __init__( self.revision: Optional[int] = deserialize.integer(payload.get("revision")) self.commit_message: Optional[str] = payload.get("commit_message") self.valid: Optional[bool] = payload.get("valid") - self.errors: Optional[List[object]] = payload.get("errors") - self.warnings: Optional[List[object]] = payload.get("warnings") + self.errors: Optional[List[Dict[str, object]]] = payload.get("errors") + self.warnings: Optional[List[Dict[str, object]]] = payload.get("warnings") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) @@ -452,6 +452,7 @@ def create( :returns: The created FlowInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -486,6 +487,7 @@ async def create_async( :returns: The created FlowInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/studio/v2/flow/execution/__init__.py b/twilio/rest/studio/v2/flow/execution/__init__.py index 1173683525..de539fa596 100644 --- a/twilio/rest/studio/v2/flow/execution/__init__.py +++ b/twilio/rest/studio/v2/flow/execution/__init__.py @@ -403,6 +403,7 @@ def create( :returns: The created ExecutionInstance """ + data = values.of( { "To": to, @@ -433,6 +434,7 @@ async def create_async( :returns: The created ExecutionInstance """ + data = values.of( { "To": to, diff --git a/twilio/rest/studio/v2/flow/flow_revision.py b/twilio/rest/studio/v2/flow/flow_revision.py index a9a5394a4f..64c50b0a3d 100644 --- a/twilio/rest/studio/v2/flow/flow_revision.py +++ b/twilio/rest/studio/v2/flow/flow_revision.py @@ -60,7 +60,7 @@ def __init__( self.revision: Optional[int] = deserialize.integer(payload.get("revision")) self.commit_message: Optional[str] = payload.get("commit_message") self.valid: Optional[bool] = payload.get("valid") - self.errors: Optional[List[object]] = payload.get("errors") + self.errors: Optional[List[Dict[str, object]]] = payload.get("errors") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) diff --git a/twilio/rest/supersim/v1/esim_profile.py b/twilio/rest/supersim/v1/esim_profile.py index 082441dda9..fedd2e1741 100644 --- a/twilio/rest/supersim/v1/esim_profile.py +++ b/twilio/rest/supersim/v1/esim_profile.py @@ -36,7 +36,7 @@ class Status(object): :ivar sid: The unique string that we created to identify the eSIM Profile resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the eSIM Profile resource belongs. :ivar iccid: The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with the Sim resource. - :ivar sim_sid: The SID of the [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource that this eSIM Profile controls. + :ivar sim_sid: The SID of the [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource that this eSIM Profile controls. :ivar status: :ivar eid: Identifier of the eUICC that can claim the eSIM Profile. :ivar smdp_plus_address: Address of the SM-DP+ server from which the Profile will be downloaded. The URL will appear once the eSIM Profile reaches the status `available`. @@ -232,6 +232,7 @@ def create( :returns: The created EsimProfileInstance """ + data = values.of( { "CallbackUrl": callback_url, @@ -266,6 +267,7 @@ async def create_async( :returns: The created EsimProfileInstance """ + data = values.of( { "CallbackUrl": callback_url, @@ -298,7 +300,7 @@ def stream( The results are returned as a generator, so this operation is memory efficient. :param str eid: List the eSIM Profiles that have been associated with an EId. - :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param "EsimProfileInstance.Status" status: List the eSIM Profiles that are in a given status. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @@ -331,7 +333,7 @@ async def stream_async( The results are returned as a generator, so this operation is memory efficient. :param str eid: List the eSIM Profiles that have been associated with an EId. - :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param "EsimProfileInstance.Status" status: List the eSIM Profiles that are in a given status. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @@ -363,7 +365,7 @@ def list( memory before returning. :param str eid: List the eSIM Profiles that have been associated with an EId. - :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param "EsimProfileInstance.Status" status: List the eSIM Profiles that are in a given status. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit @@ -398,7 +400,7 @@ async def list_async( memory before returning. :param str eid: List the eSIM Profiles that have been associated with an EId. - :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param "EsimProfileInstance.Status" status: List the eSIM Profiles that are in a given status. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit @@ -434,7 +436,7 @@ def page( Request is executed immediately :param eid: List the eSIM Profiles that have been associated with an EId. - :param sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param status: List the eSIM Profiles that are in a given status. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state @@ -470,7 +472,7 @@ async def page_async( Request is executed immediately :param eid: List the eSIM Profiles that have been associated with an EId. - :param sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param status: List the eSIM Profiles that are in a given status. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state diff --git a/twilio/rest/supersim/v1/fleet.py b/twilio/rest/supersim/v1/fleet.py index 0017ff4e92..e09ea796fc 100644 --- a/twilio/rest/supersim/v1/fleet.py +++ b/twilio/rest/supersim/v1/fleet.py @@ -395,6 +395,7 @@ def create( :returns: The created FleetInstance """ + data = values.of( { "NetworkAccessProfile": network_access_profile, @@ -444,6 +445,7 @@ async def create_async( :returns: The created FleetInstance """ + data = values.of( { "NetworkAccessProfile": network_access_profile, diff --git a/twilio/rest/supersim/v1/ip_command.py b/twilio/rest/supersim/v1/ip_command.py index 98e6e2a0a5..fd49bd8a83 100644 --- a/twilio/rest/supersim/v1/ip_command.py +++ b/twilio/rest/supersim/v1/ip_command.py @@ -246,6 +246,7 @@ def create( :returns: The created IpCommandInstance """ + data = values.of( { "Sim": sim, @@ -286,6 +287,7 @@ async def create_async( :returns: The created IpCommandInstance """ + data = values.of( { "Sim": sim, diff --git a/twilio/rest/supersim/v1/network.py b/twilio/rest/supersim/v1/network.py index 7364105c88..a526c8dfbc 100644 --- a/twilio/rest/supersim/v1/network.py +++ b/twilio/rest/supersim/v1/network.py @@ -41,7 +41,7 @@ def __init__( self.friendly_name: Optional[str] = payload.get("friendly_name") self.url: Optional[str] = payload.get("url") self.iso_country: Optional[str] = payload.get("iso_country") - self.identifiers: Optional[List[object]] = payload.get("identifiers") + self.identifiers: Optional[List[Dict[str, object]]] = payload.get("identifiers") self._solution = { "sid": sid or self.sid, diff --git a/twilio/rest/supersim/v1/network_access_profile/__init__.py b/twilio/rest/supersim/v1/network_access_profile/__init__.py index 0712dbe653..3e2b65d9c5 100644 --- a/twilio/rest/supersim/v1/network_access_profile/__init__.py +++ b/twilio/rest/supersim/v1/network_access_profile/__init__.py @@ -311,6 +311,7 @@ def create( :returns: The created NetworkAccessProfileInstance """ + data = values.of( { "UniqueName": unique_name, @@ -339,6 +340,7 @@ async def create_async( :returns: The created NetworkAccessProfileInstance """ + data = values.of( { "UniqueName": unique_name, 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 065418f39d..a6ef54e514 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 @@ -48,7 +48,7 @@ def __init__( ) self.friendly_name: Optional[str] = payload.get("friendly_name") self.iso_country: Optional[str] = payload.get("iso_country") - self.identifiers: Optional[List[object]] = payload.get("identifiers") + self.identifiers: Optional[List[Dict[str, object]]] = payload.get("identifiers") self.url: Optional[str] = payload.get("url") self._solution = { @@ -272,6 +272,7 @@ def create(self, network: str) -> NetworkAccessProfileNetworkInstance: :returns: The created NetworkAccessProfileNetworkInstance """ + data = values.of( { "Network": network, @@ -298,6 +299,7 @@ async def create_async(self, network: str) -> NetworkAccessProfileNetworkInstanc :returns: The created NetworkAccessProfileNetworkInstance """ + data = values.of( { "Network": network, diff --git a/twilio/rest/supersim/v1/settings_update.py b/twilio/rest/supersim/v1/settings_update.py index d9b00143ad..75a58a1967 100644 --- a/twilio/rest/supersim/v1/settings_update.py +++ b/twilio/rest/supersim/v1/settings_update.py @@ -48,7 +48,7 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.iccid: Optional[str] = payload.get("iccid") self.sim_sid: Optional[str] = payload.get("sim_sid") self.status: Optional["SettingsUpdateInstance.Status"] = payload.get("status") - self.packages: Optional[List[object]] = payload.get("packages") + self.packages: Optional[List[Dict[str, object]]] = payload.get("packages") self.date_completed: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_completed") ) diff --git a/twilio/rest/supersim/v1/sim/__init__.py b/twilio/rest/supersim/v1/sim/__init__.py index fae9427497..7b2636869b 100644 --- a/twilio/rest/supersim/v1/sim/__init__.py +++ b/twilio/rest/supersim/v1/sim/__init__.py @@ -403,6 +403,7 @@ def create(self, iccid: str, registration_code: str) -> SimInstance: :returns: The created SimInstance """ + data = values.of( { "Iccid": iccid, @@ -427,6 +428,7 @@ async def create_async(self, iccid: str, registration_code: str) -> SimInstance: :returns: The created SimInstance """ + data = values.of( { "Iccid": iccid, diff --git a/twilio/rest/supersim/v1/sms_command.py b/twilio/rest/supersim/v1/sms_command.py index 83601dd7ce..9e68e71b76 100644 --- a/twilio/rest/supersim/v1/sms_command.py +++ b/twilio/rest/supersim/v1/sms_command.py @@ -227,6 +227,7 @@ def create( :returns: The created SmsCommandInstance """ + data = values.of( { "Sim": sim, @@ -261,6 +262,7 @@ async def create_async( :returns: The created SmsCommandInstance """ + data = values.of( { "Sim": sim, diff --git a/twilio/rest/sync/v1/service/__init__.py b/twilio/rest/sync/v1/service/__init__.py index 7db062b90d..8e640535da 100644 --- a/twilio/rest/sync/v1/service/__init__.py +++ b/twilio/rest/sync/v1/service/__init__.py @@ -518,6 +518,7 @@ def create( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -561,6 +562,7 @@ async def create_async( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/sync/v1/service/document/__init__.py b/twilio/rest/sync/v1/service/document/__init__.py index 5689594a8a..847dbccb34 100644 --- a/twilio/rest/sync/v1/service/document/__init__.py +++ b/twilio/rest/sync/v1/service/document/__init__.py @@ -423,6 +423,7 @@ def create( :returns: The created DocumentInstance """ + data = values.of( { "UniqueName": unique_name, @@ -456,6 +457,7 @@ async def create_async( :returns: The created DocumentInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/sync/v1/service/sync_list/__init__.py b/twilio/rest/sync/v1/service/sync_list/__init__.py index 545ebee389..9606162600 100644 --- a/twilio/rest/sync/v1/service/sync_list/__init__.py +++ b/twilio/rest/sync/v1/service/sync_list/__init__.py @@ -427,6 +427,7 @@ def create( :returns: The created SyncListInstance """ + data = values.of( { "UniqueName": unique_name, @@ -460,6 +461,7 @@ async def create_async( :returns: The created SyncListInstance """ + data = values.of( { "UniqueName": unique_name, 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 640b4c38ce..0959b0e516 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 @@ -463,6 +463,7 @@ def create( :returns: The created SyncListItemInstance """ + data = values.of( { "Data": serialize.object(data), @@ -502,6 +503,7 @@ async def create_async( :returns: The created SyncListItemInstance """ + data = values.of( { "Data": serialize.object(data), diff --git a/twilio/rest/sync/v1/service/sync_map/__init__.py b/twilio/rest/sync/v1/service/sync_map/__init__.py index 5b38378f2b..9f034f5583 100644 --- a/twilio/rest/sync/v1/service/sync_map/__init__.py +++ b/twilio/rest/sync/v1/service/sync_map/__init__.py @@ -427,6 +427,7 @@ def create( :returns: The created SyncMapInstance """ + data = values.of( { "UniqueName": unique_name, @@ -460,6 +461,7 @@ async def create_async( :returns: The created SyncMapInstance """ + data = values.of( { "UniqueName": unique_name, 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 ef290caab2..e3a7f321b0 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 @@ -465,6 +465,7 @@ def create( :returns: The created SyncMapItemInstance """ + data = values.of( { "Key": key, @@ -507,6 +508,7 @@ async def create_async( :returns: The created SyncMapItemInstance """ + data = values.of( { "Key": key, diff --git a/twilio/rest/sync/v1/service/sync_stream/__init__.py b/twilio/rest/sync/v1/service/sync_stream/__init__.py index 59507674dd..584783c98a 100644 --- a/twilio/rest/sync/v1/service/sync_stream/__init__.py +++ b/twilio/rest/sync/v1/service/sync_stream/__init__.py @@ -379,6 +379,7 @@ def create( :returns: The created SyncStreamInstance """ + data = values.of( { "UniqueName": unique_name, @@ -409,6 +410,7 @@ async def create_async( :returns: The created SyncStreamInstance """ + data = values.of( { "UniqueName": unique_name, 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 5227bb076b..eb9ac365bf 100644 --- a/twilio/rest/sync/v1/service/sync_stream/stream_message.py +++ b/twilio/rest/sync/v1/service/sync_stream/stream_message.py @@ -84,6 +84,7 @@ def create(self, data: object) -> StreamMessageInstance: :returns: The created StreamMessageInstance """ + data = values.of( { "Data": serialize.object(data), @@ -111,6 +112,7 @@ async def create_async(self, data: object) -> StreamMessageInstance: :returns: The created StreamMessageInstance """ + data = values.of( { "Data": serialize.object(data), diff --git a/twilio/rest/taskrouter/v1/workspace/__init__.py b/twilio/rest/taskrouter/v1/workspace/__init__.py index 886ba65c93..479abeaa8a 100644 --- a/twilio/rest/taskrouter/v1/workspace/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/__init__.py @@ -657,6 +657,7 @@ def create( :returns: The created WorkspaceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -699,6 +700,7 @@ async def create_async( :returns: The created WorkspaceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/taskrouter/v1/workspace/activity.py b/twilio/rest/taskrouter/v1/workspace/activity.py index b233113d33..91a18c7822 100644 --- a/twilio/rest/taskrouter/v1/workspace/activity.py +++ b/twilio/rest/taskrouter/v1/workspace/activity.py @@ -356,6 +356,7 @@ def create( :returns: The created ActivityInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -384,6 +385,7 @@ async def create_async( :returns: The created ActivityInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index 2687a2de3b..f62da1759f 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -528,6 +528,7 @@ def create( :returns: The created TaskInstance """ + data = values.of( { "Timeout": timeout, @@ -570,6 +571,7 @@ async def create_async( :returns: The created TaskInstance """ + data = values.of( { "Timeout": timeout, diff --git a/twilio/rest/taskrouter/v1/workspace/task/reservation.py b/twilio/rest/taskrouter/v1/workspace/task/reservation.py index af50984004..32e7c6b4da 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/task/reservation.py @@ -200,7 +200,6 @@ def update( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, - jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Update the ReservationInstance @@ -259,7 +258,6 @@ def update( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. - :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -318,7 +316,6 @@ def update( supervisor=supervisor, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, - jitter_buffer_size=jitter_buffer_size, ) async def update_async( @@ -383,7 +380,6 @@ async def update_async( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, - jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Asynchronous coroutine to update the ReservationInstance @@ -442,7 +438,6 @@ async def update_async( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. - :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -501,7 +496,6 @@ async def update_async( supervisor=supervisor, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, - jitter_buffer_size=jitter_buffer_size, ) def __repr__(self) -> str: @@ -642,7 +636,6 @@ def update( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, - jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Update the ReservationInstance @@ -701,7 +694,6 @@ def update( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. - :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -766,7 +758,6 @@ def update( "Supervisor": supervisor, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, - "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( @@ -849,7 +840,6 @@ async def update_async( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, - jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Asynchronous coroutine to update the ReservationInstance @@ -908,7 +898,6 @@ async def update_async( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. - :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -973,7 +962,6 @@ async def update_async( "Supervisor": supervisor, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, - "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( diff --git a/twilio/rest/taskrouter/v1/workspace/task_channel.py b/twilio/rest/taskrouter/v1/workspace/task_channel.py index d6408dcd74..5744a3cba4 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/task_channel.py @@ -380,6 +380,7 @@ def create( :returns: The created TaskChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -413,6 +414,7 @@ async def create_async( :returns: The created TaskChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py index cc523c8514..82aaee6990 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py @@ -21,6 +21,9 @@ from twilio.base.list_resource import ListResource from twilio.base.version import Version from twilio.base.page import Page +from twilio.rest.taskrouter.v1.workspace.task_queue.task_queue_bulk_real_time_statistics import ( + TaskQueueBulkRealTimeStatisticsList, +) from twilio.rest.taskrouter.v1.workspace.task_queue.task_queue_cumulative_statistics import ( TaskQueueCumulativeStatisticsList, ) @@ -512,6 +515,9 @@ def __init__(self, version: Version, workspace_sid: str): } self._uri = "/Workspaces/{workspace_sid}/TaskQueues".format(**self._solution) + self._bulk_real_time_statistics: Optional[ + TaskQueueBulkRealTimeStatisticsList + ] = None self._statistics: Optional[TaskQueuesStatisticsList] = None def create( @@ -535,6 +541,7 @@ def create( :returns: The created TaskQueueInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -577,6 +584,7 @@ async def create_async( :returns: The created TaskQueueInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -857,6 +865,17 @@ async def get_page_async(self, target_url: str) -> TaskQueuePage: response = await self._version.domain.twilio.request_async("GET", target_url) return TaskQueuePage(self._version, response, self._solution) + @property + def bulk_real_time_statistics(self) -> TaskQueueBulkRealTimeStatisticsList: + """ + Access the bulk_real_time_statistics + """ + if self._bulk_real_time_statistics is None: + self._bulk_real_time_statistics = TaskQueueBulkRealTimeStatisticsList( + self._version, workspace_sid=self._solution["workspace_sid"] + ) + return self._bulk_real_time_statistics + @property def statistics(self) -> TaskQueuesStatisticsList: """ diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py new file mode 100644 index 0000000000..eb8748e095 --- /dev/null +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py @@ -0,0 +1,124 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Taskrouter + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + + +from typing import Any, Dict, List, Optional +from twilio.base import deserialize + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class TaskQueueBulkRealTimeStatisticsInstance(InstanceResource): + + """ + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. + :ivar workspace_sid: The SID of the Workspace that contains the TaskQueue. + :ivar task_queue_data: The real time statistics for each requested TaskQueue SID. `task_queue_data` returns the following attributes: `task_queue_sid`: The SID of the TaskQueue from which these statistics were calculated. `total_available_workers`: The total number of Workers available for Tasks in the TaskQueue. `total_eligible_workers`: The total number of Workers eligible for Tasks in the TaskQueue, regardless of their Activity state. `total_tasks`: The total number of Tasks. `longest_task_waiting_age`: The age of the longest waiting Task. `longest_task_waiting_sid`: The SID of the longest waiting Task. `tasks_by_status`: The number of Tasks grouped by their current status. `tasks_by_priority`: The number of Tasks grouped by priority. `activity_statistics`: The number of current Workers grouped by Activity. + :ivar task_queue_response_count: The number of TaskQueue statistics received in task_queue_data. + :ivar url: The absolute URL of the TaskQueue statistics resource. + """ + + def __init__(self, version: Version, payload: Dict[str, Any], workspace_sid: str): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.workspace_sid: Optional[str] = payload.get("workspace_sid") + self.task_queue_data: Optional[List[Dict[str, object]]] = payload.get( + "task_queue_data" + ) + self.task_queue_response_count: Optional[int] = deserialize.integer( + payload.get("task_queue_response_count") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "workspace_sid": workspace_sid, + } + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return ( + "".format( + context + ) + ) + + +class TaskQueueBulkRealTimeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): + """ + Initialize the TaskQueueBulkRealTimeStatisticsList + + :param version: Version that contains the resource + :param workspace_sid: The unique SID identifier of the Workspace. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "workspace_sid": workspace_sid, + } + self._uri = "/Workspaces/{workspace_sid}/TaskQueues/RealTimeStatistics".format( + **self._solution + ) + + def create(self) -> TaskQueueBulkRealTimeStatisticsInstance: + """ + Create the TaskQueueBulkRealTimeStatisticsInstance + + + :returns: The created TaskQueueBulkRealTimeStatisticsInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return TaskQueueBulkRealTimeStatisticsInstance( + self._version, payload, workspace_sid=self._solution["workspace_sid"] + ) + + async def create_async(self) -> TaskQueueBulkRealTimeStatisticsInstance: + """ + Asynchronously create the TaskQueueBulkRealTimeStatisticsInstance + + + :returns: The created TaskQueueBulkRealTimeStatisticsInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return TaskQueueBulkRealTimeStatisticsInstance( + self._version, payload, workspace_sid=self._solution["workspace_sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py index d588f99d4d..1fc18c16f1 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py @@ -50,7 +50,7 @@ def __init__( super().__init__(version) self.account_sid: Optional[str] = payload.get("account_sid") - self.activity_statistics: Optional[List[object]] = payload.get( + self.activity_statistics: Optional[List[Dict[str, object]]] = payload.get( "activity_statistics" ) self.longest_task_waiting_age: Optional[int] = deserialize.integer( diff --git a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py index 104731aeda..5eecad38ba 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py @@ -522,6 +522,7 @@ def create( :returns: The created WorkerInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -555,6 +556,7 @@ async def create_async( :returns: The created WorkerInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py index 24727b114d..e99705d669 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py @@ -191,7 +191,6 @@ def update( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, - jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Update the ReservationInstance @@ -248,7 +247,6 @@ def update( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. - :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -305,7 +303,6 @@ def update( post_work_activity_sid=post_work_activity_sid, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, - jitter_buffer_size=jitter_buffer_size, ) async def update_async( @@ -366,7 +363,6 @@ async def update_async( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, - jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Asynchronous coroutine to update the ReservationInstance @@ -423,7 +419,6 @@ async def update_async( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. - :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -480,7 +475,6 @@ async def update_async( post_work_activity_sid=post_work_activity_sid, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, - jitter_buffer_size=jitter_buffer_size, ) def __repr__(self) -> str: @@ -615,7 +609,6 @@ def update( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, - jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Update the ReservationInstance @@ -672,7 +665,6 @@ def update( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. - :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -735,7 +727,6 @@ def update( "PostWorkActivitySid": post_work_activity_sid, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, - "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( @@ -814,7 +805,6 @@ async def update_async( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, - jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Asynchronous coroutine to update the ReservationInstance @@ -871,7 +861,6 @@ async def update_async( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. - :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -934,7 +923,6 @@ async def update_async( "PostWorkActivitySid": post_work_activity_sid, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, - "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py index 14310b05bb..dad1f6ff26 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py @@ -49,7 +49,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], workspace_sid: str self.end_time: Optional[datetime] = deserialize.iso8601_datetime( payload.get("end_time") ) - self.activity_durations: Optional[List[object]] = payload.get( + self.activity_durations: Optional[List[Dict[str, object]]] = payload.get( "activity_durations" ) self.reservations_created: Optional[int] = deserialize.integer( diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py index c59611dcfa..8047c65ad8 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py @@ -35,7 +35,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], workspace_sid: str super().__init__(version) self.account_sid: Optional[str] = payload.get("account_sid") - self.activity_statistics: Optional[List[object]] = payload.get( + self.activity_statistics: Optional[List[Dict[str, object]]] = payload.get( "activity_statistics" ) self.total_workers: Optional[int] = deserialize.integer( diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py index 04cbba20b7..dff4bd0ba8 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py @@ -515,6 +515,7 @@ def create( :returns: The created WorkflowInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -554,6 +555,7 @@ async def create_async( :returns: The created WorkflowInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py index d69600d7f2..8571bf3e05 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py @@ -40,7 +40,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], workspace_sid: str super().__init__(version) self.account_sid: Optional[str] = payload.get("account_sid") - self.activity_statistics: Optional[List[object]] = payload.get( + self.activity_statistics: Optional[List[Dict[str, object]]] = payload.get( "activity_statistics" ) self.longest_task_waiting_age: Optional[int] = deserialize.integer( diff --git a/twilio/rest/trunking/v1/trunk/__init__.py b/twilio/rest/trunking/v1/trunk/__init__.py index e7a0aa5cfd..4b1b8c7937 100644 --- a/twilio/rest/trunking/v1/trunk/__init__.py +++ b/twilio/rest/trunking/v1/trunk/__init__.py @@ -575,6 +575,7 @@ def create( :returns: The created TrunkInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -623,6 +624,7 @@ async def create_async( :returns: The created TrunkInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/trunking/v1/trunk/credential_list.py b/twilio/rest/trunking/v1/trunk/credential_list.py index 805d66260d..3caf6e5423 100644 --- a/twilio/rest/trunking/v1/trunk/credential_list.py +++ b/twilio/rest/trunking/v1/trunk/credential_list.py @@ -261,6 +261,7 @@ def create(self, credential_list_sid: str) -> CredentialListInstance: :returns: The created CredentialListInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, @@ -285,6 +286,7 @@ async def create_async(self, credential_list_sid: str) -> CredentialListInstance :returns: The created CredentialListInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, 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 e528e0b1c3..38d6e4f03e 100644 --- a/twilio/rest/trunking/v1/trunk/ip_access_control_list.py +++ b/twilio/rest/trunking/v1/trunk/ip_access_control_list.py @@ -263,6 +263,7 @@ def create(self, ip_access_control_list_sid: str) -> IpAccessControlListInstance :returns: The created IpAccessControlListInstance """ + data = values.of( { "IpAccessControlListSid": ip_access_control_list_sid, @@ -289,6 +290,7 @@ async def create_async( :returns: The created IpAccessControlListInstance """ + data = values.of( { "IpAccessControlListSid": ip_access_control_list_sid, diff --git a/twilio/rest/trunking/v1/trunk/origination_url.py b/twilio/rest/trunking/v1/trunk/origination_url.py index 79dca9387b..2b7f48f436 100644 --- a/twilio/rest/trunking/v1/trunk/origination_url.py +++ b/twilio/rest/trunking/v1/trunk/origination_url.py @@ -418,6 +418,7 @@ def create( :returns: The created OriginationUrlInstance """ + data = values.of( { "Weight": weight, @@ -457,6 +458,7 @@ async def create_async( :returns: The created OriginationUrlInstance """ + data = values.of( { "Weight": weight, diff --git a/twilio/rest/trunking/v1/trunk/phone_number.py b/twilio/rest/trunking/v1/trunk/phone_number.py index 98f53c408f..41b78e4627 100644 --- a/twilio/rest/trunking/v1/trunk/phone_number.py +++ b/twilio/rest/trunking/v1/trunk/phone_number.py @@ -310,6 +310,7 @@ def create(self, phone_number_sid: str) -> PhoneNumberInstance: :returns: The created PhoneNumberInstance """ + data = values.of( { "PhoneNumberSid": phone_number_sid, @@ -334,6 +335,7 @@ async def create_async(self, phone_number_sid: str) -> PhoneNumberInstance: :returns: The created PhoneNumberInstance """ + data = values.of( { "PhoneNumberSid": phone_number_sid, diff --git a/twilio/rest/trusthub/v1/compliance_inquiries.py b/twilio/rest/trusthub/v1/compliance_inquiries.py index c5c88d9155..7a55b1ad7d 100644 --- a/twilio/rest/trusthub/v1/compliance_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_inquiries.py @@ -197,6 +197,7 @@ def create(self, primary_profile_sid: str) -> ComplianceInquiriesInstance: :returns: The created ComplianceInquiriesInstance """ + data = values.of( { "PrimaryProfileSid": primary_profile_sid, @@ -221,6 +222,7 @@ async def create_async( :returns: The created ComplianceInquiriesInstance """ + data = values.of( { "PrimaryProfileSid": primary_profile_sid, diff --git a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py index f2059c4e52..25598554f2 100644 --- a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py @@ -13,8 +13,8 @@ """ -from typing import Any, Dict, List, Optional, Union -from twilio.base import serialize, values +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 @@ -22,12 +22,6 @@ class ComplianceTollfreeInquiriesInstance(InstanceResource): - class OptInType(object): - VERBAL = "VERBAL" - WEB_FORM = "WEB_FORM" - PAPER_FORM = "PAPER_FORM" - VIA_TEXT = "VIA_TEXT" - MOBILE_QR_CODE = "MOBILE_QR_CODE" """ :ivar inquiry_id: The unique ID used to start an embedded compliance registration session. @@ -67,81 +61,21 @@ def __init__(self, version: Version): self._uri = "/ComplianceInquiries/Tollfree/Initialize" def create( - self, - tollfree_phone_number: str, - notification_email: str, - business_name: Union[str, object] = values.unset, - business_website: Union[str, object] = values.unset, - use_case_categories: Union[List[str], object] = values.unset, - use_case_summary: Union[str, object] = values.unset, - production_message_sample: Union[str, object] = values.unset, - opt_in_image_urls: Union[List[str], object] = values.unset, - opt_in_type: Union[ - "ComplianceTollfreeInquiriesInstance.OptInType", object - ] = values.unset, - message_volume: Union[str, object] = values.unset, - business_street_address: Union[str, object] = values.unset, - business_street_address2: Union[str, object] = values.unset, - business_city: Union[str, object] = values.unset, - business_state_province_region: Union[str, object] = values.unset, - business_postal_code: Union[str, object] = values.unset, - business_country: Union[str, object] = values.unset, - additional_information: Union[str, object] = values.unset, - business_contact_first_name: Union[str, object] = values.unset, - business_contact_last_name: Union[str, object] = values.unset, - business_contact_email: Union[str, object] = values.unset, - business_contact_phone: Union[str, object] = values.unset, + self, tollfree_phone_number: str, notification_email: str ) -> ComplianceTollfreeInquiriesInstance: """ Create the ComplianceTollfreeInquiriesInstance :param tollfree_phone_number: The Tollfree phone number to be verified - :param notification_email: The email address to receive the notification about the verification result. - :param business_name: The name of the business or organization using the Tollfree number. - :param business_website: The website of the business or organization using the Tollfree number. - :param use_case_categories: The category of the use case for the Tollfree Number. List as many are applicable.. - :param use_case_summary: Use this to further explain how messaging is used by the business or organization. - :param production_message_sample: An example of message content, i.e. a sample message. - :param opt_in_image_urls: Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. - :param opt_in_type: - :param message_volume: Estimate monthly volume of messages from the Tollfree Number. - :param business_street_address: The address of the business or organization using the Tollfree number. - :param business_street_address2: The address of the business or organization using the Tollfree number. - :param business_city: The city of the business or organization using the Tollfree number. - :param business_state_province_region: The state/province/region of the business or organization using the Tollfree number. - :param business_postal_code: The postal code of the business or organization using the Tollfree number. - :param business_country: The country of the business or organization using the Tollfree number. - :param additional_information: Additional information to be provided for verification. - :param business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. - :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. - :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. - :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :param notification_email: The notification email to be triggered when verification status is changed :returns: The created ComplianceTollfreeInquiriesInstance """ + data = values.of( { "TollfreePhoneNumber": tollfree_phone_number, "NotificationEmail": notification_email, - "BusinessName": business_name, - "BusinessWebsite": business_website, - "UseCaseCategories": serialize.map(use_case_categories, lambda e: e), - "UseCaseSummary": use_case_summary, - "ProductionMessageSample": production_message_sample, - "OptInImageUrls": serialize.map(opt_in_image_urls, lambda e: e), - "OptInType": opt_in_type, - "MessageVolume": message_volume, - "BusinessStreetAddress": business_street_address, - "BusinessStreetAddress2": business_street_address2, - "BusinessCity": business_city, - "BusinessStateProvinceRegion": business_state_province_region, - "BusinessPostalCode": business_postal_code, - "BusinessCountry": business_country, - "AdditionalInformation": additional_information, - "BusinessContactFirstName": business_contact_first_name, - "BusinessContactLastName": business_contact_last_name, - "BusinessContactEmail": business_contact_email, - "BusinessContactPhone": business_contact_phone, } ) @@ -154,81 +88,21 @@ def create( return ComplianceTollfreeInquiriesInstance(self._version, payload) async def create_async( - self, - tollfree_phone_number: str, - notification_email: str, - business_name: Union[str, object] = values.unset, - business_website: Union[str, object] = values.unset, - use_case_categories: Union[List[str], object] = values.unset, - use_case_summary: Union[str, object] = values.unset, - production_message_sample: Union[str, object] = values.unset, - opt_in_image_urls: Union[List[str], object] = values.unset, - opt_in_type: Union[ - "ComplianceTollfreeInquiriesInstance.OptInType", object - ] = values.unset, - message_volume: Union[str, object] = values.unset, - business_street_address: Union[str, object] = values.unset, - business_street_address2: Union[str, object] = values.unset, - business_city: Union[str, object] = values.unset, - business_state_province_region: Union[str, object] = values.unset, - business_postal_code: Union[str, object] = values.unset, - business_country: Union[str, object] = values.unset, - additional_information: Union[str, object] = values.unset, - business_contact_first_name: Union[str, object] = values.unset, - business_contact_last_name: Union[str, object] = values.unset, - business_contact_email: Union[str, object] = values.unset, - business_contact_phone: Union[str, object] = values.unset, + self, tollfree_phone_number: str, notification_email: str ) -> ComplianceTollfreeInquiriesInstance: """ Asynchronously create the ComplianceTollfreeInquiriesInstance :param tollfree_phone_number: The Tollfree phone number to be verified - :param notification_email: The email address to receive the notification about the verification result. - :param business_name: The name of the business or organization using the Tollfree number. - :param business_website: The website of the business or organization using the Tollfree number. - :param use_case_categories: The category of the use case for the Tollfree Number. List as many are applicable.. - :param use_case_summary: Use this to further explain how messaging is used by the business or organization. - :param production_message_sample: An example of message content, i.e. a sample message. - :param opt_in_image_urls: Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. - :param opt_in_type: - :param message_volume: Estimate monthly volume of messages from the Tollfree Number. - :param business_street_address: The address of the business or organization using the Tollfree number. - :param business_street_address2: The address of the business or organization using the Tollfree number. - :param business_city: The city of the business or organization using the Tollfree number. - :param business_state_province_region: The state/province/region of the business or organization using the Tollfree number. - :param business_postal_code: The postal code of the business or organization using the Tollfree number. - :param business_country: The country of the business or organization using the Tollfree number. - :param additional_information: Additional information to be provided for verification. - :param business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. - :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. - :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. - :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :param notification_email: The notification email to be triggered when verification status is changed :returns: The created ComplianceTollfreeInquiriesInstance """ + data = values.of( { "TollfreePhoneNumber": tollfree_phone_number, "NotificationEmail": notification_email, - "BusinessName": business_name, - "BusinessWebsite": business_website, - "UseCaseCategories": serialize.map(use_case_categories, lambda e: e), - "UseCaseSummary": use_case_summary, - "ProductionMessageSample": production_message_sample, - "OptInImageUrls": serialize.map(opt_in_image_urls, lambda e: e), - "OptInType": opt_in_type, - "MessageVolume": message_volume, - "BusinessStreetAddress": business_street_address, - "BusinessStreetAddress2": business_street_address2, - "BusinessCity": business_city, - "BusinessStateProvinceRegion": business_state_province_region, - "BusinessPostalCode": business_postal_code, - "BusinessCountry": business_country, - "AdditionalInformation": additional_information, - "BusinessContactFirstName": business_contact_first_name, - "BusinessContactLastName": business_contact_last_name, - "BusinessContactEmail": business_contact_email, - "BusinessContactPhone": business_contact_phone, } ) diff --git a/twilio/rest/trusthub/v1/customer_profiles/__init__.py b/twilio/rest/trusthub/v1/customer_profiles/__init__.py index a82fafa4da..c1fa25cce5 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/__init__.py +++ b/twilio/rest/trusthub/v1/customer_profiles/__init__.py @@ -479,6 +479,7 @@ def create( :returns: The created CustomerProfilesInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -513,6 +514,7 @@ async def create_async( :returns: The created CustomerProfilesInstance """ + data = values.of( { "FriendlyName": friendly_name, 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 e1905c1ac5..41bc67e834 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 @@ -274,6 +274,7 @@ def create( :returns: The created CustomerProfilesChannelEndpointAssignmentInstance """ + data = values.of( { "ChannelEndpointType": channel_endpoint_type, @@ -304,6 +305,7 @@ async def create_async( :returns: The created CustomerProfilesChannelEndpointAssignmentInstance """ + data = values.of( { "ChannelEndpointType": channel_endpoint_type, 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 c318b539cc..6003f56602 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 @@ -275,6 +275,7 @@ def create(self, object_sid: str) -> CustomerProfilesEntityAssignmentsInstance: :returns: The created CustomerProfilesEntityAssignmentsInstance """ + data = values.of( { "ObjectSid": object_sid, @@ -303,6 +304,7 @@ async def create_async( :returns: The created CustomerProfilesEntityAssignmentsInstance """ + data = values.of( { "ObjectSid": object_sid, 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 c3611f7647..0b5f88b626 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py @@ -55,7 +55,7 @@ def __init__( self.status: Optional[ "CustomerProfilesEvaluationsInstance.Status" ] = payload.get("status") - self.results: Optional[List[object]] = payload.get("results") + self.results: Optional[List[Dict[str, object]]] = payload.get("results") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) @@ -236,6 +236,7 @@ def create(self, policy_sid: str) -> CustomerProfilesEvaluationsInstance: :returns: The created CustomerProfilesEvaluationsInstance """ + data = values.of( { "PolicySid": policy_sid, @@ -264,6 +265,7 @@ async def create_async( :returns: The created CustomerProfilesEvaluationsInstance """ + data = values.of( { "PolicySid": policy_sid, diff --git a/twilio/rest/trusthub/v1/end_user.py b/twilio/rest/trusthub/v1/end_user.py index 05f096b6c3..c72cb6222c 100644 --- a/twilio/rest/trusthub/v1/end_user.py +++ b/twilio/rest/trusthub/v1/end_user.py @@ -345,6 +345,7 @@ def create( :returns: The created EndUserInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -376,6 +377,7 @@ async def create_async( :returns: The created EndUserInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/trusthub/v1/end_user_type.py b/twilio/rest/trusthub/v1/end_user_type.py index 391012e1ac..f3d79d2a60 100644 --- a/twilio/rest/trusthub/v1/end_user_type.py +++ b/twilio/rest/trusthub/v1/end_user_type.py @@ -40,7 +40,7 @@ def __init__( self.sid: Optional[str] = payload.get("sid") self.friendly_name: Optional[str] = payload.get("friendly_name") self.machine_name: Optional[str] = payload.get("machine_name") - self.fields: Optional[List[object]] = payload.get("fields") + self.fields: Optional[List[Dict[str, object]]] = payload.get("fields") self.url: Optional[str] = payload.get("url") self._solution = { diff --git a/twilio/rest/trusthub/v1/supporting_document.py b/twilio/rest/trusthub/v1/supporting_document.py index f1f29a4afa..e532756197 100644 --- a/twilio/rest/trusthub/v1/supporting_document.py +++ b/twilio/rest/trusthub/v1/supporting_document.py @@ -362,6 +362,7 @@ def create( :returns: The created SupportingDocumentInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -393,6 +394,7 @@ async def create_async( :returns: The created SupportingDocumentInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/trusthub/v1/supporting_document_type.py b/twilio/rest/trusthub/v1/supporting_document_type.py index 204c0b53a4..66b05f95f9 100644 --- a/twilio/rest/trusthub/v1/supporting_document_type.py +++ b/twilio/rest/trusthub/v1/supporting_document_type.py @@ -40,7 +40,7 @@ def __init__( self.sid: Optional[str] = payload.get("sid") self.friendly_name: Optional[str] = payload.get("friendly_name") self.machine_name: Optional[str] = payload.get("machine_name") - self.fields: Optional[List[object]] = payload.get("fields") + self.fields: Optional[List[Dict[str, object]]] = payload.get("fields") self.url: Optional[str] = payload.get("url") self._solution = { diff --git a/twilio/rest/trusthub/v1/trust_products/__init__.py b/twilio/rest/trusthub/v1/trust_products/__init__.py index 627cc5a090..21b95d925d 100644 --- a/twilio/rest/trusthub/v1/trust_products/__init__.py +++ b/twilio/rest/trusthub/v1/trust_products/__init__.py @@ -469,6 +469,7 @@ def create( :returns: The created TrustProductsInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -503,6 +504,7 @@ async def create_async( :returns: The created TrustProductsInstance """ + data = values.of( { "FriendlyName": friendly_name, 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 42b5923e6f..5083eb8a35 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 @@ -276,6 +276,7 @@ def create( :returns: The created TrustProductsChannelEndpointAssignmentInstance """ + data = values.of( { "ChannelEndpointType": channel_endpoint_type, @@ -306,6 +307,7 @@ async def create_async( :returns: The created TrustProductsChannelEndpointAssignmentInstance """ + data = values.of( { "ChannelEndpointType": channel_endpoint_type, 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 306f9359b5..bcd907cc25 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 @@ -269,6 +269,7 @@ def create(self, object_sid: str) -> TrustProductsEntityAssignmentsInstance: :returns: The created TrustProductsEntityAssignmentsInstance """ + data = values.of( { "ObjectSid": object_sid, @@ -297,6 +298,7 @@ async def create_async( :returns: The created TrustProductsEntityAssignmentsInstance """ + data = values.of( { "ObjectSid": object_sid, 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 f2d435c1cb..665f5193c4 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py @@ -55,7 +55,7 @@ def __init__( self.status: Optional["TrustProductsEvaluationsInstance.Status"] = payload.get( "status" ) - self.results: Optional[List[object]] = payload.get("results") + self.results: Optional[List[Dict[str, object]]] = payload.get("results") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) @@ -232,6 +232,7 @@ def create(self, policy_sid: str) -> TrustProductsEvaluationsInstance: :returns: The created TrustProductsEvaluationsInstance """ + data = values.of( { "PolicySid": policy_sid, @@ -258,6 +259,7 @@ async def create_async(self, policy_sid: str) -> TrustProductsEvaluationsInstanc :returns: The created TrustProductsEvaluationsInstance """ + data = values.of( { "PolicySid": policy_sid, diff --git a/twilio/rest/verify/v2/safelist.py b/twilio/rest/verify/v2/safelist.py index 45e5b220e1..b0f05c500f 100644 --- a/twilio/rest/verify/v2/safelist.py +++ b/twilio/rest/verify/v2/safelist.py @@ -215,6 +215,7 @@ def create(self, phone_number: str) -> SafelistInstance: :returns: The created SafelistInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -237,6 +238,7 @@ async def create_async(self, phone_number: str) -> SafelistInstance: :returns: The created SafelistInstance """ + data = values.of( { "PhoneNumber": phone_number, diff --git a/twilio/rest/verify/v2/service/__init__.py b/twilio/rest/verify/v2/service/__init__.py index 4e0bfadc35..ae087cb336 100644 --- a/twilio/rest/verify/v2/service/__init__.py +++ b/twilio/rest/verify/v2/service/__init__.py @@ -49,7 +49,6 @@ class ServiceInstance(InstanceResource): :ivar push: Configurations for the Push factors (channel) created under this Service. :ivar totp: Configurations for the TOTP factors (channel) created under this Service. :ivar default_template_sid: - :ivar verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar url: The absolute URL of the resource. @@ -81,9 +80,6 @@ def __init__( self.push: Optional[Dict[str, object]] = payload.get("push") self.totp: Optional[Dict[str, object]] = payload.get("totp") self.default_template_sid: Optional[str] = payload.get("default_template_sid") - self.verify_event_subscription_enabled: Optional[bool] = payload.get( - "verify_event_subscription_enabled" - ) self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) @@ -168,7 +164,6 @@ def update( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, - verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> "ServiceInstance": """ Update the ServiceInstance @@ -190,7 +185,6 @@ def update( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. - :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance """ @@ -212,7 +206,6 @@ def update( totp_code_length=totp_code_length, totp_skew=totp_skew, default_template_sid=default_template_sid, - verify_event_subscription_enabled=verify_event_subscription_enabled, ) async def update_async( @@ -234,7 +227,6 @@ async def update_async( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, - verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> "ServiceInstance": """ Asynchronous coroutine to update the ServiceInstance @@ -256,7 +248,6 @@ async def update_async( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. - :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance """ @@ -278,7 +269,6 @@ async def update_async( totp_code_length=totp_code_length, totp_skew=totp_skew, default_template_sid=default_template_sid, - verify_event_subscription_enabled=verify_event_subscription_enabled, ) @property @@ -445,7 +435,6 @@ def update( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, - verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ Update the ServiceInstance @@ -467,7 +456,6 @@ def update( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. - :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance """ @@ -490,7 +478,6 @@ def update( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, - "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, } ) @@ -521,7 +508,6 @@ async def update_async( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, - verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ Asynchronous coroutine to update the ServiceInstance @@ -543,7 +529,6 @@ async def update_async( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. - :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance """ @@ -566,7 +551,6 @@ async def update_async( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, - "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, } ) @@ -721,7 +705,6 @@ def create( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, - verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ Create the ServiceInstance @@ -743,10 +726,10 @@ def create( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. - :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -766,7 +749,6 @@ def create( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, - "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, } ) @@ -797,7 +779,6 @@ async def create_async( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, - verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ Asynchronously create the ServiceInstance @@ -819,10 +800,10 @@ async def create_async( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. - :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -842,7 +823,6 @@ async def create_async( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, - "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, } ) diff --git a/twilio/rest/verify/v2/service/access_token.py b/twilio/rest/verify/v2/service/access_token.py index 8c1bc46f8f..26aa9d2bf7 100644 --- a/twilio/rest/verify/v2/service/access_token.py +++ b/twilio/rest/verify/v2/service/access_token.py @@ -217,6 +217,7 @@ def create( :returns: The created AccessTokenInstance """ + data = values.of( { "Identity": identity, @@ -253,6 +254,7 @@ async def create_async( :returns: The created AccessTokenInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/verify/v2/service/entity/__init__.py b/twilio/rest/verify/v2/service/entity/__init__.py index 74629d9bb2..93134aaa88 100644 --- a/twilio/rest/verify/v2/service/entity/__init__.py +++ b/twilio/rest/verify/v2/service/entity/__init__.py @@ -332,6 +332,7 @@ def create(self, identity: str) -> EntityInstance: :returns: The created EntityInstance """ + data = values.of( { "Identity": identity, @@ -356,6 +357,7 @@ async def create_async(self, identity: str) -> EntityInstance: :returns: The created EntityInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/verify/v2/service/entity/challenge/__init__.py b/twilio/rest/verify/v2/service/entity/challenge/__init__.py index 65aab902b1..efe274607c 100644 --- a/twilio/rest/verify/v2/service/entity/challenge/__init__.py +++ b/twilio/rest/verify/v2/service/entity/challenge/__init__.py @@ -428,6 +428,7 @@ def create( :returns: The created ChallengeInstance """ + data = values.of( { "FactorSid": factor_sid, @@ -475,6 +476,7 @@ async def create_async( :returns: The created ChallengeInstance """ + data = values.of( { "FactorSid": factor_sid, diff --git a/twilio/rest/verify/v2/service/entity/challenge/notification.py b/twilio/rest/verify/v2/service/entity/challenge/notification.py index a04fea65ed..683415f70e 100644 --- a/twilio/rest/verify/v2/service/entity/challenge/notification.py +++ b/twilio/rest/verify/v2/service/entity/challenge/notification.py @@ -107,6 +107,7 @@ def create(self, ttl: Union[int, object] = values.unset) -> NotificationInstance :returns: The created NotificationInstance """ + data = values.of( { "Ttl": ttl, @@ -137,6 +138,7 @@ async def create_async( :returns: The created NotificationInstance """ + data = values.of( { "Ttl": ttl, diff --git a/twilio/rest/verify/v2/service/entity/new_factor.py b/twilio/rest/verify/v2/service/entity/new_factor.py index 71c793cc65..1c21582278 100644 --- a/twilio/rest/verify/v2/service/entity/new_factor.py +++ b/twilio/rest/verify/v2/service/entity/new_factor.py @@ -161,6 +161,7 @@ def create( :returns: The created NewFactorInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -232,6 +233,7 @@ async def create_async( :returns: The created NewFactorInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/verify/v2/service/messaging_configuration.py b/twilio/rest/verify/v2/service/messaging_configuration.py index 51d170ea41..b96c4db037 100644 --- a/twilio/rest/verify/v2/service/messaging_configuration.py +++ b/twilio/rest/verify/v2/service/messaging_configuration.py @@ -350,6 +350,7 @@ def create( :returns: The created MessagingConfigurationInstance """ + data = values.of( { "Country": country, @@ -378,6 +379,7 @@ async def create_async( :returns: The created MessagingConfigurationInstance """ + data = values.of( { "Country": country, diff --git a/twilio/rest/verify/v2/service/rate_limit/__init__.py b/twilio/rest/verify/v2/service/rate_limit/__init__.py index f411c57e65..cf37fa1e8c 100644 --- a/twilio/rest/verify/v2/service/rate_limit/__init__.py +++ b/twilio/rest/verify/v2/service/rate_limit/__init__.py @@ -377,6 +377,7 @@ def create( :returns: The created RateLimitInstance """ + data = values.of( { "UniqueName": unique_name, @@ -405,6 +406,7 @@ async def create_async( :returns: The created RateLimitInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/verify/v2/service/rate_limit/bucket.py b/twilio/rest/verify/v2/service/rate_limit/bucket.py index a97b1e0171..18ff98acd5 100644 --- a/twilio/rest/verify/v2/service/rate_limit/bucket.py +++ b/twilio/rest/verify/v2/service/rate_limit/bucket.py @@ -392,6 +392,7 @@ def create(self, max: int, interval: int) -> BucketInstance: :returns: The created BucketInstance """ + data = values.of( { "Max": max, @@ -421,6 +422,7 @@ async def create_async(self, max: int, interval: int) -> BucketInstance: :returns: The created BucketInstance """ + data = values.of( { "Max": max, diff --git a/twilio/rest/verify/v2/service/verification.py b/twilio/rest/verify/v2/service/verification.py index 068e392c0f..dc48cd010d 100644 --- a/twilio/rest/verify/v2/service/verification.py +++ b/twilio/rest/verify/v2/service/verification.py @@ -75,7 +75,7 @@ def __init__( self.lookup: Optional[Dict[str, object]] = payload.get("lookup") self.amount: Optional[str] = payload.get("amount") self.payee: Optional[str] = payload.get("payee") - self.send_code_attempts: Optional[List[object]] = payload.get( + self.send_code_attempts: Optional[List[Dict[str, object]]] = payload.get( "send_code_attempts" ) self.date_created: Optional[datetime] = deserialize.iso8601_datetime( @@ -349,6 +349,7 @@ def create( :returns: The created VerificationInstance """ + data = values.of( { "To": to, @@ -424,6 +425,7 @@ async def create_async( :returns: The created VerificationInstance """ + data = values.of( { "To": to, diff --git a/twilio/rest/verify/v2/service/verification_check.py b/twilio/rest/verify/v2/service/verification_check.py index 05a8399f87..b33803854e 100644 --- a/twilio/rest/verify/v2/service/verification_check.py +++ b/twilio/rest/verify/v2/service/verification_check.py @@ -65,7 +65,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], service_sid: str): self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_updated") ) - self.sna_attempts_error_codes: Optional[List[object]] = payload.get( + self.sna_attempts_error_codes: Optional[List[Dict[str, object]]] = payload.get( "sna_attempts_error_codes" ) @@ -119,6 +119,7 @@ def create( :returns: The created VerificationCheckInstance """ + data = values.of( { "Code": code, @@ -158,6 +159,7 @@ async def create_async( :returns: The created VerificationCheckInstance """ + data = values.of( { "Code": code, diff --git a/twilio/rest/verify/v2/service/webhook.py b/twilio/rest/verify/v2/service/webhook.py index c7924db4bf..15dce50aa1 100644 --- a/twilio/rest/verify/v2/service/webhook.py +++ b/twilio/rest/verify/v2/service/webhook.py @@ -433,6 +433,7 @@ def create( :returns: The created WebhookInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -472,6 +473,7 @@ async def create_async( :returns: The created WebhookInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/video/v1/composition.py b/twilio/rest/video/v1/composition.py index 2fead14204..039f55e4a9 100644 --- a/twilio/rest/video/v1/composition.py +++ b/twilio/rest/video/v1/composition.py @@ -309,6 +309,7 @@ def create( :returns: The created CompositionInstance """ + data = values.of( { "RoomSid": room_sid, @@ -360,6 +361,7 @@ async def create_async( :returns: The created CompositionInstance """ + data = values.of( { "RoomSid": room_sid, diff --git a/twilio/rest/video/v1/composition_hook.py b/twilio/rest/video/v1/composition_hook.py index e15c43c4ac..f4cb5c7c74 100644 --- a/twilio/rest/video/v1/composition_hook.py +++ b/twilio/rest/video/v1/composition_hook.py @@ -484,6 +484,7 @@ def create( :returns: The created CompositionHookInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -538,6 +539,7 @@ async def create_async( :returns: The created CompositionHookInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/video/v1/room/__init__.py b/twilio/rest/video/v1/room/__init__.py index bc87b88e28..0310baae1e 100644 --- a/twilio/rest/video/v1/room/__init__.py +++ b/twilio/rest/video/v1/room/__init__.py @@ -431,6 +431,7 @@ def create( :returns: The created RoomInstance """ + data = values.of( { "EnableTurn": enable_turn, @@ -498,6 +499,7 @@ async def create_async( :returns: The created RoomInstance """ + data = values.of( { "EnableTurn": enable_turn, diff --git a/twilio/rest/voice/v1/byoc_trunk.py b/twilio/rest/voice/v1/byoc_trunk.py index 88ed49dcbc..076ea0de6d 100644 --- a/twilio/rest/voice/v1/byoc_trunk.py +++ b/twilio/rest/voice/v1/byoc_trunk.py @@ -471,6 +471,7 @@ def create( :returns: The created ByocTrunkInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -523,6 +524,7 @@ async def create_async( :returns: The created ByocTrunkInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/voice/v1/connection_policy/__init__.py b/twilio/rest/voice/v1/connection_policy/__init__.py index e1c26dc495..fc8269105d 100644 --- a/twilio/rest/voice/v1/connection_policy/__init__.py +++ b/twilio/rest/voice/v1/connection_policy/__init__.py @@ -350,6 +350,7 @@ def create( :returns: The created ConnectionPolicyInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -374,6 +375,7 @@ async def create_async( :returns: The created ConnectionPolicyInstance """ + data = values.of( { "FriendlyName": friendly_name, 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 e617072cb2..0972b680dc 100644 --- a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py +++ b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py @@ -424,6 +424,7 @@ def create( :returns: The created ConnectionPolicyTargetInstance """ + data = values.of( { "Target": target, @@ -465,6 +466,7 @@ async def create_async( :returns: The created ConnectionPolicyTargetInstance """ + data = values.of( { "Target": target, 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 3e4966c72e..4d62c547b0 100644 --- a/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py +++ b/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py @@ -66,6 +66,7 @@ def create(self, update_request: str) -> BulkCountryUpdateInstance: :returns: The created BulkCountryUpdateInstance """ + data = values.of( { "UpdateRequest": update_request, @@ -88,6 +89,7 @@ async def create_async(self, update_request: str) -> BulkCountryUpdateInstance: :returns: The created BulkCountryUpdateInstance """ + data = values.of( { "UpdateRequest": update_request, diff --git a/twilio/rest/voice/v1/ip_record.py b/twilio/rest/voice/v1/ip_record.py index c81322d423..c363dd4790 100644 --- a/twilio/rest/voice/v1/ip_record.py +++ b/twilio/rest/voice/v1/ip_record.py @@ -331,6 +331,7 @@ def create( :returns: The created IpRecordInstance """ + data = values.of( { "IpAddress": ip_address, @@ -362,6 +363,7 @@ async def create_async( :returns: The created IpRecordInstance """ + data = values.of( { "IpAddress": ip_address, diff --git a/twilio/rest/voice/v1/source_ip_mapping.py b/twilio/rest/voice/v1/source_ip_mapping.py index b61bee9cc5..a192d762eb 100644 --- a/twilio/rest/voice/v1/source_ip_mapping.py +++ b/twilio/rest/voice/v1/source_ip_mapping.py @@ -317,6 +317,7 @@ def create( :returns: The created SourceIpMappingInstance """ + data = values.of( { "IpRecordSid": ip_record_sid, @@ -343,6 +344,7 @@ async def create_async( :returns: The created SourceIpMappingInstance """ + data = values.of( { "IpRecordSid": ip_record_sid, diff --git a/twilio/rest/wireless/v1/command.py b/twilio/rest/wireless/v1/command.py index 16d230adbf..0315bf8b5b 100644 --- a/twilio/rest/wireless/v1/command.py +++ b/twilio/rest/wireless/v1/command.py @@ -291,6 +291,7 @@ def create( :returns: The created CommandInstance """ + data = values.of( { "Command": command, @@ -334,6 +335,7 @@ async def create_async( :returns: The created CommandInstance """ + data = values.of( { "Command": command, diff --git a/twilio/rest/wireless/v1/rate_plan.py b/twilio/rest/wireless/v1/rate_plan.py index 469c8997ea..591cdf3182 100644 --- a/twilio/rest/wireless/v1/rate_plan.py +++ b/twilio/rest/wireless/v1/rate_plan.py @@ -385,6 +385,7 @@ def create( :returns: The created RatePlanInstance """ + data = values.of( { "UniqueName": unique_name, @@ -442,6 +443,7 @@ async def create_async( :returns: The created RatePlanInstance """ + data = values.of( { "UniqueName": unique_name, From b1c7bea3bc312edb2e5d66056521caa9fe5f46d0 Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 8 Jan 2024 08:18:35 +0000 Subject: [PATCH 09/13] Release 9.0.0-rc.1 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index a4708e3d57..17471b3a6d 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.0.0-rc.0", + version="9.0.0-rc.1", 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 ed70a4bc1f..77e099505e 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("8", "11", "0") +__version_info__ = ("9", "0", "0-rc.1") __version__ = ".".join(__version_info__) From 1cabad798a456c6577527cd4d80175c532b97d7e Mon Sep 17 00:00:00 2001 From: Shubham Date: Fri, 9 Feb 2024 15:32:33 +0530 Subject: [PATCH 10/13] chore: disables cluster test (#765) * chore: disables cluster test * chore: added make prettier to workflow --- .github/workflows/test-and-deploy.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index e94bc5fd9a..c9d4c023f7 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -33,20 +33,21 @@ jobs: run: | pip install virtualenv --upgrade make install test-install + make prettier - name: Run the tests run: make test-with-coverage - - name: Run Cluster Tests - if: (!github.event.pull_request.head.repo.fork) - env: - TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} - TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}} - TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }} - TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} - TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} - TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }} - run: make cluster-test +# - name: Run Cluster Tests +# if: (!github.event.pull_request.head.repo.fork) +# env: +# TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} +# TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}} +# TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }} +# TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} +# TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} +# TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }} +# run: make cluster-test - name: Verify docs generation run: make docs From 4bd84527c306ce8243ba7f0619ac070360543998 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 9 Feb 2024 11:19:10 +0000 Subject: [PATCH 11/13] [Librarian] Regenerated @ c3db20dd5f24647ef2bd3fb8b955496c59bb22bd d02e25fbcbae2224a4c0e6c23612622c320cce9f --- CHANGES.md | 28 + twilio/rest/__init__.py | 16 +- twilio/rest/accounts/AccountsBase.py | 1 + twilio/rest/accounts/v1/__init__.py | 1 + .../rest/accounts/v1/auth_token_promotion.py | 4 +- .../rest/accounts/v1/credential/__init__.py | 2 +- twilio/rest/accounts/v1/credential/aws.py | 5 +- .../rest/accounts/v1/credential/public_key.py | 5 +- twilio/rest/accounts/v1/safelist.py | 3 +- .../rest/accounts/v1/secondary_auth_token.py | 4 +- twilio/rest/api/ApiBase.py | 1 + twilio/rest/api/v2010/__init__.py | 1 + twilio/rest/api/v2010/account/__init__.py | 5 +- .../api/v2010/account/address/__init__.py | 5 +- .../account/address/dependent_phone_number.py | 4 +- twilio/rest/api/v2010/account/application.py | 5 +- .../v2010/account/authorized_connect_app.py | 20 +- .../__init__.py | 5 +- .../available_phone_number_country/local.py | 4 +- .../machine_to_machine.py | 4 +- .../available_phone_number_country/mobile.py | 4 +- .../national.py | 4 +- .../shared_cost.py | 4 +- .../toll_free.py | 4 +- .../available_phone_number_country/voip.py | 4 +- twilio/rest/api/v2010/account/balance.py | 3 +- .../rest/api/v2010/account/call/__init__.py | 5 +- twilio/rest/api/v2010/account/call/event.py | 4 +- .../rest/api/v2010/account/call/feedback.py | 4 +- .../v2010/account/call/feedback_summary.py | 4 +- .../api/v2010/account/call/notification.py | 5 +- twilio/rest/api/v2010/account/call/payment.py | 4 +- .../rest/api/v2010/account/call/recording.py | 5 +- twilio/rest/api/v2010/account/call/siprec.py | 4 +- twilio/rest/api/v2010/account/call/stream.py | 4 +- .../account/call/user_defined_message.py | 3 +- .../call/user_defined_message_subscription.py | 4 +- .../api/v2010/account/conference/__init__.py | 5 +- .../v2010/account/conference/participant.py | 5 +- .../api/v2010/account/conference/recording.py | 5 +- twilio/rest/api/v2010/account/connect_app.py | 5 +- .../account/incoming_phone_number/__init__.py | 5 +- .../assigned_add_on/__init__.py | 5 +- .../assigned_add_on_extension.py | 5 +- .../account/incoming_phone_number/local.py | 16 +- .../account/incoming_phone_number/mobile.py | 16 +- .../incoming_phone_number/toll_free.py | 22 +- twilio/rest/api/v2010/account/key.py | 5 +- .../api/v2010/account/message/__init__.py | 5 +- .../api/v2010/account/message/feedback.py | 3 +- .../rest/api/v2010/account/message/media.py | 5 +- twilio/rest/api/v2010/account/new_key.py | 3 +- .../rest/api/v2010/account/new_signing_key.py | 3 +- twilio/rest/api/v2010/account/notification.py | 5 +- .../api/v2010/account/outgoing_caller_id.py | 5 +- .../rest/api/v2010/account/queue/__init__.py | 5 +- twilio/rest/api/v2010/account/queue/member.py | 5 +- .../api/v2010/account/recording/__init__.py | 5 +- .../recording/add_on_result/__init__.py | 5 +- .../recording/add_on_result/payload.py | 5 +- .../v2010/account/recording/transcription.py | 5 +- twilio/rest/api/v2010/account/short_code.py | 5 +- twilio/rest/api/v2010/account/signing_key.py | 5 +- twilio/rest/api/v2010/account/sip/__init__.py | 2 +- .../account/sip/credential_list/__init__.py | 5 +- .../account/sip/credential_list/credential.py | 5 +- .../api/v2010/account/sip/domain/__init__.py | 5 +- .../account/sip/domain/auth_types/__init__.py | 2 +- .../auth_types/auth_type_calls/__init__.py | 8 +- .../auth_calls_credential_list_mapping.py | 5 +- ...th_calls_ip_access_control_list_mapping.py | 5 +- .../auth_type_registrations/__init__.py | 2 +- ...h_registrations_credential_list_mapping.py | 5 +- .../sip/domain/credential_list_mapping.py | 5 +- .../domain/ip_access_control_list_mapping.py | 5 +- .../sip/ip_access_control_list/__init__.py | 5 +- .../sip/ip_access_control_list/ip_address.py | 5 +- twilio/rest/api/v2010/account/token.py | 3 +- .../rest/api/v2010/account/transcription.py | 5 +- .../rest/api/v2010/account/usage/__init__.py | 2 +- .../v2010/account/usage/record/__init__.py | 4 +- .../v2010/account/usage/record/all_time.py | 4 +- .../api/v2010/account/usage/record/daily.py | 4 +- .../v2010/account/usage/record/last_month.py | 4 +- .../api/v2010/account/usage/record/monthly.py | 4 +- .../v2010/account/usage/record/this_month.py | 4 +- .../api/v2010/account/usage/record/today.py | 4 +- .../api/v2010/account/usage/record/yearly.py | 4 +- .../v2010/account/usage/record/yesterday.py | 4 +- .../rest/api/v2010/account/usage/trigger.py | 5 +- .../api/v2010/account/validation_request.py | 3 +- twilio/rest/autopilot/AutopilotBase.py | 43 - twilio/rest/autopilot/v1/__init__.py | 50 - .../rest/autopilot/v1/assistant/__init__.py | 881 ----------------- .../rest/autopilot/v1/assistant/defaults.py | 273 ------ .../rest/autopilot/v1/assistant/dialogue.py | 210 ----- .../v1/assistant/field_type/__init__.py | 654 ------------- .../v1/assistant/field_type/field_value.py | 579 ------------ .../autopilot/v1/assistant/model_build.py | 629 ------------- twilio/rest/autopilot/v1/assistant/query.py | 731 -------------- .../autopilot/v1/assistant/style_sheet.py | 273 ------ .../autopilot/v1/assistant/task/__init__.py | 760 --------------- .../rest/autopilot/v1/assistant/task/field.py | 551 ----------- .../autopilot/v1/assistant/task/sample.py | 699 -------------- .../v1/assistant/task/task_actions.py | 301 ------ .../v1/assistant/task/task_statistics.py | 221 ----- twilio/rest/autopilot/v1/assistant/webhook.py | 673 ------------- twilio/rest/autopilot/v1/restore_assistant.py | 136 --- twilio/rest/bulkexports/BulkexportsBase.py | 1 + twilio/rest/bulkexports/v1/__init__.py | 1 + twilio/rest/bulkexports/v1/export/__init__.py | 4 +- twilio/rest/bulkexports/v1/export/day.py | 5 +- .../v1/export/export_custom_job.py | 4 +- twilio/rest/bulkexports/v1/export/job.py | 4 +- .../bulkexports/v1/export_configuration.py | 4 +- twilio/rest/chat/ChatBase.py | 1 + twilio/rest/chat/v1/__init__.py | 1 + twilio/rest/chat/v1/credential.py | 5 +- twilio/rest/chat/v1/service/__init__.py | 5 +- .../rest/chat/v1/service/channel/__init__.py | 5 +- twilio/rest/chat/v1/service/channel/invite.py | 5 +- twilio/rest/chat/v1/service/channel/member.py | 11 +- .../rest/chat/v1/service/channel/message.py | 5 +- twilio/rest/chat/v1/service/role.py | 5 +- twilio/rest/chat/v1/service/user/__init__.py | 5 +- .../rest/chat/v1/service/user/user_channel.py | 4 +- twilio/rest/chat/v2/__init__.py | 1 + twilio/rest/chat/v2/credential.py | 5 +- twilio/rest/chat/v2/service/__init__.py | 5 +- twilio/rest/chat/v2/service/binding.py | 5 +- .../rest/chat/v2/service/channel/__init__.py | 5 +- twilio/rest/chat/v2/service/channel/invite.py | 5 +- twilio/rest/chat/v2/service/channel/member.py | 11 +- .../rest/chat/v2/service/channel/message.py | 5 +- .../rest/chat/v2/service/channel/webhook.py | 5 +- twilio/rest/chat/v2/service/role.py | 5 +- twilio/rest/chat/v2/service/user/__init__.py | 5 +- .../rest/chat/v2/service/user/user_binding.py | 5 +- .../rest/chat/v2/service/user/user_channel.py | 11 +- twilio/rest/chat/v3/__init__.py | 1 + twilio/rest/chat/v3/channel.py | 4 +- twilio/rest/content/ContentBase.py | 1 + twilio/rest/content/v1/__init__.py | 1 + twilio/rest/content/v1/content/__init__.py | 7 +- .../content/v1/content/approval_create.py | 138 +++ .../rest/content/v1/content/approval_fetch.py | 4 +- .../rest/content/v1/content_and_approvals.py | 6 +- twilio/rest/content/v1/legacy_content.py | 6 +- .../rest/conversations/ConversationsBase.py | 1 + twilio/rest/conversations/v1/__init__.py | 1 + .../conversations/v1/address_configuration.py | 5 +- .../v1/configuration/__init__.py | 4 +- .../conversations/v1/configuration/webhook.py | 4 +- .../conversations/v1/conversation/__init__.py | 5 +- .../v1/conversation/message/__init__.py | 11 +- .../conversation/message/delivery_receipt.py | 5 +- .../v1/conversation/participant.py | 5 +- .../conversations/v1/conversation/webhook.py | 5 +- twilio/rest/conversations/v1/credential.py | 5 +- .../v1/participant_conversation.py | 22 +- twilio/rest/conversations/v1/role.py | 5 +- .../rest/conversations/v1/service/__init__.py | 5 +- .../rest/conversations/v1/service/binding.py | 5 +- .../v1/service/configuration/__init__.py | 4 +- .../v1/service/configuration/notification.py | 4 +- .../v1/service/configuration/webhook.py | 4 +- .../v1/service/conversation/__init__.py | 5 +- .../service/conversation/message/__init__.py | 11 +- .../conversation/message/delivery_receipt.py | 5 +- .../v1/service/conversation/participant.py | 5 +- .../v1/service/conversation/webhook.py | 5 +- .../v1/service/participant_conversation.py | 22 +- twilio/rest/conversations/v1/service/role.py | 5 +- .../conversations/v1/service/user/__init__.py | 5 +- .../v1/service/user/user_conversation.py | 11 +- twilio/rest/conversations/v1/user/__init__.py | 5 +- .../v1/user/user_conversation.py | 11 +- twilio/rest/events/EventsBase.py | 1 + twilio/rest/events/v1/__init__.py | 1 + twilio/rest/events/v1/event_type.py | 5 +- twilio/rest/events/v1/schema/__init__.py | 10 +- .../rest/events/v1/schema/schema_version.py | 5 +- twilio/rest/events/v1/sink/__init__.py | 5 +- twilio/rest/events/v1/sink/sink_test.py | 3 +- twilio/rest/events/v1/sink/sink_validate.py | 3 +- .../rest/events/v1/subscription/__init__.py | 5 +- .../v1/subscription/subscribed_event.py | 19 +- twilio/rest/flex_api/FlexApiBase.py | 1 + twilio/rest/flex_api/v1/__init__.py | 31 +- twilio/rest/flex_api/v1/assessments.py | 5 +- twilio/rest/flex_api/v1/channel.py | 5 +- twilio/rest/flex_api/v1/configuration.py | 6 +- twilio/rest/flex_api/v1/flex_flow.py | 11 +- .../v1/insights_assessments_comment.py | 4 +- .../flex_api/v1/insights_conversational_ai.py | 295 ++++++ ...ights_conversational_ai_report_insights.py | 279 ++++++ .../flex_api/v1/insights_conversations.py | 4 +- .../flex_api/v1/insights_questionnaires.py | 5 +- .../v1/insights_questionnaires_category.py | 5 +- .../v1/insights_questionnaires_question.py | 5 +- twilio/rest/flex_api/v1/insights_segments.py | 4 +- twilio/rest/flex_api/v1/insights_session.py | 4 +- .../v1/insights_settings_answer_sets.py | 3 +- .../flex_api/v1/insights_settings_comment.py | 3 +- .../rest/flex_api/v1/insights_user_roles.py | 4 +- .../rest/flex_api/v1/interaction/__init__.py | 4 +- .../interaction_channel/__init__.py | 5 +- .../interaction_channel_invite.py | 4 +- .../interaction_channel_participant.py | 5 +- .../rest/flex_api/v1/provisioning_status.py | 4 +- twilio/rest/flex_api/v1/web_channel.py | 5 +- twilio/rest/flex_api/v2/__init__.py | 1 + twilio/rest/flex_api/v2/web_channels.py | 3 +- twilio/rest/frontline_api/FrontlineApiBase.py | 1 + twilio/rest/frontline_api/v1/__init__.py | 1 + twilio/rest/frontline_api/v1/user.py | 4 +- twilio/rest/insights/InsightsBase.py | 1 + twilio/rest/insights/v1/__init__.py | 1 + twilio/rest/insights/v1/call/__init__.py | 4 +- twilio/rest/insights/v1/call/annotation.py | 10 +- twilio/rest/insights/v1/call/call_summary.py | 10 +- twilio/rest/insights/v1/call/event.py | 4 +- twilio/rest/insights/v1/call/metric.py | 4 +- twilio/rest/insights/v1/call_summaries.py | 10 +- .../rest/insights/v1/conference/__init__.py | 23 +- .../v1/conference/conference_participant.py | 35 +- twilio/rest/insights/v1/room/__init__.py | 5 +- twilio/rest/insights/v1/room/participant.py | 5 +- twilio/rest/insights/v1/setting.py | 4 +- twilio/rest/intelligence/IntelligenceBase.py | 1 + twilio/rest/intelligence/v2/__init__.py | 1 + twilio/rest/intelligence/v2/service.py | 19 +- .../intelligence/v2/transcript/__init__.py | 7 +- .../rest/intelligence/v2/transcript/media.py | 4 +- .../v2/transcript/operator_result.py | 11 +- .../intelligence/v2/transcript/sentence.py | 4 +- twilio/rest/ip_messaging/IpMessagingBase.py | 1 + twilio/rest/ip_messaging/v1/__init__.py | 1 + twilio/rest/ip_messaging/v1/credential.py | 5 +- .../rest/ip_messaging/v1/service/__init__.py | 5 +- .../v1/service/channel/__init__.py | 5 +- .../ip_messaging/v1/service/channel/invite.py | 5 +- .../ip_messaging/v1/service/channel/member.py | 11 +- .../v1/service/channel/message.py | 5 +- twilio/rest/ip_messaging/v1/service/role.py | 5 +- .../ip_messaging/v1/service/user/__init__.py | 5 +- .../v1/service/user/user_channel.py | 4 +- twilio/rest/ip_messaging/v2/__init__.py | 1 + twilio/rest/ip_messaging/v2/credential.py | 5 +- .../rest/ip_messaging/v2/service/__init__.py | 5 +- .../rest/ip_messaging/v2/service/binding.py | 5 +- .../v2/service/channel/__init__.py | 5 +- .../ip_messaging/v2/service/channel/invite.py | 5 +- .../ip_messaging/v2/service/channel/member.py | 11 +- .../v2/service/channel/message.py | 5 +- .../v2/service/channel/webhook.py | 5 +- twilio/rest/ip_messaging/v2/service/role.py | 5 +- .../ip_messaging/v2/service/user/__init__.py | 5 +- .../v2/service/user/user_binding.py | 5 +- .../v2/service/user/user_channel.py | 11 +- twilio/rest/lookups/LookupsBase.py | 1 + twilio/rest/lookups/v1/__init__.py | 1 + twilio/rest/lookups/v1/phone_number.py | 4 +- twilio/rest/lookups/v2/__init__.py | 1 + twilio/rest/lookups/v2/phone_number.py | 4 +- twilio/rest/media/MediaBase.py | 1 + twilio/rest/media/v1/__init__.py | 1 + twilio/rest/media/v1/media_processor.py | 5 +- twilio/rest/media/v1/media_recording.py | 5 +- .../rest/media/v1/player_streamer/__init__.py | 5 +- .../v1/player_streamer/playback_grant.py | 4 +- twilio/rest/messaging/MessagingBase.py | 1 + twilio/rest/messaging/v1/__init__.py | 1 + .../v1/brand_registration/__init__.py | 11 +- .../brand_registration_otp.py | 3 +- .../v1/brand_registration/brand_vetting.py | 11 +- twilio/rest/messaging/v1/deactivations.py | 4 +- twilio/rest/messaging/v1/domain_certs.py | 4 +- twilio/rest/messaging/v1/domain_config.py | 4 +- .../v1/domain_config_messaging_service.py | 4 +- twilio/rest/messaging/v1/external_campaign.py | 3 +- .../v1/linkshortening_messaging_service.py | 4 +- ...ng_messaging_service_domain_association.py | 4 +- twilio/rest/messaging/v1/service/__init__.py | 11 +- .../rest/messaging/v1/service/alpha_sender.py | 5 +- .../messaging/v1/service/channel_sender.py | 5 +- .../rest/messaging/v1/service/phone_number.py | 5 +- .../rest/messaging/v1/service/short_code.py | 5 +- .../messaging/v1/service/us_app_to_person.py | 199 +++- .../v1/service/us_app_to_person_usecase.py | 3 +- .../messaging/v1/tollfree_verification.py | 11 +- twilio/rest/messaging/v1/usecase.py | 3 +- twilio/rest/microvisor/MicrovisorBase.py | 1 + twilio/rest/microvisor/v1/__init__.py | 1 + twilio/rest/microvisor/v1/account_config.py | 5 +- twilio/rest/microvisor/v1/account_secret.py | 5 +- twilio/rest/microvisor/v1/app/__init__.py | 5 +- twilio/rest/microvisor/v1/app/app_manifest.py | 4 +- twilio/rest/microvisor/v1/device/__init__.py | 5 +- .../microvisor/v1/device/device_config.py | 5 +- .../microvisor/v1/device/device_secret.py | 5 +- twilio/rest/monitor/MonitorBase.py | 1 + twilio/rest/monitor/v1/__init__.py | 1 + twilio/rest/monitor/v1/alert.py | 5 +- twilio/rest/monitor/v1/event.py | 5 +- twilio/rest/notify/NotifyBase.py | 1 + twilio/rest/notify/v1/__init__.py | 1 + twilio/rest/notify/v1/credential.py | 5 +- twilio/rest/notify/v1/service/__init__.py | 19 +- twilio/rest/notify/v1/service/binding.py | 5 +- twilio/rest/notify/v1/service/notification.py | 7 +- twilio/rest/numbers/NumbersBase.py | 1 + twilio/rest/numbers/v1/__init__.py | 9 + twilio/rest/numbers/v1/bulk_eligibility.py | 4 +- twilio/rest/numbers/v1/eligibility.py | 3 +- .../numbers/v1/porting_bulk_portability.py | 4 +- twilio/rest/numbers/v1/porting_port_in.py | 5 +- .../rest/numbers/v1/porting_port_in_fetch.py | 219 +++++ twilio/rest/numbers/v1/porting_portability.py | 10 +- twilio/rest/numbers/v2/__init__.py | 1 + .../v2/authorization_document/__init__.py | 5 +- .../dependent_hosted_number_order.py | 10 +- .../numbers/v2/bulk_hosted_number_order.py | 10 +- twilio/rest/numbers/v2/hosted_number_order.py | 5 +- .../v2/regulatory_compliance/__init__.py | 2 +- .../regulatory_compliance/bundle/__init__.py | 5 +- .../bundle/bundle_copy.py | 4 +- .../bundle/evaluation.py | 5 +- .../bundle/item_assignment.py | 5 +- .../bundle/replace_items.py | 3 +- .../v2/regulatory_compliance/end_user.py | 5 +- .../v2/regulatory_compliance/end_user_type.py | 5 +- .../v2/regulatory_compliance/regulation.py | 5 +- .../supporting_document.py | 5 +- .../supporting_document_type.py | 5 +- twilio/rest/preview/PreviewBase.py | 12 +- .../rest/preview/deployed_devices/__init__.py | 1 + .../deployed_devices/fleet/__init__.py | 5 +- .../deployed_devices/fleet/certificate.py | 5 +- .../deployed_devices/fleet/deployment.py | 5 +- .../preview/deployed_devices/fleet/device.py | 5 +- .../preview/deployed_devices/fleet/key.py | 5 +- .../rest/preview/hosted_numbers/__init__.py | 1 + .../authorization_document/__init__.py | 5 +- .../dependent_hosted_number_order.py | 10 +- .../hosted_numbers/hosted_number_order.py | 5 +- twilio/rest/preview/marketplace/__init__.py | 1 + .../marketplace/available_add_on/__init__.py | 5 +- .../available_add_on_extension.py | 5 +- .../marketplace/installed_add_on/__init__.py | 5 +- .../installed_add_on_extension.py | 5 +- twilio/rest/preview/sync/__init__.py | 1 + twilio/rest/preview/sync/service/__init__.py | 5 +- .../preview/sync/service/document/__init__.py | 5 +- .../service/document/document_permission.py | 5 +- .../sync/service/sync_list/__init__.py | 5 +- .../sync/service/sync_list/sync_list_item.py | 5 +- .../service/sync_list/sync_list_permission.py | 5 +- .../preview/sync/service/sync_map/__init__.py | 5 +- .../sync/service/sync_map/sync_map_item.py | 5 +- .../service/sync_map/sync_map_permission.py | 5 +- twilio/rest/preview/understand/__init__.py | 42 - .../preview/understand/assistant/__init__.py | 889 ------------------ .../assistant/assistant_fallback_actions.py | 279 ------ .../assistant/assistant_initiation_actions.py | 283 ------ .../preview/understand/assistant/dialogue.py | 210 ----- .../assistant/field_type/__init__.py | 656 ------------- .../assistant/field_type/field_value.py | 579 ------------ .../understand/assistant/model_build.py | 629 ------------- .../preview/understand/assistant/query.py | 717 -------------- .../understand/assistant/style_sheet.py | 273 ------ .../understand/assistant/task/__init__.py | 762 --------------- .../understand/assistant/task/field.py | 551 ----------- .../understand/assistant/task/sample.py | 699 -------------- .../understand/assistant/task/task_actions.py | 301 ------ .../assistant/task/task_statistics.py | 221 ----- twilio/rest/preview/wireless/__init__.py | 1 + twilio/rest/preview/wireless/command.py | 5 +- twilio/rest/preview/wireless/rate_plan.py | 5 +- twilio/rest/preview/wireless/sim/__init__.py | 5 +- twilio/rest/preview/wireless/sim/usage.py | 4 +- .../preview_messaging/PreviewMessagingBase.py | 1 + twilio/rest/preview_messaging/v1/__init__.py | 1 + twilio/rest/preview_messaging/v1/broadcast.py | 3 +- twilio/rest/preview_messaging/v1/message.py | 5 +- twilio/rest/pricing/PricingBase.py | 1 + twilio/rest/pricing/v1/__init__.py | 1 + twilio/rest/pricing/v1/messaging/__init__.py | 2 +- twilio/rest/pricing/v1/messaging/country.py | 5 +- .../rest/pricing/v1/phone_number/__init__.py | 2 +- .../rest/pricing/v1/phone_number/country.py | 5 +- twilio/rest/pricing/v1/voice/__init__.py | 2 +- twilio/rest/pricing/v1/voice/country.py | 5 +- twilio/rest/pricing/v1/voice/number.py | 4 +- twilio/rest/pricing/v2/__init__.py | 1 + twilio/rest/pricing/v2/country.py | 5 +- twilio/rest/pricing/v2/number.py | 4 +- twilio/rest/pricing/v2/voice/__init__.py | 2 +- twilio/rest/pricing/v2/voice/country.py | 5 +- twilio/rest/pricing/v2/voice/number.py | 4 +- twilio/rest/proxy/ProxyBase.py | 1 + twilio/rest/proxy/v1/__init__.py | 1 + twilio/rest/proxy/v1/service/__init__.py | 5 +- twilio/rest/proxy/v1/service/phone_number.py | 5 +- .../rest/proxy/v1/service/session/__init__.py | 5 +- .../proxy/v1/service/session/interaction.py | 11 +- .../service/session/participant/__init__.py | 5 +- .../participant/message_interaction.py | 5 +- twilio/rest/proxy/v1/service/short_code.py | 5 +- twilio/rest/routes/RoutesBase.py | 1 + twilio/rest/routes/v2/__init__.py | 1 + twilio/rest/routes/v2/phone_number.py | 4 +- twilio/rest/routes/v2/sip_domain.py | 4 +- twilio/rest/routes/v2/trunk.py | 4 +- twilio/rest/serverless/ServerlessBase.py | 1 + twilio/rest/serverless/v1/__init__.py | 1 + twilio/rest/serverless/v1/service/__init__.py | 5 +- .../serverless/v1/service/asset/__init__.py | 5 +- .../v1/service/asset/asset_version.py | 5 +- .../v1/service/environment/__init__.py | 5 +- .../v1/service/environment/deployment.py | 5 +- .../serverless/v1/service/environment/log.py | 5 +- .../v1/service/environment/variable.py | 5 +- .../v1/service/function/__init__.py | 5 +- .../function/function_version/__init__.py | 5 +- .../function_version_content.py | 4 +- twilio/rest/studio/StudioBase.py | 1 + twilio/rest/studio/v1/__init__.py | 1 + twilio/rest/studio/v1/flow/__init__.py | 5 +- .../studio/v1/flow/engagement/__init__.py | 5 +- .../v1/flow/engagement/engagement_context.py | 4 +- .../v1/flow/engagement/step/__init__.py | 5 +- .../v1/flow/engagement/step/step_context.py | 4 +- .../rest/studio/v1/flow/execution/__init__.py | 5 +- .../v1/flow/execution/execution_context.py | 4 +- .../flow/execution/execution_step/__init__.py | 5 +- .../execution_step/execution_step_context.py | 4 +- twilio/rest/studio/v2/__init__.py | 1 + twilio/rest/studio/v2/flow/__init__.py | 5 +- .../rest/studio/v2/flow/execution/__init__.py | 5 +- .../v2/flow/execution/execution_context.py | 4 +- .../flow/execution/execution_step/__init__.py | 5 +- .../execution_step/execution_step_context.py | 4 +- twilio/rest/studio/v2/flow/flow_revision.py | 5 +- twilio/rest/studio/v2/flow/flow_test_user.py | 4 +- twilio/rest/studio/v2/flow_validate.py | 3 +- twilio/rest/supersim/SupersimBase.py | 1 + twilio/rest/supersim/v1/__init__.py | 1 + twilio/rest/supersim/v1/esim_profile.py | 19 +- twilio/rest/supersim/v1/fleet.py | 5 +- twilio/rest/supersim/v1/ip_command.py | 5 +- twilio/rest/supersim/v1/network.py | 5 +- .../v1/network_access_profile/__init__.py | 5 +- .../network_access_profile_network.py | 5 +- twilio/rest/supersim/v1/settings_update.py | 4 +- twilio/rest/supersim/v1/sim/__init__.py | 5 +- twilio/rest/supersim/v1/sim/billing_period.py | 4 +- twilio/rest/supersim/v1/sim/sim_ip_address.py | 10 +- twilio/rest/supersim/v1/sms_command.py | 5 +- twilio/rest/supersim/v1/usage_record.py | 4 +- twilio/rest/sync/SyncBase.py | 1 + twilio/rest/sync/v1/__init__.py | 1 + twilio/rest/sync/v1/service/__init__.py | 5 +- .../rest/sync/v1/service/document/__init__.py | 5 +- .../service/document/document_permission.py | 5 +- .../sync/v1/service/sync_list/__init__.py | 5 +- .../v1/service/sync_list/sync_list_item.py | 5 +- .../service/sync_list/sync_list_permission.py | 5 +- .../rest/sync/v1/service/sync_map/__init__.py | 5 +- .../sync/v1/service/sync_map/sync_map_item.py | 5 +- .../service/sync_map/sync_map_permission.py | 5 +- .../sync/v1/service/sync_stream/__init__.py | 5 +- .../v1/service/sync_stream/stream_message.py | 3 +- twilio/rest/taskrouter/TaskrouterBase.py | 1 + twilio/rest/taskrouter/v1/__init__.py | 1 + .../rest/taskrouter/v1/workspace/__init__.py | 11 +- .../rest/taskrouter/v1/workspace/activity.py | 5 +- twilio/rest/taskrouter/v1/workspace/event.py | 5 +- .../taskrouter/v1/workspace/task/__init__.py | 5 +- .../v1/workspace/task/reservation.py | 17 +- .../taskrouter/v1/workspace/task_channel.py | 5 +- .../v1/workspace/task_queue/__init__.py | 5 +- .../task_queue_bulk_real_time_statistics.py | 5 +- .../task_queue_cumulative_statistics.py | 10 +- .../task_queue_real_time_statistics.py | 4 +- .../task_queue/task_queue_statistics.py | 4 +- .../task_queue/task_queues_statistics.py | 4 +- .../v1/workspace/worker/__init__.py | 5 +- .../v1/workspace/worker/reservation.py | 17 +- .../v1/workspace/worker/worker_channel.py | 5 +- .../v1/workspace/worker/worker_statistics.py | 4 +- .../worker/workers_cumulative_statistics.py | 4 +- .../worker/workers_real_time_statistics.py | 4 +- .../v1/workspace/worker/workers_statistics.py | 4 +- .../v1/workspace/workflow/__init__.py | 5 +- .../workflow_cumulative_statistics.py | 4 +- .../workflow/workflow_real_time_statistics.py | 4 +- .../workspace/workflow/workflow_statistics.py | 4 +- .../workspace_cumulative_statistics.py | 4 +- .../workspace_real_time_statistics.py | 4 +- .../v1/workspace/workspace_statistics.py | 4 +- twilio/rest/trunking/TrunkingBase.py | 1 + twilio/rest/trunking/v1/__init__.py | 1 + twilio/rest/trunking/v1/trunk/__init__.py | 11 +- .../rest/trunking/v1/trunk/credential_list.py | 5 +- .../v1/trunk/ip_access_control_list.py | 5 +- .../rest/trunking/v1/trunk/origination_url.py | 5 +- twilio/rest/trunking/v1/trunk/phone_number.py | 5 +- twilio/rest/trunking/v1/trunk/recording.py | 4 +- twilio/rest/trusthub/TrusthubBase.py | 1 + twilio/rest/trusthub/v1/__init__.py | 15 + .../rest/trusthub/v1/compliance_inquiries.py | 20 +- .../v1/compliance_registration_inquiries.py | 316 +++++++ .../v1/compliance_tollfree_inquiries.py | 143 ++- .../trusthub/v1/customer_profiles/__init__.py | 5 +- ...er_profiles_channel_endpoint_assignment.py | 5 +- .../customer_profiles_entity_assignments.py | 5 +- .../customer_profiles_evaluations.py | 11 +- twilio/rest/trusthub/v1/end_user.py | 5 +- twilio/rest/trusthub/v1/end_user_type.py | 5 +- twilio/rest/trusthub/v1/policies.py | 5 +- .../rest/trusthub/v1/supporting_document.py | 5 +- .../trusthub/v1/supporting_document_type.py | 5 +- .../trusthub/v1/trust_products/__init__.py | 5 +- ...st_products_channel_endpoint_assignment.py | 5 +- .../trust_products_entity_assignments.py | 5 +- .../trust_products_evaluations.py | 5 +- twilio/rest/verify/VerifyBase.py | 1 + twilio/rest/verify/v2/__init__.py | 1 + twilio/rest/verify/v2/form.py | 4 +- twilio/rest/verify/v2/safelist.py | 4 +- twilio/rest/verify/v2/service/__init__.py | 27 +- twilio/rest/verify/v2/service/access_token.py | 4 +- .../rest/verify/v2/service/entity/__init__.py | 5 +- .../v2/service/entity/challenge/__init__.py | 11 +- .../service/entity/challenge/notification.py | 3 +- .../rest/verify/v2/service/entity/factor.py | 5 +- .../verify/v2/service/entity/new_factor.py | 3 +- .../v2/service/messaging_configuration.py | 5 +- .../verify/v2/service/rate_limit/__init__.py | 5 +- .../verify/v2/service/rate_limit/bucket.py | 5 +- twilio/rest/verify/v2/service/verification.py | 4 +- .../verify/v2/service/verification_check.py | 3 +- twilio/rest/verify/v2/service/webhook.py | 5 +- twilio/rest/verify/v2/template.py | 4 +- twilio/rest/verify/v2/verification_attempt.py | 5 +- .../v2/verification_attempts_summary.py | 4 +- twilio/rest/video/VideoBase.py | 1 + twilio/rest/video/v1/__init__.py | 1 + twilio/rest/video/v1/composition.py | 5 +- twilio/rest/video/v1/composition_hook.py | 5 +- twilio/rest/video/v1/composition_settings.py | 14 +- twilio/rest/video/v1/recording.py | 5 +- twilio/rest/video/v1/recording_settings.py | 14 +- twilio/rest/video/v1/room/__init__.py | 5 +- .../video/v1/room/participant/__init__.py | 5 +- .../video/v1/room/participant/anonymize.py | 4 +- .../v1/room/participant/published_track.py | 5 +- .../v1/room/participant/subscribe_rules.py | 3 +- .../v1/room/participant/subscribed_track.py | 5 +- twilio/rest/video/v1/room/recording_rules.py | 3 +- twilio/rest/video/v1/room/room_recording.py | 5 +- twilio/rest/voice/VoiceBase.py | 1 + twilio/rest/voice/v1/__init__.py | 1 + twilio/rest/voice/v1/archived_call.py | 3 +- twilio/rest/voice/v1/byoc_trunk.py | 5 +- .../voice/v1/connection_policy/__init__.py | 5 +- .../connection_policy_target.py | 5 +- .../voice/v1/dialing_permissions/__init__.py | 2 +- .../bulk_country_update.py | 3 +- .../dialing_permissions/country/__init__.py | 5 +- .../country/highrisk_special_prefix.py | 4 +- .../voice/v1/dialing_permissions/settings.py | 4 +- twilio/rest/voice/v1/ip_record.py | 5 +- twilio/rest/voice/v1/source_ip_mapping.py | 5 +- twilio/rest/wireless/WirelessBase.py | 1 + twilio/rest/wireless/v1/__init__.py | 1 + twilio/rest/wireless/v1/command.py | 5 +- twilio/rest/wireless/v1/rate_plan.py | 5 +- twilio/rest/wireless/v1/sim/__init__.py | 5 +- twilio/rest/wireless/v1/sim/data_session.py | 4 +- twilio/rest/wireless/v1/sim/usage_record.py | 4 +- twilio/rest/wireless/v1/usage_record.py | 4 +- 583 files changed, 3365 insertions(+), 15725 deletions(-) delete mode 100644 twilio/rest/autopilot/AutopilotBase.py delete mode 100644 twilio/rest/autopilot/v1/__init__.py delete mode 100644 twilio/rest/autopilot/v1/assistant/__init__.py delete mode 100644 twilio/rest/autopilot/v1/assistant/defaults.py delete mode 100644 twilio/rest/autopilot/v1/assistant/dialogue.py delete mode 100644 twilio/rest/autopilot/v1/assistant/field_type/__init__.py delete mode 100644 twilio/rest/autopilot/v1/assistant/field_type/field_value.py delete mode 100644 twilio/rest/autopilot/v1/assistant/model_build.py delete mode 100644 twilio/rest/autopilot/v1/assistant/query.py delete mode 100644 twilio/rest/autopilot/v1/assistant/style_sheet.py delete mode 100644 twilio/rest/autopilot/v1/assistant/task/__init__.py delete mode 100644 twilio/rest/autopilot/v1/assistant/task/field.py delete mode 100644 twilio/rest/autopilot/v1/assistant/task/sample.py delete mode 100644 twilio/rest/autopilot/v1/assistant/task/task_actions.py delete mode 100644 twilio/rest/autopilot/v1/assistant/task/task_statistics.py delete mode 100644 twilio/rest/autopilot/v1/assistant/webhook.py delete mode 100644 twilio/rest/autopilot/v1/restore_assistant.py create mode 100644 twilio/rest/content/v1/content/approval_create.py create mode 100644 twilio/rest/flex_api/v1/insights_conversational_ai.py create mode 100644 twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py create mode 100644 twilio/rest/numbers/v1/porting_port_in_fetch.py delete mode 100644 twilio/rest/preview/understand/__init__.py delete mode 100644 twilio/rest/preview/understand/assistant/__init__.py delete mode 100644 twilio/rest/preview/understand/assistant/assistant_fallback_actions.py delete mode 100644 twilio/rest/preview/understand/assistant/assistant_initiation_actions.py delete mode 100644 twilio/rest/preview/understand/assistant/dialogue.py delete mode 100644 twilio/rest/preview/understand/assistant/field_type/__init__.py delete mode 100644 twilio/rest/preview/understand/assistant/field_type/field_value.py delete mode 100644 twilio/rest/preview/understand/assistant/model_build.py delete mode 100644 twilio/rest/preview/understand/assistant/query.py delete mode 100644 twilio/rest/preview/understand/assistant/style_sheet.py delete mode 100644 twilio/rest/preview/understand/assistant/task/__init__.py delete mode 100644 twilio/rest/preview/understand/assistant/task/field.py delete mode 100644 twilio/rest/preview/understand/assistant/task/sample.py delete mode 100644 twilio/rest/preview/understand/assistant/task/task_actions.py delete mode 100644 twilio/rest/preview/understand/assistant/task/task_statistics.py create mode 100644 twilio/rest/trusthub/v1/compliance_registration_inquiries.py diff --git a/CHANGES.md b/CHANGES.md index cb2ea55e6c..6ad5394e4e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,34 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-02-09] Version 9.0.0-rc.2 +------------------------------- +**Library - Chore** +- [PR #765](https://github.com/twilio/twilio-python/pull/765): disables cluster test. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Flex** +- Adding `flex_instance_sid` to Flex Configuration + +**Insights** +- add flag to restrict access to unapid customers + +**Lookups** +- Remove `carrier` field from `sms_pumping_risk` and leave `carrier_risk_category` **(breaking change)** +- Remove carrier information from call forwarding package **(breaking change)** + +**Messaging** +- Add update instance endpoints to us_app_to_person api + +**Push** +- Migrated to new Push API V4 with Resilient Notification Delivery. + +**Trusthub** +- Add optional field NotificationEmail to the POST /v1/ComplianceInquiries/Customers/Initialize API + +**Verify** +- `Tags` property added again to Public Docs **(breaking change)** + + [2024-01-08] Version 9.0.0-rc.1 ------------------------------- **Library - Chore** diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 3ff1070399..818688e399 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -8,6 +8,7 @@ https://openapi-generator.tech Do not edit the class manually. """ + from typing import TYPE_CHECKING, Optional from twilio.base.client_base import ClientBase @@ -15,7 +16,6 @@ if TYPE_CHECKING: from twilio.rest.accounts import Accounts from twilio.rest.api import Api - from twilio.rest.autopilot import Autopilot from twilio.rest.bulkexports import Bulkexports from twilio.rest.chat import Chat from twilio.rest.content import Content @@ -124,7 +124,6 @@ def __init__( # Domains self._accounts: Optional["Accounts"] = None self._api: Optional["Api"] = None - self._autopilot: Optional["Autopilot"] = None self._bulkexports: Optional["Bulkexports"] = None self._chat: Optional["Chat"] = None self._content: Optional["Content"] = None @@ -185,19 +184,6 @@ def api(self) -> "Api": self._api = Api(self) return self._api - @property - def autopilot(self) -> "Autopilot": - """ - Access the Autopilot Twilio Domain - - :returns: Autopilot Twilio Domain - """ - if self._autopilot is None: - from twilio.rest.autopilot import Autopilot - - self._autopilot = Autopilot(self) - return self._autopilot - @property def bulkexports(self) -> "Bulkexports": """ diff --git a/twilio/rest/accounts/AccountsBase.py b/twilio/rest/accounts/AccountsBase.py index a89be84161..e9ac0d589d 100644 --- a/twilio/rest/accounts/AccountsBase.py +++ b/twilio/rest/accounts/AccountsBase.py @@ -17,6 +17,7 @@ class AccountsBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Accounts Domain diff --git a/twilio/rest/accounts/v1/__init__.py b/twilio/rest/accounts/v1/__init__.py index 4abbf24344..142d5c7a96 100644 --- a/twilio/rest/accounts/v1/__init__.py +++ b/twilio/rest/accounts/v1/__init__.py @@ -22,6 +22,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Accounts diff --git a/twilio/rest/accounts/v1/auth_token_promotion.py b/twilio/rest/accounts/v1/auth_token_promotion.py index 0dbf1eb752..7ab6c3f39d 100644 --- a/twilio/rest/accounts/v1/auth_token_promotion.py +++ b/twilio/rest/accounts/v1/auth_token_promotion.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class AuthTokenPromotionInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the secondary Auth Token was created for. :ivar auth_token: The promoted Auth Token that must be used to authenticate future API requests. @@ -90,6 +88,7 @@ def __repr__(self) -> str: class AuthTokenPromotionContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the AuthTokenPromotionContext @@ -145,6 +144,7 @@ def __repr__(self) -> str: class AuthTokenPromotionList(ListResource): + def __init__(self, version: Version): """ Initialize the AuthTokenPromotionList diff --git a/twilio/rest/accounts/v1/credential/__init__.py b/twilio/rest/accounts/v1/credential/__init__.py index d76ce584f3..e9c4653f0c 100644 --- a/twilio/rest/accounts/v1/credential/__init__.py +++ b/twilio/rest/accounts/v1/credential/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional @@ -24,6 +23,7 @@ class CredentialList(ListResource): + def __init__(self, version: Version): """ Initialize the CredentialList diff --git a/twilio/rest/accounts/v1/credential/aws.py b/twilio/rest/accounts/v1/credential/aws.py index ae1efb6a1b..ab75620920 100644 --- a/twilio/rest/accounts/v1/credential/aws.py +++ b/twilio/rest/accounts/v1/credential/aws.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class AwsInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the AWS resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AWS resource. @@ -143,6 +141,7 @@ def __repr__(self) -> str: class AwsContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AwsContext @@ -277,6 +276,7 @@ def __repr__(self) -> str: class AwsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AwsInstance: """ Build an instance of AwsInstance @@ -295,6 +295,7 @@ def __repr__(self) -> str: class AwsList(ListResource): + def __init__(self, version: Version): """ Initialize the AwsList diff --git a/twilio/rest/accounts/v1/credential/public_key.py b/twilio/rest/accounts/v1/credential/public_key.py index 2177ebced2..09018d1d26 100644 --- a/twilio/rest/accounts/v1/credential/public_key.py +++ b/twilio/rest/accounts/v1/credential/public_key.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class PublicKeyInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the PublicKey resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Credential that the PublicKey resource belongs to. @@ -145,6 +143,7 @@ def __repr__(self) -> str: class PublicKeyContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the PublicKeyContext @@ -281,6 +280,7 @@ def __repr__(self) -> str: class PublicKeyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PublicKeyInstance: """ Build an instance of PublicKeyInstance @@ -299,6 +299,7 @@ def __repr__(self) -> str: class PublicKeyList(ListResource): + def __init__(self, version: Version): """ Initialize the PublicKeyList diff --git a/twilio/rest/accounts/v1/safelist.py b/twilio/rest/accounts/v1/safelist.py index 9ba12c1e99..e20855965c 100644 --- a/twilio/rest/accounts/v1/safelist.py +++ b/twilio/rest/accounts/v1/safelist.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values @@ -22,7 +21,6 @@ class SafelistInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the SafeList resource. :ivar phone_number: The phone number in SafeList. @@ -45,6 +43,7 @@ def __repr__(self) -> str: class SafelistList(ListResource): + def __init__(self, version: Version): """ Initialize the SafelistList diff --git a/twilio/rest/accounts/v1/secondary_auth_token.py b/twilio/rest/accounts/v1/secondary_auth_token.py index 76b09a764e..3735dd876a 100644 --- a/twilio/rest/accounts/v1/secondary_auth_token.py +++ b/twilio/rest/accounts/v1/secondary_auth_token.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class SecondaryAuthTokenInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the secondary Auth Token was created for. :ivar date_created: The date and time in UTC when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. @@ -108,6 +106,7 @@ def __repr__(self) -> str: class SecondaryAuthTokenContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the SecondaryAuthTokenContext @@ -181,6 +180,7 @@ def __repr__(self) -> str: class SecondaryAuthTokenList(ListResource): + def __init__(self, version: Version): """ Initialize the SecondaryAuthTokenList diff --git a/twilio/rest/api/ApiBase.py b/twilio/rest/api/ApiBase.py index 417bc0d0df..e53535ab3f 100644 --- a/twilio/rest/api/ApiBase.py +++ b/twilio/rest/api/ApiBase.py @@ -17,6 +17,7 @@ class ApiBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Api Domain diff --git a/twilio/rest/api/v2010/__init__.py b/twilio/rest/api/v2010/__init__.py index fe5c45c51e..2efb4ff3d0 100644 --- a/twilio/rest/api/v2010/__init__.py +++ b/twilio/rest/api/v2010/__init__.py @@ -20,6 +20,7 @@ class V2010(Version): + def __init__(self, domain: Domain): """ Initialize the V2010 version of Api diff --git a/twilio/rest/api/v2010/account/__init__.py b/twilio/rest/api/v2010/account/__init__.py index d45ee80182..adf2458f2a 100644 --- a/twilio/rest/api/v2010/account/__init__.py +++ b/twilio/rest/api/v2010/account/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -52,6 +51,7 @@ class AccountInstance(InstanceResource): + class Status(object): ACTIVE = "active" SUSPENDED = "suspended" @@ -349,6 +349,7 @@ def __repr__(self) -> str: class AccountContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AccountContext @@ -782,6 +783,7 @@ def __repr__(self) -> str: class AccountPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AccountInstance: """ Build an instance of AccountInstance @@ -800,6 +802,7 @@ def __repr__(self) -> str: class AccountList(ListResource): + def __init__(self, version: Version): """ Initialize the AccountList diff --git a/twilio/rest/api/v2010/account/address/__init__.py b/twilio/rest/api/v2010/account/address/__init__.py index 2c52ef902d..422d7f776c 100644 --- a/twilio/rest/api/v2010/account/address/__init__.py +++ b/twilio/rest/api/v2010/account/address/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class AddressInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is responsible for the Address resource. :ivar city: The city in which the address is located. @@ -231,6 +229,7 @@ def __repr__(self) -> str: class AddressContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the AddressContext @@ -448,6 +447,7 @@ def __repr__(self) -> str: class AddressPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AddressInstance: """ Build an instance of AddressInstance @@ -468,6 +468,7 @@ def __repr__(self) -> str: class AddressList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the AddressList diff --git a/twilio/rest/api/v2010/account/address/dependent_phone_number.py b/twilio/rest/api/v2010/account/address/dependent_phone_number.py index 6e9ff957a0..738f9baffd 100644 --- a/twilio/rest/api/v2010/account/address/dependent_phone_number.py +++ b/twilio/rest/api/v2010/account/address/dependent_phone_number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class DependentPhoneNumberInstance(InstanceResource): + class AddressRequirement(object): NONE = "none" ANY = "any" @@ -127,6 +127,7 @@ def __repr__(self) -> str: class DependentPhoneNumberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DependentPhoneNumberInstance: """ Build an instance of DependentPhoneNumberInstance @@ -150,6 +151,7 @@ def __repr__(self) -> str: class DependentPhoneNumberList(ListResource): + def __init__(self, version: Version, account_sid: str, address_sid: str): """ Initialize the DependentPhoneNumberList diff --git a/twilio/rest/api/v2010/account/application.py b/twilio/rest/api/v2010/account/application.py index d11dc6f7cc..3f70417b5e 100644 --- a/twilio/rest/api/v2010/account/application.py +++ b/twilio/rest/api/v2010/account/application.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ApplicationInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Application resource. :ivar api_version: The API version used to start a new TwiML session. @@ -281,6 +279,7 @@ def __repr__(self) -> str: class ApplicationContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the ApplicationContext @@ -525,6 +524,7 @@ def __repr__(self) -> str: class ApplicationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ApplicationInstance: """ Build an instance of ApplicationInstance @@ -545,6 +545,7 @@ def __repr__(self) -> str: class ApplicationList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the ApplicationList diff --git a/twilio/rest/api/v2010/account/authorized_connect_app.py b/twilio/rest/api/v2010/account/authorized_connect_app.py index 4d71766b62..9359545cdb 100644 --- a/twilio/rest/api/v2010/account/authorized_connect_app.py +++ b/twilio/rest/api/v2010/account/authorized_connect_app.py @@ -12,10 +12,8 @@ Do not edit the class manually. """ - -from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -24,6 +22,7 @@ class AuthorizedConnectAppInstance(InstanceResource): + class Permission(object): GET_ALL = "get-all" POST_ALL = "post-all" @@ -35,8 +34,6 @@ class Permission(object): :ivar connect_app_friendly_name: The name of the Connect App. :ivar connect_app_homepage_url: The public URL for the Connect App. :ivar connect_app_sid: The SID that we assigned to the Connect App. - :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar permissions: The set of permissions that you authorized for the Connect App. Can be: `get-all` or `post-all`. :ivar uri: The URI of the resource, relative to `https://api.twilio.com`. """ @@ -64,15 +61,9 @@ def __init__( "connect_app_homepage_url" ) self.connect_app_sid: Optional[str] = payload.get("connect_app_sid") - self.date_created: Optional[datetime] = deserialize.rfc2822_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.rfc2822_datetime( - payload.get("date_updated") + self.permissions: Optional[List["AuthorizedConnectAppInstance.Permission"]] = ( + payload.get("permissions") ) - self.permissions: Optional[ - List["AuthorizedConnectAppInstance.Permission"] - ] = payload.get("permissions") self.uri: Optional[str] = payload.get("uri") self._solution = { @@ -126,6 +117,7 @@ def __repr__(self) -> str: class AuthorizedConnectAppContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, connect_app_sid: str): """ Initialize the AuthorizedConnectAppContext @@ -196,6 +188,7 @@ def __repr__(self) -> str: class AuthorizedConnectAppPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AuthorizedConnectAppInstance: """ Build an instance of AuthorizedConnectAppInstance @@ -216,6 +209,7 @@ def __repr__(self) -> str: class AuthorizedConnectAppList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the AuthorizedConnectAppList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py b/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py index 5645844cfb..14fcfc28df 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -40,7 +39,6 @@ class AvailablePhoneNumberCountryInstance(InstanceResource): - """ :ivar country_code: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country. :ivar country: The name of the country. @@ -168,6 +166,7 @@ def __repr__(self) -> str: class AvailablePhoneNumberCountryContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the AvailablePhoneNumberCountryContext @@ -341,6 +340,7 @@ def __repr__(self) -> str: class AvailablePhoneNumberCountryPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> AvailablePhoneNumberCountryInstance: @@ -363,6 +363,7 @@ def __repr__(self) -> str: class AvailablePhoneNumberCountryList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the AvailablePhoneNumberCountryList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/local.py b/twilio/rest/api/v2010/account/available_phone_number_country/local.py index b8e0cee71a..a3fd567a7f 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/local.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/local.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class LocalInstance(InstanceResource): - """ :ivar friendly_name: A formatted version of the phone number. :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. @@ -79,6 +77,7 @@ def __repr__(self) -> str: class LocalPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> LocalInstance: """ Build an instance of LocalInstance @@ -102,6 +101,7 @@ def __repr__(self) -> str: class LocalList(ListResource): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the LocalList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py b/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py index 65e0be2b88..04ba514cca 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class MachineToMachineInstance(InstanceResource): - """ :ivar friendly_name: A formatted version of the phone number. :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. @@ -79,6 +77,7 @@ def __repr__(self) -> str: class MachineToMachinePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MachineToMachineInstance: """ Build an instance of MachineToMachineInstance @@ -102,6 +101,7 @@ def __repr__(self) -> str: class MachineToMachineList(ListResource): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the MachineToMachineList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py b/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py index 5ef6f891d3..cd37127017 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class MobileInstance(InstanceResource): - """ :ivar friendly_name: A formatted version of the phone number. :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. @@ -79,6 +77,7 @@ def __repr__(self) -> str: class MobilePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MobileInstance: """ Build an instance of MobileInstance @@ -102,6 +101,7 @@ def __repr__(self) -> str: class MobileList(ListResource): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the MobileList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/national.py b/twilio/rest/api/v2010/account/available_phone_number_country/national.py index 8b2edb640c..018bef3ac7 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/national.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/national.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class NationalInstance(InstanceResource): - """ :ivar friendly_name: A formatted version of the phone number. :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. @@ -79,6 +77,7 @@ def __repr__(self) -> str: class NationalPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> NationalInstance: """ Build an instance of NationalInstance @@ -102,6 +101,7 @@ def __repr__(self) -> str: class NationalList(ListResource): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the NationalList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py b/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py index d167c2f039..3cb7af3eff 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class SharedCostInstance(InstanceResource): - """ :ivar friendly_name: A formatted version of the phone number. :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. @@ -79,6 +77,7 @@ def __repr__(self) -> str: class SharedCostPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SharedCostInstance: """ Build an instance of SharedCostInstance @@ -102,6 +101,7 @@ def __repr__(self) -> str: class SharedCostList(ListResource): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the SharedCostList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py b/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py index aea21d7017..e9d830c0bb 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class TollFreeInstance(InstanceResource): - """ :ivar friendly_name: A formatted version of the phone number. :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. @@ -79,6 +77,7 @@ def __repr__(self) -> str: class TollFreePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TollFreeInstance: """ Build an instance of TollFreeInstance @@ -102,6 +101,7 @@ def __repr__(self) -> str: class TollFreeList(ListResource): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the TollFreeList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/voip.py b/twilio/rest/api/v2010/account/available_phone_number_country/voip.py index fba53f0357..8825843c8f 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/voip.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/voip.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class VoipInstance(InstanceResource): - """ :ivar friendly_name: A formatted version of the phone number. :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. @@ -79,6 +77,7 @@ def __repr__(self) -> str: class VoipPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> VoipInstance: """ Build an instance of VoipInstance @@ -102,6 +101,7 @@ def __repr__(self) -> str: class VoipList(ListResource): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the VoipList diff --git a/twilio/rest/api/v2010/account/balance.py b/twilio/rest/api/v2010/account/balance.py index befb75e694..0e90cdaae0 100644 --- a/twilio/rest/api/v2010/account/balance.py +++ b/twilio/rest/api/v2010/account/balance.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class BalanceInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Account. :ivar balance: The balance of the Account, in units specified by the unit parameter. Balance changes may not be reflected immediately. Child accounts do not contain balance information @@ -50,6 +48,7 @@ def __repr__(self) -> str: class BalanceList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the BalanceList diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index ad669dd724..21c4e9c27e 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -38,6 +37,7 @@ class CallInstance(InstanceResource): + class Status(object): QUEUED = "queued" RINGING = "ringing" @@ -337,6 +337,7 @@ def __repr__(self) -> str: class CallContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the CallContext @@ -668,6 +669,7 @@ def __repr__(self) -> str: class CallPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CallInstance: """ Build an instance of CallInstance @@ -688,6 +690,7 @@ def __repr__(self) -> str: class CallList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the CallList diff --git a/twilio/rest/api/v2010/account/call/event.py b/twilio/rest/api/v2010/account/call/event.py index bb77d6510a..7993dd00a0 100644 --- a/twilio/rest/api/v2010/account/call/event.py +++ b/twilio/rest/api/v2010/account/call/event.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values @@ -23,7 +22,6 @@ class EventInstance(InstanceResource): - """ :ivar request: Contains a dictionary representing the request of the call. :ivar response: Contains a dictionary representing the call response, including a list of the call events. @@ -53,6 +51,7 @@ def __repr__(self) -> str: class EventPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EventInstance: """ Build an instance of EventInstance @@ -76,6 +75,7 @@ def __repr__(self) -> str: class EventList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the EventList diff --git a/twilio/rest/api/v2010/account/call/feedback.py b/twilio/rest/api/v2010/account/call/feedback.py index 8eb84a966a..210a529ac2 100644 --- a/twilio/rest/api/v2010/account/call/feedback.py +++ b/twilio/rest/api/v2010/account/call/feedback.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,6 +22,7 @@ class FeedbackInstance(InstanceResource): + class Issues(object): AUDIO_LATENCY = "audio-latency" DIGITS_NOT_CAPTURED = "digits-not-captured" @@ -147,6 +147,7 @@ def __repr__(self) -> str: class FeedbackContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the FeedbackContext @@ -283,6 +284,7 @@ def __repr__(self) -> str: class FeedbackList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the FeedbackList diff --git a/twilio/rest/api/v2010/account/call/feedback_summary.py b/twilio/rest/api/v2010/account/call/feedback_summary.py index a856fda5ac..2f26b0b0a4 100644 --- a/twilio/rest/api/v2010/account/call/feedback_summary.py +++ b/twilio/rest/api/v2010/account/call/feedback_summary.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date, datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,6 +22,7 @@ class FeedbackSummaryInstance(InstanceResource): + class Status(object): QUEUED = "queued" IN_PROGRESS = "in-progress" @@ -155,6 +155,7 @@ def __repr__(self) -> str: class FeedbackSummaryContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the FeedbackSummaryContext @@ -249,6 +250,7 @@ def __repr__(self) -> str: class FeedbackSummaryList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the FeedbackSummaryList diff --git a/twilio/rest/api/v2010/account/call/notification.py b/twilio/rest/api/v2010/account/call/notification.py index 5db223c859..44291b8448 100644 --- a/twilio/rest/api/v2010/account/call/notification.py +++ b/twilio/rest/api/v2010/account/call/notification.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date, datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class NotificationInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call Notification resource. :ivar api_version: The API version used to create the Call Notification resource. @@ -132,6 +130,7 @@ def __repr__(self) -> str: class NotificationContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): """ Initialize the NotificationContext @@ -208,6 +207,7 @@ def __repr__(self) -> str: class NotificationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> NotificationInstance: """ Build an instance of NotificationInstance @@ -231,6 +231,7 @@ def __repr__(self) -> str: class NotificationList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the NotificationList diff --git a/twilio/rest/api/v2010/account/call/payment.py b/twilio/rest/api/v2010/account/call/payment.py index 2233971912..540baa8435 100644 --- a/twilio/rest/api/v2010/account/call/payment.py +++ b/twilio/rest/api/v2010/account/call/payment.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,6 +22,7 @@ class PaymentInstance(InstanceResource): + class BankAccountType(object): CONSUMER_CHECKING = "consumer-checking" CONSUMER_SAVINGS = "consumer-savings" @@ -161,6 +161,7 @@ def __repr__(self) -> str: class PaymentContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): """ Initialize the PaymentContext @@ -275,6 +276,7 @@ def __repr__(self) -> str: class PaymentList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the PaymentList diff --git a/twilio/rest/api/v2010/account/call/recording.py b/twilio/rest/api/v2010/account/call/recording.py index 99ed688ea2..b9653c4b5b 100644 --- a/twilio/rest/api/v2010/account/call/recording.py +++ b/twilio/rest/api/v2010/account/call/recording.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date, datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class RecordingInstance(InstanceResource): + class Source(object): DIALVERB = "DialVerb" CONFERENCE = "Conference" @@ -206,6 +206,7 @@ def __repr__(self) -> str: class RecordingContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): """ Initialize the RecordingContext @@ -374,6 +375,7 @@ def __repr__(self) -> str: class RecordingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RecordingInstance: """ Build an instance of RecordingInstance @@ -397,6 +399,7 @@ def __repr__(self) -> str: class RecordingList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the RecordingList diff --git a/twilio/rest/api/v2010/account/call/siprec.py b/twilio/rest/api/v2010/account/call/siprec.py index 23b8cfbe35..bcb537071f 100644 --- a/twilio/rest/api/v2010/account/call/siprec.py +++ b/twilio/rest/api/v2010/account/call/siprec.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,6 +22,7 @@ class SiprecInstance(InstanceResource): + class Status(object): IN_PROGRESS = "in-progress" STOPPED = "stopped" @@ -126,6 +126,7 @@ def __repr__(self) -> str: class SiprecContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): """ Initialize the SiprecContext @@ -216,6 +217,7 @@ def __repr__(self) -> str: class SiprecList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the SiprecList diff --git a/twilio/rest/api/v2010/account/call/stream.py b/twilio/rest/api/v2010/account/call/stream.py index 949d6dc197..a46d8f9757 100644 --- a/twilio/rest/api/v2010/account/call/stream.py +++ b/twilio/rest/api/v2010/account/call/stream.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,6 +22,7 @@ class StreamInstance(InstanceResource): + class Status(object): IN_PROGRESS = "in-progress" STOPPED = "stopped" @@ -126,6 +126,7 @@ def __repr__(self) -> str: class StreamContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): """ Initialize the StreamContext @@ -218,6 +219,7 @@ def __repr__(self) -> str: class StreamList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the StreamList 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 2aef221eb5..0e9d1f0490 100644 --- a/twilio/rest/api/v2010/account/call/user_defined_message.py +++ b/twilio/rest/api/v2010/account/call/user_defined_message.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class UserDefinedMessageInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created User Defined Message. :ivar call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User Defined Message is associated with. @@ -59,6 +57,7 @@ def __repr__(self) -> str: class UserDefinedMessageList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the UserDefinedMessageList 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 8d90b7bf5e..a0b7c18339 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class UserDefinedMessageSubscriptionInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that subscribed to the User Defined Messages. :ivar call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User Defined Message Subscription is associated with. This refers to the Call SID that is producing the User Defined Messages. @@ -105,6 +103,7 @@ def __repr__(self) -> str: class UserDefinedMessageSubscriptionContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): """ Initialize the UserDefinedMessageSubscriptionContext @@ -163,6 +162,7 @@ def __repr__(self) -> str: class UserDefinedMessageSubscriptionList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the UserDefinedMessageSubscriptionList diff --git a/twilio/rest/api/v2010/account/conference/__init__.py b/twilio/rest/api/v2010/account/conference/__init__.py index 776ee6c4ad..36cd390c60 100644 --- a/twilio/rest/api/v2010/account/conference/__init__.py +++ b/twilio/rest/api/v2010/account/conference/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date, datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -26,6 +25,7 @@ class ConferenceInstance(InstanceResource): + class ReasonConferenceEnded(object): CONFERENCE_ENDED_VIA_API = "conference-ended-via-api" PARTICIPANT_WITH_END_CONFERENCE_ON_EXIT_LEFT = ( @@ -199,6 +199,7 @@ def __repr__(self) -> str: class ConferenceContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the ConferenceContext @@ -370,6 +371,7 @@ def __repr__(self) -> str: class ConferencePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConferenceInstance: """ Build an instance of ConferenceInstance @@ -390,6 +392,7 @@ def __repr__(self) -> str: class ConferenceList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the ConferenceList diff --git a/twilio/rest/api/v2010/account/conference/participant.py b/twilio/rest/api/v2010/account/conference/participant.py index c14ae1d5fa..3759e4558d 100644 --- a/twilio/rest/api/v2010/account/conference/participant.py +++ b/twilio/rest/api/v2010/account/conference/participant.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class ParticipantInstance(InstanceResource): + class Status(object): QUEUED = "queued" CONNECTING = "connecting" @@ -249,6 +249,7 @@ def __repr__(self) -> str: class ParticipantContext(InstanceContext): + def __init__( self, version: Version, account_sid: str, conference_sid: str, call_sid: str ): @@ -477,6 +478,7 @@ def __repr__(self) -> str: class ParticipantPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantInstance: """ Build an instance of ParticipantInstance @@ -500,6 +502,7 @@ def __repr__(self) -> str: class ParticipantList(ListResource): + def __init__(self, version: Version, account_sid: str, conference_sid: str): """ Initialize the ParticipantList diff --git a/twilio/rest/api/v2010/account/conference/recording.py b/twilio/rest/api/v2010/account/conference/recording.py index e9ac5789cb..dfb1d406ee 100644 --- a/twilio/rest/api/v2010/account/conference/recording.py +++ b/twilio/rest/api/v2010/account/conference/recording.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date, datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class RecordingInstance(InstanceResource): + class Source(object): DIALVERB = "DialVerb" CONFERENCE = "Conference" @@ -204,6 +204,7 @@ def __repr__(self) -> str: class RecordingContext(InstanceContext): + def __init__( self, version: Version, account_sid: str, conference_sid: str, sid: str ): @@ -372,6 +373,7 @@ def __repr__(self) -> str: class RecordingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RecordingInstance: """ Build an instance of RecordingInstance @@ -395,6 +397,7 @@ def __repr__(self) -> str: class RecordingList(ListResource): + def __init__(self, version: Version, account_sid: str, conference_sid: str): """ Initialize the RecordingList diff --git a/twilio/rest/api/v2010/account/connect_app.py b/twilio/rest/api/v2010/account/connect_app.py index e34fbeae4d..722e4e9b3e 100644 --- a/twilio/rest/api/v2010/account/connect_app.py +++ b/twilio/rest/api/v2010/account/connect_app.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -23,6 +22,7 @@ class ConnectAppInstance(InstanceResource): + class Permission(object): GET_ALL = "get-all" POST_ALL = "post-all" @@ -215,6 +215,7 @@ def __repr__(self) -> str: class ConnectAppContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the ConnectAppContext @@ -415,6 +416,7 @@ def __repr__(self) -> str: class ConnectAppPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConnectAppInstance: """ Build an instance of ConnectAppInstance @@ -435,6 +437,7 @@ def __repr__(self) -> str: class ConnectAppList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the ConnectAppList 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 f26c7589b2..b1910d5bf6 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -30,6 +29,7 @@ class IncomingPhoneNumberInstance(InstanceResource): + class AddressRequirement(object): NONE = "none" ANY = "any" @@ -395,6 +395,7 @@ def __repr__(self) -> str: class IncomingPhoneNumberContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the IncomingPhoneNumberContext @@ -704,6 +705,7 @@ def __repr__(self) -> str: class IncomingPhoneNumberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> IncomingPhoneNumberInstance: """ Build an instance of IncomingPhoneNumberInstance @@ -724,6 +726,7 @@ def __repr__(self) -> str: class IncomingPhoneNumberList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the IncomingPhoneNumberList 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 645d0e846c..12c6f961e4 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class AssignedAddOnInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource. @@ -148,6 +146,7 @@ def __repr__(self) -> str: class AssignedAddOnContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, resource_sid: str, sid: str): """ Initialize the AssignedAddOnContext @@ -262,6 +261,7 @@ def __repr__(self) -> str: class AssignedAddOnPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AssignedAddOnInstance: """ Build an instance of AssignedAddOnInstance @@ -285,6 +285,7 @@ def __repr__(self) -> str: class AssignedAddOnList(ListResource): + def __init__(self, version: Version, account_sid: str, resource_sid: str): """ Initialize the AssignedAddOnList diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py index 54b1c2a80b..18504cafd8 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class AssignedAddOnExtensionInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource. @@ -112,6 +110,7 @@ def __repr__(self) -> str: class AssignedAddOnExtensionContext(InstanceContext): + def __init__( self, version: Version, @@ -197,6 +196,7 @@ def __repr__(self) -> str: class AssignedAddOnExtensionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AssignedAddOnExtensionInstance: """ Build an instance of AssignedAddOnExtensionInstance @@ -221,6 +221,7 @@ def __repr__(self) -> str: class AssignedAddOnExtensionList(ListResource): + def __init__( self, version: Version, 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 eb69e05c08..6f87f0e94c 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/local.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/local.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class LocalInstance(InstanceResource): + class AddressRequirement(object): NONE = "none" ANY = "any" @@ -88,9 +88,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], account_sid: str): self.account_sid: Optional[str] = payload.get("account_sid") self.address_sid: Optional[str] = payload.get("address_sid") - self.address_requirements: Optional[ - "LocalInstance.AddressRequirement" - ] = payload.get("address_requirements") + self.address_requirements: Optional["LocalInstance.AddressRequirement"] = ( + payload.get("address_requirements") + ) self.api_version: Optional[str] = payload.get("api_version") self.beta: Optional[bool] = payload.get("beta") self.capabilities: Optional[str] = payload.get("capabilities") @@ -116,9 +116,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], account_sid: str): ) self.trunk_sid: Optional[str] = payload.get("trunk_sid") self.uri: Optional[str] = payload.get("uri") - self.voice_receive_mode: Optional[ - "LocalInstance.VoiceReceiveMode" - ] = payload.get("voice_receive_mode") + self.voice_receive_mode: Optional["LocalInstance.VoiceReceiveMode"] = ( + payload.get("voice_receive_mode") + ) self.voice_application_sid: Optional[str] = payload.get("voice_application_sid") self.voice_caller_id_lookup: Optional[bool] = payload.get( "voice_caller_id_lookup" @@ -152,6 +152,7 @@ def __repr__(self) -> str: class LocalPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> LocalInstance: """ Build an instance of LocalInstance @@ -172,6 +173,7 @@ def __repr__(self) -> str: class LocalList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the LocalList 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 7acd28c0f0..59fdda7a90 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class MobileInstance(InstanceResource): + class AddressRequirement(object): NONE = "none" ANY = "any" @@ -88,9 +88,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], account_sid: str): self.account_sid: Optional[str] = payload.get("account_sid") self.address_sid: Optional[str] = payload.get("address_sid") - self.address_requirements: Optional[ - "MobileInstance.AddressRequirement" - ] = payload.get("address_requirements") + self.address_requirements: Optional["MobileInstance.AddressRequirement"] = ( + payload.get("address_requirements") + ) self.api_version: Optional[str] = payload.get("api_version") self.beta: Optional[bool] = payload.get("beta") self.capabilities: Optional[str] = payload.get("capabilities") @@ -116,9 +116,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], account_sid: str): ) self.trunk_sid: Optional[str] = payload.get("trunk_sid") self.uri: Optional[str] = payload.get("uri") - self.voice_receive_mode: Optional[ - "MobileInstance.VoiceReceiveMode" - ] = payload.get("voice_receive_mode") + self.voice_receive_mode: Optional["MobileInstance.VoiceReceiveMode"] = ( + payload.get("voice_receive_mode") + ) self.voice_application_sid: Optional[str] = payload.get("voice_application_sid") self.voice_caller_id_lookup: Optional[bool] = payload.get( "voice_caller_id_lookup" @@ -152,6 +152,7 @@ def __repr__(self) -> str: class MobilePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MobileInstance: """ Build an instance of MobileInstance @@ -172,6 +173,7 @@ def __repr__(self) -> str: class MobileList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the MobileList 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 7d8592e90a..e6a197283a 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class TollFreeInstance(InstanceResource): + class AddressRequirement(object): NONE = "none" ANY = "any" @@ -88,9 +88,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], account_sid: str): self.account_sid: Optional[str] = payload.get("account_sid") self.address_sid: Optional[str] = payload.get("address_sid") - self.address_requirements: Optional[ - "TollFreeInstance.AddressRequirement" - ] = payload.get("address_requirements") + self.address_requirements: Optional["TollFreeInstance.AddressRequirement"] = ( + payload.get("address_requirements") + ) self.api_version: Optional[str] = payload.get("api_version") self.beta: Optional[bool] = payload.get("beta") self.capabilities: Optional[str] = payload.get("capabilities") @@ -116,9 +116,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], account_sid: str): ) self.trunk_sid: Optional[str] = payload.get("trunk_sid") self.uri: Optional[str] = payload.get("uri") - self.voice_receive_mode: Optional[ - "TollFreeInstance.VoiceReceiveMode" - ] = payload.get("voice_receive_mode") + self.voice_receive_mode: Optional["TollFreeInstance.VoiceReceiveMode"] = ( + payload.get("voice_receive_mode") + ) self.voice_application_sid: Optional[str] = payload.get("voice_application_sid") self.voice_caller_id_lookup: Optional[bool] = payload.get( "voice_caller_id_lookup" @@ -127,9 +127,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], account_sid: str): self.voice_fallback_url: Optional[str] = payload.get("voice_fallback_url") self.voice_method: Optional[str] = payload.get("voice_method") self.voice_url: Optional[str] = payload.get("voice_url") - self.emergency_status: Optional[ - "TollFreeInstance.EmergencyStatus" - ] = payload.get("emergency_status") + self.emergency_status: Optional["TollFreeInstance.EmergencyStatus"] = ( + payload.get("emergency_status") + ) self.emergency_address_sid: Optional[str] = payload.get("emergency_address_sid") self.emergency_address_status: Optional[ "TollFreeInstance.EmergencyAddressStatus" @@ -152,6 +152,7 @@ def __repr__(self) -> str: class TollFreePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TollFreeInstance: """ Build an instance of TollFreeInstance @@ -172,6 +173,7 @@ def __repr__(self) -> str: class TollFreeList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the TollFreeList diff --git a/twilio/rest/api/v2010/account/key.py b/twilio/rest/api/v2010/account/key.py index 76c8f1d55c..68a9feb0e1 100644 --- a/twilio/rest/api/v2010/account/key.py +++ b/twilio/rest/api/v2010/account/key.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class KeyInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the Key resource. :ivar friendly_name: The string that you assigned to describe the resource. @@ -145,6 +143,7 @@ def __repr__(self) -> str: class KeyContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the KeyContext @@ -293,6 +292,7 @@ def __repr__(self) -> str: class KeyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> KeyInstance: """ Build an instance of KeyInstance @@ -313,6 +313,7 @@ def __repr__(self) -> str: class KeyList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the KeyList diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index ac76c085ae..8d8144d331 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -26,6 +25,7 @@ class MessageInstance(InstanceResource): + class AddressRetention(object): RETAIN = "retain" OBFUSCATE = "obfuscate" @@ -245,6 +245,7 @@ def __repr__(self) -> str: class MessageContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the MessageContext @@ -434,6 +435,7 @@ def __repr__(self) -> str: class MessagePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: """ Build an instance of MessageInstance @@ -454,6 +456,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the MessageList diff --git a/twilio/rest/api/v2010/account/message/feedback.py b/twilio/rest/api/v2010/account/message/feedback.py index 61a23207c3..2ccce06a54 100644 --- a/twilio/rest/api/v2010/account/message/feedback.py +++ b/twilio/rest/api/v2010/account/message/feedback.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,6 +22,7 @@ class FeedbackInstance(InstanceResource): + class Outcome(object): CONFIRMED = "confirmed" UNCONFIRMED = "unconfirmed" @@ -72,6 +72,7 @@ def __repr__(self) -> str: class FeedbackList(ListResource): + def __init__(self, version: Version, account_sid: str, message_sid: str): """ Initialize the FeedbackList diff --git a/twilio/rest/api/v2010/account/message/media.py b/twilio/rest/api/v2010/account/message/media.py index 45638e9c53..4068d0c35d 100644 --- a/twilio/rest/api/v2010/account/message/media.py +++ b/twilio/rest/api/v2010/account/message/media.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class MediaInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with this Media resource. :ivar content_type: The default [MIME type](https://en.wikipedia.org/wiki/Internet_media_type) of the media, for example `image/jpeg`, `image/png`, or `image/gif`. @@ -128,6 +126,7 @@ def __repr__(self) -> str: class MediaContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, message_sid: str, sid: str): """ Initialize the MediaContext @@ -228,6 +227,7 @@ def __repr__(self) -> str: class MediaPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MediaInstance: """ Build an instance of MediaInstance @@ -251,6 +251,7 @@ def __repr__(self) -> str: class MediaList(ListResource): + def __init__(self, version: Version, account_sid: str, message_sid: str): """ Initialize the MediaList diff --git a/twilio/rest/api/v2010/account/new_key.py b/twilio/rest/api/v2010/account/new_key.py index 2f1015cf00..015249ddf8 100644 --- a/twilio/rest/api/v2010/account/new_key.py +++ b/twilio/rest/api/v2010/account/new_key.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class NewKeyInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the NewKey resource. You will use this as the basic-auth `user` when authenticating to the API. :ivar friendly_name: The string that you assigned to describe the resource. @@ -60,6 +58,7 @@ def __repr__(self) -> str: class NewKeyList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the NewKeyList diff --git a/twilio/rest/api/v2010/account/new_signing_key.py b/twilio/rest/api/v2010/account/new_signing_key.py index 45f32b50d0..6bfa32324b 100644 --- a/twilio/rest/api/v2010/account/new_signing_key.py +++ b/twilio/rest/api/v2010/account/new_signing_key.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class NewSigningKeyInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the NewSigningKey resource. :ivar friendly_name: The string that you assigned to describe the resource. @@ -60,6 +58,7 @@ def __repr__(self) -> str: class NewSigningKeyList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the NewSigningKeyList diff --git a/twilio/rest/api/v2010/account/notification.py b/twilio/rest/api/v2010/account/notification.py index 69e647cd4a..0a2e13da35 100644 --- a/twilio/rest/api/v2010/account/notification.py +++ b/twilio/rest/api/v2010/account/notification.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date, datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class NotificationInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Notification resource. :ivar api_version: The API version used to generate the notification. Can be empty for events that don't have a specific API version, such as incoming phone calls. @@ -129,6 +127,7 @@ def __repr__(self) -> str: class NotificationContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the NotificationContext @@ -199,6 +198,7 @@ def __repr__(self) -> str: class NotificationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> NotificationInstance: """ Build an instance of NotificationInstance @@ -219,6 +219,7 @@ def __repr__(self) -> str: class NotificationList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the NotificationList diff --git a/twilio/rest/api/v2010/account/outgoing_caller_id.py b/twilio/rest/api/v2010/account/outgoing_caller_id.py index 90d5e472e4..65ddfa1cdb 100644 --- a/twilio/rest/api/v2010/account/outgoing_caller_id.py +++ b/twilio/rest/api/v2010/account/outgoing_caller_id.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class OutgoingCallerIdInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the OutgoingCallerId resource. :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. @@ -153,6 +151,7 @@ def __repr__(self) -> str: class OutgoingCallerIdContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the OutgoingCallerIdContext @@ -305,6 +304,7 @@ def __repr__(self) -> str: class OutgoingCallerIdPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> OutgoingCallerIdInstance: """ Build an instance of OutgoingCallerIdInstance @@ -325,6 +325,7 @@ def __repr__(self) -> str: class OutgoingCallerIdList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the OutgoingCallerIdList diff --git a/twilio/rest/api/v2010/account/queue/__init__.py b/twilio/rest/api/v2010/account/queue/__init__.py index 0d4530a4b2..4e6c87baa9 100644 --- a/twilio/rest/api/v2010/account/queue/__init__.py +++ b/twilio/rest/api/v2010/account/queue/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class QueueInstance(InstanceResource): - """ :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 current_size: The number of calls currently in the queue. @@ -177,6 +175,7 @@ def __repr__(self) -> str: class QueueContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the QueueContext @@ -350,6 +349,7 @@ def __repr__(self) -> str: class QueuePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> QueueInstance: """ Build an instance of QueueInstance @@ -370,6 +370,7 @@ def __repr__(self) -> str: class QueueList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the QueueList diff --git a/twilio/rest/api/v2010/account/queue/member.py b/twilio/rest/api/v2010/account/queue/member.py index 842a178953..bf092ff283 100644 --- a/twilio/rest/api/v2010/account/queue/member.py +++ b/twilio/rest/api/v2010/account/queue/member.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class MemberInstance(InstanceResource): - """ :ivar call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Member resource is associated with. :ivar date_enqueued: The date that the member was enqueued, given in RFC 2822 format. @@ -138,6 +136,7 @@ def __repr__(self) -> str: class MemberContext(InstanceContext): + def __init__( self, version: Version, account_sid: str, queue_sid: str, call_sid: str ): @@ -280,6 +279,7 @@ def __repr__(self) -> str: class MemberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MemberInstance: """ Build an instance of MemberInstance @@ -303,6 +303,7 @@ def __repr__(self) -> str: class MemberList(ListResource): + def __init__(self, version: Version, account_sid: str, queue_sid: str): """ Initialize the MemberList diff --git a/twilio/rest/api/v2010/account/recording/__init__.py b/twilio/rest/api/v2010/account/recording/__init__.py index 10ee3e1b90..b6d7c98273 100644 --- a/twilio/rest/api/v2010/account/recording/__init__.py +++ b/twilio/rest/api/v2010/account/recording/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -26,6 +25,7 @@ class RecordingInstance(InstanceResource): + class Source(object): DIALVERB = "DialVerb" CONFERENCE = "Conference" @@ -198,6 +198,7 @@ def __repr__(self) -> str: class RecordingContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the RecordingContext @@ -335,6 +336,7 @@ def __repr__(self) -> str: class RecordingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RecordingInstance: """ Build an instance of RecordingInstance @@ -355,6 +357,7 @@ def __repr__(self) -> str: class RecordingList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the RecordingList diff --git a/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py b/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py index 79d3a71365..af1e75f4c6 100644 --- a/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py +++ b/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,6 +24,7 @@ class AddOnResultInstance(InstanceResource): + class Status(object): CANCELED = "canceled" COMPLETED = "completed" @@ -157,6 +157,7 @@ def __repr__(self) -> str: class AddOnResultContext(InstanceContext): + def __init__( self, version: Version, account_sid: str, reference_sid: str, sid: str ): @@ -273,6 +274,7 @@ def __repr__(self) -> str: class AddOnResultPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AddOnResultInstance: """ Build an instance of AddOnResultInstance @@ -296,6 +298,7 @@ def __repr__(self) -> str: class AddOnResultList(ListResource): + def __init__(self, version: Version, account_sid: str, reference_sid: str): """ Initialize the AddOnResultList diff --git a/twilio/rest/api/v2010/account/recording/add_on_result/payload.py b/twilio/rest/api/v2010/account/recording/add_on_result/payload.py index 08e8822202..1dc26e1d7b 100644 --- a/twilio/rest/api/v2010/account/recording/add_on_result/payload.py +++ b/twilio/rest/api/v2010/account/recording/add_on_result/payload.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class PayloadInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the Recording AddOnResult Payload resource. :ivar add_on_result_sid: The SID of the AddOnResult to which the payload belongs. @@ -143,6 +141,7 @@ def __repr__(self) -> str: class PayloadContext(InstanceContext): + def __init__( self, version: Version, @@ -252,6 +251,7 @@ def __repr__(self) -> str: class PayloadPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PayloadInstance: """ Build an instance of PayloadInstance @@ -276,6 +276,7 @@ def __repr__(self) -> str: class PayloadList(ListResource): + def __init__( self, version: Version, diff --git a/twilio/rest/api/v2010/account/recording/transcription.py b/twilio/rest/api/v2010/account/recording/transcription.py index 6aa104d427..bb6e0e405a 100644 --- a/twilio/rest/api/v2010/account/recording/transcription.py +++ b/twilio/rest/api/v2010/account/recording/transcription.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class TranscriptionInstance(InstanceResource): + class Status(object): IN_PROGRESS = "in-progress" COMPLETED = "completed" @@ -144,6 +144,7 @@ def __repr__(self) -> str: class TranscriptionContext(InstanceContext): + def __init__( self, version: Version, account_sid: str, recording_sid: str, sid: str ): @@ -244,6 +245,7 @@ def __repr__(self) -> str: class TranscriptionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TranscriptionInstance: """ Build an instance of TranscriptionInstance @@ -267,6 +269,7 @@ def __repr__(self) -> str: class TranscriptionList(ListResource): + def __init__(self, version: Version, account_sid: str, recording_sid: str): """ Initialize the TranscriptionList diff --git a/twilio/rest/api/v2010/account/short_code.py b/twilio/rest/api/v2010/account/short_code.py index 831cb770af..2af049a20b 100644 --- a/twilio/rest/api/v2010/account/short_code.py +++ b/twilio/rest/api/v2010/account/short_code.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ShortCodeInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this ShortCode resource. :ivar api_version: The API version used to start a new TwiML session when an SMS message is sent to this short code. @@ -177,6 +175,7 @@ def __repr__(self) -> str: class ShortCodeContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the ShortCodeContext @@ -337,6 +336,7 @@ def __repr__(self) -> str: class ShortCodePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ShortCodeInstance: """ Build an instance of ShortCodeInstance @@ -357,6 +357,7 @@ def __repr__(self) -> str: class ShortCodeList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the ShortCodeList diff --git a/twilio/rest/api/v2010/account/signing_key.py b/twilio/rest/api/v2010/account/signing_key.py index e14f42c777..6ddc7b92b0 100644 --- a/twilio/rest/api/v2010/account/signing_key.py +++ b/twilio/rest/api/v2010/account/signing_key.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class SigningKeyInstance(InstanceResource): - """ :ivar sid: :ivar friendly_name: @@ -147,6 +145,7 @@ def __repr__(self) -> str: class SigningKeyContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the SigningKeyContext @@ -299,6 +298,7 @@ def __repr__(self) -> str: class SigningKeyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SigningKeyInstance: """ Build an instance of SigningKeyInstance @@ -319,6 +319,7 @@ def __repr__(self) -> str: class SigningKeyList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the SigningKeyList diff --git a/twilio/rest/api/v2010/account/sip/__init__.py b/twilio/rest/api/v2010/account/sip/__init__.py index a0780cb1e4..12c695ff72 100644 --- a/twilio/rest/api/v2010/account/sip/__init__.py +++ b/twilio/rest/api/v2010/account/sip/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional @@ -27,6 +26,7 @@ class SipList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the SipList 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 e026e652df..634500f8cf 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/__init__.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class CredentialListInstance(InstanceResource): - """ :ivar account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) that owns this resource. :ivar date_created: The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. @@ -159,6 +157,7 @@ def __repr__(self) -> str: class CredentialListContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the CredentialListContext @@ -322,6 +321,7 @@ def __repr__(self) -> str: class CredentialListPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialListInstance: """ Build an instance of CredentialListInstance @@ -342,6 +342,7 @@ def __repr__(self) -> str: class CredentialListList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the CredentialListList 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 e40caaa329..3d2c24b999 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/credential.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/credential.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class CredentialInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies this resource. :ivar account_sid: The unique id of the Account that is responsible for this resource. @@ -156,6 +154,7 @@ def __repr__(self) -> str: class CredentialContext(InstanceContext): + def __init__( self, version: Version, account_sid: str, credential_list_sid: str, sid: str ): @@ -314,6 +313,7 @@ def __repr__(self) -> str: class CredentialPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialInstance: """ Build an instance of CredentialInstance @@ -337,6 +337,7 @@ def __repr__(self) -> str: class CredentialList(ListResource): + def __init__(self, version: Version, account_sid: str, credential_list_sid: str): """ Initialize the CredentialList diff --git a/twilio/rest/api/v2010/account/sip/domain/__init__.py b/twilio/rest/api/v2010/account/sip/domain/__init__.py index 71174f32be..f59a0c8a27 100644 --- a/twilio/rest/api/v2010/account/sip/domain/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -31,7 +30,6 @@ class DomainInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the SipDomain resource. :ivar api_version: The API version used to process the call. @@ -291,6 +289,7 @@ def __repr__(self) -> str: class DomainContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the DomainContext @@ -562,6 +561,7 @@ def __repr__(self) -> str: class DomainPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DomainInstance: """ Build an instance of DomainInstance @@ -582,6 +582,7 @@ def __repr__(self) -> str: class DomainList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the DomainList diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/__init__.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/__init__.py index 282d3b64e5..73a81ac90d 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional @@ -28,6 +27,7 @@ class AuthTypesList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the AuthTypesList diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/__init__.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/__init__.py index 9d822b4fe9..79a42fa01d 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional @@ -28,6 +27,7 @@ class AuthTypeCallsList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the AuthTypeCallsList @@ -50,9 +50,9 @@ def __init__(self, version: Version, account_sid: str, domain_sid: str): ) ) - self._credential_list_mappings: Optional[ - AuthCallsCredentialListMappingList - ] = None + self._credential_list_mappings: Optional[AuthCallsCredentialListMappingList] = ( + None + ) self._ip_access_control_list_mappings: Optional[ AuthCallsIpAccessControlListMappingList ] = None 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 3ddec185c3..81bb5b0b0c 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class AuthCallsCredentialListMappingInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource. :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. @@ -126,6 +124,7 @@ def __repr__(self) -> str: class AuthCallsCredentialListMappingContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, domain_sid: str, sid: str): """ Initialize the AuthCallsCredentialListMappingContext @@ -226,6 +225,7 @@ def __repr__(self) -> str: class AuthCallsCredentialListMappingPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> AuthCallsCredentialListMappingInstance: @@ -251,6 +251,7 @@ def __repr__(self) -> str: class AuthCallsCredentialListMappingList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the AuthCallsCredentialListMappingList 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 c410104410..a690ef4b10 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class AuthCallsIpAccessControlListMappingInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IpAccessControlListMapping resource. :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. @@ -128,6 +126,7 @@ def __repr__(self) -> str: class AuthCallsIpAccessControlListMappingContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, domain_sid: str, sid: str): """ Initialize the AuthCallsIpAccessControlListMappingContext @@ -230,6 +229,7 @@ def __repr__(self) -> str: class AuthCallsIpAccessControlListMappingPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> AuthCallsIpAccessControlListMappingInstance: @@ -255,6 +255,7 @@ def __repr__(self) -> str: class AuthCallsIpAccessControlListMappingList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the AuthCallsIpAccessControlListMappingList diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/__init__.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/__init__.py index 41c1805ff2..c10c747378 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional @@ -25,6 +24,7 @@ class AuthTypeRegistrationsList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the AuthTypeRegistrationsList 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 37f05c7587..2b03bb2998 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class AuthRegistrationsCredentialListMappingInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource. :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. @@ -126,6 +124,7 @@ def __repr__(self) -> str: class AuthRegistrationsCredentialListMappingContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, domain_sid: str, sid: str): """ Initialize the AuthRegistrationsCredentialListMappingContext @@ -226,6 +225,7 @@ def __repr__(self) -> str: class AuthRegistrationsCredentialListMappingPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> AuthRegistrationsCredentialListMappingInstance: @@ -251,6 +251,7 @@ def __repr__(self) -> str: class AuthRegistrationsCredentialListMappingList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the AuthRegistrationsCredentialListMappingList 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 81fb012810..f7838bfc59 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class CredentialListMappingInstance(InstanceResource): - """ :ivar account_sid: The unique id of the Account that is responsible for this resource. :ivar date_created: The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. @@ -128,6 +126,7 @@ def __repr__(self) -> str: class CredentialListMappingContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, domain_sid: str, sid: str): """ Initialize the CredentialListMappingContext @@ -226,6 +225,7 @@ def __repr__(self) -> str: class CredentialListMappingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialListMappingInstance: """ Build an instance of CredentialListMappingInstance @@ -249,6 +249,7 @@ def __repr__(self) -> str: class CredentialListMappingList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the CredentialListMappingList 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 bbea7ade36..c619be386f 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class IpAccessControlListMappingInstance(InstanceResource): - """ :ivar account_sid: The unique id of the Account that is responsible for this resource. :ivar date_created: The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. @@ -130,6 +128,7 @@ def __repr__(self) -> str: class IpAccessControlListMappingContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, domain_sid: str, sid: str): """ Initialize the IpAccessControlListMappingContext @@ -228,6 +227,7 @@ def __repr__(self) -> str: class IpAccessControlListMappingPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> IpAccessControlListMappingInstance: @@ -253,6 +253,7 @@ def __repr__(self) -> str: class IpAccessControlListMappingList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the IpAccessControlListMappingList 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 33b219f39b..7c2fd8214a 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class IpAccessControlListInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies this resource. :ivar account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) that owns this resource. @@ -161,6 +159,7 @@ def __repr__(self) -> str: class IpAccessControlListContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the IpAccessControlListContext @@ -326,6 +325,7 @@ def __repr__(self) -> str: class IpAccessControlListPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> IpAccessControlListInstance: """ Build an instance of IpAccessControlListInstance @@ -346,6 +346,7 @@ def __repr__(self) -> str: class IpAccessControlListList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the IpAccessControlListList 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 362b645fa3..251bae9655 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class IpAddressInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies this resource. :ivar account_sid: The unique id of the Account that is responsible for this resource. @@ -178,6 +176,7 @@ def __repr__(self) -> str: class IpAddressContext(InstanceContext): + def __init__( self, version: Version, @@ -356,6 +355,7 @@ def __repr__(self) -> str: class IpAddressPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> IpAddressInstance: """ Build an instance of IpAddressInstance @@ -379,6 +379,7 @@ def __repr__(self) -> str: class IpAddressList(ListResource): + def __init__( self, version: Version, account_sid: str, ip_access_control_list_sid: str ): diff --git a/twilio/rest/api/v2010/account/token.py b/twilio/rest/api/v2010/account/token.py index 3d00c3cf0c..ec5acac97f 100644 --- a/twilio/rest/api/v2010/account/token.py +++ b/twilio/rest/api/v2010/account/token.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class TokenInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Token resource. :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. @@ -64,6 +62,7 @@ def __repr__(self) -> str: class TokenList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the TokenList diff --git a/twilio/rest/api/v2010/account/transcription.py b/twilio/rest/api/v2010/account/transcription.py index 2baa8af865..a77bc42fb4 100644 --- a/twilio/rest/api/v2010/account/transcription.py +++ b/twilio/rest/api/v2010/account/transcription.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class TranscriptionInstance(InstanceResource): + class Status(object): IN_PROGRESS = "in-progress" COMPLETED = "completed" @@ -141,6 +141,7 @@ def __repr__(self) -> str: class TranscriptionContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the TranscriptionContext @@ -235,6 +236,7 @@ def __repr__(self) -> str: class TranscriptionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TranscriptionInstance: """ Build an instance of TranscriptionInstance @@ -255,6 +257,7 @@ def __repr__(self) -> str: class TranscriptionList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the TranscriptionList diff --git a/twilio/rest/api/v2010/account/usage/__init__.py b/twilio/rest/api/v2010/account/usage/__init__.py index 3f3f2c76fb..8fe80f64ba 100644 --- a/twilio/rest/api/v2010/account/usage/__init__.py +++ b/twilio/rest/api/v2010/account/usage/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional @@ -24,6 +23,7 @@ class UsageList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the UsageList diff --git a/twilio/rest/api/v2010/account/usage/record/__init__.py b/twilio/rest/api/v2010/account/usage/record/__init__.py index 356526f854..8f8236fa23 100644 --- a/twilio/rest/api/v2010/account/usage/record/__init__.py +++ b/twilio/rest/api/v2010/account/usage/record/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -32,6 +31,7 @@ class RecordInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -413,6 +413,7 @@ def __repr__(self) -> str: class RecordPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RecordInstance: """ Build an instance of RecordInstance @@ -433,6 +434,7 @@ def __repr__(self) -> str: class RecordList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the RecordList diff --git a/twilio/rest/api/v2010/account/usage/record/all_time.py b/twilio/rest/api/v2010/account/usage/record/all_time.py index e61511d41e..5c424bbb80 100644 --- a/twilio/rest/api/v2010/account/usage/record/all_time.py +++ b/twilio/rest/api/v2010/account/usage/record/all_time.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class AllTimeInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -405,6 +405,7 @@ def __repr__(self) -> str: class AllTimePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AllTimeInstance: """ Build an instance of AllTimeInstance @@ -425,6 +426,7 @@ def __repr__(self) -> str: class AllTimeList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the AllTimeList diff --git a/twilio/rest/api/v2010/account/usage/record/daily.py b/twilio/rest/api/v2010/account/usage/record/daily.py index 783a16ac81..6ce34da022 100644 --- a/twilio/rest/api/v2010/account/usage/record/daily.py +++ b/twilio/rest/api/v2010/account/usage/record/daily.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class DailyInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -405,6 +405,7 @@ def __repr__(self) -> str: class DailyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DailyInstance: """ Build an instance of DailyInstance @@ -425,6 +426,7 @@ def __repr__(self) -> str: class DailyList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the DailyList diff --git a/twilio/rest/api/v2010/account/usage/record/last_month.py b/twilio/rest/api/v2010/account/usage/record/last_month.py index 22ed568cf0..53b6deec6f 100644 --- a/twilio/rest/api/v2010/account/usage/record/last_month.py +++ b/twilio/rest/api/v2010/account/usage/record/last_month.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class LastMonthInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -405,6 +405,7 @@ def __repr__(self) -> str: class LastMonthPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> LastMonthInstance: """ Build an instance of LastMonthInstance @@ -425,6 +426,7 @@ def __repr__(self) -> str: class LastMonthList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the LastMonthList diff --git a/twilio/rest/api/v2010/account/usage/record/monthly.py b/twilio/rest/api/v2010/account/usage/record/monthly.py index b64ef27f74..baa1164a7d 100644 --- a/twilio/rest/api/v2010/account/usage/record/monthly.py +++ b/twilio/rest/api/v2010/account/usage/record/monthly.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class MonthlyInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -405,6 +405,7 @@ def __repr__(self) -> str: class MonthlyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MonthlyInstance: """ Build an instance of MonthlyInstance @@ -425,6 +426,7 @@ def __repr__(self) -> str: class MonthlyList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the MonthlyList diff --git a/twilio/rest/api/v2010/account/usage/record/this_month.py b/twilio/rest/api/v2010/account/usage/record/this_month.py index 3515831260..5ce2ddc58a 100644 --- a/twilio/rest/api/v2010/account/usage/record/this_month.py +++ b/twilio/rest/api/v2010/account/usage/record/this_month.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class ThisMonthInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -405,6 +405,7 @@ def __repr__(self) -> str: class ThisMonthPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ThisMonthInstance: """ Build an instance of ThisMonthInstance @@ -425,6 +426,7 @@ def __repr__(self) -> str: class ThisMonthList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the ThisMonthList diff --git a/twilio/rest/api/v2010/account/usage/record/today.py b/twilio/rest/api/v2010/account/usage/record/today.py index 9b47ad6969..cb814db819 100644 --- a/twilio/rest/api/v2010/account/usage/record/today.py +++ b/twilio/rest/api/v2010/account/usage/record/today.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class TodayInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -405,6 +405,7 @@ def __repr__(self) -> str: class TodayPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TodayInstance: """ Build an instance of TodayInstance @@ -425,6 +426,7 @@ def __repr__(self) -> str: class TodayList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the TodayList diff --git a/twilio/rest/api/v2010/account/usage/record/yearly.py b/twilio/rest/api/v2010/account/usage/record/yearly.py index b53ae265af..ac757b9eb7 100644 --- a/twilio/rest/api/v2010/account/usage/record/yearly.py +++ b/twilio/rest/api/v2010/account/usage/record/yearly.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class YearlyInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -405,6 +405,7 @@ def __repr__(self) -> str: class YearlyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> YearlyInstance: """ Build an instance of YearlyInstance @@ -425,6 +426,7 @@ def __repr__(self) -> str: class YearlyList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the YearlyList diff --git a/twilio/rest/api/v2010/account/usage/record/yesterday.py b/twilio/rest/api/v2010/account/usage/record/yesterday.py index 4a7e246f0f..ab262b7092 100644 --- a/twilio/rest/api/v2010/account/usage/record/yesterday.py +++ b/twilio/rest/api/v2010/account/usage/record/yesterday.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class YesterdayInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -405,6 +405,7 @@ def __repr__(self) -> str: class YesterdayPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> YesterdayInstance: """ Build an instance of YesterdayInstance @@ -425,6 +426,7 @@ def __repr__(self) -> str: class YesterdayList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the YesterdayList diff --git a/twilio/rest/api/v2010/account/usage/trigger.py b/twilio/rest/api/v2010/account/usage/trigger.py index 67fd82f780..66e86602af 100644 --- a/twilio/rest/api/v2010/account/usage/trigger.py +++ b/twilio/rest/api/v2010/account/usage/trigger.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class TriggerInstance(InstanceResource): + class Recurring(object): DAILY = "daily" MONTHLY = "monthly" @@ -524,6 +524,7 @@ def __repr__(self) -> str: class TriggerContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the TriggerContext @@ -690,6 +691,7 @@ def __repr__(self) -> str: class TriggerPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TriggerInstance: """ Build an instance of TriggerInstance @@ -710,6 +712,7 @@ def __repr__(self) -> str: class TriggerList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the TriggerList diff --git a/twilio/rest/api/v2010/account/validation_request.py b/twilio/rest/api/v2010/account/validation_request.py index d126cea26c..a949df2d0a 100644 --- a/twilio/rest/api/v2010/account/validation_request.py +++ b/twilio/rest/api/v2010/account/validation_request.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values @@ -22,7 +21,6 @@ class ValidationRequestInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for the Caller ID. :ivar call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Caller ID is associated with. @@ -55,6 +53,7 @@ def __repr__(self) -> str: class ValidationRequestList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the ValidationRequestList diff --git a/twilio/rest/autopilot/AutopilotBase.py b/twilio/rest/autopilot/AutopilotBase.py deleted file mode 100644 index 3b1a7f7112..0000000000 --- a/twilio/rest/autopilot/AutopilotBase.py +++ /dev/null @@ -1,43 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional - -from twilio.base.domain import Domain -from twilio.rest import Client -from twilio.rest.autopilot.v1 import V1 - - -class AutopilotBase(Domain): - def __init__(self, twilio: Client): - """ - Initialize the Autopilot Domain - - :returns: Domain for Autopilot - """ - super().__init__(twilio, "https://autopilot.twilio.com") - self._v1: Optional[V1] = None - - @property - def v1(self) -> V1: - """ - :returns: Versions v1 of Autopilot - """ - if self._v1 is None: - self._v1 = V1(self) - return self._v1 - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/__init__.py b/twilio/rest/autopilot/v1/__init__.py deleted file mode 100644 index fd23e47670..0000000000 --- a/twilio/rest/autopilot/v1/__init__.py +++ /dev/null @@ -1,50 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional -from twilio.base.version import Version -from twilio.base.domain import Domain -from twilio.rest.autopilot.v1.assistant import AssistantList -from twilio.rest.autopilot.v1.restore_assistant import RestoreAssistantList - - -class V1(Version): - def __init__(self, domain: Domain): - """ - Initialize the V1 version of Autopilot - - :param domain: The Twilio.autopilot domain - """ - super().__init__(domain, "v1") - self._assistants: Optional[AssistantList] = None - self._restore_assistant: Optional[RestoreAssistantList] = None - - @property - def assistants(self) -> AssistantList: - if self._assistants is None: - self._assistants = AssistantList(self) - return self._assistants - - @property - def restore_assistant(self) -> RestoreAssistantList: - if self._restore_assistant is None: - self._restore_assistant = RestoreAssistantList(self) - return self._restore_assistant - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/__init__.py b/twilio/rest/autopilot/v1/assistant/__init__.py deleted file mode 100644 index 0420e5a1de..0000000000 --- a/twilio/rest/autopilot/v1/assistant/__init__.py +++ /dev/null @@ -1,881 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -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 -from twilio.base.page import Page -from twilio.rest.autopilot.v1.assistant.defaults import DefaultsList -from twilio.rest.autopilot.v1.assistant.dialogue import DialogueList -from twilio.rest.autopilot.v1.assistant.field_type import FieldTypeList -from twilio.rest.autopilot.v1.assistant.model_build import ModelBuildList -from twilio.rest.autopilot.v1.assistant.query import QueryList -from twilio.rest.autopilot.v1.assistant.style_sheet import StyleSheetList -from twilio.rest.autopilot.v1.assistant.task import TaskList -from twilio.rest.autopilot.v1.assistant.webhook import WebhookList - - -class AssistantInstance(InstanceResource): - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Assistant resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar friendly_name: The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - :ivar latest_model_build_sid: Reserved. - :ivar links: A list of the URLs of the Assistant's related resources. - :ivar log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :ivar development_stage: A string describing the state of the assistant. - :ivar needs_model_build: Whether model needs to be rebuilt. - :ivar sid: The unique string that we created to identify the Assistant resource. - :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. It can be up to 64 characters long. - :ivar url: The absolute URL of the Assistant resource. - :ivar callback_url: Reserved. - :ivar callback_events: Reserved. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.latest_model_build_sid: Optional[str] = payload.get( - "latest_model_build_sid" - ) - self.links: Optional[Dict[str, object]] = payload.get("links") - self.log_queries: Optional[bool] = payload.get("log_queries") - self.development_stage: Optional[str] = payload.get("development_stage") - self.needs_model_build: Optional[bool] = payload.get("needs_model_build") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - self.callback_url: Optional[str] = payload.get("callback_url") - self.callback_events: Optional[str] = payload.get("callback_events") - - self._solution = { - "sid": sid or self.sid, - } - self._context: Optional[AssistantContext] = None - - @property - def _proxy(self) -> "AssistantContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: AssistantContext for this AssistantInstance - """ - if self._context is None: - self._context = AssistantContext( - self._version, - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "AssistantInstance": - """ - Fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "AssistantInstance": - """ - Asynchronous coroutine to fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - defaults: Union[object, object] = values.unset, - development_stage: Union[str, object] = values.unset, - ) -> "AssistantInstance": - """ - Update the AssistantInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param callback_url: Reserved. - :param callback_events: Reserved. - :param style_sheet: The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - :param defaults: A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - :param development_stage: A string describing the state of the assistant. - - :returns: The updated AssistantInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - log_queries=log_queries, - unique_name=unique_name, - callback_url=callback_url, - callback_events=callback_events, - style_sheet=style_sheet, - defaults=defaults, - development_stage=development_stage, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - defaults: Union[object, object] = values.unset, - development_stage: Union[str, object] = values.unset, - ) -> "AssistantInstance": - """ - Asynchronous coroutine to update the AssistantInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param callback_url: Reserved. - :param callback_events: Reserved. - :param style_sheet: The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - :param defaults: A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - :param development_stage: A string describing the state of the assistant. - - :returns: The updated AssistantInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - log_queries=log_queries, - unique_name=unique_name, - callback_url=callback_url, - callback_events=callback_events, - style_sheet=style_sheet, - defaults=defaults, - development_stage=development_stage, - ) - - @property - def defaults(self) -> DefaultsList: - """ - Access the defaults - """ - return self._proxy.defaults - - @property - def dialogues(self) -> DialogueList: - """ - Access the dialogues - """ - return self._proxy.dialogues - - @property - def field_types(self) -> FieldTypeList: - """ - Access the field_types - """ - return self._proxy.field_types - - @property - def model_builds(self) -> ModelBuildList: - """ - Access the model_builds - """ - return self._proxy.model_builds - - @property - def queries(self) -> QueryList: - """ - Access the queries - """ - return self._proxy.queries - - @property - def style_sheet(self) -> StyleSheetList: - """ - Access the style_sheet - """ - return self._proxy.style_sheet - - @property - def tasks(self) -> TaskList: - """ - Access the tasks - """ - return self._proxy.tasks - - @property - def webhooks(self) -> WebhookList: - """ - Access the webhooks - """ - return self._proxy.webhooks - - 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 AssistantContext(InstanceContext): - def __init__(self, version: Version, sid: str): - """ - Initialize the AssistantContext - - :param version: Version that contains the resource - :param sid: The Twilio-provided string that uniquely identifies the Assistant resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "sid": sid, - } - self._uri = "/Assistants/{sid}".format(**self._solution) - - self._defaults: Optional[DefaultsList] = None - self._dialogues: Optional[DialogueList] = None - self._field_types: Optional[FieldTypeList] = None - self._model_builds: Optional[ModelBuildList] = None - self._queries: Optional[QueryList] = None - self._style_sheet: Optional[StyleSheetList] = None - self._tasks: Optional[TaskList] = None - self._webhooks: Optional[WebhookList] = None - - def delete(self) -> bool: - """ - Deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> AssistantInstance: - """ - Fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return AssistantInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> AssistantInstance: - """ - Asynchronous coroutine to fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return AssistantInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - defaults: Union[object, object] = values.unset, - development_stage: Union[str, object] = values.unset, - ) -> AssistantInstance: - """ - Update the AssistantInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param callback_url: Reserved. - :param callback_events: Reserved. - :param style_sheet: The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - :param defaults: A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - :param development_stage: A string describing the state of the assistant. - - :returns: The updated AssistantInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "StyleSheet": serialize.object(style_sheet), - "Defaults": serialize.object(defaults), - "DevelopmentStage": development_stage, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload, sid=self._solution["sid"]) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - defaults: Union[object, object] = values.unset, - development_stage: Union[str, object] = values.unset, - ) -> AssistantInstance: - """ - Asynchronous coroutine to update the AssistantInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param callback_url: Reserved. - :param callback_events: Reserved. - :param style_sheet: The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - :param defaults: A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - :param development_stage: A string describing the state of the assistant. - - :returns: The updated AssistantInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "StyleSheet": serialize.object(style_sheet), - "Defaults": serialize.object(defaults), - "DevelopmentStage": development_stage, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload, sid=self._solution["sid"]) - - @property - def defaults(self) -> DefaultsList: - """ - Access the defaults - """ - if self._defaults is None: - self._defaults = DefaultsList( - self._version, - self._solution["sid"], - ) - return self._defaults - - @property - def dialogues(self) -> DialogueList: - """ - Access the dialogues - """ - if self._dialogues is None: - self._dialogues = DialogueList( - self._version, - self._solution["sid"], - ) - return self._dialogues - - @property - def field_types(self) -> FieldTypeList: - """ - Access the field_types - """ - if self._field_types is None: - self._field_types = FieldTypeList( - self._version, - self._solution["sid"], - ) - return self._field_types - - @property - def model_builds(self) -> ModelBuildList: - """ - Access the model_builds - """ - if self._model_builds is None: - self._model_builds = ModelBuildList( - self._version, - self._solution["sid"], - ) - return self._model_builds - - @property - def queries(self) -> QueryList: - """ - Access the queries - """ - if self._queries is None: - self._queries = QueryList( - self._version, - self._solution["sid"], - ) - return self._queries - - @property - def style_sheet(self) -> StyleSheetList: - """ - Access the style_sheet - """ - if self._style_sheet is None: - self._style_sheet = StyleSheetList( - self._version, - self._solution["sid"], - ) - return self._style_sheet - - @property - def tasks(self) -> TaskList: - """ - Access the tasks - """ - if self._tasks is None: - self._tasks = TaskList( - self._version, - self._solution["sid"], - ) - return self._tasks - - @property - def webhooks(self) -> WebhookList: - """ - Access the webhooks - """ - if self._webhooks is None: - self._webhooks = WebhookList( - self._version, - self._solution["sid"], - ) - return self._webhooks - - 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 AssistantPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> AssistantInstance: - """ - Build an instance of AssistantInstance - - :param payload: Payload response from the API - """ - return AssistantInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class AssistantList(ListResource): - def __init__(self, version: Version): - """ - Initialize the AssistantList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Assistants" - - def create( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - defaults: Union[object, object] = values.unset, - ) -> AssistantInstance: - """ - Create the AssistantInstance - - :param friendly_name: A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - :param log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param callback_url: Reserved. - :param callback_events: Reserved. - :param style_sheet: The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - :param defaults: A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - - :returns: The created AssistantInstance - """ - - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "StyleSheet": serialize.object(style_sheet), - "Defaults": serialize.object(defaults), - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload) - - async def create_async( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - defaults: Union[object, object] = values.unset, - ) -> AssistantInstance: - """ - Asynchronously create the AssistantInstance - - :param friendly_name: A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - :param log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param callback_url: Reserved. - :param callback_events: Reserved. - :param style_sheet: The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - :param defaults: A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - - :returns: The created AssistantInstance - """ - - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "StyleSheet": serialize.object(style_sheet), - "Defaults": serialize.object(defaults), - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[AssistantInstance]: - """ - Streams AssistantInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[AssistantInstance]: - """ - Asynchronously streams AssistantInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AssistantInstance]: - """ - Lists AssistantInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AssistantInstance]: - """ - Asynchronously lists AssistantInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AssistantPage: - """ - Retrieve a single page of AssistantInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of AssistantInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return AssistantPage(self._version, response) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AssistantPage: - """ - Asynchronously retrieve a single page of AssistantInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of AssistantInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return AssistantPage(self._version, response) - - def get_page(self, target_url: str) -> AssistantPage: - """ - Retrieve a specific page of AssistantInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AssistantInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return AssistantPage(self._version, response) - - async def get_page_async(self, target_url: str) -> AssistantPage: - """ - Asynchronously retrieve a specific page of AssistantInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AssistantInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return AssistantPage(self._version, response) - - def get(self, sid: str) -> AssistantContext: - """ - Constructs a AssistantContext - - :param sid: The Twilio-provided string that uniquely identifies the Assistant resource to update. - """ - return AssistantContext(self._version, sid=sid) - - def __call__(self, sid: str) -> AssistantContext: - """ - Constructs a AssistantContext - - :param sid: The Twilio-provided string that uniquely identifies the Assistant resource to update. - """ - return AssistantContext(self._version, sid=sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/defaults.py b/twilio/rest/autopilot/v1/assistant/defaults.py deleted file mode 100644 index 0db77b8417..0000000000 --- a/twilio/rest/autopilot/v1/assistant/defaults.py +++ /dev/null @@ -1,273 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from typing import Any, Dict, Optional, Union -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 -from twilio.base.version import Version - - -class DefaultsInstance(InstanceResource): - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Defaults resource. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar url: The absolute URL of the Defaults resource. - :ivar data: The JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. - """ - - def __init__(self, version: Version, payload: Dict[str, Any], assistant_sid: str): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.url: Optional[str] = payload.get("url") - self.data: Optional[Dict[str, object]] = payload.get("data") - - self._solution = { - "assistant_sid": assistant_sid, - } - self._context: Optional[DefaultsContext] = None - - @property - def _proxy(self) -> "DefaultsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: DefaultsContext for this DefaultsInstance - """ - if self._context is None: - self._context = DefaultsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - ) - return self._context - - def fetch(self) -> "DefaultsInstance": - """ - Fetch the DefaultsInstance - - - :returns: The fetched DefaultsInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "DefaultsInstance": - """ - Asynchronous coroutine to fetch the DefaultsInstance - - - :returns: The fetched DefaultsInstance - """ - return await self._proxy.fetch_async() - - def update( - self, defaults: Union[object, object] = values.unset - ) -> "DefaultsInstance": - """ - Update the DefaultsInstance - - :param defaults: A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. - - :returns: The updated DefaultsInstance - """ - return self._proxy.update( - defaults=defaults, - ) - - async def update_async( - self, defaults: Union[object, object] = values.unset - ) -> "DefaultsInstance": - """ - Asynchronous coroutine to update the DefaultsInstance - - :param defaults: A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. - - :returns: The updated DefaultsInstance - """ - return await self._proxy.update_async( - defaults=defaults, - ) - - 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 DefaultsContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the DefaultsContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/Defaults".format(**self._solution) - - def fetch(self) -> DefaultsInstance: - """ - Fetch the DefaultsInstance - - - :returns: The fetched DefaultsInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return DefaultsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - async def fetch_async(self) -> DefaultsInstance: - """ - Asynchronous coroutine to fetch the DefaultsInstance - - - :returns: The fetched DefaultsInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return DefaultsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - def update( - self, defaults: Union[object, object] = values.unset - ) -> DefaultsInstance: - """ - Update the DefaultsInstance - - :param defaults: A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. - - :returns: The updated DefaultsInstance - """ - data = values.of( - { - "Defaults": serialize.object(defaults), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return DefaultsInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def update_async( - self, defaults: Union[object, object] = values.unset - ) -> DefaultsInstance: - """ - Asynchronous coroutine to update the DefaultsInstance - - :param defaults: A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. - - :returns: The updated DefaultsInstance - """ - data = values.of( - { - "Defaults": serialize.object(defaults), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return DefaultsInstance( - self._version, payload, assistant_sid=self._solution["assistant_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 DefaultsList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the DefaultsList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - - def get(self) -> DefaultsContext: - """ - Constructs a DefaultsContext - - """ - return DefaultsContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __call__(self) -> DefaultsContext: - """ - Constructs a DefaultsContext - - """ - return DefaultsContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/dialogue.py b/twilio/rest/autopilot/v1/assistant/dialogue.py deleted file mode 100644 index 6e06f4ff2b..0000000000 --- a/twilio/rest/autopilot/v1/assistant/dialogue.py +++ /dev/null @@ -1,210 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from typing import Any, Dict, Optional -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class DialogueInstance(InstanceResource): - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Dialogue resource. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar sid: The unique string that we created to identify the Dialogue resource. - :ivar data: The JSON string that describes the dialogue session object. - :ivar url: The absolute URL of the Dialogue resource. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.data: Optional[Dict[str, object]] = payload.get("data") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[DialogueContext] = None - - @property - def _proxy(self) -> "DialogueContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: DialogueContext for this DialogueInstance - """ - if self._context is None: - self._context = DialogueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def fetch(self) -> "DialogueInstance": - """ - Fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "DialogueInstance": - """ - Asynchronous coroutine to fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DialogueContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the DialogueContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - :param sid: The Twilio-provided string that uniquely identifies the Dialogue resource to fetch. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Dialogues/{sid}".format( - **self._solution - ) - - def fetch(self) -> DialogueInstance: - """ - Fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return DialogueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> DialogueInstance: - """ - Asynchronous coroutine to fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return DialogueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_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 DialogueList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the DialogueList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - - def get(self, sid: str) -> DialogueContext: - """ - Constructs a DialogueContext - - :param sid: The Twilio-provided string that uniquely identifies the Dialogue resource to fetch. - """ - return DialogueContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> DialogueContext: - """ - Constructs a DialogueContext - - :param sid: The Twilio-provided string that uniquely identifies the Dialogue resource to fetch. - """ - return DialogueContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/field_type/__init__.py b/twilio/rest/autopilot/v1/assistant/field_type/__init__.py deleted file mode 100644 index 3dcee087b4..0000000000 --- a/twilio/rest/autopilot/v1/assistant/field_type/__init__.py +++ /dev/null @@ -1,654 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.autopilot.v1.assistant.field_type.field_value import FieldValueList - - -class FieldTypeInstance(InstanceResource): - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the FieldType resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar friendly_name: The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - :ivar links: A list of the URLs of related resources. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar sid: The unique string that we created to identify the FieldType resource. - :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - :ivar url: The absolute URL of the FieldType resource. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.links: Optional[Dict[str, object]] = payload.get("links") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[FieldTypeContext] = None - - @property - def _proxy(self) -> "FieldTypeContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FieldTypeContext for this FieldTypeInstance - """ - if self._context is None: - self._context = FieldTypeContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FieldTypeInstance": - """ - Fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FieldTypeInstance": - """ - Asynchronous coroutine to fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> "FieldTypeInstance": - """ - Update the FieldTypeInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - - :returns: The updated FieldTypeInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - unique_name=unique_name, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> "FieldTypeInstance": - """ - Asynchronous coroutine to update the FieldTypeInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - - :returns: The updated FieldTypeInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - unique_name=unique_name, - ) - - @property - def field_values(self) -> FieldValueList: - """ - Access the field_values - """ - return self._proxy.field_values - - 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 FieldTypeContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the FieldTypeContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the to update. - :param sid: The Twilio-provided string that uniquely identifies the FieldType resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes/{sid}".format( - **self._solution - ) - - self._field_values: Optional[FieldValueList] = None - - def delete(self) -> bool: - """ - Deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FieldTypeInstance: - """ - Fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FieldTypeInstance: - """ - Asynchronous coroutine to fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> FieldTypeInstance: - """ - Update the FieldTypeInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - - :returns: The updated FieldTypeInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> FieldTypeInstance: - """ - Asynchronous coroutine to update the FieldTypeInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - - :returns: The updated FieldTypeInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - @property - def field_values(self) -> FieldValueList: - """ - Access the field_values - """ - if self._field_values is None: - self._field_values = FieldValueList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._field_values - - 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 FieldTypePage(Page): - def get_instance(self, payload: Dict[str, Any]) -> FieldTypeInstance: - """ - Build an instance of FieldTypeInstance - - :param payload: Payload response from the API - """ - return FieldTypeInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class FieldTypeList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the FieldTypeList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes".format(**self._solution) - - def create( - self, unique_name: str, friendly_name: Union[str, object] = values.unset - ) -> FieldTypeInstance: - """ - Create the FieldTypeInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param friendly_name: A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - - :returns: The created FieldTypeInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, unique_name: str, friendly_name: Union[str, object] = values.unset - ) -> FieldTypeInstance: - """ - Asynchronously create the FieldTypeInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param friendly_name: A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - - :returns: The created FieldTypeInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[FieldTypeInstance]: - """ - Streams FieldTypeInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[FieldTypeInstance]: - """ - Asynchronously streams FieldTypeInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldTypeInstance]: - """ - Lists FieldTypeInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldTypeInstance]: - """ - Asynchronously lists FieldTypeInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldTypePage: - """ - Retrieve a single page of FieldTypeInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of FieldTypeInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return FieldTypePage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldTypePage: - """ - Asynchronously retrieve a single page of FieldTypeInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of FieldTypeInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return FieldTypePage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> FieldTypePage: - """ - Retrieve a specific page of FieldTypeInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldTypeInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return FieldTypePage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> FieldTypePage: - """ - Asynchronously retrieve a specific page of FieldTypeInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldTypeInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return FieldTypePage(self._version, response, self._solution) - - def get(self, sid: str) -> FieldTypeContext: - """ - Constructs a FieldTypeContext - - :param sid: The Twilio-provided string that uniquely identifies the FieldType resource to update. - """ - return FieldTypeContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> FieldTypeContext: - """ - Constructs a FieldTypeContext - - :param sid: The Twilio-provided string that uniquely identifies the FieldType resource to update. - """ - return FieldTypeContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/field_type/field_value.py b/twilio/rest/autopilot/v1/assistant/field_type/field_value.py deleted file mode 100644 index ba38a9f3ce..0000000000 --- a/twilio/rest/autopilot/v1/assistant/field_type/field_value.py +++ /dev/null @@ -1,579 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class FieldValueInstance(InstanceResource): - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the FieldValue resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar field_type_sid: The SID of the Field Type associated with the Field Value. - :ivar language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resource. - :ivar sid: The unique string that we created to identify the FieldValue resource. - :ivar value: The Field Value data. - :ivar url: The absolute URL of the FieldValue resource. - :ivar synonym_of: The word for which the field value is a synonym of. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - field_type_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.field_type_sid: Optional[str] = payload.get("field_type_sid") - self.language: Optional[str] = payload.get("language") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.value: Optional[str] = payload.get("value") - self.url: Optional[str] = payload.get("url") - self.synonym_of: Optional[str] = payload.get("synonym_of") - - self._solution = { - "assistant_sid": assistant_sid, - "field_type_sid": field_type_sid, - "sid": sid or self.sid, - } - self._context: Optional[FieldValueContext] = None - - @property - def _proxy(self) -> "FieldValueContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FieldValueContext for this FieldValueInstance - """ - if self._context is None: - self._context = FieldValueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FieldValueInstance": - """ - Fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FieldValueInstance": - """ - Asynchronous coroutine to fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldValueContext(InstanceContext): - def __init__( - self, version: Version, assistant_sid: str, field_type_sid: str, sid: str - ): - """ - Initialize the FieldValueContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resource to fetch. - :param field_type_sid: The SID of the Field Type associated with the Field Value to fetch. - :param sid: The Twilio-provided string that uniquely identifies the FieldValue resource to fetch. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "field_type_sid": field_type_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes/{field_type_sid}/FieldValues/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FieldValueInstance: - """ - Fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FieldValueInstance: - """ - Asynchronous coroutine to fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_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 FieldValuePage(Page): - def get_instance(self, payload: Dict[str, Any]) -> FieldValueInstance: - """ - Build an instance of FieldValueInstance - - :param payload: Payload response from the API - """ - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class FieldValueList(ListResource): - def __init__(self, version: Version, assistant_sid: str, field_type_sid: str): - """ - Initialize the FieldValueList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resources to read. - :param field_type_sid: The SID of the Field Type associated with the Field Value to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "field_type_sid": field_type_sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes/{field_type_sid}/FieldValues".format( - **self._solution - ) - - def create( - self, language: str, value: str, synonym_of: Union[str, object] = values.unset - ) -> FieldValueInstance: - """ - Create the FieldValueInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :param value: The Field Value data. - :param synonym_of: The string value that indicates which word the field value is a synonym of. - - :returns: The created FieldValueInstance - """ - - data = values.of( - { - "Language": language, - "Value": value, - "SynonymOf": synonym_of, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - ) - - async def create_async( - self, language: str, value: str, synonym_of: Union[str, object] = values.unset - ) -> FieldValueInstance: - """ - Asynchronously create the FieldValueInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :param value: The Field Value data. - :param synonym_of: The string value that indicates which word the field value is a synonym of. - - :returns: The created FieldValueInstance - """ - - data = values.of( - { - "Language": language, - "Value": value, - "SynonymOf": synonym_of, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - ) - - def stream( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[FieldValueInstance]: - """ - Streams FieldValueInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(language=language, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[FieldValueInstance]: - """ - Asynchronously streams FieldValueInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(language=language, page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldValueInstance]: - """ - Lists FieldValueInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - language=language, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldValueInstance]: - """ - Asynchronously lists FieldValueInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - language=language, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldValuePage: - """ - Retrieve a single page of FieldValueInstance records from the API. - Request is executed immediately - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :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 - - :returns: Page of FieldValueInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return FieldValuePage(self._version, response, self._solution) - - async def page_async( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldValuePage: - """ - Asynchronously retrieve a single page of FieldValueInstance records from the API. - Request is executed immediately - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :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 - - :returns: Page of FieldValueInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return FieldValuePage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> FieldValuePage: - """ - Retrieve a specific page of FieldValueInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldValueInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return FieldValuePage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> FieldValuePage: - """ - Asynchronously retrieve a specific page of FieldValueInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldValueInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return FieldValuePage(self._version, response, self._solution) - - def get(self, sid: str) -> FieldValueContext: - """ - Constructs a FieldValueContext - - :param sid: The Twilio-provided string that uniquely identifies the FieldValue resource to fetch. - """ - return FieldValueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=sid, - ) - - def __call__(self, sid: str) -> FieldValueContext: - """ - Constructs a FieldValueContext - - :param sid: The Twilio-provided string that uniquely identifies the FieldValue resource to fetch. - """ - return FieldValueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/model_build.py b/twilio/rest/autopilot/v1/assistant/model_build.py deleted file mode 100644 index 49db853f62..0000000000 --- a/twilio/rest/autopilot/v1/assistant/model_build.py +++ /dev/null @@ -1,629 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class ModelBuildInstance(InstanceResource): - class Status(object): - ENQUEUED = "enqueued" - BUILDING = "building" - COMPLETED = "completed" - FAILED = "failed" - CANCELED = "canceled" - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ModelBuild resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar sid: The unique string that we created to identify the ModelBuild resource. - :ivar status: - :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. - :ivar url: The absolute URL of the ModelBuild resource. - :ivar build_duration: The time in seconds it took to build the model. - :ivar error_code: If the `status` for the model build is `failed`, this value is a code to more information about the failure. This value will be null for all other statuses. See [error code dictionary](https://www.twilio.com/docs/api/errors) for a description of the error. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.status: Optional["ModelBuildInstance.Status"] = payload.get("status") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - self.build_duration: Optional[int] = deserialize.integer( - payload.get("build_duration") - ) - self.error_code: Optional[int] = deserialize.integer(payload.get("error_code")) - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[ModelBuildContext] = None - - @property - def _proxy(self) -> "ModelBuildContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: ModelBuildContext for this ModelBuildInstance - """ - if self._context is None: - self._context = ModelBuildContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "ModelBuildInstance": - """ - Fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "ModelBuildInstance": - """ - Asynchronous coroutine to fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - return await self._proxy.fetch_async() - - def update( - self, unique_name: Union[str, object] = values.unset - ) -> "ModelBuildInstance": - """ - Update the ModelBuildInstance - - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The updated ModelBuildInstance - """ - return self._proxy.update( - unique_name=unique_name, - ) - - async def update_async( - self, unique_name: Union[str, object] = values.unset - ) -> "ModelBuildInstance": - """ - Asynchronous coroutine to update the ModelBuildInstance - - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The updated ModelBuildInstance - """ - return await self._proxy.update_async( - unique_name=unique_name, - ) - - 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 ModelBuildContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the ModelBuildContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - :param sid: The Twilio-provided string that uniquely identifies the ModelBuild resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/ModelBuilds/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> ModelBuildInstance: - """ - Fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> ModelBuildInstance: - """ - Asynchronous coroutine to fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, unique_name: Union[str, object] = values.unset - ) -> ModelBuildInstance: - """ - Update the ModelBuildInstance - - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The updated ModelBuildInstance - """ - data = values.of( - { - "UniqueName": unique_name, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, unique_name: Union[str, object] = values.unset - ) -> ModelBuildInstance: - """ - Asynchronous coroutine to update the ModelBuildInstance - - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The updated ModelBuildInstance - """ - data = values.of( - { - "UniqueName": unique_name, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_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 ModelBuildPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> ModelBuildInstance: - """ - Build an instance of ModelBuildInstance - - :param payload: Payload response from the API - """ - return ModelBuildInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class ModelBuildList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the ModelBuildList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/ModelBuilds".format(**self._solution) - - def create( - self, - status_callback: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> ModelBuildInstance: - """ - Create the ModelBuildInstance - - :param status_callback: The URL we should call using a POST method to send status information to your application. - :param unique_name: An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The created ModelBuildInstance - """ - - data = values.of( - { - "StatusCallback": status_callback, - "UniqueName": unique_name, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, - status_callback: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> ModelBuildInstance: - """ - Asynchronously create the ModelBuildInstance - - :param status_callback: The URL we should call using a POST method to send status information to your application. - :param unique_name: An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The created ModelBuildInstance - """ - - data = values.of( - { - "StatusCallback": status_callback, - "UniqueName": unique_name, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[ModelBuildInstance]: - """ - Streams ModelBuildInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[ModelBuildInstance]: - """ - Asynchronously streams ModelBuildInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[ModelBuildInstance]: - """ - Lists ModelBuildInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[ModelBuildInstance]: - """ - Asynchronously lists ModelBuildInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> ModelBuildPage: - """ - Retrieve a single page of ModelBuildInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of ModelBuildInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return ModelBuildPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> ModelBuildPage: - """ - Asynchronously retrieve a single page of ModelBuildInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of ModelBuildInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return ModelBuildPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> ModelBuildPage: - """ - Retrieve a specific page of ModelBuildInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of ModelBuildInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return ModelBuildPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> ModelBuildPage: - """ - Asynchronously retrieve a specific page of ModelBuildInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of ModelBuildInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return ModelBuildPage(self._version, response, self._solution) - - def get(self, sid: str) -> ModelBuildContext: - """ - Constructs a ModelBuildContext - - :param sid: The Twilio-provided string that uniquely identifies the ModelBuild resource to update. - """ - return ModelBuildContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> ModelBuildContext: - """ - Constructs a ModelBuildContext - - :param sid: The Twilio-provided string that uniquely identifies the ModelBuild resource to update. - """ - return ModelBuildContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/query.py b/twilio/rest/autopilot/v1/assistant/query.py deleted file mode 100644 index 0edad0924b..0000000000 --- a/twilio/rest/autopilot/v1/assistant/query.py +++ /dev/null @@ -1,731 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class QueryInstance(InstanceResource): - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Query resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar results: The natural language analysis results that include the [Task](https://www.twilio.com/docs/autopilot/api/task) recognized and a list of identified [Fields](https://www.twilio.com/docs/autopilot/api/task-field). - :ivar language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query. For example: `en-US`. - :ivar model_build_sid: The SID of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) queried. - :ivar query: The end-user's natural language input. - :ivar sample_sid: The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar sid: The unique string that we created to identify the Query resource. - :ivar status: The status of the Query. Can be: `pending-review`, `reviewed`, or `discarded` - :ivar url: The absolute URL of the Query resource. - :ivar source_channel: The communication channel from where the end-user input came. - :ivar dialogue_sid: The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.results: Optional[Dict[str, object]] = payload.get("results") - self.language: Optional[str] = payload.get("language") - self.model_build_sid: Optional[str] = payload.get("model_build_sid") - self.query: Optional[str] = payload.get("query") - self.sample_sid: Optional[str] = payload.get("sample_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.status: Optional[str] = payload.get("status") - self.url: Optional[str] = payload.get("url") - self.source_channel: Optional[str] = payload.get("source_channel") - self.dialogue_sid: Optional[str] = payload.get("dialogue_sid") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[QueryContext] = None - - @property - def _proxy(self) -> "QueryContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: QueryContext for this QueryInstance - """ - if self._context is None: - self._context = QueryContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "QueryInstance": - """ - Fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "QueryInstance": - """ - Asynchronous coroutine to fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> "QueryInstance": - """ - Update the QueryInstance - - :param sample_sid: The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - :param status: The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` - - :returns: The updated QueryInstance - """ - return self._proxy.update( - sample_sid=sample_sid, - status=status, - ) - - async def update_async( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> "QueryInstance": - """ - Asynchronous coroutine to update the QueryInstance - - :param sample_sid: The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - :param status: The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` - - :returns: The updated QueryInstance - """ - return await self._proxy.update_async( - sample_sid=sample_sid, - 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 QueryContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the QueryContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - :param sid: The Twilio-provided string that uniquely identifies the Query resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Queries/{sid}".format(**self._solution) - - def delete(self) -> bool: - """ - Deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> QueryInstance: - """ - Fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> QueryInstance: - """ - Asynchronous coroutine to fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Update the QueryInstance - - :param sample_sid: The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - :param status: The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` - - :returns: The updated QueryInstance - """ - data = values.of( - { - "SampleSid": sample_sid, - "Status": status, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Asynchronous coroutine to update the QueryInstance - - :param sample_sid: The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - :param status: The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` - - :returns: The updated QueryInstance - """ - data = values.of( - { - "SampleSid": sample_sid, - "Status": status, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_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 QueryPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> QueryInstance: - """ - Build an instance of QueryInstance - - :param payload: Payload response from the API - """ - return QueryInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class QueryList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the QueryList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/Queries".format(**self._solution) - - def create( - self, - language: str, - query: str, - tasks: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Create the QueryInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new query. For example: `en-US`. - :param query: The end-user's natural language input. It can be up to 2048 characters long. - :param tasks: The list of tasks to limit the new query to. Tasks are expressed as a comma-separated list of task `unique_name` values. For example, `task-unique_name-1, task-unique_name-2`. Listing specific tasks is useful to constrain the paths that a user can take. - :param model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - - :returns: The created QueryInstance - """ - - data = values.of( - { - "Language": language, - "Query": query, - "Tasks": tasks, - "ModelBuild": model_build, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, - language: str, - query: str, - tasks: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Asynchronously create the QueryInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new query. For example: `en-US`. - :param query: The end-user's natural language input. It can be up to 2048 characters long. - :param tasks: The list of tasks to limit the new query to. Tasks are expressed as a comma-separated list of task `unique_name` values. For example, `task-unique_name-1, task-unique_name-2`. Listing specific tasks is useful to constrain the paths that a user can take. - :param model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - - :returns: The created QueryInstance - """ - - data = values.of( - { - "Language": language, - "Query": query, - "Tasks": tasks, - "ModelBuild": model_build, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - dialogue_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[QueryInstance]: - """ - Streams QueryInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - :param str model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - :param str status: The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - :param str dialogue_sid: The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page( - language=language, - model_build=model_build, - status=status, - dialogue_sid=dialogue_sid, - page_size=limits["page_size"], - ) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - dialogue_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[QueryInstance]: - """ - Asynchronously streams QueryInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - :param str model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - :param str status: The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - :param str dialogue_sid: The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async( - language=language, - model_build=model_build, - status=status, - dialogue_sid=dialogue_sid, - page_size=limits["page_size"], - ) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - dialogue_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[QueryInstance]: - """ - Lists QueryInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - :param str model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - :param str status: The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - :param str dialogue_sid: The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - language=language, - model_build=model_build, - status=status, - dialogue_sid=dialogue_sid, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - dialogue_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[QueryInstance]: - """ - Asynchronously lists QueryInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - :param str model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - :param str status: The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - :param str dialogue_sid: The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - language=language, - model_build=model_build, - status=status, - dialogue_sid=dialogue_sid, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - dialogue_sid: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> QueryPage: - """ - Retrieve a single page of QueryInstance records from the API. - Request is executed immediately - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - :param model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - :param status: The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - :param dialogue_sid: The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - :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 - - :returns: Page of QueryInstance - """ - data = values.of( - { - "Language": language, - "ModelBuild": model_build, - "Status": status, - "DialogueSid": dialogue_sid, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return QueryPage(self._version, response, self._solution) - - async def page_async( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - dialogue_sid: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> QueryPage: - """ - Asynchronously retrieve a single page of QueryInstance records from the API. - Request is executed immediately - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - :param model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - :param status: The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - :param dialogue_sid: The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - :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 - - :returns: Page of QueryInstance - """ - data = values.of( - { - "Language": language, - "ModelBuild": model_build, - "Status": status, - "DialogueSid": dialogue_sid, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return QueryPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> QueryPage: - """ - Retrieve a specific page of QueryInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of QueryInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return QueryPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> QueryPage: - """ - Asynchronously retrieve a specific page of QueryInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of QueryInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return QueryPage(self._version, response, self._solution) - - def get(self, sid: str) -> QueryContext: - """ - Constructs a QueryContext - - :param sid: The Twilio-provided string that uniquely identifies the Query resource to update. - """ - return QueryContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> QueryContext: - """ - Constructs a QueryContext - - :param sid: The Twilio-provided string that uniquely identifies the Query resource to update. - """ - return QueryContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/style_sheet.py b/twilio/rest/autopilot/v1/assistant/style_sheet.py deleted file mode 100644 index 980ab40111..0000000000 --- a/twilio/rest/autopilot/v1/assistant/style_sheet.py +++ /dev/null @@ -1,273 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from typing import Any, Dict, Optional, Union -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 -from twilio.base.version import Version - - -class StyleSheetInstance(InstanceResource): - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the StyleSheet resource. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar url: The absolute URL of the StyleSheet resource. - :ivar data: The JSON string that describes the style sheet object. - """ - - def __init__(self, version: Version, payload: Dict[str, Any], assistant_sid: str): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.url: Optional[str] = payload.get("url") - self.data: Optional[Dict[str, object]] = payload.get("data") - - self._solution = { - "assistant_sid": assistant_sid, - } - self._context: Optional[StyleSheetContext] = None - - @property - def _proxy(self) -> "StyleSheetContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: StyleSheetContext for this StyleSheetInstance - """ - if self._context is None: - self._context = StyleSheetContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - ) - return self._context - - def fetch(self) -> "StyleSheetInstance": - """ - Fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "StyleSheetInstance": - """ - Asynchronous coroutine to fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - return await self._proxy.fetch_async() - - def update( - self, style_sheet: Union[object, object] = values.unset - ) -> "StyleSheetInstance": - """ - Update the StyleSheetInstance - - :param style_sheet: The JSON string that describes the style sheet object. - - :returns: The updated StyleSheetInstance - """ - return self._proxy.update( - style_sheet=style_sheet, - ) - - async def update_async( - self, style_sheet: Union[object, object] = values.unset - ) -> "StyleSheetInstance": - """ - Asynchronous coroutine to update the StyleSheetInstance - - :param style_sheet: The JSON string that describes the style sheet object. - - :returns: The updated StyleSheetInstance - """ - return await self._proxy.update_async( - style_sheet=style_sheet, - ) - - 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 StyleSheetContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the StyleSheetContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/StyleSheet".format(**self._solution) - - def fetch(self) -> StyleSheetInstance: - """ - Fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return StyleSheetInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - async def fetch_async(self) -> StyleSheetInstance: - """ - Asynchronous coroutine to fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return StyleSheetInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - def update( - self, style_sheet: Union[object, object] = values.unset - ) -> StyleSheetInstance: - """ - Update the StyleSheetInstance - - :param style_sheet: The JSON string that describes the style sheet object. - - :returns: The updated StyleSheetInstance - """ - data = values.of( - { - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return StyleSheetInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def update_async( - self, style_sheet: Union[object, object] = values.unset - ) -> StyleSheetInstance: - """ - Asynchronous coroutine to update the StyleSheetInstance - - :param style_sheet: The JSON string that describes the style sheet object. - - :returns: The updated StyleSheetInstance - """ - data = values.of( - { - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return StyleSheetInstance( - self._version, payload, assistant_sid=self._solution["assistant_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 StyleSheetList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the StyleSheetList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - - def get(self) -> StyleSheetContext: - """ - Constructs a StyleSheetContext - - """ - return StyleSheetContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __call__(self) -> StyleSheetContext: - """ - Constructs a StyleSheetContext - - """ - return StyleSheetContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/task/__init__.py b/twilio/rest/autopilot/v1/assistant/task/__init__.py deleted file mode 100644 index 67c4f17920..0000000000 --- a/twilio/rest/autopilot/v1/assistant/task/__init__.py +++ /dev/null @@ -1,760 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -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 -from twilio.base.page import Page -from twilio.rest.autopilot.v1.assistant.task.field import FieldList -from twilio.rest.autopilot.v1.assistant.task.sample import SampleList -from twilio.rest.autopilot.v1.assistant.task.task_actions import TaskActionsList -from twilio.rest.autopilot.v1.assistant.task.task_statistics import TaskStatisticsList - - -class TaskInstance(InstanceResource): - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Task resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar friendly_name: The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - :ivar links: A list of the URLs of related resources. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar sid: The unique string that we created to identify the Task resource. - :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - :ivar actions_url: The URL from which the Assistant can fetch actions. - :ivar url: The absolute URL of the Task resource. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.links: Optional[Dict[str, object]] = payload.get("links") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.actions_url: Optional[str] = payload.get("actions_url") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[TaskContext] = None - - @property - def _proxy(self) -> "TaskContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: TaskContext for this TaskInstance - """ - if self._context is None: - self._context = TaskContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "TaskInstance": - """ - Fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "TaskInstance": - """ - Asynchronous coroutine to fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> "TaskInstance": - """ - Update the TaskInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - :param actions_url: The URL from which the Assistant can fetch actions. - - :returns: The updated TaskInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - unique_name=unique_name, - actions=actions, - actions_url=actions_url, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> "TaskInstance": - """ - Asynchronous coroutine to update the TaskInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - :param actions_url: The URL from which the Assistant can fetch actions. - - :returns: The updated TaskInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - unique_name=unique_name, - actions=actions, - actions_url=actions_url, - ) - - @property - def fields(self) -> FieldList: - """ - Access the fields - """ - return self._proxy.fields - - @property - def samples(self) -> SampleList: - """ - Access the samples - """ - return self._proxy.samples - - @property - def task_actions(self) -> TaskActionsList: - """ - Access the task_actions - """ - return self._proxy.task_actions - - @property - def statistics(self) -> TaskStatisticsList: - """ - Access the statistics - """ - return self._proxy.statistics - - 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 TaskContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the TaskContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - :param sid: The Twilio-provided string that uniquely identifies the Task resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{sid}".format(**self._solution) - - self._fields: Optional[FieldList] = None - self._samples: Optional[SampleList] = None - self._task_actions: Optional[TaskActionsList] = None - self._statistics: Optional[TaskStatisticsList] = None - - def delete(self) -> bool: - """ - Deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> TaskInstance: - """ - Fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> TaskInstance: - """ - Asynchronous coroutine to fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Update the TaskInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - :param actions_url: The URL from which the Assistant can fetch actions. - - :returns: The updated TaskInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Asynchronous coroutine to update the TaskInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - :param actions_url: The URL from which the Assistant can fetch actions. - - :returns: The updated TaskInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - @property - def fields(self) -> FieldList: - """ - Access the fields - """ - if self._fields is None: - self._fields = FieldList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._fields - - @property - def samples(self) -> SampleList: - """ - Access the samples - """ - if self._samples is None: - self._samples = SampleList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._samples - - @property - def task_actions(self) -> TaskActionsList: - """ - Access the task_actions - """ - if self._task_actions is None: - self._task_actions = TaskActionsList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._task_actions - - @property - def statistics(self) -> TaskStatisticsList: - """ - Access the statistics - """ - if self._statistics is None: - self._statistics = TaskStatisticsList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._statistics - - 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 TaskPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> TaskInstance: - """ - Build an instance of TaskInstance - - :param payload: Payload response from the API - """ - return TaskInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class TaskList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the TaskList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks".format(**self._solution) - - def create( - self, - unique_name: str, - friendly_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Create the TaskInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param friendly_name: A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. It is optional and not unique. - :param actions_url: The URL from which the Assistant can fetch actions. - - :returns: The created TaskInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, - unique_name: str, - friendly_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Asynchronously create the TaskInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param friendly_name: A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. It is optional and not unique. - :param actions_url: The URL from which the Assistant can fetch actions. - - :returns: The created TaskInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[TaskInstance]: - """ - Streams TaskInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[TaskInstance]: - """ - Asynchronously streams TaskInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[TaskInstance]: - """ - Lists TaskInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[TaskInstance]: - """ - Asynchronously lists TaskInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> TaskPage: - """ - Retrieve a single page of TaskInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of TaskInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return TaskPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> TaskPage: - """ - Asynchronously retrieve a single page of TaskInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of TaskInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return TaskPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> TaskPage: - """ - Retrieve a specific page of TaskInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of TaskInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return TaskPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> TaskPage: - """ - Asynchronously retrieve a specific page of TaskInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of TaskInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return TaskPage(self._version, response, self._solution) - - def get(self, sid: str) -> TaskContext: - """ - Constructs a TaskContext - - :param sid: The Twilio-provided string that uniquely identifies the Task resource to update. - """ - return TaskContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> TaskContext: - """ - Constructs a TaskContext - - :param sid: The Twilio-provided string that uniquely identifies the Task resource to update. - """ - return TaskContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/task/field.py b/twilio/rest/autopilot/v1/assistant/task/field.py deleted file mode 100644 index b146201d5a..0000000000 --- a/twilio/rest/autopilot/v1/assistant/task/field.py +++ /dev/null @@ -1,551 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class FieldInstance(InstanceResource): - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Field resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar field_type: The Field Type of the field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the unique_name, or the SID of a custom Field Type. - :ivar task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with this Field. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. - :ivar sid: The unique string that we created to identify the Field resource. - :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - :ivar url: The absolute URL of the Field resource. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.field_type: Optional[str] = payload.get("field_type") - self.task_sid: Optional[str] = payload.get("task_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid or self.sid, - } - self._context: Optional[FieldContext] = None - - @property - def _proxy(self) -> "FieldContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FieldContext for this FieldInstance - """ - if self._context is None: - self._context = FieldContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FieldInstance": - """ - Fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FieldInstance": - """ - Asynchronous coroutine to fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str, sid: str): - """ - Initialize the FieldContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to fetch. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resource to fetch. - :param sid: The Twilio-provided string that uniquely identifies the Field resource to fetch. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Fields/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FieldInstance: - """ - Fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FieldInstance: - """ - Asynchronous coroutine to fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_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 FieldPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> FieldInstance: - """ - Build an instance of FieldInstance - - :param payload: Payload response from the API - """ - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class FieldList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the FieldList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to read. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resources to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Fields".format( - **self._solution - ) - - def create(self, field_type: str, unique_name: str) -> FieldInstance: - """ - Create the FieldInstance - - :param field_type: The Field Type of the new field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the `unique_name`, or the `sid` of a custom Field Type. - :param unique_name: An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The created FieldInstance - """ - - data = values.of( - { - "FieldType": field_type, - "UniqueName": unique_name, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def create_async(self, field_type: str, unique_name: str) -> FieldInstance: - """ - Asynchronously create the FieldInstance - - :param field_type: The Field Type of the new field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the `unique_name`, or the `sid` of a custom Field Type. - :param unique_name: An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The created FieldInstance - """ - - data = values.of( - { - "FieldType": field_type, - "UniqueName": unique_name, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[FieldInstance]: - """ - Streams FieldInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[FieldInstance]: - """ - Asynchronously streams FieldInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldInstance]: - """ - Lists FieldInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldInstance]: - """ - Asynchronously lists FieldInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldPage: - """ - Retrieve a single page of FieldInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of FieldInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return FieldPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldPage: - """ - Asynchronously retrieve a single page of FieldInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of FieldInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return FieldPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> FieldPage: - """ - Retrieve a specific page of FieldInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return FieldPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> FieldPage: - """ - Asynchronously retrieve a specific page of FieldInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return FieldPage(self._version, response, self._solution) - - def get(self, sid: str) -> FieldContext: - """ - Constructs a FieldContext - - :param sid: The Twilio-provided string that uniquely identifies the Field resource to fetch. - """ - return FieldContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __call__(self, sid: str) -> FieldContext: - """ - Constructs a FieldContext - - :param sid: The Twilio-provided string that uniquely identifies the Field resource to fetch. - """ - return FieldContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/task/sample.py b/twilio/rest/autopilot/v1/assistant/task/sample.py deleted file mode 100644 index 924ccb45d6..0000000000 --- a/twilio/rest/autopilot/v1/assistant/task/sample.py +++ /dev/null @@ -1,699 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class SampleInstance(InstanceResource): - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Sample resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the resource. - :ivar language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. - :ivar sid: The unique string that we created to identify the Sample resource. - :ivar tagged_text: The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - :ivar url: The absolute URL of the Sample resource. - :ivar source_channel: The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.task_sid: Optional[str] = payload.get("task_sid") - self.language: Optional[str] = payload.get("language") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.tagged_text: Optional[str] = payload.get("tagged_text") - self.url: Optional[str] = payload.get("url") - self.source_channel: Optional[str] = payload.get("source_channel") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid or self.sid, - } - self._context: Optional[SampleContext] = None - - @property - def _proxy(self) -> "SampleContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: SampleContext for this SampleInstance - """ - if self._context is None: - self._context = SampleContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "SampleInstance": - """ - Fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "SampleInstance": - """ - Asynchronous coroutine to fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> "SampleInstance": - """ - Update the SampleInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :param tagged_text: The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - :param source_channel: The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - - :returns: The updated SampleInstance - """ - return self._proxy.update( - language=language, - tagged_text=tagged_text, - source_channel=source_channel, - ) - - async def update_async( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> "SampleInstance": - """ - Asynchronous coroutine to update the SampleInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :param tagged_text: The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - :param source_channel: The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - - :returns: The updated SampleInstance - """ - return await self._proxy.update_async( - language=language, - tagged_text=tagged_text, - source_channel=source_channel, - ) - - 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 SampleContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str, sid: str): - """ - Initialize the SampleContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to update. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to update. - :param sid: The Twilio-provided string that uniquely identifies the Sample resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Samples/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> SampleInstance: - """ - Fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> SampleInstance: - """ - Asynchronous coroutine to fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Update the SampleInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :param tagged_text: The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - :param source_channel: The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - - :returns: The updated SampleInstance - """ - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Asynchronous coroutine to update the SampleInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :param tagged_text: The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - :param source_channel: The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - - :returns: The updated SampleInstance - """ - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_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 SamplePage(Page): - def get_instance(self, payload: Dict[str, Any]) -> SampleInstance: - """ - Build an instance of SampleInstance - - :param payload: Payload response from the API - """ - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class SampleList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the SampleList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to read. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resources to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Samples".format( - **self._solution - ) - - def create( - self, - language: str, - tagged_text: str, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Create the SampleInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new sample. For example: `en-US`. - :param tagged_text: The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - :param source_channel: The communication channel from which the new sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - - :returns: The created SampleInstance - """ - - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def create_async( - self, - language: str, - tagged_text: str, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Asynchronously create the SampleInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new sample. For example: `en-US`. - :param tagged_text: The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - :param source_channel: The communication channel from which the new sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - - :returns: The created SampleInstance - """ - - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def stream( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[SampleInstance]: - """ - Streams SampleInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(language=language, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[SampleInstance]: - """ - Asynchronously streams SampleInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(language=language, page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SampleInstance]: - """ - Lists SampleInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - language=language, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SampleInstance]: - """ - Asynchronously lists SampleInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - language=language, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SamplePage: - """ - Retrieve a single page of SampleInstance records from the API. - Request is executed immediately - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :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 - - :returns: Page of SampleInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return SamplePage(self._version, response, self._solution) - - async def page_async( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SamplePage: - """ - Asynchronously retrieve a single page of SampleInstance records from the API. - Request is executed immediately - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :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 - - :returns: Page of SampleInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return SamplePage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> SamplePage: - """ - Retrieve a specific page of SampleInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SampleInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return SamplePage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> SamplePage: - """ - Asynchronously retrieve a specific page of SampleInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SampleInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return SamplePage(self._version, response, self._solution) - - def get(self, sid: str) -> SampleContext: - """ - Constructs a SampleContext - - :param sid: The Twilio-provided string that uniquely identifies the Sample resource to update. - """ - return SampleContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __call__(self, sid: str) -> SampleContext: - """ - Constructs a SampleContext - - :param sid: The Twilio-provided string that uniquely identifies the Sample resource to update. - """ - return SampleContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/task/task_actions.py b/twilio/rest/autopilot/v1/assistant/task/task_actions.py deleted file mode 100644 index 01d4efa2c1..0000000000 --- a/twilio/rest/autopilot/v1/assistant/task/task_actions.py +++ /dev/null @@ -1,301 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from typing import Any, Dict, Optional, Union -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 -from twilio.base.version import Version - - -class TaskActionsInstance(InstanceResource): - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskActions resource. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. - :ivar task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the resource. - :ivar url: The absolute URL of the TaskActions resource. - :ivar data: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.task_sid: Optional[str] = payload.get("task_sid") - self.url: Optional[str] = payload.get("url") - self.data: Optional[Dict[str, object]] = payload.get("data") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._context: Optional[TaskActionsContext] = None - - @property - def _proxy(self) -> "TaskActionsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: TaskActionsContext for this TaskActionsInstance - """ - if self._context is None: - self._context = TaskActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - return self._context - - def fetch(self) -> "TaskActionsInstance": - """ - Fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "TaskActionsInstance": - """ - Asynchronous coroutine to fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - return await self._proxy.fetch_async() - - def update( - self, actions: Union[object, object] = values.unset - ) -> "TaskActionsInstance": - """ - Update the TaskActionsInstance - - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - - :returns: The updated TaskActionsInstance - """ - return self._proxy.update( - actions=actions, - ) - - async def update_async( - self, actions: Union[object, object] = values.unset - ) -> "TaskActionsInstance": - """ - Asynchronous coroutine to update the TaskActionsInstance - - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - - :returns: The updated TaskActionsInstance - """ - return await self._proxy.update_async( - actions=actions, - ) - - 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 TaskActionsContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskActionsContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task for which the task actions to update were defined. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the task actions to update were defined. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Actions".format( - **self._solution - ) - - def fetch(self) -> TaskActionsInstance: - """ - Fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def fetch_async(self) -> TaskActionsInstance: - """ - Asynchronous coroutine to fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def update( - self, actions: Union[object, object] = values.unset - ) -> TaskActionsInstance: - """ - Update the TaskActionsInstance - - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - - :returns: The updated TaskActionsInstance - """ - data = values.of( - { - "Actions": serialize.object(actions), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def update_async( - self, actions: Union[object, object] = values.unset - ) -> TaskActionsInstance: - """ - Asynchronous coroutine to update the TaskActionsInstance - - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - - :returns: The updated TaskActionsInstance - """ - data = values.of( - { - "Actions": serialize.object(actions), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_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 TaskActionsList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskActionsList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task for which the task actions to fetch were defined. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the task actions to fetch were defined. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - - def get(self) -> TaskActionsContext: - """ - Constructs a TaskActionsContext - - """ - return TaskActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __call__(self) -> TaskActionsContext: - """ - Constructs a TaskActionsContext - - """ - return TaskActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/task/task_statistics.py b/twilio/rest/autopilot/v1/assistant/task/task_statistics.py deleted file mode 100644 index 3d92b05cb9..0000000000 --- a/twilio/rest/autopilot/v1/assistant/task/task_statistics.py +++ /dev/null @@ -1,221 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from typing import Any, Dict, Optional -from twilio.base import deserialize -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class TaskStatisticsInstance(InstanceResource): - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskStatistics resource. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. - :ivar task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the statistics were collected. - :ivar samples_count: The total number of [Samples](https://www.twilio.com/docs/autopilot/api/task-sample) associated with the Task. - :ivar fields_count: The total number of [Fields](https://www.twilio.com/docs/autopilot/api/task-field) associated with the Task. - :ivar url: The absolute URL of the TaskStatistics resource. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.task_sid: Optional[str] = payload.get("task_sid") - self.samples_count: Optional[int] = deserialize.integer( - payload.get("samples_count") - ) - self.fields_count: Optional[int] = deserialize.integer( - payload.get("fields_count") - ) - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._context: Optional[TaskStatisticsContext] = None - - @property - def _proxy(self) -> "TaskStatisticsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: TaskStatisticsContext for this TaskStatisticsInstance - """ - if self._context is None: - self._context = TaskStatisticsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - return self._context - - def fetch(self) -> "TaskStatisticsInstance": - """ - Fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "TaskStatisticsInstance": - """ - Asynchronous coroutine to fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class TaskStatisticsContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskStatisticsContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) that is associated with the resource to fetch. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Statistics".format( - **self._solution - ) - - def fetch(self) -> TaskStatisticsInstance: - """ - Fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return TaskStatisticsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def fetch_async(self) -> TaskStatisticsInstance: - """ - Asynchronous coroutine to fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return TaskStatisticsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_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 TaskStatisticsList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskStatisticsList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) that is associated with the resource to fetch. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - - def get(self) -> TaskStatisticsContext: - """ - Constructs a TaskStatisticsContext - - """ - return TaskStatisticsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __call__(self) -> TaskStatisticsContext: - """ - Constructs a TaskStatisticsContext - - """ - return TaskStatisticsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/webhook.py b/twilio/rest/autopilot/v1/assistant/webhook.py deleted file mode 100644 index 02632d8aa9..0000000000 --- a/twilio/rest/autopilot/v1/assistant/webhook.py +++ /dev/null @@ -1,673 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class WebhookInstance(InstanceResource): - - """ - :ivar url: The absolute URL of the Webhook resource. - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Webhook resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar sid: The unique string that we created to identify the Webhook resource. - :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - :ivar events: The list of space-separated events that this Webhook is subscribed to. - :ivar webhook_url: The URL associated with this Webhook. - :ivar webhook_method: The method used when calling the webhook's URL. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.url: Optional[str] = payload.get("url") - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.events: Optional[str] = payload.get("events") - self.webhook_url: Optional[str] = payload.get("webhook_url") - self.webhook_method: Optional[str] = payload.get("webhook_method") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[WebhookContext] = None - - @property - def _proxy(self) -> "WebhookContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: WebhookContext for this WebhookInstance - """ - if self._context is None: - self._context = WebhookContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the WebhookInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the WebhookInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "WebhookInstance": - """ - Fetch the WebhookInstance - - - :returns: The fetched WebhookInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "WebhookInstance": - """ - Asynchronous coroutine to fetch the WebhookInstance - - - :returns: The fetched WebhookInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - unique_name: Union[str, object] = values.unset, - events: Union[str, object] = values.unset, - webhook_url: Union[str, object] = values.unset, - webhook_method: Union[str, object] = values.unset, - ) -> "WebhookInstance": - """ - Update the WebhookInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param events: The list of space-separated events that this Webhook will subscribe to. - :param webhook_url: The URL associated with this Webhook. - :param webhook_method: The method to be used when calling the webhook's URL. - - :returns: The updated WebhookInstance - """ - return self._proxy.update( - unique_name=unique_name, - events=events, - webhook_url=webhook_url, - webhook_method=webhook_method, - ) - - async def update_async( - self, - unique_name: Union[str, object] = values.unset, - events: Union[str, object] = values.unset, - webhook_url: Union[str, object] = values.unset, - webhook_method: Union[str, object] = values.unset, - ) -> "WebhookInstance": - """ - Asynchronous coroutine to update the WebhookInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param events: The list of space-separated events that this Webhook will subscribe to. - :param webhook_url: The URL associated with this Webhook. - :param webhook_method: The method to be used when calling the webhook's URL. - - :returns: The updated WebhookInstance - """ - return await self._proxy.update_async( - unique_name=unique_name, - events=events, - webhook_url=webhook_url, - webhook_method=webhook_method, - ) - - 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 WebhookContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the WebhookContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - :param sid: The Twilio-provided string that uniquely identifies the Webhook resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Webhooks/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the WebhookInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the WebhookInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> WebhookInstance: - """ - Fetch the WebhookInstance - - - :returns: The fetched WebhookInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return WebhookInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> WebhookInstance: - """ - Asynchronous coroutine to fetch the WebhookInstance - - - :returns: The fetched WebhookInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return WebhookInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - unique_name: Union[str, object] = values.unset, - events: Union[str, object] = values.unset, - webhook_url: Union[str, object] = values.unset, - webhook_method: Union[str, object] = values.unset, - ) -> WebhookInstance: - """ - Update the WebhookInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param events: The list of space-separated events that this Webhook will subscribe to. - :param webhook_url: The URL associated with this Webhook. - :param webhook_method: The method to be used when calling the webhook's URL. - - :returns: The updated WebhookInstance - """ - data = values.of( - { - "UniqueName": unique_name, - "Events": events, - "WebhookUrl": webhook_url, - "WebhookMethod": webhook_method, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return WebhookInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - unique_name: Union[str, object] = values.unset, - events: Union[str, object] = values.unset, - webhook_url: Union[str, object] = values.unset, - webhook_method: Union[str, object] = values.unset, - ) -> WebhookInstance: - """ - Asynchronous coroutine to update the WebhookInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param events: The list of space-separated events that this Webhook will subscribe to. - :param webhook_url: The URL associated with this Webhook. - :param webhook_method: The method to be used when calling the webhook's URL. - - :returns: The updated WebhookInstance - """ - data = values.of( - { - "UniqueName": unique_name, - "Events": events, - "WebhookUrl": webhook_url, - "WebhookMethod": webhook_method, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return WebhookInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_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 WebhookPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> WebhookInstance: - """ - Build an instance of WebhookInstance - - :param payload: Payload response from the API - """ - return WebhookInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class WebhookList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the WebhookList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/Webhooks".format(**self._solution) - - def create( - self, - unique_name: str, - events: str, - webhook_url: str, - webhook_method: Union[str, object] = values.unset, - ) -> WebhookInstance: - """ - Create the WebhookInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param events: The list of space-separated events that this Webhook will subscribe to. - :param webhook_url: The URL associated with this Webhook. - :param webhook_method: The method to be used when calling the webhook's URL. - - :returns: The created WebhookInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "Events": events, - "WebhookUrl": webhook_url, - "WebhookMethod": webhook_method, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return WebhookInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, - unique_name: str, - events: str, - webhook_url: str, - webhook_method: Union[str, object] = values.unset, - ) -> WebhookInstance: - """ - Asynchronously create the WebhookInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param events: The list of space-separated events that this Webhook will subscribe to. - :param webhook_url: The URL associated with this Webhook. - :param webhook_method: The method to be used when calling the webhook's URL. - - :returns: The created WebhookInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "Events": events, - "WebhookUrl": webhook_url, - "WebhookMethod": webhook_method, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return WebhookInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[WebhookInstance]: - """ - Streams WebhookInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[WebhookInstance]: - """ - Asynchronously streams WebhookInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[WebhookInstance]: - """ - Lists WebhookInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[WebhookInstance]: - """ - Asynchronously lists WebhookInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> WebhookPage: - """ - Retrieve a single page of WebhookInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of WebhookInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return WebhookPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> WebhookPage: - """ - Asynchronously retrieve a single page of WebhookInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of WebhookInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return WebhookPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> WebhookPage: - """ - Retrieve a specific page of WebhookInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of WebhookInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return WebhookPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> WebhookPage: - """ - Asynchronously retrieve a specific page of WebhookInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of WebhookInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return WebhookPage(self._version, response, self._solution) - - def get(self, sid: str) -> WebhookContext: - """ - Constructs a WebhookContext - - :param sid: The Twilio-provided string that uniquely identifies the Webhook resource to update. - """ - return WebhookContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> WebhookContext: - """ - Constructs a WebhookContext - - :param sid: The Twilio-provided string that uniquely identifies the Webhook resource to update. - """ - return WebhookContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/restore_assistant.py b/twilio/rest/autopilot/v1/restore_assistant.py deleted file mode 100644 index aae8dd3f8f..0000000000 --- a/twilio/rest/autopilot/v1/restore_assistant.py +++ /dev/null @@ -1,136 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - 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 -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 RestoreAssistantInstance(InstanceResource): - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Assistant resource. - :ivar sid: The unique string that we created to identify the Assistant resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - :ivar friendly_name: The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - :ivar needs_model_build: Whether model needs to be rebuilt. - :ivar latest_model_build_sid: Reserved. - :ivar log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :ivar development_stage: A string describing the state of the assistant. - :ivar callback_url: Reserved. - :ivar callback_events: Reserved. - """ - - def __init__(self, version: Version, payload: Dict[str, Any]): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.sid: Optional[str] = payload.get("sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.unique_name: Optional[str] = payload.get("unique_name") - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.needs_model_build: Optional[bool] = payload.get("needs_model_build") - self.latest_model_build_sid: Optional[str] = payload.get( - "latest_model_build_sid" - ) - self.log_queries: Optional[bool] = payload.get("log_queries") - self.development_stage: Optional[str] = payload.get("development_stage") - self.callback_url: Optional[str] = payload.get("callback_url") - self.callback_events: Optional[str] = payload.get("callback_events") - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - - return "" - - -class RestoreAssistantList(ListResource): - def __init__(self, version: Version): - """ - Initialize the RestoreAssistantList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Assistants/Restore" - - def update(self, assistant: str) -> RestoreAssistantInstance: - """ - Update the RestoreAssistantInstance - - :param assistant: The Twilio-provided string that uniquely identifies the Assistant resource to restore. - - :returns: The created RestoreAssistantInstance - """ - data = values.of( - { - "Assistant": assistant, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return RestoreAssistantInstance(self._version, payload) - - async def update_async(self, assistant: str) -> RestoreAssistantInstance: - """ - Asynchronously update the RestoreAssistantInstance - - :param assistant: The Twilio-provided string that uniquely identifies the Assistant resource to restore. - - :returns: The created RestoreAssistantInstance - """ - data = values.of( - { - "Assistant": assistant, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return RestoreAssistantInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/bulkexports/BulkexportsBase.py b/twilio/rest/bulkexports/BulkexportsBase.py index d2efe642b4..cbca4c53e4 100644 --- a/twilio/rest/bulkexports/BulkexportsBase.py +++ b/twilio/rest/bulkexports/BulkexportsBase.py @@ -17,6 +17,7 @@ class BulkexportsBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Bulkexports Domain diff --git a/twilio/rest/bulkexports/v1/__init__.py b/twilio/rest/bulkexports/v1/__init__.py index e25eb3afc3..a888fb484f 100644 --- a/twilio/rest/bulkexports/v1/__init__.py +++ b/twilio/rest/bulkexports/v1/__init__.py @@ -20,6 +20,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Bulkexports diff --git a/twilio/rest/bulkexports/v1/export/__init__.py b/twilio/rest/bulkexports/v1/export/__init__.py index 03d6c449ea..c5c11df086 100644 --- a/twilio/rest/bulkexports/v1/export/__init__.py +++ b/twilio/rest/bulkexports/v1/export/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -25,7 +24,6 @@ class ExportInstance(InstanceResource): - """ :ivar resource_type: The type of communication – Messages, Calls, Conferences, and Participants :ivar url: The URL of this resource. @@ -107,6 +105,7 @@ def __repr__(self) -> str: class ExportContext(InstanceContext): + def __init__(self, version: Version, resource_type: str): """ Initialize the ExportContext @@ -198,6 +197,7 @@ def __repr__(self) -> str: class ExportList(ListResource): + def __init__(self, version: Version): """ Initialize the ExportList diff --git a/twilio/rest/bulkexports/v1/export/day.py b/twilio/rest/bulkexports/v1/export/day.py index 26daf02ed1..fcbc56e979 100644 --- a/twilio/rest/bulkexports/v1/export/day.py +++ b/twilio/rest/bulkexports/v1/export/day.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class DayInstance(InstanceResource): - """ :ivar redirect_to: :ivar day: The ISO 8601 format date of the resources in the file, for a UTC day @@ -100,6 +98,7 @@ def __repr__(self) -> str: class DayContext(InstanceContext): + def __init__(self, version: Version, resource_type: str, day: str): """ Initialize the DayContext @@ -168,6 +167,7 @@ def __repr__(self) -> str: class DayPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DayInstance: """ Build an instance of DayInstance @@ -188,6 +188,7 @@ def __repr__(self) -> str: class DayList(ListResource): + def __init__(self, version: Version, resource_type: str): """ Initialize the DayList diff --git a/twilio/rest/bulkexports/v1/export/export_custom_job.py b/twilio/rest/bulkexports/v1/export/export_custom_job.py index abb3015e42..758398eba3 100644 --- a/twilio/rest/bulkexports/v1/export/export_custom_job.py +++ b/twilio/rest/bulkexports/v1/export/export_custom_job.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values @@ -23,7 +22,6 @@ class ExportCustomJobInstance(InstanceResource): - """ :ivar friendly_name: The friendly name specified when creating the job :ivar resource_type: The type of communication – Messages, Calls, Conferences, and Participants @@ -70,6 +68,7 @@ def __repr__(self) -> str: class ExportCustomJobPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ExportCustomJobInstance: """ Build an instance of ExportCustomJobInstance @@ -90,6 +89,7 @@ def __repr__(self) -> str: class ExportCustomJobList(ListResource): + def __init__(self, version: Version, resource_type: str): """ Initialize the ExportCustomJobList diff --git a/twilio/rest/bulkexports/v1/export/job.py b/twilio/rest/bulkexports/v1/export/job.py index 64c3c0f46f..48b2df1ab3 100644 --- a/twilio/rest/bulkexports/v1/export/job.py +++ b/twilio/rest/bulkexports/v1/export/job.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class JobInstance(InstanceResource): - """ :ivar resource_type: The type of communication – Messages, Calls, Conferences, and Participants :ivar friendly_name: The friendly name specified when creating the job @@ -124,6 +122,7 @@ def __repr__(self) -> str: class JobContext(InstanceContext): + def __init__(self, version: Version, job_sid: str): """ Initialize the JobContext @@ -212,6 +211,7 @@ def __repr__(self) -> str: class JobList(ListResource): + def __init__(self, version: Version): """ Initialize the JobList diff --git a/twilio/rest/bulkexports/v1/export_configuration.py b/twilio/rest/bulkexports/v1/export_configuration.py index 28e64c5cdc..59aee93915 100644 --- a/twilio/rest/bulkexports/v1/export_configuration.py +++ b/twilio/rest/bulkexports/v1/export_configuration.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class ExportConfigurationInstance(InstanceResource): - """ :ivar enabled: If true, Twilio will automatically generate every day's file when the day is over. :ivar webhook_url: Stores the URL destination for the method specified in webhook_method. @@ -136,6 +134,7 @@ def __repr__(self) -> str: class ExportConfigurationContext(InstanceContext): + def __init__(self, version: Version, resource_type: str): """ Initialize the ExportConfigurationContext @@ -266,6 +265,7 @@ def __repr__(self) -> str: class ExportConfigurationList(ListResource): + def __init__(self, version: Version): """ Initialize the ExportConfigurationList diff --git a/twilio/rest/chat/ChatBase.py b/twilio/rest/chat/ChatBase.py index a84b4eb334..6d8656da17 100644 --- a/twilio/rest/chat/ChatBase.py +++ b/twilio/rest/chat/ChatBase.py @@ -19,6 +19,7 @@ class ChatBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Chat Domain diff --git a/twilio/rest/chat/v1/__init__.py b/twilio/rest/chat/v1/__init__.py index f01101f7da..d0ade9eed5 100644 --- a/twilio/rest/chat/v1/__init__.py +++ b/twilio/rest/chat/v1/__init__.py @@ -20,6 +20,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Chat diff --git a/twilio/rest/chat/v1/credential.py b/twilio/rest/chat/v1/credential.py index bf6350120a..8b477b675d 100644 --- a/twilio/rest/chat/v1/credential.py +++ b/twilio/rest/chat/v1/credential.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class CredentialInstance(InstanceResource): + class PushService(object): GCM = "gcm" APN = "apn" @@ -185,6 +185,7 @@ def __repr__(self) -> str: class CredentialContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CredentialContext @@ -353,6 +354,7 @@ def __repr__(self) -> str: class CredentialPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialInstance: """ Build an instance of CredentialInstance @@ -371,6 +373,7 @@ def __repr__(self) -> str: class CredentialList(ListResource): + def __init__(self, version: Version): """ Initialize the CredentialList diff --git a/twilio/rest/chat/v1/service/__init__.py b/twilio/rest/chat/v1/service/__init__.py index be4e946817..2783da6a9a 100644 --- a/twilio/rest/chat/v1/service/__init__.py +++ b/twilio/rest/chat/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,7 +26,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Service resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the Service resource. @@ -529,6 +527,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -1025,6 +1024,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -1043,6 +1043,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList diff --git a/twilio/rest/chat/v1/service/channel/__init__.py b/twilio/rest/chat/v1/service/channel/__init__.py index 46223702b5..1585613948 100644 --- a/twilio/rest/chat/v1/service/channel/__init__.py +++ b/twilio/rest/chat/v1/service/channel/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,6 +26,7 @@ class ChannelInstance(InstanceResource): + class ChannelType(object): PUBLIC = "public" PRIVATE = "private" @@ -212,6 +212,7 @@ def __repr__(self) -> str: class ChannelContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the ChannelContext @@ -419,6 +420,7 @@ def __repr__(self) -> str: class ChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ChannelInstance: """ Build an instance of ChannelInstance @@ -439,6 +441,7 @@ def __repr__(self) -> str: class ChannelList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the ChannelList diff --git a/twilio/rest/chat/v1/service/channel/invite.py b/twilio/rest/chat/v1/service/channel/invite.py index 3894abe546..6beccffae4 100644 --- a/twilio/rest/chat/v1/service/channel/invite.py +++ b/twilio/rest/chat/v1/service/channel/invite.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class InviteInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Invite resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the Invite resource. @@ -134,6 +132,7 @@ def __repr__(self) -> str: class InviteContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the InviteContext @@ -234,6 +233,7 @@ def __repr__(self) -> str: class InvitePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InviteInstance: """ Build an instance of InviteInstance @@ -257,6 +257,7 @@ def __repr__(self) -> str: class InviteList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the InviteList diff --git a/twilio/rest/chat/v1/service/channel/member.py b/twilio/rest/chat/v1/service/channel/member.py index dc56780e72..f0cd21448f 100644 --- a/twilio/rest/chat/v1/service/channel/member.py +++ b/twilio/rest/chat/v1/service/channel/member.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class MemberInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Member resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the Member resource. @@ -64,9 +62,9 @@ def __init__( self.last_consumed_message_index: Optional[int] = deserialize.integer( payload.get("last_consumed_message_index") ) - self.last_consumption_timestamp: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + self.last_consumption_timestamp: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + ) self.url: Optional[str] = payload.get("url") self._solution = { @@ -176,6 +174,7 @@ def __repr__(self) -> str: class MemberContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MemberContext @@ -344,6 +343,7 @@ def __repr__(self) -> str: class MemberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MemberInstance: """ Build an instance of MemberInstance @@ -367,6 +367,7 @@ def __repr__(self) -> str: class MemberList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MemberList diff --git a/twilio/rest/chat/v1/service/channel/message.py b/twilio/rest/chat/v1/service/channel/message.py index 6fea6a1800..f524c92387 100644 --- a/twilio/rest/chat/v1/service/channel/message.py +++ b/twilio/rest/chat/v1/service/channel/message.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class MessageInstance(InstanceResource): + class OrderType(object): ASC = "asc" DESC = "desc" @@ -179,6 +179,7 @@ def __repr__(self) -> str: class MessageContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MessageContext @@ -347,6 +348,7 @@ def __repr__(self) -> str: class MessagePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: """ Build an instance of MessageInstance @@ -370,6 +372,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MessageList diff --git a/twilio/rest/chat/v1/service/role.py b/twilio/rest/chat/v1/service/role.py index 913969fa9c..1913986a4a 100644 --- a/twilio/rest/chat/v1/service/role.py +++ b/twilio/rest/chat/v1/service/role.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class RoleInstance(InstanceResource): + class RoleType(object): CHANNEL = "channel" DEPLOYMENT = "deployment" @@ -156,6 +156,7 @@ def __repr__(self) -> str: class RoleContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the RoleContext @@ -302,6 +303,7 @@ def __repr__(self) -> str: class RolePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoleInstance: """ Build an instance of RoleInstance @@ -322,6 +324,7 @@ def __repr__(self) -> str: class RoleList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the RoleList diff --git a/twilio/rest/chat/v1/service/user/__init__.py b/twilio/rest/chat/v1/service/user/__init__.py index 316e773b0b..b06509668a 100644 --- a/twilio/rest/chat/v1/service/user/__init__.py +++ b/twilio/rest/chat/v1/service/user/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class UserInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the User resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the User resource. @@ -191,6 +189,7 @@ def __repr__(self) -> str: class UserContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the UserContext @@ -370,6 +369,7 @@ def __repr__(self) -> str: class UserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserInstance: """ Build an instance of UserInstance @@ -390,6 +390,7 @@ def __repr__(self) -> str: class UserList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the UserList diff --git a/twilio/rest/chat/v1/service/user/user_channel.py b/twilio/rest/chat/v1/service/user/user_channel.py index 353f6bf68f..01e639ceab 100644 --- a/twilio/rest/chat/v1/service/user/user_channel.py +++ b/twilio/rest/chat/v1/service/user/user_channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,6 +22,7 @@ class UserChannelInstance(InstanceResource): + class ChannelStatus(object): JOINED = "joined" INVITED = "invited" @@ -75,6 +75,7 @@ def __repr__(self) -> str: class UserChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserChannelInstance: """ Build an instance of UserChannelInstance @@ -98,6 +99,7 @@ def __repr__(self) -> str: class UserChannelList(ListResource): + def __init__(self, version: Version, service_sid: str, user_sid: str): """ Initialize the UserChannelList diff --git a/twilio/rest/chat/v2/__init__.py b/twilio/rest/chat/v2/__init__.py index c433e8543f..e949532d56 100644 --- a/twilio/rest/chat/v2/__init__.py +++ b/twilio/rest/chat/v2/__init__.py @@ -20,6 +20,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Chat diff --git a/twilio/rest/chat/v2/credential.py b/twilio/rest/chat/v2/credential.py index 1e49f78db3..564cd5159f 100644 --- a/twilio/rest/chat/v2/credential.py +++ b/twilio/rest/chat/v2/credential.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class CredentialInstance(InstanceResource): + class PushService(object): GCM = "gcm" APN = "apn" @@ -185,6 +185,7 @@ def __repr__(self) -> str: class CredentialContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CredentialContext @@ -353,6 +354,7 @@ def __repr__(self) -> str: class CredentialPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialInstance: """ Build an instance of CredentialInstance @@ -371,6 +373,7 @@ def __repr__(self) -> str: class CredentialList(ListResource): + def __init__(self, version: Version): """ Initialize the CredentialList diff --git a/twilio/rest/chat/v2/service/__init__.py b/twilio/rest/chat/v2/service/__init__.py index 59d8b8a5f5..66dd200b41 100644 --- a/twilio/rest/chat/v2/service/__init__.py +++ b/twilio/rest/chat/v2/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -28,7 +27,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Service resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. @@ -411,6 +409,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -786,6 +785,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -804,6 +804,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList diff --git a/twilio/rest/chat/v2/service/binding.py b/twilio/rest/chat/v2/service/binding.py index 424ad98c0c..2f960c5135 100644 --- a/twilio/rest/chat/v2/service/binding.py +++ b/twilio/rest/chat/v2/service/binding.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class BindingInstance(InstanceResource): + class BindingType(object): GCM = "gcm" APN = "apn" @@ -141,6 +141,7 @@ def __repr__(self) -> str: class BindingContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the BindingContext @@ -233,6 +234,7 @@ def __repr__(self) -> str: class BindingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BindingInstance: """ Build an instance of BindingInstance @@ -253,6 +255,7 @@ def __repr__(self) -> str: class BindingList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the BindingList diff --git a/twilio/rest/chat/v2/service/channel/__init__.py b/twilio/rest/chat/v2/service/channel/__init__.py index e785020790..2b49faf266 100644 --- a/twilio/rest/chat/v2/service/channel/__init__.py +++ b/twilio/rest/chat/v2/service/channel/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -28,6 +27,7 @@ class ChannelInstance(InstanceResource): + class ChannelType(object): PUBLIC = "public" PRIVATE = "private" @@ -268,6 +268,7 @@ def __repr__(self) -> str: class ChannelContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the ChannelContext @@ -541,6 +542,7 @@ def __repr__(self) -> str: class ChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ChannelInstance: """ Build an instance of ChannelInstance @@ -561,6 +563,7 @@ def __repr__(self) -> str: class ChannelList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the ChannelList diff --git a/twilio/rest/chat/v2/service/channel/invite.py b/twilio/rest/chat/v2/service/channel/invite.py index bf4e7fbc5c..2c7333786d 100644 --- a/twilio/rest/chat/v2/service/channel/invite.py +++ b/twilio/rest/chat/v2/service/channel/invite.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class InviteInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Invite resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Invite resource. @@ -134,6 +132,7 @@ def __repr__(self) -> str: class InviteContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the InviteContext @@ -234,6 +233,7 @@ def __repr__(self) -> str: class InvitePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InviteInstance: """ Build an instance of InviteInstance @@ -257,6 +257,7 @@ def __repr__(self) -> str: class InviteList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the InviteList diff --git a/twilio/rest/chat/v2/service/channel/member.py b/twilio/rest/chat/v2/service/channel/member.py index 54e2aa407c..c71d3e3457 100644 --- a/twilio/rest/chat/v2/service/channel/member.py +++ b/twilio/rest/chat/v2/service/channel/member.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class MemberInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -68,9 +68,9 @@ def __init__( self.last_consumed_message_index: Optional[int] = deserialize.integer( payload.get("last_consumed_message_index") ) - self.last_consumption_timestamp: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + self.last_consumption_timestamp: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + ) self.url: Optional[str] = payload.get("url") self.attributes: Optional[str] = payload.get("attributes") @@ -231,6 +231,7 @@ def __repr__(self) -> str: class MemberContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MemberContext @@ -461,6 +462,7 @@ def __repr__(self) -> str: class MemberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MemberInstance: """ Build an instance of MemberInstance @@ -484,6 +486,7 @@ def __repr__(self) -> str: class MemberList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MemberList diff --git a/twilio/rest/chat/v2/service/channel/message.py b/twilio/rest/chat/v2/service/channel/message.py index 3e1b289fd7..e98f526c74 100644 --- a/twilio/rest/chat/v2/service/channel/message.py +++ b/twilio/rest/chat/v2/service/channel/message.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class MessageInstance(InstanceResource): + class OrderType(object): ASC = "asc" DESC = "desc" @@ -239,6 +239,7 @@ def __repr__(self) -> str: class MessageContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MessageContext @@ -465,6 +466,7 @@ def __repr__(self) -> str: class MessagePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: """ Build an instance of MessageInstance @@ -488,6 +490,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MessageList diff --git a/twilio/rest/chat/v2/service/channel/webhook.py b/twilio/rest/chat/v2/service/channel/webhook.py index e20ca22432..ca738bac4a 100644 --- a/twilio/rest/chat/v2/service/channel/webhook.py +++ b/twilio/rest/chat/v2/service/channel/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class WebhookInstance(InstanceResource): + class Method(object): GET = "GET" POST = "POST" @@ -200,6 +200,7 @@ def __repr__(self) -> str: class WebhookContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the WebhookContext @@ -400,6 +401,7 @@ def __repr__(self) -> str: class WebhookPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WebhookInstance: """ Build an instance of WebhookInstance @@ -423,6 +425,7 @@ def __repr__(self) -> str: class WebhookList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the WebhookList diff --git a/twilio/rest/chat/v2/service/role.py b/twilio/rest/chat/v2/service/role.py index 4d636c71f2..5bb373c9a2 100644 --- a/twilio/rest/chat/v2/service/role.py +++ b/twilio/rest/chat/v2/service/role.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class RoleInstance(InstanceResource): + class RoleType(object): CHANNEL = "channel" DEPLOYMENT = "deployment" @@ -156,6 +156,7 @@ def __repr__(self) -> str: class RoleContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the RoleContext @@ -302,6 +303,7 @@ def __repr__(self) -> str: class RolePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoleInstance: """ Build an instance of RoleInstance @@ -322,6 +324,7 @@ def __repr__(self) -> str: class RoleList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the RoleList diff --git a/twilio/rest/chat/v2/service/user/__init__.py b/twilio/rest/chat/v2/service/user/__init__.py index 1c9e780d43..2c4ac5a3bd 100644 --- a/twilio/rest/chat/v2/service/user/__init__.py +++ b/twilio/rest/chat/v2/service/user/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -26,6 +25,7 @@ class UserInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -212,6 +212,7 @@ def __repr__(self) -> str: class UserContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the UserContext @@ -419,6 +420,7 @@ def __repr__(self) -> str: class UserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserInstance: """ Build an instance of UserInstance @@ -439,6 +441,7 @@ def __repr__(self) -> str: class UserList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the UserList diff --git a/twilio/rest/chat/v2/service/user/user_binding.py b/twilio/rest/chat/v2/service/user/user_binding.py index 5ea1628840..4170c74fb6 100644 --- a/twilio/rest/chat/v2/service/user/user_binding.py +++ b/twilio/rest/chat/v2/service/user/user_binding.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class UserBindingInstance(InstanceResource): + class BindingType(object): GCM = "gcm" APN = "apn" @@ -144,6 +144,7 @@ def __repr__(self) -> str: class UserBindingContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, user_sid: str, sid: str): """ Initialize the UserBindingContext @@ -242,6 +243,7 @@ def __repr__(self) -> str: class UserBindingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserBindingInstance: """ Build an instance of UserBindingInstance @@ -265,6 +267,7 @@ def __repr__(self) -> str: class UserBindingList(ListResource): + def __init__(self, version: Version, service_sid: str, user_sid: str): """ Initialize the UserBindingList diff --git a/twilio/rest/chat/v2/service/user/user_channel.py b/twilio/rest/chat/v2/service/user/user_channel.py index 2f72e8c59c..1fd25254a5 100644 --- a/twilio/rest/chat/v2/service/user/user_channel.py +++ b/twilio/rest/chat/v2/service/user/user_channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class UserChannelInstance(InstanceResource): + class ChannelStatus(object): JOINED = "joined" INVITED = "invited" @@ -77,9 +77,9 @@ def __init__( ) self.links: Optional[Dict[str, object]] = payload.get("links") self.url: Optional[str] = payload.get("url") - self.notification_level: Optional[ - "UserChannelInstance.NotificationLevel" - ] = payload.get("notification_level") + self.notification_level: Optional["UserChannelInstance.NotificationLevel"] = ( + payload.get("notification_level") + ) self._solution = { "service_sid": service_sid, @@ -214,6 +214,7 @@ def __repr__(self) -> str: class UserChannelContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, user_sid: str, channel_sid: str ): @@ -418,6 +419,7 @@ def __repr__(self) -> str: class UserChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserChannelInstance: """ Build an instance of UserChannelInstance @@ -441,6 +443,7 @@ def __repr__(self) -> str: class UserChannelList(ListResource): + def __init__(self, version: Version, service_sid: str, user_sid: str): """ Initialize the UserChannelList diff --git a/twilio/rest/chat/v3/__init__.py b/twilio/rest/chat/v3/__init__.py index 7fdfc8977f..582dc44069 100644 --- a/twilio/rest/chat/v3/__init__.py +++ b/twilio/rest/chat/v3/__init__.py @@ -19,6 +19,7 @@ class V3(Version): + def __init__(self, domain: Domain): """ Initialize the V3 version of Chat diff --git a/twilio/rest/chat/v3/channel.py b/twilio/rest/chat/v3/channel.py index 001334e854..e9d10b55bf 100644 --- a/twilio/rest/chat/v3/channel.py +++ b/twilio/rest/chat/v3/channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,6 +22,7 @@ class ChannelInstance(InstanceResource): + class ChannelType(object): PUBLIC = "public" PRIVATE = "private" @@ -159,6 +159,7 @@ def __repr__(self) -> str: class ChannelContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the ChannelContext @@ -267,6 +268,7 @@ def __repr__(self) -> str: class ChannelList(ListResource): + def __init__(self, version: Version): """ Initialize the ChannelList diff --git a/twilio/rest/content/ContentBase.py b/twilio/rest/content/ContentBase.py index 72dfbad76d..a8511f9fff 100644 --- a/twilio/rest/content/ContentBase.py +++ b/twilio/rest/content/ContentBase.py @@ -17,6 +17,7 @@ class ContentBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Content Domain diff --git a/twilio/rest/content/v1/__init__.py b/twilio/rest/content/v1/__init__.py index 68f3f13a69..1410fe4788 100644 --- a/twilio/rest/content/v1/__init__.py +++ b/twilio/rest/content/v1/__init__.py @@ -21,6 +21,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Content diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index b0eaaa0fad..b057cb4f86 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class ContentInstance(InstanceResource): - """ :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. @@ -34,7 +32,7 @@ class ContentInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar url: The URL of the resource, relative to `https://content.twilio.com`. :ivar links: A list of links related to the Content resource, such as approval_fetch and approval_create """ @@ -133,6 +131,7 @@ def __repr__(self) -> str: class ContentContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ContentContext @@ -235,6 +234,7 @@ def __repr__(self) -> str: class ContentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ContentInstance: """ Build an instance of ContentInstance @@ -253,6 +253,7 @@ def __repr__(self) -> str: class ContentList(ListResource): + def __init__(self, version: Version): """ Initialize the ContentList diff --git a/twilio/rest/content/v1/content/approval_create.py b/twilio/rest/content/v1/content/approval_create.py new file mode 100644 index 0000000000..63a4474306 --- /dev/null +++ b/twilio/rest/content/v1/content/approval_create.py @@ -0,0 +1,138 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Content + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class ApprovalCreateInstance(InstanceResource): + """ + :ivar name: + :ivar category: + :ivar content_type: + :ivar status: + :ivar rejection_reason: + :ivar allow_category_change: + """ + + def __init__(self, version: Version, payload: Dict[str, Any], sid: str): + super().__init__(version) + + self.name: Optional[str] = payload.get("name") + self.category: Optional[str] = payload.get("category") + self.content_type: Optional[str] = payload.get("content_type") + self.status: Optional[str] = payload.get("status") + self.rejection_reason: Optional[str] = payload.get("rejection_reason") + self.allow_category_change: Optional[bool] = payload.get( + "allow_category_change" + ) + + self._solution = { + "sid": sid, + } + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ApprovalCreateList(ListResource): + + class ContentApprovalRequest(object): + """ + :ivar name: Name of the template. + :ivar category: A WhatsApp recognized template category. + """ + + def __init__(self, payload: Dict[str, Any], sid: str): + + self.name: Optional[str] = payload.get("name") + self.category: Optional[str] = payload.get("category") + + def to_dict(self): + return { + "name": self.name, + "category": self.category, + } + + def __init__(self, version: Version, sid: str): + """ + Initialize the ApprovalCreateList + + :param version: Version that contains the resource + :param sid: + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/Content/{sid}/ApprovalRequests/whatsapp".format(**self._solution) + + def create( + self, content_approval_request: ContentApprovalRequest + ) -> ApprovalCreateInstance: + """ + Create the ApprovalCreateInstance + + :param content_approval_request: + + :returns: The created ApprovalCreateInstance + """ + data = content_approval_request.to_dict() + + headers = {"Content-Type": "application/json"} + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ApprovalCreateInstance(self._version, payload, sid=self._solution["sid"]) + + async def create_async( + self, content_approval_request: ContentApprovalRequest + ) -> ApprovalCreateInstance: + """ + Asynchronously create the ApprovalCreateInstance + + :param content_approval_request: + + :returns: The created ApprovalCreateInstance + """ + + data = content_approval_request.to_dict() + headers = {"Content-Type": "application/json"} + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ApprovalCreateInstance(self._version, payload, sid=self._solution["sid"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/content/v1/content/approval_fetch.py b/twilio/rest/content/v1/content/approval_fetch.py index ccd3b96d84..f35ef6a48f 100644 --- a/twilio/rest/content/v1/content/approval_fetch.py +++ b/twilio/rest/content/v1/content/approval_fetch.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class ApprovalFetchInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the Content resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource. @@ -86,6 +84,7 @@ def __repr__(self) -> str: class ApprovalFetchContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ApprovalFetchContext @@ -150,6 +149,7 @@ def __repr__(self) -> str: class ApprovalFetchList(ListResource): + def __init__(self, version: Version, sid: str): """ Initialize the ApprovalFetchList diff --git a/twilio/rest/content/v1/content_and_approvals.py b/twilio/rest/content/v1/content_and_approvals.py index 914376ea0b..e2d6d72aaf 100644 --- a/twilio/rest/content/v1/content_and_approvals.py +++ b/twilio/rest/content/v1/content_and_approvals.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ContentAndApprovalsInstance(InstanceResource): - """ :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. @@ -33,7 +31,7 @@ class ContentAndApprovalsInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar approval_requests: The submitted information and approval request status of the Content resource. """ @@ -67,6 +65,7 @@ def __repr__(self) -> str: class ContentAndApprovalsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ContentAndApprovalsInstance: """ Build an instance of ContentAndApprovalsInstance @@ -85,6 +84,7 @@ def __repr__(self) -> str: class ContentAndApprovalsList(ListResource): + def __init__(self, version: Version): """ Initialize the ContentAndApprovalsList diff --git a/twilio/rest/content/v1/legacy_content.py b/twilio/rest/content/v1/legacy_content.py index 9a1370b98a..5705c33b0b 100644 --- a/twilio/rest/content/v1/legacy_content.py +++ b/twilio/rest/content/v1/legacy_content.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class LegacyContentInstance(InstanceResource): - """ :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. @@ -33,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-api/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar 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`. @@ -69,6 +67,7 @@ def __repr__(self) -> str: class LegacyContentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> LegacyContentInstance: """ Build an instance of LegacyContentInstance @@ -87,6 +86,7 @@ def __repr__(self) -> str: class LegacyContentList(ListResource): + def __init__(self, version: Version): """ Initialize the LegacyContentList diff --git a/twilio/rest/conversations/ConversationsBase.py b/twilio/rest/conversations/ConversationsBase.py index 06d5533e3e..8904308365 100644 --- a/twilio/rest/conversations/ConversationsBase.py +++ b/twilio/rest/conversations/ConversationsBase.py @@ -17,6 +17,7 @@ class ConversationsBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Conversations Domain diff --git a/twilio/rest/conversations/v1/__init__.py b/twilio/rest/conversations/v1/__init__.py index 0fbe314fa2..3296ba2b46 100644 --- a/twilio/rest/conversations/v1/__init__.py +++ b/twilio/rest/conversations/v1/__init__.py @@ -28,6 +28,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Conversations diff --git a/twilio/rest/conversations/v1/address_configuration.py b/twilio/rest/conversations/v1/address_configuration.py index 5cfc0b9c84..3295eade6c 100644 --- a/twilio/rest/conversations/v1/address_configuration.py +++ b/twilio/rest/conversations/v1/address_configuration.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class AddressConfigurationInstance(InstanceResource): + class AutoCreationType(object): WEBHOOK = "webhook" STUDIO = "studio" @@ -228,6 +228,7 @@ def __repr__(self) -> str: class AddressConfigurationContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AddressConfigurationContext @@ -432,6 +433,7 @@ def __repr__(self) -> str: class AddressConfigurationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AddressConfigurationInstance: """ Build an instance of AddressConfigurationInstance @@ -450,6 +452,7 @@ def __repr__(self) -> str: class AddressConfigurationList(ListResource): + def __init__(self, version: Version): """ Initialize the AddressConfigurationList diff --git a/twilio/rest/conversations/v1/configuration/__init__.py b/twilio/rest/conversations/v1/configuration/__init__.py index afd5a6cfa1..46f511aa1e 100644 --- a/twilio/rest/conversations/v1/configuration/__init__.py +++ b/twilio/rest/conversations/v1/configuration/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -24,7 +23,6 @@ class ConfigurationInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this configuration. :ivar default_chat_service_sid: The SID of the default [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) used when creating a conversation. @@ -145,6 +143,7 @@ def __repr__(self) -> str: class ConfigurationContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the ConfigurationContext @@ -270,6 +269,7 @@ def __repr__(self) -> str: class ConfigurationList(ListResource): + def __init__(self, version: Version): """ Initialize the ConfigurationList diff --git a/twilio/rest/conversations/v1/configuration/webhook.py b/twilio/rest/conversations/v1/configuration/webhook.py index 4b2f1c1d7c..4ece54232c 100644 --- a/twilio/rest/conversations/v1/configuration/webhook.py +++ b/twilio/rest/conversations/v1/configuration/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -22,6 +21,7 @@ class WebhookInstance(InstanceResource): + class Method(object): GET = "GET" POST = "POST" @@ -150,6 +150,7 @@ def __repr__(self) -> str: class WebhookContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the WebhookContext @@ -281,6 +282,7 @@ def __repr__(self) -> str: class WebhookList(ListResource): + def __init__(self, version: Version): """ Initialize the WebhookList diff --git a/twilio/rest/conversations/v1/conversation/__init__.py b/twilio/rest/conversations/v1/conversation/__init__.py index e7ac784be1..bdb4bda324 100644 --- a/twilio/rest/conversations/v1/conversation/__init__.py +++ b/twilio/rest/conversations/v1/conversation/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,6 +26,7 @@ class ConversationInstance(InstanceResource): + class State(object): INACTIVE = "inactive" ACTIVE = "active" @@ -281,6 +281,7 @@ def __repr__(self) -> str: class ConversationContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ConversationContext @@ -553,6 +554,7 @@ def __repr__(self) -> str: class ConversationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConversationInstance: """ Build an instance of ConversationInstance @@ -571,6 +573,7 @@ def __repr__(self) -> str: class ConversationList(ListResource): + def __init__(self, version: Version): """ Initialize the ConversationList diff --git a/twilio/rest/conversations/v1/conversation/message/__init__.py b/twilio/rest/conversations/v1/conversation/message/__init__.py index 6ee1b8e49e..e3e9dea1b2 100644 --- a/twilio/rest/conversations/v1/conversation/message/__init__.py +++ b/twilio/rest/conversations/v1/conversation/message/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,6 +26,7 @@ class MessageInstance(InstanceResource): + class OrderType(object): ASC = "asc" DESC = "desc" @@ -50,7 +50,7 @@ class WebhookEnabledType(object): :ivar url: An absolute API resource API URL for this message. :ivar delivery: An object that contains the summary of delivery statuses for the message to non-chat participants. :ivar links: Contains an absolute API resource URL to access the delivery & read receipts of this message. - :ivar content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template. + :ivar content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template. """ def __init__( @@ -244,6 +244,7 @@ def __repr__(self) -> str: class MessageContext(InstanceContext): + def __init__(self, version: Version, conversation_sid: str, sid: str): """ Initialize the MessageContext @@ -477,6 +478,7 @@ def __repr__(self) -> str: class MessagePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: """ Build an instance of MessageInstance @@ -497,6 +499,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + def __init__(self, version: Version, conversation_sid: str): """ Initialize the MessageList @@ -540,7 +543,7 @@ def create( :param date_updated: The date that this resource was last updated. `null` if the message has not been edited. :param attributes: A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. :param media_sid: The Media SID to be attached to the new Message. - :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. :param content_variables: A structurally valid JSON string that contains values to resolve Rich Content template variables. :param subject: The subject of the message, can be up to 256 characters long. @@ -599,7 +602,7 @@ async def create_async( :param date_updated: The date that this resource was last updated. `null` if the message has not been edited. :param attributes: A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. :param media_sid: The Media SID to be attached to the new Message. - :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. :param content_variables: A structurally valid JSON string that contains values to resolve Rich Content template variables. :param subject: The subject of the message, can be up to 256 characters long. diff --git a/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py b/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py index 3949c67032..16af7892e9 100644 --- a/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py +++ b/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class DeliveryReceiptInstance(InstanceResource): + class DeliveryStatus(object): READ = "read" FAILED = "failed" @@ -126,6 +126,7 @@ def __repr__(self) -> str: class DeliveryReceiptContext(InstanceContext): + def __init__( self, version: Version, conversation_sid: str, message_sid: str, sid: str ): @@ -202,6 +203,7 @@ def __repr__(self) -> str: class DeliveryReceiptPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeliveryReceiptInstance: """ Build an instance of DeliveryReceiptInstance @@ -225,6 +227,7 @@ def __repr__(self) -> str: class DeliveryReceiptList(ListResource): + def __init__(self, version: Version, conversation_sid: str, message_sid: str): """ Initialize the DeliveryReceiptList diff --git a/twilio/rest/conversations/v1/conversation/participant.py b/twilio/rest/conversations/v1/conversation/participant.py index a05f4085d7..499bdbf30a 100644 --- a/twilio/rest/conversations/v1/conversation/participant.py +++ b/twilio/rest/conversations/v1/conversation/participant.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class ParticipantInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -246,6 +246,7 @@ def __repr__(self) -> str: class ParticipantContext(InstanceContext): + def __init__(self, version: Version, conversation_sid: str, sid: str): """ Initialize the ParticipantContext @@ -482,6 +483,7 @@ def __repr__(self) -> str: class ParticipantPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantInstance: """ Build an instance of ParticipantInstance @@ -502,6 +504,7 @@ def __repr__(self) -> str: class ParticipantList(ListResource): + def __init__(self, version: Version, conversation_sid: str): """ Initialize the ParticipantList diff --git a/twilio/rest/conversations/v1/conversation/webhook.py b/twilio/rest/conversations/v1/conversation/webhook.py index ddd49ede23..623887986c 100644 --- a/twilio/rest/conversations/v1/conversation/webhook.py +++ b/twilio/rest/conversations/v1/conversation/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class WebhookInstance(InstanceResource): + class Method(object): GET = "GET" POST = "POST" @@ -189,6 +189,7 @@ def __repr__(self) -> str: class WebhookContext(InstanceContext): + def __init__(self, version: Version, conversation_sid: str, sid: str): """ Initialize the WebhookContext @@ -375,6 +376,7 @@ def __repr__(self) -> str: class WebhookPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WebhookInstance: """ Build an instance of WebhookInstance @@ -395,6 +397,7 @@ def __repr__(self) -> str: class WebhookList(ListResource): + def __init__(self, version: Version, conversation_sid: str): """ Initialize the WebhookList diff --git a/twilio/rest/conversations/v1/credential.py b/twilio/rest/conversations/v1/credential.py index c8b680a9c4..92f26d1f0a 100644 --- a/twilio/rest/conversations/v1/credential.py +++ b/twilio/rest/conversations/v1/credential.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class CredentialInstance(InstanceResource): + class PushType(object): APN = "apn" GCM = "gcm" @@ -191,6 +191,7 @@ def __repr__(self) -> str: class CredentialContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CredentialContext @@ -365,6 +366,7 @@ def __repr__(self) -> str: class CredentialPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialInstance: """ Build an instance of CredentialInstance @@ -383,6 +385,7 @@ def __repr__(self) -> str: class CredentialList(ListResource): + def __init__(self, version: Version): """ Initialize the CredentialList diff --git a/twilio/rest/conversations/v1/participant_conversation.py b/twilio/rest/conversations/v1/participant_conversation.py index 0a7d0634b9..7413047152 100644 --- a/twilio/rest/conversations/v1/participant_conversation.py +++ b/twilio/rest/conversations/v1/participant_conversation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class ParticipantConversationInstance(InstanceResource): + class State(object): INACTIVE = "inactive" ACTIVE = "active" @@ -69,18 +69,18 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.conversation_attributes: Optional[str] = payload.get( "conversation_attributes" ) - self.conversation_date_created: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("conversation_date_created")) - self.conversation_date_updated: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("conversation_date_updated")) + self.conversation_date_created: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("conversation_date_created")) + ) + self.conversation_date_updated: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("conversation_date_updated")) + ) self.conversation_created_by: Optional[str] = payload.get( "conversation_created_by" ) - self.conversation_state: Optional[ - "ParticipantConversationInstance.State" - ] = payload.get("conversation_state") + self.conversation_state: Optional["ParticipantConversationInstance.State"] = ( + payload.get("conversation_state") + ) self.conversation_timers: Optional[Dict[str, object]] = payload.get( "conversation_timers" ) @@ -97,6 +97,7 @@ def __repr__(self) -> str: class ParticipantConversationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantConversationInstance: """ Build an instance of ParticipantConversationInstance @@ -115,6 +116,7 @@ def __repr__(self) -> str: class ParticipantConversationList(ListResource): + def __init__(self, version: Version): """ Initialize the ParticipantConversationList diff --git a/twilio/rest/conversations/v1/role.py b/twilio/rest/conversations/v1/role.py index 61e10ffec0..b5d4d2c6db 100644 --- a/twilio/rest/conversations/v1/role.py +++ b/twilio/rest/conversations/v1/role.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class RoleInstance(InstanceResource): + class RoleType(object): CONVERSATION = "conversation" SERVICE = "service" @@ -150,6 +150,7 @@ def __repr__(self) -> str: class RoleContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the RoleContext @@ -282,6 +283,7 @@ def __repr__(self) -> str: class RolePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoleInstance: """ Build an instance of RoleInstance @@ -300,6 +302,7 @@ def __repr__(self) -> str: class RoleList(ListResource): + def __init__(self, version: Version): """ Initialize the RoleList diff --git a/twilio/rest/conversations/v1/service/__init__.py b/twilio/rest/conversations/v1/service/__init__.py index 924df1fd27..2a9f12090b 100644 --- a/twilio/rest/conversations/v1/service/__init__.py +++ b/twilio/rest/conversations/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -32,7 +31,6 @@ class ServiceInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this service. :ivar sid: A 34 character string that uniquely identifies this resource. @@ -169,6 +167,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -336,6 +335,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -354,6 +354,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList diff --git a/twilio/rest/conversations/v1/service/binding.py b/twilio/rest/conversations/v1/service/binding.py index 264ef0490c..6e66844490 100644 --- a/twilio/rest/conversations/v1/service/binding.py +++ b/twilio/rest/conversations/v1/service/binding.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class BindingInstance(InstanceResource): + class BindingType(object): APN = "apn" GCM = "gcm" @@ -139,6 +139,7 @@ def __repr__(self) -> str: class BindingContext(InstanceContext): + def __init__(self, version: Version, chat_service_sid: str, sid: str): """ Initialize the BindingContext @@ -233,6 +234,7 @@ def __repr__(self) -> str: class BindingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BindingInstance: """ Build an instance of BindingInstance @@ -253,6 +255,7 @@ def __repr__(self) -> str: class BindingList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the BindingList diff --git a/twilio/rest/conversations/v1/service/configuration/__init__.py b/twilio/rest/conversations/v1/service/configuration/__init__.py index f5e96dc279..15de8dfda9 100644 --- a/twilio/rest/conversations/v1/service/configuration/__init__.py +++ b/twilio/rest/conversations/v1/service/configuration/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -27,7 +26,6 @@ class ConfigurationInstance(InstanceResource): - """ :ivar chat_service_sid: The unique string that we created to identify the Service configuration resource. :ivar default_conversation_creator_role_sid: The conversation-level role assigned to a conversation creator when they join a new conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. @@ -154,6 +152,7 @@ def __repr__(self) -> str: class ConfigurationContext(InstanceContext): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the ConfigurationContext @@ -292,6 +291,7 @@ def __repr__(self) -> str: class ConfigurationList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the ConfigurationList diff --git a/twilio/rest/conversations/v1/service/configuration/notification.py b/twilio/rest/conversations/v1/service/configuration/notification.py index 388f310e9d..498478fdf7 100644 --- a/twilio/rest/conversations/v1/service/configuration/notification.py +++ b/twilio/rest/conversations/v1/service/configuration/notification.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class NotificationInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this configuration. :ivar chat_service_sid: The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Configuration applies to. @@ -201,6 +199,7 @@ def __repr__(self) -> str: class NotificationContext(InstanceContext): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the NotificationContext @@ -393,6 +392,7 @@ def __repr__(self) -> str: class NotificationList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the NotificationList diff --git a/twilio/rest/conversations/v1/service/configuration/webhook.py b/twilio/rest/conversations/v1/service/configuration/webhook.py index 6152c44333..aa4015361f 100644 --- a/twilio/rest/conversations/v1/service/configuration/webhook.py +++ b/twilio/rest/conversations/v1/service/configuration/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -22,6 +21,7 @@ class WebhookInstance(InstanceResource): + class Method(object): GET = "GET" POST = "POST" @@ -146,6 +146,7 @@ def __repr__(self) -> str: class WebhookContext(InstanceContext): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the WebhookContext @@ -284,6 +285,7 @@ def __repr__(self) -> str: class WebhookList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the WebhookList diff --git a/twilio/rest/conversations/v1/service/conversation/__init__.py b/twilio/rest/conversations/v1/service/conversation/__init__.py index 0fef1cffaf..c347977a40 100644 --- a/twilio/rest/conversations/v1/service/conversation/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -29,6 +28,7 @@ class ConversationInstance(InstanceResource): + class State(object): INACTIVE = "inactive" ACTIVE = "active" @@ -289,6 +289,7 @@ def __repr__(self) -> str: class ConversationContext(InstanceContext): + def __init__(self, version: Version, chat_service_sid: str, sid: str): """ Initialize the ConversationContext @@ -580,6 +581,7 @@ def __repr__(self) -> str: class ConversationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConversationInstance: """ Build an instance of ConversationInstance @@ -600,6 +602,7 @@ def __repr__(self) -> str: class ConversationList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the ConversationList diff --git a/twilio/rest/conversations/v1/service/conversation/message/__init__.py b/twilio/rest/conversations/v1/service/conversation/message/__init__.py index 06b72492c8..753df18352 100644 --- a/twilio/rest/conversations/v1/service/conversation/message/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/message/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,6 +26,7 @@ class MessageInstance(InstanceResource): + class OrderType(object): ASC = "asc" DESC = "desc" @@ -51,7 +51,7 @@ class WebhookEnabledType(object): :ivar delivery: An object that contains the summary of delivery statuses for the message to non-chat participants. :ivar url: An absolute API resource URL for this message. :ivar links: Contains an absolute API resource URL to access the delivery & read receipts of this message. - :ivar content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template. + :ivar content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template. """ def __init__( @@ -249,6 +249,7 @@ def __repr__(self) -> str: class MessageContext(InstanceContext): + def __init__( self, version: Version, chat_service_sid: str, conversation_sid: str, sid: str ): @@ -491,6 +492,7 @@ def __repr__(self) -> str: class MessagePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: """ Build an instance of MessageInstance @@ -514,6 +516,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + def __init__(self, version: Version, chat_service_sid: str, conversation_sid: str): """ Initialize the MessageList @@ -559,7 +562,7 @@ def create( :param date_updated: The date that this resource was last updated. `null` if the message has not been edited. :param attributes: A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. :param media_sid: The Media SID to be attached to the new Message. - :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. :param content_variables: A structurally valid JSON string that contains values to resolve Rich Content template variables. :param subject: The subject of the message, can be up to 256 characters long. @@ -621,7 +624,7 @@ async def create_async( :param date_updated: The date that this resource was last updated. `null` if the message has not been edited. :param attributes: A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. :param media_sid: The Media SID to be attached to the new Message. - :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. :param content_variables: A structurally valid JSON string that contains values to resolve Rich Content template variables. :param subject: The subject of the message, can be up to 256 characters long. diff --git a/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py b/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py index 01e6f392f2..b9bf8a70c8 100644 --- a/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py +++ b/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class DeliveryReceiptInstance(InstanceResource): + class DeliveryStatus(object): READ = "read" FAILED = "failed" @@ -131,6 +131,7 @@ def __repr__(self) -> str: class DeliveryReceiptContext(InstanceContext): + def __init__( self, version: Version, @@ -216,6 +217,7 @@ def __repr__(self) -> str: class DeliveryReceiptPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeliveryReceiptInstance: """ Build an instance of DeliveryReceiptInstance @@ -240,6 +242,7 @@ def __repr__(self) -> str: class DeliveryReceiptList(ListResource): + def __init__( self, version: Version, diff --git a/twilio/rest/conversations/v1/service/conversation/participant.py b/twilio/rest/conversations/v1/service/conversation/participant.py index cf4fba5fa4..6f6eee61e7 100644 --- a/twilio/rest/conversations/v1/service/conversation/participant.py +++ b/twilio/rest/conversations/v1/service/conversation/participant.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class ParticipantInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -251,6 +251,7 @@ def __repr__(self) -> str: class ParticipantContext(InstanceContext): + def __init__( self, version: Version, chat_service_sid: str, conversation_sid: str, sid: str ): @@ -495,6 +496,7 @@ def __repr__(self) -> str: class ParticipantPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantInstance: """ Build an instance of ParticipantInstance @@ -518,6 +520,7 @@ def __repr__(self) -> str: class ParticipantList(ListResource): + def __init__(self, version: Version, chat_service_sid: str, conversation_sid: str): """ Initialize the ParticipantList diff --git a/twilio/rest/conversations/v1/service/conversation/webhook.py b/twilio/rest/conversations/v1/service/conversation/webhook.py index 5dace89d67..83b267406e 100644 --- a/twilio/rest/conversations/v1/service/conversation/webhook.py +++ b/twilio/rest/conversations/v1/service/conversation/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class WebhookInstance(InstanceResource): + class Method(object): GET = "GET" POST = "POST" @@ -194,6 +194,7 @@ def __repr__(self) -> str: class WebhookContext(InstanceContext): + def __init__( self, version: Version, chat_service_sid: str, conversation_sid: str, sid: str ): @@ -388,6 +389,7 @@ def __repr__(self) -> str: class WebhookPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WebhookInstance: """ Build an instance of WebhookInstance @@ -411,6 +413,7 @@ def __repr__(self) -> str: class WebhookList(ListResource): + def __init__(self, version: Version, chat_service_sid: str, conversation_sid: str): """ Initialize the WebhookList diff --git a/twilio/rest/conversations/v1/service/participant_conversation.py b/twilio/rest/conversations/v1/service/participant_conversation.py index b4de04f277..2c3bebcc1e 100644 --- a/twilio/rest/conversations/v1/service/participant_conversation.py +++ b/twilio/rest/conversations/v1/service/participant_conversation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class ParticipantConversationInstance(InstanceResource): + class State(object): INACTIVE = "inactive" ACTIVE = "active" @@ -71,18 +71,18 @@ def __init__( self.conversation_attributes: Optional[str] = payload.get( "conversation_attributes" ) - self.conversation_date_created: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("conversation_date_created")) - self.conversation_date_updated: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("conversation_date_updated")) + self.conversation_date_created: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("conversation_date_created")) + ) + self.conversation_date_updated: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("conversation_date_updated")) + ) self.conversation_created_by: Optional[str] = payload.get( "conversation_created_by" ) - self.conversation_state: Optional[ - "ParticipantConversationInstance.State" - ] = payload.get("conversation_state") + self.conversation_state: Optional["ParticipantConversationInstance.State"] = ( + payload.get("conversation_state") + ) self.conversation_timers: Optional[Dict[str, object]] = payload.get( "conversation_timers" ) @@ -105,6 +105,7 @@ def __repr__(self) -> str: class ParticipantConversationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantConversationInstance: """ Build an instance of ParticipantConversationInstance @@ -125,6 +126,7 @@ def __repr__(self) -> str: class ParticipantConversationList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the ParticipantConversationList diff --git a/twilio/rest/conversations/v1/service/role.py b/twilio/rest/conversations/v1/service/role.py index 2adbfc131b..3c0a0fc909 100644 --- a/twilio/rest/conversations/v1/service/role.py +++ b/twilio/rest/conversations/v1/service/role.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class RoleInstance(InstanceResource): + class RoleType(object): CONVERSATION = "conversation" SERVICE = "service" @@ -156,6 +156,7 @@ def __repr__(self) -> str: class RoleContext(InstanceContext): + def __init__(self, version: Version, chat_service_sid: str, sid: str): """ Initialize the RoleContext @@ -302,6 +303,7 @@ def __repr__(self) -> str: class RolePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoleInstance: """ Build an instance of RoleInstance @@ -322,6 +324,7 @@ def __repr__(self) -> str: class RoleList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the RoleList diff --git a/twilio/rest/conversations/v1/service/user/__init__.py b/twilio/rest/conversations/v1/service/user/__init__.py index 0f5e24b392..37a8d2e4fb 100644 --- a/twilio/rest/conversations/v1/service/user/__init__.py +++ b/twilio/rest/conversations/v1/service/user/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,6 +26,7 @@ class UserInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -218,6 +218,7 @@ def __repr__(self) -> str: class UserContext(InstanceContext): + def __init__(self, version: Version, chat_service_sid: str, sid: str): """ Initialize the UserContext @@ -431,6 +432,7 @@ def __repr__(self) -> str: class UserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserInstance: """ Build an instance of UserInstance @@ -451,6 +453,7 @@ def __repr__(self) -> str: class UserList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the UserList diff --git a/twilio/rest/conversations/v1/service/user/user_conversation.py b/twilio/rest/conversations/v1/service/user/user_conversation.py index 40e02f746a..7a836505b9 100644 --- a/twilio/rest/conversations/v1/service/user/user_conversation.py +++ b/twilio/rest/conversations/v1/service/user/user_conversation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class UserConversationInstance(InstanceResource): + class NotificationLevel(object): DEFAULT = "default" MUTED = "muted" @@ -76,9 +76,9 @@ def __init__( self.participant_sid: Optional[str] = payload.get("participant_sid") self.user_sid: Optional[str] = payload.get("user_sid") self.friendly_name: Optional[str] = payload.get("friendly_name") - self.conversation_state: Optional[ - "UserConversationInstance.State" - ] = payload.get("conversation_state") + self.conversation_state: Optional["UserConversationInstance.State"] = ( + payload.get("conversation_state") + ) self.timers: Optional[Dict[str, object]] = payload.get("timers") self.attributes: Optional[str] = payload.get("attributes") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( @@ -212,6 +212,7 @@ def __repr__(self) -> str: class UserConversationContext(InstanceContext): + def __init__( self, version: Version, @@ -394,6 +395,7 @@ def __repr__(self) -> str: class UserConversationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserConversationInstance: """ Build an instance of UserConversationInstance @@ -417,6 +419,7 @@ def __repr__(self) -> str: class UserConversationList(ListResource): + def __init__(self, version: Version, chat_service_sid: str, user_sid: str): """ Initialize the UserConversationList diff --git a/twilio/rest/conversations/v1/user/__init__.py b/twilio/rest/conversations/v1/user/__init__.py index 6b922afa7b..d8017c5102 100644 --- a/twilio/rest/conversations/v1/user/__init__.py +++ b/twilio/rest/conversations/v1/user/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,6 +24,7 @@ class UserInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -210,6 +210,7 @@ def __repr__(self) -> str: class UserContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the UserContext @@ -408,6 +409,7 @@ def __repr__(self) -> str: class UserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserInstance: """ Build an instance of UserInstance @@ -426,6 +428,7 @@ def __repr__(self) -> str: class UserList(ListResource): + def __init__(self, version: Version): """ Initialize the UserList diff --git a/twilio/rest/conversations/v1/user/user_conversation.py b/twilio/rest/conversations/v1/user/user_conversation.py index 4134066afd..e162441151 100644 --- a/twilio/rest/conversations/v1/user/user_conversation.py +++ b/twilio/rest/conversations/v1/user/user_conversation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class UserConversationInstance(InstanceResource): + class NotificationLevel(object): DEFAULT = "default" MUTED = "muted" @@ -75,9 +75,9 @@ def __init__( self.participant_sid: Optional[str] = payload.get("participant_sid") self.user_sid: Optional[str] = payload.get("user_sid") self.friendly_name: Optional[str] = payload.get("friendly_name") - self.conversation_state: Optional[ - "UserConversationInstance.State" - ] = payload.get("conversation_state") + self.conversation_state: Optional["UserConversationInstance.State"] = ( + payload.get("conversation_state") + ) self.timers: Optional[Dict[str, object]] = payload.get("timers") self.attributes: Optional[str] = payload.get("attributes") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( @@ -209,6 +209,7 @@ def __repr__(self) -> str: class UserConversationContext(InstanceContext): + def __init__(self, version: Version, user_sid: str, conversation_sid: str): """ Initialize the UserConversationContext @@ -379,6 +380,7 @@ def __repr__(self) -> str: class UserConversationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserConversationInstance: """ Build an instance of UserConversationInstance @@ -399,6 +401,7 @@ def __repr__(self) -> str: class UserConversationList(ListResource): + def __init__(self, version: Version, user_sid: str): """ Initialize the UserConversationList diff --git a/twilio/rest/events/EventsBase.py b/twilio/rest/events/EventsBase.py index 17c087a1d5..eb2251ae4e 100644 --- a/twilio/rest/events/EventsBase.py +++ b/twilio/rest/events/EventsBase.py @@ -17,6 +17,7 @@ class EventsBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Events Domain diff --git a/twilio/rest/events/v1/__init__.py b/twilio/rest/events/v1/__init__.py index d62e813d50..6b91355444 100644 --- a/twilio/rest/events/v1/__init__.py +++ b/twilio/rest/events/v1/__init__.py @@ -22,6 +22,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Events diff --git a/twilio/rest/events/v1/event_type.py b/twilio/rest/events/v1/event_type.py index beaeed332b..7215df8f24 100644 --- a/twilio/rest/events/v1/event_type.py +++ b/twilio/rest/events/v1/event_type.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class EventTypeInstance(InstanceResource): - """ :ivar type: A string that uniquely identifies this Event Type. :ivar schema_id: A string that uniquely identifies the Schema this Event Type adheres to. @@ -101,6 +99,7 @@ def __repr__(self) -> str: class EventTypeContext(InstanceContext): + def __init__(self, version: Version, type: str): """ Initialize the EventTypeContext @@ -165,6 +164,7 @@ def __repr__(self) -> str: class EventTypePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EventTypeInstance: """ Build an instance of EventTypeInstance @@ -183,6 +183,7 @@ def __repr__(self) -> str: class EventTypeList(ListResource): + def __init__(self, version: Version): """ Initialize the EventTypeList diff --git a/twilio/rest/events/v1/schema/__init__.py b/twilio/rest/events/v1/schema/__init__.py index 5bd099d56b..c3b6593c03 100644 --- a/twilio/rest/events/v1/schema/__init__.py +++ b/twilio/rest/events/v1/schema/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize @@ -25,7 +24,6 @@ class SchemaInstance(InstanceResource): - """ :ivar id: The unique identifier of the schema. Each schema can have multiple versions, that share the same id. :ivar url: The URL of this resource. @@ -42,9 +40,9 @@ def __init__( self.id: Optional[str] = payload.get("id") self.url: Optional[str] = payload.get("url") self.links: Optional[Dict[str, object]] = payload.get("links") - self.latest_version_date_created: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("latest_version_date_created")) + self.latest_version_date_created: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("latest_version_date_created")) + ) self.latest_version: Optional[int] = deserialize.integer( payload.get("latest_version") ) @@ -105,6 +103,7 @@ def __repr__(self) -> str: class SchemaContext(InstanceContext): + def __init__(self, version: Version, id: str): """ Initialize the SchemaContext @@ -183,6 +182,7 @@ def __repr__(self) -> str: class SchemaList(ListResource): + def __init__(self, version: Version): """ Initialize the SchemaList diff --git a/twilio/rest/events/v1/schema/schema_version.py b/twilio/rest/events/v1/schema/schema_version.py index 823aefbf73..3557cb2935 100644 --- a/twilio/rest/events/v1/schema/schema_version.py +++ b/twilio/rest/events/v1/schema/schema_version.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class SchemaVersionInstance(InstanceResource): - """ :ivar id: The unique identifier of the schema. Each schema can have multiple versions, that share the same id. :ivar schema_version: The version of this schema. @@ -103,6 +101,7 @@ def __repr__(self) -> str: class SchemaVersionContext(InstanceContext): + def __init__(self, version: Version, id: str, schema_version: int): """ Initialize the SchemaVersionContext @@ -171,6 +170,7 @@ def __repr__(self) -> str: class SchemaVersionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SchemaVersionInstance: """ Build an instance of SchemaVersionInstance @@ -189,6 +189,7 @@ def __repr__(self) -> str: class SchemaVersionList(ListResource): + def __init__(self, version: Version, id: str): """ Initialize the SchemaVersionList diff --git a/twilio/rest/events/v1/sink/__init__.py b/twilio/rest/events/v1/sink/__init__.py index 89289ede30..67688f296d 100644 --- a/twilio/rest/events/v1/sink/__init__.py +++ b/twilio/rest/events/v1/sink/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -26,6 +25,7 @@ class SinkInstance(InstanceResource): + class SinkType(object): KINESIS = "kinesis" WEBHOOK = "webhook" @@ -175,6 +175,7 @@ def __repr__(self) -> str: class SinkContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SinkContext @@ -334,6 +335,7 @@ def __repr__(self) -> str: class SinkPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SinkInstance: """ Build an instance of SinkInstance @@ -352,6 +354,7 @@ def __repr__(self) -> str: class SinkList(ListResource): + def __init__(self, version: Version): """ Initialize the SinkList diff --git a/twilio/rest/events/v1/sink/sink_test.py b/twilio/rest/events/v1/sink/sink_test.py index c85c422e7b..adf04f582d 100644 --- a/twilio/rest/events/v1/sink/sink_test.py +++ b/twilio/rest/events/v1/sink/sink_test.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class SinkTestInstance(InstanceResource): - """ :ivar result: Feedback indicating whether the test event was generated. """ @@ -46,6 +44,7 @@ def __repr__(self) -> str: class SinkTestList(ListResource): + def __init__(self, version: Version, sid: str): """ Initialize the SinkTestList diff --git a/twilio/rest/events/v1/sink/sink_validate.py b/twilio/rest/events/v1/sink/sink_validate.py index 792d8c4553..4c24dd76b3 100644 --- a/twilio/rest/events/v1/sink/sink_validate.py +++ b/twilio/rest/events/v1/sink/sink_validate.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base import values @@ -22,7 +21,6 @@ class SinkValidateInstance(InstanceResource): - """ :ivar result: Feedback indicating whether the given Sink was validated. """ @@ -47,6 +45,7 @@ def __repr__(self) -> str: class SinkValidateList(ListResource): + def __init__(self, version: Version, sid: str): """ Initialize the SinkValidateList diff --git a/twilio/rest/events/v1/subscription/__init__.py b/twilio/rest/events/v1/subscription/__init__.py index cbe79a985d..666b26aa70 100644 --- a/twilio/rest/events/v1/subscription/__init__.py +++ b/twilio/rest/events/v1/subscription/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -25,7 +24,6 @@ class SubscriptionInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Account. :ivar sid: A 34 character string that uniquely identifies this Subscription. @@ -165,6 +163,7 @@ def __repr__(self) -> str: class SubscriptionContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SubscriptionContext @@ -323,6 +322,7 @@ def __repr__(self) -> str: class SubscriptionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SubscriptionInstance: """ Build an instance of SubscriptionInstance @@ -341,6 +341,7 @@ def __repr__(self) -> str: class SubscriptionList(ListResource): + def __init__(self, version: Version): """ Initialize the SubscriptionList diff --git a/twilio/rest/events/v1/subscription/subscribed_event.py b/twilio/rest/events/v1/subscription/subscribed_event.py index 4733b8e92c..80c9ce1494 100644 --- a/twilio/rest/events/v1/subscription/subscribed_event.py +++ b/twilio/rest/events/v1/subscription/subscribed_event.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -23,11 +22,10 @@ class SubscribedEventInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Account. :ivar type: Type of event being subscribed to. - :ivar schema_version: The schema version that the subscription should use. + :ivar schema_version: The schema version that the Subscription should use. :ivar subscription_sid: The unique SID identifier of the Subscription. :ivar url: The URL of this resource. """ @@ -113,7 +111,7 @@ def update( """ Update the SubscribedEventInstance - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The updated SubscribedEventInstance """ @@ -127,7 +125,7 @@ async def update_async( """ Asynchronous coroutine to update the SubscribedEventInstance - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The updated SubscribedEventInstance """ @@ -146,6 +144,7 @@ def __repr__(self) -> str: class SubscribedEventContext(InstanceContext): + def __init__(self, version: Version, subscription_sid: str, type: str): """ Initialize the SubscribedEventContext @@ -235,7 +234,7 @@ def update( """ Update the SubscribedEventInstance - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The updated SubscribedEventInstance """ @@ -264,7 +263,7 @@ async def update_async( """ Asynchronous coroutine to update the SubscribedEventInstance - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The updated SubscribedEventInstance """ @@ -298,6 +297,7 @@ def __repr__(self) -> str: class SubscribedEventPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SubscribedEventInstance: """ Build an instance of SubscribedEventInstance @@ -318,6 +318,7 @@ def __repr__(self) -> str: class SubscribedEventList(ListResource): + def __init__(self, version: Version, subscription_sid: str): """ Initialize the SubscribedEventList @@ -343,7 +344,7 @@ def create( Create the SubscribedEventInstance :param type: Type of event being subscribed to. - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The created SubscribedEventInstance """ @@ -372,7 +373,7 @@ async def create_async( Asynchronously create the SubscribedEventInstance :param type: Type of event being subscribed to. - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The created SubscribedEventInstance """ diff --git a/twilio/rest/flex_api/FlexApiBase.py b/twilio/rest/flex_api/FlexApiBase.py index afdad47340..3bda5b6b47 100644 --- a/twilio/rest/flex_api/FlexApiBase.py +++ b/twilio/rest/flex_api/FlexApiBase.py @@ -18,6 +18,7 @@ class FlexApiBase(Domain): + def __init__(self, twilio: Client): """ Initialize the FlexApi Domain diff --git a/twilio/rest/flex_api/v1/__init__.py b/twilio/rest/flex_api/v1/__init__.py index 59e697bd9e..7ee41b75f0 100644 --- a/twilio/rest/flex_api/v1/__init__.py +++ b/twilio/rest/flex_api/v1/__init__.py @@ -22,6 +22,12 @@ from twilio.rest.flex_api.v1.insights_assessments_comment import ( InsightsAssessmentsCommentList, ) +from twilio.rest.flex_api.v1.insights_conversational_ai import ( + InsightsConversationalAiList, +) +from twilio.rest.flex_api.v1.insights_conversational_ai_report_insights import ( + InsightsConversationalAiReportInsightsList, +) from twilio.rest.flex_api.v1.insights_conversations import InsightsConversationsList from twilio.rest.flex_api.v1.insights_questionnaires import InsightsQuestionnairesList from twilio.rest.flex_api.v1.insights_questionnaires_category import ( @@ -45,6 +51,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of FlexApi @@ -56,8 +63,12 @@ def __init__(self, domain: Domain): self._channel: Optional[ChannelList] = None self._configuration: Optional[ConfigurationList] = None self._flex_flow: Optional[FlexFlowList] = None - self._insights_assessments_comment: Optional[ - InsightsAssessmentsCommentList + self._insights_assessments_comment: Optional[InsightsAssessmentsCommentList] = ( + None + ) + self._insights_conversational_ai: Optional[InsightsConversationalAiList] = None + self._insights_conversational_ai_report_insights: Optional[ + InsightsConversationalAiReportInsightsList ] = None self._insights_conversations: Optional[InsightsConversationsList] = None self._insights_questionnaires: Optional[InsightsQuestionnairesList] = None @@ -108,6 +119,22 @@ def insights_assessments_comment(self) -> InsightsAssessmentsCommentList: self._insights_assessments_comment = InsightsAssessmentsCommentList(self) return self._insights_assessments_comment + @property + def insights_conversational_ai(self) -> InsightsConversationalAiList: + if self._insights_conversational_ai is None: + self._insights_conversational_ai = InsightsConversationalAiList(self) + return self._insights_conversational_ai + + @property + def insights_conversational_ai_report_insights( + self, + ) -> InsightsConversationalAiReportInsightsList: + if self._insights_conversational_ai_report_insights is None: + self._insights_conversational_ai_report_insights = ( + InsightsConversationalAiReportInsightsList(self) + ) + return self._insights_conversational_ai_report_insights + @property def insights_conversations(self) -> InsightsConversationsList: if self._insights_conversations is None: diff --git a/twilio/rest/flex_api/v1/assessments.py b/twilio/rest/flex_api/v1/assessments.py index b6b2e626ad..23648b1041 100644 --- a/twilio/rest/flex_api/v1/assessments.py +++ b/twilio/rest/flex_api/v1/assessments.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class AssessmentsInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Account. :ivar assessment_sid: The SID of the assessment @@ -143,6 +141,7 @@ def __repr__(self) -> str: class AssessmentsContext(InstanceContext): + def __init__(self, version: Version, assessment_sid: str): """ Initialize the AssessmentsContext @@ -247,6 +246,7 @@ def __repr__(self) -> str: class AssessmentsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AssessmentsInstance: """ Build an instance of AssessmentsInstance @@ -265,6 +265,7 @@ def __repr__(self) -> str: class AssessmentsList(ListResource): + def __init__(self, version: Version): """ Initialize the AssessmentsList diff --git a/twilio/rest/flex_api/v1/channel.py b/twilio/rest/flex_api/v1/channel.py index a9151604eb..a2f1e1af0f 100644 --- a/twilio/rest/flex_api/v1/channel.py +++ b/twilio/rest/flex_api/v1/channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ChannelInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Channel resource and owns this Workflow. :ivar flex_flow_sid: The SID of the Flex Flow. @@ -121,6 +119,7 @@ def __repr__(self) -> str: class ChannelContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ChannelContext @@ -209,6 +208,7 @@ def __repr__(self) -> str: class ChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ChannelInstance: """ Build an instance of ChannelInstance @@ -227,6 +227,7 @@ def __repr__(self) -> str: class ChannelList(ListResource): + def __init__(self, version: Version): """ Initialize the ChannelList diff --git a/twilio/rest/flex_api/v1/configuration.py b/twilio/rest/flex_api/v1/configuration.py index c8ab6554bb..b358081517 100644 --- a/twilio/rest/flex_api/v1/configuration.py +++ b/twilio/rest/flex_api/v1/configuration.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values @@ -23,6 +22,7 @@ class ConfigurationInstance(InstanceResource): + class Status(object): OK = "ok" INPROGRESS = "inprogress" @@ -46,6 +46,7 @@ class Status(object): :ivar messaging_service_instance_sid: The SID of the Messaging service instance. :ivar chat_service_instance_sid: The SID of the chat service this user belongs to. :ivar flex_service_instance_sid: The SID of the Flex service instance. + :ivar flex_instance_sid: The SID of the Flex instance. :ivar ui_language: The primary language of the Flex UI. :ivar ui_attributes: The object that describes Flex UI characteristics and settings. :ivar ui_dependencies: The object that defines the NPM packages and versions to be used in Hosted Flex. @@ -125,6 +126,7 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.flex_service_instance_sid: Optional[str] = payload.get( "flex_service_instance_sid" ) + self.flex_instance_sid: Optional[str] = payload.get("flex_instance_sid") self.ui_language: Optional[str] = payload.get("ui_language") self.ui_attributes: Optional[Dict[str, object]] = payload.get("ui_attributes") self.ui_dependencies: Optional[Dict[str, object]] = payload.get( @@ -264,6 +266,7 @@ def __repr__(self) -> str: class ConfigurationContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the ConfigurationContext @@ -369,6 +372,7 @@ def __repr__(self) -> str: class ConfigurationList(ListResource): + def __init__(self, version: Version): """ Initialize the ConfigurationList diff --git a/twilio/rest/flex_api/v1/flex_flow.py b/twilio/rest/flex_api/v1/flex_flow.py index ba4dc4ec60..57c9a8f430 100644 --- a/twilio/rest/flex_api/v1/flex_flow.py +++ b/twilio/rest/flex_api/v1/flex_flow.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class FlexFlowInstance(InstanceResource): + class ChannelType(object): WEB = "web" SMS = "sms" @@ -74,9 +74,9 @@ def __init__( ) self.contact_identity: Optional[str] = payload.get("contact_identity") self.enabled: Optional[bool] = payload.get("enabled") - self.integration_type: Optional[ - "FlexFlowInstance.IntegrationType" - ] = payload.get("integration_type") + self.integration_type: Optional["FlexFlowInstance.IntegrationType"] = ( + payload.get("integration_type") + ) self.integration: Optional[Dict[str, object]] = payload.get("integration") self.long_lived: Optional[bool] = payload.get("long_lived") self.janitor_enabled: Optional[bool] = payload.get("janitor_enabled") @@ -279,6 +279,7 @@ def __repr__(self) -> str: class FlexFlowContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the FlexFlowContext @@ -517,6 +518,7 @@ def __repr__(self) -> str: class FlexFlowPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FlexFlowInstance: """ Build an instance of FlexFlowInstance @@ -535,6 +537,7 @@ def __repr__(self) -> str: class FlexFlowList(ListResource): + def __init__(self, version: Version): """ Initialize the FlexFlowList diff --git a/twilio/rest/flex_api/v1/insights_assessments_comment.py b/twilio/rest/flex_api/v1/insights_assessments_comment.py index 2d5fd3a431..eed32fefbc 100644 --- a/twilio/rest/flex_api/v1/insights_assessments_comment.py +++ b/twilio/rest/flex_api/v1/insights_assessments_comment.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class InsightsAssessmentsCommentInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. :ivar assessment_sid: The SID of the assessment. @@ -66,6 +64,7 @@ def __repr__(self) -> str: class InsightsAssessmentsCommentPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> InsightsAssessmentsCommentInstance: @@ -86,6 +85,7 @@ def __repr__(self) -> str: class InsightsAssessmentsCommentList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsAssessmentsCommentList diff --git a/twilio/rest/flex_api/v1/insights_conversational_ai.py b/twilio/rest/flex_api/v1/insights_conversational_ai.py new file mode 100644 index 0000000000..0cce79ad9d --- /dev/null +++ b/twilio/rest/flex_api/v1/insights_conversational_ai.py @@ -0,0 +1,295 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Flex + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union +from twilio.base import deserialize, serialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class InsightsConversationalAiInstance(InstanceResource): + + class Granularity(object): + DAYS = "days" + WEEKS = "weeks" + MONTHS = "months" + QUARTERS = "quarters" + YEARS = "years" + + """ + :ivar instance_sid: Sid of Flex Service Instance + :ivar report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics + :ivar granularity: + :ivar period_start: The start date from which report data is included + :ivar period_end: The end date till report data is included + :ivar updated: Updated time of the report + :ivar total_pages: Represents total number of pages fetched report has + :ivar page: Page offset required for pagination + :ivar rows: List of report breakdown + :ivar url: The URL of this resource. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + instance_sid: Optional[str] = None, + ): + super().__init__(version) + + self.instance_sid: Optional[str] = payload.get("instance_sid") + self.report_id: Optional[str] = payload.get("report_id") + self.granularity: Optional["InsightsConversationalAiInstance.Granularity"] = ( + payload.get("granularity") + ) + self.period_start: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("period_start") + ) + self.period_end: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("period_end") + ) + self.updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("updated") + ) + self.total_pages: Optional[int] = deserialize.integer( + payload.get("total_pages") + ) + self.page: Optional[int] = deserialize.integer(payload.get("page")) + self.rows: Optional[List[Dict[str, object]]] = payload.get("rows") + self.url: Optional[str] = payload.get("url") + + self._solution = { + "instance_sid": instance_sid or self.instance_sid, + } + self._context: Optional[InsightsConversationalAiContext] = None + + @property + def _proxy(self) -> "InsightsConversationalAiContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: InsightsConversationalAiContext for this InsightsConversationalAiInstance + """ + if self._context is None: + self._context = InsightsConversationalAiContext( + self._version, + instance_sid=self._solution["instance_sid"], + ) + return self._context + + def fetch( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[ + "InsightsConversationalAiInstance.Granularity", object + ] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> "InsightsConversationalAiInstance": + """ + Fetch the InsightsConversationalAiInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiInstance + """ + return self._proxy.fetch( + max_rows=max_rows, + report_id=report_id, + granularity=granularity, + include_date=include_date, + ) + + async def fetch_async( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[ + "InsightsConversationalAiInstance.Granularity", object + ] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> "InsightsConversationalAiInstance": + """ + Asynchronous coroutine to fetch the InsightsConversationalAiInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiInstance + """ + return await self._proxy.fetch_async( + max_rows=max_rows, + report_id=report_id, + granularity=granularity, + include_date=include_date, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class InsightsConversationalAiContext(InstanceContext): + + def __init__(self, version: Version, instance_sid: str): + """ + Initialize the InsightsConversationalAiContext + + :param version: Version that contains the resource + :param instance_sid: Sid of Flex Service Instance + """ + super().__init__(version) + + # Path Solution + self._solution = { + "instance_sid": instance_sid, + } + self._uri = "/Insights/Instances/{instance_sid}/AI/Reports".format( + **self._solution + ) + + def fetch( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[ + "InsightsConversationalAiInstance.Granularity", object + ] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> InsightsConversationalAiInstance: + """ + Fetch the InsightsConversationalAiInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiInstance + """ + + data = values.of( + { + "MaxRows": max_rows, + "ReportId": report_id, + "Granularity": granularity, + "IncludeDate": serialize.iso8601_datetime(include_date), + } + ) + + payload = self._version.fetch(method="GET", uri=self._uri, params=data) + + return InsightsConversationalAiInstance( + self._version, + payload, + instance_sid=self._solution["instance_sid"], + ) + + async def fetch_async( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[ + "InsightsConversationalAiInstance.Granularity", object + ] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> InsightsConversationalAiInstance: + """ + Asynchronous coroutine to fetch the InsightsConversationalAiInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiInstance + """ + + data = values.of( + { + "MaxRows": max_rows, + "ReportId": report_id, + "Granularity": granularity, + "IncludeDate": serialize.iso8601_datetime(include_date), + } + ) + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, params=data + ) + + return InsightsConversationalAiInstance( + self._version, + payload, + instance_sid=self._solution["instance_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class InsightsConversationalAiList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the InsightsConversationalAiList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, instance_sid: str) -> InsightsConversationalAiContext: + """ + Constructs a InsightsConversationalAiContext + + :param instance_sid: Sid of Flex Service Instance + """ + return InsightsConversationalAiContext(self._version, instance_sid=instance_sid) + + def __call__(self, instance_sid: str) -> InsightsConversationalAiContext: + """ + Constructs a InsightsConversationalAiContext + + :param instance_sid: Sid of Flex Service Instance + """ + return InsightsConversationalAiContext(self._version, instance_sid=instance_sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py b/twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py new file mode 100644 index 0000000000..59ac5a04bf --- /dev/null +++ b/twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py @@ -0,0 +1,279 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Flex + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union +from twilio.base import deserialize, serialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class InsightsConversationalAiReportInsightsInstance(InstanceResource): + """ + :ivar instance_sid: The Instance SID of the instance for which report insights is fetched + :ivar report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics + :ivar period_start: The start date from which report insights data is included + :ivar period_end: The end date till report insights data is included + :ivar updated: Updated time of the report insights + :ivar insights: List of report insights breakdown + :ivar url: The URL of this resource + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + instance_sid: Optional[str] = None, + ): + super().__init__(version) + + self.instance_sid: Optional[str] = payload.get("instance_sid") + self.report_id: Optional[str] = payload.get("report_id") + self.period_start: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("period_start") + ) + self.period_end: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("period_end") + ) + self.updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("updated") + ) + self.insights: Optional[List[Dict[str, object]]] = payload.get("insights") + self.url: Optional[str] = payload.get("url") + + self._solution = { + "instance_sid": instance_sid or self.instance_sid, + } + self._context: Optional[InsightsConversationalAiReportInsightsContext] = None + + @property + def _proxy(self) -> "InsightsConversationalAiReportInsightsContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: InsightsConversationalAiReportInsightsContext for this InsightsConversationalAiReportInsightsInstance + """ + if self._context is None: + self._context = InsightsConversationalAiReportInsightsContext( + self._version, + instance_sid=self._solution["instance_sid"], + ) + return self._context + + def fetch( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[str, object] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> "InsightsConversationalAiReportInsightsInstance": + """ + Fetch the InsightsConversationalAiReportInsightsInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report insights is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiReportInsightsInstance + """ + return self._proxy.fetch( + max_rows=max_rows, + report_id=report_id, + granularity=granularity, + include_date=include_date, + ) + + async def fetch_async( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[str, object] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> "InsightsConversationalAiReportInsightsInstance": + """ + Asynchronous coroutine to fetch the InsightsConversationalAiReportInsightsInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report insights is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiReportInsightsInstance + """ + return await self._proxy.fetch_async( + max_rows=max_rows, + report_id=report_id, + granularity=granularity, + include_date=include_date, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class InsightsConversationalAiReportInsightsContext(InstanceContext): + + def __init__(self, version: Version, instance_sid: str): + """ + Initialize the InsightsConversationalAiReportInsightsContext + + :param version: Version that contains the resource + :param instance_sid: The Instance SID of the instance for which report insights will be fetched + """ + super().__init__(version) + + # Path Solution + self._solution = { + "instance_sid": instance_sid, + } + self._uri = "/Insights/Instances/{instance_sid}/AI/ReportInsights".format( + **self._solution + ) + + def fetch( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[str, object] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> InsightsConversationalAiReportInsightsInstance: + """ + Fetch the InsightsConversationalAiReportInsightsInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report insights is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiReportInsightsInstance + """ + + data = values.of( + { + "MaxRows": max_rows, + "ReportId": report_id, + "Granularity": granularity, + "IncludeDate": serialize.iso8601_datetime(include_date), + } + ) + + payload = self._version.fetch(method="GET", uri=self._uri, params=data) + + return InsightsConversationalAiReportInsightsInstance( + self._version, + payload, + instance_sid=self._solution["instance_sid"], + ) + + async def fetch_async( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[str, object] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> InsightsConversationalAiReportInsightsInstance: + """ + Asynchronous coroutine to fetch the InsightsConversationalAiReportInsightsInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report insights is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiReportInsightsInstance + """ + + data = values.of( + { + "MaxRows": max_rows, + "ReportId": report_id, + "Granularity": granularity, + "IncludeDate": serialize.iso8601_datetime(include_date), + } + ) + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, params=data + ) + + return InsightsConversationalAiReportInsightsInstance( + self._version, + payload, + instance_sid=self._solution["instance_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class InsightsConversationalAiReportInsightsList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the InsightsConversationalAiReportInsightsList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, instance_sid: str) -> InsightsConversationalAiReportInsightsContext: + """ + Constructs a InsightsConversationalAiReportInsightsContext + + :param instance_sid: The Instance SID of the instance for which report insights will be fetched + """ + return InsightsConversationalAiReportInsightsContext( + self._version, instance_sid=instance_sid + ) + + def __call__( + self, instance_sid: str + ) -> InsightsConversationalAiReportInsightsContext: + """ + Constructs a InsightsConversationalAiReportInsightsContext + + :param instance_sid: The Instance SID of the instance for which report insights will be fetched + """ + return InsightsConversationalAiReportInsightsContext( + self._version, instance_sid=instance_sid + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v1/insights_conversations.py b/twilio/rest/flex_api/v1/insights_conversations.py index 205f43c39b..d08608c7e4 100644 --- a/twilio/rest/flex_api/v1/insights_conversations.py +++ b/twilio/rest/flex_api/v1/insights_conversations.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class InsightsConversationsInstance(InstanceResource): - """ :ivar account_id: The id of the account. :ivar conversation_id: The unique id of the conversation @@ -52,6 +50,7 @@ def __repr__(self) -> str: class InsightsConversationsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InsightsConversationsInstance: """ Build an instance of InsightsConversationsInstance @@ -70,6 +69,7 @@ def __repr__(self) -> str: class InsightsConversationsList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsConversationsList diff --git a/twilio/rest/flex_api/v1/insights_questionnaires.py b/twilio/rest/flex_api/v1/insights_questionnaires.py index f4fedcbe33..fe0338a9fe 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class InsightsQuestionnairesInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. :ivar questionnaire_sid: The sid of this questionnaire @@ -189,6 +187,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesContext(InstanceContext): + def __init__(self, version: Version, questionnaire_sid: str): """ Initialize the InsightsQuestionnairesContext @@ -393,6 +392,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InsightsQuestionnairesInstance: """ Build an instance of InsightsQuestionnairesInstance @@ -411,6 +411,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsQuestionnairesList diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_category.py b/twilio/rest/flex_api/v1/insights_questionnaires_category.py index 659e10ec6b..28057dbc00 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_category.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_category.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class InsightsQuestionnairesCategoryInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. :ivar category_sid: The SID of the category @@ -135,6 +133,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesCategoryContext(InstanceContext): + def __init__(self, version: Version, category_sid: str): """ Initialize the InsightsQuestionnairesCategoryContext @@ -261,6 +260,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesCategoryPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> InsightsQuestionnairesCategoryInstance: @@ -281,6 +281,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesCategoryList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsQuestionnairesCategoryList diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_question.py b/twilio/rest/flex_api/v1/insights_questionnaires_question.py index b8d1fe4251..b796ff6afd 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_question.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_question.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class InsightsQuestionnairesQuestionInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. :ivar question_sid: The SID of the question @@ -175,6 +173,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesQuestionContext(InstanceContext): + def __init__(self, version: Version, question_sid: str): """ Initialize the InsightsQuestionnairesQuestionContext @@ -329,6 +328,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesQuestionPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> InsightsQuestionnairesQuestionInstance: @@ -349,6 +349,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesQuestionList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsQuestionnairesQuestionList diff --git a/twilio/rest/flex_api/v1/insights_segments.py b/twilio/rest/flex_api/v1/insights_segments.py index 3de3138ff2..2d509802a9 100644 --- a/twilio/rest/flex_api/v1/insights_segments.py +++ b/twilio/rest/flex_api/v1/insights_segments.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values @@ -23,7 +22,6 @@ class InsightsSegmentsInstance(InstanceResource): - """ :ivar segment_id: To unique id of the segment :ivar external_id: The unique id for the conversation. @@ -96,6 +94,7 @@ def __repr__(self) -> str: class InsightsSegmentsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InsightsSegmentsInstance: """ Build an instance of InsightsSegmentsInstance @@ -114,6 +113,7 @@ def __repr__(self) -> str: class InsightsSegmentsList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsSegmentsList diff --git a/twilio/rest/flex_api/v1/insights_session.py b/twilio/rest/flex_api/v1/insights_session.py index d0b889822e..b4174aa949 100644 --- a/twilio/rest/flex_api/v1/insights_session.py +++ b/twilio/rest/flex_api/v1/insights_session.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class InsightsSessionInstance(InstanceResource): - """ :ivar workspace_id: Unique ID to identify the user's workspace :ivar session_expiry: The session expiry date and time, given in ISO 8601 format. @@ -95,6 +93,7 @@ def __repr__(self) -> str: class InsightsSessionContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the InsightsSessionContext @@ -158,6 +157,7 @@ def __repr__(self) -> str: class InsightsSessionList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsSessionList 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 46762d48af..767737da67 100644 --- a/twilio/rest/flex_api/v1/insights_settings_answer_sets.py +++ b/twilio/rest/flex_api/v1/insights_settings_answer_sets.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values @@ -22,7 +21,6 @@ class InsightsSettingsAnswerSetsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. :ivar answer_sets: The lis of answer sets @@ -53,6 +51,7 @@ def __repr__(self) -> str: class InsightsSettingsAnswerSetsList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsSettingsAnswerSetsList diff --git a/twilio/rest/flex_api/v1/insights_settings_comment.py b/twilio/rest/flex_api/v1/insights_settings_comment.py index 92b135e85e..5d41e8d3b3 100644 --- a/twilio/rest/flex_api/v1/insights_settings_comment.py +++ b/twilio/rest/flex_api/v1/insights_settings_comment.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values @@ -22,7 +21,6 @@ class InsightsSettingsCommentInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. :ivar comments: @@ -47,6 +45,7 @@ def __repr__(self) -> str: class InsightsSettingsCommentList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsSettingsCommentList diff --git a/twilio/rest/flex_api/v1/insights_user_roles.py b/twilio/rest/flex_api/v1/insights_user_roles.py index 25d406bcb2..9dbea5fa3b 100644 --- a/twilio/rest/flex_api/v1/insights_user_roles.py +++ b/twilio/rest/flex_api/v1/insights_user_roles.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class InsightsUserRolesInstance(InstanceResource): - """ :ivar roles: Flex Insights roles for the user :ivar url: @@ -89,6 +87,7 @@ def __repr__(self) -> str: class InsightsUserRolesContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the InsightsUserRolesContext @@ -160,6 +159,7 @@ def __repr__(self) -> str: class InsightsUserRolesList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsUserRolesList diff --git a/twilio/rest/flex_api/v1/interaction/__init__.py b/twilio/rest/flex_api/v1/interaction/__init__.py index 7d81b3f019..992cc9b015 100644 --- a/twilio/rest/flex_api/v1/interaction/__init__.py +++ b/twilio/rest/flex_api/v1/interaction/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -26,7 +25,6 @@ class InteractionInstance(InstanceResource): - """ :ivar sid: The unique string created by Twilio to identify an Interaction resource, prefixed with KD. :ivar channel: A JSON object that defines the Interaction’s communication channel and includes details about the channel. See the [Outbound SMS](https://www.twilio.com/docs/flex/developer/conversations/interactions-api/interactions#agent-initiated-outbound-interactions) and [inbound (API-initiated)](https://www.twilio.com/docs/flex/developer/conversations/interactions-api/interactions#api-initiated-contact) Channel object examples. @@ -106,6 +104,7 @@ def __repr__(self) -> str: class InteractionContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the InteractionContext @@ -184,6 +183,7 @@ def __repr__(self) -> str: class InteractionList(ListResource): + def __init__(self, version: Version): """ Initialize the InteractionList diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py index d15ff24080..a26dc0425e 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext @@ -29,6 +28,7 @@ class InteractionChannelInstance(InstanceResource): + class ChannelStatus(object): SETUP = "setup" ACTIVE = "active" @@ -182,6 +182,7 @@ def __repr__(self) -> str: class InteractionChannelContext(InstanceContext): + def __init__(self, version: Version, interaction_sid: str, sid: str): """ Initialize the InteractionChannelContext @@ -347,6 +348,7 @@ def __repr__(self) -> str: class InteractionChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InteractionChannelInstance: """ Build an instance of InteractionChannelInstance @@ -367,6 +369,7 @@ def __repr__(self) -> str: class InteractionChannelList(ListResource): + def __init__(self, version: Version, interaction_sid: str): """ Initialize the InteractionChannelList 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 899c78593a..5292297b98 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values @@ -23,7 +22,6 @@ class InteractionChannelInviteInstance(InstanceResource): - """ :ivar sid: The unique string created by Twilio to identify an Interaction Channel Invite resource. :ivar interaction_sid: The Interaction SID for this Channel. @@ -63,6 +61,7 @@ def __repr__(self) -> str: class InteractionChannelInvitePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InteractionChannelInviteInstance: """ Build an instance of InteractionChannelInviteInstance @@ -86,6 +85,7 @@ def __repr__(self) -> str: class InteractionChannelInviteList(ListResource): + def __init__(self, version: Version, interaction_sid: str, channel_sid: str): """ Initialize the InteractionChannelInviteList 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 6aa291d80b..649439ba2b 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -23,6 +22,7 @@ class InteractionChannelParticipantInstance(InstanceResource): + class Status(object): CLOSED = "closed" WRAPUP = "wrapup" @@ -125,6 +125,7 @@ def __repr__(self) -> str: class InteractionChannelParticipantContext(InstanceContext): + def __init__( self, version: Version, interaction_sid: str, channel_sid: str, sid: str ): @@ -221,6 +222,7 @@ def __repr__(self) -> str: class InteractionChannelParticipantPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> InteractionChannelParticipantInstance: @@ -246,6 +248,7 @@ def __repr__(self) -> str: class InteractionChannelParticipantList(ListResource): + def __init__(self, version: Version, interaction_sid: str, channel_sid: str): """ Initialize the InteractionChannelParticipantList diff --git a/twilio/rest/flex_api/v1/provisioning_status.py b/twilio/rest/flex_api/v1/provisioning_status.py index 7b00927e0e..9cc9144dcc 100644 --- a/twilio/rest/flex_api/v1/provisioning_status.py +++ b/twilio/rest/flex_api/v1/provisioning_status.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,6 +20,7 @@ class ProvisioningStatusInstance(InstanceResource): + class Status(object): ACTIVE = "active" IN_PROGRESS = "in-progress" @@ -85,6 +85,7 @@ def __repr__(self) -> str: class ProvisioningStatusContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the ProvisioningStatusContext @@ -142,6 +143,7 @@ def __repr__(self) -> str: class ProvisioningStatusList(ListResource): + def __init__(self, version: Version): """ Initialize the ProvisioningStatusList diff --git a/twilio/rest/flex_api/v1/web_channel.py b/twilio/rest/flex_api/v1/web_channel.py index 79910f9326..ddf9c8f902 100644 --- a/twilio/rest/flex_api/v1/web_channel.py +++ b/twilio/rest/flex_api/v1/web_channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class WebChannelInstance(InstanceResource): + class ChatStatus(object): INACTIVE = "inactive" @@ -155,6 +155,7 @@ def __repr__(self) -> str: class WebChannelContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the WebChannelContext @@ -299,6 +300,7 @@ def __repr__(self) -> str: class WebChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WebChannelInstance: """ Build an instance of WebChannelInstance @@ -317,6 +319,7 @@ def __repr__(self) -> str: class WebChannelList(ListResource): + def __init__(self, version: Version): """ Initialize the WebChannelList diff --git a/twilio/rest/flex_api/v2/__init__.py b/twilio/rest/flex_api/v2/__init__.py index e48012241d..021615e19f 100644 --- a/twilio/rest/flex_api/v2/__init__.py +++ b/twilio/rest/flex_api/v2/__init__.py @@ -19,6 +19,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of FlexApi diff --git a/twilio/rest/flex_api/v2/web_channels.py b/twilio/rest/flex_api/v2/web_channels.py index 56c0fc2188..13e5b28d7a 100644 --- a/twilio/rest/flex_api/v2/web_channels.py +++ b/twilio/rest/flex_api/v2/web_channels.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values @@ -22,7 +21,6 @@ class WebChannelsInstance(InstanceResource): - """ :ivar conversation_sid: The unique string representing the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) created. :ivar identity: The unique string representing the User created and should be authorized to participate in the Conversation. For more details, see [User Identity & Access Tokens](https://www.twilio.com/docs/conversations/identity). @@ -45,6 +43,7 @@ def __repr__(self) -> str: class WebChannelsList(ListResource): + def __init__(self, version: Version): """ Initialize the WebChannelsList diff --git a/twilio/rest/frontline_api/FrontlineApiBase.py b/twilio/rest/frontline_api/FrontlineApiBase.py index 302854dc0c..d9dadc16e9 100644 --- a/twilio/rest/frontline_api/FrontlineApiBase.py +++ b/twilio/rest/frontline_api/FrontlineApiBase.py @@ -17,6 +17,7 @@ class FrontlineApiBase(Domain): + def __init__(self, twilio: Client): """ Initialize the FrontlineApi Domain diff --git a/twilio/rest/frontline_api/v1/__init__.py b/twilio/rest/frontline_api/v1/__init__.py index d2629dd5a0..610ed37194 100644 --- a/twilio/rest/frontline_api/v1/__init__.py +++ b/twilio/rest/frontline_api/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of FrontlineApi diff --git a/twilio/rest/frontline_api/v1/user.py b/twilio/rest/frontline_api/v1/user.py index aa279937e8..b14fbd0989 100644 --- a/twilio/rest/frontline_api/v1/user.py +++ b/twilio/rest/frontline_api/v1/user.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,6 +21,7 @@ class UserInstance(InstanceResource): + class StateType(object): ACTIVE = "active" DEACTIVATED = "deactivated" @@ -146,6 +146,7 @@ def __repr__(self) -> str: class UserContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the UserContext @@ -278,6 +279,7 @@ def __repr__(self) -> str: class UserList(ListResource): + def __init__(self, version: Version): """ Initialize the UserList diff --git a/twilio/rest/insights/InsightsBase.py b/twilio/rest/insights/InsightsBase.py index efe713ba03..458122cec7 100644 --- a/twilio/rest/insights/InsightsBase.py +++ b/twilio/rest/insights/InsightsBase.py @@ -17,6 +17,7 @@ class InsightsBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Insights Domain diff --git a/twilio/rest/insights/v1/__init__.py b/twilio/rest/insights/v1/__init__.py index b5b6c44863..8f7d1946f0 100644 --- a/twilio/rest/insights/v1/__init__.py +++ b/twilio/rest/insights/v1/__init__.py @@ -23,6 +23,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Insights diff --git a/twilio/rest/insights/v1/call/__init__.py b/twilio/rest/insights/v1/call/__init__.py index 32672015ba..ff628b7d06 100644 --- a/twilio/rest/insights/v1/call/__init__.py +++ b/twilio/rest/insights/v1/call/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -26,7 +25,6 @@ class CallInstance(InstanceResource): - """ :ivar sid: :ivar url: @@ -119,6 +117,7 @@ def __repr__(self) -> str: class CallContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CallContext @@ -236,6 +235,7 @@ def __repr__(self) -> str: class CallList(ListResource): + def __init__(self, version: Version): """ Initialize the CallList diff --git a/twilio/rest/insights/v1/call/annotation.py b/twilio/rest/insights/v1/call/annotation.py index a282dcbba0..0d3f7bb4f4 100644 --- a/twilio/rest/insights/v1/call/annotation.py +++ b/twilio/rest/insights/v1/call/annotation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -22,6 +21,7 @@ class AnnotationInstance(InstanceResource): + class AnsweredBy(object): UNKNOWN_ANSWERED_BY = "unknown_answered_by" HUMAN = "human" @@ -56,9 +56,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], call_sid: str): self.answered_by: Optional["AnnotationInstance.AnsweredBy"] = payload.get( "answered_by" ) - self.connectivity_issue: Optional[ - "AnnotationInstance.ConnectivityIssue" - ] = payload.get("connectivity_issue") + self.connectivity_issue: Optional["AnnotationInstance.ConnectivityIssue"] = ( + payload.get("connectivity_issue") + ) self.quality_issues: Optional[List[str]] = payload.get("quality_issues") self.spam: Optional[bool] = payload.get("spam") self.call_score: Optional[int] = deserialize.integer(payload.get("call_score")) @@ -185,6 +185,7 @@ def __repr__(self) -> str: class AnnotationContext(InstanceContext): + def __init__(self, version: Version, call_sid: str): """ Initialize the AnnotationContext @@ -343,6 +344,7 @@ def __repr__(self) -> str: class AnnotationList(ListResource): + def __init__(self, version: Version, call_sid: str): """ Initialize the AnnotationList diff --git a/twilio/rest/insights/v1/call/call_summary.py b/twilio/rest/insights/v1/call/call_summary.py index bb12443697..0e256b36c8 100644 --- a/twilio/rest/insights/v1/call/call_summary.py +++ b/twilio/rest/insights/v1/call/call_summary.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values @@ -23,6 +22,7 @@ class CallSummaryInstance(InstanceResource): + class AnsweredBy(object): UNKNOWN = "unknown" MACHINE_START = "machine_start" @@ -92,9 +92,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], call_sid: str): self.answered_by: Optional["CallSummaryInstance.AnsweredBy"] = payload.get( "answered_by" ) - self.processing_state: Optional[ - "CallSummaryInstance.ProcessingState" - ] = payload.get("processing_state") + self.processing_state: Optional["CallSummaryInstance.ProcessingState"] = ( + payload.get("processing_state") + ) self.created_time: Optional[datetime] = deserialize.iso8601_datetime( payload.get("created_time") ) @@ -186,6 +186,7 @@ def __repr__(self) -> str: class CallSummaryContext(InstanceContext): + def __init__(self, version: Version, call_sid: str): """ Initialize the CallSummaryContext @@ -270,6 +271,7 @@ def __repr__(self) -> str: class CallSummaryList(ListResource): + def __init__(self, version: Version, call_sid: str): """ Initialize the CallSummaryList diff --git a/twilio/rest/insights/v1/call/event.py b/twilio/rest/insights/v1/call/event.py index f970b8298b..89734f110a 100644 --- a/twilio/rest/insights/v1/call/event.py +++ b/twilio/rest/insights/v1/call/event.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values @@ -23,6 +22,7 @@ class EventInstance(InstanceResource): + class Level(object): UNKNOWN = "UNKNOWN" DEBUG = "DEBUG" @@ -81,6 +81,7 @@ def __repr__(self) -> str: class EventPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EventInstance: """ Build an instance of EventInstance @@ -101,6 +102,7 @@ def __repr__(self) -> str: class EventList(ListResource): + def __init__(self, version: Version, call_sid: str): """ Initialize the EventList diff --git a/twilio/rest/insights/v1/call/metric.py b/twilio/rest/insights/v1/call/metric.py index fea59cc284..3cf9decc53 100644 --- a/twilio/rest/insights/v1/call/metric.py +++ b/twilio/rest/insights/v1/call/metric.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values @@ -23,6 +22,7 @@ class MetricInstance(InstanceResource): + class StreamDirection(object): UNKNOWN = "unknown" INBOUND = "inbound" @@ -78,6 +78,7 @@ def __repr__(self) -> str: class MetricPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MetricInstance: """ Build an instance of MetricInstance @@ -98,6 +99,7 @@ def __repr__(self) -> str: class MetricList(ListResource): + def __init__(self, version: Version, call_sid: str): """ Initialize the MetricList diff --git a/twilio/rest/insights/v1/call_summaries.py b/twilio/rest/insights/v1/call_summaries.py index 98555812e4..78cd5b506e 100644 --- a/twilio/rest/insights/v1/call_summaries.py +++ b/twilio/rest/insights/v1/call_summaries.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class CallSummariesInstance(InstanceResource): + class AnsweredBy(object): UNKNOWN = "unknown" MACHINE_START = "machine_start" @@ -103,9 +103,9 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.call_state: Optional["CallSummariesInstance.CallState"] = payload.get( "call_state" ) - self.processing_state: Optional[ - "CallSummariesInstance.ProcessingState" - ] = payload.get("processing_state") + self.processing_state: Optional["CallSummariesInstance.ProcessingState"] = ( + payload.get("processing_state") + ) self.created_time: Optional[datetime] = deserialize.iso8601_datetime( payload.get("created_time") ) @@ -143,6 +143,7 @@ def __repr__(self) -> str: class CallSummariesPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CallSummariesInstance: """ Build an instance of CallSummariesInstance @@ -161,6 +162,7 @@ def __repr__(self) -> str: class CallSummariesList(ListResource): + def __init__(self, version: Version): """ Initialize the CallSummariesList diff --git a/twilio/rest/insights/v1/conference/__init__.py b/twilio/rest/insights/v1/conference/__init__.py index ca0a316eee..1ee8c09dc8 100644 --- a/twilio/rest/insights/v1/conference/__init__.py +++ b/twilio/rest/insights/v1/conference/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,6 +26,7 @@ class ConferenceInstance(InstanceResource): + class ConferenceEndReason(object): LAST_PARTICIPANT_LEFT = "last_participant_left" CONFERENCE_ENDED_VIA_API = "conference_ended_via_api" @@ -135,25 +135,25 @@ def __init__( self.unique_participants: Optional[int] = deserialize.integer( payload.get("unique_participants") ) - self.end_reason: Optional[ - "ConferenceInstance.ConferenceEndReason" - ] = payload.get("end_reason") + self.end_reason: Optional["ConferenceInstance.ConferenceEndReason"] = ( + payload.get("end_reason") + ) self.ended_by: Optional[str] = payload.get("ended_by") self.mixer_region: Optional["ConferenceInstance.Region"] = payload.get( "mixer_region" ) - self.mixer_region_requested: Optional[ - "ConferenceInstance.Region" - ] = payload.get("mixer_region_requested") + self.mixer_region_requested: Optional["ConferenceInstance.Region"] = ( + payload.get("mixer_region_requested") + ) self.recording_enabled: Optional[bool] = payload.get("recording_enabled") self.detected_issues: Optional[Dict[str, object]] = payload.get( "detected_issues" ) self.tags: Optional[List["ConferenceInstance.Tag"]] = payload.get("tags") self.tag_info: Optional[Dict[str, object]] = payload.get("tag_info") - self.processing_state: Optional[ - "ConferenceInstance.ProcessingState" - ] = payload.get("processing_state") + self.processing_state: Optional["ConferenceInstance.ProcessingState"] = ( + payload.get("processing_state") + ) self.url: Optional[str] = payload.get("url") self.links: Optional[Dict[str, object]] = payload.get("links") @@ -213,6 +213,7 @@ def __repr__(self) -> str: class ConferenceContext(InstanceContext): + def __init__(self, version: Version, conference_sid: str): """ Initialize the ConferenceContext @@ -291,6 +292,7 @@ def __repr__(self) -> str: class ConferencePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConferenceInstance: """ Build an instance of ConferenceInstance @@ -309,6 +311,7 @@ def __repr__(self) -> str: class ConferenceList(ListResource): + def __init__(self, version: Version): """ Initialize the ConferenceList diff --git a/twilio/rest/insights/v1/conference/conference_participant.py b/twilio/rest/insights/v1/conference/conference_participant.py index e6c5489b41..68faa690b3 100644 --- a/twilio/rest/insights/v1/conference/conference_participant.py +++ b/twilio/rest/insights/v1/conference/conference_participant.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class ConferenceParticipantInstance(InstanceResource): + class CallDirection(object): INBOUND = "inbound" OUTBOUND = "outbound" @@ -107,14 +107,14 @@ def __init__( self.conference_sid: Optional[str] = payload.get("conference_sid") self.call_sid: Optional[str] = payload.get("call_sid") self.account_sid: Optional[str] = payload.get("account_sid") - self.call_direction: Optional[ - "ConferenceParticipantInstance.CallDirection" - ] = payload.get("call_direction") + self.call_direction: Optional["ConferenceParticipantInstance.CallDirection"] = ( + payload.get("call_direction") + ) self._from: Optional[str] = payload.get("from") self.to: Optional[str] = payload.get("to") - self.call_status: Optional[ - "ConferenceParticipantInstance.CallStatus" - ] = payload.get("call_status") + self.call_status: Optional["ConferenceParticipantInstance.CallStatus"] = ( + payload.get("call_status") + ) self.country_code: Optional[str] = payload.get("country_code") self.is_moderator: Optional[bool] = payload.get("is_moderator") self.join_time: Optional[datetime] = deserialize.iso8601_datetime( @@ -139,15 +139,15 @@ def __init__( self.coached_participants: Optional[List[str]] = payload.get( "coached_participants" ) - self.participant_region: Optional[ - "ConferenceParticipantInstance.Region" - ] = payload.get("participant_region") - self.conference_region: Optional[ - "ConferenceParticipantInstance.Region" - ] = payload.get("conference_region") - self.call_type: Optional[ - "ConferenceParticipantInstance.CallType" - ] = payload.get("call_type") + self.participant_region: Optional["ConferenceParticipantInstance.Region"] = ( + payload.get("participant_region") + ) + self.conference_region: Optional["ConferenceParticipantInstance.Region"] = ( + payload.get("conference_region") + ) + self.call_type: Optional["ConferenceParticipantInstance.CallType"] = ( + payload.get("call_type") + ) self.processing_state: Optional[ "ConferenceParticipantInstance.ProcessingState" ] = payload.get("processing_state") @@ -225,6 +225,7 @@ def __repr__(self) -> str: class ConferenceParticipantContext(InstanceContext): + def __init__(self, version: Version, conference_sid: str, participant_sid: str): """ Initialize the ConferenceParticipantContext @@ -319,6 +320,7 @@ def __repr__(self) -> str: class ConferenceParticipantPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConferenceParticipantInstance: """ Build an instance of ConferenceParticipantInstance @@ -339,6 +341,7 @@ def __repr__(self) -> str: class ConferenceParticipantList(ListResource): + def __init__(self, version: Version, conference_sid: str): """ Initialize the ConferenceParticipantList diff --git a/twilio/rest/insights/v1/room/__init__.py b/twilio/rest/insights/v1/room/__init__.py index c17dd25648..7361018e23 100644 --- a/twilio/rest/insights/v1/room/__init__.py +++ b/twilio/rest/insights/v1/room/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -25,6 +24,7 @@ class RoomInstance(InstanceResource): + class Codec(object): VP8 = "VP8" H264 = "H264" @@ -223,6 +223,7 @@ def __repr__(self) -> str: class RoomContext(InstanceContext): + def __init__(self, version: Version, room_sid: str): """ Initialize the RoomContext @@ -301,6 +302,7 @@ def __repr__(self) -> str: class RoomPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoomInstance: """ Build an instance of RoomInstance @@ -319,6 +321,7 @@ def __repr__(self) -> str: class RoomList(ListResource): + def __init__(self, version: Version): """ Initialize the RoomList diff --git a/twilio/rest/insights/v1/room/participant.py b/twilio/rest/insights/v1/room/participant.py index f9ed4723e4..0f6617f549 100644 --- a/twilio/rest/insights/v1/room/participant.py +++ b/twilio/rest/insights/v1/room/participant.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class ParticipantInstance(InstanceResource): + class Codec(object): VP8 = "VP8" H264 = "H264" @@ -162,6 +162,7 @@ def __repr__(self) -> str: class ParticipantContext(InstanceContext): + def __init__(self, version: Version, room_sid: str, participant_sid: str): """ Initialize the ParticipantContext @@ -232,6 +233,7 @@ def __repr__(self) -> str: class ParticipantPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantInstance: """ Build an instance of ParticipantInstance @@ -252,6 +254,7 @@ def __repr__(self) -> str: class ParticipantList(ListResource): + def __init__(self, version: Version, room_sid: str): """ Initialize the ParticipantList diff --git a/twilio/rest/insights/v1/setting.py b/twilio/rest/insights/v1/setting.py index 10dc574239..f0bb5f60d8 100644 --- a/twilio/rest/insights/v1/setting.py +++ b/twilio/rest/insights/v1/setting.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class SettingInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Account. :ivar advanced_features: A boolean flag indicating whether Advanced Features for Voice Insights are enabled. @@ -135,6 +133,7 @@ def __repr__(self) -> str: class SettingContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the SettingContext @@ -268,6 +267,7 @@ def __repr__(self) -> str: class SettingList(ListResource): + def __init__(self, version: Version): """ Initialize the SettingList diff --git a/twilio/rest/intelligence/IntelligenceBase.py b/twilio/rest/intelligence/IntelligenceBase.py index 2cece972e4..0546bc15ae 100644 --- a/twilio/rest/intelligence/IntelligenceBase.py +++ b/twilio/rest/intelligence/IntelligenceBase.py @@ -17,6 +17,7 @@ class IntelligenceBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Intelligence Domain diff --git a/twilio/rest/intelligence/v2/__init__.py b/twilio/rest/intelligence/v2/__init__.py index 448b323e36..e20b125ced 100644 --- a/twilio/rest/intelligence/v2/__init__.py +++ b/twilio/rest/intelligence/v2/__init__.py @@ -20,6 +20,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Intelligence diff --git a/twilio/rest/intelligence/v2/service.py b/twilio/rest/intelligence/v2/service.py index 3c870a5486..0761da5445 100644 --- a/twilio/rest/intelligence/v2/service.py +++ b/twilio/rest/intelligence/v2/service.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class ServiceInstance(InstanceResource): + class HttpMethod(object): GET = "GET" POST = "POST" @@ -34,7 +34,7 @@ class HttpMethod(object): :ivar auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. :ivar media_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. :ivar auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :ivar data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :ivar data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :ivar date_created: The date that this Service was created, given in ISO 8601 format. :ivar date_updated: The date that this Service was updated, given in ISO 8601 format. :ivar friendly_name: A human readable description of this resource, up to 64 characters. @@ -148,7 +148,7 @@ def update( :param if_match: The If-Match HTTP request header :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. @@ -190,7 +190,7 @@ async def update_async( :param if_match: The If-Match HTTP request header :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. @@ -225,6 +225,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -320,7 +321,7 @@ def update( :param if_match: The If-Match HTTP request header :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. @@ -374,7 +375,7 @@ async def update_async( :param if_match: The If-Match HTTP request header :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. @@ -421,6 +422,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -439,6 +441,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -467,7 +470,7 @@ def create( :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. @@ -517,7 +520,7 @@ async def create_async( :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. diff --git a/twilio/rest/intelligence/v2/transcript/__init__.py b/twilio/rest/intelligence/v2/transcript/__init__.py index 63de42b7b8..30b97f89bd 100644 --- a/twilio/rest/intelligence/v2/transcript/__init__.py +++ b/twilio/rest/intelligence/v2/transcript/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,6 +26,7 @@ class TranscriptInstance(InstanceResource): + class Status(object): QUEUED = "queued" IN_PROGRESS = "in-progress" @@ -42,7 +42,7 @@ class Status(object): :ivar date_updated: The date that this Transcript was updated, given in ISO 8601 format. :ivar status: :ivar channel: Media Channel describing Transcript Source and Participant Mapping - :ivar data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :ivar data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :ivar language_code: The default language code of the audio. :ivar customer_key: :ivar media_start_time: The date that this Transcript's media was started, given in ISO 8601 format. @@ -167,6 +167,7 @@ def __repr__(self) -> str: class TranscriptContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the TranscriptContext @@ -295,6 +296,7 @@ def __repr__(self) -> str: class TranscriptPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TranscriptInstance: """ Build an instance of TranscriptInstance @@ -313,6 +315,7 @@ def __repr__(self) -> str: class TranscriptList(ListResource): + def __init__(self, version: Version): """ Initialize the TranscriptList diff --git a/twilio/rest/intelligence/v2/transcript/media.py b/twilio/rest/intelligence/v2/transcript/media.py index 89a675a95c..cb129b436a 100644 --- a/twilio/rest/intelligence/v2/transcript/media.py +++ b/twilio/rest/intelligence/v2/transcript/media.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class MediaInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Account. :ivar media_url: Downloadable URL for media, if stored in Twilio AI. @@ -97,6 +95,7 @@ def __repr__(self) -> str: class MediaContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the MediaContext @@ -173,6 +172,7 @@ def __repr__(self) -> str: class MediaList(ListResource): + def __init__(self, version: Version, sid: str): """ Initialize the MediaList diff --git a/twilio/rest/intelligence/v2/transcript/operator_result.py b/twilio/rest/intelligence/v2/transcript/operator_result.py index 3a381333cf..0865673329 100644 --- a/twilio/rest/intelligence/v2/transcript/operator_result.py +++ b/twilio/rest/intelligence/v2/transcript/operator_result.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -23,6 +22,7 @@ class OperatorResultInstance(InstanceResource): + class OperatorType(object): CONVERSATION_CLASSIFY = "conversation_classify" UTTERANCE_CLASSIFY = "utterance_classify" @@ -57,9 +57,9 @@ def __init__( ): super().__init__(version) - self.operator_type: Optional[ - "OperatorResultInstance.OperatorType" - ] = payload.get("operator_type") + self.operator_type: Optional["OperatorResultInstance.OperatorType"] = ( + payload.get("operator_type") + ) self.name: Optional[str] = payload.get("name") self.operator_sid: Optional[str] = payload.get("operator_sid") self.extract_match: Optional[bool] = payload.get("extract_match") @@ -148,6 +148,7 @@ def __repr__(self) -> str: class OperatorResultContext(InstanceContext): + def __init__(self, version: Version, transcript_sid: str, operator_sid: str): """ Initialize the OperatorResultContext @@ -234,6 +235,7 @@ def __repr__(self) -> str: class OperatorResultPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> OperatorResultInstance: """ Build an instance of OperatorResultInstance @@ -254,6 +256,7 @@ def __repr__(self) -> str: class OperatorResultList(ListResource): + def __init__(self, version: Version, transcript_sid: str): """ Initialize the OperatorResultList diff --git a/twilio/rest/intelligence/v2/transcript/sentence.py b/twilio/rest/intelligence/v2/transcript/sentence.py index 0f31769443..f419135419 100644 --- a/twilio/rest/intelligence/v2/transcript/sentence.py +++ b/twilio/rest/intelligence/v2/transcript/sentence.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class SentenceInstance(InstanceResource): - """ :ivar media_channel: The channel number. :ivar sentence_index: The index of the sentence in the transcript. @@ -68,6 +66,7 @@ def __repr__(self) -> str: class SentencePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SentenceInstance: """ Build an instance of SentenceInstance @@ -88,6 +87,7 @@ def __repr__(self) -> str: class SentenceList(ListResource): + def __init__(self, version: Version, transcript_sid: str): """ Initialize the SentenceList diff --git a/twilio/rest/ip_messaging/IpMessagingBase.py b/twilio/rest/ip_messaging/IpMessagingBase.py index d9e063c308..752d41adce 100644 --- a/twilio/rest/ip_messaging/IpMessagingBase.py +++ b/twilio/rest/ip_messaging/IpMessagingBase.py @@ -18,6 +18,7 @@ class IpMessagingBase(Domain): + def __init__(self, twilio: Client): """ Initialize the IpMessaging Domain diff --git a/twilio/rest/ip_messaging/v1/__init__.py b/twilio/rest/ip_messaging/v1/__init__.py index 1fd53b76b1..d1f40c791f 100644 --- a/twilio/rest/ip_messaging/v1/__init__.py +++ b/twilio/rest/ip_messaging/v1/__init__.py @@ -20,6 +20,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of IpMessaging diff --git a/twilio/rest/ip_messaging/v1/credential.py b/twilio/rest/ip_messaging/v1/credential.py index f13fd814f2..01423f4900 100644 --- a/twilio/rest/ip_messaging/v1/credential.py +++ b/twilio/rest/ip_messaging/v1/credential.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class CredentialInstance(InstanceResource): + class PushService(object): GCM = "gcm" APN = "apn" @@ -185,6 +185,7 @@ def __repr__(self) -> str: class CredentialContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CredentialContext @@ -353,6 +354,7 @@ def __repr__(self) -> str: class CredentialPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialInstance: """ Build an instance of CredentialInstance @@ -371,6 +373,7 @@ def __repr__(self) -> str: class CredentialList(ListResource): + def __init__(self, version: Version): """ Initialize the CredentialList diff --git a/twilio/rest/ip_messaging/v1/service/__init__.py b/twilio/rest/ip_messaging/v1/service/__init__.py index 4a2d139391..8e080657b5 100644 --- a/twilio/rest/ip_messaging/v1/service/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,7 +26,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: @@ -529,6 +527,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -1025,6 +1024,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -1043,6 +1043,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList diff --git a/twilio/rest/ip_messaging/v1/service/channel/__init__.py b/twilio/rest/ip_messaging/v1/service/channel/__init__.py index c525b08065..ef469e97f2 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/channel/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,6 +26,7 @@ class ChannelInstance(InstanceResource): + class ChannelType(object): PUBLIC = "public" PRIVATE = "private" @@ -212,6 +212,7 @@ def __repr__(self) -> str: class ChannelContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the ChannelContext @@ -419,6 +420,7 @@ def __repr__(self) -> str: class ChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ChannelInstance: """ Build an instance of ChannelInstance @@ -439,6 +441,7 @@ def __repr__(self) -> str: class ChannelList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the ChannelList diff --git a/twilio/rest/ip_messaging/v1/service/channel/invite.py b/twilio/rest/ip_messaging/v1/service/channel/invite.py index 0ccb06dfef..7078058a40 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v1/service/channel/invite.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class InviteInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: @@ -134,6 +132,7 @@ def __repr__(self) -> str: class InviteContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the InviteContext @@ -234,6 +233,7 @@ def __repr__(self) -> str: class InvitePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InviteInstance: """ Build an instance of InviteInstance @@ -257,6 +257,7 @@ def __repr__(self) -> str: class InviteList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the InviteList diff --git a/twilio/rest/ip_messaging/v1/service/channel/member.py b/twilio/rest/ip_messaging/v1/service/channel/member.py index 0c6742f683..c52fde5a8e 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/member.py +++ b/twilio/rest/ip_messaging/v1/service/channel/member.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class MemberInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: @@ -64,9 +62,9 @@ def __init__( self.last_consumed_message_index: Optional[int] = deserialize.integer( payload.get("last_consumed_message_index") ) - self.last_consumption_timestamp: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + self.last_consumption_timestamp: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + ) self.url: Optional[str] = payload.get("url") self._solution = { @@ -176,6 +174,7 @@ def __repr__(self) -> str: class MemberContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MemberContext @@ -344,6 +343,7 @@ def __repr__(self) -> str: class MemberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MemberInstance: """ Build an instance of MemberInstance @@ -367,6 +367,7 @@ def __repr__(self) -> str: class MemberList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MemberList diff --git a/twilio/rest/ip_messaging/v1/service/channel/message.py b/twilio/rest/ip_messaging/v1/service/channel/message.py index 462cb94cf0..f9f2a2b1a6 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/message.py +++ b/twilio/rest/ip_messaging/v1/service/channel/message.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class MessageInstance(InstanceResource): + class OrderType(object): ASC = "asc" DESC = "desc" @@ -179,6 +179,7 @@ def __repr__(self) -> str: class MessageContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MessageContext @@ -347,6 +348,7 @@ def __repr__(self) -> str: class MessagePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: """ Build an instance of MessageInstance @@ -370,6 +372,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MessageList diff --git a/twilio/rest/ip_messaging/v1/service/role.py b/twilio/rest/ip_messaging/v1/service/role.py index 6767e23160..935a99e180 100644 --- a/twilio/rest/ip_messaging/v1/service/role.py +++ b/twilio/rest/ip_messaging/v1/service/role.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class RoleInstance(InstanceResource): + class RoleType(object): CHANNEL = "channel" DEPLOYMENT = "deployment" @@ -156,6 +156,7 @@ def __repr__(self) -> str: class RoleContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the RoleContext @@ -302,6 +303,7 @@ def __repr__(self) -> str: class RolePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoleInstance: """ Build an instance of RoleInstance @@ -322,6 +324,7 @@ def __repr__(self) -> str: class RoleList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the RoleList diff --git a/twilio/rest/ip_messaging/v1/service/user/__init__.py b/twilio/rest/ip_messaging/v1/service/user/__init__.py index ffcd24e782..ef24fa776f 100644 --- a/twilio/rest/ip_messaging/v1/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/user/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class UserInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: @@ -191,6 +189,7 @@ def __repr__(self) -> str: class UserContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the UserContext @@ -370,6 +369,7 @@ def __repr__(self) -> str: class UserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserInstance: """ Build an instance of UserInstance @@ -390,6 +390,7 @@ def __repr__(self) -> str: class UserList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the UserList diff --git a/twilio/rest/ip_messaging/v1/service/user/user_channel.py b/twilio/rest/ip_messaging/v1/service/user/user_channel.py index 4d00fa50c0..192aafb380 100644 --- a/twilio/rest/ip_messaging/v1/service/user/user_channel.py +++ b/twilio/rest/ip_messaging/v1/service/user/user_channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,6 +22,7 @@ class UserChannelInstance(InstanceResource): + class ChannelStatus(object): JOINED = "joined" INVITED = "invited" @@ -75,6 +75,7 @@ def __repr__(self) -> str: class UserChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserChannelInstance: """ Build an instance of UserChannelInstance @@ -98,6 +99,7 @@ def __repr__(self) -> str: class UserChannelList(ListResource): + def __init__(self, version: Version, service_sid: str, user_sid: str): """ Initialize the UserChannelList diff --git a/twilio/rest/ip_messaging/v2/__init__.py b/twilio/rest/ip_messaging/v2/__init__.py index 966a35a441..6003c86b12 100644 --- a/twilio/rest/ip_messaging/v2/__init__.py +++ b/twilio/rest/ip_messaging/v2/__init__.py @@ -20,6 +20,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of IpMessaging diff --git a/twilio/rest/ip_messaging/v2/credential.py b/twilio/rest/ip_messaging/v2/credential.py index ab21588e34..f81892c742 100644 --- a/twilio/rest/ip_messaging/v2/credential.py +++ b/twilio/rest/ip_messaging/v2/credential.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class CredentialInstance(InstanceResource): + class PushService(object): GCM = "gcm" APN = "apn" @@ -185,6 +185,7 @@ def __repr__(self) -> str: class CredentialContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CredentialContext @@ -353,6 +354,7 @@ def __repr__(self) -> str: class CredentialPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialInstance: """ Build an instance of CredentialInstance @@ -371,6 +373,7 @@ def __repr__(self) -> str: class CredentialList(ListResource): + def __init__(self, version: Version): """ Initialize the CredentialList diff --git a/twilio/rest/ip_messaging/v2/service/__init__.py b/twilio/rest/ip_messaging/v2/service/__init__.py index 4e96b3b2d6..227789bab8 100644 --- a/twilio/rest/ip_messaging/v2/service/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -28,7 +27,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: @@ -411,6 +409,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -786,6 +785,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -804,6 +804,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList diff --git a/twilio/rest/ip_messaging/v2/service/binding.py b/twilio/rest/ip_messaging/v2/service/binding.py index 70dbc78fb7..24c4f65a4b 100644 --- a/twilio/rest/ip_messaging/v2/service/binding.py +++ b/twilio/rest/ip_messaging/v2/service/binding.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class BindingInstance(InstanceResource): + class BindingType(object): GCM = "gcm" APN = "apn" @@ -141,6 +141,7 @@ def __repr__(self) -> str: class BindingContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the BindingContext @@ -233,6 +234,7 @@ def __repr__(self) -> str: class BindingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BindingInstance: """ Build an instance of BindingInstance @@ -253,6 +255,7 @@ def __repr__(self) -> str: class BindingList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the BindingList diff --git a/twilio/rest/ip_messaging/v2/service/channel/__init__.py b/twilio/rest/ip_messaging/v2/service/channel/__init__.py index 6f306290f3..c4e03d4536 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/channel/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -28,6 +27,7 @@ class ChannelInstance(InstanceResource): + class ChannelType(object): PUBLIC = "public" PRIVATE = "private" @@ -268,6 +268,7 @@ def __repr__(self) -> str: class ChannelContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the ChannelContext @@ -541,6 +542,7 @@ def __repr__(self) -> str: class ChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ChannelInstance: """ Build an instance of ChannelInstance @@ -561,6 +563,7 @@ def __repr__(self) -> str: class ChannelList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the ChannelList diff --git a/twilio/rest/ip_messaging/v2/service/channel/invite.py b/twilio/rest/ip_messaging/v2/service/channel/invite.py index 71ef25df61..0f863d70f0 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v2/service/channel/invite.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class InviteInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: @@ -134,6 +132,7 @@ def __repr__(self) -> str: class InviteContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the InviteContext @@ -234,6 +233,7 @@ def __repr__(self) -> str: class InvitePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InviteInstance: """ Build an instance of InviteInstance @@ -257,6 +257,7 @@ def __repr__(self) -> str: class InviteList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the InviteList diff --git a/twilio/rest/ip_messaging/v2/service/channel/member.py b/twilio/rest/ip_messaging/v2/service/channel/member.py index 6b3aa44f67..5de4520ed3 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/member.py +++ b/twilio/rest/ip_messaging/v2/service/channel/member.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class MemberInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -68,9 +68,9 @@ def __init__( self.last_consumed_message_index: Optional[int] = deserialize.integer( payload.get("last_consumed_message_index") ) - self.last_consumption_timestamp: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + self.last_consumption_timestamp: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + ) self.url: Optional[str] = payload.get("url") self.attributes: Optional[str] = payload.get("attributes") @@ -231,6 +231,7 @@ def __repr__(self) -> str: class MemberContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MemberContext @@ -461,6 +462,7 @@ def __repr__(self) -> str: class MemberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MemberInstance: """ Build an instance of MemberInstance @@ -484,6 +486,7 @@ def __repr__(self) -> str: class MemberList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MemberList diff --git a/twilio/rest/ip_messaging/v2/service/channel/message.py b/twilio/rest/ip_messaging/v2/service/channel/message.py index 64c4ba977e..057571c2ab 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/message.py +++ b/twilio/rest/ip_messaging/v2/service/channel/message.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class MessageInstance(InstanceResource): + class OrderType(object): ASC = "asc" DESC = "desc" @@ -239,6 +239,7 @@ def __repr__(self) -> str: class MessageContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MessageContext @@ -465,6 +466,7 @@ def __repr__(self) -> str: class MessagePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: """ Build an instance of MessageInstance @@ -488,6 +490,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MessageList diff --git a/twilio/rest/ip_messaging/v2/service/channel/webhook.py b/twilio/rest/ip_messaging/v2/service/channel/webhook.py index c5c2879b20..633acfd51f 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/webhook.py +++ b/twilio/rest/ip_messaging/v2/service/channel/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class WebhookInstance(InstanceResource): + class Method(object): GET = "GET" POST = "POST" @@ -200,6 +200,7 @@ def __repr__(self) -> str: class WebhookContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the WebhookContext @@ -400,6 +401,7 @@ def __repr__(self) -> str: class WebhookPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WebhookInstance: """ Build an instance of WebhookInstance @@ -423,6 +425,7 @@ def __repr__(self) -> str: class WebhookList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the WebhookList diff --git a/twilio/rest/ip_messaging/v2/service/role.py b/twilio/rest/ip_messaging/v2/service/role.py index 2a39101b37..91fc1af939 100644 --- a/twilio/rest/ip_messaging/v2/service/role.py +++ b/twilio/rest/ip_messaging/v2/service/role.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class RoleInstance(InstanceResource): + class RoleType(object): CHANNEL = "channel" DEPLOYMENT = "deployment" @@ -156,6 +156,7 @@ def __repr__(self) -> str: class RoleContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the RoleContext @@ -302,6 +303,7 @@ def __repr__(self) -> str: class RolePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoleInstance: """ Build an instance of RoleInstance @@ -322,6 +324,7 @@ def __repr__(self) -> str: class RoleList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the RoleList diff --git a/twilio/rest/ip_messaging/v2/service/user/__init__.py b/twilio/rest/ip_messaging/v2/service/user/__init__.py index 5b632c125e..1b3ba1b391 100644 --- a/twilio/rest/ip_messaging/v2/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/user/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -26,6 +25,7 @@ class UserInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -212,6 +212,7 @@ def __repr__(self) -> str: class UserContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the UserContext @@ -419,6 +420,7 @@ def __repr__(self) -> str: class UserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserInstance: """ Build an instance of UserInstance @@ -439,6 +441,7 @@ def __repr__(self) -> str: class UserList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the UserList diff --git a/twilio/rest/ip_messaging/v2/service/user/user_binding.py b/twilio/rest/ip_messaging/v2/service/user/user_binding.py index c2e389fc92..575a295cbb 100644 --- a/twilio/rest/ip_messaging/v2/service/user/user_binding.py +++ b/twilio/rest/ip_messaging/v2/service/user/user_binding.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class UserBindingInstance(InstanceResource): + class BindingType(object): GCM = "gcm" APN = "apn" @@ -144,6 +144,7 @@ def __repr__(self) -> str: class UserBindingContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, user_sid: str, sid: str): """ Initialize the UserBindingContext @@ -242,6 +243,7 @@ def __repr__(self) -> str: class UserBindingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserBindingInstance: """ Build an instance of UserBindingInstance @@ -265,6 +267,7 @@ def __repr__(self) -> str: class UserBindingList(ListResource): + def __init__(self, version: Version, service_sid: str, user_sid: str): """ Initialize the UserBindingList diff --git a/twilio/rest/ip_messaging/v2/service/user/user_channel.py b/twilio/rest/ip_messaging/v2/service/user/user_channel.py index 51239956f0..d89e6cb80d 100644 --- a/twilio/rest/ip_messaging/v2/service/user/user_channel.py +++ b/twilio/rest/ip_messaging/v2/service/user/user_channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class UserChannelInstance(InstanceResource): + class ChannelStatus(object): JOINED = "joined" INVITED = "invited" @@ -73,9 +73,9 @@ def __init__( ) self.links: Optional[Dict[str, object]] = payload.get("links") self.url: Optional[str] = payload.get("url") - self.notification_level: Optional[ - "UserChannelInstance.NotificationLevel" - ] = payload.get("notification_level") + self.notification_level: Optional["UserChannelInstance.NotificationLevel"] = ( + payload.get("notification_level") + ) self._solution = { "service_sid": service_sid, @@ -194,6 +194,7 @@ def __repr__(self) -> str: class UserChannelContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, user_sid: str, channel_sid: str ): @@ -378,6 +379,7 @@ def __repr__(self) -> str: class UserChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserChannelInstance: """ Build an instance of UserChannelInstance @@ -401,6 +403,7 @@ def __repr__(self) -> str: class UserChannelList(ListResource): + def __init__(self, version: Version, service_sid: str, user_sid: str): """ Initialize the UserChannelList diff --git a/twilio/rest/lookups/LookupsBase.py b/twilio/rest/lookups/LookupsBase.py index fe3aa2aa6d..e24f8dc611 100644 --- a/twilio/rest/lookups/LookupsBase.py +++ b/twilio/rest/lookups/LookupsBase.py @@ -18,6 +18,7 @@ class LookupsBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Lookups Domain diff --git a/twilio/rest/lookups/v1/__init__.py b/twilio/rest/lookups/v1/__init__.py index 82f17cc04f..72204da366 100644 --- a/twilio/rest/lookups/v1/__init__.py +++ b/twilio/rest/lookups/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Lookups diff --git a/twilio/rest/lookups/v1/phone_number.py b/twilio/rest/lookups/v1/phone_number.py index f38a5c9f0b..fe521c73e9 100644 --- a/twilio/rest/lookups/v1/phone_number.py +++ b/twilio/rest/lookups/v1/phone_number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class PhoneNumberInstance(InstanceResource): - """ :ivar caller_name: The name of the phone number's owner. If `null`, that information was not available. :ivar country_code: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) for the phone number. @@ -128,6 +126,7 @@ def __repr__(self) -> str: class PhoneNumberContext(InstanceContext): + def __init__(self, version: Version, phone_number: str): """ Initialize the PhoneNumberContext @@ -226,6 +225,7 @@ def __repr__(self) -> str: class PhoneNumberList(ListResource): + def __init__(self, version: Version): """ Initialize the PhoneNumberList diff --git a/twilio/rest/lookups/v2/__init__.py b/twilio/rest/lookups/v2/__init__.py index 1cea8ab0b2..d795aea168 100644 --- a/twilio/rest/lookups/v2/__init__.py +++ b/twilio/rest/lookups/v2/__init__.py @@ -19,6 +19,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Lookups diff --git a/twilio/rest/lookups/v2/phone_number.py b/twilio/rest/lookups/v2/phone_number.py index 3a3640fbea..97ef39b940 100644 --- a/twilio/rest/lookups/v2/phone_number.py +++ b/twilio/rest/lookups/v2/phone_number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,6 +21,7 @@ class PhoneNumberInstance(InstanceResource): + class ValidationError(object): TOO_SHORT = "TOO_SHORT" TOO_LONG = "TOO_LONG" @@ -219,6 +219,7 @@ def __repr__(self) -> str: class PhoneNumberContext(InstanceContext): + def __init__(self, version: Version, phone_number: str): """ Initialize the PhoneNumberContext @@ -371,6 +372,7 @@ def __repr__(self) -> str: class PhoneNumberList(ListResource): + def __init__(self, version: Version): """ Initialize the PhoneNumberList diff --git a/twilio/rest/media/MediaBase.py b/twilio/rest/media/MediaBase.py index 28c5e37a00..6581eb5d09 100644 --- a/twilio/rest/media/MediaBase.py +++ b/twilio/rest/media/MediaBase.py @@ -17,6 +17,7 @@ class MediaBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Media Domain diff --git a/twilio/rest/media/v1/__init__.py b/twilio/rest/media/v1/__init__.py index cca96fc012..3cef1df9b2 100644 --- a/twilio/rest/media/v1/__init__.py +++ b/twilio/rest/media/v1/__init__.py @@ -21,6 +21,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Media diff --git a/twilio/rest/media/v1/media_processor.py b/twilio/rest/media/v1/media_processor.py index da4a3b0c93..7f1d2825b1 100644 --- a/twilio/rest/media/v1/media_processor.py +++ b/twilio/rest/media/v1/media_processor.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class MediaProcessorInstance(InstanceResource): + class Order(object): ASC = "asc" DESC = "desc" @@ -154,6 +154,7 @@ def __repr__(self) -> str: class MediaProcessorContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the MediaProcessorContext @@ -266,6 +267,7 @@ def __repr__(self) -> str: class MediaProcessorPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MediaProcessorInstance: """ Build an instance of MediaProcessorInstance @@ -284,6 +286,7 @@ def __repr__(self) -> str: class MediaProcessorList(ListResource): + def __init__(self, version: Version): """ Initialize the MediaProcessorList diff --git a/twilio/rest/media/v1/media_recording.py b/twilio/rest/media/v1/media_recording.py index 16d47af34e..fb916e5278 100644 --- a/twilio/rest/media/v1/media_recording.py +++ b/twilio/rest/media/v1/media_recording.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class MediaRecordingInstance(InstanceResource): + class Format(object): MP4 = "mp4" WEBM = "webm" @@ -150,6 +150,7 @@ def __repr__(self) -> str: class MediaRecordingContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the MediaRecordingContext @@ -238,6 +239,7 @@ def __repr__(self) -> str: class MediaRecordingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MediaRecordingInstance: """ Build an instance of MediaRecordingInstance @@ -256,6 +258,7 @@ def __repr__(self) -> str: class MediaRecordingList(ListResource): + def __init__(self, version: Version): """ Initialize the MediaRecordingList diff --git a/twilio/rest/media/v1/player_streamer/__init__.py b/twilio/rest/media/v1/player_streamer/__init__.py index 1d91e86a44..6ea0889fc3 100644 --- a/twilio/rest/media/v1/player_streamer/__init__.py +++ b/twilio/rest/media/v1/player_streamer/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,6 +24,7 @@ class PlayerStreamerInstance(InstanceResource): + class EndedReason(object): ENDED_VIA_API = "ended-via-api" MAX_DURATION_EXCEEDED = "max-duration-exceeded" @@ -171,6 +171,7 @@ def __repr__(self) -> str: class PlayerStreamerContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the PlayerStreamerContext @@ -297,6 +298,7 @@ def __repr__(self) -> str: class PlayerStreamerPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PlayerStreamerInstance: """ Build an instance of PlayerStreamerInstance @@ -315,6 +317,7 @@ def __repr__(self) -> str: class PlayerStreamerList(ListResource): + def __init__(self, version: Version): """ Initialize the PlayerStreamerList diff --git a/twilio/rest/media/v1/player_streamer/playback_grant.py b/twilio/rest/media/v1/player_streamer/playback_grant.py index 4ea581b474..a4cdbb4026 100644 --- a/twilio/rest/media/v1/player_streamer/playback_grant.py +++ b/twilio/rest/media/v1/player_streamer/playback_grant.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class PlaybackGrantInstance(InstanceResource): - """ :ivar sid: The unique string generated to identify the PlayerStreamer resource that this PlaybackGrant authorizes views for. :ivar url: The absolute URL of the resource. @@ -128,6 +126,7 @@ def __repr__(self) -> str: class PlaybackGrantContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the PlaybackGrantContext @@ -242,6 +241,7 @@ def __repr__(self) -> str: class PlaybackGrantList(ListResource): + def __init__(self, version: Version, sid: str): """ Initialize the PlaybackGrantList diff --git a/twilio/rest/messaging/MessagingBase.py b/twilio/rest/messaging/MessagingBase.py index ea6b0dd0a5..4fff74d914 100644 --- a/twilio/rest/messaging/MessagingBase.py +++ b/twilio/rest/messaging/MessagingBase.py @@ -17,6 +17,7 @@ class MessagingBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Messaging Domain diff --git a/twilio/rest/messaging/v1/__init__.py b/twilio/rest/messaging/v1/__init__.py index 20ce090da5..6262dfe938 100644 --- a/twilio/rest/messaging/v1/__init__.py +++ b/twilio/rest/messaging/v1/__init__.py @@ -35,6 +35,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Messaging diff --git a/twilio/rest/messaging/v1/brand_registration/__init__.py b/twilio/rest/messaging/v1/brand_registration/__init__.py index de54a2f2a8..5c6dbc8246 100644 --- a/twilio/rest/messaging/v1/brand_registration/__init__.py +++ b/twilio/rest/messaging/v1/brand_registration/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,6 +27,7 @@ class BrandRegistrationInstance(InstanceResource): + class BrandFeedback(object): TAX_ID = "TAX_ID" STOCK_SYMBOL = "STOCK_SYMBOL" @@ -103,9 +103,9 @@ def __init__( self.brand_feedback: Optional[ List["BrandRegistrationInstance.BrandFeedback"] ] = payload.get("brand_feedback") - self.identity_status: Optional[ - "BrandRegistrationInstance.IdentityStatus" - ] = payload.get("identity_status") + self.identity_status: Optional["BrandRegistrationInstance.IdentityStatus"] = ( + payload.get("identity_status") + ) self.russell_3000: Optional[bool] = payload.get("russell_3000") self.government_entity: Optional[bool] = payload.get("government_entity") self.tax_exempt_status: Optional[str] = payload.get("tax_exempt_status") @@ -196,6 +196,7 @@ def __repr__(self) -> str: class BrandRegistrationContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the BrandRegistrationContext @@ -325,6 +326,7 @@ def __repr__(self) -> str: class BrandRegistrationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BrandRegistrationInstance: """ Build an instance of BrandRegistrationInstance @@ -343,6 +345,7 @@ def __repr__(self) -> str: class BrandRegistrationList(ListResource): + def __init__(self, version: Version): """ Initialize the BrandRegistrationList 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 3cc7d364bb..20ce245b37 100644 --- a/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py +++ b/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class BrandRegistrationOtpInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Brand Registration resource. :ivar brand_registration_sid: The unique string to identify Brand Registration of Sole Proprietor Brand @@ -52,6 +50,7 @@ def __repr__(self) -> str: class BrandRegistrationOtpList(ListResource): + def __init__(self, version: Version, brand_registration_sid: str): """ Initialize the BrandRegistrationOtpList diff --git a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py index cc00fbc9ed..c801cb12b4 100644 --- a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py +++ b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class BrandVettingInstance(InstanceResource): + class VettingProvider(object): CAMPAIGN_VERIFY = "campaign-verify" @@ -61,9 +61,9 @@ def __init__( self.vetting_id: Optional[str] = payload.get("vetting_id") self.vetting_class: Optional[str] = payload.get("vetting_class") self.vetting_status: Optional[str] = payload.get("vetting_status") - self.vetting_provider: Optional[ - "BrandVettingInstance.VettingProvider" - ] = payload.get("vetting_provider") + self.vetting_provider: Optional["BrandVettingInstance.VettingProvider"] = ( + payload.get("vetting_provider") + ) self.url: Optional[str] = payload.get("url") self._solution = { @@ -117,6 +117,7 @@ def __repr__(self) -> str: class BrandVettingContext(InstanceContext): + def __init__(self, version: Version, brand_sid: str, brand_vetting_sid: str): """ Initialize the BrandVettingContext @@ -189,6 +190,7 @@ def __repr__(self) -> str: class BrandVettingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BrandVettingInstance: """ Build an instance of BrandVettingInstance @@ -209,6 +211,7 @@ def __repr__(self) -> str: class BrandVettingList(ListResource): + def __init__(self, version: Version, brand_sid: str): """ Initialize the BrandVettingList diff --git a/twilio/rest/messaging/v1/deactivations.py b/twilio/rest/messaging/v1/deactivations.py index 972ee62e30..6616d87df5 100644 --- a/twilio/rest/messaging/v1/deactivations.py +++ b/twilio/rest/messaging/v1/deactivations.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, Optional, Union from twilio.base import serialize, values @@ -23,7 +22,6 @@ class DeactivationsInstance(InstanceResource): - """ :ivar redirect_to: Returns an authenticated url that redirects to a file containing the deactivated numbers for the requested day. This url is valid for up to two minutes. """ @@ -88,6 +86,7 @@ def __repr__(self) -> str: class DeactivationsContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the DeactivationsContext @@ -157,6 +156,7 @@ def __repr__(self) -> str: class DeactivationsList(ListResource): + def __init__(self, version: Version): """ Initialize the DeactivationsList diff --git a/twilio/rest/messaging/v1/domain_certs.py b/twilio/rest/messaging/v1/domain_certs.py index 71ef3105bc..3acc8a18ff 100644 --- a/twilio/rest/messaging/v1/domain_certs.py +++ b/twilio/rest/messaging/v1/domain_certs.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class DomainCertsInstance(InstanceResource): - """ :ivar domain_sid: The unique string that we created to identify the Domain resource. :ivar date_updated: Date that this Domain was last updated. @@ -151,6 +149,7 @@ def __repr__(self) -> str: class DomainCertsContext(InstanceContext): + def __init__(self, version: Version, domain_sid: str): """ Initialize the DomainCertsContext @@ -289,6 +288,7 @@ def __repr__(self) -> str: class DomainCertsList(ListResource): + def __init__(self, version: Version): """ Initialize the DomainCertsList diff --git a/twilio/rest/messaging/v1/domain_config.py b/twilio/rest/messaging/v1/domain_config.py index fa8a65912a..4889827a60 100644 --- a/twilio/rest/messaging/v1/domain_config.py +++ b/twilio/rest/messaging/v1/domain_config.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class DomainConfigInstance(InstanceResource): - """ :ivar domain_sid: The unique string that we created to identify the Domain resource. :ivar config_sid: The unique string that we created to identify the Domain config (prefix ZK). @@ -155,6 +153,7 @@ def __repr__(self) -> str: class DomainConfigContext(InstanceContext): + def __init__(self, version: Version, domain_sid: str): """ Initialize the DomainConfigContext @@ -293,6 +292,7 @@ def __repr__(self) -> str: class DomainConfigList(ListResource): + def __init__(self, version: Version): """ Initialize the DomainConfigList diff --git a/twilio/rest/messaging/v1/domain_config_messaging_service.py b/twilio/rest/messaging/v1/domain_config_messaging_service.py index 8cded6fb47..178ebd544e 100644 --- a/twilio/rest/messaging/v1/domain_config_messaging_service.py +++ b/twilio/rest/messaging/v1/domain_config_messaging_service.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize @@ -23,7 +22,6 @@ class DomainConfigMessagingServiceInstance(InstanceResource): - """ :ivar domain_sid: The unique string that we created to identify the Domain resource. :ivar config_sid: The unique string that we created to identify the Domain config (prefix ZK). @@ -110,6 +108,7 @@ def __repr__(self) -> str: class DomainConfigMessagingServiceContext(InstanceContext): + def __init__(self, version: Version, messaging_service_sid: str): """ Initialize the DomainConfigMessagingServiceContext @@ -178,6 +177,7 @@ def __repr__(self) -> str: class DomainConfigMessagingServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the DomainConfigMessagingServiceList diff --git a/twilio/rest/messaging/v1/external_campaign.py b/twilio/rest/messaging/v1/external_campaign.py index ce232e9cf9..b70d8a4ee1 100644 --- a/twilio/rest/messaging/v1/external_campaign.py +++ b/twilio/rest/messaging/v1/external_campaign.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class ExternalCampaignInstance(InstanceResource): - """ :ivar sid: The unique string that identifies a US A2P Compliance resource `QE2c6890da8086d771620e9b13fadeba0b`. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the Campaign belongs to. @@ -54,6 +52,7 @@ def __repr__(self) -> str: class ExternalCampaignList(ListResource): + def __init__(self, version: Version): """ Initialize the ExternalCampaignList diff --git a/twilio/rest/messaging/v1/linkshortening_messaging_service.py b/twilio/rest/messaging/v1/linkshortening_messaging_service.py index c5b20e28a5..94ebfa6173 100644 --- a/twilio/rest/messaging/v1/linkshortening_messaging_service.py +++ b/twilio/rest/messaging/v1/linkshortening_messaging_service.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class LinkshorteningMessagingServiceInstance(InstanceResource): - """ :ivar domain_sid: The unique string identifies the domain resource :ivar messaging_service_sid: The unique string that identifies the messaging service @@ -114,6 +112,7 @@ def __repr__(self) -> str: class LinkshorteningMessagingServiceContext(InstanceContext): + def __init__(self, version: Version, domain_sid: str, messaging_service_sid: str): """ Initialize the LinkshorteningMessagingServiceContext @@ -208,6 +207,7 @@ def __repr__(self) -> str: class LinkshorteningMessagingServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the LinkshorteningMessagingServiceList diff --git a/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py b/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py index 37e9e7a867..a1252d2b35 100644 --- a/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py +++ b/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class LinkshorteningMessagingServiceDomainAssociationInstance(InstanceResource): - """ :ivar domain_sid: The unique string that we created to identify the Domain resource. :ivar messaging_service_sid: The unique string that identifies the messaging service @@ -96,6 +94,7 @@ def __repr__(self) -> str: class LinkshorteningMessagingServiceDomainAssociationContext(InstanceContext): + def __init__(self, version: Version, messaging_service_sid: str): """ Initialize the LinkshorteningMessagingServiceDomainAssociationContext @@ -168,6 +167,7 @@ def __repr__(self) -> str: class LinkshorteningMessagingServiceDomainAssociationList(ListResource): + def __init__(self, version: Version): """ Initialize the LinkshorteningMessagingServiceDomainAssociationList diff --git a/twilio/rest/messaging/v1/service/__init__.py b/twilio/rest/messaging/v1/service/__init__.py index 4d23155880..3695b744f7 100644 --- a/twilio/rest/messaging/v1/service/__init__.py +++ b/twilio/rest/messaging/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -32,6 +31,7 @@ class ServiceInstance(InstanceResource): + class ScanMessageContent(object): INHERIT = "inherit" ENABLE = "enable" @@ -85,9 +85,9 @@ def __init__( self.sticky_sender: Optional[bool] = payload.get("sticky_sender") self.mms_converter: Optional[bool] = payload.get("mms_converter") self.smart_encoding: Optional[bool] = payload.get("smart_encoding") - self.scan_message_content: Optional[ - "ServiceInstance.ScanMessageContent" - ] = payload.get("scan_message_content") + self.scan_message_content: Optional["ServiceInstance.ScanMessageContent"] = ( + payload.get("scan_message_content") + ) self.fallback_to_long_code: Optional[bool] = payload.get( "fallback_to_long_code" ) @@ -341,6 +341,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -652,6 +653,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -670,6 +672,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList diff --git a/twilio/rest/messaging/v1/service/alpha_sender.py b/twilio/rest/messaging/v1/service/alpha_sender.py index 9dca85f801..38d2d0d5e9 100644 --- a/twilio/rest/messaging/v1/service/alpha_sender.py +++ b/twilio/rest/messaging/v1/service/alpha_sender.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class AlphaSenderInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the AlphaSender resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AlphaSender resource. @@ -127,6 +125,7 @@ def __repr__(self) -> str: class AlphaSenderContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the AlphaSenderContext @@ -221,6 +220,7 @@ def __repr__(self) -> str: class AlphaSenderPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AlphaSenderInstance: """ Build an instance of AlphaSenderInstance @@ -241,6 +241,7 @@ def __repr__(self) -> str: class AlphaSenderList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the AlphaSenderList diff --git a/twilio/rest/messaging/v1/service/channel_sender.py b/twilio/rest/messaging/v1/service/channel_sender.py index 17a147dd16..a8de3d0cf6 100644 --- a/twilio/rest/messaging/v1/service/channel_sender.py +++ b/twilio/rest/messaging/v1/service/channel_sender.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ChannelSenderInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ChannelSender resource. :ivar messaging_service_sid: The SID of the [Service](https://www.twilio.com/docs/messaging/services) the resource is associated with. @@ -111,6 +109,7 @@ def __repr__(self) -> str: class ChannelSenderContext(InstanceContext): + def __init__(self, version: Version, messaging_service_sid: str, sid: str): """ Initialize the ChannelSenderContext @@ -181,6 +180,7 @@ def __repr__(self) -> str: class ChannelSenderPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ChannelSenderInstance: """ Build an instance of ChannelSenderInstance @@ -203,6 +203,7 @@ def __repr__(self) -> str: class ChannelSenderList(ListResource): + def __init__(self, version: Version, messaging_service_sid: str): """ Initialize the ChannelSenderList diff --git a/twilio/rest/messaging/v1/service/phone_number.py b/twilio/rest/messaging/v1/service/phone_number.py index daafa6d788..8b0b4c0900 100644 --- a/twilio/rest/messaging/v1/service/phone_number.py +++ b/twilio/rest/messaging/v1/service/phone_number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class PhoneNumberInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the PhoneNumber resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the PhoneNumber resource. @@ -129,6 +127,7 @@ def __repr__(self) -> str: class PhoneNumberContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the PhoneNumberContext @@ -223,6 +222,7 @@ def __repr__(self) -> str: class PhoneNumberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PhoneNumberInstance: """ Build an instance of PhoneNumberInstance @@ -243,6 +243,7 @@ def __repr__(self) -> str: class PhoneNumberList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the PhoneNumberList diff --git a/twilio/rest/messaging/v1/service/short_code.py b/twilio/rest/messaging/v1/service/short_code.py index dbc24cea3f..6537875891 100644 --- a/twilio/rest/messaging/v1/service/short_code.py +++ b/twilio/rest/messaging/v1/service/short_code.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ShortCodeInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the ShortCode resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ShortCode resource. @@ -129,6 +127,7 @@ def __repr__(self) -> str: class ShortCodeContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the ShortCodeContext @@ -221,6 +220,7 @@ def __repr__(self) -> str: class ShortCodePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ShortCodeInstance: """ Build an instance of ShortCodeInstance @@ -241,6 +241,7 @@ def __repr__(self) -> str: class ShortCodeList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the ShortCodeList 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 5e89c8384a..cc23f0caf5 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class UsAppToPersonInstance(InstanceResource): - """ :ivar sid: The unique string that identifies a US A2P Compliance resource `QE2c6890da8086d771620e9b13fadeba0b`. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the Campaign belongs to. @@ -35,6 +33,9 @@ class UsAppToPersonInstance(InstanceResource): :ivar us_app_to_person_usecase: A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING, SOLE_PROPRIETOR...]. SOLE_PROPRIETOR campaign use cases can only be created by SOLE_PROPRIETOR Brands, and there can only be one SOLE_PROPRIETOR campaign created per SOLE_PROPRIETOR Brand. :ivar has_embedded_links: Indicate that this SMS campaign will send messages that contain links. :ivar has_embedded_phone: Indicates that this SMS campaign will send messages that contain phone numbers. + :ivar subscriber_opt_in: A boolean that specifies whether campaign has Subscriber Optin or not. + :ivar age_gated: A boolean that specifies whether campaign is age gated or not. + :ivar direct_lending: A boolean that specifies whether campaign allows direct lending or not. :ivar campaign_status: Campaign status. Examples: IN_PROGRESS, VERIFIED, FAILED. :ivar campaign_id: The Campaign Registry (TCR) Campaign ID. :ivar is_externally_registered: Indicates whether the campaign was registered externally or not. @@ -75,6 +76,9 @@ def __init__( ) self.has_embedded_links: Optional[bool] = payload.get("has_embedded_links") self.has_embedded_phone: Optional[bool] = payload.get("has_embedded_phone") + self.subscriber_opt_in: Optional[bool] = payload.get("subscriber_opt_in") + self.age_gated: Optional[bool] = payload.get("age_gated") + self.direct_lending: Optional[bool] = payload.get("direct_lending") self.campaign_status: Optional[str] = payload.get("campaign_status") self.campaign_id: Optional[str] = payload.get("campaign_id") self.is_externally_registered: Optional[bool] = payload.get( @@ -156,6 +160,72 @@ async def fetch_async(self) -> "UsAppToPersonInstance": """ return await self._proxy.fetch_async() + def update( + self, + has_embedded_links: bool, + has_embedded_phone: bool, + message_samples: List[str], + message_flow: str, + description: str, + age_gated: bool, + direct_lending: bool, + ) -> "UsAppToPersonInstance": + """ + Update the UsAppToPersonInstance + + :param has_embedded_links: Indicates that this SMS campaign will send messages that contain links. + :param has_embedded_phone: Indicates that this SMS campaign will send messages that contain phone numbers. + :param message_samples: An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + :param message_flow: Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + :param description: A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + :param age_gated: A boolean that specifies whether campaign requires age gate for federally legal content. + :param direct_lending: A boolean that specifies whether campaign allows direct lending or not. + + :returns: The updated UsAppToPersonInstance + """ + return self._proxy.update( + has_embedded_links=has_embedded_links, + has_embedded_phone=has_embedded_phone, + message_samples=message_samples, + message_flow=message_flow, + description=description, + age_gated=age_gated, + direct_lending=direct_lending, + ) + + async def update_async( + self, + has_embedded_links: bool, + has_embedded_phone: bool, + message_samples: List[str], + message_flow: str, + description: str, + age_gated: bool, + direct_lending: bool, + ) -> "UsAppToPersonInstance": + """ + Asynchronous coroutine to update the UsAppToPersonInstance + + :param has_embedded_links: Indicates that this SMS campaign will send messages that contain links. + :param has_embedded_phone: Indicates that this SMS campaign will send messages that contain phone numbers. + :param message_samples: An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + :param message_flow: Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + :param description: A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + :param age_gated: A boolean that specifies whether campaign requires age gate for federally legal content. + :param direct_lending: A boolean that specifies whether campaign allows direct lending or not. + + :returns: The updated UsAppToPersonInstance + """ + return await self._proxy.update_async( + has_embedded_links=has_embedded_links, + has_embedded_phone=has_embedded_phone, + message_samples=message_samples, + message_flow=message_flow, + description=description, + age_gated=age_gated, + direct_lending=direct_lending, + ) + def __repr__(self) -> str: """ Provide a friendly representation @@ -167,13 +237,14 @@ def __repr__(self) -> str: class UsAppToPersonContext(InstanceContext): + def __init__(self, version: Version, messaging_service_sid: str, sid: str): """ Initialize the UsAppToPersonContext :param version: Version that contains the resource - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to fetch the resource from. - :param sid: The SID of the US A2P Compliance resource to fetch `QE2c6890da8086d771620e9b13fadeba0b`. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api) to update the resource from. + :param sid: The SID of the US A2P Compliance resource to update `QE2c6890da8086d771620e9b13fadeba0b`. """ super().__init__(version) @@ -250,6 +321,102 @@ async def fetch_async(self) -> UsAppToPersonInstance: sid=self._solution["sid"], ) + def update( + self, + has_embedded_links: bool, + has_embedded_phone: bool, + message_samples: List[str], + message_flow: str, + description: str, + age_gated: bool, + direct_lending: bool, + ) -> UsAppToPersonInstance: + """ + Update the UsAppToPersonInstance + + :param has_embedded_links: Indicates that this SMS campaign will send messages that contain links. + :param has_embedded_phone: Indicates that this SMS campaign will send messages that contain phone numbers. + :param message_samples: An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + :param message_flow: Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + :param description: A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + :param age_gated: A boolean that specifies whether campaign requires age gate for federally legal content. + :param direct_lending: A boolean that specifies whether campaign allows direct lending or not. + + :returns: The updated UsAppToPersonInstance + """ + data = values.of( + { + "HasEmbeddedLinks": has_embedded_links, + "HasEmbeddedPhone": has_embedded_phone, + "MessageSamples": serialize.map(message_samples, lambda e: e), + "MessageFlow": message_flow, + "Description": description, + "AgeGated": age_gated, + "DirectLending": direct_lending, + } + ) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return UsAppToPersonInstance( + self._version, + payload, + messaging_service_sid=self._solution["messaging_service_sid"], + sid=self._solution["sid"], + ) + + async def update_async( + self, + has_embedded_links: bool, + has_embedded_phone: bool, + message_samples: List[str], + message_flow: str, + description: str, + age_gated: bool, + direct_lending: bool, + ) -> UsAppToPersonInstance: + """ + Asynchronous coroutine to update the UsAppToPersonInstance + + :param has_embedded_links: Indicates that this SMS campaign will send messages that contain links. + :param has_embedded_phone: Indicates that this SMS campaign will send messages that contain phone numbers. + :param message_samples: An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + :param message_flow: Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + :param description: A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + :param age_gated: A boolean that specifies whether campaign requires age gate for federally legal content. + :param direct_lending: A boolean that specifies whether campaign allows direct lending or not. + + :returns: The updated UsAppToPersonInstance + """ + data = values.of( + { + "HasEmbeddedLinks": has_embedded_links, + "HasEmbeddedPhone": has_embedded_phone, + "MessageSamples": serialize.map(message_samples, lambda e: e), + "MessageFlow": message_flow, + "Description": description, + "AgeGated": age_gated, + "DirectLending": direct_lending, + } + ) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return UsAppToPersonInstance( + self._version, + payload, + messaging_service_sid=self._solution["messaging_service_sid"], + sid=self._solution["sid"], + ) + def __repr__(self) -> str: """ Provide a friendly representation @@ -261,6 +428,7 @@ def __repr__(self) -> str: class UsAppToPersonPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UsAppToPersonInstance: """ Build an instance of UsAppToPersonInstance @@ -283,6 +451,7 @@ def __repr__(self) -> str: class UsAppToPersonList(ListResource): + def __init__(self, version: Version, messaging_service_sid: str): """ Initialize the UsAppToPersonList @@ -316,6 +485,9 @@ def create( opt_in_keywords: Union[List[str], object] = values.unset, opt_out_keywords: Union[List[str], object] = values.unset, help_keywords: Union[List[str], object] = values.unset, + subscriber_opt_in: Union[bool, object] = values.unset, + age_gated: Union[bool, object] = values.unset, + direct_lending: Union[bool, object] = values.unset, ) -> UsAppToPersonInstance: """ Create the UsAppToPersonInstance @@ -333,6 +505,9 @@ def create( :param opt_in_keywords: If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. :param opt_out_keywords: End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. :param help_keywords: End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + :param subscriber_opt_in: A boolean that specifies whether campaign has Subscriber Optin or not. + :param age_gated: A boolean that specifies whether campaign is age gated or not. + :param direct_lending: A boolean that specifies whether campaign allows direct lending or not. :returns: The created UsAppToPersonInstance """ @@ -352,6 +527,9 @@ def create( "OptInKeywords": serialize.map(opt_in_keywords, lambda e: e), "OptOutKeywords": serialize.map(opt_out_keywords, lambda e: e), "HelpKeywords": serialize.map(help_keywords, lambda e: e), + "SubscriberOptIn": subscriber_opt_in, + "AgeGated": age_gated, + "DirectLending": direct_lending, } ) @@ -382,6 +560,9 @@ async def create_async( opt_in_keywords: Union[List[str], object] = values.unset, opt_out_keywords: Union[List[str], object] = values.unset, help_keywords: Union[List[str], object] = values.unset, + subscriber_opt_in: Union[bool, object] = values.unset, + age_gated: Union[bool, object] = values.unset, + direct_lending: Union[bool, object] = values.unset, ) -> UsAppToPersonInstance: """ Asynchronously create the UsAppToPersonInstance @@ -399,6 +580,9 @@ async def create_async( :param opt_in_keywords: If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. :param opt_out_keywords: End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. :param help_keywords: End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + :param subscriber_opt_in: A boolean that specifies whether campaign has Subscriber Optin or not. + :param age_gated: A boolean that specifies whether campaign is age gated or not. + :param direct_lending: A boolean that specifies whether campaign allows direct lending or not. :returns: The created UsAppToPersonInstance """ @@ -418,6 +602,9 @@ async def create_async( "OptInKeywords": serialize.map(opt_in_keywords, lambda e: e), "OptOutKeywords": serialize.map(opt_out_keywords, lambda e: e), "HelpKeywords": serialize.map(help_keywords, lambda e: e), + "SubscriberOptIn": subscriber_opt_in, + "AgeGated": age_gated, + "DirectLending": direct_lending, } ) @@ -620,7 +807,7 @@ def get(self, sid: str) -> UsAppToPersonContext: """ Constructs a UsAppToPersonContext - :param sid: The SID of the US A2P Compliance resource to fetch `QE2c6890da8086d771620e9b13fadeba0b`. + :param sid: The SID of the US A2P Compliance resource to update `QE2c6890da8086d771620e9b13fadeba0b`. """ return UsAppToPersonContext( self._version, @@ -632,7 +819,7 @@ def __call__(self, sid: str) -> UsAppToPersonContext: """ Constructs a UsAppToPersonContext - :param sid: The SID of the US A2P Compliance resource to fetch `QE2c6890da8086d771620e9b13fadeba0b`. + :param sid: The SID of the US A2P Compliance resource to update `QE2c6890da8086d771620e9b13fadeba0b`. """ return UsAppToPersonContext( self._version, 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 60b8757038..c4f513ab1b 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import values @@ -22,7 +21,6 @@ class UsAppToPersonUsecaseInstance(InstanceResource): - """ :ivar us_app_to_person_usecases: Human readable name, code, description and post_approval_required (indicates whether or not post approval is required for this Use Case) of A2P Campaign Use Cases. """ @@ -51,6 +49,7 @@ def __repr__(self) -> str: class UsAppToPersonUsecaseList(ListResource): + def __init__(self, version: Version, messaging_service_sid: str): """ Initialize the UsAppToPersonUsecaseList diff --git a/twilio/rest/messaging/v1/tollfree_verification.py b/twilio/rest/messaging/v1/tollfree_verification.py index 83c0df1a49..af57cfc5fc 100644 --- a/twilio/rest/messaging/v1/tollfree_verification.py +++ b/twilio/rest/messaging/v1/tollfree_verification.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class TollfreeVerificationInstance(InstanceResource): + class OptInType(object): VERBAL = "VERBAL" WEB_FORM = "WEB_FORM" @@ -127,9 +127,9 @@ def __init__( "production_message_sample" ) self.opt_in_image_urls: Optional[List[str]] = payload.get("opt_in_image_urls") - self.opt_in_type: Optional[ - "TollfreeVerificationInstance.OptInType" - ] = payload.get("opt_in_type") + self.opt_in_type: Optional["TollfreeVerificationInstance.OptInType"] = ( + payload.get("opt_in_type") + ) self.message_volume: Optional[str] = payload.get("message_volume") self.additional_information: Optional[str] = payload.get( "additional_information" @@ -371,6 +371,7 @@ def __repr__(self) -> str: class TollfreeVerificationContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the TollfreeVerificationContext @@ -637,6 +638,7 @@ def __repr__(self) -> str: class TollfreeVerificationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TollfreeVerificationInstance: """ Build an instance of TollfreeVerificationInstance @@ -655,6 +657,7 @@ def __repr__(self) -> str: class TollfreeVerificationList(ListResource): + def __init__(self, version: Version): """ Initialize the TollfreeVerificationList diff --git a/twilio/rest/messaging/v1/usecase.py b/twilio/rest/messaging/v1/usecase.py index 3fb46b4a2b..d7223f3632 100644 --- a/twilio/rest/messaging/v1/usecase.py +++ b/twilio/rest/messaging/v1/usecase.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class UsecaseInstance(InstanceResource): - """ :ivar usecases: Human readable use case details (usecase, description and purpose) of Messaging Service Use Cases. """ @@ -42,6 +40,7 @@ def __repr__(self) -> str: class UsecaseList(ListResource): + def __init__(self, version: Version): """ Initialize the UsecaseList diff --git a/twilio/rest/microvisor/MicrovisorBase.py b/twilio/rest/microvisor/MicrovisorBase.py index 57a4c50f55..e8c874b920 100644 --- a/twilio/rest/microvisor/MicrovisorBase.py +++ b/twilio/rest/microvisor/MicrovisorBase.py @@ -17,6 +17,7 @@ class MicrovisorBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Microvisor Domain diff --git a/twilio/rest/microvisor/v1/__init__.py b/twilio/rest/microvisor/v1/__init__.py index d47ed845bd..22010d62e5 100644 --- a/twilio/rest/microvisor/v1/__init__.py +++ b/twilio/rest/microvisor/v1/__init__.py @@ -22,6 +22,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Microvisor diff --git a/twilio/rest/microvisor/v1/account_config.py b/twilio/rest/microvisor/v1/account_config.py index 459a95f25f..3d37b01cd2 100644 --- a/twilio/rest/microvisor/v1/account_config.py +++ b/twilio/rest/microvisor/v1/account_config.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class AccountConfigInstance(InstanceResource): - """ :ivar key: The config key; up to 100 characters. :ivar date_updated: @@ -135,6 +133,7 @@ def __repr__(self) -> str: class AccountConfigContext(InstanceContext): + def __init__(self, version: Version, key: str): """ Initialize the AccountConfigContext @@ -267,6 +266,7 @@ def __repr__(self) -> str: class AccountConfigPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AccountConfigInstance: """ Build an instance of AccountConfigInstance @@ -285,6 +285,7 @@ def __repr__(self) -> str: class AccountConfigList(ListResource): + def __init__(self, version: Version): """ Initialize the AccountConfigList diff --git a/twilio/rest/microvisor/v1/account_secret.py b/twilio/rest/microvisor/v1/account_secret.py index eacd4fa526..cca0e1d773 100644 --- a/twilio/rest/microvisor/v1/account_secret.py +++ b/twilio/rest/microvisor/v1/account_secret.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class AccountSecretInstance(InstanceResource): - """ :ivar key: The secret key; up to 100 characters. :ivar date_rotated: @@ -133,6 +131,7 @@ def __repr__(self) -> str: class AccountSecretContext(InstanceContext): + def __init__(self, version: Version, key: str): """ Initialize the AccountSecretContext @@ -265,6 +264,7 @@ def __repr__(self) -> str: class AccountSecretPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AccountSecretInstance: """ Build an instance of AccountSecretInstance @@ -283,6 +283,7 @@ def __repr__(self) -> str: class AccountSecretList(ListResource): + def __init__(self, version: Version): """ Initialize the AccountSecretList diff --git a/twilio/rest/microvisor/v1/app/__init__.py b/twilio/rest/microvisor/v1/app/__init__.py index e9f547af76..0c91fe3c50 100644 --- a/twilio/rest/microvisor/v1/app/__init__.py +++ b/twilio/rest/microvisor/v1/app/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class AppInstance(InstanceResource): - """ :ivar sid: A 34-character string that uniquely identifies this App. :ivar account_sid: The unique SID identifier of the Account. @@ -129,6 +127,7 @@ def __repr__(self) -> str: class AppContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AppContext @@ -231,6 +230,7 @@ def __repr__(self) -> str: class AppPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AppInstance: """ Build an instance of AppInstance @@ -249,6 +249,7 @@ def __repr__(self) -> str: class AppList(ListResource): + def __init__(self, version: Version): """ Initialize the AppList diff --git a/twilio/rest/microvisor/v1/app/app_manifest.py b/twilio/rest/microvisor/v1/app/app_manifest.py index dba0240e91..4f9eab075e 100644 --- a/twilio/rest/microvisor/v1/app/app_manifest.py +++ b/twilio/rest/microvisor/v1/app/app_manifest.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class AppManifestInstance(InstanceResource): - """ :ivar app_sid: A 34-character string that uniquely identifies this App. :ivar hash: App manifest hash represented as `hash_algorithm:hash_value`. @@ -86,6 +84,7 @@ def __repr__(self) -> str: class AppManifestContext(InstanceContext): + def __init__(self, version: Version, app_sid: str): """ Initialize the AppManifestContext @@ -150,6 +149,7 @@ def __repr__(self) -> str: class AppManifestList(ListResource): + def __init__(self, version: Version, app_sid: str): """ Initialize the AppManifestList diff --git a/twilio/rest/microvisor/v1/device/__init__.py b/twilio/rest/microvisor/v1/device/__init__.py index e3023ae499..56904ee1f7 100644 --- a/twilio/rest/microvisor/v1/device/__init__.py +++ b/twilio/rest/microvisor/v1/device/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -26,7 +25,6 @@ class DeviceInstance(InstanceResource): - """ :ivar sid: A 34-character string that uniquely identifies this Device. :ivar unique_name: A developer-defined string that uniquely identifies the Device. This value must be unique for all Devices on this Account. The `unique_name` value may be used as an alternative to the `sid` in the URL path to address the resource. @@ -169,6 +167,7 @@ def __repr__(self) -> str: class DeviceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the DeviceContext @@ -328,6 +327,7 @@ def __repr__(self) -> str: class DevicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeviceInstance: """ Build an instance of DeviceInstance @@ -346,6 +346,7 @@ def __repr__(self) -> str: class DeviceList(ListResource): + def __init__(self, version: Version): """ Initialize the DeviceList diff --git a/twilio/rest/microvisor/v1/device/device_config.py b/twilio/rest/microvisor/v1/device/device_config.py index 54424e800b..3607e971f2 100644 --- a/twilio/rest/microvisor/v1/device/device_config.py +++ b/twilio/rest/microvisor/v1/device/device_config.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class DeviceConfigInstance(InstanceResource): - """ :ivar device_sid: A 34-character string that uniquely identifies the parent Device. :ivar key: The config key; up to 100 characters. @@ -143,6 +141,7 @@ def __repr__(self) -> str: class DeviceConfigContext(InstanceContext): + def __init__(self, version: Version, device_sid: str, key: str): """ Initialize the DeviceConfigContext @@ -289,6 +288,7 @@ def __repr__(self) -> str: class DeviceConfigPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeviceConfigInstance: """ Build an instance of DeviceConfigInstance @@ -309,6 +309,7 @@ def __repr__(self) -> str: class DeviceConfigList(ListResource): + def __init__(self, version: Version, device_sid: str): """ Initialize the DeviceConfigList diff --git a/twilio/rest/microvisor/v1/device/device_secret.py b/twilio/rest/microvisor/v1/device/device_secret.py index 124fe0e483..0ab9b1c721 100644 --- a/twilio/rest/microvisor/v1/device/device_secret.py +++ b/twilio/rest/microvisor/v1/device/device_secret.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class DeviceSecretInstance(InstanceResource): - """ :ivar device_sid: A 34-character string that uniquely identifies the parent Device. :ivar key: The secret key; up to 100 characters. @@ -141,6 +139,7 @@ def __repr__(self) -> str: class DeviceSecretContext(InstanceContext): + def __init__(self, version: Version, device_sid: str, key: str): """ Initialize the DeviceSecretContext @@ -287,6 +286,7 @@ def __repr__(self) -> str: class DeviceSecretPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeviceSecretInstance: """ Build an instance of DeviceSecretInstance @@ -307,6 +307,7 @@ def __repr__(self) -> str: class DeviceSecretList(ListResource): + def __init__(self, version: Version, device_sid: str): """ Initialize the DeviceSecretList diff --git a/twilio/rest/monitor/MonitorBase.py b/twilio/rest/monitor/MonitorBase.py index d63580761f..4c5c6ebcd6 100644 --- a/twilio/rest/monitor/MonitorBase.py +++ b/twilio/rest/monitor/MonitorBase.py @@ -17,6 +17,7 @@ class MonitorBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Monitor Domain diff --git a/twilio/rest/monitor/v1/__init__.py b/twilio/rest/monitor/v1/__init__.py index fcf06738fa..e892612b3b 100644 --- a/twilio/rest/monitor/v1/__init__.py +++ b/twilio/rest/monitor/v1/__init__.py @@ -20,6 +20,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Monitor diff --git a/twilio/rest/monitor/v1/alert.py b/twilio/rest/monitor/v1/alert.py index b3c44374e5..ef8cf39dda 100644 --- a/twilio/rest/monitor/v1/alert.py +++ b/twilio/rest/monitor/v1/alert.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class AlertInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Alert resource. :ivar alert_text: The text of the alert. @@ -127,6 +125,7 @@ def __repr__(self) -> str: class AlertContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AlertContext @@ -191,6 +190,7 @@ def __repr__(self) -> str: class AlertPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AlertInstance: """ Build an instance of AlertInstance @@ -209,6 +209,7 @@ def __repr__(self) -> str: class AlertList(ListResource): + def __init__(self, version: Version): """ Initialize the AlertList diff --git a/twilio/rest/monitor/v1/event.py b/twilio/rest/monitor/v1/event.py index 63829c43e0..6b67a9c029 100644 --- a/twilio/rest/monitor/v1/event.py +++ b/twilio/rest/monitor/v1/event.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class EventInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Event resource. :ivar actor_sid: The SID of the actor that caused the event, if available. Can be `null`. @@ -113,6 +111,7 @@ def __repr__(self) -> str: class EventContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the EventContext @@ -177,6 +176,7 @@ def __repr__(self) -> str: class EventPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EventInstance: """ Build an instance of EventInstance @@ -195,6 +195,7 @@ def __repr__(self) -> str: class EventList(ListResource): + def __init__(self, version: Version): """ Initialize the EventList diff --git a/twilio/rest/notify/NotifyBase.py b/twilio/rest/notify/NotifyBase.py index d8a79bed63..2772ed0959 100644 --- a/twilio/rest/notify/NotifyBase.py +++ b/twilio/rest/notify/NotifyBase.py @@ -17,6 +17,7 @@ class NotifyBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Notify Domain diff --git a/twilio/rest/notify/v1/__init__.py b/twilio/rest/notify/v1/__init__.py index 91942a4f73..90cab95028 100644 --- a/twilio/rest/notify/v1/__init__.py +++ b/twilio/rest/notify/v1/__init__.py @@ -20,6 +20,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Notify diff --git a/twilio/rest/notify/v1/credential.py b/twilio/rest/notify/v1/credential.py index 61f1abd801..3dd6380cee 100644 --- a/twilio/rest/notify/v1/credential.py +++ b/twilio/rest/notify/v1/credential.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class CredentialInstance(InstanceResource): + class PushService(object): GCM = "gcm" APN = "apn" @@ -185,6 +185,7 @@ def __repr__(self) -> str: class CredentialContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CredentialContext @@ -353,6 +354,7 @@ def __repr__(self) -> str: class CredentialPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialInstance: """ Build an instance of CredentialInstance @@ -371,6 +373,7 @@ def __repr__(self) -> str: class CredentialList(ListResource): + def __init__(self, version: Version): """ Initialize the CredentialList diff --git a/twilio/rest/notify/v1/service/__init__.py b/twilio/rest/notify/v1/service/__init__.py index 5c5d14d066..912d6ba9cd 100644 --- a/twilio/rest/notify/v1/service/__init__.py +++ b/twilio/rest/notify/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -26,7 +25,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Service resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. @@ -36,7 +34,7 @@ class ServiceInstance(InstanceResource): :ivar apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :ivar gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. :ivar fcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. - :ivar messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. In order to send SMS notifications this parameter has to be set. + :ivar messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. In order to send SMS notifications this parameter has to be set. :ivar facebook_messenger_page_id: Deprecated. :ivar default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :ivar default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -171,7 +169,7 @@ def update( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -225,7 +223,7 @@ async def update_async( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -281,6 +279,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -384,7 +383,7 @@ def update( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -448,7 +447,7 @@ async def update_async( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -524,6 +523,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -542,6 +542,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -576,7 +577,7 @@ def create( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -641,7 +642,7 @@ async def create_async( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. diff --git a/twilio/rest/notify/v1/service/binding.py b/twilio/rest/notify/v1/service/binding.py index 1bcb36d247..a6b1e3f087 100644 --- a/twilio/rest/notify/v1/service/binding.py +++ b/twilio/rest/notify/v1/service/binding.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date, datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class BindingInstance(InstanceResource): + class BindingType(object): APN = "apn" GCM = "gcm" @@ -148,6 +148,7 @@ def __repr__(self) -> str: class BindingContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the BindingContext @@ -240,6 +241,7 @@ def __repr__(self) -> str: class BindingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BindingInstance: """ Build an instance of BindingInstance @@ -260,6 +262,7 @@ def __repr__(self) -> str: class BindingList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the BindingList diff --git a/twilio/rest/notify/v1/service/notification.py b/twilio/rest/notify/v1/service/notification.py index 237e553117..e2482be109 100644 --- a/twilio/rest/notify/v1/service/notification.py +++ b/twilio/rest/notify/v1/service/notification.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,6 +22,7 @@ class NotificationInstance(InstanceResource): + class Priority(object): HIGH = "high" LOW = "low" @@ -95,6 +95,7 @@ def __repr__(self) -> str: class NotificationList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the NotificationList @@ -144,7 +145,7 @@ def create( :param data: The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. :param apn: The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. :param gcm: The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). - :param sms: The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/send-messages) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. + :param sms: The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/quickstart) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. :param facebook_messenger: Deprecated. :param fcm: The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. :param segment: The Segment resource is deprecated. Use the `tag` parameter, instead. @@ -223,7 +224,7 @@ async def create_async( :param data: The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. :param apn: The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. :param gcm: The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). - :param sms: The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/send-messages) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. + :param sms: The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/quickstart) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. :param facebook_messenger: Deprecated. :param fcm: The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. :param segment: The Segment resource is deprecated. Use the `tag` parameter, instead. diff --git a/twilio/rest/numbers/NumbersBase.py b/twilio/rest/numbers/NumbersBase.py index b5c1e04328..7b9e08638f 100644 --- a/twilio/rest/numbers/NumbersBase.py +++ b/twilio/rest/numbers/NumbersBase.py @@ -18,6 +18,7 @@ class NumbersBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Numbers Domain diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 1619c070f0..95223e1615 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -19,10 +19,12 @@ from twilio.rest.numbers.v1.eligibility import EligibilityList from twilio.rest.numbers.v1.porting_bulk_portability import PortingBulkPortabilityList from twilio.rest.numbers.v1.porting_port_in import PortingPortInList +from twilio.rest.numbers.v1.porting_port_in_fetch import PortingPortInFetchList from twilio.rest.numbers.v1.porting_portability import PortingPortabilityList class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Numbers @@ -34,6 +36,7 @@ def __init__(self, domain: Domain): self._eligibilities: Optional[EligibilityList] = None self._porting_bulk_portabilities: Optional[PortingBulkPortabilityList] = None self._porting_port_ins: Optional[PortingPortInList] = None + self._porting_port_ins: Optional[PortingPortInFetchList] = None self._porting_portabilities: Optional[PortingPortabilityList] = None @property @@ -60,6 +63,12 @@ def porting_port_ins(self) -> PortingPortInList: self._porting_port_ins = PortingPortInList(self) return self._porting_port_ins + @property + def porting_port_ins(self) -> PortingPortInFetchList: + if self._porting_port_ins is None: + self._porting_port_ins = PortingPortInFetchList(self) + return self._porting_port_ins + @property def porting_portabilities(self) -> PortingPortabilityList: if self._porting_portabilities is None: diff --git a/twilio/rest/numbers/v1/bulk_eligibility.py b/twilio/rest/numbers/v1/bulk_eligibility.py index e68cee2a43..c13f42c796 100644 --- a/twilio/rest/numbers/v1/bulk_eligibility.py +++ b/twilio/rest/numbers/v1/bulk_eligibility.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional from twilio.base import deserialize @@ -23,7 +22,6 @@ class BulkEligibilityInstance(InstanceResource): - """ :ivar request_id: The SID of the bulk eligibility check that you want to know about. :ivar url: This is the url of the request that you're trying to reach out to locate the resource. @@ -103,6 +101,7 @@ def __repr__(self) -> str: class BulkEligibilityContext(InstanceContext): + def __init__(self, version: Version, request_id: str): """ Initialize the BulkEligibilityContext @@ -169,6 +168,7 @@ def __repr__(self) -> str: class BulkEligibilityList(ListResource): + def __init__(self, version: Version): """ Initialize the BulkEligibilityList diff --git a/twilio/rest/numbers/v1/eligibility.py b/twilio/rest/numbers/v1/eligibility.py index 6781c3d869..99461374ee 100644 --- a/twilio/rest/numbers/v1/eligibility.py +++ b/twilio/rest/numbers/v1/eligibility.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class EligibilityInstance(InstanceResource): - """ :ivar results: The result set that contains the eligibility check response for the requested number, each result has at least the following attributes: phone_number: The requested phone number ,hosting_account_sid: The account sid where the phone number will be hosted, date_last_checked: Datetime (ISO 8601) when the PN was last checked for eligibility, country: Phone number’s country, eligibility_status: Indicates the eligibility status of the PN (Eligible/Ineligible), eligibility_sub_status: Indicates the sub status of the eligibility , ineligibility_reason: Reason for number's ineligibility (if applicable), next_step: Suggested next step in the hosting process based on the eligibility status. """ @@ -42,6 +40,7 @@ def __repr__(self) -> str: class EligibilityList(ListResource): + def __init__(self, version: Version): """ Initialize the EligibilityList diff --git a/twilio/rest/numbers/v1/porting_bulk_portability.py b/twilio/rest/numbers/v1/porting_bulk_portability.py index a6c037edb0..c3fedcd5bb 100644 --- a/twilio/rest/numbers/v1/porting_bulk_portability.py +++ b/twilio/rest/numbers/v1/porting_bulk_portability.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional from twilio.base import deserialize, serialize, values @@ -23,6 +22,7 @@ class PortingBulkPortabilityInstance(InstanceResource): + class Status(object): IN_PROGRESS = "in-progress" COMPLETED = "completed" @@ -102,6 +102,7 @@ def __repr__(self) -> str: class PortingBulkPortabilityContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the PortingBulkPortabilityContext @@ -166,6 +167,7 @@ def __repr__(self) -> str: class PortingBulkPortabilityList(ListResource): + def __init__(self, version: Version): """ Initialize the PortingBulkPortabilityList diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py index 1bc33ac16f..ad3140a0b8 100644 --- a/twilio/rest/numbers/v1/porting_port_in.py +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_resource import InstanceResource @@ -21,9 +20,8 @@ class PortingPortInInstance(InstanceResource): - """ - :ivar port_in_request_sid: The SID of the Port In request, It is the request identifier + :ivar port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. :ivar url: """ @@ -44,6 +42,7 @@ def __repr__(self) -> str: class PortingPortInList(ListResource): + def __init__(self, version: Version): """ Initialize the PortingPortInList diff --git a/twilio/rest/numbers/v1/porting_port_in_fetch.py b/twilio/rest/numbers/v1/porting_port_in_fetch.py new file mode 100644 index 0000000000..78e31afbd8 --- /dev/null +++ b/twilio/rest/numbers/v1/porting_port_in_fetch.py @@ -0,0 +1,219 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Numbers + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import date +from typing import Any, Dict, List, Optional +from twilio.base import deserialize +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class PortingPortInFetchInstance(InstanceResource): + """ + :ivar port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + :ivar url: The URL of this Port In request + :ivar account_sid: The Account SID that the numbers will be added to after they are ported into Twilio. + :ivar notification_emails: List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails. + :ivar target_port_in_date: Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation. + :ivar target_port_in_time_range_start: Minimum hour in the future needs to be established with the Ops team for validation. + :ivar target_port_in_time_range_end: Maximum hour in the future needs to be established with the Ops team for validation. + :ivar losing_carrier_information: The information for the losing carrier. + :ivar phone_numbers: The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212). + :ivar documents: The list of documents SID referencing a utility bills + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + port_in_request_sid: Optional[str] = None, + ): + super().__init__(version) + + self.port_in_request_sid: Optional[str] = payload.get("port_in_request_sid") + self.url: Optional[str] = payload.get("url") + self.account_sid: Optional[str] = payload.get("account_sid") + self.notification_emails: Optional[List[str]] = payload.get( + "notification_emails" + ) + self.target_port_in_date: Optional[date] = deserialize.iso8601_date( + payload.get("target_port_in_date") + ) + self.target_port_in_time_range_start: Optional[str] = payload.get( + "target_port_in_time_range_start" + ) + self.target_port_in_time_range_end: Optional[str] = payload.get( + "target_port_in_time_range_end" + ) + self.losing_carrier_information: Optional[Dict[str, object]] = payload.get( + "losing_carrier_information" + ) + self.phone_numbers: Optional[List[Dict[str, object]]] = payload.get( + "phone_numbers" + ) + self.documents: Optional[List[str]] = payload.get("documents") + + self._solution = { + "port_in_request_sid": port_in_request_sid or self.port_in_request_sid, + } + self._context: Optional[PortingPortInFetchContext] = None + + @property + def _proxy(self) -> "PortingPortInFetchContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: PortingPortInFetchContext for this PortingPortInFetchInstance + """ + if self._context is None: + self._context = PortingPortInFetchContext( + self._version, + port_in_request_sid=self._solution["port_in_request_sid"], + ) + return self._context + + def fetch(self) -> "PortingPortInFetchInstance": + """ + Fetch the PortingPortInFetchInstance + + + :returns: The fetched PortingPortInFetchInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "PortingPortInFetchInstance": + """ + Asynchronous coroutine to fetch the PortingPortInFetchInstance + + + :returns: The fetched PortingPortInFetchInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PortingPortInFetchContext(InstanceContext): + + def __init__(self, version: Version, port_in_request_sid: str): + """ + Initialize the PortingPortInFetchContext + + :param version: Version that contains the resource + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "port_in_request_sid": port_in_request_sid, + } + self._uri = "/Porting/PortIn/{port_in_request_sid}".format(**self._solution) + + def fetch(self) -> PortingPortInFetchInstance: + """ + Fetch the PortingPortInFetchInstance + + + :returns: The fetched PortingPortInFetchInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return PortingPortInFetchInstance( + self._version, + payload, + port_in_request_sid=self._solution["port_in_request_sid"], + ) + + async def fetch_async(self) -> PortingPortInFetchInstance: + """ + Asynchronous coroutine to fetch the PortingPortInFetchInstance + + + :returns: The fetched PortingPortInFetchInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return PortingPortInFetchInstance( + self._version, + payload, + port_in_request_sid=self._solution["port_in_request_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PortingPortInFetchList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PortingPortInFetchList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, port_in_request_sid: str) -> PortingPortInFetchContext: + """ + Constructs a PortingPortInFetchContext + + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + """ + return PortingPortInFetchContext( + self._version, port_in_request_sid=port_in_request_sid + ) + + def __call__(self, port_in_request_sid: str) -> PortingPortInFetchContext: + """ + Constructs a PortingPortInFetchContext + + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + """ + return PortingPortInFetchContext( + self._version, port_in_request_sid=port_in_request_sid + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/numbers/v1/porting_portability.py b/twilio/rest/numbers/v1/porting_portability.py index cb08535d1e..f1cf0cb8c9 100644 --- a/twilio/rest/numbers/v1/porting_portability.py +++ b/twilio/rest/numbers/v1/porting_portability.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -22,6 +21,7 @@ class PortingPortabilityInstance(InstanceResource): + class NumberType(object): LOCAL = "LOCAL" UNKNOWN = "UNKNOWN" @@ -60,9 +60,9 @@ def __init__( self.not_portable_reason_code: Optional[int] = deserialize.integer( payload.get("not_portable_reason_code") ) - self.number_type: Optional[ - "PortingPortabilityInstance.NumberType" - ] = payload.get("number_type") + self.number_type: Optional["PortingPortabilityInstance.NumberType"] = ( + 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") @@ -127,6 +127,7 @@ def __repr__(self) -> str: class PortingPortabilityContext(InstanceContext): + def __init__(self, version: Version, phone_number: str): """ Initialize the PortingPortabilityContext @@ -207,6 +208,7 @@ def __repr__(self) -> str: class PortingPortabilityList(ListResource): + def __init__(self, version: Version): """ Initialize the PortingPortabilityList diff --git a/twilio/rest/numbers/v2/__init__.py b/twilio/rest/numbers/v2/__init__.py index 149e7a8697..9b5b50154e 100644 --- a/twilio/rest/numbers/v2/__init__.py +++ b/twilio/rest/numbers/v2/__init__.py @@ -22,6 +22,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Numbers diff --git a/twilio/rest/numbers/v2/authorization_document/__init__.py b/twilio/rest/numbers/v2/authorization_document/__init__.py index c40d44421d..7e0a4d9184 100644 --- a/twilio/rest/numbers/v2/authorization_document/__init__.py +++ b/twilio/rest/numbers/v2/authorization_document/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,6 +26,7 @@ class AuthorizationDocumentInstance(InstanceResource): + class Status(object): OPENED = "opened" SIGNING = "signing" @@ -141,6 +141,7 @@ def __repr__(self) -> str: class AuthorizationDocumentContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AuthorizationDocumentContext @@ -247,6 +248,7 @@ def __repr__(self) -> str: class AuthorizationDocumentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AuthorizationDocumentInstance: """ Build an instance of AuthorizationDocumentInstance @@ -265,6 +267,7 @@ def __repr__(self) -> str: class AuthorizationDocumentList(ListResource): + def __init__(self, version: Version): """ Initialize the AuthorizationDocumentList diff --git a/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py b/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py index 51587325c7..7fc558fee2 100644 --- a/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py +++ b/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class DependentHostedNumberOrderInstance(InstanceResource): + class Status(object): RECEIVED = "received" VERIFIED = "verified" @@ -73,9 +73,9 @@ def __init__( self.phone_number: Optional[str] = payload.get("phone_number") self.capabilities: Optional[str] = payload.get("capabilities") self.friendly_name: Optional[str] = payload.get("friendly_name") - self.status: Optional[ - "DependentHostedNumberOrderInstance.Status" - ] = payload.get("status") + self.status: Optional["DependentHostedNumberOrderInstance.Status"] = ( + payload.get("status") + ) self.failure_reason: Optional[str] = payload.get("failure_reason") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") @@ -105,6 +105,7 @@ def __repr__(self) -> str: class DependentHostedNumberOrderPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> DependentHostedNumberOrderInstance: @@ -129,6 +130,7 @@ def __repr__(self) -> str: class DependentHostedNumberOrderList(ListResource): + def __init__(self, version: Version, signing_document_sid: str): """ Initialize the DependentHostedNumberOrderList diff --git a/twilio/rest/numbers/v2/bulk_hosted_number_order.py b/twilio/rest/numbers/v2/bulk_hosted_number_order.py index e45b86854f..f7f6026c50 100644 --- a/twilio/rest/numbers/v2/bulk_hosted_number_order.py +++ b/twilio/rest/numbers/v2/bulk_hosted_number_order.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values @@ -23,6 +22,7 @@ class BulkHostedNumberOrderInstance(InstanceResource): + class RequestStatus(object): QUEUED = "QUEUED" IN_PROGRESS = "IN_PROGRESS" @@ -49,9 +49,9 @@ def __init__( super().__init__(version) self.bulk_hosting_sid: Optional[str] = payload.get("bulk_hosting_sid") - self.request_status: Optional[ - "BulkHostedNumberOrderInstance.RequestStatus" - ] = payload.get("request_status") + self.request_status: Optional["BulkHostedNumberOrderInstance.RequestStatus"] = ( + payload.get("request_status") + ) self.friendly_name: Optional[str] = payload.get("friendly_name") self.notification_email: Optional[str] = payload.get("notification_email") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( @@ -125,6 +125,7 @@ def __repr__(self) -> str: class BulkHostedNumberOrderContext(InstanceContext): + def __init__(self, version: Version, bulk_hosting_sid: str): """ Initialize the BulkHostedNumberOrderContext @@ -205,6 +206,7 @@ def __repr__(self) -> str: class BulkHostedNumberOrderList(ListResource): + def __init__(self, version: Version): """ Initialize the BulkHostedNumberOrderList diff --git a/twilio/rest/numbers/v2/hosted_number_order.py b/twilio/rest/numbers/v2/hosted_number_order.py index 81cd7e451b..c20fc517c8 100644 --- a/twilio/rest/numbers/v2/hosted_number_order.py +++ b/twilio/rest/numbers/v2/hosted_number_order.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class HostedNumberOrderInstance(InstanceResource): + class Status(object): RECEIVED = "received" VERIFIED = "verified" @@ -157,6 +157,7 @@ def __repr__(self) -> str: class HostedNumberOrderContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the HostedNumberOrderContext @@ -245,6 +246,7 @@ def __repr__(self) -> str: class HostedNumberOrderPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> HostedNumberOrderInstance: """ Build an instance of HostedNumberOrderInstance @@ -263,6 +265,7 @@ def __repr__(self) -> str: class HostedNumberOrderList(ListResource): + def __init__(self, version: Version): """ Initialize the HostedNumberOrderList diff --git a/twilio/rest/numbers/v2/regulatory_compliance/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/__init__.py index 9afca8a972..189117d85c 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional @@ -32,6 +31,7 @@ class RegulatoryComplianceList(ListResource): + def __init__(self, version: Version): """ Initialize the RegulatoryComplianceList diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py index 1f1224fb2a..8215bb95b7 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -36,6 +35,7 @@ class BundleInstance(InstanceResource): + class EndUserType(object): INDIVIDUAL = "individual" BUSINESS = "business" @@ -238,6 +238,7 @@ def __repr__(self) -> str: class BundleContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the BundleContext @@ -447,6 +448,7 @@ def __repr__(self) -> str: class BundlePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BundleInstance: """ Build an instance of BundleInstance @@ -465,6 +467,7 @@ def __repr__(self) -> str: class BundleList(ListResource): + def __init__(self, version: Version): """ Initialize the BundleList 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 eb88f7c9bf..a8cf77fd18 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class BundleCopyInstance(InstanceResource): + class Status(object): DRAFT = "draft" PENDING_REVIEW = "pending-review" @@ -80,6 +80,7 @@ def __repr__(self) -> str: class BundleCopyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BundleCopyInstance: """ Build an instance of BundleCopyInstance @@ -100,6 +101,7 @@ def __repr__(self) -> str: class BundleCopyList(ListResource): + def __init__(self, version: Version, bundle_sid: str): """ Initialize the BundleCopyList diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py index e4c74ec92a..39aae3b6ed 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class EvaluationInstance(InstanceResource): + class Status(object): COMPLIANT = "compliant" NONCOMPLIANT = "noncompliant" @@ -110,6 +110,7 @@ def __repr__(self) -> str: class EvaluationContext(InstanceContext): + def __init__(self, version: Version, bundle_sid: str, sid: str): """ Initialize the EvaluationContext @@ -182,6 +183,7 @@ def __repr__(self) -> str: class EvaluationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EvaluationInstance: """ Build an instance of EvaluationInstance @@ -202,6 +204,7 @@ def __repr__(self) -> str: class EvaluationList(ListResource): + def __init__(self, version: Version, bundle_sid: str): """ Initialize the EvaluationList 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 4d2998ff64..d22fc31396 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ItemAssignmentInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Item Assignment resource. :ivar bundle_sid: The unique string that we created to identify the Bundle resource. @@ -121,6 +119,7 @@ def __repr__(self) -> str: class ItemAssignmentContext(InstanceContext): + def __init__(self, version: Version, bundle_sid: str, sid: str): """ Initialize the ItemAssignmentContext @@ -217,6 +216,7 @@ def __repr__(self) -> str: class ItemAssignmentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ItemAssignmentInstance: """ Build an instance of ItemAssignmentInstance @@ -237,6 +237,7 @@ def __repr__(self) -> str: class ItemAssignmentList(ListResource): + def __init__(self, version: Version, bundle_sid: str): """ Initialize the ItemAssignmentList 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 91d5f18a12..09e2823ada 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize, values @@ -23,6 +22,7 @@ class ReplaceItemsInstance(InstanceResource): + class Status(object): DRAFT = "draft" PENDING_REVIEW = "pending-review" @@ -79,6 +79,7 @@ def __repr__(self) -> str: class ReplaceItemsList(ListResource): + def __init__(self, version: Version, bundle_sid: str): """ Initialize the ReplaceItemsList diff --git a/twilio/rest/numbers/v2/regulatory_compliance/end_user.py b/twilio/rest/numbers/v2/regulatory_compliance/end_user.py index b717cd420e..3f9e5ec856 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/end_user.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/end_user.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class EndUserInstance(InstanceResource): + class Type(object): INDIVIDUAL = "individual" BUSINESS = "business" @@ -160,6 +160,7 @@ def __repr__(self) -> str: class EndUserContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the EndUserContext @@ -304,6 +305,7 @@ def __repr__(self) -> str: class EndUserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EndUserInstance: """ Build an instance of EndUserInstance @@ -322,6 +324,7 @@ def __repr__(self) -> str: class EndUserList(ListResource): + def __init__(self, version: Version): """ Initialize the EndUserList diff --git a/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py b/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py index e114558132..ba155575ac 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class EndUserTypeInstance(InstanceResource): - """ :ivar sid: The unique string that identifies the End-User Type resource. :ivar friendly_name: A human-readable description that is assigned to describe the End-User Type resource. Examples can include first name, last name, email, business name, etc @@ -92,6 +90,7 @@ def __repr__(self) -> str: class EndUserTypeContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the EndUserTypeContext @@ -156,6 +155,7 @@ def __repr__(self) -> str: class EndUserTypePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EndUserTypeInstance: """ Build an instance of EndUserTypeInstance @@ -174,6 +174,7 @@ def __repr__(self) -> str: class EndUserTypeList(ListResource): + def __init__(self, version: Version): """ Initialize the EndUserTypeList diff --git a/twilio/rest/numbers/v2/regulatory_compliance/regulation.py b/twilio/rest/numbers/v2/regulatory_compliance/regulation.py index ab0bf1a332..9d9a508810 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/regulation.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/regulation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,6 +22,7 @@ class RegulationInstance(InstanceResource): + class EndUserType(object): INDIVIDUAL = "individual" BUSINESS = "business" @@ -101,6 +101,7 @@ def __repr__(self) -> str: class RegulationContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the RegulationContext @@ -165,6 +166,7 @@ def __repr__(self) -> str: class RegulationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RegulationInstance: """ Build an instance of RegulationInstance @@ -183,6 +185,7 @@ def __repr__(self) -> str: class RegulationList(ListResource): + def __init__(self, version: Version): """ Initialize the RegulationList diff --git a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py index 6a4636198b..f2cd4e13d2 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class SupportingDocumentInstance(InstanceResource): + class Status(object): DRAFT = "draft" PENDING_REVIEW = "pending-review" @@ -172,6 +172,7 @@ def __repr__(self) -> str: class SupportingDocumentContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SupportingDocumentContext @@ -322,6 +323,7 @@ def __repr__(self) -> str: class SupportingDocumentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SupportingDocumentInstance: """ Build an instance of SupportingDocumentInstance @@ -340,6 +342,7 @@ def __repr__(self) -> str: class SupportingDocumentList(ListResource): + def __init__(self, version: Version): """ Initialize the SupportingDocumentList diff --git a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py index 811ae1d83e..0c7dc7b302 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class SupportingDocumentTypeInstance(InstanceResource): - """ :ivar sid: The unique string that identifies the Supporting Document Type resource. :ivar friendly_name: A human-readable description of the Supporting Document Type resource. @@ -92,6 +90,7 @@ def __repr__(self) -> str: class SupportingDocumentTypeContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SupportingDocumentTypeContext @@ -158,6 +157,7 @@ def __repr__(self) -> str: class SupportingDocumentTypePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SupportingDocumentTypeInstance: """ Build an instance of SupportingDocumentTypeInstance @@ -176,6 +176,7 @@ def __repr__(self) -> str: class SupportingDocumentTypeList(ListResource): + def __init__(self, version: Version): """ Initialize the SupportingDocumentTypeList diff --git a/twilio/rest/preview/PreviewBase.py b/twilio/rest/preview/PreviewBase.py index 73d5aac4bd..6608a69a2c 100644 --- a/twilio/rest/preview/PreviewBase.py +++ b/twilio/rest/preview/PreviewBase.py @@ -17,11 +17,11 @@ from twilio.rest.preview.hosted_numbers import HostedNumbers from twilio.rest.preview.sync import Sync from twilio.rest.preview.marketplace import Marketplace -from twilio.rest.preview.understand import Understand from twilio.rest.preview.wireless import Wireless class PreviewBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Preview Domain @@ -33,7 +33,6 @@ def __init__(self, twilio: Client): self._hosted_numbers: Optional[HostedNumbers] = None self._sync: Optional[Sync] = None self._marketplace: Optional[Marketplace] = None - self._understand: Optional[Understand] = None self._wireless: Optional[Wireless] = None @property @@ -72,15 +71,6 @@ def marketplace(self) -> Marketplace: self._marketplace = Marketplace(self) return self._marketplace - @property - def understand(self) -> Understand: - """ - :returns: Versions understand of Preview - """ - if self._understand is None: - self._understand = Understand(self) - return self._understand - @property def wireless(self) -> Wireless: """ diff --git a/twilio/rest/preview/deployed_devices/__init__.py b/twilio/rest/preview/deployed_devices/__init__.py index 30d6288565..795ee96566 100644 --- a/twilio/rest/preview/deployed_devices/__init__.py +++ b/twilio/rest/preview/deployed_devices/__init__.py @@ -19,6 +19,7 @@ class DeployedDevices(Version): + def __init__(self, domain: Domain): """ Initialize the DeployedDevices version of Preview diff --git a/twilio/rest/preview/deployed_devices/fleet/__init__.py b/twilio/rest/preview/deployed_devices/fleet/__init__.py index b943e670cc..0f5c284468 100644 --- a/twilio/rest/preview/deployed_devices/fleet/__init__.py +++ b/twilio/rest/preview/deployed_devices/fleet/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,7 +27,6 @@ class FleetInstance(InstanceResource): - """ :ivar sid: Contains a 34 character string that uniquely identifies this Fleet resource. :ivar url: Contains an absolute URL for this Fleet resource. @@ -193,6 +191,7 @@ def __repr__(self) -> str: class FleetContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the FleetContext @@ -390,6 +389,7 @@ def __repr__(self) -> str: class FleetPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FleetInstance: """ Build an instance of FleetInstance @@ -408,6 +408,7 @@ def __repr__(self) -> str: class FleetList(ListResource): + def __init__(self, version: Version): """ Initialize the FleetList diff --git a/twilio/rest/preview/deployed_devices/fleet/certificate.py b/twilio/rest/preview/deployed_devices/fleet/certificate.py index f0304d709f..1511a06134 100644 --- a/twilio/rest/preview/deployed_devices/fleet/certificate.py +++ b/twilio/rest/preview/deployed_devices/fleet/certificate.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class CertificateInstance(InstanceResource): - """ :ivar sid: Contains a 34 character string that uniquely identifies this Certificate credential resource. :ivar url: Contains an absolute URL for this Certificate credential resource. @@ -165,6 +163,7 @@ def __repr__(self) -> str: class CertificateContext(InstanceContext): + def __init__(self, version: Version, fleet_sid: str, sid: str): """ Initialize the CertificateContext @@ -323,6 +322,7 @@ def __repr__(self) -> str: class CertificatePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CertificateInstance: """ Build an instance of CertificateInstance @@ -343,6 +343,7 @@ def __repr__(self) -> str: class CertificateList(ListResource): + def __init__(self, version: Version, fleet_sid: str): """ Initialize the CertificateList diff --git a/twilio/rest/preview/deployed_devices/fleet/deployment.py b/twilio/rest/preview/deployed_devices/fleet/deployment.py index 91272fc308..5c0d109eab 100644 --- a/twilio/rest/preview/deployed_devices/fleet/deployment.py +++ b/twilio/rest/preview/deployed_devices/fleet/deployment.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class DeploymentInstance(InstanceResource): - """ :ivar sid: Contains a 34 character string that uniquely identifies this Deployment resource. :ivar url: Contains an absolute URL for this Deployment resource. @@ -163,6 +161,7 @@ def __repr__(self) -> str: class DeploymentContext(InstanceContext): + def __init__(self, version: Version, fleet_sid: str, sid: str): """ Initialize the DeploymentContext @@ -321,6 +320,7 @@ def __repr__(self) -> str: class DeploymentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeploymentInstance: """ Build an instance of DeploymentInstance @@ -341,6 +341,7 @@ def __repr__(self) -> str: class DeploymentList(ListResource): + def __init__(self, version: Version, fleet_sid: str): """ Initialize the DeploymentList diff --git a/twilio/rest/preview/deployed_devices/fleet/device.py b/twilio/rest/preview/deployed_devices/fleet/device.py index 1a992941a2..8f20074915 100644 --- a/twilio/rest/preview/deployed_devices/fleet/device.py +++ b/twilio/rest/preview/deployed_devices/fleet/device.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class DeviceInstance(InstanceResource): - """ :ivar sid: Contains a 34 character string that uniquely identifies this Device resource. :ivar url: Contains an absolute URL for this Device resource. @@ -185,6 +183,7 @@ def __repr__(self) -> str: class DeviceContext(InstanceContext): + def __init__(self, version: Version, fleet_sid: str, sid: str): """ Initialize the DeviceContext @@ -355,6 +354,7 @@ def __repr__(self) -> str: class DevicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeviceInstance: """ Build an instance of DeviceInstance @@ -375,6 +375,7 @@ def __repr__(self) -> str: class DeviceList(ListResource): + def __init__(self, version: Version, fleet_sid: str): """ Initialize the DeviceList diff --git a/twilio/rest/preview/deployed_devices/fleet/key.py b/twilio/rest/preview/deployed_devices/fleet/key.py index e98d8dd696..eabfc456cc 100644 --- a/twilio/rest/preview/deployed_devices/fleet/key.py +++ b/twilio/rest/preview/deployed_devices/fleet/key.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class KeyInstance(InstanceResource): - """ :ivar sid: Contains a 34 character string that uniquely identifies this Key credential resource. :ivar url: Contains an absolute URL for this Key credential resource. @@ -165,6 +163,7 @@ def __repr__(self) -> str: class KeyContext(InstanceContext): + def __init__(self, version: Version, fleet_sid: str, sid: str): """ Initialize the KeyContext @@ -323,6 +322,7 @@ def __repr__(self) -> str: class KeyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> KeyInstance: """ Build an instance of KeyInstance @@ -343,6 +343,7 @@ def __repr__(self) -> str: class KeyList(ListResource): + def __init__(self, version: Version, fleet_sid: str): """ Initialize the KeyList diff --git a/twilio/rest/preview/hosted_numbers/__init__.py b/twilio/rest/preview/hosted_numbers/__init__.py index fd46160426..7b3a767eef 100644 --- a/twilio/rest/preview/hosted_numbers/__init__.py +++ b/twilio/rest/preview/hosted_numbers/__init__.py @@ -22,6 +22,7 @@ class HostedNumbers(Version): + def __init__(self, domain: Domain): """ Initialize the HostedNumbers version of Preview diff --git a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py index 5ea74ff51e..162d0b11a5 100644 --- a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py +++ b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,6 +26,7 @@ class AuthorizationDocumentInstance(InstanceResource): + class Status(object): OPENED = "opened" SIGNING = "signing" @@ -191,6 +191,7 @@ def __repr__(self) -> str: class AuthorizationDocumentContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AuthorizationDocumentContext @@ -367,6 +368,7 @@ def __repr__(self) -> str: class AuthorizationDocumentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AuthorizationDocumentInstance: """ Build an instance of AuthorizationDocumentInstance @@ -385,6 +387,7 @@ def __repr__(self) -> str: class AuthorizationDocumentList(ListResource): + def __init__(self, version: Version): """ Initialize the AuthorizationDocumentList diff --git a/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py b/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py index 4931d54c6b..35b67d71c7 100644 --- a/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class DependentHostedNumberOrderInstance(InstanceResource): + class Status(object): RECEIVED = "received" PENDING_VERIFICATION = "pending-verification" @@ -80,9 +80,9 @@ def __init__( self.capabilities: Optional[str] = payload.get("capabilities") self.friendly_name: Optional[str] = payload.get("friendly_name") self.unique_name: Optional[str] = payload.get("unique_name") - self.status: Optional[ - "DependentHostedNumberOrderInstance.Status" - ] = payload.get("status") + self.status: Optional["DependentHostedNumberOrderInstance.Status"] = ( + payload.get("status") + ) self.failure_reason: Optional[str] = payload.get("failure_reason") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") @@ -125,6 +125,7 @@ def __repr__(self) -> str: class DependentHostedNumberOrderPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> DependentHostedNumberOrderInstance: @@ -149,6 +150,7 @@ def __repr__(self) -> str: class DependentHostedNumberOrderList(ListResource): + def __init__(self, version: Version, signing_document_sid: str): """ Initialize the DependentHostedNumberOrderList diff --git a/twilio/rest/preview/hosted_numbers/hosted_number_order.py b/twilio/rest/preview/hosted_numbers/hosted_number_order.py index 8a50a45374..70b9f309ba 100644 --- a/twilio/rest/preview/hosted_numbers/hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/hosted_number_order.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class HostedNumberOrderInstance(InstanceResource): + class Status(object): RECEIVED = "received" PENDING_VERIFICATION = "pending-verification" @@ -267,6 +267,7 @@ def __repr__(self) -> str: class HostedNumberOrderContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the HostedNumberOrderContext @@ -469,6 +470,7 @@ def __repr__(self) -> str: class HostedNumberOrderPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> HostedNumberOrderInstance: """ Build an instance of HostedNumberOrderInstance @@ -487,6 +489,7 @@ def __repr__(self) -> str: class HostedNumberOrderList(ListResource): + def __init__(self, version: Version): """ Initialize the HostedNumberOrderList diff --git a/twilio/rest/preview/marketplace/__init__.py b/twilio/rest/preview/marketplace/__init__.py index d12d3ab0a5..fcc99a4112 100644 --- a/twilio/rest/preview/marketplace/__init__.py +++ b/twilio/rest/preview/marketplace/__init__.py @@ -20,6 +20,7 @@ class Marketplace(Version): + def __init__(self, domain: Domain): """ Initialize the Marketplace version of Preview diff --git a/twilio/rest/preview/marketplace/available_add_on/__init__.py b/twilio/rest/preview/marketplace/available_add_on/__init__.py index 776a33e9d9..7743d8a8c3 100644 --- a/twilio/rest/preview/marketplace/available_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/available_add_on/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -26,7 +25,6 @@ class AvailableAddOnInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the AvailableAddOn resource. :ivar friendly_name: The string that you assigned to describe the resource. @@ -108,6 +106,7 @@ def __repr__(self) -> str: class AvailableAddOnContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AvailableAddOnContext @@ -186,6 +185,7 @@ def __repr__(self) -> str: class AvailableAddOnPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AvailableAddOnInstance: """ Build an instance of AvailableAddOnInstance @@ -204,6 +204,7 @@ def __repr__(self) -> str: class AvailableAddOnList(ListResource): + def __init__(self, version: Version): """ Initialize the AvailableAddOnList diff --git a/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py b/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py index 218b48ee3f..d27b74cbfc 100644 --- a/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py +++ b/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class AvailableAddOnExtensionInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the AvailableAddOnExtension resource. :ivar available_add_on_sid: The SID of the AvailableAddOn resource to which this extension applies. @@ -102,6 +100,7 @@ def __repr__(self) -> str: class AvailableAddOnExtensionContext(InstanceContext): + def __init__(self, version: Version, available_add_on_sid: str, sid: str): """ Initialize the AvailableAddOnExtensionContext @@ -174,6 +173,7 @@ def __repr__(self) -> str: class AvailableAddOnExtensionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AvailableAddOnExtensionInstance: """ Build an instance of AvailableAddOnExtensionInstance @@ -196,6 +196,7 @@ def __repr__(self) -> str: class AvailableAddOnExtensionList(ListResource): + def __init__(self, version: Version, available_add_on_sid: str): """ Initialize the AvailableAddOnExtensionList diff --git a/twilio/rest/preview/marketplace/installed_add_on/__init__.py b/twilio/rest/preview/marketplace/installed_add_on/__init__.py index e9a7e8cd7d..5a0530aef4 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/installed_add_on/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,7 +26,6 @@ class InstalledAddOnInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the InstalledAddOn resource. This Sid can also be found in the Console on that specific Add-ons page as the 'Available Add-on Sid'. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the InstalledAddOn resource. @@ -171,6 +169,7 @@ def __repr__(self) -> str: class InstalledAddOnContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the InstalledAddOnContext @@ -329,6 +328,7 @@ def __repr__(self) -> str: class InstalledAddOnPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InstalledAddOnInstance: """ Build an instance of InstalledAddOnInstance @@ -347,6 +347,7 @@ def __repr__(self) -> str: class InstalledAddOnList(ListResource): + def __init__(self, version: Version): """ Initialize the InstalledAddOnList diff --git a/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py b/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py index e191c8c48f..a6002fa0d1 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py +++ b/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class InstalledAddOnExtensionInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the InstalledAddOn Extension resource. :ivar installed_add_on_sid: The SID of the InstalledAddOn resource to which this extension applies. @@ -128,6 +126,7 @@ def __repr__(self) -> str: class InstalledAddOnExtensionContext(InstanceContext): + def __init__(self, version: Version, installed_add_on_sid: str, sid: str): """ Initialize the InstalledAddOnExtensionContext @@ -254,6 +253,7 @@ def __repr__(self) -> str: class InstalledAddOnExtensionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InstalledAddOnExtensionInstance: """ Build an instance of InstalledAddOnExtensionInstance @@ -276,6 +276,7 @@ def __repr__(self) -> str: class InstalledAddOnExtensionList(ListResource): + def __init__(self, version: Version, installed_add_on_sid: str): """ Initialize the InstalledAddOnExtensionList diff --git a/twilio/rest/preview/sync/__init__.py b/twilio/rest/preview/sync/__init__.py index fad9f85c49..d84c79039b 100644 --- a/twilio/rest/preview/sync/__init__.py +++ b/twilio/rest/preview/sync/__init__.py @@ -19,6 +19,7 @@ class Sync(Version): + def __init__(self, domain: Domain): """ Initialize the Sync version of Preview diff --git a/twilio/rest/preview/sync/service/__init__.py b/twilio/rest/preview/sync/service/__init__.py index b3a962fa6f..e270895fbf 100644 --- a/twilio/rest/preview/sync/service/__init__.py +++ b/twilio/rest/preview/sync/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: @@ -199,6 +197,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -395,6 +394,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -413,6 +413,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList diff --git a/twilio/rest/preview/sync/service/document/__init__.py b/twilio/rest/preview/sync/service/document/__init__.py index 660aee9b18..e7ab4ae8b8 100644 --- a/twilio/rest/preview/sync/service/document/__init__.py +++ b/twilio/rest/preview/sync/service/document/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,7 +26,6 @@ class DocumentInstance(InstanceResource): - """ :ivar sid: :ivar unique_name: @@ -175,6 +173,7 @@ def __repr__(self) -> str: class DocumentContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the DocumentContext @@ -348,6 +347,7 @@ def __repr__(self) -> str: class DocumentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DocumentInstance: """ Build an instance of DocumentInstance @@ -368,6 +368,7 @@ def __repr__(self) -> str: class DocumentList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the DocumentList diff --git a/twilio/rest/preview/sync/service/document/document_permission.py b/twilio/rest/preview/sync/service/document/document_permission.py index 1b43dc9fcf..7439d34341 100644 --- a/twilio/rest/preview/sync/service/document/document_permission.py +++ b/twilio/rest/preview/sync/service/document/document_permission.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class DocumentPermissionInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Twilio Account. :ivar service_sid: The unique SID identifier of the Sync Service Instance. @@ -161,6 +159,7 @@ def __repr__(self) -> str: class DocumentPermissionContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, document_sid: str, identity: str ): @@ -329,6 +328,7 @@ def __repr__(self) -> str: class DocumentPermissionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DocumentPermissionInstance: """ Build an instance of DocumentPermissionInstance @@ -352,6 +352,7 @@ def __repr__(self) -> str: class DocumentPermissionList(ListResource): + def __init__(self, version: Version, service_sid: str, document_sid: str): """ Initialize the DocumentPermissionList diff --git a/twilio/rest/preview/sync/service/sync_list/__init__.py b/twilio/rest/preview/sync/service/sync_list/__init__.py index 7dfc743963..fcd2f28ffe 100644 --- a/twilio/rest/preview/sync/service/sync_list/__init__.py +++ b/twilio/rest/preview/sync/service/sync_list/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,7 +27,6 @@ class SyncListInstance(InstanceResource): - """ :ivar sid: :ivar unique_name: @@ -149,6 +147,7 @@ def __repr__(self) -> str: class SyncListContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the SyncListContext @@ -270,6 +269,7 @@ def __repr__(self) -> str: class SyncListPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncListInstance: """ Build an instance of SyncListInstance @@ -290,6 +290,7 @@ def __repr__(self) -> str: class SyncListList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the SyncListList 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 d795075fea..0cefd6c66b 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class SyncListItemInstance(InstanceResource): + class QueryFromBoundType(object): INCLUSIVE = "inclusive" EXCLUSIVE = "exclusive" @@ -179,6 +179,7 @@ def __repr__(self) -> str: class SyncListItemContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, list_sid: str, index: int): """ Initialize the SyncListItemContext @@ -355,6 +356,7 @@ def __repr__(self) -> str: class SyncListItemPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncListItemInstance: """ Build an instance of SyncListItemInstance @@ -378,6 +380,7 @@ def __repr__(self) -> str: class SyncListItemList(ListResource): + def __init__(self, version: Version, service_sid: str, list_sid: str): """ Initialize the SyncListItemList diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py index 7e1a2db968..0f4f9e4b28 100644 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py +++ b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class SyncListPermissionInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Twilio Account. :ivar service_sid: The unique SID identifier of the Sync Service Instance. @@ -161,6 +159,7 @@ def __repr__(self) -> str: class SyncListPermissionContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, list_sid: str, identity: str ): @@ -331,6 +330,7 @@ def __repr__(self) -> str: class SyncListPermissionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncListPermissionInstance: """ Build an instance of SyncListPermissionInstance @@ -354,6 +354,7 @@ def __repr__(self) -> str: class SyncListPermissionList(ListResource): + def __init__(self, version: Version, service_sid: str, list_sid: str): """ Initialize the SyncListPermissionList diff --git a/twilio/rest/preview/sync/service/sync_map/__init__.py b/twilio/rest/preview/sync/service/sync_map/__init__.py index cc5907cf80..1d79936240 100644 --- a/twilio/rest/preview/sync/service/sync_map/__init__.py +++ b/twilio/rest/preview/sync/service/sync_map/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,7 +27,6 @@ class SyncMapInstance(InstanceResource): - """ :ivar sid: :ivar unique_name: @@ -149,6 +147,7 @@ def __repr__(self) -> str: class SyncMapContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the SyncMapContext @@ -270,6 +269,7 @@ def __repr__(self) -> str: class SyncMapPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncMapInstance: """ Build an instance of SyncMapInstance @@ -290,6 +290,7 @@ def __repr__(self) -> str: class SyncMapList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the SyncMapList 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 20240d1ef9..322c8ed225 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class SyncMapItemInstance(InstanceResource): + class QueryFromBoundType(object): INCLUSIVE = "inclusive" EXCLUSIVE = "exclusive" @@ -179,6 +179,7 @@ def __repr__(self) -> str: class SyncMapItemContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, map_sid: str, key: str): """ Initialize the SyncMapItemContext @@ -355,6 +356,7 @@ def __repr__(self) -> str: class SyncMapItemPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncMapItemInstance: """ Build an instance of SyncMapItemInstance @@ -378,6 +380,7 @@ def __repr__(self) -> str: class SyncMapItemList(ListResource): + def __init__(self, version: Version, service_sid: str, map_sid: str): """ Initialize the SyncMapItemList diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py index 3b3230fe17..999713e0e9 100644 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py +++ b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class SyncMapPermissionInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Twilio Account. :ivar service_sid: The unique SID identifier of the Sync Service Instance. @@ -161,6 +159,7 @@ def __repr__(self) -> str: class SyncMapPermissionContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, map_sid: str, identity: str): """ Initialize the SyncMapPermissionContext @@ -329,6 +328,7 @@ def __repr__(self) -> str: class SyncMapPermissionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncMapPermissionInstance: """ Build an instance of SyncMapPermissionInstance @@ -352,6 +352,7 @@ def __repr__(self) -> str: class SyncMapPermissionList(ListResource): + def __init__(self, version: Version, service_sid: str, map_sid: str): """ Initialize the SyncMapPermissionList diff --git a/twilio/rest/preview/understand/__init__.py b/twilio/rest/preview/understand/__init__.py deleted file mode 100644 index da659fd3a6..0000000000 --- a/twilio/rest/preview/understand/__init__.py +++ /dev/null @@ -1,42 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional -from twilio.base.version import Version -from twilio.base.domain import Domain -from twilio.rest.preview.understand.assistant import AssistantList - - -class Understand(Version): - def __init__(self, domain: Domain): - """ - Initialize the Understand version of Preview - - :param domain: The Twilio.preview domain - """ - super().__init__(domain, "understand") - self._assistants: Optional[AssistantList] = None - - @property - def assistants(self) -> AssistantList: - if self._assistants is None: - self._assistants = AssistantList(self) - return self._assistants - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/__init__.py b/twilio/rest/preview/understand/assistant/__init__.py deleted file mode 100644 index 9f50e5fff7..0000000000 --- a/twilio/rest/preview/understand/assistant/__init__.py +++ /dev/null @@ -1,889 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -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 -from twilio.base.page import Page -from twilio.rest.preview.understand.assistant.assistant_fallback_actions import ( - AssistantFallbackActionsList, -) -from twilio.rest.preview.understand.assistant.assistant_initiation_actions import ( - AssistantInitiationActionsList, -) -from twilio.rest.preview.understand.assistant.dialogue import DialogueList -from twilio.rest.preview.understand.assistant.field_type import FieldTypeList -from twilio.rest.preview.understand.assistant.model_build import ModelBuildList -from twilio.rest.preview.understand.assistant.query import QueryList -from twilio.rest.preview.understand.assistant.style_sheet import StyleSheetList -from twilio.rest.preview.understand.assistant.task import TaskList - - -class AssistantInstance(InstanceResource): - - """ - :ivar account_sid: The unique ID of the Account that created this Assistant. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long. - :ivar latest_model_build_sid: The unique ID (Sid) of the latest model build. Null if no model has been built. - :ivar links: - :ivar log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. You can use the unique name in the URL path. Unique up to 64 characters long. - :ivar url: - :ivar callback_url: A user-provided URL to send event callbacks to. - :ivar callback_events: Space-separated list of callback events that will trigger callbacks. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.latest_model_build_sid: Optional[str] = payload.get( - "latest_model_build_sid" - ) - self.links: Optional[Dict[str, object]] = payload.get("links") - self.log_queries: Optional[bool] = payload.get("log_queries") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - self.callback_url: Optional[str] = payload.get("callback_url") - self.callback_events: Optional[str] = payload.get("callback_events") - - self._solution = { - "sid": sid or self.sid, - } - self._context: Optional[AssistantContext] = None - - @property - def _proxy(self) -> "AssistantContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: AssistantContext for this AssistantInstance - """ - if self._context is None: - self._context = AssistantContext( - self._version, - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "AssistantInstance": - """ - Fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "AssistantInstance": - """ - Asynchronous coroutine to fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - fallback_actions: Union[object, object] = values.unset, - initiation_actions: Union[object, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - ) -> "AssistantInstance": - """ - Update the AssistantInstance - - :param friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long. - :param log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param callback_url: A user-provided URL to send event callbacks to. - :param callback_events: Space-separated list of callback events that will trigger callbacks. - :param fallback_actions: The JSON actions to be executed when the user's input is not recognized as matching any Task. - :param initiation_actions: The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - :param style_sheet: The JSON object that holds the style sheet for the assistant - - :returns: The updated AssistantInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - log_queries=log_queries, - unique_name=unique_name, - callback_url=callback_url, - callback_events=callback_events, - fallback_actions=fallback_actions, - initiation_actions=initiation_actions, - style_sheet=style_sheet, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - fallback_actions: Union[object, object] = values.unset, - initiation_actions: Union[object, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - ) -> "AssistantInstance": - """ - Asynchronous coroutine to update the AssistantInstance - - :param friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long. - :param log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param callback_url: A user-provided URL to send event callbacks to. - :param callback_events: Space-separated list of callback events that will trigger callbacks. - :param fallback_actions: The JSON actions to be executed when the user's input is not recognized as matching any Task. - :param initiation_actions: The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - :param style_sheet: The JSON object that holds the style sheet for the assistant - - :returns: The updated AssistantInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - log_queries=log_queries, - unique_name=unique_name, - callback_url=callback_url, - callback_events=callback_events, - fallback_actions=fallback_actions, - initiation_actions=initiation_actions, - style_sheet=style_sheet, - ) - - @property - def assistant_fallback_actions(self) -> AssistantFallbackActionsList: - """ - Access the assistant_fallback_actions - """ - return self._proxy.assistant_fallback_actions - - @property - def assistant_initiation_actions(self) -> AssistantInitiationActionsList: - """ - Access the assistant_initiation_actions - """ - return self._proxy.assistant_initiation_actions - - @property - def dialogues(self) -> DialogueList: - """ - Access the dialogues - """ - return self._proxy.dialogues - - @property - def field_types(self) -> FieldTypeList: - """ - Access the field_types - """ - return self._proxy.field_types - - @property - def model_builds(self) -> ModelBuildList: - """ - Access the model_builds - """ - return self._proxy.model_builds - - @property - def queries(self) -> QueryList: - """ - Access the queries - """ - return self._proxy.queries - - @property - def style_sheet(self) -> StyleSheetList: - """ - Access the style_sheet - """ - return self._proxy.style_sheet - - @property - def tasks(self) -> TaskList: - """ - Access the tasks - """ - return self._proxy.tasks - - 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 AssistantContext(InstanceContext): - def __init__(self, version: Version, sid: str): - """ - Initialize the AssistantContext - - :param version: Version that contains the resource - :param sid: A 34 character string that uniquely identifies this resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "sid": sid, - } - self._uri = "/Assistants/{sid}".format(**self._solution) - - self._assistant_fallback_actions: Optional[AssistantFallbackActionsList] = None - self._assistant_initiation_actions: Optional[ - AssistantInitiationActionsList - ] = None - self._dialogues: Optional[DialogueList] = None - self._field_types: Optional[FieldTypeList] = None - self._model_builds: Optional[ModelBuildList] = None - self._queries: Optional[QueryList] = None - self._style_sheet: Optional[StyleSheetList] = None - self._tasks: Optional[TaskList] = None - - def delete(self) -> bool: - """ - Deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> AssistantInstance: - """ - Fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return AssistantInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> AssistantInstance: - """ - Asynchronous coroutine to fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return AssistantInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - fallback_actions: Union[object, object] = values.unset, - initiation_actions: Union[object, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - ) -> AssistantInstance: - """ - Update the AssistantInstance - - :param friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long. - :param log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param callback_url: A user-provided URL to send event callbacks to. - :param callback_events: Space-separated list of callback events that will trigger callbacks. - :param fallback_actions: The JSON actions to be executed when the user's input is not recognized as matching any Task. - :param initiation_actions: The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - :param style_sheet: The JSON object that holds the style sheet for the assistant - - :returns: The updated AssistantInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "FallbackActions": serialize.object(fallback_actions), - "InitiationActions": serialize.object(initiation_actions), - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload, sid=self._solution["sid"]) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - fallback_actions: Union[object, object] = values.unset, - initiation_actions: Union[object, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - ) -> AssistantInstance: - """ - Asynchronous coroutine to update the AssistantInstance - - :param friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long. - :param log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param callback_url: A user-provided URL to send event callbacks to. - :param callback_events: Space-separated list of callback events that will trigger callbacks. - :param fallback_actions: The JSON actions to be executed when the user's input is not recognized as matching any Task. - :param initiation_actions: The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - :param style_sheet: The JSON object that holds the style sheet for the assistant - - :returns: The updated AssistantInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "FallbackActions": serialize.object(fallback_actions), - "InitiationActions": serialize.object(initiation_actions), - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload, sid=self._solution["sid"]) - - @property - def assistant_fallback_actions(self) -> AssistantFallbackActionsList: - """ - Access the assistant_fallback_actions - """ - if self._assistant_fallback_actions is None: - self._assistant_fallback_actions = AssistantFallbackActionsList( - self._version, - self._solution["sid"], - ) - return self._assistant_fallback_actions - - @property - def assistant_initiation_actions(self) -> AssistantInitiationActionsList: - """ - Access the assistant_initiation_actions - """ - if self._assistant_initiation_actions is None: - self._assistant_initiation_actions = AssistantInitiationActionsList( - self._version, - self._solution["sid"], - ) - return self._assistant_initiation_actions - - @property - def dialogues(self) -> DialogueList: - """ - Access the dialogues - """ - if self._dialogues is None: - self._dialogues = DialogueList( - self._version, - self._solution["sid"], - ) - return self._dialogues - - @property - def field_types(self) -> FieldTypeList: - """ - Access the field_types - """ - if self._field_types is None: - self._field_types = FieldTypeList( - self._version, - self._solution["sid"], - ) - return self._field_types - - @property - def model_builds(self) -> ModelBuildList: - """ - Access the model_builds - """ - if self._model_builds is None: - self._model_builds = ModelBuildList( - self._version, - self._solution["sid"], - ) - return self._model_builds - - @property - def queries(self) -> QueryList: - """ - Access the queries - """ - if self._queries is None: - self._queries = QueryList( - self._version, - self._solution["sid"], - ) - return self._queries - - @property - def style_sheet(self) -> StyleSheetList: - """ - Access the style_sheet - """ - if self._style_sheet is None: - self._style_sheet = StyleSheetList( - self._version, - self._solution["sid"], - ) - return self._style_sheet - - @property - def tasks(self) -> TaskList: - """ - Access the tasks - """ - if self._tasks is None: - self._tasks = TaskList( - self._version, - self._solution["sid"], - ) - return self._tasks - - 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 AssistantPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> AssistantInstance: - """ - Build an instance of AssistantInstance - - :param payload: Payload response from the API - """ - return AssistantInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class AssistantList(ListResource): - def __init__(self, version: Version): - """ - Initialize the AssistantList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Assistants" - - def create( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - fallback_actions: Union[object, object] = values.unset, - initiation_actions: Union[object, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - ) -> AssistantInstance: - """ - Create the AssistantInstance - - :param friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long. - :param log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param callback_url: A user-provided URL to send event callbacks to. - :param callback_events: Space-separated list of callback events that will trigger callbacks. - :param fallback_actions: The JSON actions to be executed when the user's input is not recognized as matching any Task. - :param initiation_actions: The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - :param style_sheet: The JSON object that holds the style sheet for the assistant - - :returns: The created AssistantInstance - """ - - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "FallbackActions": serialize.object(fallback_actions), - "InitiationActions": serialize.object(initiation_actions), - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload) - - async def create_async( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - fallback_actions: Union[object, object] = values.unset, - initiation_actions: Union[object, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - ) -> AssistantInstance: - """ - Asynchronously create the AssistantInstance - - :param friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long. - :param log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param callback_url: A user-provided URL to send event callbacks to. - :param callback_events: Space-separated list of callback events that will trigger callbacks. - :param fallback_actions: The JSON actions to be executed when the user's input is not recognized as matching any Task. - :param initiation_actions: The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - :param style_sheet: The JSON object that holds the style sheet for the assistant - - :returns: The created AssistantInstance - """ - - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "FallbackActions": serialize.object(fallback_actions), - "InitiationActions": serialize.object(initiation_actions), - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[AssistantInstance]: - """ - Streams AssistantInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[AssistantInstance]: - """ - Asynchronously streams AssistantInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AssistantInstance]: - """ - Lists AssistantInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AssistantInstance]: - """ - Asynchronously lists AssistantInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AssistantPage: - """ - Retrieve a single page of AssistantInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of AssistantInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return AssistantPage(self._version, response) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AssistantPage: - """ - Asynchronously retrieve a single page of AssistantInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of AssistantInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return AssistantPage(self._version, response) - - def get_page(self, target_url: str) -> AssistantPage: - """ - Retrieve a specific page of AssistantInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AssistantInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return AssistantPage(self._version, response) - - async def get_page_async(self, target_url: str) -> AssistantPage: - """ - Asynchronously retrieve a specific page of AssistantInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AssistantInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return AssistantPage(self._version, response) - - def get(self, sid: str) -> AssistantContext: - """ - Constructs a AssistantContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return AssistantContext(self._version, sid=sid) - - def __call__(self, sid: str) -> AssistantContext: - """ - Constructs a AssistantContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return AssistantContext(self._version, sid=sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/assistant_fallback_actions.py b/twilio/rest/preview/understand/assistant/assistant_fallback_actions.py deleted file mode 100644 index 84e964de0e..0000000000 --- a/twilio/rest/preview/understand/assistant/assistant_fallback_actions.py +++ /dev/null @@ -1,279 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from typing import Any, Dict, Optional, Union -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 -from twilio.base.version import Version - - -class AssistantFallbackActionsInstance(InstanceResource): - - """ - :ivar account_sid: - :ivar assistant_sid: - :ivar url: - :ivar data: - """ - - def __init__(self, version: Version, payload: Dict[str, Any], assistant_sid: str): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.url: Optional[str] = payload.get("url") - self.data: Optional[Dict[str, object]] = payload.get("data") - - self._solution = { - "assistant_sid": assistant_sid, - } - self._context: Optional[AssistantFallbackActionsContext] = None - - @property - def _proxy(self) -> "AssistantFallbackActionsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: AssistantFallbackActionsContext for this AssistantFallbackActionsInstance - """ - if self._context is None: - self._context = AssistantFallbackActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - ) - return self._context - - def fetch(self) -> "AssistantFallbackActionsInstance": - """ - Fetch the AssistantFallbackActionsInstance - - - :returns: The fetched AssistantFallbackActionsInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "AssistantFallbackActionsInstance": - """ - Asynchronous coroutine to fetch the AssistantFallbackActionsInstance - - - :returns: The fetched AssistantFallbackActionsInstance - """ - return await self._proxy.fetch_async() - - def update( - self, fallback_actions: Union[object, object] = values.unset - ) -> "AssistantFallbackActionsInstance": - """ - Update the AssistantFallbackActionsInstance - - :param fallback_actions: - - :returns: The updated AssistantFallbackActionsInstance - """ - return self._proxy.update( - fallback_actions=fallback_actions, - ) - - async def update_async( - self, fallback_actions: Union[object, object] = values.unset - ) -> "AssistantFallbackActionsInstance": - """ - Asynchronous coroutine to update the AssistantFallbackActionsInstance - - :param fallback_actions: - - :returns: The updated AssistantFallbackActionsInstance - """ - return await self._proxy.update_async( - fallback_actions=fallback_actions, - ) - - 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 AssistantFallbackActionsContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the AssistantFallbackActionsContext - - :param version: Version that contains the resource - :param assistant_sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/FallbackActions".format( - **self._solution - ) - - def fetch(self) -> AssistantFallbackActionsInstance: - """ - Fetch the AssistantFallbackActionsInstance - - - :returns: The fetched AssistantFallbackActionsInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return AssistantFallbackActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - async def fetch_async(self) -> AssistantFallbackActionsInstance: - """ - Asynchronous coroutine to fetch the AssistantFallbackActionsInstance - - - :returns: The fetched AssistantFallbackActionsInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return AssistantFallbackActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - def update( - self, fallback_actions: Union[object, object] = values.unset - ) -> AssistantFallbackActionsInstance: - """ - Update the AssistantFallbackActionsInstance - - :param fallback_actions: - - :returns: The updated AssistantFallbackActionsInstance - """ - data = values.of( - { - "FallbackActions": serialize.object(fallback_actions), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantFallbackActionsInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def update_async( - self, fallback_actions: Union[object, object] = values.unset - ) -> AssistantFallbackActionsInstance: - """ - Asynchronous coroutine to update the AssistantFallbackActionsInstance - - :param fallback_actions: - - :returns: The updated AssistantFallbackActionsInstance - """ - data = values.of( - { - "FallbackActions": serialize.object(fallback_actions), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantFallbackActionsInstance( - self._version, payload, assistant_sid=self._solution["assistant_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 AssistantFallbackActionsList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the AssistantFallbackActionsList - - :param version: Version that contains the resource - :param assistant_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - - def get(self) -> AssistantFallbackActionsContext: - """ - Constructs a AssistantFallbackActionsContext - - """ - return AssistantFallbackActionsContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __call__(self) -> AssistantFallbackActionsContext: - """ - Constructs a AssistantFallbackActionsContext - - """ - return AssistantFallbackActionsContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/assistant_initiation_actions.py b/twilio/rest/preview/understand/assistant/assistant_initiation_actions.py deleted file mode 100644 index 544154f658..0000000000 --- a/twilio/rest/preview/understand/assistant/assistant_initiation_actions.py +++ /dev/null @@ -1,283 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from typing import Any, Dict, Optional, Union -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 -from twilio.base.version import Version - - -class AssistantInitiationActionsInstance(InstanceResource): - - """ - :ivar account_sid: - :ivar assistant_sid: - :ivar url: - :ivar data: - """ - - def __init__(self, version: Version, payload: Dict[str, Any], assistant_sid: str): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.url: Optional[str] = payload.get("url") - self.data: Optional[Dict[str, object]] = payload.get("data") - - self._solution = { - "assistant_sid": assistant_sid, - } - self._context: Optional[AssistantInitiationActionsContext] = None - - @property - def _proxy(self) -> "AssistantInitiationActionsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: AssistantInitiationActionsContext for this AssistantInitiationActionsInstance - """ - if self._context is None: - self._context = AssistantInitiationActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - ) - return self._context - - def fetch(self) -> "AssistantInitiationActionsInstance": - """ - Fetch the AssistantInitiationActionsInstance - - - :returns: The fetched AssistantInitiationActionsInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "AssistantInitiationActionsInstance": - """ - Asynchronous coroutine to fetch the AssistantInitiationActionsInstance - - - :returns: The fetched AssistantInitiationActionsInstance - """ - return await self._proxy.fetch_async() - - def update( - self, initiation_actions: Union[object, object] = values.unset - ) -> "AssistantInitiationActionsInstance": - """ - Update the AssistantInitiationActionsInstance - - :param initiation_actions: - - :returns: The updated AssistantInitiationActionsInstance - """ - return self._proxy.update( - initiation_actions=initiation_actions, - ) - - async def update_async( - self, initiation_actions: Union[object, object] = values.unset - ) -> "AssistantInitiationActionsInstance": - """ - Asynchronous coroutine to update the AssistantInitiationActionsInstance - - :param initiation_actions: - - :returns: The updated AssistantInitiationActionsInstance - """ - return await self._proxy.update_async( - initiation_actions=initiation_actions, - ) - - 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 AssistantInitiationActionsContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the AssistantInitiationActionsContext - - :param version: Version that contains the resource - :param assistant_sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/InitiationActions".format( - **self._solution - ) - - def fetch(self) -> AssistantInitiationActionsInstance: - """ - Fetch the AssistantInitiationActionsInstance - - - :returns: The fetched AssistantInitiationActionsInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return AssistantInitiationActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - async def fetch_async(self) -> AssistantInitiationActionsInstance: - """ - Asynchronous coroutine to fetch the AssistantInitiationActionsInstance - - - :returns: The fetched AssistantInitiationActionsInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return AssistantInitiationActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - def update( - self, initiation_actions: Union[object, object] = values.unset - ) -> AssistantInitiationActionsInstance: - """ - Update the AssistantInitiationActionsInstance - - :param initiation_actions: - - :returns: The updated AssistantInitiationActionsInstance - """ - data = values.of( - { - "InitiationActions": serialize.object(initiation_actions), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInitiationActionsInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def update_async( - self, initiation_actions: Union[object, object] = values.unset - ) -> AssistantInitiationActionsInstance: - """ - Asynchronous coroutine to update the AssistantInitiationActionsInstance - - :param initiation_actions: - - :returns: The updated AssistantInitiationActionsInstance - """ - data = values.of( - { - "InitiationActions": serialize.object(initiation_actions), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInitiationActionsInstance( - self._version, payload, assistant_sid=self._solution["assistant_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 AssistantInitiationActionsList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the AssistantInitiationActionsList - - :param version: Version that contains the resource - :param assistant_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - - def get(self) -> AssistantInitiationActionsContext: - """ - Constructs a AssistantInitiationActionsContext - - """ - return AssistantInitiationActionsContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __call__(self) -> AssistantInitiationActionsContext: - """ - Constructs a AssistantInitiationActionsContext - - """ - return AssistantInitiationActionsContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/dialogue.py b/twilio/rest/preview/understand/assistant/dialogue.py deleted file mode 100644 index 57b0016ec2..0000000000 --- a/twilio/rest/preview/understand/assistant/dialogue.py +++ /dev/null @@ -1,210 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from typing import Any, Dict, Optional -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class DialogueInstance(InstanceResource): - - """ - :ivar account_sid: The unique ID of the Account that created this Field. - :ivar assistant_sid: The unique ID of the parent Assistant. - :ivar sid: The unique ID of the Dialogue - :ivar data: The dialogue memory object as json - :ivar url: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.data: Optional[Dict[str, object]] = payload.get("data") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[DialogueContext] = None - - @property - def _proxy(self) -> "DialogueContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: DialogueContext for this DialogueInstance - """ - if self._context is None: - self._context = DialogueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def fetch(self) -> "DialogueInstance": - """ - Fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "DialogueInstance": - """ - Asynchronous coroutine to fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DialogueContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the DialogueContext - - :param version: Version that contains the resource - :param assistant_sid: - :param sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Dialogues/{sid}".format( - **self._solution - ) - - def fetch(self) -> DialogueInstance: - """ - Fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return DialogueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> DialogueInstance: - """ - Asynchronous coroutine to fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return DialogueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_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 DialogueList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the DialogueList - - :param version: Version that contains the resource - :param assistant_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - - def get(self, sid: str) -> DialogueContext: - """ - Constructs a DialogueContext - - :param sid: - """ - return DialogueContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> DialogueContext: - """ - Constructs a DialogueContext - - :param sid: - """ - return DialogueContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/field_type/__init__.py b/twilio/rest/preview/understand/assistant/field_type/__init__.py deleted file mode 100644 index 28cec5ac89..0000000000 --- a/twilio/rest/preview/understand/assistant/field_type/__init__.py +++ /dev/null @@ -1,656 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.preview.understand.assistant.field_type.field_value import ( - FieldValueList, -) - - -class FieldTypeInstance(InstanceResource): - - """ - :ivar account_sid: The unique ID of the Account that created this Field Type. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :ivar links: - :ivar assistant_sid: The unique ID of the Assistant. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :ivar url: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.links: Optional[Dict[str, object]] = payload.get("links") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[FieldTypeContext] = None - - @property - def _proxy(self) -> "FieldTypeContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FieldTypeContext for this FieldTypeInstance - """ - if self._context is None: - self._context = FieldTypeContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FieldTypeInstance": - """ - Fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FieldTypeInstance": - """ - Asynchronous coroutine to fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> "FieldTypeInstance": - """ - Update the FieldTypeInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - - :returns: The updated FieldTypeInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - unique_name=unique_name, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> "FieldTypeInstance": - """ - Asynchronous coroutine to update the FieldTypeInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - - :returns: The updated FieldTypeInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - unique_name=unique_name, - ) - - @property - def field_values(self) -> FieldValueList: - """ - Access the field_values - """ - return self._proxy.field_values - - 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 FieldTypeContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the FieldTypeContext - - :param version: Version that contains the resource - :param assistant_sid: - :param sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes/{sid}".format( - **self._solution - ) - - self._field_values: Optional[FieldValueList] = None - - def delete(self) -> bool: - """ - Deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FieldTypeInstance: - """ - Fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FieldTypeInstance: - """ - Asynchronous coroutine to fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> FieldTypeInstance: - """ - Update the FieldTypeInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - - :returns: The updated FieldTypeInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> FieldTypeInstance: - """ - Asynchronous coroutine to update the FieldTypeInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - - :returns: The updated FieldTypeInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - @property - def field_values(self) -> FieldValueList: - """ - Access the field_values - """ - if self._field_values is None: - self._field_values = FieldValueList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._field_values - - 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 FieldTypePage(Page): - def get_instance(self, payload: Dict[str, Any]) -> FieldTypeInstance: - """ - Build an instance of FieldTypeInstance - - :param payload: Payload response from the API - """ - return FieldTypeInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class FieldTypeList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the FieldTypeList - - :param version: Version that contains the resource - :param assistant_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes".format(**self._solution) - - def create( - self, unique_name: str, friendly_name: Union[str, object] = values.unset - ) -> FieldTypeInstance: - """ - Create the FieldTypeInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - - :returns: The created FieldTypeInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, unique_name: str, friendly_name: Union[str, object] = values.unset - ) -> FieldTypeInstance: - """ - Asynchronously create the FieldTypeInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - - :returns: The created FieldTypeInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[FieldTypeInstance]: - """ - Streams FieldTypeInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[FieldTypeInstance]: - """ - Asynchronously streams FieldTypeInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldTypeInstance]: - """ - Lists FieldTypeInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldTypeInstance]: - """ - Asynchronously lists FieldTypeInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldTypePage: - """ - Retrieve a single page of FieldTypeInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of FieldTypeInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return FieldTypePage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldTypePage: - """ - Asynchronously retrieve a single page of FieldTypeInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of FieldTypeInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return FieldTypePage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> FieldTypePage: - """ - Retrieve a specific page of FieldTypeInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldTypeInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return FieldTypePage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> FieldTypePage: - """ - Asynchronously retrieve a specific page of FieldTypeInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldTypeInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return FieldTypePage(self._version, response, self._solution) - - def get(self, sid: str) -> FieldTypeContext: - """ - Constructs a FieldTypeContext - - :param sid: - """ - return FieldTypeContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> FieldTypeContext: - """ - Constructs a FieldTypeContext - - :param sid: - """ - return FieldTypeContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/field_type/field_value.py b/twilio/rest/preview/understand/assistant/field_type/field_value.py deleted file mode 100644 index 71bf01bf50..0000000000 --- a/twilio/rest/preview/understand/assistant/field_type/field_value.py +++ /dev/null @@ -1,579 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class FieldValueInstance(InstanceResource): - - """ - :ivar account_sid: The unique ID of the Account that created this Field Value. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar field_type_sid: The unique ID of the Field Type associated with this Field Value. - :ivar language: An ISO language-country string of the value. - :ivar assistant_sid: The unique ID of the Assistant. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar value: The Field Value itself. - :ivar url: - :ivar synonym_of: A value that indicates this field value is a synonym of. Empty if the value is not a synonym. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - field_type_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.field_type_sid: Optional[str] = payload.get("field_type_sid") - self.language: Optional[str] = payload.get("language") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.value: Optional[str] = payload.get("value") - self.url: Optional[str] = payload.get("url") - self.synonym_of: Optional[str] = payload.get("synonym_of") - - self._solution = { - "assistant_sid": assistant_sid, - "field_type_sid": field_type_sid, - "sid": sid or self.sid, - } - self._context: Optional[FieldValueContext] = None - - @property - def _proxy(self) -> "FieldValueContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FieldValueContext for this FieldValueInstance - """ - if self._context is None: - self._context = FieldValueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FieldValueInstance": - """ - Fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FieldValueInstance": - """ - Asynchronous coroutine to fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldValueContext(InstanceContext): - def __init__( - self, version: Version, assistant_sid: str, field_type_sid: str, sid: str - ): - """ - Initialize the FieldValueContext - - :param version: Version that contains the resource - :param assistant_sid: - :param field_type_sid: - :param sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "field_type_sid": field_type_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes/{field_type_sid}/FieldValues/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FieldValueInstance: - """ - Fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FieldValueInstance: - """ - Asynchronous coroutine to fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_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 FieldValuePage(Page): - def get_instance(self, payload: Dict[str, Any]) -> FieldValueInstance: - """ - Build an instance of FieldValueInstance - - :param payload: Payload response from the API - """ - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class FieldValueList(ListResource): - def __init__(self, version: Version, assistant_sid: str, field_type_sid: str): - """ - Initialize the FieldValueList - - :param version: Version that contains the resource - :param assistant_sid: - :param field_type_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "field_type_sid": field_type_sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes/{field_type_sid}/FieldValues".format( - **self._solution - ) - - def create( - self, language: str, value: str, synonym_of: Union[str, object] = values.unset - ) -> FieldValueInstance: - """ - Create the FieldValueInstance - - :param language: An ISO language-country string of the value. - :param value: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param synonym_of: A value that indicates this field value is a synonym of. Empty if the value is not a synonym. - - :returns: The created FieldValueInstance - """ - - data = values.of( - { - "Language": language, - "Value": value, - "SynonymOf": synonym_of, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - ) - - async def create_async( - self, language: str, value: str, synonym_of: Union[str, object] = values.unset - ) -> FieldValueInstance: - """ - Asynchronously create the FieldValueInstance - - :param language: An ISO language-country string of the value. - :param value: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param synonym_of: A value that indicates this field value is a synonym of. Empty if the value is not a synonym. - - :returns: The created FieldValueInstance - """ - - data = values.of( - { - "Language": language, - "Value": value, - "SynonymOf": synonym_of, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - ) - - def stream( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[FieldValueInstance]: - """ - Streams FieldValueInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: An ISO language-country string of the value. For example: *en-US* - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(language=language, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[FieldValueInstance]: - """ - Asynchronously streams FieldValueInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: An ISO language-country string of the value. For example: *en-US* - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(language=language, page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldValueInstance]: - """ - Lists FieldValueInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: An ISO language-country string of the value. For example: *en-US* - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - language=language, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldValueInstance]: - """ - Asynchronously lists FieldValueInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: An ISO language-country string of the value. For example: *en-US* - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - language=language, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldValuePage: - """ - Retrieve a single page of FieldValueInstance records from the API. - Request is executed immediately - - :param language: An ISO language-country string of the value. For example: *en-US* - :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 - - :returns: Page of FieldValueInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return FieldValuePage(self._version, response, self._solution) - - async def page_async( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldValuePage: - """ - Asynchronously retrieve a single page of FieldValueInstance records from the API. - Request is executed immediately - - :param language: An ISO language-country string of the value. For example: *en-US* - :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 - - :returns: Page of FieldValueInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return FieldValuePage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> FieldValuePage: - """ - Retrieve a specific page of FieldValueInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldValueInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return FieldValuePage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> FieldValuePage: - """ - Asynchronously retrieve a specific page of FieldValueInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldValueInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return FieldValuePage(self._version, response, self._solution) - - def get(self, sid: str) -> FieldValueContext: - """ - Constructs a FieldValueContext - - :param sid: - """ - return FieldValueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=sid, - ) - - def __call__(self, sid: str) -> FieldValueContext: - """ - Constructs a FieldValueContext - - :param sid: - """ - return FieldValueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/model_build.py b/twilio/rest/preview/understand/assistant/model_build.py deleted file mode 100644 index bc30ebdd29..0000000000 --- a/twilio/rest/preview/understand/assistant/model_build.py +++ /dev/null @@ -1,629 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class ModelBuildInstance(InstanceResource): - class Status(object): - ENQUEUED = "enqueued" - BUILDING = "building" - COMPLETED = "completed" - FAILED = "failed" - CANCELED = "canceled" - - """ - :ivar account_sid: The unique ID of the Account that created this Model Build. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar assistant_sid: The unique ID of the parent Assistant. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar status: - :ivar unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :ivar url: - :ivar build_duration: The time in seconds it took to build the model. - :ivar error_code: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.status: Optional["ModelBuildInstance.Status"] = payload.get("status") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - self.build_duration: Optional[int] = deserialize.integer( - payload.get("build_duration") - ) - self.error_code: Optional[int] = deserialize.integer(payload.get("error_code")) - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[ModelBuildContext] = None - - @property - def _proxy(self) -> "ModelBuildContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: ModelBuildContext for this ModelBuildInstance - """ - if self._context is None: - self._context = ModelBuildContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "ModelBuildInstance": - """ - Fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "ModelBuildInstance": - """ - Asynchronous coroutine to fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - return await self._proxy.fetch_async() - - def update( - self, unique_name: Union[str, object] = values.unset - ) -> "ModelBuildInstance": - """ - Update the ModelBuildInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - - :returns: The updated ModelBuildInstance - """ - return self._proxy.update( - unique_name=unique_name, - ) - - async def update_async( - self, unique_name: Union[str, object] = values.unset - ) -> "ModelBuildInstance": - """ - Asynchronous coroutine to update the ModelBuildInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - - :returns: The updated ModelBuildInstance - """ - return await self._proxy.update_async( - unique_name=unique_name, - ) - - 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 ModelBuildContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the ModelBuildContext - - :param version: Version that contains the resource - :param assistant_sid: - :param sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/ModelBuilds/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> ModelBuildInstance: - """ - Fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> ModelBuildInstance: - """ - Asynchronous coroutine to fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, unique_name: Union[str, object] = values.unset - ) -> ModelBuildInstance: - """ - Update the ModelBuildInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - - :returns: The updated ModelBuildInstance - """ - data = values.of( - { - "UniqueName": unique_name, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, unique_name: Union[str, object] = values.unset - ) -> ModelBuildInstance: - """ - Asynchronous coroutine to update the ModelBuildInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - - :returns: The updated ModelBuildInstance - """ - data = values.of( - { - "UniqueName": unique_name, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_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 ModelBuildPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> ModelBuildInstance: - """ - Build an instance of ModelBuildInstance - - :param payload: Payload response from the API - """ - return ModelBuildInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class ModelBuildList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the ModelBuildList - - :param version: Version that contains the resource - :param assistant_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/ModelBuilds".format(**self._solution) - - def create( - self, - status_callback: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> ModelBuildInstance: - """ - Create the ModelBuildInstance - - :param status_callback: - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - - :returns: The created ModelBuildInstance - """ - - data = values.of( - { - "StatusCallback": status_callback, - "UniqueName": unique_name, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, - status_callback: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> ModelBuildInstance: - """ - Asynchronously create the ModelBuildInstance - - :param status_callback: - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - - :returns: The created ModelBuildInstance - """ - - data = values.of( - { - "StatusCallback": status_callback, - "UniqueName": unique_name, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[ModelBuildInstance]: - """ - Streams ModelBuildInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[ModelBuildInstance]: - """ - Asynchronously streams ModelBuildInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[ModelBuildInstance]: - """ - Lists ModelBuildInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[ModelBuildInstance]: - """ - Asynchronously lists ModelBuildInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> ModelBuildPage: - """ - Retrieve a single page of ModelBuildInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of ModelBuildInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return ModelBuildPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> ModelBuildPage: - """ - Asynchronously retrieve a single page of ModelBuildInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of ModelBuildInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return ModelBuildPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> ModelBuildPage: - """ - Retrieve a specific page of ModelBuildInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of ModelBuildInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return ModelBuildPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> ModelBuildPage: - """ - Asynchronously retrieve a specific page of ModelBuildInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of ModelBuildInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return ModelBuildPage(self._version, response, self._solution) - - def get(self, sid: str) -> ModelBuildContext: - """ - Constructs a ModelBuildContext - - :param sid: - """ - return ModelBuildContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> ModelBuildContext: - """ - Constructs a ModelBuildContext - - :param sid: - """ - return ModelBuildContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/query.py b/twilio/rest/preview/understand/assistant/query.py deleted file mode 100644 index 116c425ffa..0000000000 --- a/twilio/rest/preview/understand/assistant/query.py +++ /dev/null @@ -1,717 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class QueryInstance(InstanceResource): - - """ - :ivar account_sid: The unique ID of the Account that created this Query. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar results: The natural language analysis results which include the Task recognized, the confidence score and a list of identified Fields. - :ivar language: An ISO language-country string of the sample. - :ivar model_build_sid: The unique ID of the Model Build queried. - :ivar query: The end-user's natural language input. - :ivar sample_sid: An optional reference to the Sample created from this query. - :ivar assistant_sid: The unique ID of the parent Assistant. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar status: A string that described the query status. The values can be: pending_review, reviewed, discarded - :ivar url: - :ivar source_channel: The communication channel where this end-user input came from - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.results: Optional[Dict[str, object]] = payload.get("results") - self.language: Optional[str] = payload.get("language") - self.model_build_sid: Optional[str] = payload.get("model_build_sid") - self.query: Optional[str] = payload.get("query") - self.sample_sid: Optional[str] = payload.get("sample_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.status: Optional[str] = payload.get("status") - self.url: Optional[str] = payload.get("url") - self.source_channel: Optional[str] = payload.get("source_channel") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[QueryContext] = None - - @property - def _proxy(self) -> "QueryContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: QueryContext for this QueryInstance - """ - if self._context is None: - self._context = QueryContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "QueryInstance": - """ - Fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "QueryInstance": - """ - Asynchronous coroutine to fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> "QueryInstance": - """ - Update the QueryInstance - - :param sample_sid: An optional reference to the Sample created from this query. - :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded - - :returns: The updated QueryInstance - """ - return self._proxy.update( - sample_sid=sample_sid, - status=status, - ) - - async def update_async( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> "QueryInstance": - """ - Asynchronous coroutine to update the QueryInstance - - :param sample_sid: An optional reference to the Sample created from this query. - :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded - - :returns: The updated QueryInstance - """ - return await self._proxy.update_async( - sample_sid=sample_sid, - 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 QueryContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the QueryContext - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the parent Assistant. - :param sid: A 34 character string that uniquely identifies this resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Queries/{sid}".format(**self._solution) - - def delete(self) -> bool: - """ - Deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> QueryInstance: - """ - Fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> QueryInstance: - """ - Asynchronous coroutine to fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Update the QueryInstance - - :param sample_sid: An optional reference to the Sample created from this query. - :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded - - :returns: The updated QueryInstance - """ - data = values.of( - { - "SampleSid": sample_sid, - "Status": status, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Asynchronous coroutine to update the QueryInstance - - :param sample_sid: An optional reference to the Sample created from this query. - :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded - - :returns: The updated QueryInstance - """ - data = values.of( - { - "SampleSid": sample_sid, - "Status": status, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_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 QueryPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> QueryInstance: - """ - Build an instance of QueryInstance - - :param payload: Payload response from the API - """ - return QueryInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class QueryList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the QueryList - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the parent Assistant. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/Queries".format(**self._solution) - - def create( - self, - language: str, - query: str, - tasks: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - field: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Create the QueryInstance - - :param language: An ISO language-country string of the sample. - :param query: A user-provided string that uniquely identifies this resource as an alternative to the sid. It can be up to 2048 characters long. - :param tasks: Constraints the query to a set of tasks. Useful when you need to constrain the paths the user can take. Tasks should be comma separated *task-unique-name-1*, *task-unique-name-2* - :param model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param field: Constraints the query to a given Field with an task. Useful when you know the Field you are expecting. It accepts one field in the format *task-unique-name-1*:*field-unique-name* - - :returns: The created QueryInstance - """ - - data = values.of( - { - "Language": language, - "Query": query, - "Tasks": tasks, - "ModelBuild": model_build, - "Field": field, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, - language: str, - query: str, - tasks: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - field: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Asynchronously create the QueryInstance - - :param language: An ISO language-country string of the sample. - :param query: A user-provided string that uniquely identifies this resource as an alternative to the sid. It can be up to 2048 characters long. - :param tasks: Constraints the query to a set of tasks. Useful when you need to constrain the paths the user can take. Tasks should be comma separated *task-unique-name-1*, *task-unique-name-2* - :param model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param field: Constraints the query to a given Field with an task. Useful when you know the Field you are expecting. It accepts one field in the format *task-unique-name-1*:*field-unique-name* - - :returns: The created QueryInstance - """ - - data = values.of( - { - "Language": language, - "Query": query, - "Tasks": tasks, - "ModelBuild": model_build, - "Field": field, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[QueryInstance]: - """ - Streams QueryInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: An ISO language-country string of the sample. - :param str model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param str status: A string that described the query status. The values can be: pending_review, reviewed, discarded - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page( - language=language, - model_build=model_build, - status=status, - page_size=limits["page_size"], - ) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[QueryInstance]: - """ - Asynchronously streams QueryInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: An ISO language-country string of the sample. - :param str model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param str status: A string that described the query status. The values can be: pending_review, reviewed, discarded - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async( - language=language, - model_build=model_build, - status=status, - page_size=limits["page_size"], - ) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[QueryInstance]: - """ - Lists QueryInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: An ISO language-country string of the sample. - :param str model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param str status: A string that described the query status. The values can be: pending_review, reviewed, discarded - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - language=language, - model_build=model_build, - status=status, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[QueryInstance]: - """ - Asynchronously lists QueryInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: An ISO language-country string of the sample. - :param str model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param str status: A string that described the query status. The values can be: pending_review, reviewed, discarded - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - language=language, - model_build=model_build, - status=status, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> QueryPage: - """ - Retrieve a single page of QueryInstance records from the API. - Request is executed immediately - - :param language: An ISO language-country string of the sample. - :param model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded - :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 - - :returns: Page of QueryInstance - """ - data = values.of( - { - "Language": language, - "ModelBuild": model_build, - "Status": status, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return QueryPage(self._version, response, self._solution) - - async def page_async( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> QueryPage: - """ - Asynchronously retrieve a single page of QueryInstance records from the API. - Request is executed immediately - - :param language: An ISO language-country string of the sample. - :param model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded - :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 - - :returns: Page of QueryInstance - """ - data = values.of( - { - "Language": language, - "ModelBuild": model_build, - "Status": status, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return QueryPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> QueryPage: - """ - Retrieve a specific page of QueryInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of QueryInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return QueryPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> QueryPage: - """ - Asynchronously retrieve a specific page of QueryInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of QueryInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return QueryPage(self._version, response, self._solution) - - def get(self, sid: str) -> QueryContext: - """ - Constructs a QueryContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return QueryContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> QueryContext: - """ - Constructs a QueryContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return QueryContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/style_sheet.py b/twilio/rest/preview/understand/assistant/style_sheet.py deleted file mode 100644 index 4571fc4cb1..0000000000 --- a/twilio/rest/preview/understand/assistant/style_sheet.py +++ /dev/null @@ -1,273 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from typing import Any, Dict, Optional, Union -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 -from twilio.base.version import Version - - -class StyleSheetInstance(InstanceResource): - - """ - :ivar account_sid: The unique ID of the Account that created this Assistant - :ivar assistant_sid: The unique ID of the Assistant - :ivar url: - :ivar data: The JSON style sheet object - """ - - def __init__(self, version: Version, payload: Dict[str, Any], assistant_sid: str): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.url: Optional[str] = payload.get("url") - self.data: Optional[Dict[str, object]] = payload.get("data") - - self._solution = { - "assistant_sid": assistant_sid, - } - self._context: Optional[StyleSheetContext] = None - - @property - def _proxy(self) -> "StyleSheetContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: StyleSheetContext for this StyleSheetInstance - """ - if self._context is None: - self._context = StyleSheetContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - ) - return self._context - - def fetch(self) -> "StyleSheetInstance": - """ - Fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "StyleSheetInstance": - """ - Asynchronous coroutine to fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - return await self._proxy.fetch_async() - - def update( - self, style_sheet: Union[object, object] = values.unset - ) -> "StyleSheetInstance": - """ - Update the StyleSheetInstance - - :param style_sheet: The JSON Style sheet string - - :returns: The updated StyleSheetInstance - """ - return self._proxy.update( - style_sheet=style_sheet, - ) - - async def update_async( - self, style_sheet: Union[object, object] = values.unset - ) -> "StyleSheetInstance": - """ - Asynchronous coroutine to update the StyleSheetInstance - - :param style_sheet: The JSON Style sheet string - - :returns: The updated StyleSheetInstance - """ - return await self._proxy.update_async( - style_sheet=style_sheet, - ) - - 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 StyleSheetContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the StyleSheetContext - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/StyleSheet".format(**self._solution) - - def fetch(self) -> StyleSheetInstance: - """ - Fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return StyleSheetInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - async def fetch_async(self) -> StyleSheetInstance: - """ - Asynchronous coroutine to fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return StyleSheetInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - def update( - self, style_sheet: Union[object, object] = values.unset - ) -> StyleSheetInstance: - """ - Update the StyleSheetInstance - - :param style_sheet: The JSON Style sheet string - - :returns: The updated StyleSheetInstance - """ - data = values.of( - { - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return StyleSheetInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def update_async( - self, style_sheet: Union[object, object] = values.unset - ) -> StyleSheetInstance: - """ - Asynchronous coroutine to update the StyleSheetInstance - - :param style_sheet: The JSON Style sheet string - - :returns: The updated StyleSheetInstance - """ - data = values.of( - { - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return StyleSheetInstance( - self._version, payload, assistant_sid=self._solution["assistant_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 StyleSheetList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the StyleSheetList - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - - def get(self) -> StyleSheetContext: - """ - Constructs a StyleSheetContext - - """ - return StyleSheetContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __call__(self) -> StyleSheetContext: - """ - Constructs a StyleSheetContext - - """ - return StyleSheetContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/task/__init__.py b/twilio/rest/preview/understand/assistant/task/__init__.py deleted file mode 100644 index 26fa1f74ec..0000000000 --- a/twilio/rest/preview/understand/assistant/task/__init__.py +++ /dev/null @@ -1,762 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -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 -from twilio.base.page import Page -from twilio.rest.preview.understand.assistant.task.field import FieldList -from twilio.rest.preview.understand.assistant.task.sample import SampleList -from twilio.rest.preview.understand.assistant.task.task_actions import TaskActionsList -from twilio.rest.preview.understand.assistant.task.task_statistics import ( - TaskStatisticsList, -) - - -class TaskInstance(InstanceResource): - - """ - :ivar account_sid: The unique ID of the Account that created this Task. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :ivar links: - :ivar assistant_sid: The unique ID of the Assistant. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :ivar actions_url: User-provided HTTP endpoint where from the assistant fetches actions - :ivar url: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.links: Optional[Dict[str, object]] = payload.get("links") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.actions_url: Optional[str] = payload.get("actions_url") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[TaskContext] = None - - @property - def _proxy(self) -> "TaskContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: TaskContext for this TaskInstance - """ - if self._context is None: - self._context = TaskContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "TaskInstance": - """ - Fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "TaskInstance": - """ - Asynchronous coroutine to fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> "TaskInstance": - """ - Update the TaskInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param actions: A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - :param actions_url: User-provided HTTP endpoint where from the assistant fetches actions - - :returns: The updated TaskInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - unique_name=unique_name, - actions=actions, - actions_url=actions_url, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> "TaskInstance": - """ - Asynchronous coroutine to update the TaskInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param actions: A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - :param actions_url: User-provided HTTP endpoint where from the assistant fetches actions - - :returns: The updated TaskInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - unique_name=unique_name, - actions=actions, - actions_url=actions_url, - ) - - @property - def fields(self) -> FieldList: - """ - Access the fields - """ - return self._proxy.fields - - @property - def samples(self) -> SampleList: - """ - Access the samples - """ - return self._proxy.samples - - @property - def task_actions(self) -> TaskActionsList: - """ - Access the task_actions - """ - return self._proxy.task_actions - - @property - def statistics(self) -> TaskStatisticsList: - """ - Access the statistics - """ - return self._proxy.statistics - - 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 TaskContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the TaskContext - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant. - :param sid: A 34 character string that uniquely identifies this resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{sid}".format(**self._solution) - - self._fields: Optional[FieldList] = None - self._samples: Optional[SampleList] = None - self._task_actions: Optional[TaskActionsList] = None - self._statistics: Optional[TaskStatisticsList] = None - - def delete(self) -> bool: - """ - Deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> TaskInstance: - """ - Fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> TaskInstance: - """ - Asynchronous coroutine to fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Update the TaskInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param actions: A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - :param actions_url: User-provided HTTP endpoint where from the assistant fetches actions - - :returns: The updated TaskInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Asynchronous coroutine to update the TaskInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param actions: A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - :param actions_url: User-provided HTTP endpoint where from the assistant fetches actions - - :returns: The updated TaskInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - @property - def fields(self) -> FieldList: - """ - Access the fields - """ - if self._fields is None: - self._fields = FieldList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._fields - - @property - def samples(self) -> SampleList: - """ - Access the samples - """ - if self._samples is None: - self._samples = SampleList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._samples - - @property - def task_actions(self) -> TaskActionsList: - """ - Access the task_actions - """ - if self._task_actions is None: - self._task_actions = TaskActionsList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._task_actions - - @property - def statistics(self) -> TaskStatisticsList: - """ - Access the statistics - """ - if self._statistics is None: - self._statistics = TaskStatisticsList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._statistics - - 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 TaskPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> TaskInstance: - """ - Build an instance of TaskInstance - - :param payload: Payload response from the API - """ - return TaskInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class TaskList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the TaskList - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks".format(**self._solution) - - def create( - self, - unique_name: str, - friendly_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Create the TaskInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param actions: A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - :param actions_url: User-provided HTTP endpoint where from the assistant fetches actions - - :returns: The created TaskInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, - unique_name: str, - friendly_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Asynchronously create the TaskInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param actions: A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - :param actions_url: User-provided HTTP endpoint where from the assistant fetches actions - - :returns: The created TaskInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[TaskInstance]: - """ - Streams TaskInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[TaskInstance]: - """ - Asynchronously streams TaskInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[TaskInstance]: - """ - Lists TaskInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[TaskInstance]: - """ - Asynchronously lists TaskInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> TaskPage: - """ - Retrieve a single page of TaskInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of TaskInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return TaskPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> TaskPage: - """ - Asynchronously retrieve a single page of TaskInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of TaskInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return TaskPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> TaskPage: - """ - Retrieve a specific page of TaskInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of TaskInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return TaskPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> TaskPage: - """ - Asynchronously retrieve a specific page of TaskInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of TaskInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return TaskPage(self._version, response, self._solution) - - def get(self, sid: str) -> TaskContext: - """ - Constructs a TaskContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return TaskContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> TaskContext: - """ - Constructs a TaskContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return TaskContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/task/field.py b/twilio/rest/preview/understand/assistant/task/field.py deleted file mode 100644 index c1f97b6175..0000000000 --- a/twilio/rest/preview/understand/assistant/task/field.py +++ /dev/null @@ -1,551 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class FieldInstance(InstanceResource): - - """ - :ivar account_sid: The unique ID of the Account that created this Field. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar field_type: The Field Type of this field. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or sid of a custom Field Type. - :ivar task_sid: The unique ID of the Task associated with this Field. - :ivar assistant_sid: The unique ID of the parent Assistant. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :ivar url: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.field_type: Optional[str] = payload.get("field_type") - self.task_sid: Optional[str] = payload.get("task_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid or self.sid, - } - self._context: Optional[FieldContext] = None - - @property - def _proxy(self) -> "FieldContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FieldContext for this FieldInstance - """ - if self._context is None: - self._context = FieldContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FieldInstance": - """ - Fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FieldInstance": - """ - Asynchronous coroutine to fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str, sid: str): - """ - Initialize the FieldContext - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant. - :param task_sid: The unique ID of the Task associated with this Field. - :param sid: A 34 character string that uniquely identifies this resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Fields/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FieldInstance: - """ - Fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FieldInstance: - """ - Asynchronous coroutine to fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_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 FieldPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> FieldInstance: - """ - Build an instance of FieldInstance - - :param payload: Payload response from the API - """ - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class FieldList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the FieldList - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant. - :param task_sid: The unique ID of the Task associated with this Field. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Fields".format( - **self._solution - ) - - def create(self, field_type: str, unique_name: str) -> FieldInstance: - """ - Create the FieldInstance - - :param field_type: The unique name or sid of the FieldType. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or the Field Type sid of a custom Field Type. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - - :returns: The created FieldInstance - """ - - data = values.of( - { - "FieldType": field_type, - "UniqueName": unique_name, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def create_async(self, field_type: str, unique_name: str) -> FieldInstance: - """ - Asynchronously create the FieldInstance - - :param field_type: The unique name or sid of the FieldType. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or the Field Type sid of a custom Field Type. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - - :returns: The created FieldInstance - """ - - data = values.of( - { - "FieldType": field_type, - "UniqueName": unique_name, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[FieldInstance]: - """ - Streams FieldInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[FieldInstance]: - """ - Asynchronously streams FieldInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldInstance]: - """ - Lists FieldInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldInstance]: - """ - Asynchronously lists FieldInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldPage: - """ - Retrieve a single page of FieldInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of FieldInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return FieldPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldPage: - """ - Asynchronously retrieve a single page of FieldInstance records from the API. - Request is executed immediately - - :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 - - :returns: Page of FieldInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return FieldPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> FieldPage: - """ - Retrieve a specific page of FieldInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return FieldPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> FieldPage: - """ - Asynchronously retrieve a specific page of FieldInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return FieldPage(self._version, response, self._solution) - - def get(self, sid: str) -> FieldContext: - """ - Constructs a FieldContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return FieldContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __call__(self, sid: str) -> FieldContext: - """ - Constructs a FieldContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return FieldContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/task/sample.py b/twilio/rest/preview/understand/assistant/task/sample.py deleted file mode 100644 index ba8addfaa2..0000000000 --- a/twilio/rest/preview/understand/assistant/task/sample.py +++ /dev/null @@ -1,699 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class SampleInstance(InstanceResource): - - """ - :ivar account_sid: The unique ID of the Account that created this Sample. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar task_sid: The unique ID of the Task associated with this Sample. - :ivar language: An ISO language-country string of the sample. - :ivar assistant_sid: The unique ID of the Assistant. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. - :ivar url: - :ivar source_channel: The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.task_sid: Optional[str] = payload.get("task_sid") - self.language: Optional[str] = payload.get("language") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.tagged_text: Optional[str] = payload.get("tagged_text") - self.url: Optional[str] = payload.get("url") - self.source_channel: Optional[str] = payload.get("source_channel") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid or self.sid, - } - self._context: Optional[SampleContext] = None - - @property - def _proxy(self) -> "SampleContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: SampleContext for this SampleInstance - """ - if self._context is None: - self._context = SampleContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "SampleInstance": - """ - Fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "SampleInstance": - """ - Asynchronous coroutine to fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> "SampleInstance": - """ - Update the SampleInstance - - :param language: An ISO language-country string of the sample. - :param tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. - :param source_channel: The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - - :returns: The updated SampleInstance - """ - return self._proxy.update( - language=language, - tagged_text=tagged_text, - source_channel=source_channel, - ) - - async def update_async( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> "SampleInstance": - """ - Asynchronous coroutine to update the SampleInstance - - :param language: An ISO language-country string of the sample. - :param tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. - :param source_channel: The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - - :returns: The updated SampleInstance - """ - return await self._proxy.update_async( - language=language, - tagged_text=tagged_text, - source_channel=source_channel, - ) - - 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 SampleContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str, sid: str): - """ - Initialize the SampleContext - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant. - :param task_sid: The unique ID of the Task associated with this Sample. - :param sid: A 34 character string that uniquely identifies this resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Samples/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> SampleInstance: - """ - Fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> SampleInstance: - """ - Asynchronous coroutine to fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Update the SampleInstance - - :param language: An ISO language-country string of the sample. - :param tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. - :param source_channel: The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - - :returns: The updated SampleInstance - """ - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Asynchronous coroutine to update the SampleInstance - - :param language: An ISO language-country string of the sample. - :param tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. - :param source_channel: The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - - :returns: The updated SampleInstance - """ - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_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 SamplePage(Page): - def get_instance(self, payload: Dict[str, Any]) -> SampleInstance: - """ - Build an instance of SampleInstance - - :param payload: Payload response from the API - """ - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class SampleList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the SampleList - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant. - :param task_sid: The unique ID of the Task associated with this Sample. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Samples".format( - **self._solution - ) - - def create( - self, - language: str, - tagged_text: str, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Create the SampleInstance - - :param language: An ISO language-country string of the sample. - :param tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. - :param source_channel: The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - - :returns: The created SampleInstance - """ - - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def create_async( - self, - language: str, - tagged_text: str, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Asynchronously create the SampleInstance - - :param language: An ISO language-country string of the sample. - :param tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. - :param source_channel: The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - - :returns: The created SampleInstance - """ - - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def stream( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[SampleInstance]: - """ - Streams SampleInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: An ISO language-country string of the sample. - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(language=language, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[SampleInstance]: - """ - Asynchronously streams SampleInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: An ISO language-country string of the sample. - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(language=language, page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SampleInstance]: - """ - Lists SampleInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: An ISO language-country string of the sample. - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - language=language, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SampleInstance]: - """ - Asynchronously lists SampleInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: An ISO language-country string of the sample. - :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 - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - language=language, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SamplePage: - """ - Retrieve a single page of SampleInstance records from the API. - Request is executed immediately - - :param language: An ISO language-country string of the sample. - :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 - - :returns: Page of SampleInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return SamplePage(self._version, response, self._solution) - - async def page_async( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SamplePage: - """ - Asynchronously retrieve a single page of SampleInstance records from the API. - Request is executed immediately - - :param language: An ISO language-country string of the sample. - :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 - - :returns: Page of SampleInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return SamplePage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> SamplePage: - """ - Retrieve a specific page of SampleInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SampleInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return SamplePage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> SamplePage: - """ - Asynchronously retrieve a specific page of SampleInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SampleInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return SamplePage(self._version, response, self._solution) - - def get(self, sid: str) -> SampleContext: - """ - Constructs a SampleContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return SampleContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __call__(self, sid: str) -> SampleContext: - """ - Constructs a SampleContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return SampleContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/task/task_actions.py b/twilio/rest/preview/understand/assistant/task/task_actions.py deleted file mode 100644 index 41366bbb96..0000000000 --- a/twilio/rest/preview/understand/assistant/task/task_actions.py +++ /dev/null @@ -1,301 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from typing import Any, Dict, Optional, Union -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 -from twilio.base.version import Version - - -class TaskActionsInstance(InstanceResource): - - """ - :ivar account_sid: The unique ID of the Account that created this Field. - :ivar assistant_sid: The unique ID of the parent Assistant. - :ivar task_sid: The unique ID of the Task. - :ivar url: - :ivar data: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.task_sid: Optional[str] = payload.get("task_sid") - self.url: Optional[str] = payload.get("url") - self.data: Optional[Dict[str, object]] = payload.get("data") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._context: Optional[TaskActionsContext] = None - - @property - def _proxy(self) -> "TaskActionsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: TaskActionsContext for this TaskActionsInstance - """ - if self._context is None: - self._context = TaskActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - return self._context - - def fetch(self) -> "TaskActionsInstance": - """ - Fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "TaskActionsInstance": - """ - Asynchronous coroutine to fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - return await self._proxy.fetch_async() - - def update( - self, actions: Union[object, object] = values.unset - ) -> "TaskActionsInstance": - """ - Update the TaskActionsInstance - - :param actions: The JSON actions that instruct the Assistant how to perform this task. - - :returns: The updated TaskActionsInstance - """ - return self._proxy.update( - actions=actions, - ) - - async def update_async( - self, actions: Union[object, object] = values.unset - ) -> "TaskActionsInstance": - """ - Asynchronous coroutine to update the TaskActionsInstance - - :param actions: The JSON actions that instruct the Assistant how to perform this task. - - :returns: The updated TaskActionsInstance - """ - return await self._proxy.update_async( - actions=actions, - ) - - 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 TaskActionsContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskActionsContext - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the parent Assistant. - :param task_sid: The unique ID of the Task. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Actions".format( - **self._solution - ) - - def fetch(self) -> TaskActionsInstance: - """ - Fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def fetch_async(self) -> TaskActionsInstance: - """ - Asynchronous coroutine to fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def update( - self, actions: Union[object, object] = values.unset - ) -> TaskActionsInstance: - """ - Update the TaskActionsInstance - - :param actions: The JSON actions that instruct the Assistant how to perform this task. - - :returns: The updated TaskActionsInstance - """ - data = values.of( - { - "Actions": serialize.object(actions), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def update_async( - self, actions: Union[object, object] = values.unset - ) -> TaskActionsInstance: - """ - Asynchronous coroutine to update the TaskActionsInstance - - :param actions: The JSON actions that instruct the Assistant how to perform this task. - - :returns: The updated TaskActionsInstance - """ - data = values.of( - { - "Actions": serialize.object(actions), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_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 TaskActionsList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskActionsList - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the parent Assistant. - :param task_sid: The unique ID of the Task. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - - def get(self) -> TaskActionsContext: - """ - Constructs a TaskActionsContext - - """ - return TaskActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __call__(self) -> TaskActionsContext: - """ - Constructs a TaskActionsContext - - """ - return TaskActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/task/task_statistics.py b/twilio/rest/preview/understand/assistant/task/task_statistics.py deleted file mode 100644 index 07375954c7..0000000000 --- a/twilio/rest/preview/understand/assistant/task/task_statistics.py +++ /dev/null @@ -1,221 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - - -from typing import Any, Dict, Optional -from twilio.base import deserialize -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class TaskStatisticsInstance(InstanceResource): - - """ - :ivar account_sid: The unique ID of the Account that created this Field. - :ivar assistant_sid: The unique ID of the parent Assistant. - :ivar task_sid: The unique ID of the Task associated with this Field. - :ivar samples_count: The total number of Samples associated with this Task. - :ivar fields_count: The total number of Fields associated with this Task. - :ivar url: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.task_sid: Optional[str] = payload.get("task_sid") - self.samples_count: Optional[int] = deserialize.integer( - payload.get("samples_count") - ) - self.fields_count: Optional[int] = deserialize.integer( - payload.get("fields_count") - ) - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._context: Optional[TaskStatisticsContext] = None - - @property - def _proxy(self) -> "TaskStatisticsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: TaskStatisticsContext for this TaskStatisticsInstance - """ - if self._context is None: - self._context = TaskStatisticsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - return self._context - - def fetch(self) -> "TaskStatisticsInstance": - """ - Fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "TaskStatisticsInstance": - """ - Asynchronous coroutine to fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class TaskStatisticsContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskStatisticsContext - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the parent Assistant. - :param task_sid: The unique ID of the Task associated with this Field. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Statistics".format( - **self._solution - ) - - def fetch(self) -> TaskStatisticsInstance: - """ - Fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return TaskStatisticsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def fetch_async(self) -> TaskStatisticsInstance: - """ - Asynchronous coroutine to fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return TaskStatisticsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_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 TaskStatisticsList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskStatisticsList - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the parent Assistant. - :param task_sid: The unique ID of the Task associated with this Field. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - - def get(self) -> TaskStatisticsContext: - """ - Constructs a TaskStatisticsContext - - """ - return TaskStatisticsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __call__(self) -> TaskStatisticsContext: - """ - Constructs a TaskStatisticsContext - - """ - return TaskStatisticsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/wireless/__init__.py b/twilio/rest/preview/wireless/__init__.py index 24f2ea0f0d..85ed4fb54d 100644 --- a/twilio/rest/preview/wireless/__init__.py +++ b/twilio/rest/preview/wireless/__init__.py @@ -21,6 +21,7 @@ class Wireless(Version): + def __init__(self, domain: Domain): """ Initialize the Wireless version of Preview diff --git a/twilio/rest/preview/wireless/command.py b/twilio/rest/preview/wireless/command.py index b8cc4d6a02..755256bb6b 100644 --- a/twilio/rest/preview/wireless/command.py +++ b/twilio/rest/preview/wireless/command.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class CommandInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: @@ -109,6 +107,7 @@ def __repr__(self) -> str: class CommandContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CommandContext @@ -173,6 +172,7 @@ def __repr__(self) -> str: class CommandPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CommandInstance: """ Build an instance of CommandInstance @@ -191,6 +191,7 @@ def __repr__(self) -> str: class CommandList(ListResource): + def __init__(self, version: Version): """ Initialize the CommandList diff --git a/twilio/rest/preview/wireless/rate_plan.py b/twilio/rest/preview/wireless/rate_plan.py index 08ace21fb0..abd9cbecc2 100644 --- a/twilio/rest/preview/wireless/rate_plan.py +++ b/twilio/rest/preview/wireless/rate_plan.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class RatePlanInstance(InstanceResource): - """ :ivar sid: :ivar unique_name: @@ -173,6 +171,7 @@ def __repr__(self) -> str: class RatePlanContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the RatePlanContext @@ -317,6 +316,7 @@ def __repr__(self) -> str: class RatePlanPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RatePlanInstance: """ Build an instance of RatePlanInstance @@ -335,6 +335,7 @@ def __repr__(self) -> str: class RatePlanList(ListResource): + def __init__(self, version: Version): """ Initialize the RatePlanList diff --git a/twilio/rest/preview/wireless/sim/__init__.py b/twilio/rest/preview/wireless/sim/__init__.py index 3a5dd7e770..8620c03ba2 100644 --- a/twilio/rest/preview/wireless/sim/__init__.py +++ b/twilio/rest/preview/wireless/sim/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class SimInstance(InstanceResource): - """ :ivar sid: :ivar unique_name: @@ -261,6 +259,7 @@ def __repr__(self) -> str: class SimContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SimContext @@ -479,6 +478,7 @@ def __repr__(self) -> str: class SimPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SimInstance: """ Build an instance of SimInstance @@ -497,6 +497,7 @@ def __repr__(self) -> str: class SimList(ListResource): + def __init__(self, version: Version): """ Initialize the SimList diff --git a/twilio/rest/preview/wireless/sim/usage.py b/twilio/rest/preview/wireless/sim/usage.py index de1ca5a035..d90b5f9e84 100644 --- a/twilio/rest/preview/wireless/sim/usage.py +++ b/twilio/rest/preview/wireless/sim/usage.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class UsageInstance(InstanceResource): - """ :ivar sim_sid: :ivar sim_unique_name: @@ -115,6 +113,7 @@ def __repr__(self) -> str: class UsageContext(InstanceContext): + def __init__(self, version: Version, sim_sid: str): """ Initialize the UsageContext @@ -201,6 +200,7 @@ def __repr__(self) -> str: class UsageList(ListResource): + def __init__(self, version: Version, sim_sid: str): """ Initialize the UsageList diff --git a/twilio/rest/preview_messaging/PreviewMessagingBase.py b/twilio/rest/preview_messaging/PreviewMessagingBase.py index 1bd182d820..12b19f4cf1 100644 --- a/twilio/rest/preview_messaging/PreviewMessagingBase.py +++ b/twilio/rest/preview_messaging/PreviewMessagingBase.py @@ -17,6 +17,7 @@ class PreviewMessagingBase(Domain): + def __init__(self, twilio: Client): """ Initialize the PreviewMessaging Domain diff --git a/twilio/rest/preview_messaging/v1/__init__.py b/twilio/rest/preview_messaging/v1/__init__.py index 0e1e182d49..424af648e8 100644 --- a/twilio/rest/preview_messaging/v1/__init__.py +++ b/twilio/rest/preview_messaging/v1/__init__.py @@ -20,6 +20,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of PreviewMessaging diff --git a/twilio/rest/preview_messaging/v1/broadcast.py b/twilio/rest/preview_messaging/v1/broadcast.py index 3c8e1819d6..e41e066bad 100644 --- a/twilio/rest/preview_messaging/v1/broadcast.py +++ b/twilio/rest/preview_messaging/v1/broadcast.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class BroadcastInstance(InstanceResource): - """ :ivar broadcast_sid: Numeric ID indentifying individual Broadcast requests :ivar created_date: Timestamp of when the Broadcast was created @@ -58,6 +56,7 @@ def __repr__(self) -> str: class BroadcastList(ListResource): + def __init__(self, version: Version): """ Initialize the BroadcastList diff --git a/twilio/rest/preview_messaging/v1/message.py b/twilio/rest/preview_messaging/v1/message.py index 2cce21f8e9..c6212c7f4f 100644 --- a/twilio/rest/preview_messaging/v1/message.py +++ b/twilio/rest/preview_messaging/v1/message.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional from twilio.base import deserialize @@ -22,7 +21,6 @@ class MessageInstance(InstanceResource): - """ :ivar total_message_count: The number of Messages processed in the request, equal to the sum of success_count and error_count. :ivar success_count: The number of Messages successfully created. @@ -59,6 +57,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + class CreateMessagesRequest(object): """ :ivar messages: @@ -81,6 +80,7 @@ class CreateMessagesRequest(object): """ def __init__(self, payload: Dict[str, Any]): + self.messages: Optional[List[MessageList.MessagingV1Message]] = payload.get( "messages" ) @@ -132,6 +132,7 @@ class MessagingV1Message(object): """ def __init__(self, payload: Dict[str, Any]): + self.to: Optional[str] = payload.get("to") self.body: Optional[str] = payload.get("body") self.content_variables: Optional[dict[str, str]] = payload.get( diff --git a/twilio/rest/pricing/PricingBase.py b/twilio/rest/pricing/PricingBase.py index 35028ee350..cf624e1867 100644 --- a/twilio/rest/pricing/PricingBase.py +++ b/twilio/rest/pricing/PricingBase.py @@ -18,6 +18,7 @@ class PricingBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Pricing Domain diff --git a/twilio/rest/pricing/v1/__init__.py b/twilio/rest/pricing/v1/__init__.py index 2227d163d4..ba8b65885d 100644 --- a/twilio/rest/pricing/v1/__init__.py +++ b/twilio/rest/pricing/v1/__init__.py @@ -21,6 +21,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Pricing diff --git a/twilio/rest/pricing/v1/messaging/__init__.py b/twilio/rest/pricing/v1/messaging/__init__.py index 32230c7135..df5c148b81 100644 --- a/twilio/rest/pricing/v1/messaging/__init__.py +++ b/twilio/rest/pricing/v1/messaging/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional @@ -23,6 +22,7 @@ class MessagingList(ListResource): + def __init__(self, version: Version): """ Initialize the MessagingList diff --git a/twilio/rest/pricing/v1/messaging/country.py b/twilio/rest/pricing/v1/messaging/country.py index fba539fc68..47f5707ce8 100644 --- a/twilio/rest/pricing/v1/messaging/country.py +++ b/twilio/rest/pricing/v1/messaging/country.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class CountryInstance(InstanceResource): - """ :ivar country: The name of the country. :ivar iso_country: The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). @@ -99,6 +97,7 @@ def __repr__(self) -> str: class CountryContext(InstanceContext): + def __init__(self, version: Version, iso_country: str): """ Initialize the CountryContext @@ -163,6 +162,7 @@ def __repr__(self) -> str: class CountryPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CountryInstance: """ Build an instance of CountryInstance @@ -181,6 +181,7 @@ def __repr__(self) -> str: class CountryList(ListResource): + def __init__(self, version: Version): """ Initialize the CountryList diff --git a/twilio/rest/pricing/v1/phone_number/__init__.py b/twilio/rest/pricing/v1/phone_number/__init__.py index b3cfbe50e4..429ce9b14c 100644 --- a/twilio/rest/pricing/v1/phone_number/__init__.py +++ b/twilio/rest/pricing/v1/phone_number/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional @@ -23,6 +22,7 @@ class PhoneNumberList(ListResource): + def __init__(self, version: Version): """ Initialize the PhoneNumberList diff --git a/twilio/rest/pricing/v1/phone_number/country.py b/twilio/rest/pricing/v1/phone_number/country.py index 30a0eeb475..b0822fff23 100644 --- a/twilio/rest/pricing/v1/phone_number/country.py +++ b/twilio/rest/pricing/v1/phone_number/country.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class CountryInstance(InstanceResource): - """ :ivar country: The name of the country. :ivar iso_country: The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). @@ -97,6 +95,7 @@ def __repr__(self) -> str: class CountryContext(InstanceContext): + def __init__(self, version: Version, iso_country: str): """ Initialize the CountryContext @@ -161,6 +160,7 @@ def __repr__(self) -> str: class CountryPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CountryInstance: """ Build an instance of CountryInstance @@ -179,6 +179,7 @@ def __repr__(self) -> str: class CountryList(ListResource): + def __init__(self, version: Version): """ Initialize the CountryList diff --git a/twilio/rest/pricing/v1/voice/__init__.py b/twilio/rest/pricing/v1/voice/__init__.py index 4d91f382c9..a801a30089 100644 --- a/twilio/rest/pricing/v1/voice/__init__.py +++ b/twilio/rest/pricing/v1/voice/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional @@ -24,6 +23,7 @@ class VoiceList(ListResource): + def __init__(self, version: Version): """ Initialize the VoiceList diff --git a/twilio/rest/pricing/v1/voice/country.py b/twilio/rest/pricing/v1/voice/country.py index c65df83f41..e3b1496de4 100644 --- a/twilio/rest/pricing/v1/voice/country.py +++ b/twilio/rest/pricing/v1/voice/country.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class CountryInstance(InstanceResource): - """ :ivar country: The name of the country. :ivar iso_country: The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). @@ -101,6 +99,7 @@ def __repr__(self) -> str: class CountryContext(InstanceContext): + def __init__(self, version: Version, iso_country: str): """ Initialize the CountryContext @@ -165,6 +164,7 @@ def __repr__(self) -> str: class CountryPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CountryInstance: """ Build an instance of CountryInstance @@ -183,6 +183,7 @@ def __repr__(self) -> str: class CountryList(ListResource): + def __init__(self, version: Version): """ Initialize the CountryList diff --git a/twilio/rest/pricing/v1/voice/number.py b/twilio/rest/pricing/v1/voice/number.py index dfdf4b63f8..910919707e 100644 --- a/twilio/rest/pricing/v1/voice/number.py +++ b/twilio/rest/pricing/v1/voice/number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class NumberInstance(InstanceResource): - """ :ivar number: The phone number. :ivar country: The name of the country. @@ -94,6 +92,7 @@ def __repr__(self) -> str: class NumberContext(InstanceContext): + def __init__(self, version: Version, number: str): """ Initialize the NumberContext @@ -158,6 +157,7 @@ def __repr__(self) -> str: class NumberList(ListResource): + def __init__(self, version: Version): """ Initialize the NumberList diff --git a/twilio/rest/pricing/v2/__init__.py b/twilio/rest/pricing/v2/__init__.py index f034595cb2..d0fd67f737 100644 --- a/twilio/rest/pricing/v2/__init__.py +++ b/twilio/rest/pricing/v2/__init__.py @@ -21,6 +21,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Pricing diff --git a/twilio/rest/pricing/v2/country.py b/twilio/rest/pricing/v2/country.py index 6842359b88..a058c071b5 100644 --- a/twilio/rest/pricing/v2/country.py +++ b/twilio/rest/pricing/v2/country.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class CountryInstance(InstanceResource): - """ :ivar country: The name of the country. :ivar iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). @@ -101,6 +99,7 @@ def __repr__(self) -> str: class CountryContext(InstanceContext): + def __init__(self, version: Version, iso_country: str): """ Initialize the CountryContext @@ -165,6 +164,7 @@ def __repr__(self) -> str: class CountryPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CountryInstance: """ Build an instance of CountryInstance @@ -183,6 +183,7 @@ def __repr__(self) -> str: class CountryList(ListResource): + def __init__(self, version: Version): """ Initialize the CountryList diff --git a/twilio/rest/pricing/v2/number.py b/twilio/rest/pricing/v2/number.py index 39d8eb4783..6c4cd9fe9d 100644 --- a/twilio/rest/pricing/v2/number.py +++ b/twilio/rest/pricing/v2/number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class NumberInstance(InstanceResource): - """ :ivar destination_number: The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. :ivar origination_number: The origination phone number in [[E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. @@ -114,6 +112,7 @@ def __repr__(self) -> str: class NumberContext(InstanceContext): + def __init__(self, version: Version, destination_number: str): """ Initialize the NumberContext @@ -192,6 +191,7 @@ def __repr__(self) -> str: class NumberList(ListResource): + def __init__(self, version: Version): """ Initialize the NumberList diff --git a/twilio/rest/pricing/v2/voice/__init__.py b/twilio/rest/pricing/v2/voice/__init__.py index 6539469636..1ebbcbb644 100644 --- a/twilio/rest/pricing/v2/voice/__init__.py +++ b/twilio/rest/pricing/v2/voice/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional @@ -24,6 +23,7 @@ class VoiceList(ListResource): + def __init__(self, version: Version): """ Initialize the VoiceList diff --git a/twilio/rest/pricing/v2/voice/country.py b/twilio/rest/pricing/v2/voice/country.py index a06ed0a762..4a84bbd734 100644 --- a/twilio/rest/pricing/v2/voice/country.py +++ b/twilio/rest/pricing/v2/voice/country.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class CountryInstance(InstanceResource): - """ :ivar country: The name of the country. :ivar iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). @@ -101,6 +99,7 @@ def __repr__(self) -> str: class CountryContext(InstanceContext): + def __init__(self, version: Version, iso_country: str): """ Initialize the CountryContext @@ -165,6 +164,7 @@ def __repr__(self) -> str: class CountryPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CountryInstance: """ Build an instance of CountryInstance @@ -183,6 +183,7 @@ def __repr__(self) -> str: class CountryList(ListResource): + def __init__(self, version: Version): """ Initialize the CountryList diff --git a/twilio/rest/pricing/v2/voice/number.py b/twilio/rest/pricing/v2/voice/number.py index 6d4f1bddb3..6dd8764821 100644 --- a/twilio/rest/pricing/v2/voice/number.py +++ b/twilio/rest/pricing/v2/voice/number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class NumberInstance(InstanceResource): - """ :ivar destination_number: The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. :ivar origination_number: The origination phone number in [[E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. @@ -112,6 +110,7 @@ def __repr__(self) -> str: class NumberContext(InstanceContext): + def __init__(self, version: Version, destination_number: str): """ Initialize the NumberContext @@ -190,6 +189,7 @@ def __repr__(self) -> str: class NumberList(ListResource): + def __init__(self, version: Version): """ Initialize the NumberList diff --git a/twilio/rest/proxy/ProxyBase.py b/twilio/rest/proxy/ProxyBase.py index b4d4d0e84d..da1baec178 100644 --- a/twilio/rest/proxy/ProxyBase.py +++ b/twilio/rest/proxy/ProxyBase.py @@ -17,6 +17,7 @@ class ProxyBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Proxy Domain diff --git a/twilio/rest/proxy/v1/__init__.py b/twilio/rest/proxy/v1/__init__.py index 87a58d3ff2..83737dc0fb 100644 --- a/twilio/rest/proxy/v1/__init__.py +++ b/twilio/rest/proxy/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Proxy diff --git a/twilio/rest/proxy/v1/service/__init__.py b/twilio/rest/proxy/v1/service/__init__.py index 0cd90e817e..6be2def24c 100644 --- a/twilio/rest/proxy/v1/service/__init__.py +++ b/twilio/rest/proxy/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,6 +26,7 @@ class ServiceInstance(InstanceResource): + class GeoMatchLevel(object): AREA_CODE = "area-code" OVERLAY = "overlay" @@ -252,6 +252,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -476,6 +477,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -494,6 +496,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList diff --git a/twilio/rest/proxy/v1/service/phone_number.py b/twilio/rest/proxy/v1/service/phone_number.py index ec0af3dde9..c4252b3980 100644 --- a/twilio/rest/proxy/v1/service/phone_number.py +++ b/twilio/rest/proxy/v1/service/phone_number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class PhoneNumberInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the PhoneNumber resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the PhoneNumber resource. @@ -163,6 +161,7 @@ def __repr__(self) -> str: class PhoneNumberContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the PhoneNumberContext @@ -315,6 +314,7 @@ def __repr__(self) -> str: class PhoneNumberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PhoneNumberInstance: """ Build an instance of PhoneNumberInstance @@ -335,6 +335,7 @@ def __repr__(self) -> str: class PhoneNumberList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the PhoneNumberList diff --git a/twilio/rest/proxy/v1/service/session/__init__.py b/twilio/rest/proxy/v1/service/session/__init__.py index 1c9dc055a9..26ff177889 100644 --- a/twilio/rest/proxy/v1/service/session/__init__.py +++ b/twilio/rest/proxy/v1/service/session/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -26,6 +25,7 @@ class SessionInstance(InstanceResource): + class Mode(object): MESSAGE_ONLY = "message-only" VOICE_ONLY = "voice-only" @@ -220,6 +220,7 @@ def __repr__(self) -> str: class SessionContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the SessionContext @@ -413,6 +414,7 @@ def __repr__(self) -> str: class SessionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SessionInstance: """ Build an instance of SessionInstance @@ -433,6 +435,7 @@ def __repr__(self) -> str: class SessionList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the SessionList diff --git a/twilio/rest/proxy/v1/service/session/interaction.py b/twilio/rest/proxy/v1/service/session/interaction.py index 8ce2846d51..6e4cac7c14 100644 --- a/twilio/rest/proxy/v1/service/session/interaction.py +++ b/twilio/rest/proxy/v1/service/session/interaction.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class InteractionInstance(InstanceResource): + class ResourceStatus(object): ACCEPTED = "accepted" ANSWERED = "answered" @@ -94,9 +94,9 @@ def __init__( "inbound_participant_sid" ) self.inbound_resource_sid: Optional[str] = payload.get("inbound_resource_sid") - self.inbound_resource_status: Optional[ - "InteractionInstance.ResourceStatus" - ] = payload.get("inbound_resource_status") + self.inbound_resource_status: Optional["InteractionInstance.ResourceStatus"] = ( + payload.get("inbound_resource_status") + ) self.inbound_resource_type: Optional[str] = payload.get("inbound_resource_type") self.inbound_resource_url: Optional[str] = payload.get("inbound_resource_url") self.outbound_participant_sid: Optional[str] = payload.get( @@ -189,6 +189,7 @@ def __repr__(self) -> str: class InteractionContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, session_sid: str, sid: str): """ Initialize the InteractionContext @@ -289,6 +290,7 @@ def __repr__(self) -> str: class InteractionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InteractionInstance: """ Build an instance of InteractionInstance @@ -312,6 +314,7 @@ def __repr__(self) -> str: class InteractionList(ListResource): + def __init__(self, version: Version, service_sid: str, session_sid: str): """ Initialize the InteractionList diff --git a/twilio/rest/proxy/v1/service/session/participant/__init__.py b/twilio/rest/proxy/v1/service/session/participant/__init__.py index a14b19a95b..266396f08f 100644 --- a/twilio/rest/proxy/v1/service/session/participant/__init__.py +++ b/twilio/rest/proxy/v1/service/session/participant/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class ParticipantInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Participant resource. :ivar session_sid: The SID of the parent [Session](https://www.twilio.com/docs/proxy/api/session) resource. @@ -152,6 +150,7 @@ def __repr__(self) -> str: class ParticipantContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, session_sid: str, sid: str): """ Initialize the ParticipantContext @@ -268,6 +267,7 @@ def __repr__(self) -> str: class ParticipantPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantInstance: """ Build an instance of ParticipantInstance @@ -291,6 +291,7 @@ def __repr__(self) -> str: class ParticipantList(ListResource): + def __init__(self, version: Version, service_sid: str, session_sid: str): """ Initialize the ParticipantList 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 d2b60ce95c..b260b4693f 100644 --- a/twilio/rest/proxy/v1/service/session/participant/message_interaction.py +++ b/twilio/rest/proxy/v1/service/session/participant/message_interaction.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class MessageInteractionInstance(InstanceResource): + class ResourceStatus(object): ACCEPTED = "accepted" ANSWERED = "answered" @@ -176,6 +176,7 @@ def __repr__(self) -> str: class MessageInteractionContext(InstanceContext): + def __init__( self, version: Version, @@ -261,6 +262,7 @@ def __repr__(self) -> str: class MessageInteractionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInteractionInstance: """ Build an instance of MessageInteractionInstance @@ -285,6 +287,7 @@ def __repr__(self) -> str: class MessageInteractionList(ListResource): + def __init__( self, version: Version, service_sid: str, session_sid: str, participant_sid: str ): diff --git a/twilio/rest/proxy/v1/service/short_code.py b/twilio/rest/proxy/v1/service/short_code.py index ccda96db4e..7fc108e673 100644 --- a/twilio/rest/proxy/v1/service/short_code.py +++ b/twilio/rest/proxy/v1/service/short_code.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ShortCodeInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the ShortCode resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ShortCode resource. @@ -159,6 +157,7 @@ def __repr__(self) -> str: class ShortCodeContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the ShortCodeContext @@ -309,6 +308,7 @@ def __repr__(self) -> str: class ShortCodePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ShortCodeInstance: """ Build an instance of ShortCodeInstance @@ -329,6 +329,7 @@ def __repr__(self) -> str: class ShortCodeList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the ShortCodeList diff --git a/twilio/rest/routes/RoutesBase.py b/twilio/rest/routes/RoutesBase.py index 86a85dd3da..a47d67f093 100644 --- a/twilio/rest/routes/RoutesBase.py +++ b/twilio/rest/routes/RoutesBase.py @@ -17,6 +17,7 @@ class RoutesBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Routes Domain diff --git a/twilio/rest/routes/v2/__init__.py b/twilio/rest/routes/v2/__init__.py index b3852c1a6d..56a140efc3 100644 --- a/twilio/rest/routes/v2/__init__.py +++ b/twilio/rest/routes/v2/__init__.py @@ -21,6 +21,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Routes diff --git a/twilio/rest/routes/v2/phone_number.py b/twilio/rest/routes/v2/phone_number.py index 496a3de2ba..4f452e3616 100644 --- a/twilio/rest/routes/v2/phone_number.py +++ b/twilio/rest/routes/v2/phone_number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class PhoneNumberInstance(InstanceResource): - """ :ivar phone_number: The phone number in E.164 format :ivar url: The absolute URL of the resource. @@ -141,6 +139,7 @@ def __repr__(self) -> str: class PhoneNumberContext(InstanceContext): + def __init__(self, version: Version, phone_number: str): """ Initialize the PhoneNumberContext @@ -265,6 +264,7 @@ def __repr__(self) -> str: class PhoneNumberList(ListResource): + def __init__(self, version: Version): """ Initialize the PhoneNumberList diff --git a/twilio/rest/routes/v2/sip_domain.py b/twilio/rest/routes/v2/sip_domain.py index 42755a43fc..cad3a4922c 100644 --- a/twilio/rest/routes/v2/sip_domain.py +++ b/twilio/rest/routes/v2/sip_domain.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class SipDomainInstance(InstanceResource): - """ :ivar sip_domain: :ivar url: @@ -141,6 +139,7 @@ def __repr__(self) -> str: class SipDomainContext(InstanceContext): + def __init__(self, version: Version, sip_domain: str): """ Initialize the SipDomainContext @@ -265,6 +264,7 @@ def __repr__(self) -> str: class SipDomainList(ListResource): + def __init__(self, version: Version): """ Initialize the SipDomainList diff --git a/twilio/rest/routes/v2/trunk.py b/twilio/rest/routes/v2/trunk.py index cf02b000b1..2baf2788ae 100644 --- a/twilio/rest/routes/v2/trunk.py +++ b/twilio/rest/routes/v2/trunk.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class TrunkInstance(InstanceResource): - """ :ivar sip_trunk_domain: The absolute URL of the SIP Trunk :ivar url: The absolute URL of the resource. @@ -141,6 +139,7 @@ def __repr__(self) -> str: class TrunkContext(InstanceContext): + def __init__(self, version: Version, sip_trunk_domain: str): """ Initialize the TrunkContext @@ -265,6 +264,7 @@ def __repr__(self) -> str: class TrunkList(ListResource): + def __init__(self, version: Version): """ Initialize the TrunkList diff --git a/twilio/rest/serverless/ServerlessBase.py b/twilio/rest/serverless/ServerlessBase.py index 803c63dece..d6e227c0b7 100644 --- a/twilio/rest/serverless/ServerlessBase.py +++ b/twilio/rest/serverless/ServerlessBase.py @@ -17,6 +17,7 @@ class ServerlessBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Serverless Domain diff --git a/twilio/rest/serverless/v1/__init__.py b/twilio/rest/serverless/v1/__init__.py index ea6b4e9db2..e494615caf 100644 --- a/twilio/rest/serverless/v1/__init__.py +++ b/twilio/rest/serverless/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Serverless diff --git a/twilio/rest/serverless/v1/service/__init__.py b/twilio/rest/serverless/v1/service/__init__.py index ab58c0eb8d..493b1a2e05 100644 --- a/twilio/rest/serverless/v1/service/__init__.py +++ b/twilio/rest/serverless/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,7 +27,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Service resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. @@ -201,6 +199,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -404,6 +403,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -422,6 +422,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList diff --git a/twilio/rest/serverless/v1/service/asset/__init__.py b/twilio/rest/serverless/v1/service/asset/__init__.py index 38f3598109..2049c9d46b 100644 --- a/twilio/rest/serverless/v1/service/asset/__init__.py +++ b/twilio/rest/serverless/v1/service/asset/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class AssetInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Asset resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Asset resource. @@ -159,6 +157,7 @@ def __repr__(self) -> str: class AssetContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the AssetContext @@ -320,6 +319,7 @@ def __repr__(self) -> str: class AssetPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AssetInstance: """ Build an instance of AssetInstance @@ -340,6 +340,7 @@ def __repr__(self) -> str: class AssetList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the AssetList diff --git a/twilio/rest/serverless/v1/service/asset/asset_version.py b/twilio/rest/serverless/v1/service/asset/asset_version.py index 34ebb07ef0..fbe7b30800 100644 --- a/twilio/rest/serverless/v1/service/asset/asset_version.py +++ b/twilio/rest/serverless/v1/service/asset/asset_version.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class AssetVersionInstance(InstanceResource): + class Visibility(object): PUBLIC = "public" PRIVATE = "private" @@ -116,6 +116,7 @@ def __repr__(self) -> str: class AssetVersionContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, asset_sid: str, sid: str): """ Initialize the AssetVersionContext @@ -190,6 +191,7 @@ def __repr__(self) -> str: class AssetVersionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AssetVersionInstance: """ Build an instance of AssetVersionInstance @@ -213,6 +215,7 @@ def __repr__(self) -> str: class AssetVersionList(ListResource): + def __init__(self, version: Version, service_sid: str, asset_sid: str): """ Initialize the AssetVersionList diff --git a/twilio/rest/serverless/v1/service/environment/__init__.py b/twilio/rest/serverless/v1/service/environment/__init__.py index 235c77739f..46b7ddacf4 100644 --- a/twilio/rest/serverless/v1/service/environment/__init__.py +++ b/twilio/rest/serverless/v1/service/environment/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class EnvironmentInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Environment resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Environment resource. @@ -157,6 +155,7 @@ def __repr__(self) -> str: class EnvironmentContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the EnvironmentContext @@ -294,6 +293,7 @@ def __repr__(self) -> str: class EnvironmentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EnvironmentInstance: """ Build an instance of EnvironmentInstance @@ -314,6 +314,7 @@ def __repr__(self) -> str: class EnvironmentList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the EnvironmentList diff --git a/twilio/rest/serverless/v1/service/environment/deployment.py b/twilio/rest/serverless/v1/service/environment/deployment.py index 6667bd891c..1ff896f93a 100644 --- a/twilio/rest/serverless/v1/service/environment/deployment.py +++ b/twilio/rest/serverless/v1/service/environment/deployment.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class DeploymentInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Deployment resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Deployment resource. @@ -112,6 +110,7 @@ def __repr__(self) -> str: class DeploymentContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, environment_sid: str, sid: str ): @@ -188,6 +187,7 @@ def __repr__(self) -> str: class DeploymentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeploymentInstance: """ Build an instance of DeploymentInstance @@ -211,6 +211,7 @@ def __repr__(self) -> str: class DeploymentList(ListResource): + def __init__(self, version: Version, service_sid: str, environment_sid: str): """ Initialize the DeploymentList diff --git a/twilio/rest/serverless/v1/service/environment/log.py b/twilio/rest/serverless/v1/service/environment/log.py index d856ba75d8..e1aff5214f 100644 --- a/twilio/rest/serverless/v1/service/environment/log.py +++ b/twilio/rest/serverless/v1/service/environment/log.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class LogInstance(InstanceResource): + class Level(object): INFO = "info" WARN = "warn" @@ -122,6 +122,7 @@ def __repr__(self) -> str: class LogContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, environment_sid: str, sid: str ): @@ -200,6 +201,7 @@ def __repr__(self) -> str: class LogPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> LogInstance: """ Build an instance of LogInstance @@ -223,6 +225,7 @@ def __repr__(self) -> str: class LogList(ListResource): + def __init__(self, version: Version, service_sid: str, environment_sid: str): """ Initialize the LogList diff --git a/twilio/rest/serverless/v1/service/environment/variable.py b/twilio/rest/serverless/v1/service/environment/variable.py index b64484f57f..f69c129f81 100644 --- a/twilio/rest/serverless/v1/service/environment/variable.py +++ b/twilio/rest/serverless/v1/service/environment/variable.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class VariableInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Variable resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Variable resource. @@ -168,6 +166,7 @@ def __repr__(self) -> str: class VariableContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, environment_sid: str, sid: str ): @@ -336,6 +335,7 @@ def __repr__(self) -> str: class VariablePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> VariableInstance: """ Build an instance of VariableInstance @@ -359,6 +359,7 @@ def __repr__(self) -> str: class VariableList(ListResource): + def __init__(self, version: Version, service_sid: str, environment_sid: str): """ Initialize the VariableList diff --git a/twilio/rest/serverless/v1/service/function/__init__.py b/twilio/rest/serverless/v1/service/function/__init__.py index 7b9718e246..71bbad8466 100644 --- a/twilio/rest/serverless/v1/service/function/__init__.py +++ b/twilio/rest/serverless/v1/service/function/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class FunctionInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Function resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Function resource. @@ -161,6 +159,7 @@ def __repr__(self) -> str: class FunctionContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the FunctionContext @@ -322,6 +321,7 @@ def __repr__(self) -> str: class FunctionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FunctionInstance: """ Build an instance of FunctionInstance @@ -342,6 +342,7 @@ def __repr__(self) -> str: class FunctionList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the FunctionList diff --git a/twilio/rest/serverless/v1/service/function/function_version/__init__.py b/twilio/rest/serverless/v1/service/function/function_version/__init__.py index 73443897a9..e915894f11 100644 --- a/twilio/rest/serverless/v1/service/function/function_version/__init__.py +++ b/twilio/rest/serverless/v1/service/function/function_version/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,6 +26,7 @@ class FunctionVersionInstance(InstanceResource): + class Visibility(object): PUBLIC = "public" PRIVATE = "private" @@ -128,6 +128,7 @@ def __repr__(self) -> str: class FunctionVersionContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, function_sid: str, sid: str): """ Initialize the FunctionVersionContext @@ -220,6 +221,7 @@ def __repr__(self) -> str: class FunctionVersionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FunctionVersionInstance: """ Build an instance of FunctionVersionInstance @@ -243,6 +245,7 @@ def __repr__(self) -> str: class FunctionVersionList(ListResource): + def __init__(self, version: Version, service_sid: str, function_sid: str): """ Initialize the FunctionVersionList diff --git a/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py b/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py index c39f9f0710..c58fa574e7 100644 --- a/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py +++ b/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class FunctionVersionContentInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Function Version resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Function Version resource. @@ -103,6 +101,7 @@ def __repr__(self) -> str: class FunctionVersionContentContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, function_sid: str, sid: str): """ Initialize the FunctionVersionContentContext @@ -177,6 +176,7 @@ def __repr__(self) -> str: class FunctionVersionContentList(ListResource): + def __init__(self, version: Version, service_sid: str, function_sid: str, sid: str): """ Initialize the FunctionVersionContentList diff --git a/twilio/rest/studio/StudioBase.py b/twilio/rest/studio/StudioBase.py index e1b2374226..3b218775c8 100644 --- a/twilio/rest/studio/StudioBase.py +++ b/twilio/rest/studio/StudioBase.py @@ -18,6 +18,7 @@ class StudioBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Studio Domain diff --git a/twilio/rest/studio/v1/__init__.py b/twilio/rest/studio/v1/__init__.py index d5ca90bb68..8ab7d71b6c 100644 --- a/twilio/rest/studio/v1/__init__.py +++ b/twilio/rest/studio/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Studio diff --git a/twilio/rest/studio/v1/flow/__init__.py b/twilio/rest/studio/v1/flow/__init__.py index a7c5756e04..bb0f78658b 100644 --- a/twilio/rest/studio/v1/flow/__init__.py +++ b/twilio/rest/studio/v1/flow/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -26,6 +25,7 @@ class FlowInstance(InstanceResource): + class Status(object): DRAFT = "draft" PUBLISHED = "published" @@ -142,6 +142,7 @@ def __repr__(self) -> str: class FlowContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the FlowContext @@ -257,6 +258,7 @@ def __repr__(self) -> str: class FlowPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FlowInstance: """ Build an instance of FlowInstance @@ -275,6 +277,7 @@ def __repr__(self) -> str: class FlowList(ListResource): + def __init__(self, version: Version): """ Initialize the FlowList diff --git a/twilio/rest/studio/v1/flow/engagement/__init__.py b/twilio/rest/studio/v1/flow/engagement/__init__.py index 8271fa2c96..f6d95abd5f 100644 --- a/twilio/rest/studio/v1/flow/engagement/__init__.py +++ b/twilio/rest/studio/v1/flow/engagement/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -28,6 +27,7 @@ class EngagementInstance(InstanceResource): + class Status(object): ACTIVE = "active" ENDED = "ended" @@ -156,6 +156,7 @@ def __repr__(self) -> str: class EngagementContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, sid: str): """ Initialize the EngagementContext @@ -277,6 +278,7 @@ def __repr__(self) -> str: class EngagementPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EngagementInstance: """ Build an instance of EngagementInstance @@ -297,6 +299,7 @@ def __repr__(self) -> str: class EngagementList(ListResource): + def __init__(self, version: Version, flow_sid: str): """ Initialize the EngagementList diff --git a/twilio/rest/studio/v1/flow/engagement/engagement_context.py b/twilio/rest/studio/v1/flow/engagement/engagement_context.py index d558b38bed..f534db6922 100644 --- a/twilio/rest/studio/v1/flow/engagement/engagement_context.py +++ b/twilio/rest/studio/v1/flow/engagement/engagement_context.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class EngagementContextInstance(InstanceResource): - """ :ivar account_sid: The SID of the Account. :ivar context: As your flow executes, we save the state in what's called the Flow Context. Any data in the flow context can be accessed by your widgets as variables, either in configuration fields or in text areas as variable substitution. @@ -96,6 +94,7 @@ def __repr__(self) -> str: class EngagementContextContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, engagement_sid: str): """ Initialize the EngagementContextContext @@ -166,6 +165,7 @@ def __repr__(self) -> str: class EngagementContextList(ListResource): + def __init__(self, version: Version, flow_sid: str, engagement_sid: str): """ Initialize the EngagementContextList diff --git a/twilio/rest/studio/v1/flow/engagement/step/__init__.py b/twilio/rest/studio/v1/flow/engagement/step/__init__.py index c1638f29cf..1a2d8570c9 100644 --- a/twilio/rest/studio/v1/flow/engagement/step/__init__.py +++ b/twilio/rest/studio/v1/flow/engagement/step/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class StepInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Step resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Step resource. @@ -128,6 +126,7 @@ def __repr__(self) -> str: class StepContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, engagement_sid: str, sid: str): """ Initialize the StepContext @@ -218,6 +217,7 @@ def __repr__(self) -> str: class StepPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> StepInstance: """ Build an instance of StepInstance @@ -241,6 +241,7 @@ def __repr__(self) -> str: class StepList(ListResource): + def __init__(self, version: Version, flow_sid: str, engagement_sid: str): """ Initialize the StepList diff --git a/twilio/rest/studio/v1/flow/engagement/step/step_context.py b/twilio/rest/studio/v1/flow/engagement/step/step_context.py index c1555d05ab..69c4c22465 100644 --- a/twilio/rest/studio/v1/flow/engagement/step/step_context.py +++ b/twilio/rest/studio/v1/flow/engagement/step/step_context.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class StepContextInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the StepContext resource. :ivar context: The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. @@ -101,6 +99,7 @@ def __repr__(self) -> str: class StepContextContext(InstanceContext): + def __init__( self, version: Version, flow_sid: str, engagement_sid: str, step_sid: str ): @@ -177,6 +176,7 @@ def __repr__(self) -> str: class StepContextList(ListResource): + def __init__( self, version: Version, flow_sid: str, engagement_sid: str, step_sid: str ): diff --git a/twilio/rest/studio/v1/flow/execution/__init__.py b/twilio/rest/studio/v1/flow/execution/__init__.py index c4cfd09c49..57239e5154 100644 --- a/twilio/rest/studio/v1/flow/execution/__init__.py +++ b/twilio/rest/studio/v1/flow/execution/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -26,6 +25,7 @@ class ExecutionInstance(InstanceResource): + class Status(object): ACTIVE = "active" ENDED = "ended" @@ -180,6 +180,7 @@ def __repr__(self) -> str: class ExecutionContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, sid: str): """ Initialize the ExecutionContext @@ -357,6 +358,7 @@ def __repr__(self) -> str: class ExecutionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ExecutionInstance: """ Build an instance of ExecutionInstance @@ -377,6 +379,7 @@ def __repr__(self) -> str: class ExecutionList(ListResource): + def __init__(self, version: Version, flow_sid: str): """ Initialize the ExecutionList diff --git a/twilio/rest/studio/v1/flow/execution/execution_context.py b/twilio/rest/studio/v1/flow/execution/execution_context.py index d84431d12a..a2765bbc9b 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_context.py +++ b/twilio/rest/studio/v1/flow/execution/execution_context.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class ExecutionContextInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionContext resource. :ivar context: The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. @@ -96,6 +94,7 @@ def __repr__(self) -> str: class ExecutionContextContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, execution_sid: str): """ Initialize the ExecutionContextContext @@ -166,6 +165,7 @@ def __repr__(self) -> str: class ExecutionContextList(ListResource): + def __init__(self, version: Version, flow_sid: str, execution_sid: str): """ Initialize the ExecutionContextList diff --git a/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py b/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py index 462e5322b4..6e19ca4453 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py +++ b/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class ExecutionStepInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the ExecutionStep resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionStep resource. @@ -130,6 +128,7 @@ def __repr__(self) -> str: class ExecutionStepContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, execution_sid: str, sid: str): """ Initialize the ExecutionStepContext @@ -220,6 +219,7 @@ def __repr__(self) -> str: class ExecutionStepPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ExecutionStepInstance: """ Build an instance of ExecutionStepInstance @@ -243,6 +243,7 @@ def __repr__(self) -> str: class ExecutionStepList(ListResource): + def __init__(self, version: Version, flow_sid: str, execution_sid: str): """ Initialize the ExecutionStepList diff --git a/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py b/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py index 1463adec6b..224f92d0f5 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py +++ b/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class ExecutionStepContextInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionStepContext resource. :ivar context: The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. @@ -101,6 +99,7 @@ def __repr__(self) -> str: class ExecutionStepContextContext(InstanceContext): + def __init__( self, version: Version, flow_sid: str, execution_sid: str, step_sid: str ): @@ -177,6 +176,7 @@ def __repr__(self) -> str: class ExecutionStepContextList(ListResource): + def __init__( self, version: Version, flow_sid: str, execution_sid: str, step_sid: str ): diff --git a/twilio/rest/studio/v2/__init__.py b/twilio/rest/studio/v2/__init__.py index 2ad61768ad..83ccc8e0a9 100644 --- a/twilio/rest/studio/v2/__init__.py +++ b/twilio/rest/studio/v2/__init__.py @@ -20,6 +20,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Studio diff --git a/twilio/rest/studio/v2/flow/__init__.py b/twilio/rest/studio/v2/flow/__init__.py index dafec94320..21138d29cc 100644 --- a/twilio/rest/studio/v2/flow/__init__.py +++ b/twilio/rest/studio/v2/flow/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,6 +26,7 @@ class FlowInstance(InstanceResource): + class Status(object): DRAFT = "draft" PUBLISHED = "published" @@ -210,6 +210,7 @@ def __repr__(self) -> str: class FlowContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the FlowContext @@ -406,6 +407,7 @@ def __repr__(self) -> str: class FlowPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FlowInstance: """ Build an instance of FlowInstance @@ -424,6 +426,7 @@ def __repr__(self) -> str: class FlowList(ListResource): + def __init__(self, version: Version): """ Initialize the FlowList diff --git a/twilio/rest/studio/v2/flow/execution/__init__.py b/twilio/rest/studio/v2/flow/execution/__init__.py index de539fa596..38d3b2b539 100644 --- a/twilio/rest/studio/v2/flow/execution/__init__.py +++ b/twilio/rest/studio/v2/flow/execution/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -26,6 +25,7 @@ class ExecutionInstance(InstanceResource): + class Status(object): ACTIVE = "active" ENDED = "ended" @@ -178,6 +178,7 @@ def __repr__(self) -> str: class ExecutionContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, sid: str): """ Initialize the ExecutionContext @@ -355,6 +356,7 @@ def __repr__(self) -> str: class ExecutionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ExecutionInstance: """ Build an instance of ExecutionInstance @@ -375,6 +377,7 @@ def __repr__(self) -> str: class ExecutionList(ListResource): + def __init__(self, version: Version, flow_sid: str): """ Initialize the ExecutionList diff --git a/twilio/rest/studio/v2/flow/execution/execution_context.py b/twilio/rest/studio/v2/flow/execution/execution_context.py index 47628b1ea9..facb52eed7 100644 --- a/twilio/rest/studio/v2/flow/execution/execution_context.py +++ b/twilio/rest/studio/v2/flow/execution/execution_context.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class ExecutionContextInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionContext resource. :ivar context: The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. @@ -96,6 +94,7 @@ def __repr__(self) -> str: class ExecutionContextContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, execution_sid: str): """ Initialize the ExecutionContextContext @@ -166,6 +165,7 @@ def __repr__(self) -> str: class ExecutionContextList(ListResource): + def __init__(self, version: Version, flow_sid: str, execution_sid: str): """ Initialize the ExecutionContextList diff --git a/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py b/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py index 7b43ad5eee..257e16b1df 100644 --- a/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py +++ b/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class ExecutionStepInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the ExecutionStep resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionStep resource. @@ -130,6 +128,7 @@ def __repr__(self) -> str: class ExecutionStepContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, execution_sid: str, sid: str): """ Initialize the ExecutionStepContext @@ -220,6 +219,7 @@ def __repr__(self) -> str: class ExecutionStepPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ExecutionStepInstance: """ Build an instance of ExecutionStepInstance @@ -243,6 +243,7 @@ def __repr__(self) -> str: class ExecutionStepList(ListResource): + def __init__(self, version: Version, flow_sid: str, execution_sid: str): """ Initialize the ExecutionStepList diff --git a/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py b/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py index 5a88321590..41661238b5 100644 --- a/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py +++ b/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class ExecutionStepContextInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionStepContext resource. :ivar context: The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. @@ -101,6 +99,7 @@ def __repr__(self) -> str: class ExecutionStepContextContext(InstanceContext): + def __init__( self, version: Version, flow_sid: str, execution_sid: str, step_sid: str ): @@ -177,6 +176,7 @@ def __repr__(self) -> str: class ExecutionStepContextList(ListResource): + def __init__( self, version: Version, flow_sid: str, execution_sid: str, step_sid: str ): diff --git a/twilio/rest/studio/v2/flow/flow_revision.py b/twilio/rest/studio/v2/flow/flow_revision.py index 64c50b0a3d..0de91513ed 100644 --- a/twilio/rest/studio/v2/flow/flow_revision.py +++ b/twilio/rest/studio/v2/flow/flow_revision.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class FlowRevisionInstance(InstanceResource): + class Status(object): DRAFT = "draft" PUBLISHED = "published" @@ -120,6 +120,7 @@ def __repr__(self) -> str: class FlowRevisionContext(InstanceContext): + def __init__(self, version: Version, sid: str, revision: str): """ Initialize the FlowRevisionContext @@ -188,6 +189,7 @@ def __repr__(self) -> str: class FlowRevisionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FlowRevisionInstance: """ Build an instance of FlowRevisionInstance @@ -206,6 +208,7 @@ def __repr__(self) -> str: class FlowRevisionList(ListResource): + def __init__(self, version: Version, sid: str): """ Initialize the FlowRevisionList diff --git a/twilio/rest/studio/v2/flow/flow_test_user.py b/twilio/rest/studio/v2/flow/flow_test_user.py index d5dbee7d68..3465632353 100644 --- a/twilio/rest/studio/v2/flow/flow_test_user.py +++ b/twilio/rest/studio/v2/flow/flow_test_user.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class FlowTestUserInstance(InstanceResource): - """ :ivar sid: Unique identifier of the flow. :ivar test_users: List of test user identities that can test draft versions of the flow. @@ -109,6 +107,7 @@ def __repr__(self) -> str: class FlowTestUserContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the FlowTestUserContext @@ -217,6 +216,7 @@ def __repr__(self) -> str: class FlowTestUserList(ListResource): + def __init__(self, version: Version, sid: str): """ Initialize the FlowTestUserList diff --git a/twilio/rest/studio/v2/flow_validate.py b/twilio/rest/studio/v2/flow_validate.py index 74ddfa2362..6994e6af14 100644 --- a/twilio/rest/studio/v2/flow_validate.py +++ b/twilio/rest/studio/v2/flow_validate.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import serialize, values @@ -22,6 +21,7 @@ class FlowValidateInstance(InstanceResource): + class Status(object): DRAFT = "draft" PUBLISHED = "published" @@ -46,6 +46,7 @@ def __repr__(self) -> str: class FlowValidateList(ListResource): + def __init__(self, version: Version): """ Initialize the FlowValidateList diff --git a/twilio/rest/supersim/SupersimBase.py b/twilio/rest/supersim/SupersimBase.py index d85c382641..dd73d12223 100644 --- a/twilio/rest/supersim/SupersimBase.py +++ b/twilio/rest/supersim/SupersimBase.py @@ -17,6 +17,7 @@ class SupersimBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Supersim Domain diff --git a/twilio/rest/supersim/v1/__init__.py b/twilio/rest/supersim/v1/__init__.py index 480787bcab..2336da2616 100644 --- a/twilio/rest/supersim/v1/__init__.py +++ b/twilio/rest/supersim/v1/__init__.py @@ -27,6 +27,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Supersim diff --git a/twilio/rest/supersim/v1/esim_profile.py b/twilio/rest/supersim/v1/esim_profile.py index fedd2e1741..c8ecb02ae0 100644 --- a/twilio/rest/supersim/v1/esim_profile.py +++ b/twilio/rest/supersim/v1/esim_profile.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class EsimProfileInstance(InstanceResource): + class Status(object): NEW = "new" RESERVING = "reserving" @@ -36,7 +36,7 @@ class Status(object): :ivar sid: The unique string that we created to identify the eSIM Profile resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the eSIM Profile resource belongs. :ivar iccid: The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with the Sim resource. - :ivar sim_sid: The SID of the [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource that this eSIM Profile controls. + :ivar sim_sid: The SID of the [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource that this eSIM Profile controls. :ivar status: :ivar eid: Identifier of the eUICC that can claim the eSIM Profile. :ivar smdp_plus_address: Address of the SM-DP+ server from which the Profile will be downloaded. The URL will appear once the eSIM Profile reaches the status `available`. @@ -122,6 +122,7 @@ def __repr__(self) -> str: class EsimProfileContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the EsimProfileContext @@ -186,6 +187,7 @@ def __repr__(self) -> str: class EsimProfilePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EsimProfileInstance: """ Build an instance of EsimProfileInstance @@ -204,6 +206,7 @@ def __repr__(self) -> str: class EsimProfileList(ListResource): + def __init__(self, version: Version): """ Initialize the EsimProfileList @@ -300,7 +303,7 @@ def stream( The results are returned as a generator, so this operation is memory efficient. :param str eid: List the eSIM Profiles that have been associated with an EId. - :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param "EsimProfileInstance.Status" status: List the eSIM Profiles that are in a given status. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @@ -333,7 +336,7 @@ async def stream_async( The results are returned as a generator, so this operation is memory efficient. :param str eid: List the eSIM Profiles that have been associated with an EId. - :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param "EsimProfileInstance.Status" status: List the eSIM Profiles that are in a given status. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @@ -365,7 +368,7 @@ def list( memory before returning. :param str eid: List the eSIM Profiles that have been associated with an EId. - :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param "EsimProfileInstance.Status" status: List the eSIM Profiles that are in a given status. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit @@ -400,7 +403,7 @@ async def list_async( memory before returning. :param str eid: List the eSIM Profiles that have been associated with an EId. - :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param "EsimProfileInstance.Status" status: List the eSIM Profiles that are in a given status. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit @@ -436,7 +439,7 @@ def page( Request is executed immediately :param eid: List the eSIM Profiles that have been associated with an EId. - :param sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param status: List the eSIM Profiles that are in a given status. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state @@ -472,7 +475,7 @@ async def page_async( Request is executed immediately :param eid: List the eSIM Profiles that have been associated with an EId. - :param sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param status: List the eSIM Profiles that are in a given status. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state diff --git a/twilio/rest/supersim/v1/fleet.py b/twilio/rest/supersim/v1/fleet.py index e09ea796fc..2447057a7f 100644 --- a/twilio/rest/supersim/v1/fleet.py +++ b/twilio/rest/supersim/v1/fleet.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class FleetInstance(InstanceResource): + class DataMetering(object): PAYG = "payg" @@ -189,6 +189,7 @@ def __repr__(self) -> str: class FleetContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the FleetContext @@ -339,6 +340,7 @@ def __repr__(self) -> str: class FleetPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FleetInstance: """ Build an instance of FleetInstance @@ -357,6 +359,7 @@ def __repr__(self) -> str: class FleetList(ListResource): + def __init__(self, version: Version): """ Initialize the FleetList diff --git a/twilio/rest/supersim/v1/ip_command.py b/twilio/rest/supersim/v1/ip_command.py index fd49bd8a83..b7610efec6 100644 --- a/twilio/rest/supersim/v1/ip_command.py +++ b/twilio/rest/supersim/v1/ip_command.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class IpCommandInstance(InstanceResource): + class Direction(object): TO_SIM = "to_sim" FROM_SIM = "from_sim" @@ -132,6 +132,7 @@ def __repr__(self) -> str: class IpCommandContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the IpCommandContext @@ -196,6 +197,7 @@ def __repr__(self) -> str: class IpCommandPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> IpCommandInstance: """ Build an instance of IpCommandInstance @@ -214,6 +216,7 @@ def __repr__(self) -> str: class IpCommandList(ListResource): + def __init__(self, version: Version): """ Initialize the IpCommandList diff --git a/twilio/rest/supersim/v1/network.py b/twilio/rest/supersim/v1/network.py index a526c8dfbc..0d4f6a94fd 100644 --- a/twilio/rest/supersim/v1/network.py +++ b/twilio/rest/supersim/v1/network.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class NetworkInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Network resource. :ivar friendly_name: A human readable identifier of this resource. @@ -92,6 +90,7 @@ def __repr__(self) -> str: class NetworkContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the NetworkContext @@ -156,6 +155,7 @@ def __repr__(self) -> str: class NetworkPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> NetworkInstance: """ Build an instance of NetworkInstance @@ -174,6 +174,7 @@ def __repr__(self) -> str: class NetworkList(ListResource): + def __init__(self, version: Version): """ Initialize the NetworkList diff --git a/twilio/rest/supersim/v1/network_access_profile/__init__.py b/twilio/rest/supersim/v1/network_access_profile/__init__.py index 3e2b65d9c5..d0b5374699 100644 --- a/twilio/rest/supersim/v1/network_access_profile/__init__.py +++ b/twilio/rest/supersim/v1/network_access_profile/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,7 +26,6 @@ class NetworkAccessProfileInstance(InstanceResource): - """ :ivar sid: The unique string that identifies the Network Access Profile resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. @@ -139,6 +137,7 @@ def __repr__(self) -> str: class NetworkAccessProfileContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the NetworkAccessProfileContext @@ -269,6 +268,7 @@ def __repr__(self) -> str: class NetworkAccessProfilePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> NetworkAccessProfileInstance: """ Build an instance of NetworkAccessProfileInstance @@ -287,6 +287,7 @@ def __repr__(self) -> str: class NetworkAccessProfileList(ListResource): + def __init__(self, version: Version): """ Initialize the NetworkAccessProfileList 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 a6ef54e514..50a259550d 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class NetworkAccessProfileNetworkInstance(InstanceResource): - """ :ivar sid: The unique string that identifies the Network resource. :ivar network_access_profile_sid: The unique string that identifies the Network resource's Network Access Profile resource. @@ -122,6 +120,7 @@ def __repr__(self) -> str: class NetworkAccessProfileNetworkContext(InstanceContext): + def __init__(self, version: Version, network_access_profile_sid: str, sid: str): """ Initialize the NetworkAccessProfileNetworkContext @@ -220,6 +219,7 @@ def __repr__(self) -> str: class NetworkAccessProfileNetworkPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> NetworkAccessProfileNetworkInstance: @@ -244,6 +244,7 @@ def __repr__(self) -> str: class NetworkAccessProfileNetworkList(ListResource): + def __init__(self, version: Version, network_access_profile_sid: str): """ Initialize the NetworkAccessProfileNetworkList diff --git a/twilio/rest/supersim/v1/settings_update.py b/twilio/rest/supersim/v1/settings_update.py index 75a58a1967..f946150287 100644 --- a/twilio/rest/supersim/v1/settings_update.py +++ b/twilio/rest/supersim/v1/settings_update.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class SettingsUpdateInstance(InstanceResource): + class Status(object): SCHEDULED = "scheduled" IN_PROGRESS = "in-progress" @@ -70,6 +70,7 @@ def __repr__(self) -> str: class SettingsUpdatePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SettingsUpdateInstance: """ Build an instance of SettingsUpdateInstance @@ -88,6 +89,7 @@ def __repr__(self) -> str: class SettingsUpdateList(ListResource): + def __init__(self, version: Version): """ Initialize the SettingsUpdateList diff --git a/twilio/rest/supersim/v1/sim/__init__.py b/twilio/rest/supersim/v1/sim/__init__.py index 7b2636869b..b1ba647336 100644 --- a/twilio/rest/supersim/v1/sim/__init__.py +++ b/twilio/rest/supersim/v1/sim/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -26,6 +25,7 @@ class SimInstance(InstanceResource): + class Status(object): NEW = "new" READY = "ready" @@ -194,6 +194,7 @@ def __repr__(self) -> str: class SimContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SimContext @@ -365,6 +366,7 @@ def __repr__(self) -> str: class SimPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SimInstance: """ Build an instance of SimInstance @@ -383,6 +385,7 @@ def __repr__(self) -> str: class SimList(ListResource): + def __init__(self, version: Version): """ Initialize the SimList diff --git a/twilio/rest/supersim/v1/sim/billing_period.py b/twilio/rest/supersim/v1/sim/billing_period.py index 52afd38c70..e6fb961835 100644 --- a/twilio/rest/supersim/v1/sim/billing_period.py +++ b/twilio/rest/supersim/v1/sim/billing_period.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class BillingPeriodInstance(InstanceResource): + class BpType(object): READY = "ready" ACTIVE = "active" @@ -76,6 +76,7 @@ def __repr__(self) -> str: class BillingPeriodPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BillingPeriodInstance: """ Build an instance of BillingPeriodInstance @@ -96,6 +97,7 @@ def __repr__(self) -> str: class BillingPeriodList(ListResource): + def __init__(self, version: Version, sim_sid: str): """ Initialize the BillingPeriodList diff --git a/twilio/rest/supersim/v1/sim/sim_ip_address.py b/twilio/rest/supersim/v1/sim/sim_ip_address.py index 42911d1372..7c2b70e50f 100644 --- a/twilio/rest/supersim/v1/sim/sim_ip_address.py +++ b/twilio/rest/supersim/v1/sim/sim_ip_address.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values @@ -23,6 +22,7 @@ class SimIpAddressInstance(InstanceResource): + class IpAddressVersion(object): IPV4 = "IPv4" IPV6 = "IPv6" @@ -36,9 +36,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], sim_sid: str): super().__init__(version) self.ip_address: Optional[str] = payload.get("ip_address") - self.ip_address_version: Optional[ - "SimIpAddressInstance.IpAddressVersion" - ] = payload.get("ip_address_version") + self.ip_address_version: Optional["SimIpAddressInstance.IpAddressVersion"] = ( + payload.get("ip_address_version") + ) self._solution = { "sim_sid": sim_sid, @@ -55,6 +55,7 @@ def __repr__(self) -> str: class SimIpAddressPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SimIpAddressInstance: """ Build an instance of SimIpAddressInstance @@ -75,6 +76,7 @@ def __repr__(self) -> str: class SimIpAddressList(ListResource): + def __init__(self, version: Version, sim_sid: str): """ Initialize the SimIpAddressList diff --git a/twilio/rest/supersim/v1/sms_command.py b/twilio/rest/supersim/v1/sms_command.py index 9e68e71b76..0eb2094103 100644 --- a/twilio/rest/supersim/v1/sms_command.py +++ b/twilio/rest/supersim/v1/sms_command.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class SmsCommandInstance(InstanceResource): + class Direction(object): TO_SIM = "to_sim" FROM_SIM = "from_sim" @@ -117,6 +117,7 @@ def __repr__(self) -> str: class SmsCommandContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SmsCommandContext @@ -181,6 +182,7 @@ def __repr__(self) -> str: class SmsCommandPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SmsCommandInstance: """ Build an instance of SmsCommandInstance @@ -199,6 +201,7 @@ def __repr__(self) -> str: class SmsCommandList(ListResource): + def __init__(self, version: Version): """ Initialize the SmsCommandList diff --git a/twilio/rest/supersim/v1/usage_record.py b/twilio/rest/supersim/v1/usage_record.py index 5962a59951..86a335d0de 100644 --- a/twilio/rest/supersim/v1/usage_record.py +++ b/twilio/rest/supersim/v1/usage_record.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class UsageRecordInstance(InstanceResource): + class Granularity(object): HOUR = "hour" DAY = "day" @@ -77,6 +77,7 @@ def __repr__(self) -> str: class UsageRecordPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UsageRecordInstance: """ Build an instance of UsageRecordInstance @@ -95,6 +96,7 @@ def __repr__(self) -> str: class UsageRecordList(ListResource): + def __init__(self, version: Version): """ Initialize the UsageRecordList diff --git a/twilio/rest/sync/SyncBase.py b/twilio/rest/sync/SyncBase.py index 35c4fa9846..113cac0390 100644 --- a/twilio/rest/sync/SyncBase.py +++ b/twilio/rest/sync/SyncBase.py @@ -17,6 +17,7 @@ class SyncBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Sync Domain diff --git a/twilio/rest/sync/v1/__init__.py b/twilio/rest/sync/v1/__init__.py index db6c478992..e98201bd41 100644 --- a/twilio/rest/sync/v1/__init__.py +++ b/twilio/rest/sync/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Sync diff --git a/twilio/rest/sync/v1/service/__init__.py b/twilio/rest/sync/v1/service/__init__.py index 8e640535da..9fd7c22e30 100644 --- a/twilio/rest/sync/v1/service/__init__.py +++ b/twilio/rest/sync/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,7 +27,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Service resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. It is a read-only property, it cannot be assigned using REST API. @@ -239,6 +237,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -466,6 +465,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -484,6 +484,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList diff --git a/twilio/rest/sync/v1/service/document/__init__.py b/twilio/rest/sync/v1/service/document/__init__.py index 847dbccb34..f3b89cfe67 100644 --- a/twilio/rest/sync/v1/service/document/__init__.py +++ b/twilio/rest/sync/v1/service/document/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,7 +26,6 @@ class DocumentInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Document resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource and can be up to 320 characters long. @@ -189,6 +187,7 @@ def __repr__(self) -> str: class DocumentContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the DocumentContext @@ -372,6 +371,7 @@ def __repr__(self) -> str: class DocumentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DocumentInstance: """ Build an instance of DocumentInstance @@ -392,6 +392,7 @@ def __repr__(self) -> str: class DocumentList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the DocumentList diff --git a/twilio/rest/sync/v1/service/document/document_permission.py b/twilio/rest/sync/v1/service/document/document_permission.py index da0241f552..d8f157fb4e 100644 --- a/twilio/rest/sync/v1/service/document/document_permission.py +++ b/twilio/rest/sync/v1/service/document/document_permission.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class DocumentPermissionInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Document Permission resource. :ivar service_sid: The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. @@ -161,6 +159,7 @@ def __repr__(self) -> str: class DocumentPermissionContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, document_sid: str, identity: str ): @@ -329,6 +328,7 @@ def __repr__(self) -> str: class DocumentPermissionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DocumentPermissionInstance: """ Build an instance of DocumentPermissionInstance @@ -352,6 +352,7 @@ def __repr__(self) -> str: class DocumentPermissionList(ListResource): + def __init__(self, version: Version, service_sid: str, document_sid: str): """ Initialize the DocumentPermissionList diff --git a/twilio/rest/sync/v1/service/sync_list/__init__.py b/twilio/rest/sync/v1/service/sync_list/__init__.py index 9606162600..7e9ca672c4 100644 --- a/twilio/rest/sync/v1/service/sync_list/__init__.py +++ b/twilio/rest/sync/v1/service/sync_list/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,7 +27,6 @@ class SyncListInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Sync List resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. @@ -189,6 +187,7 @@ def __repr__(self) -> str: class SyncListContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the SyncListContext @@ -376,6 +375,7 @@ def __repr__(self) -> str: class SyncListPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncListInstance: """ Build an instance of SyncListInstance @@ -396,6 +396,7 @@ def __repr__(self) -> str: class SyncListList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the SyncListList 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 0959b0e516..02dafcd49b 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class SyncListItemInstance(InstanceResource): + class QueryFromBoundType(object): INCLUSIVE = "inclusive" EXCLUSIVE = "exclusive" @@ -205,6 +205,7 @@ def __repr__(self) -> str: class SyncListItemContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, list_sid: str, index: int): """ Initialize the SyncListItemContext @@ -403,6 +404,7 @@ def __repr__(self) -> str: class SyncListItemPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncListItemInstance: """ Build an instance of SyncListItemInstance @@ -426,6 +428,7 @@ def __repr__(self) -> str: class SyncListItemList(ListResource): + def __init__(self, version: Version, service_sid: str, list_sid: str): """ Initialize the SyncListItemList diff --git a/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py b/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py index f0d970b18d..228ab0d192 100644 --- a/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py +++ b/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class SyncListPermissionInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Sync List Permission resource. :ivar service_sid: The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. @@ -161,6 +159,7 @@ def __repr__(self) -> str: class SyncListPermissionContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, list_sid: str, identity: str ): @@ -331,6 +330,7 @@ def __repr__(self) -> str: class SyncListPermissionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncListPermissionInstance: """ Build an instance of SyncListPermissionInstance @@ -354,6 +354,7 @@ def __repr__(self) -> str: class SyncListPermissionList(ListResource): + def __init__(self, version: Version, service_sid: str, list_sid: str): """ Initialize the SyncListPermissionList diff --git a/twilio/rest/sync/v1/service/sync_map/__init__.py b/twilio/rest/sync/v1/service/sync_map/__init__.py index 9f034f5583..1a68e8ef4d 100644 --- a/twilio/rest/sync/v1/service/sync_map/__init__.py +++ b/twilio/rest/sync/v1/service/sync_map/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,7 +27,6 @@ class SyncMapInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Sync Map resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. @@ -189,6 +187,7 @@ def __repr__(self) -> str: class SyncMapContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the SyncMapContext @@ -376,6 +375,7 @@ def __repr__(self) -> str: class SyncMapPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncMapInstance: """ Build an instance of SyncMapInstance @@ -396,6 +396,7 @@ def __repr__(self) -> str: class SyncMapList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the SyncMapList 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 e3a7f321b0..7c621f8adc 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class SyncMapItemInstance(InstanceResource): + class QueryFromBoundType(object): INCLUSIVE = "inclusive" EXCLUSIVE = "exclusive" @@ -205,6 +205,7 @@ def __repr__(self) -> str: class SyncMapItemContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, map_sid: str, key: str): """ Initialize the SyncMapItemContext @@ -403,6 +404,7 @@ def __repr__(self) -> str: class SyncMapItemPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncMapItemInstance: """ Build an instance of SyncMapItemInstance @@ -426,6 +428,7 @@ def __repr__(self) -> str: class SyncMapItemList(ListResource): + def __init__(self, version: Version, service_sid: str, map_sid: str): """ Initialize the SyncMapItemList diff --git a/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py b/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py index ee34694dd4..3f204d65ba 100644 --- a/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py +++ b/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class SyncMapPermissionInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Sync Map Permission resource. :ivar service_sid: The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. @@ -161,6 +159,7 @@ def __repr__(self) -> str: class SyncMapPermissionContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, map_sid: str, identity: str): """ Initialize the SyncMapPermissionContext @@ -329,6 +328,7 @@ def __repr__(self) -> str: class SyncMapPermissionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncMapPermissionInstance: """ Build an instance of SyncMapPermissionInstance @@ -352,6 +352,7 @@ def __repr__(self) -> str: class SyncMapPermissionList(ListResource): + def __init__(self, version: Version, service_sid: str, map_sid: str): """ Initialize the SyncMapPermissionList diff --git a/twilio/rest/sync/v1/service/sync_stream/__init__.py b/twilio/rest/sync/v1/service/sync_stream/__init__.py index 584783c98a..aa10d164a6 100644 --- a/twilio/rest/sync/v1/service/sync_stream/__init__.py +++ b/twilio/rest/sync/v1/service/sync_stream/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class SyncStreamInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Sync Stream resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. @@ -167,6 +165,7 @@ def __repr__(self) -> str: class SyncStreamContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the SyncStreamContext @@ -330,6 +329,7 @@ def __repr__(self) -> str: class SyncStreamPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncStreamInstance: """ Build an instance of SyncStreamInstance @@ -350,6 +350,7 @@ def __repr__(self) -> str: class SyncStreamList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the SyncStreamList 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 eb9ac365bf..88a7604a7a 100644 --- a/twilio/rest/sync/v1/service/sync_stream/stream_message.py +++ b/twilio/rest/sync/v1/service/sync_stream/stream_message.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base import serialize, values @@ -22,7 +21,6 @@ class StreamMessageInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Stream Message resource. :ivar data: An arbitrary, schema-less object that contains the Stream Message body. Can be up to 4 KiB in length. @@ -56,6 +54,7 @@ def __repr__(self) -> str: class StreamMessageList(ListResource): + def __init__(self, version: Version, service_sid: str, stream_sid: str): """ Initialize the StreamMessageList diff --git a/twilio/rest/taskrouter/TaskrouterBase.py b/twilio/rest/taskrouter/TaskrouterBase.py index ee7fbfd7e8..4bbbdb602e 100644 --- a/twilio/rest/taskrouter/TaskrouterBase.py +++ b/twilio/rest/taskrouter/TaskrouterBase.py @@ -17,6 +17,7 @@ class TaskrouterBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Taskrouter Domain diff --git a/twilio/rest/taskrouter/v1/__init__.py b/twilio/rest/taskrouter/v1/__init__.py index a331fb3497..a17eeccc2a 100644 --- a/twilio/rest/taskrouter/v1/__init__.py +++ b/twilio/rest/taskrouter/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Taskrouter diff --git a/twilio/rest/taskrouter/v1/workspace/__init__.py b/twilio/rest/taskrouter/v1/workspace/__init__.py index 479abeaa8a..0b0136fedc 100644 --- a/twilio/rest/taskrouter/v1/workspace/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -40,6 +39,7 @@ class WorkspaceInstance(InstanceResource): + class QueueOrder(object): FIFO = "FIFO" LIFO = "LIFO" @@ -83,9 +83,9 @@ def __init__( self.sid: Optional[str] = payload.get("sid") self.timeout_activity_name: Optional[str] = payload.get("timeout_activity_name") self.timeout_activity_sid: Optional[str] = payload.get("timeout_activity_sid") - self.prioritize_queue_order: Optional[ - "WorkspaceInstance.QueueOrder" - ] = payload.get("prioritize_queue_order") + self.prioritize_queue_order: Optional["WorkspaceInstance.QueueOrder"] = ( + payload.get("prioritize_queue_order") + ) self.url: Optional[str] = payload.get("url") self.links: Optional[Dict[str, object]] = payload.get("links") @@ -296,6 +296,7 @@ def __repr__(self) -> str: class WorkspaceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the WorkspaceContext @@ -605,6 +606,7 @@ def __repr__(self) -> str: class WorkspacePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WorkspaceInstance: """ Build an instance of WorkspaceInstance @@ -623,6 +625,7 @@ def __repr__(self) -> str: class WorkspaceList(ListResource): + def __init__(self, version: Version): """ Initialize the WorkspaceList diff --git a/twilio/rest/taskrouter/v1/workspace/activity.py b/twilio/rest/taskrouter/v1/workspace/activity.py index 91a18c7822..3ab15acf8e 100644 --- a/twilio/rest/taskrouter/v1/workspace/activity.py +++ b/twilio/rest/taskrouter/v1/workspace/activity.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ActivityInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Activity resource. :ivar available: Whether the Worker is eligible to receive a Task when it occupies the Activity. A value of `true`, `1`, or `yes` indicates the Activity is available. All other values indicate that it is not. The value cannot be changed after the Activity is created. @@ -157,6 +155,7 @@ def __repr__(self) -> str: class ActivityContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, sid: str): """ Initialize the ActivityContext @@ -309,6 +308,7 @@ def __repr__(self) -> str: class ActivityPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ActivityInstance: """ Build an instance of ActivityInstance @@ -329,6 +329,7 @@ def __repr__(self) -> str: class ActivityList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the ActivityList diff --git a/twilio/rest/taskrouter/v1/workspace/event.py b/twilio/rest/taskrouter/v1/workspace/event.py index 82f71317e2..534d9cd120 100644 --- a/twilio/rest/taskrouter/v1/workspace/event.py +++ b/twilio/rest/taskrouter/v1/workspace/event.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class EventInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Event resource. :ivar actor_sid: The SID of the resource that triggered the event. @@ -125,6 +123,7 @@ def __repr__(self) -> str: class EventContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, sid: str): """ Initialize the EventContext @@ -193,6 +192,7 @@ def __repr__(self) -> str: class EventPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EventInstance: """ Build an instance of EventInstance @@ -213,6 +213,7 @@ def __repr__(self) -> str: class EventList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the EventList diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index f62da1759f..708db25105 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -25,6 +24,7 @@ class TaskInstance(InstanceResource): + class Status(object): PENDING = "pending" RESERVED = "reserved" @@ -254,6 +254,7 @@ def __repr__(self) -> str: class TaskContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, sid: str): """ Initialize the TaskContext @@ -471,6 +472,7 @@ def __repr__(self) -> str: class TaskPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TaskInstance: """ Build an instance of TaskInstance @@ -491,6 +493,7 @@ def __repr__(self) -> str: class TaskList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the TaskList diff --git a/twilio/rest/taskrouter/v1/workspace/task/reservation.py b/twilio/rest/taskrouter/v1/workspace/task/reservation.py index 32e7c6b4da..7ac7807c0e 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/task/reservation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class ReservationInstance(InstanceResource): + class CallStatus(object): INITIATED = "initiated" RINGING = "ringing" @@ -200,6 +200,7 @@ def update( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Update the ReservationInstance @@ -258,6 +259,7 @@ def update( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -316,6 +318,7 @@ def update( supervisor=supervisor, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, + jitter_buffer_size=jitter_buffer_size, ) async def update_async( @@ -380,6 +383,7 @@ async def update_async( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Asynchronous coroutine to update the ReservationInstance @@ -438,6 +442,7 @@ async def update_async( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -496,6 +501,7 @@ async def update_async( supervisor=supervisor, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, + jitter_buffer_size=jitter_buffer_size, ) def __repr__(self) -> str: @@ -509,6 +515,7 @@ def __repr__(self) -> str: class ReservationContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, task_sid: str, sid: str): """ Initialize the ReservationContext @@ -636,6 +643,7 @@ def update( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Update the ReservationInstance @@ -694,6 +702,7 @@ def update( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -758,6 +767,7 @@ def update( "Supervisor": supervisor, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, + "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( @@ -840,6 +850,7 @@ async def update_async( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Asynchronous coroutine to update the ReservationInstance @@ -898,6 +909,7 @@ async def update_async( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -962,6 +974,7 @@ async def update_async( "Supervisor": supervisor, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, + "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( @@ -993,6 +1006,7 @@ def __repr__(self) -> str: class ReservationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ReservationInstance: """ Build an instance of ReservationInstance @@ -1016,6 +1030,7 @@ def __repr__(self) -> str: class ReservationList(ListResource): + def __init__(self, version: Version, workspace_sid: str, task_sid: str): """ Initialize the ReservationList diff --git a/twilio/rest/taskrouter/v1/workspace/task_channel.py b/twilio/rest/taskrouter/v1/workspace/task_channel.py index 5744a3cba4..780c4ef9fa 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/task_channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class TaskChannelInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Task Channel resource. :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. @@ -169,6 +167,7 @@ def __repr__(self) -> str: class TaskChannelContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, sid: str): """ Initialize the TaskChannelContext @@ -329,6 +328,7 @@ def __repr__(self) -> str: class TaskChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TaskChannelInstance: """ Build an instance of TaskChannelInstance @@ -349,6 +349,7 @@ def __repr__(self) -> str: class TaskChannelList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the TaskChannelList diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py index 82aaee6990..794fd216d3 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -39,6 +38,7 @@ class TaskQueueInstance(InstanceResource): + class TaskOrder(object): FIFO = "FIFO" LIFO = "LIFO" @@ -252,6 +252,7 @@ def __repr__(self) -> str: class TaskQueueContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, sid: str): """ Initialize the TaskQueueContext @@ -479,6 +480,7 @@ def __repr__(self) -> str: class TaskQueuePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TaskQueueInstance: """ Build an instance of TaskQueueInstance @@ -499,6 +501,7 @@ def __repr__(self) -> str: class TaskQueueList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the TaskQueueList 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 eb8748e095..90552babf3 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional from twilio.base import deserialize @@ -22,11 +21,10 @@ class TaskQueueBulkRealTimeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. :ivar workspace_sid: The SID of the Workspace that contains the TaskQueue. - :ivar task_queue_data: The real time statistics for each requested TaskQueue SID. `task_queue_data` returns the following attributes: `task_queue_sid`: The SID of the TaskQueue from which these statistics were calculated. `total_available_workers`: The total number of Workers available for Tasks in the TaskQueue. `total_eligible_workers`: The total number of Workers eligible for Tasks in the TaskQueue, regardless of their Activity state. `total_tasks`: The total number of Tasks. `longest_task_waiting_age`: The age of the longest waiting Task. `longest_task_waiting_sid`: The SID of the longest waiting Task. `tasks_by_status`: The number of Tasks grouped by their current status. `tasks_by_priority`: The number of Tasks grouped by priority. `activity_statistics`: The number of current Workers grouped by Activity. + :ivar task_queue_data: The real-time statistics for each requested TaskQueue SID. `task_queue_data` returns the following attributes: `task_queue_sid`: The SID of the TaskQueue from which these statistics were calculated. `total_available_workers`: The total number of Workers available for Tasks in the TaskQueue. `total_eligible_workers`: The total number of Workers eligible for Tasks in the TaskQueue, regardless of their Activity state. `total_tasks`: The total number of Tasks. `longest_task_waiting_age`: The age of the longest waiting Task. `longest_task_waiting_sid`: The SID of the longest waiting Task. `tasks_by_status`: The number of Tasks grouped by their current status. `tasks_by_priority`: The number of Tasks grouped by priority. `activity_statistics`: The number of current Workers grouped by Activity. :ivar task_queue_response_count: The number of TaskQueue statistics received in task_queue_data. :ivar url: The absolute URL of the TaskQueue statistics resource. """ @@ -63,6 +61,7 @@ def __repr__(self) -> str: class TaskQueueBulkRealTimeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the TaskQueueBulkRealTimeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py index 94c213b626..acb8b79a29 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,7 +22,6 @@ class TaskQueueCumulativeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. :ivar avg_task_acceptance_time: The average time in seconds between Task creation and acceptance. @@ -96,9 +94,9 @@ def __init__( self.wait_duration_until_canceled: Optional[Dict[str, object]] = payload.get( "wait_duration_until_canceled" ) - self.wait_duration_in_queue_until_accepted: Optional[ - Dict[str, object] - ] = payload.get("wait_duration_in_queue_until_accepted") + self.wait_duration_in_queue_until_accepted: Optional[Dict[str, object]] = ( + payload.get("wait_duration_in_queue_until_accepted") + ) self.tasks_canceled: Optional[int] = deserialize.integer( payload.get("tasks_canceled") ) @@ -206,6 +204,7 @@ def __repr__(self) -> str: class TaskQueueCumulativeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, task_queue_sid: str): """ Initialize the TaskQueueCumulativeStatisticsContext @@ -318,6 +317,7 @@ def __repr__(self) -> str: class TaskQueueCumulativeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str, task_queue_sid: str): """ Initialize the TaskQueueCumulativeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py index 1fc18c16f1..faca804702 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class TaskQueueRealTimeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. :ivar activity_statistics: The number of current Workers by Activity. @@ -147,6 +145,7 @@ def __repr__(self) -> str: class TaskQueueRealTimeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, task_queue_sid: str): """ Initialize the TaskQueueRealTimeStatisticsContext @@ -233,6 +232,7 @@ def __repr__(self) -> str: class TaskQueueRealTimeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str, task_queue_sid: str): """ Initialize the TaskQueueRealTimeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py index 97fef95c2c..2a09f62a68 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import serialize, values @@ -23,7 +22,6 @@ class TaskQueueStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. :ivar cumulative: An object that contains the cumulative statistics for the TaskQueue. @@ -136,6 +134,7 @@ def __repr__(self) -> str: class TaskQueueStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, task_queue_sid: str): """ Initialize the TaskQueueStatisticsContext @@ -248,6 +247,7 @@ def __repr__(self) -> str: class TaskQueueStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str, task_queue_sid: str): """ Initialize the TaskQueueStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py index 091715e7dd..bec2d81b40 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values @@ -24,7 +23,6 @@ class TaskQueuesStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. :ivar cumulative: An object that contains the cumulative statistics for the TaskQueues. @@ -57,6 +55,7 @@ def __repr__(self) -> str: class TaskQueuesStatisticsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TaskQueuesStatisticsInstance: """ Build an instance of TaskQueuesStatisticsInstance @@ -77,6 +76,7 @@ def __repr__(self) -> str: class TaskQueuesStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the TaskQueuesStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py index 5eecad38ba..a3ce2db7d4 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -38,7 +37,6 @@ class WorkerInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. :ivar activity_name: The `friendly_name` of the Worker's current Activity. @@ -234,6 +232,7 @@ def __repr__(self) -> str: class WorkerContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, sid: str): """ Initialize the WorkerContext @@ -467,6 +466,7 @@ def __repr__(self) -> str: class WorkerPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WorkerInstance: """ Build an instance of WorkerInstance @@ -487,6 +487,7 @@ def __repr__(self) -> str: class WorkerList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkerList diff --git a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py index e99705d669..2f62c433ef 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class ReservationInstance(InstanceResource): + class CallStatus(object): INITIATED = "initiated" RINGING = "ringing" @@ -191,6 +191,7 @@ def update( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Update the ReservationInstance @@ -247,6 +248,7 @@ def update( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -303,6 +305,7 @@ def update( post_work_activity_sid=post_work_activity_sid, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, + jitter_buffer_size=jitter_buffer_size, ) async def update_async( @@ -363,6 +366,7 @@ async def update_async( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Asynchronous coroutine to update the ReservationInstance @@ -419,6 +423,7 @@ async def update_async( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -475,6 +480,7 @@ async def update_async( post_work_activity_sid=post_work_activity_sid, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, + jitter_buffer_size=jitter_buffer_size, ) def __repr__(self) -> str: @@ -488,6 +494,7 @@ def __repr__(self) -> str: class ReservationContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, worker_sid: str, sid: str): """ Initialize the ReservationContext @@ -609,6 +616,7 @@ def update( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Update the ReservationInstance @@ -665,6 +673,7 @@ def update( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -727,6 +736,7 @@ def update( "PostWorkActivitySid": post_work_activity_sid, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, + "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( @@ -805,6 +815,7 @@ async def update_async( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Asynchronous coroutine to update the ReservationInstance @@ -861,6 +872,7 @@ async def update_async( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -923,6 +935,7 @@ async def update_async( "PostWorkActivitySid": post_work_activity_sid, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, + "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( @@ -954,6 +967,7 @@ def __repr__(self) -> str: class ReservationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ReservationInstance: """ Build an instance of ReservationInstance @@ -977,6 +991,7 @@ def __repr__(self) -> str: class ReservationList(ListResource): + def __init__(self, version: Version, workspace_sid: str, worker_sid: str): """ Initialize the ReservationList diff --git a/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py b/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py index 74c8531af6..64f0c3afe9 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class WorkerChannelInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. :ivar assigned_tasks: The total number of Tasks assigned to Worker for the TaskChannel type. @@ -166,6 +164,7 @@ def __repr__(self) -> str: class WorkerChannelContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, worker_sid: str, sid: str): """ Initialize the WorkerChannelContext @@ -310,6 +309,7 @@ def __repr__(self) -> str: class WorkerChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WorkerChannelInstance: """ Build an instance of WorkerChannelInstance @@ -333,6 +333,7 @@ def __repr__(self) -> str: class WorkerChannelList(ListResource): + def __init__(self, version: Version, workspace_sid: str, worker_sid: str): """ Initialize the WorkerChannelList diff --git a/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py index 7724d5caf0..61618d2961 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import serialize, values @@ -23,7 +22,6 @@ class WorkerStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. :ivar cumulative: An object that contains the cumulative statistics for the Worker. @@ -128,6 +126,7 @@ def __repr__(self) -> str: class WorkerStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, worker_sid: str): """ Initialize the WorkerStatisticsContext @@ -234,6 +233,7 @@ def __repr__(self) -> str: class WorkerStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str, worker_sid: str): """ Initialize the WorkerStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py index dad1f6ff26..b18e7f123b 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,7 +22,6 @@ class WorkersCumulativeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. :ivar start_time: The beginning of the interval during which these statistics were calculated, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. @@ -154,6 +152,7 @@ def __repr__(self) -> str: class WorkersCumulativeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkersCumulativeStatisticsContext @@ -256,6 +255,7 @@ def __repr__(self) -> str: class WorkersCumulativeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkersCumulativeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py index 8047c65ad8..277889ae7a 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class WorkersRealTimeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. :ivar activity_statistics: The number of current Workers by Activity. @@ -105,6 +103,7 @@ def __repr__(self) -> str: class WorkersRealTimeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkersRealTimeStatisticsContext @@ -187,6 +186,7 @@ def __repr__(self) -> str: class WorkersRealTimeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkersRealTimeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py index 58ef59969b..0cd09ec124 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import serialize, values @@ -23,7 +22,6 @@ class WorkersStatisticsInstance(InstanceResource): - """ :ivar realtime: An object that contains the real-time statistics for the Worker. :ivar cumulative: An object that contains the cumulative statistics for the Worker. @@ -138,6 +136,7 @@ def __repr__(self) -> str: class WorkersStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkersStatisticsContext @@ -256,6 +255,7 @@ def __repr__(self) -> str: class WorkersStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkersStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py index dff4bd0ba8..f01e76d379 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -33,7 +32,6 @@ class WorkflowInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workflow resource. :ivar assignment_callback_url: The URL that we call when a task managed by the Workflow is assigned to a Worker. See Assignment Callback URL for more information. @@ -233,6 +231,7 @@ def __repr__(self) -> str: class WorkflowContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, sid: str): """ Initialize the WorkflowContext @@ -460,6 +459,7 @@ def __repr__(self) -> str: class WorkflowPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WorkflowInstance: """ Build an instance of WorkflowInstance @@ -480,6 +480,7 @@ def __repr__(self) -> str: class WorkflowList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkflowList diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py index 28e557b8c2..e06cab0114 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,7 +22,6 @@ class WorkflowCumulativeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workflow resource. :ivar avg_task_acceptance_time: The average time in seconds between Task creation and acceptance. @@ -206,6 +204,7 @@ def __repr__(self) -> str: class WorkflowCumulativeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, workflow_sid: str): """ Initialize the WorkflowCumulativeStatisticsContext @@ -318,6 +317,7 @@ def __repr__(self) -> str: class WorkflowCumulativeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str, workflow_sid: str): """ Initialize the WorkflowCumulativeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py index 55a41f5d84..415d4223e4 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class WorkflowRealTimeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workflow resource. :ivar longest_task_waiting_age: The age of the longest waiting Task. @@ -127,6 +125,7 @@ def __repr__(self) -> str: class WorkflowRealTimeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, workflow_sid: str): """ Initialize the WorkflowRealTimeStatisticsContext @@ -213,6 +212,7 @@ def __repr__(self) -> str: class WorkflowRealTimeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str, workflow_sid: str): """ Initialize the WorkflowRealTimeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py index 521b2921b7..f86590e40f 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import serialize, values @@ -23,7 +22,6 @@ class WorkflowStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workflow resource. :ivar cumulative: An object that contains the cumulative statistics for the Workflow. @@ -136,6 +134,7 @@ def __repr__(self) -> str: class WorkflowStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, workflow_sid: str): """ Initialize the WorkflowStatisticsContext @@ -248,6 +247,7 @@ def __repr__(self) -> str: class WorkflowStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str, workflow_sid: str): """ Initialize the WorkflowStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py index 71e8a56a7a..2b223641ae 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,7 +22,6 @@ class WorkspaceCumulativeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workspace resource. :ivar avg_task_acceptance_time: The average time in seconds between Task creation and acceptance. @@ -196,6 +194,7 @@ def __repr__(self) -> str: class WorkspaceCumulativeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkspaceCumulativeStatisticsContext @@ -304,6 +303,7 @@ def __repr__(self) -> str: class WorkspaceCumulativeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkspaceCumulativeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py index 8571bf3e05..35b50c0b21 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class WorkspaceRealTimeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workspace resource. :ivar activity_statistics: The number of current Workers by Activity. @@ -125,6 +123,7 @@ def __repr__(self) -> str: class WorkspaceRealTimeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkspaceRealTimeStatisticsContext @@ -207,6 +206,7 @@ def __repr__(self) -> str: class WorkspaceRealTimeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkspaceRealTimeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py index 443ee93903..19eb885675 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import serialize, values @@ -23,7 +22,6 @@ class WorkspaceStatisticsInstance(InstanceResource): - """ :ivar realtime: An object that contains the real-time statistics for the Workspace. :ivar cumulative: An object that contains the cumulative statistics for the Workspace. @@ -126,6 +124,7 @@ def __repr__(self) -> str: class WorkspaceStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkspaceStatisticsContext @@ -230,6 +229,7 @@ def __repr__(self) -> str: class WorkspaceStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkspaceStatisticsList diff --git a/twilio/rest/trunking/TrunkingBase.py b/twilio/rest/trunking/TrunkingBase.py index 627790454d..bed8f9a2a9 100644 --- a/twilio/rest/trunking/TrunkingBase.py +++ b/twilio/rest/trunking/TrunkingBase.py @@ -17,6 +17,7 @@ class TrunkingBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Trunking Domain diff --git a/twilio/rest/trunking/v1/__init__.py b/twilio/rest/trunking/v1/__init__.py index 89dc5c1087..af530b97c7 100644 --- a/twilio/rest/trunking/v1/__init__.py +++ b/twilio/rest/trunking/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Trunking diff --git a/twilio/rest/trunking/v1/trunk/__init__.py b/twilio/rest/trunking/v1/trunk/__init__.py index 4b1b8c7937..935ce2718d 100644 --- a/twilio/rest/trunking/v1/trunk/__init__.py +++ b/twilio/rest/trunking/v1/trunk/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -29,6 +28,7 @@ class TrunkInstance(InstanceResource): + class TransferCallerId(object): FROM_TRANSFEREE = "from-transferee" FROM_TRANSFEROR = "from-transferor" @@ -75,9 +75,9 @@ def __init__( self.transfer_mode: Optional["TrunkInstance.TransferSetting"] = payload.get( "transfer_mode" ) - self.transfer_caller_id: Optional[ - "TrunkInstance.TransferCallerId" - ] = payload.get("transfer_caller_id") + self.transfer_caller_id: Optional["TrunkInstance.TransferCallerId"] = ( + payload.get("transfer_caller_id") + ) self.cnam_lookup_enabled: Optional[bool] = payload.get("cnam_lookup_enabled") self.auth_type: Optional[str] = payload.get("auth_type") self.auth_type_set: Optional[List[str]] = payload.get("auth_type_set") @@ -269,6 +269,7 @@ def __repr__(self) -> str: class TrunkContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the TrunkContext @@ -519,6 +520,7 @@ def __repr__(self) -> str: class TrunkPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TrunkInstance: """ Build an instance of TrunkInstance @@ -537,6 +539,7 @@ def __repr__(self) -> str: class TrunkList(ListResource): + def __init__(self, version: Version): """ Initialize the TrunkList diff --git a/twilio/rest/trunking/v1/trunk/credential_list.py b/twilio/rest/trunking/v1/trunk/credential_list.py index 3caf6e5423..7dc043d286 100644 --- a/twilio/rest/trunking/v1/trunk/credential_list.py +++ b/twilio/rest/trunking/v1/trunk/credential_list.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class CredentialListInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialList resource. :ivar sid: The unique string that we created to identify the CredentialList resource. @@ -125,6 +123,7 @@ def __repr__(self) -> str: class CredentialListContext(InstanceContext): + def __init__(self, version: Version, trunk_sid: str, sid: str): """ Initialize the CredentialListContext @@ -217,6 +216,7 @@ def __repr__(self) -> str: class CredentialListPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialListInstance: """ Build an instance of CredentialListInstance @@ -237,6 +237,7 @@ def __repr__(self) -> str: class CredentialListList(ListResource): + def __init__(self, version: Version, trunk_sid: str): """ Initialize the CredentialListList 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 38d6e4f03e..b361e7fe9f 100644 --- a/twilio/rest/trunking/v1/trunk/ip_access_control_list.py +++ b/twilio/rest/trunking/v1/trunk/ip_access_control_list.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class IpAccessControlListInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IpAccessControlList resource. :ivar sid: The unique string that we created to identify the IpAccessControlList resource. @@ -125,6 +123,7 @@ def __repr__(self) -> str: class IpAccessControlListContext(InstanceContext): + def __init__(self, version: Version, trunk_sid: str, sid: str): """ Initialize the IpAccessControlListContext @@ -219,6 +218,7 @@ def __repr__(self) -> str: class IpAccessControlListPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> IpAccessControlListInstance: """ Build an instance of IpAccessControlListInstance @@ -239,6 +239,7 @@ def __repr__(self) -> str: class IpAccessControlListList(ListResource): + def __init__(self, version: Version, trunk_sid: str): """ Initialize the IpAccessControlListList diff --git a/twilio/rest/trunking/v1/trunk/origination_url.py b/twilio/rest/trunking/v1/trunk/origination_url.py index 2b7f48f436..426938995e 100644 --- a/twilio/rest/trunking/v1/trunk/origination_url.py +++ b/twilio/rest/trunking/v1/trunk/origination_url.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class OriginationUrlInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the OriginationUrl resource. :ivar sid: The unique string that we created to identify the OriginationUrl resource. @@ -187,6 +185,7 @@ def __repr__(self) -> str: class OriginationUrlContext(InstanceContext): + def __init__(self, version: Version, trunk_sid: str, sid: str): """ Initialize the OriginationUrlContext @@ -363,6 +362,7 @@ def __repr__(self) -> str: class OriginationUrlPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> OriginationUrlInstance: """ Build an instance of OriginationUrlInstance @@ -383,6 +383,7 @@ def __repr__(self) -> str: class OriginationUrlList(ListResource): + def __init__(self, version: Version, trunk_sid: str): """ Initialize the OriginationUrlList diff --git a/twilio/rest/trunking/v1/trunk/phone_number.py b/twilio/rest/trunking/v1/trunk/phone_number.py index 41b78e4627..7f0adbeef1 100644 --- a/twilio/rest/trunking/v1/trunk/phone_number.py +++ b/twilio/rest/trunking/v1/trunk/phone_number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class PhoneNumberInstance(InstanceResource): + class AddressRequirement(object): NONE = "none" ANY = "any" @@ -174,6 +174,7 @@ def __repr__(self) -> str: class PhoneNumberContext(InstanceContext): + def __init__(self, version: Version, trunk_sid: str, sid: str): """ Initialize the PhoneNumberContext @@ -266,6 +267,7 @@ def __repr__(self) -> str: class PhoneNumberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PhoneNumberInstance: """ Build an instance of PhoneNumberInstance @@ -286,6 +288,7 @@ def __repr__(self) -> str: class PhoneNumberList(ListResource): + def __init__(self, version: Version, trunk_sid: str): """ Initialize the PhoneNumberList diff --git a/twilio/rest/trunking/v1/trunk/recording.py b/twilio/rest/trunking/v1/trunk/recording.py index 02d9ca290d..1a431b496b 100644 --- a/twilio/rest/trunking/v1/trunk/recording.py +++ b/twilio/rest/trunking/v1/trunk/recording.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,6 +21,7 @@ class RecordingInstance(InstanceResource): + class RecordingMode(object): DO_NOT_RECORD = "do-not-record" RECORD_FROM_RINGING = "record-from-ringing" @@ -129,6 +129,7 @@ def __repr__(self) -> str: class RecordingContext(InstanceContext): + def __init__(self, version: Version, trunk_sid: str): """ Initialize the RecordingContext @@ -253,6 +254,7 @@ def __repr__(self) -> str: class RecordingList(ListResource): + def __init__(self, version: Version, trunk_sid: str): """ Initialize the RecordingList diff --git a/twilio/rest/trusthub/TrusthubBase.py b/twilio/rest/trusthub/TrusthubBase.py index f58cc7cfec..97fd32f9b7 100644 --- a/twilio/rest/trusthub/TrusthubBase.py +++ b/twilio/rest/trusthub/TrusthubBase.py @@ -17,6 +17,7 @@ class TrusthubBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Trusthub Domain diff --git a/twilio/rest/trusthub/v1/__init__.py b/twilio/rest/trusthub/v1/__init__.py index 7d11abd1ec..596c5ea758 100644 --- a/twilio/rest/trusthub/v1/__init__.py +++ b/twilio/rest/trusthub/v1/__init__.py @@ -16,6 +16,9 @@ from twilio.base.version import Version from twilio.base.domain import Domain from twilio.rest.trusthub.v1.compliance_inquiries import ComplianceInquiriesList +from twilio.rest.trusthub.v1.compliance_registration_inquiries import ( + ComplianceRegistrationInquiriesList, +) from twilio.rest.trusthub.v1.compliance_tollfree_inquiries import ( ComplianceTollfreeInquiriesList, ) @@ -29,6 +32,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Trusthub @@ -37,6 +41,9 @@ def __init__(self, domain: Domain): """ super().__init__(domain, "v1") self._compliance_inquiries: Optional[ComplianceInquiriesList] = None + self._compliance_registration_inquiries: Optional[ + ComplianceRegistrationInquiriesList + ] = None self._compliance_tollfree_inquiries: Optional[ ComplianceTollfreeInquiriesList ] = None @@ -54,6 +61,14 @@ def compliance_inquiries(self) -> ComplianceInquiriesList: self._compliance_inquiries = ComplianceInquiriesList(self) return self._compliance_inquiries + @property + def compliance_registration_inquiries(self) -> ComplianceRegistrationInquiriesList: + if self._compliance_registration_inquiries is None: + self._compliance_registration_inquiries = ( + ComplianceRegistrationInquiriesList(self) + ) + return self._compliance_registration_inquiries + @property def compliance_tollfree_inquiries(self) -> ComplianceTollfreeInquiriesList: if self._compliance_tollfree_inquiries is None: diff --git a/twilio/rest/trusthub/v1/compliance_inquiries.py b/twilio/rest/trusthub/v1/compliance_inquiries.py index 7a55b1ad7d..b1b52a4f78 100644 --- a/twilio/rest/trusthub/v1/compliance_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_inquiries.py @@ -12,8 +12,7 @@ Do not edit the class manually. """ - -from typing import Any, Dict, Optional +from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -22,7 +21,6 @@ class ComplianceInquiriesInstance(InstanceResource): - """ :ivar inquiry_id: The unique ID used to start an embedded compliance registration session. :ivar inquiry_session_token: The session token used to start an embedded compliance registration session. @@ -100,6 +98,7 @@ def __repr__(self) -> str: class ComplianceInquiriesContext(InstanceContext): + def __init__(self, version: Version, customer_id: str): """ Initialize the ComplianceInquiriesContext @@ -178,6 +177,7 @@ def __repr__(self) -> str: class ComplianceInquiriesList(ListResource): + def __init__(self, version: Version): """ Initialize the ComplianceInquiriesList @@ -189,11 +189,16 @@ def __init__(self, version: Version): self._uri = "/ComplianceInquiries/Customers/Initialize" - def create(self, primary_profile_sid: str) -> ComplianceInquiriesInstance: + def create( + self, + primary_profile_sid: str, + notification_email: Union[str, object] = values.unset, + ) -> ComplianceInquiriesInstance: """ Create the ComplianceInquiriesInstance :param primary_profile_sid: The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. + :param notification_email: The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. :returns: The created ComplianceInquiriesInstance """ @@ -201,6 +206,7 @@ def create(self, primary_profile_sid: str) -> ComplianceInquiriesInstance: data = values.of( { "PrimaryProfileSid": primary_profile_sid, + "NotificationEmail": notification_email, } ) @@ -213,12 +219,15 @@ def create(self, primary_profile_sid: str) -> ComplianceInquiriesInstance: return ComplianceInquiriesInstance(self._version, payload) async def create_async( - self, primary_profile_sid: str + self, + primary_profile_sid: str, + notification_email: Union[str, object] = values.unset, ) -> ComplianceInquiriesInstance: """ Asynchronously create the ComplianceInquiriesInstance :param primary_profile_sid: The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. + :param notification_email: The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. :returns: The created ComplianceInquiriesInstance """ @@ -226,6 +235,7 @@ async def create_async( data = values.of( { "PrimaryProfileSid": primary_profile_sid, + "NotificationEmail": notification_email, } ) diff --git a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py new file mode 100644 index 0000000000..264dd4ae31 --- /dev/null +++ b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py @@ -0,0 +1,316 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Trusthub + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional, Union +from twilio.base import values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class ComplianceRegistrationInquiriesInstance(InstanceResource): + + class BusinessIdentityType(object): + DIRECT_CUSTOMER = "direct_customer" + ISV_RESELLER_OR_PARTNER = "isv_reseller_or_partner" + UNKNOWN = "unknown" + + class EndUserType(object): + INDIVIDUAL = "Individual" + BUSINESS = "Business" + + class PhoneNumberType(object): + LOCAL = "local" + NATIONAL = "national" + MOBILE = "mobile" + TOLL_FREE = "toll-free" + + """ + :ivar inquiry_id: The unique ID used to start an embedded compliance registration session. + :ivar inquiry_session_token: The session token used to start an embedded compliance registration session. + :ivar registration_id: The RegistrationId matching the Registration Profile that should be resumed or resubmitted for editing. + :ivar url: The URL of this resource. + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.inquiry_id: Optional[str] = payload.get("inquiry_id") + self.inquiry_session_token: Optional[str] = payload.get("inquiry_session_token") + self.registration_id: Optional[str] = payload.get("registration_id") + self.url: Optional[str] = payload.get("url") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class ComplianceRegistrationInquiriesList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the ComplianceRegistrationInquiriesList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = ( + "/ComplianceInquiries/Registration/RegulatoryCompliance/GB/Initialize" + ) + + def create( + self, + end_user_type: "ComplianceRegistrationInquiriesInstance.EndUserType", + phone_number_type: "ComplianceRegistrationInquiriesInstance.PhoneNumberType", + business_identity_type: Union[ + "ComplianceRegistrationInquiriesInstance.BusinessIdentityType", object + ] = values.unset, + business_registration_authority: Union[str, object] = values.unset, + business_legal_name: Union[str, object] = values.unset, + notification_email: Union[str, object] = values.unset, + accepted_notification_receipt: Union[bool, object] = values.unset, + business_registration_number: Union[str, object] = values.unset, + business_website_url: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + authorized_representative1_first_name: Union[str, object] = values.unset, + authorized_representative1_last_name: Union[str, object] = values.unset, + authorized_representative1_phone: Union[str, object] = values.unset, + authorized_representative1_email: Union[str, object] = values.unset, + authorized_representative1_date_of_birth: Union[str, object] = values.unset, + address_street: Union[str, object] = values.unset, + address_street_secondary: Union[str, object] = values.unset, + address_city: Union[str, object] = values.unset, + address_subdivision: Union[str, object] = values.unset, + address_postal_code: Union[str, object] = values.unset, + address_country_code: Union[str, object] = values.unset, + emergency_address_street: Union[str, object] = values.unset, + emergency_address_street_secondary: Union[str, object] = values.unset, + emergency_address_city: Union[str, object] = values.unset, + emergency_address_subdivision: Union[str, object] = values.unset, + emergency_address_postal_code: Union[str, object] = values.unset, + emergency_address_country_code: Union[str, object] = values.unset, + use_address_as_emergency_address: Union[bool, object] = values.unset, + file_name: Union[str, object] = values.unset, + file: Union[str, object] = values.unset, + ) -> ComplianceRegistrationInquiriesInstance: + """ + Create the ComplianceRegistrationInquiriesInstance + + :param end_user_type: + :param phone_number_type: + :param business_identity_type: + :param business_registration_authority: The authority that registered the business + :param business_legal_name: he name of the business or organization using the Tollfree number. + :param notification_email: he email address to receive the notification about the verification result. + :param accepted_notification_receipt: The email address to receive the notification about the verification result. + :param business_registration_number: Business registration number of the business + :param business_website_url: The URL of the business website + :param friendly_name: Friendly name for your business information + :param authorized_representative1_first_name: First name of the authorized representative + :param authorized_representative1_last_name: Last name of the authorized representative + :param authorized_representative1_phone: Phone number of the authorized representative + :param authorized_representative1_email: Email address of the authorized representative + :param authorized_representative1_date_of_birth: Birthdate of the authorized representative + :param address_street: Street address of the business + :param address_street_secondary: Street address of the business + :param address_city: City of the business + :param address_subdivision: State or province of the business + :param address_postal_code: Postal code of the business + :param address_country_code: Country code of the business + :param emergency_address_street: Street address of the business + :param emergency_address_street_secondary: Street address of the business + :param emergency_address_city: City of the business + :param emergency_address_subdivision: State or province of the business + :param emergency_address_postal_code: Postal code of the business + :param emergency_address_country_code: Country code of the business + :param use_address_as_emergency_address: Use the business address as the emergency address + :param file_name: The name of the verification document to upload + :param file: The verification document to upload + + :returns: The created ComplianceRegistrationInquiriesInstance + """ + + data = values.of( + { + "EndUserType": end_user_type, + "PhoneNumberType": phone_number_type, + "BusinessIdentityType": business_identity_type, + "BusinessRegistrationAuthority": business_registration_authority, + "BusinessLegalName": business_legal_name, + "NotificationEmail": notification_email, + "AcceptedNotificationReceipt": accepted_notification_receipt, + "BusinessRegistrationNumber": business_registration_number, + "BusinessWebsiteUrl": business_website_url, + "FriendlyName": friendly_name, + "AuthorizedRepresentative1FirstName": authorized_representative1_first_name, + "AuthorizedRepresentative1LastName": authorized_representative1_last_name, + "AuthorizedRepresentative1Phone": authorized_representative1_phone, + "AuthorizedRepresentative1Email": authorized_representative1_email, + "AuthorizedRepresentative1DateOfBirth": authorized_representative1_date_of_birth, + "AddressStreet": address_street, + "AddressStreetSecondary": address_street_secondary, + "AddressCity": address_city, + "AddressSubdivision": address_subdivision, + "AddressPostalCode": address_postal_code, + "AddressCountryCode": address_country_code, + "EmergencyAddressStreet": emergency_address_street, + "EmergencyAddressStreetSecondary": emergency_address_street_secondary, + "EmergencyAddressCity": emergency_address_city, + "EmergencyAddressSubdivision": emergency_address_subdivision, + "EmergencyAddressPostalCode": emergency_address_postal_code, + "EmergencyAddressCountryCode": emergency_address_country_code, + "UseAddressAsEmergencyAddress": use_address_as_emergency_address, + "FileName": file_name, + "File": file, + } + ) + + payload = self._version.create( + method="POST", + uri=self._uri, + data=data, + ) + + return ComplianceRegistrationInquiriesInstance(self._version, payload) + + async def create_async( + self, + end_user_type: "ComplianceRegistrationInquiriesInstance.EndUserType", + phone_number_type: "ComplianceRegistrationInquiriesInstance.PhoneNumberType", + business_identity_type: Union[ + "ComplianceRegistrationInquiriesInstance.BusinessIdentityType", object + ] = values.unset, + business_registration_authority: Union[str, object] = values.unset, + business_legal_name: Union[str, object] = values.unset, + notification_email: Union[str, object] = values.unset, + accepted_notification_receipt: Union[bool, object] = values.unset, + business_registration_number: Union[str, object] = values.unset, + business_website_url: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + authorized_representative1_first_name: Union[str, object] = values.unset, + authorized_representative1_last_name: Union[str, object] = values.unset, + authorized_representative1_phone: Union[str, object] = values.unset, + authorized_representative1_email: Union[str, object] = values.unset, + authorized_representative1_date_of_birth: Union[str, object] = values.unset, + address_street: Union[str, object] = values.unset, + address_street_secondary: Union[str, object] = values.unset, + address_city: Union[str, object] = values.unset, + address_subdivision: Union[str, object] = values.unset, + address_postal_code: Union[str, object] = values.unset, + address_country_code: Union[str, object] = values.unset, + emergency_address_street: Union[str, object] = values.unset, + emergency_address_street_secondary: Union[str, object] = values.unset, + emergency_address_city: Union[str, object] = values.unset, + emergency_address_subdivision: Union[str, object] = values.unset, + emergency_address_postal_code: Union[str, object] = values.unset, + emergency_address_country_code: Union[str, object] = values.unset, + use_address_as_emergency_address: Union[bool, object] = values.unset, + file_name: Union[str, object] = values.unset, + file: Union[str, object] = values.unset, + ) -> ComplianceRegistrationInquiriesInstance: + """ + Asynchronously create the ComplianceRegistrationInquiriesInstance + + :param end_user_type: + :param phone_number_type: + :param business_identity_type: + :param business_registration_authority: The authority that registered the business + :param business_legal_name: he name of the business or organization using the Tollfree number. + :param notification_email: he email address to receive the notification about the verification result. + :param accepted_notification_receipt: The email address to receive the notification about the verification result. + :param business_registration_number: Business registration number of the business + :param business_website_url: The URL of the business website + :param friendly_name: Friendly name for your business information + :param authorized_representative1_first_name: First name of the authorized representative + :param authorized_representative1_last_name: Last name of the authorized representative + :param authorized_representative1_phone: Phone number of the authorized representative + :param authorized_representative1_email: Email address of the authorized representative + :param authorized_representative1_date_of_birth: Birthdate of the authorized representative + :param address_street: Street address of the business + :param address_street_secondary: Street address of the business + :param address_city: City of the business + :param address_subdivision: State or province of the business + :param address_postal_code: Postal code of the business + :param address_country_code: Country code of the business + :param emergency_address_street: Street address of the business + :param emergency_address_street_secondary: Street address of the business + :param emergency_address_city: City of the business + :param emergency_address_subdivision: State or province of the business + :param emergency_address_postal_code: Postal code of the business + :param emergency_address_country_code: Country code of the business + :param use_address_as_emergency_address: Use the business address as the emergency address + :param file_name: The name of the verification document to upload + :param file: The verification document to upload + + :returns: The created ComplianceRegistrationInquiriesInstance + """ + + data = values.of( + { + "EndUserType": end_user_type, + "PhoneNumberType": phone_number_type, + "BusinessIdentityType": business_identity_type, + "BusinessRegistrationAuthority": business_registration_authority, + "BusinessLegalName": business_legal_name, + "NotificationEmail": notification_email, + "AcceptedNotificationReceipt": accepted_notification_receipt, + "BusinessRegistrationNumber": business_registration_number, + "BusinessWebsiteUrl": business_website_url, + "FriendlyName": friendly_name, + "AuthorizedRepresentative1FirstName": authorized_representative1_first_name, + "AuthorizedRepresentative1LastName": authorized_representative1_last_name, + "AuthorizedRepresentative1Phone": authorized_representative1_phone, + "AuthorizedRepresentative1Email": authorized_representative1_email, + "AuthorizedRepresentative1DateOfBirth": authorized_representative1_date_of_birth, + "AddressStreet": address_street, + "AddressStreetSecondary": address_street_secondary, + "AddressCity": address_city, + "AddressSubdivision": address_subdivision, + "AddressPostalCode": address_postal_code, + "AddressCountryCode": address_country_code, + "EmergencyAddressStreet": emergency_address_street, + "EmergencyAddressStreetSecondary": emergency_address_street_secondary, + "EmergencyAddressCity": emergency_address_city, + "EmergencyAddressSubdivision": emergency_address_subdivision, + "EmergencyAddressPostalCode": emergency_address_postal_code, + "EmergencyAddressCountryCode": emergency_address_country_code, + "UseAddressAsEmergencyAddress": use_address_as_emergency_address, + "FileName": file_name, + "File": file, + } + ) + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + data=data, + ) + + return ComplianceRegistrationInquiriesInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py index 25598554f2..6c9d5b3d9b 100644 --- a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py @@ -12,9 +12,8 @@ Do not edit the class manually. """ - -from typing import Any, Dict, Optional -from twilio.base import values +from typing import Any, Dict, List, Optional, Union +from twilio.base import serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -23,6 +22,13 @@ class ComplianceTollfreeInquiriesInstance(InstanceResource): + class OptInType(object): + VERBAL = "VERBAL" + WEB_FORM = "WEB_FORM" + PAPER_FORM = "PAPER_FORM" + VIA_TEXT = "VIA_TEXT" + MOBILE_QR_CODE = "MOBILE_QR_CODE" + """ :ivar inquiry_id: The unique ID used to start an embedded compliance registration session. :ivar inquiry_session_token: The session token used to start an embedded compliance registration session. @@ -49,6 +55,7 @@ def __repr__(self) -> str: class ComplianceTollfreeInquiriesList(ListResource): + def __init__(self, version: Version): """ Initialize the ComplianceTollfreeInquiriesList @@ -61,13 +68,55 @@ def __init__(self, version: Version): self._uri = "/ComplianceInquiries/Tollfree/Initialize" def create( - self, tollfree_phone_number: str, notification_email: str + self, + tollfree_phone_number: str, + notification_email: str, + business_name: Union[str, object] = values.unset, + business_website: Union[str, object] = values.unset, + use_case_categories: Union[List[str], object] = values.unset, + use_case_summary: Union[str, object] = values.unset, + production_message_sample: Union[str, object] = values.unset, + opt_in_image_urls: Union[List[str], object] = values.unset, + opt_in_type: Union[ + "ComplianceTollfreeInquiriesInstance.OptInType", object + ] = values.unset, + message_volume: Union[str, object] = values.unset, + business_street_address: Union[str, object] = values.unset, + business_street_address2: Union[str, object] = values.unset, + business_city: Union[str, object] = values.unset, + business_state_province_region: Union[str, object] = values.unset, + business_postal_code: Union[str, object] = values.unset, + business_country: Union[str, object] = values.unset, + additional_information: Union[str, object] = values.unset, + business_contact_first_name: Union[str, object] = values.unset, + business_contact_last_name: Union[str, object] = values.unset, + business_contact_email: Union[str, object] = values.unset, + business_contact_phone: Union[str, object] = values.unset, ) -> ComplianceTollfreeInquiriesInstance: """ Create the ComplianceTollfreeInquiriesInstance :param tollfree_phone_number: The Tollfree phone number to be verified - :param notification_email: The notification email to be triggered when verification status is changed + :param notification_email: The email address to receive the notification about the verification result. + :param business_name: The name of the business or organization using the Tollfree number. + :param business_website: The website of the business or organization using the Tollfree number. + :param use_case_categories: The category of the use case for the Tollfree Number. List as many are applicable.. + :param use_case_summary: Use this to further explain how messaging is used by the business or organization. + :param production_message_sample: An example of message content, i.e. a sample message. + :param opt_in_image_urls: Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + :param opt_in_type: + :param message_volume: Estimate monthly volume of messages from the Tollfree Number. + :param business_street_address: The address of the business or organization using the Tollfree number. + :param business_street_address2: The address of the business or organization using the Tollfree number. + :param business_city: The city of the business or organization using the Tollfree number. + :param business_state_province_region: The state/province/region of the business or organization using the Tollfree number. + :param business_postal_code: The postal code of the business or organization using the Tollfree number. + :param business_country: The country of the business or organization using the Tollfree number. + :param additional_information: Additional information to be provided for verification. + :param business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. + :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. + :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. + :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. :returns: The created ComplianceTollfreeInquiriesInstance """ @@ -76,6 +125,25 @@ def create( { "TollfreePhoneNumber": tollfree_phone_number, "NotificationEmail": notification_email, + "BusinessName": business_name, + "BusinessWebsite": business_website, + "UseCaseCategories": serialize.map(use_case_categories, lambda e: e), + "UseCaseSummary": use_case_summary, + "ProductionMessageSample": production_message_sample, + "OptInImageUrls": serialize.map(opt_in_image_urls, lambda e: e), + "OptInType": opt_in_type, + "MessageVolume": message_volume, + "BusinessStreetAddress": business_street_address, + "BusinessStreetAddress2": business_street_address2, + "BusinessCity": business_city, + "BusinessStateProvinceRegion": business_state_province_region, + "BusinessPostalCode": business_postal_code, + "BusinessCountry": business_country, + "AdditionalInformation": additional_information, + "BusinessContactFirstName": business_contact_first_name, + "BusinessContactLastName": business_contact_last_name, + "BusinessContactEmail": business_contact_email, + "BusinessContactPhone": business_contact_phone, } ) @@ -88,13 +156,55 @@ def create( return ComplianceTollfreeInquiriesInstance(self._version, payload) async def create_async( - self, tollfree_phone_number: str, notification_email: str + self, + tollfree_phone_number: str, + notification_email: str, + business_name: Union[str, object] = values.unset, + business_website: Union[str, object] = values.unset, + use_case_categories: Union[List[str], object] = values.unset, + use_case_summary: Union[str, object] = values.unset, + production_message_sample: Union[str, object] = values.unset, + opt_in_image_urls: Union[List[str], object] = values.unset, + opt_in_type: Union[ + "ComplianceTollfreeInquiriesInstance.OptInType", object + ] = values.unset, + message_volume: Union[str, object] = values.unset, + business_street_address: Union[str, object] = values.unset, + business_street_address2: Union[str, object] = values.unset, + business_city: Union[str, object] = values.unset, + business_state_province_region: Union[str, object] = values.unset, + business_postal_code: Union[str, object] = values.unset, + business_country: Union[str, object] = values.unset, + additional_information: Union[str, object] = values.unset, + business_contact_first_name: Union[str, object] = values.unset, + business_contact_last_name: Union[str, object] = values.unset, + business_contact_email: Union[str, object] = values.unset, + business_contact_phone: Union[str, object] = values.unset, ) -> ComplianceTollfreeInquiriesInstance: """ Asynchronously create the ComplianceTollfreeInquiriesInstance :param tollfree_phone_number: The Tollfree phone number to be verified - :param notification_email: The notification email to be triggered when verification status is changed + :param notification_email: The email address to receive the notification about the verification result. + :param business_name: The name of the business or organization using the Tollfree number. + :param business_website: The website of the business or organization using the Tollfree number. + :param use_case_categories: The category of the use case for the Tollfree Number. List as many are applicable.. + :param use_case_summary: Use this to further explain how messaging is used by the business or organization. + :param production_message_sample: An example of message content, i.e. a sample message. + :param opt_in_image_urls: Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + :param opt_in_type: + :param message_volume: Estimate monthly volume of messages from the Tollfree Number. + :param business_street_address: The address of the business or organization using the Tollfree number. + :param business_street_address2: The address of the business or organization using the Tollfree number. + :param business_city: The city of the business or organization using the Tollfree number. + :param business_state_province_region: The state/province/region of the business or organization using the Tollfree number. + :param business_postal_code: The postal code of the business or organization using the Tollfree number. + :param business_country: The country of the business or organization using the Tollfree number. + :param additional_information: Additional information to be provided for verification. + :param business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. + :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. + :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. + :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. :returns: The created ComplianceTollfreeInquiriesInstance """ @@ -103,6 +213,25 @@ async def create_async( { "TollfreePhoneNumber": tollfree_phone_number, "NotificationEmail": notification_email, + "BusinessName": business_name, + "BusinessWebsite": business_website, + "UseCaseCategories": serialize.map(use_case_categories, lambda e: e), + "UseCaseSummary": use_case_summary, + "ProductionMessageSample": production_message_sample, + "OptInImageUrls": serialize.map(opt_in_image_urls, lambda e: e), + "OptInType": opt_in_type, + "MessageVolume": message_volume, + "BusinessStreetAddress": business_street_address, + "BusinessStreetAddress2": business_street_address2, + "BusinessCity": business_city, + "BusinessStateProvinceRegion": business_state_province_region, + "BusinessPostalCode": business_postal_code, + "BusinessCountry": business_country, + "AdditionalInformation": additional_information, + "BusinessContactFirstName": business_contact_first_name, + "BusinessContactLastName": business_contact_last_name, + "BusinessContactEmail": business_contact_email, + "BusinessContactPhone": business_contact_phone, } ) diff --git a/twilio/rest/trusthub/v1/customer_profiles/__init__.py b/twilio/rest/trusthub/v1/customer_profiles/__init__.py index c1fa25cce5..a16ae0e73b 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/__init__.py +++ b/twilio/rest/trusthub/v1/customer_profiles/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -33,6 +32,7 @@ class CustomerProfilesInstance(InstanceResource): + class Status(object): DRAFT = "draft" PENDING_REVIEW = "pending-review" @@ -219,6 +219,7 @@ def __repr__(self) -> str: class CustomerProfilesContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CustomerProfilesContext @@ -433,6 +434,7 @@ def __repr__(self) -> str: class CustomerProfilesPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CustomerProfilesInstance: """ Build an instance of CustomerProfilesInstance @@ -451,6 +453,7 @@ def __repr__(self) -> str: class CustomerProfilesList(ListResource): + def __init__(self, version: Version): """ Initialize the CustomerProfilesList 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 41bc67e834..4cb14c5ccd 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class CustomerProfilesChannelEndpointAssignmentInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Item Assignment resource. :ivar customer_profile_sid: The unique string that we created to identify the CustomerProfile resource. @@ -125,6 +123,7 @@ def __repr__(self) -> str: class CustomerProfilesChannelEndpointAssignmentContext(InstanceContext): + def __init__(self, version: Version, customer_profile_sid: str, sid: str): """ Initialize the CustomerProfilesChannelEndpointAssignmentContext @@ -221,6 +220,7 @@ def __repr__(self) -> str: class CustomerProfilesChannelEndpointAssignmentPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> CustomerProfilesChannelEndpointAssignmentInstance: @@ -245,6 +245,7 @@ def __repr__(self) -> str: class CustomerProfilesChannelEndpointAssignmentList(ListResource): + def __init__(self, version: Version, customer_profile_sid: str): """ Initialize the CustomerProfilesChannelEndpointAssignmentList 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 6003f56602..40f0d6a07d 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class CustomerProfilesEntityAssignmentsInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Item Assignment resource. :ivar customer_profile_sid: The unique string that we created to identify the CustomerProfile resource. @@ -125,6 +123,7 @@ def __repr__(self) -> str: class CustomerProfilesEntityAssignmentsContext(InstanceContext): + def __init__(self, version: Version, customer_profile_sid: str, sid: str): """ Initialize the CustomerProfilesEntityAssignmentsContext @@ -225,6 +224,7 @@ def __repr__(self) -> str: class CustomerProfilesEntityAssignmentsPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> CustomerProfilesEntityAssignmentsInstance: @@ -249,6 +249,7 @@ def __repr__(self) -> str: class CustomerProfilesEntityAssignmentsList(ListResource): + def __init__(self, version: Version, customer_profile_sid: str): """ Initialize the CustomerProfilesEntityAssignmentsList 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 0b5f88b626..60538ee22e 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class CustomerProfilesEvaluationsInstance(InstanceResource): + class Status(object): COMPLIANT = "compliant" NONCOMPLIANT = "noncompliant" @@ -52,9 +52,9 @@ def __init__( self.account_sid: Optional[str] = payload.get("account_sid") self.policy_sid: Optional[str] = payload.get("policy_sid") self.customer_profile_sid: Optional[str] = payload.get("customer_profile_sid") - self.status: Optional[ - "CustomerProfilesEvaluationsInstance.Status" - ] = payload.get("status") + self.status: Optional["CustomerProfilesEvaluationsInstance.Status"] = ( + payload.get("status") + ) self.results: Optional[List[Dict[str, object]]] = payload.get("results") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") @@ -114,6 +114,7 @@ def __repr__(self) -> str: class CustomerProfilesEvaluationsContext(InstanceContext): + def __init__(self, version: Version, customer_profile_sid: str, sid: str): """ Initialize the CustomerProfilesEvaluationsContext @@ -186,6 +187,7 @@ def __repr__(self) -> str: class CustomerProfilesEvaluationsPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> CustomerProfilesEvaluationsInstance: @@ -210,6 +212,7 @@ def __repr__(self) -> str: class CustomerProfilesEvaluationsList(ListResource): + def __init__(self, version: Version, customer_profile_sid: str): """ Initialize the CustomerProfilesEvaluationsList diff --git a/twilio/rest/trusthub/v1/end_user.py b/twilio/rest/trusthub/v1/end_user.py index c72cb6222c..b8b08d65ca 100644 --- a/twilio/rest/trusthub/v1/end_user.py +++ b/twilio/rest/trusthub/v1/end_user.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class EndUserInstance(InstanceResource): - """ :ivar sid: The unique string created by Twilio to identify the End User resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the End User resource. @@ -157,6 +155,7 @@ def __repr__(self) -> str: class EndUserContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the EndUserContext @@ -301,6 +300,7 @@ def __repr__(self) -> str: class EndUserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EndUserInstance: """ Build an instance of EndUserInstance @@ -319,6 +319,7 @@ def __repr__(self) -> str: class EndUserList(ListResource): + def __init__(self, version: Version): """ Initialize the EndUserList diff --git a/twilio/rest/trusthub/v1/end_user_type.py b/twilio/rest/trusthub/v1/end_user_type.py index f3d79d2a60..d336385b25 100644 --- a/twilio/rest/trusthub/v1/end_user_type.py +++ b/twilio/rest/trusthub/v1/end_user_type.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class EndUserTypeInstance(InstanceResource): - """ :ivar sid: The unique string that identifies the End-User Type resource. :ivar friendly_name: A human-readable description that is assigned to describe the End-User Type resource. Examples can include first name, last name, email, business name, etc @@ -92,6 +90,7 @@ def __repr__(self) -> str: class EndUserTypeContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the EndUserTypeContext @@ -156,6 +155,7 @@ def __repr__(self) -> str: class EndUserTypePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EndUserTypeInstance: """ Build an instance of EndUserTypeInstance @@ -174,6 +174,7 @@ def __repr__(self) -> str: class EndUserTypeList(ListResource): + def __init__(self, version: Version): """ Initialize the EndUserTypeList diff --git a/twilio/rest/trusthub/v1/policies.py b/twilio/rest/trusthub/v1/policies.py index 6c08335216..a39b1e0e65 100644 --- a/twilio/rest/trusthub/v1/policies.py +++ b/twilio/rest/trusthub/v1/policies.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class PoliciesInstance(InstanceResource): - """ :ivar sid: The unique string that identifies the Policy resource. :ivar friendly_name: A human-readable description that is assigned to describe the Policy resource. Examples can include Primary Customer profile policy @@ -90,6 +88,7 @@ def __repr__(self) -> str: class PoliciesContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the PoliciesContext @@ -154,6 +153,7 @@ def __repr__(self) -> str: class PoliciesPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PoliciesInstance: """ Build an instance of PoliciesInstance @@ -172,6 +172,7 @@ def __repr__(self) -> str: class PoliciesList(ListResource): + def __init__(self, version: Version): """ Initialize the PoliciesList diff --git a/twilio/rest/trusthub/v1/supporting_document.py b/twilio/rest/trusthub/v1/supporting_document.py index e532756197..a18293fd8e 100644 --- a/twilio/rest/trusthub/v1/supporting_document.py +++ b/twilio/rest/trusthub/v1/supporting_document.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class SupportingDocumentInstance(InstanceResource): + class Status(object): DRAFT = "draft" PENDING_REVIEW = "pending-review" @@ -170,6 +170,7 @@ def __repr__(self) -> str: class SupportingDocumentContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SupportingDocumentContext @@ -318,6 +319,7 @@ def __repr__(self) -> str: class SupportingDocumentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SupportingDocumentInstance: """ Build an instance of SupportingDocumentInstance @@ -336,6 +338,7 @@ def __repr__(self) -> str: class SupportingDocumentList(ListResource): + def __init__(self, version: Version): """ Initialize the SupportingDocumentList diff --git a/twilio/rest/trusthub/v1/supporting_document_type.py b/twilio/rest/trusthub/v1/supporting_document_type.py index 66b05f95f9..f1a93c59b7 100644 --- a/twilio/rest/trusthub/v1/supporting_document_type.py +++ b/twilio/rest/trusthub/v1/supporting_document_type.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class SupportingDocumentTypeInstance(InstanceResource): - """ :ivar sid: The unique string that identifies the Supporting Document Type resource. :ivar friendly_name: A human-readable description of the Supporting Document Type resource. @@ -92,6 +90,7 @@ def __repr__(self) -> str: class SupportingDocumentTypeContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SupportingDocumentTypeContext @@ -156,6 +155,7 @@ def __repr__(self) -> str: class SupportingDocumentTypePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SupportingDocumentTypeInstance: """ Build an instance of SupportingDocumentTypeInstance @@ -174,6 +174,7 @@ def __repr__(self) -> str: class SupportingDocumentTypeList(ListResource): + def __init__(self, version: Version): """ Initialize the SupportingDocumentTypeList diff --git a/twilio/rest/trusthub/v1/trust_products/__init__.py b/twilio/rest/trusthub/v1/trust_products/__init__.py index 21b95d925d..a638f680f0 100644 --- a/twilio/rest/trusthub/v1/trust_products/__init__.py +++ b/twilio/rest/trusthub/v1/trust_products/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -33,6 +32,7 @@ class TrustProductsInstance(InstanceResource): + class Status(object): DRAFT = "draft" PENDING_REVIEW = "pending-review" @@ -217,6 +217,7 @@ def __repr__(self) -> str: class TrustProductsContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the TrustProductsContext @@ -423,6 +424,7 @@ def __repr__(self) -> str: class TrustProductsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TrustProductsInstance: """ Build an instance of TrustProductsInstance @@ -441,6 +443,7 @@ def __repr__(self) -> str: class TrustProductsList(ListResource): + def __init__(self, version: Version): """ Initialize the TrustProductsList 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 5083eb8a35..ef2b589ffb 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class TrustProductsChannelEndpointAssignmentInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Item Assignment resource. :ivar trust_product_sid: The unique string that we created to identify the CustomerProfile resource. @@ -125,6 +123,7 @@ def __repr__(self) -> str: class TrustProductsChannelEndpointAssignmentContext(InstanceContext): + def __init__(self, version: Version, trust_product_sid: str, sid: str): """ Initialize the TrustProductsChannelEndpointAssignmentContext @@ -221,6 +220,7 @@ def __repr__(self) -> str: class TrustProductsChannelEndpointAssignmentPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> TrustProductsChannelEndpointAssignmentInstance: @@ -245,6 +245,7 @@ def __repr__(self) -> str: class TrustProductsChannelEndpointAssignmentList(ListResource): + def __init__(self, version: Version, trust_product_sid: str): """ Initialize the TrustProductsChannelEndpointAssignmentList 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 bcd907cc25..68854b9c5e 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 @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class TrustProductsEntityAssignmentsInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Item Assignment resource. :ivar trust_product_sid: The unique string that we created to identify the TrustProduct resource. @@ -123,6 +121,7 @@ def __repr__(self) -> str: class TrustProductsEntityAssignmentsContext(InstanceContext): + def __init__(self, version: Version, trust_product_sid: str, sid: str): """ Initialize the TrustProductsEntityAssignmentsContext @@ -219,6 +218,7 @@ def __repr__(self) -> str: class TrustProductsEntityAssignmentsPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> TrustProductsEntityAssignmentsInstance: @@ -243,6 +243,7 @@ def __repr__(self) -> str: class TrustProductsEntityAssignmentsList(ListResource): + def __init__(self, version: Version, trust_product_sid: str): """ Initialize the TrustProductsEntityAssignmentsList 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 665f5193c4..dfb929bac0 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class TrustProductsEvaluationsInstance(InstanceResource): + class Status(object): COMPLIANT = "compliant" NONCOMPLIANT = "noncompliant" @@ -114,6 +114,7 @@ def __repr__(self) -> str: class TrustProductsEvaluationsContext(InstanceContext): + def __init__(self, version: Version, trust_product_sid: str, sid: str): """ Initialize the TrustProductsEvaluationsContext @@ -184,6 +185,7 @@ def __repr__(self) -> str: class TrustProductsEvaluationsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TrustProductsEvaluationsInstance: """ Build an instance of TrustProductsEvaluationsInstance @@ -206,6 +208,7 @@ def __repr__(self) -> str: class TrustProductsEvaluationsList(ListResource): + def __init__(self, version: Version, trust_product_sid: str): """ Initialize the TrustProductsEvaluationsList diff --git a/twilio/rest/verify/VerifyBase.py b/twilio/rest/verify/VerifyBase.py index 8977a50430..076f063147 100644 --- a/twilio/rest/verify/VerifyBase.py +++ b/twilio/rest/verify/VerifyBase.py @@ -17,6 +17,7 @@ class VerifyBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Verify Domain diff --git a/twilio/rest/verify/v2/__init__.py b/twilio/rest/verify/v2/__init__.py index c4f94aea30..01bee13b0d 100644 --- a/twilio/rest/verify/v2/__init__.py +++ b/twilio/rest/verify/v2/__init__.py @@ -26,6 +26,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Verify diff --git a/twilio/rest/verify/v2/form.py b/twilio/rest/verify/v2/form.py index 9b17da9e48..6e3231fcda 100644 --- a/twilio/rest/verify/v2/form.py +++ b/twilio/rest/verify/v2/form.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,6 +20,7 @@ class FormInstance(InstanceResource): + class FormTypes(object): FORM_PUSH = "form-push" @@ -93,6 +93,7 @@ def __repr__(self) -> str: class FormContext(InstanceContext): + def __init__(self, version: Version, form_type: "FormInstance.FormTypes"): """ Initialize the FormContext @@ -157,6 +158,7 @@ def __repr__(self) -> str: class FormList(ListResource): + def __init__(self, version: Version): """ Initialize the FormList diff --git a/twilio/rest/verify/v2/safelist.py b/twilio/rest/verify/v2/safelist.py index b0f05c500f..fb71369fb1 100644 --- a/twilio/rest/verify/v2/safelist.py +++ b/twilio/rest/verify/v2/safelist.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class SafelistInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the SafeList resource. :ivar phone_number: The phone number in SafeList. @@ -108,6 +106,7 @@ def __repr__(self) -> str: class SafelistContext(InstanceContext): + def __init__(self, version: Version, phone_number: str): """ Initialize the SafelistContext @@ -196,6 +195,7 @@ def __repr__(self) -> str: class SafelistList(ListResource): + def __init__(self, version: Version): """ Initialize the SafelistList diff --git a/twilio/rest/verify/v2/service/__init__.py b/twilio/rest/verify/v2/service/__init__.py index ae087cb336..374ecb3ef1 100644 --- a/twilio/rest/verify/v2/service/__init__.py +++ b/twilio/rest/verify/v2/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -33,7 +32,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Service resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. @@ -49,6 +47,7 @@ class ServiceInstance(InstanceResource): :ivar push: Configurations for the Push factors (channel) created under this Service. :ivar totp: Configurations for the TOTP factors (channel) created under this Service. :ivar default_template_sid: + :ivar verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar url: The absolute URL of the resource. @@ -80,6 +79,9 @@ def __init__( self.push: Optional[Dict[str, object]] = payload.get("push") self.totp: Optional[Dict[str, object]] = payload.get("totp") self.default_template_sid: Optional[str] = payload.get("default_template_sid") + self.verify_event_subscription_enabled: Optional[bool] = payload.get( + "verify_event_subscription_enabled" + ) self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) @@ -164,6 +166,7 @@ def update( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> "ServiceInstance": """ Update the ServiceInstance @@ -185,6 +188,7 @@ def update( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance """ @@ -206,6 +210,7 @@ def update( totp_code_length=totp_code_length, totp_skew=totp_skew, default_template_sid=default_template_sid, + verify_event_subscription_enabled=verify_event_subscription_enabled, ) async def update_async( @@ -227,6 +232,7 @@ async def update_async( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> "ServiceInstance": """ Asynchronous coroutine to update the ServiceInstance @@ -248,6 +254,7 @@ async def update_async( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance """ @@ -269,6 +276,7 @@ async def update_async( totp_code_length=totp_code_length, totp_skew=totp_skew, default_template_sid=default_template_sid, + verify_event_subscription_enabled=verify_event_subscription_enabled, ) @property @@ -331,6 +339,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -435,6 +444,7 @@ def update( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ Update the ServiceInstance @@ -456,6 +466,7 @@ def update( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance """ @@ -478,6 +489,7 @@ def update( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, + "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, } ) @@ -508,6 +520,7 @@ async def update_async( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ Asynchronous coroutine to update the ServiceInstance @@ -529,6 +542,7 @@ async def update_async( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance """ @@ -551,6 +565,7 @@ async def update_async( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, + "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, } ) @@ -657,6 +672,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -675,6 +691,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -705,6 +722,7 @@ def create( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ Create the ServiceInstance @@ -726,6 +744,7 @@ def create( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The created ServiceInstance """ @@ -749,6 +768,7 @@ def create( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, + "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, } ) @@ -779,6 +799,7 @@ async def create_async( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ Asynchronously create the ServiceInstance @@ -800,6 +821,7 @@ async def create_async( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The created ServiceInstance """ @@ -823,6 +845,7 @@ async def create_async( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, + "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, } ) diff --git a/twilio/rest/verify/v2/service/access_token.py b/twilio/rest/verify/v2/service/access_token.py index 26aa9d2bf7..0bb888a08f 100644 --- a/twilio/rest/verify/v2/service/access_token.py +++ b/twilio/rest/verify/v2/service/access_token.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,6 +22,7 @@ class AccessTokenInstance(InstanceResource): + class FactorTypes(object): PUSH = "push" @@ -114,6 +114,7 @@ def __repr__(self) -> str: class AccessTokenContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the AccessTokenContext @@ -184,6 +185,7 @@ def __repr__(self) -> str: class AccessTokenList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the AccessTokenList diff --git a/twilio/rest/verify/v2/service/entity/__init__.py b/twilio/rest/verify/v2/service/entity/__init__.py index 93134aaa88..41541a4ca6 100644 --- a/twilio/rest/verify/v2/service/entity/__init__.py +++ b/twilio/rest/verify/v2/service/entity/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class EntityInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies this Entity. :ivar identity: The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. @@ -151,6 +149,7 @@ def __repr__(self) -> str: class EntityContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, identity: str): """ Initialize the EntityContext @@ -288,6 +287,7 @@ def __repr__(self) -> str: class EntityPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EntityInstance: """ Build an instance of EntityInstance @@ -308,6 +308,7 @@ def __repr__(self) -> str: class EntityList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the EntityList diff --git a/twilio/rest/verify/v2/service/entity/challenge/__init__.py b/twilio/rest/verify/v2/service/entity/challenge/__init__.py index efe274607c..ab8c7f8d11 100644 --- a/twilio/rest/verify/v2/service/entity/challenge/__init__.py +++ b/twilio/rest/verify/v2/service/entity/challenge/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -25,6 +24,7 @@ class ChallengeInstance(InstanceResource): + class ChallengeReasons(object): NONE = "none" NOT_NEEDED = "not_needed" @@ -96,9 +96,9 @@ def __init__( self.status: Optional["ChallengeInstance.ChallengeStatuses"] = payload.get( "status" ) - self.responded_reason: Optional[ - "ChallengeInstance.ChallengeReasons" - ] = payload.get("responded_reason") + self.responded_reason: Optional["ChallengeInstance.ChallengeReasons"] = ( + payload.get("responded_reason") + ) self.details: Optional[Dict[str, object]] = payload.get("details") self.hidden_details: Optional[Dict[str, object]] = payload.get("hidden_details") self.metadata: Optional[Dict[str, object]] = payload.get("metadata") @@ -204,6 +204,7 @@ def __repr__(self) -> str: class ChallengeContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, identity: str, sid: str): """ Initialize the ChallengeContext @@ -364,6 +365,7 @@ def __repr__(self) -> str: class ChallengePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ChallengeInstance: """ Build an instance of ChallengeInstance @@ -387,6 +389,7 @@ def __repr__(self) -> str: class ChallengeList(ListResource): + def __init__(self, version: Version, service_sid: str, identity: str): """ Initialize the ChallengeList diff --git a/twilio/rest/verify/v2/service/entity/challenge/notification.py b/twilio/rest/verify/v2/service/entity/challenge/notification.py index 683415f70e..0cfae0a60f 100644 --- a/twilio/rest/verify/v2/service/entity/challenge/notification.py +++ b/twilio/rest/verify/v2/service/entity/challenge/notification.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class NotificationInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies this Notification. :ivar account_sid: The unique SID identifier of the Account. @@ -75,6 +73,7 @@ def __repr__(self) -> str: class NotificationList(ListResource): + def __init__( self, version: Version, service_sid: str, identity: str, challenge_sid: str ): diff --git a/twilio/rest/verify/v2/service/entity/factor.py b/twilio/rest/verify/v2/service/entity/factor.py index b46a643717..8900fcbfc2 100644 --- a/twilio/rest/verify/v2/service/entity/factor.py +++ b/twilio/rest/verify/v2/service/entity/factor.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class FactorInstance(InstanceResource): + class FactorStatuses(object): UNVERIFIED = "unverified" VERIFIED = "verified" @@ -232,6 +232,7 @@ def __repr__(self) -> str: class FactorContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, identity: str, sid: str): """ Initialize the FactorContext @@ -440,6 +441,7 @@ def __repr__(self) -> str: class FactorPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FactorInstance: """ Build an instance of FactorInstance @@ -463,6 +465,7 @@ def __repr__(self) -> str: class FactorList(ListResource): + def __init__(self, version: Version, service_sid: str, identity: str): """ Initialize the FactorList diff --git a/twilio/rest/verify/v2/service/entity/new_factor.py b/twilio/rest/verify/v2/service/entity/new_factor.py index 1c21582278..7b260a4a3d 100644 --- a/twilio/rest/verify/v2/service/entity/new_factor.py +++ b/twilio/rest/verify/v2/service/entity/new_factor.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,6 +22,7 @@ class NewFactorInstance(InstanceResource): + class FactorStatuses(object): UNVERIFIED = "unverified" VERIFIED = "verified" @@ -102,6 +102,7 @@ def __repr__(self) -> str: class NewFactorList(ListResource): + def __init__(self, version: Version, service_sid: str, identity: str): """ Initialize the NewFactorList diff --git a/twilio/rest/verify/v2/service/messaging_configuration.py b/twilio/rest/verify/v2/service/messaging_configuration.py index b96c4db037..f412aba1ee 100644 --- a/twilio/rest/verify/v2/service/messaging_configuration.py +++ b/twilio/rest/verify/v2/service/messaging_configuration.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class MessagingConfigurationInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. :ivar service_sid: The SID of the [Service](https://www.twilio.com/docs/verify/api/service) that the resource is associated with. @@ -151,6 +149,7 @@ def __repr__(self) -> str: class MessagingConfigurationContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, country: str): """ Initialize the MessagingConfigurationContext @@ -301,6 +300,7 @@ def __repr__(self) -> str: class MessagingConfigurationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessagingConfigurationInstance: """ Build an instance of MessagingConfigurationInstance @@ -321,6 +321,7 @@ def __repr__(self) -> str: class MessagingConfigurationList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the MessagingConfigurationList diff --git a/twilio/rest/verify/v2/service/rate_limit/__init__.py b/twilio/rest/verify/v2/service/rate_limit/__init__.py index cf37fa1e8c..2d4a18bf0f 100644 --- a/twilio/rest/verify/v2/service/rate_limit/__init__.py +++ b/twilio/rest/verify/v2/service/rate_limit/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class RateLimitInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies this Rate Limit. :ivar service_sid: The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with. @@ -165,6 +163,7 @@ def __repr__(self) -> str: class RateLimitContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the RateLimitContext @@ -330,6 +329,7 @@ def __repr__(self) -> str: class RateLimitPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RateLimitInstance: """ Build an instance of RateLimitInstance @@ -350,6 +350,7 @@ def __repr__(self) -> str: class RateLimitList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the RateLimitList diff --git a/twilio/rest/verify/v2/service/rate_limit/bucket.py b/twilio/rest/verify/v2/service/rate_limit/bucket.py index 18ff98acd5..ca4ffaf775 100644 --- a/twilio/rest/verify/v2/service/rate_limit/bucket.py +++ b/twilio/rest/verify/v2/service/rate_limit/bucket.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class BucketInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies this Bucket. :ivar rate_limit_sid: The Twilio-provided string that uniquely identifies the Rate Limit resource. @@ -168,6 +166,7 @@ def __repr__(self) -> str: class BucketContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, rate_limit_sid: str, sid: str ): @@ -338,6 +337,7 @@ def __repr__(self) -> str: class BucketPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BucketInstance: """ Build an instance of BucketInstance @@ -361,6 +361,7 @@ def __repr__(self) -> str: class BucketList(ListResource): + def __init__(self, version: Version, service_sid: str, rate_limit_sid: str): """ Initialize the BucketList diff --git a/twilio/rest/verify/v2/service/verification.py b/twilio/rest/verify/v2/service/verification.py index dc48cd010d..1c42043a3d 100644 --- a/twilio/rest/verify/v2/service/verification.py +++ b/twilio/rest/verify/v2/service/verification.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,6 +22,7 @@ class VerificationInstance(InstanceResource): + class Channel(object): SMS = "sms" CALL = "call" @@ -164,6 +164,7 @@ def __repr__(self) -> str: class VerificationContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the VerificationContext @@ -290,6 +291,7 @@ def __repr__(self) -> str: class VerificationList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the VerificationList diff --git a/twilio/rest/verify/v2/service/verification_check.py b/twilio/rest/verify/v2/service/verification_check.py index b33803854e..9cd92487e4 100644 --- a/twilio/rest/verify/v2/service/verification_check.py +++ b/twilio/rest/verify/v2/service/verification_check.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values @@ -23,6 +22,7 @@ class VerificationCheckInstance(InstanceResource): + class Channel(object): SMS = "sms" CALL = "call" @@ -84,6 +84,7 @@ def __repr__(self) -> str: class VerificationCheckList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the VerificationCheckList diff --git a/twilio/rest/verify/v2/service/webhook.py b/twilio/rest/verify/v2/service/webhook.py index 15dce50aa1..4f8772574c 100644 --- a/twilio/rest/verify/v2/service/webhook.py +++ b/twilio/rest/verify/v2/service/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class WebhookInstance(InstanceResource): + class Methods(object): GET = "GET" POST = "POST" @@ -202,6 +202,7 @@ def __repr__(self) -> str: class WebhookContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the WebhookContext @@ -378,6 +379,7 @@ def __repr__(self) -> str: class WebhookPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WebhookInstance: """ Build an instance of WebhookInstance @@ -398,6 +400,7 @@ def __repr__(self) -> str: class WebhookList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the WebhookList diff --git a/twilio/rest/verify/v2/template.py b/twilio/rest/verify/v2/template.py index ba9f5bd75e..b9968eec87 100644 --- a/twilio/rest/verify/v2/template.py +++ b/twilio/rest/verify/v2/template.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values @@ -23,7 +22,6 @@ class TemplateInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies a Verification Template. :ivar account_sid: The unique SID identifier of the Account. @@ -52,6 +50,7 @@ def __repr__(self) -> str: class TemplatePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TemplateInstance: """ Build an instance of TemplateInstance @@ -70,6 +69,7 @@ def __repr__(self) -> str: class TemplateList(ListResource): + def __init__(self, version: Version): """ Initialize the TemplateList diff --git a/twilio/rest/verify/v2/verification_attempt.py b/twilio/rest/verify/v2/verification_attempt.py index 009291550a..2c1f914d32 100644 --- a/twilio/rest/verify/v2/verification_attempt.py +++ b/twilio/rest/verify/v2/verification_attempt.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class VerificationAttemptInstance(InstanceResource): + class Channels(object): SMS = "sms" CALL = "call" @@ -122,6 +122,7 @@ def __repr__(self) -> str: class VerificationAttemptContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the VerificationAttemptContext @@ -186,6 +187,7 @@ def __repr__(self) -> str: class VerificationAttemptPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> VerificationAttemptInstance: """ Build an instance of VerificationAttemptInstance @@ -204,6 +206,7 @@ def __repr__(self) -> str: class VerificationAttemptList(ListResource): + def __init__(self, version: Version): """ Initialize the VerificationAttemptList diff --git a/twilio/rest/verify/v2/verification_attempts_summary.py b/twilio/rest/verify/v2/verification_attempts_summary.py index d913c40b9b..1f2d3d3955 100644 --- a/twilio/rest/verify/v2/verification_attempts_summary.py +++ b/twilio/rest/verify/v2/verification_attempts_summary.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,6 +22,7 @@ class VerificationAttemptsSummaryInstance(InstanceResource): + class Channels(object): SMS = "sms" CALL = "call" @@ -145,6 +145,7 @@ def __repr__(self) -> str: class VerificationAttemptsSummaryContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the VerificationAttemptsSummaryContext @@ -252,6 +253,7 @@ def __repr__(self) -> str: class VerificationAttemptsSummaryList(ListResource): + def __init__(self, version: Version): """ Initialize the VerificationAttemptsSummaryList diff --git a/twilio/rest/video/VideoBase.py b/twilio/rest/video/VideoBase.py index 2a25345662..0d2cf7e364 100644 --- a/twilio/rest/video/VideoBase.py +++ b/twilio/rest/video/VideoBase.py @@ -17,6 +17,7 @@ class VideoBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Video Domain diff --git a/twilio/rest/video/v1/__init__.py b/twilio/rest/video/v1/__init__.py index 9cd9fcf352..0667596a3f 100644 --- a/twilio/rest/video/v1/__init__.py +++ b/twilio/rest/video/v1/__init__.py @@ -24,6 +24,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Video diff --git a/twilio/rest/video/v1/composition.py b/twilio/rest/video/v1/composition.py index 039f55e4a9..64ee0b2ce8 100644 --- a/twilio/rest/video/v1/composition.py +++ b/twilio/rest/video/v1/composition.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class CompositionInstance(InstanceResource): + class Format(object): MP4 = "mp4" WEBM = "webm" @@ -165,6 +165,7 @@ def __repr__(self) -> str: class CompositionContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CompositionContext @@ -253,6 +254,7 @@ def __repr__(self) -> str: class CompositionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CompositionInstance: """ Build an instance of CompositionInstance @@ -271,6 +273,7 @@ def __repr__(self) -> str: class CompositionList(ListResource): + def __init__(self, version: Version): """ Initialize the CompositionList diff --git a/twilio/rest/video/v1/composition_hook.py b/twilio/rest/video/v1/composition_hook.py index f4cb5c7c74..f6156e82ff 100644 --- a/twilio/rest/video/v1/composition_hook.py +++ b/twilio/rest/video/v1/composition_hook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class CompositionHookInstance(InstanceResource): + class Format(object): MP4 = "mp4" WEBM = "webm" @@ -226,6 +226,7 @@ def __repr__(self) -> str: class CompositionHookContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CompositionHookContext @@ -426,6 +427,7 @@ def __repr__(self) -> str: class CompositionHookPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CompositionHookInstance: """ Build an instance of CompositionHookInstance @@ -444,6 +446,7 @@ def __repr__(self) -> str: class CompositionHookList(ListResource): + def __init__(self, version: Version): """ Initialize the CompositionHookList diff --git a/twilio/rest/video/v1/composition_settings.py b/twilio/rest/video/v1/composition_settings.py index 42d10368d2..7082866b32 100644 --- a/twilio/rest/video/v1/composition_settings.py +++ b/twilio/rest/video/v1/composition_settings.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,12 +21,11 @@ class CompositionSettingsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CompositionSettings resource. :ivar friendly_name: The string that you assigned to describe the resource and that will be shown in the console :ivar aws_credentials_sid: The SID of the stored Credential resource. - :ivar aws_s3_url: The URL of the AWS S3 bucket where the compositions are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :ivar aws_s3_url: The URL of the AWS S3 bucket where the compositions are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :ivar aws_storage_enabled: Whether all compositions are written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. :ivar encryption_key_sid: The SID of the Public Key resource used for encryption. :ivar encryption_enabled: Whether all compositions are stored in an encrypted form. The default is `false`. @@ -77,7 +75,7 @@ def create( :param friendly_name: A descriptive string that you create to describe the resource and show to the user in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. :param encryption_enabled: Whether all compositions should be stored in an encrypted form. The default is `false`. @@ -107,7 +105,7 @@ async def create_async( :param friendly_name: A descriptive string that you create to describe the resource and show to the user in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. :param encryption_enabled: Whether all compositions should be stored in an encrypted form. The default is `false`. @@ -151,6 +149,7 @@ def __repr__(self) -> str: class CompositionSettingsContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the CompositionSettingsContext @@ -176,7 +175,7 @@ def create( :param friendly_name: A descriptive string that you create to describe the resource and show to the user in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. :param encryption_enabled: Whether all compositions should be stored in an encrypted form. The default is `false`. @@ -212,7 +211,7 @@ async def create_async( :param friendly_name: A descriptive string that you create to describe the resource and show to the user in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. :param encryption_enabled: Whether all compositions should be stored in an encrypted form. The default is `false`. @@ -282,6 +281,7 @@ def __repr__(self) -> str: class CompositionSettingsList(ListResource): + def __init__(self, version: Version): """ Initialize the CompositionSettingsList diff --git a/twilio/rest/video/v1/recording.py b/twilio/rest/video/v1/recording.py index af0973776f..20c836d2b0 100644 --- a/twilio/rest/video/v1/recording.py +++ b/twilio/rest/video/v1/recording.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class RecordingInstance(InstanceResource): + class Codec(object): VP8 = "VP8" H264 = "H264" @@ -165,6 +165,7 @@ def __repr__(self) -> str: class RecordingContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the RecordingContext @@ -253,6 +254,7 @@ def __repr__(self) -> str: class RecordingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RecordingInstance: """ Build an instance of RecordingInstance @@ -271,6 +273,7 @@ def __repr__(self) -> str: class RecordingList(ListResource): + def __init__(self, version: Version): """ Initialize the RecordingList diff --git a/twilio/rest/video/v1/recording_settings.py b/twilio/rest/video/v1/recording_settings.py index 2e3a4750f6..d0d6e5ebb8 100644 --- a/twilio/rest/video/v1/recording_settings.py +++ b/twilio/rest/video/v1/recording_settings.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,12 +21,11 @@ class RecordingSettingsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the RecordingSettings resource. :ivar friendly_name: The string that you assigned to describe the resource and show the user in the console :ivar aws_credentials_sid: The SID of the stored Credential resource. - :ivar aws_s3_url: The URL of the AWS S3 bucket where the recordings are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :ivar aws_s3_url: The URL of the AWS S3 bucket where the recordings are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :ivar aws_storage_enabled: Whether all recordings are written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. :ivar encryption_key_sid: The SID of the Public Key resource used for encryption. :ivar encryption_enabled: Whether all recordings are stored in an encrypted form. The default is `false`. @@ -77,7 +75,7 @@ def create( :param friendly_name: A descriptive string that you create to describe the resource and be shown to users in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. :param encryption_enabled: Whether all recordings should be stored in an encrypted form. The default is `false`. @@ -107,7 +105,7 @@ async def create_async( :param friendly_name: A descriptive string that you create to describe the resource and be shown to users in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. :param encryption_enabled: Whether all recordings should be stored in an encrypted form. The default is `false`. @@ -151,6 +149,7 @@ def __repr__(self) -> str: class RecordingSettingsContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the RecordingSettingsContext @@ -176,7 +175,7 @@ def create( :param friendly_name: A descriptive string that you create to describe the resource and be shown to users in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. :param encryption_enabled: Whether all recordings should be stored in an encrypted form. The default is `false`. @@ -212,7 +211,7 @@ async def create_async( :param friendly_name: A descriptive string that you create to describe the resource and be shown to users in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. :param encryption_enabled: Whether all recordings should be stored in an encrypted form. The default is `false`. @@ -282,6 +281,7 @@ def __repr__(self) -> str: class RecordingSettingsList(ListResource): + def __init__(self, version: Version): """ Initialize the RecordingSettingsList diff --git a/twilio/rest/video/v1/room/__init__.py b/twilio/rest/video/v1/room/__init__.py index 0310baae1e..d787c9896e 100644 --- a/twilio/rest/video/v1/room/__init__.py +++ b/twilio/rest/video/v1/room/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,6 +26,7 @@ class RoomInstance(InstanceResource): + class RoomStatus(object): IN_PROGRESS = "in-progress" COMPLETED = "completed" @@ -215,6 +215,7 @@ def __repr__(self) -> str: class RoomContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the RoomContext @@ -363,6 +364,7 @@ def __repr__(self) -> str: class RoomPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoomInstance: """ Build an instance of RoomInstance @@ -381,6 +383,7 @@ def __repr__(self) -> str: class RoomList(ListResource): + def __init__(self, version: Version): """ Initialize the RoomList diff --git a/twilio/rest/video/v1/room/participant/__init__.py b/twilio/rest/video/v1/room/participant/__init__.py index f8a21ba6a1..145d95429a 100644 --- a/twilio/rest/video/v1/room/participant/__init__.py +++ b/twilio/rest/video/v1/room/participant/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -28,6 +27,7 @@ class ParticipantInstance(InstanceResource): + class Status(object): CONNECTED = "connected" DISCONNECTED = "disconnected" @@ -184,6 +184,7 @@ def __repr__(self) -> str: class ParticipantContext(InstanceContext): + def __init__(self, version: Version, room_sid: str, sid: str): """ Initialize the ParticipantContext @@ -367,6 +368,7 @@ def __repr__(self) -> str: class ParticipantPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantInstance: """ Build an instance of ParticipantInstance @@ -387,6 +389,7 @@ def __repr__(self) -> str: class ParticipantList(ListResource): + def __init__(self, version: Version, room_sid: str): """ Initialize the ParticipantList diff --git a/twilio/rest/video/v1/room/participant/anonymize.py b/twilio/rest/video/v1/room/participant/anonymize.py index 415c5b1f20..e9a7f1383e 100644 --- a/twilio/rest/video/v1/room/participant/anonymize.py +++ b/twilio/rest/video/v1/room/participant/anonymize.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize, values @@ -23,6 +22,7 @@ class AnonymizeInstance(InstanceResource): + class Status(object): CONNECTED = "connected" DISCONNECTED = "disconnected" @@ -117,6 +117,7 @@ def __repr__(self) -> str: class AnonymizeContext(InstanceContext): + def __init__(self, version: Version, room_sid: str, sid: str): """ Initialize the AnonymizeContext @@ -191,6 +192,7 @@ def __repr__(self) -> str: class AnonymizeList(ListResource): + def __init__(self, version: Version, room_sid: str, sid: str): """ Initialize the AnonymizeList diff --git a/twilio/rest/video/v1/room/participant/published_track.py b/twilio/rest/video/v1/room/participant/published_track.py index a5156fee8f..1fa84827b6 100644 --- a/twilio/rest/video/v1/room/participant/published_track.py +++ b/twilio/rest/video/v1/room/participant/published_track.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class PublishedTrackInstance(InstanceResource): + class Kind(object): AUDIO = "audio" VIDEO = "video" @@ -118,6 +118,7 @@ def __repr__(self) -> str: class PublishedTrackContext(InstanceContext): + def __init__(self, version: Version, room_sid: str, participant_sid: str, sid: str): """ Initialize the PublishedTrackContext @@ -192,6 +193,7 @@ def __repr__(self) -> str: class PublishedTrackPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PublishedTrackInstance: """ Build an instance of PublishedTrackInstance @@ -215,6 +217,7 @@ def __repr__(self) -> str: class PublishedTrackList(ListResource): + def __init__(self, version: Version, room_sid: str, participant_sid: str): """ Initialize the PublishedTrackList diff --git a/twilio/rest/video/v1/room/participant/subscribe_rules.py b/twilio/rest/video/v1/room/participant/subscribe_rules.py index 286f912cf5..3015163e6d 100644 --- a/twilio/rest/video/v1/room/participant/subscribe_rules.py +++ b/twilio/rest/video/v1/room/participant/subscribe_rules.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,7 +22,6 @@ class SubscribeRulesInstance(InstanceResource): - """ :ivar participant_sid: The SID of the Participant resource for the Subscribe Rules. :ivar room_sid: The SID of the Room resource for the Subscribe Rules @@ -67,6 +65,7 @@ def __repr__(self) -> str: class SubscribeRulesList(ListResource): + def __init__(self, version: Version, room_sid: str, participant_sid: str): """ Initialize the SubscribeRulesList diff --git a/twilio/rest/video/v1/room/participant/subscribed_track.py b/twilio/rest/video/v1/room/participant/subscribed_track.py index 627015a44a..7c915095ec 100644 --- a/twilio/rest/video/v1/room/participant/subscribed_track.py +++ b/twilio/rest/video/v1/room/participant/subscribed_track.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class SubscribedTrackInstance(InstanceResource): + class Kind(object): AUDIO = "audio" VIDEO = "video" @@ -120,6 +120,7 @@ def __repr__(self) -> str: class SubscribedTrackContext(InstanceContext): + def __init__(self, version: Version, room_sid: str, participant_sid: str, sid: str): """ Initialize the SubscribedTrackContext @@ -194,6 +195,7 @@ def __repr__(self) -> str: class SubscribedTrackPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SubscribedTrackInstance: """ Build an instance of SubscribedTrackInstance @@ -217,6 +219,7 @@ def __repr__(self) -> str: class SubscribedTrackList(ListResource): + def __init__(self, version: Version, room_sid: str, participant_sid: str): """ Initialize the SubscribedTrackList diff --git a/twilio/rest/video/v1/room/recording_rules.py b/twilio/rest/video/v1/room/recording_rules.py index 862d90e4b2..6e731a1458 100644 --- a/twilio/rest/video/v1/room/recording_rules.py +++ b/twilio/rest/video/v1/room/recording_rules.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,7 +22,6 @@ class RecordingRulesInstance(InstanceResource): - """ :ivar room_sid: The SID of the Room resource for the Recording Rules :ivar rules: A collection of Recording Rules that describe how to include or exclude matching tracks for recording @@ -58,6 +56,7 @@ def __repr__(self) -> str: class RecordingRulesList(ListResource): + def __init__(self, version: Version, room_sid: str): """ Initialize the RecordingRulesList diff --git a/twilio/rest/video/v1/room/room_recording.py b/twilio/rest/video/v1/room/room_recording.py index 481422eacb..db67f29947 100644 --- a/twilio/rest/video/v1/room/room_recording.py +++ b/twilio/rest/video/v1/room/room_recording.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,6 +23,7 @@ class RoomRecordingInstance(InstanceResource): + class Codec(object): VP8 = "VP8" H264 = "H264" @@ -167,6 +167,7 @@ def __repr__(self) -> str: class RoomRecordingContext(InstanceContext): + def __init__(self, version: Version, room_sid: str, sid: str): """ Initialize the RoomRecordingContext @@ -259,6 +260,7 @@ def __repr__(self) -> str: class RoomRecordingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoomRecordingInstance: """ Build an instance of RoomRecordingInstance @@ -279,6 +281,7 @@ def __repr__(self) -> str: class RoomRecordingList(ListResource): + def __init__(self, version: Version, room_sid: str): """ Initialize the RoomRecordingList diff --git a/twilio/rest/voice/VoiceBase.py b/twilio/rest/voice/VoiceBase.py index 21a11ce350..4394ab1a2d 100644 --- a/twilio/rest/voice/VoiceBase.py +++ b/twilio/rest/voice/VoiceBase.py @@ -17,6 +17,7 @@ class VoiceBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Voice Domain diff --git a/twilio/rest/voice/v1/__init__.py b/twilio/rest/voice/v1/__init__.py index 2014cd1626..75c0c7fc74 100644 --- a/twilio/rest/voice/v1/__init__.py +++ b/twilio/rest/voice/v1/__init__.py @@ -24,6 +24,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Voice diff --git a/twilio/rest/voice/v1/archived_call.py b/twilio/rest/voice/v1/archived_call.py index de13e682da..ec8a5bb68e 100644 --- a/twilio/rest/voice/v1/archived_call.py +++ b/twilio/rest/voice/v1/archived_call.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from twilio.base.instance_context import InstanceContext @@ -21,6 +20,7 @@ class ArchivedCallContext(InstanceContext): + def __init__(self, version: Version, date: date, sid: str): """ Initialize the ArchivedCallContext @@ -73,6 +73,7 @@ def __repr__(self) -> str: class ArchivedCallList(ListResource): + def __init__(self, version: Version): """ Initialize the ArchivedCallList diff --git a/twilio/rest/voice/v1/byoc_trunk.py b/twilio/rest/voice/v1/byoc_trunk.py index 076ea0de6d..1a8f60984d 100644 --- a/twilio/rest/voice/v1/byoc_trunk.py +++ b/twilio/rest/voice/v1/byoc_trunk.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ByocTrunkInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the BYOC Trunk resource. :ivar sid: The unique string that that we created to identify the BYOC Trunk resource. @@ -221,6 +219,7 @@ def __repr__(self) -> str: class ByocTrunkContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ByocTrunkContext @@ -413,6 +412,7 @@ def __repr__(self) -> str: class ByocTrunkPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ByocTrunkInstance: """ Build an instance of ByocTrunkInstance @@ -431,6 +431,7 @@ def __repr__(self) -> str: class ByocTrunkList(ListResource): + def __init__(self, version: Version): """ Initialize the ByocTrunkList diff --git a/twilio/rest/voice/v1/connection_policy/__init__.py b/twilio/rest/voice/v1/connection_policy/__init__.py index fc8269105d..d1d8aac893 100644 --- a/twilio/rest/voice/v1/connection_policy/__init__.py +++ b/twilio/rest/voice/v1/connection_policy/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class ConnectionPolicyInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Connection Policy resource. :ivar sid: The unique string that we created to identify the Connection Policy resource. @@ -157,6 +155,7 @@ def __repr__(self) -> str: class ConnectionPolicyContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ConnectionPolicyContext @@ -311,6 +310,7 @@ def __repr__(self) -> str: class ConnectionPolicyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConnectionPolicyInstance: """ Build an instance of ConnectionPolicyInstance @@ -329,6 +329,7 @@ def __repr__(self) -> str: class ConnectionPolicyList(ListResource): + def __init__(self, version: Version): """ Initialize the ConnectionPolicyList 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 0972b680dc..d1f8a41524 100644 --- a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py +++ b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ConnectionPolicyTargetInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Target resource. :ivar connection_policy_sid: The SID of the Connection Policy that owns the Target. @@ -187,6 +185,7 @@ def __repr__(self) -> str: class ConnectionPolicyTargetContext(InstanceContext): + def __init__(self, version: Version, connection_policy_sid: str, sid: str): """ Initialize the ConnectionPolicyTargetContext @@ -365,6 +364,7 @@ def __repr__(self) -> str: class ConnectionPolicyTargetPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConnectionPolicyTargetInstance: """ Build an instance of ConnectionPolicyTargetInstance @@ -387,6 +387,7 @@ def __repr__(self) -> str: class ConnectionPolicyTargetList(ListResource): + def __init__(self, version: Version, connection_policy_sid: str): """ Initialize the ConnectionPolicyTargetList diff --git a/twilio/rest/voice/v1/dialing_permissions/__init__.py b/twilio/rest/voice/v1/dialing_permissions/__init__.py index 2de126841e..2346430adc 100644 --- a/twilio/rest/voice/v1/dialing_permissions/__init__.py +++ b/twilio/rest/voice/v1/dialing_permissions/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional @@ -27,6 +26,7 @@ class DialingPermissionsList(ListResource): + def __init__(self, version: Version): """ Initialize the DialingPermissionsList 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 4d62c547b0..60aa2642f0 100644 --- a/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py +++ b/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base import deserialize, values @@ -22,7 +21,6 @@ class BulkCountryUpdateInstance(InstanceResource): - """ :ivar update_count: The number of countries updated :ivar update_request: A bulk update request to change voice dialing country permissions stored as a URL-encoded, JSON array of update objects. For example : `[ { \"iso_code\": \"GB\", \"low_risk_numbers_enabled\": \"true\", \"high_risk_special_numbers_enabled\":\"true\", \"high_risk_tollfraud_numbers_enabled\": \"false\" } ]` @@ -47,6 +45,7 @@ def __repr__(self) -> str: class BulkCountryUpdateList(ListResource): + def __init__(self, version: Version): """ Initialize the BulkCountryUpdateList diff --git a/twilio/rest/voice/v1/dialing_permissions/country/__init__.py b/twilio/rest/voice/v1/dialing_permissions/country/__init__.py index 424a9828d0..4f694f41b0 100644 --- a/twilio/rest/voice/v1/dialing_permissions/country/__init__.py +++ b/twilio/rest/voice/v1/dialing_permissions/country/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -26,7 +25,6 @@ class CountryInstance(InstanceResource): - """ :ivar iso_code: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). :ivar name: The name of the country. @@ -116,6 +114,7 @@ def __repr__(self) -> str: class CountryContext(InstanceContext): + def __init__(self, version: Version, iso_code: str): """ Initialize the CountryContext @@ -194,6 +193,7 @@ def __repr__(self) -> str: class CountryPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CountryInstance: """ Build an instance of CountryInstance @@ -212,6 +212,7 @@ def __repr__(self) -> str: class CountryList(ListResource): + def __init__(self, version: Version): """ Initialize the CountryList diff --git a/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py b/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py index ef46284f20..9303f2c9ae 100644 --- a/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py +++ b/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values @@ -23,7 +22,6 @@ class HighriskSpecialPrefixInstance(InstanceResource): - """ :ivar prefix: A prefix is a contiguous number range for a block of E.164 numbers that includes the E.164 assigned country code. For example, a North American Numbering Plan prefix like `+1510720` written like `+1(510) 720` matches all numbers inclusive from `+1(510) 720-0000` to `+1(510) 720-9999`. """ @@ -48,6 +46,7 @@ def __repr__(self) -> str: class HighriskSpecialPrefixPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> HighriskSpecialPrefixInstance: """ Build an instance of HighriskSpecialPrefixInstance @@ -68,6 +67,7 @@ def __repr__(self) -> str: class HighriskSpecialPrefixList(ListResource): + def __init__(self, version: Version, iso_code: str): """ Initialize the HighriskSpecialPrefixList diff --git a/twilio/rest/voice/v1/dialing_permissions/settings.py b/twilio/rest/voice/v1/dialing_permissions/settings.py index 5b762c742a..6ede5e3a6f 100644 --- a/twilio/rest/voice/v1/dialing_permissions/settings.py +++ b/twilio/rest/voice/v1/dialing_permissions/settings.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class SettingsInstance(InstanceResource): - """ :ivar dialing_permissions_inheritance: `true` if the sub-account will inherit voice dialing permissions from the Master Project; otherwise `false`. :ivar url: The absolute URL of this resource. @@ -109,6 +107,7 @@ def __repr__(self) -> str: class SettingsContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the SettingsContext @@ -214,6 +213,7 @@ def __repr__(self) -> str: class SettingsList(ListResource): + def __init__(self, version: Version): """ Initialize the SettingsList diff --git a/twilio/rest/voice/v1/ip_record.py b/twilio/rest/voice/v1/ip_record.py index c363dd4790..ee409ba78c 100644 --- a/twilio/rest/voice/v1/ip_record.py +++ b/twilio/rest/voice/v1/ip_record.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class IpRecordInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IP Record resource. :ivar sid: The unique string that we created to identify the IP Record resource. @@ -151,6 +149,7 @@ def __repr__(self) -> str: class IpRecordContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the IpRecordContext @@ -287,6 +286,7 @@ def __repr__(self) -> str: class IpRecordPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> IpRecordInstance: """ Build an instance of IpRecordInstance @@ -305,6 +305,7 @@ def __repr__(self) -> str: class IpRecordList(ListResource): + def __init__(self, version: Version): """ Initialize the IpRecordList diff --git a/twilio/rest/voice/v1/source_ip_mapping.py b/twilio/rest/voice/v1/source_ip_mapping.py index a192d762eb..8a0d4a9126 100644 --- a/twilio/rest/voice/v1/source_ip_mapping.py +++ b/twilio/rest/voice/v1/source_ip_mapping.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class SourceIpMappingInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the IP Record resource. :ivar ip_record_sid: The Twilio-provided string that uniquely identifies the IP Record resource to map from. @@ -141,6 +139,7 @@ def __repr__(self) -> str: class SourceIpMappingContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SourceIpMappingContext @@ -277,6 +276,7 @@ def __repr__(self) -> str: class SourceIpMappingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SourceIpMappingInstance: """ Build an instance of SourceIpMappingInstance @@ -295,6 +295,7 @@ def __repr__(self) -> str: class SourceIpMappingList(ListResource): + def __init__(self, version: Version): """ Initialize the SourceIpMappingList diff --git a/twilio/rest/wireless/WirelessBase.py b/twilio/rest/wireless/WirelessBase.py index 5bec36968e..0228c4d666 100644 --- a/twilio/rest/wireless/WirelessBase.py +++ b/twilio/rest/wireless/WirelessBase.py @@ -17,6 +17,7 @@ class WirelessBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Wireless Domain diff --git a/twilio/rest/wireless/v1/__init__.py b/twilio/rest/wireless/v1/__init__.py index 7d94692e45..8f4d0dc5d7 100644 --- a/twilio/rest/wireless/v1/__init__.py +++ b/twilio/rest/wireless/v1/__init__.py @@ -22,6 +22,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Wireless diff --git a/twilio/rest/wireless/v1/command.py b/twilio/rest/wireless/v1/command.py index 0315bf8b5b..cb33e1d397 100644 --- a/twilio/rest/wireless/v1/command.py +++ b/twilio/rest/wireless/v1/command.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,6 +23,7 @@ class CommandInstance(InstanceResource): + class CommandMode(object): TEXT = "text" BINARY = "binary" @@ -151,6 +151,7 @@ def __repr__(self) -> str: class CommandContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CommandContext @@ -239,6 +240,7 @@ def __repr__(self) -> str: class CommandPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CommandInstance: """ Build an instance of CommandInstance @@ -257,6 +259,7 @@ def __repr__(self) -> str: class CommandList(ListResource): + def __init__(self, version: Version): """ Initialize the CommandList diff --git a/twilio/rest/wireless/v1/rate_plan.py b/twilio/rest/wireless/v1/rate_plan.py index 591cdf3182..2bc8939257 100644 --- a/twilio/rest/wireless/v1/rate_plan.py +++ b/twilio/rest/wireless/v1/rate_plan.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class RatePlanInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the RatePlan resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. @@ -181,6 +179,7 @@ def __repr__(self) -> str: class RatePlanContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the RatePlanContext @@ -325,6 +324,7 @@ def __repr__(self) -> str: class RatePlanPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RatePlanInstance: """ Build an instance of RatePlanInstance @@ -343,6 +343,7 @@ def __repr__(self) -> str: class RatePlanList(ListResource): + def __init__(self, version: Version): """ Initialize the RatePlanList diff --git a/twilio/rest/wireless/v1/sim/__init__.py b/twilio/rest/wireless/v1/sim/__init__.py index 7c4cf5a423..f0d21c447e 100644 --- a/twilio/rest/wireless/v1/sim/__init__.py +++ b/twilio/rest/wireless/v1/sim/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -26,6 +25,7 @@ class SimInstance(InstanceResource): + class ResetStatus(object): RESETTING = "resetting" @@ -317,6 +317,7 @@ def __repr__(self) -> str: class SimContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SimContext @@ -584,6 +585,7 @@ def __repr__(self) -> str: class SimPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SimInstance: """ Build an instance of SimInstance @@ -602,6 +604,7 @@ def __repr__(self) -> str: class SimList(ListResource): + def __init__(self, version: Version): """ Initialize the SimList diff --git a/twilio/rest/wireless/v1/sim/data_session.py b/twilio/rest/wireless/v1/sim/data_session.py index 75f7bc3bfc..649eb49631 100644 --- a/twilio/rest/wireless/v1/sim/data_session.py +++ b/twilio/rest/wireless/v1/sim/data_session.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class DataSessionInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the DataSession resource. :ivar sim_sid: The SID of the [Sim resource](https://www.twilio.com/docs/iot/wireless/api/sim-resource) that the Data Session is for. @@ -89,6 +87,7 @@ def __repr__(self) -> str: class DataSessionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DataSessionInstance: """ Build an instance of DataSessionInstance @@ -109,6 +108,7 @@ def __repr__(self) -> str: class DataSessionList(ListResource): + def __init__(self, version: Version, sim_sid: str): """ Initialize the DataSessionList diff --git a/twilio/rest/wireless/v1/sim/usage_record.py b/twilio/rest/wireless/v1/sim/usage_record.py index eb15cf228f..8b1db6d0da 100644 --- a/twilio/rest/wireless/v1/sim/usage_record.py +++ b/twilio/rest/wireless/v1/sim/usage_record.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values @@ -24,6 +23,7 @@ class UsageRecordInstance(InstanceResource): + class Granularity(object): HOURLY = "hourly" DAILY = "daily" @@ -61,6 +61,7 @@ def __repr__(self) -> str: class UsageRecordPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UsageRecordInstance: """ Build an instance of UsageRecordInstance @@ -81,6 +82,7 @@ def __repr__(self) -> str: class UsageRecordList(ListResource): + def __init__(self, version: Version, sim_sid: str): """ Initialize the UsageRecordList diff --git a/twilio/rest/wireless/v1/usage_record.py b/twilio/rest/wireless/v1/usage_record.py index 38c96f5d4f..43e34469ce 100644 --- a/twilio/rest/wireless/v1/usage_record.py +++ b/twilio/rest/wireless/v1/usage_record.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values @@ -24,6 +23,7 @@ class UsageRecordInstance(InstanceResource): + class Granularity(object): HOURLY = "hourly" DAILY = "daily" @@ -55,6 +55,7 @@ def __repr__(self) -> str: class UsageRecordPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UsageRecordInstance: """ Build an instance of UsageRecordInstance @@ -73,6 +74,7 @@ def __repr__(self) -> str: class UsageRecordList(ListResource): + def __init__(self, version: Version): """ Initialize the UsageRecordList From 7c16b025c98d099e4ee672b919ce8ce6def4eef1 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 9 Feb 2024 11:33:48 +0000 Subject: [PATCH 12/13] Release 9.0.0-rc.2 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 17471b3a6d..d92077fbc0 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.0.0-rc.1", + version="9.0.0-rc.2", 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 77e099505e..d4b05b95d5 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "0", "0-rc.1") +__version_info__ = ("9", "0", "0-rc.2") __version__ = ".".join(__version_info__) From 441d7329e261bf612a8631235d17b4f06ec95b9f Mon Sep 17 00:00:00 2001 From: Shubham Date: Wed, 21 Feb 2024 14:01:00 +0530 Subject: [PATCH 13/13] feat!: MVR release preparation (#766) * feat!: MVR release preparation * fix: added test for json data in http client --- CHANGES.md | 38 ----------------------------- UPGRADE.md | 9 +++---- tests/unit/http/test_http_client.py | 26 ++++++++++++++++++++ 3 files changed, 30 insertions(+), 43 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6ad5394e4e..f3b7a49ddb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,44 +3,6 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. -[2024-02-09] Version 9.0.0-rc.2 -------------------------------- -**Library - Chore** -- [PR #765](https://github.com/twilio/twilio-python/pull/765): disables cluster test. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! - -**Flex** -- Adding `flex_instance_sid` to Flex Configuration - -**Insights** -- add flag to restrict access to unapid customers - -**Lookups** -- Remove `carrier` field from `sms_pumping_risk` and leave `carrier_risk_category` **(breaking change)** -- Remove carrier information from call forwarding package **(breaking change)** - -**Messaging** -- Add update instance endpoints to us_app_to_person api - -**Push** -- Migrated to new Push API V4 with Resilient Notification Delivery. - -**Trusthub** -- Add optional field NotificationEmail to the POST /v1/ComplianceInquiries/Customers/Initialize API - -**Verify** -- `Tags` property added again to Public Docs **(breaking change)** - - -[2024-01-08] Version 9.0.0-rc.1 -------------------------------- -**Library - Chore** -- [PR #743](https://github.com/twilio/twilio-python/pull/743): sync with main. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! - - -[2023-12-06] Version 9.0.0-rc.0 ---------------------------- -- Release Candidate preparation - [2023-12-14] Version 8.11.0 --------------------------- **Library - Chore** diff --git a/UPGRADE.md b/UPGRADE.md index 4bf1602c61..03c196bf5b 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -3,14 +3,13 @@ _`MAJOR` version bumps will have upgrade notes posted here._ -## [2023-12-06] 8.x.x to 9.x.x-rc.x - ---- +## [2024-02-20] 8.x.x to 9.x.x ### Overview -#### Twilio Python Helper Library’s major version 9.0.0-rc.x is now available. We ensured that you can upgrade to Python helper Library 9.0.0-rc.x version without any breaking changes +##### Twilio Python Helper Library’s major version 9.0.0 is now available. We ensured that you can upgrade to Python helper Library 9.0.0 version without any breaking changes of existing apis -Support for JSON payloads has been added in the request body +Behind the scenes Python Helper is now auto-generated via OpenAPI with this release. This enables us to rapidly add new features and enhance consistency across versions and languages. +We're pleased to inform you that version 9.0.0 adds support for the application/json content type in the request body. ## [2023-04-05] 7.x.x to 8.x.x diff --git a/tests/unit/http/test_http_client.py b/tests/unit/http/test_http_client.py index e599aaaf00..8484e57b17 100644 --- a/tests/unit/http/test_http_client.py +++ b/tests/unit/http/test_http_client.py @@ -145,6 +145,32 @@ def test_last_request_last_response_exist(self): "testing-unicode: Ω≈ç√, 💩", self.client._test_only_last_response.text ) + def test_request_with_json(self): + self.request_mock.url = "https://api.twilio.com/" + self.request_mock.headers = {"Host": "other.twilio.com"} + + self.client.request( + "doesnt-matter-method", + "doesnt-matter-url", + {"params-value": "params-key"}, + {"json-key": "json-value"}, + {"Content-Type": "application/json"}, + ) + + self.assertIsNotNone(self.client._test_only_last_request) + self.assertEqual( + {"Content-Type": "application/json"}, + self.client._test_only_last_request.headers, + ) + + self.assertIsNotNone(self.client._test_only_last_response) + + if self.client._test_only_last_response is not None: + self.assertEqual(200, self.client._test_only_last_response.status_code) + self.assertEqual( + "testing-unicode: Ω≈ç√, 💩", self.client._test_only_last_response.text + ) + def test_last_response_empty_on_error(self): self.session_mock.send.side_effect = Exception("voltron")