From 59e81bfae68ec2bb8d6a13f0f093d1e7ce5da772 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 19 Oct 2023 11:32:51 +0000 Subject: [PATCH] [Librarian] Regenerated @ 922c1fef02b8c8fbbbe2315aa9b9d1dba49f3fc0 --- CHANGES.md | 33 ++++++++++++++ twilio/rest/accounts/v1/__init__.py | 8 ++++ .../{api/v2010 => accounts/v1}/safelist.py | 8 ++-- twilio/rest/api/v2010/__init__.py | 8 ---- .../v2010/account/conference/participant.py | 6 +++ twilio/rest/flex_api/v1/configuration.py | 2 + .../intelligence/v2/transcript/__init__.py | 44 +++++-------------- .../rest/intelligence/v2/transcript/media.py | 8 ++-- .../v2/transcript/operator_result.py | 20 ++++----- .../intelligence/v2/transcript/sentence.py | 12 ++--- twilio/rest/lookups/v2/phone_number.py | 6 +-- .../messaging/v1/service/us_app_to_person.py | 6 +-- .../taskrouter/v1/workspace/task/__init__.py | 34 +++++++++++--- 13 files changed, 118 insertions(+), 77 deletions(-) rename twilio/rest/{api/v2010 => accounts/v1}/safelist.py (95%) diff --git a/CHANGES.md b/CHANGES.md index 1cd9a3dac..1a652208c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,39 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2023-10-19] Version 8.10.0 +--------------------------- +**Library - Fix** +- [PR #730](https://github.com/twilio/twilio-python/pull/730): Requirement changes. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! +- [PR #727](https://github.com/twilio/twilio-python/pull/727): Requirement changes. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! +- [PR #726](https://github.com/twilio/twilio-python/pull/726): requirements changes. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Accounts** +- Updated Safelist metadata to correct the docs. +- Add Global SafeList API changes + +**Api** +- Added optional parameter `CallToken` for create participant api + +**Flex** +- Adding `offline_config` to Flex Configuration + +**Intelligence** +- Deleted `redacted` parameter from fetching transcript in v2 **(breaking change)** + +**Lookups** +- Add new `phone_number_quality_score` package to the lookup response +- Remove `disposable_phone_number_risk` package **(breaking change)** + +**Messaging** +- Update US App To Person documentation with current `message_samples` requirements + +**Taskrouter** +- Remove beta_feature check on task_queue_bulk_real_time_statistics endpoint +- Add `virtual_start_time` property to tasks +- Updating `task_queue_data` format from `map` to `array` in the response of bulk get endpoint of TaskQueue Real Time Statistics API **(breaking change)** + + [2023-10-05] Version 8.9.1 -------------------------- **Library - Chore** diff --git a/twilio/rest/accounts/v1/__init__.py b/twilio/rest/accounts/v1/__init__.py index c4b24d039..4abbf2434 100644 --- a/twilio/rest/accounts/v1/__init__.py +++ b/twilio/rest/accounts/v1/__init__.py @@ -17,6 +17,7 @@ from twilio.base.domain import Domain from twilio.rest.accounts.v1.auth_token_promotion import AuthTokenPromotionList from twilio.rest.accounts.v1.credential import CredentialList +from twilio.rest.accounts.v1.safelist import SafelistList from twilio.rest.accounts.v1.secondary_auth_token import SecondaryAuthTokenList @@ -30,6 +31,7 @@ def __init__(self, domain: Domain): super().__init__(domain, "v1") self._auth_token_promotion: Optional[AuthTokenPromotionList] = None self._credentials: Optional[CredentialList] = None + self._safelist: Optional[SafelistList] = None self._secondary_auth_token: Optional[SecondaryAuthTokenList] = None @property @@ -44,6 +46,12 @@ def credentials(self) -> CredentialList: self._credentials = CredentialList(self) return self._credentials + @property + def safelist(self) -> SafelistList: + if self._safelist is None: + self._safelist = SafelistList(self) + return self._safelist + @property def secondary_auth_token(self) -> SecondaryAuthTokenList: if self._secondary_auth_token is None: diff --git a/twilio/rest/api/v2010/safelist.py b/twilio/rest/accounts/v1/safelist.py similarity index 95% rename from twilio/rest/api/v2010/safelist.py rename to twilio/rest/accounts/v1/safelist.py index dba6cf115..fb658a677 100644 --- a/twilio/rest/api/v2010/safelist.py +++ b/twilio/rest/accounts/v1/safelist.py @@ -4,7 +4,7 @@ | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - Twilio - Api + Twilio - Accounts This is the public Twilio REST API. NOTE: This class is auto generated by OpenAPI Generator. @@ -41,7 +41,7 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" class SafelistList(ListResource): @@ -54,7 +54,7 @@ def __init__(self, version: Version): """ super().__init__(version) - self._uri = "/SafeList/Numbers.json" + self._uri = "/SafeList/Numbers" def create(self, phone_number: str) -> SafelistInstance: """ @@ -126,4 +126,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/api/v2010/__init__.py b/twilio/rest/api/v2010/__init__.py index 9cfb1d38f..fe5c45c51 100644 --- a/twilio/rest/api/v2010/__init__.py +++ b/twilio/rest/api/v2010/__init__.py @@ -16,7 +16,6 @@ from twilio.base.version import Version from twilio.base.domain import Domain from twilio.rest.api.v2010.account import AccountList -from twilio.rest.api.v2010.safelist import SafelistList from twilio.rest.api.v2010.account import AccountContext @@ -29,7 +28,6 @@ def __init__(self, domain: Domain): """ super().__init__(domain, "2010-04-01") self._accounts: Optional[AccountList] = None - self._safelist: Optional[SafelistList] = None self._account: Optional[AccountContext] = None @property @@ -38,12 +36,6 @@ def accounts(self) -> AccountList: self._accounts = AccountList(self) return self._accounts - @property - def safelist(self) -> SafelistList: - if self._safelist is None: - self._safelist = SafelistList(self) - return self._safelist - @property def account(self) -> AccountContext: if self._account is None: diff --git a/twilio/rest/api/v2010/account/conference/participant.py b/twilio/rest/api/v2010/account/conference/participant.py index e1c2e90b3..f1fa87fd8 100644 --- a/twilio/rest/api/v2010/account/conference/participant.py +++ b/twilio/rest/api/v2010/account/conference/participant.py @@ -571,6 +571,7 @@ def create( amd_status_callback: Union[str, object] = values.unset, amd_status_callback_method: Union[str, object] = values.unset, trim: Union[str, object] = values.unset, + call_token: Union[str, object] = values.unset, ) -> ParticipantInstance: """ Create the ParticipantInstance @@ -622,6 +623,7 @@ def create( :param amd_status_callback: The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. :param amd_status_callback_method: The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. :param trim: Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + :param call_token: A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. :returns: The created ParticipantInstance """ @@ -682,6 +684,7 @@ def create( "AmdStatusCallback": amd_status_callback, "AmdStatusCallbackMethod": amd_status_callback_method, "Trim": trim, + "CallToken": call_token, } ) @@ -749,6 +752,7 @@ async def create_async( amd_status_callback: Union[str, object] = values.unset, amd_status_callback_method: Union[str, object] = values.unset, trim: Union[str, object] = values.unset, + call_token: Union[str, object] = values.unset, ) -> ParticipantInstance: """ Asynchronously create the ParticipantInstance @@ -800,6 +804,7 @@ async def create_async( :param amd_status_callback: The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. :param amd_status_callback_method: The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. :param trim: Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + :param call_token: A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. :returns: The created ParticipantInstance """ @@ -860,6 +865,7 @@ async def create_async( "AmdStatusCallback": amd_status_callback, "AmdStatusCallbackMethod": amd_status_callback_method, "Trim": trim, + "CallToken": call_token, } ) diff --git a/twilio/rest/flex_api/v1/configuration.py b/twilio/rest/flex_api/v1/configuration.py index d46150795..24edb5eaa 100644 --- a/twilio/rest/flex_api/v1/configuration.py +++ b/twilio/rest/flex_api/v1/configuration.py @@ -76,6 +76,7 @@ class Status(object): :ivar flex_ui_status_report: Configurable parameters for Flex UI Status report. :ivar agent_conv_end_methods: Agent conversation end methods. :ivar citrix_voice_vdi: Citrix voice vdi configuration and settings. + :ivar offline_config: Presence and presence ttl configuration """ def __init__(self, version: Version, payload: Dict[str, Any]): @@ -184,6 +185,7 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.citrix_voice_vdi: Optional[Dict[str, object]] = payload.get( "citrix_voice_vdi" ) + self.offline_config: Optional[Dict[str, object]] = payload.get("offline_config") self._context: Optional[ConfigurationContext] = None diff --git a/twilio/rest/intelligence/v2/transcript/__init__.py b/twilio/rest/intelligence/v2/transcript/__init__.py index 748000ff6..7b479526c 100644 --- a/twilio/rest/intelligence/v2/transcript/__init__.py +++ b/twilio/rest/intelligence/v2/transcript/__init__.py @@ -117,33 +117,23 @@ async def delete_async(self) -> bool: """ return await self._proxy.delete_async() - def fetch( - self, redacted: Union[bool, object] = values.unset - ) -> "TranscriptInstance": + def fetch(self) -> "TranscriptInstance": """ Fetch the TranscriptInstance - :param redacted: Grant access to PII Redacted/Unredacted Transcript. The default is `true` to access redacted Transcript. :returns: The fetched TranscriptInstance """ - return self._proxy.fetch( - redacted=redacted, - ) + return self._proxy.fetch() - async def fetch_async( - self, redacted: Union[bool, object] = values.unset - ) -> "TranscriptInstance": + async def fetch_async(self) -> "TranscriptInstance": """ Asynchronous coroutine to fetch the TranscriptInstance - :param redacted: Grant access to PII Redacted/Unredacted Transcript. The default is `true` to access redacted Transcript. :returns: The fetched TranscriptInstance """ - return await self._proxy.fetch_async( - redacted=redacted, - ) + return await self._proxy.fetch_async() @property def media(self) -> MediaList: @@ -220,48 +210,36 @@ async def delete_async(self) -> bool: uri=self._uri, ) - def fetch(self, redacted: Union[bool, object] = values.unset) -> TranscriptInstance: + def fetch(self) -> TranscriptInstance: """ Fetch the TranscriptInstance - :param redacted: Grant access to PII Redacted/Unredacted Transcript. The default is `true` to access redacted Transcript. :returns: The fetched TranscriptInstance """ - data = values.of( - { - "Redacted": redacted, - } + payload = self._version.fetch( + method="GET", + uri=self._uri, ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) - return TranscriptInstance( self._version, payload, sid=self._solution["sid"], ) - async def fetch_async( - self, redacted: Union[bool, object] = values.unset - ) -> TranscriptInstance: + async def fetch_async(self) -> TranscriptInstance: """ Asynchronous coroutine to fetch the TranscriptInstance - :param redacted: Grant access to PII Redacted/Unredacted Transcript. The default is `true` to access redacted Transcript. :returns: The fetched TranscriptInstance """ - data = values.of( - { - "Redacted": redacted, - } - ) - payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", + uri=self._uri, ) return TranscriptInstance( diff --git a/twilio/rest/intelligence/v2/transcript/media.py b/twilio/rest/intelligence/v2/transcript/media.py index 4e3c5ded6..89a675a95 100644 --- a/twilio/rest/intelligence/v2/transcript/media.py +++ b/twilio/rest/intelligence/v2/transcript/media.py @@ -64,7 +64,7 @@ def fetch(self, redacted: Union[bool, object] = values.unset) -> "MediaInstance" """ Fetch the MediaInstance - :param redacted: Grant access to PII Redacted/Unredacted Media. The default is `true` to access redacted media. + :param redacted: Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. :returns: The fetched MediaInstance """ @@ -78,7 +78,7 @@ async def fetch_async( """ Asynchronous coroutine to fetch the MediaInstance - :param redacted: Grant access to PII Redacted/Unredacted Media. The default is `true` to access redacted media. + :param redacted: Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. :returns: The fetched MediaInstance """ @@ -116,7 +116,7 @@ def fetch(self, redacted: Union[bool, object] = values.unset) -> MediaInstance: """ Fetch the MediaInstance - :param redacted: Grant access to PII Redacted/Unredacted Media. The default is `true` to access redacted media. + :param redacted: Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. :returns: The fetched MediaInstance """ @@ -141,7 +141,7 @@ async def fetch_async( """ Asynchronous coroutine to fetch the MediaInstance - :param redacted: Grant access to PII Redacted/Unredacted Media. The default is `true` to access redacted media. + :param redacted: Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. :returns: The fetched MediaInstance """ diff --git a/twilio/rest/intelligence/v2/transcript/operator_result.py b/twilio/rest/intelligence/v2/transcript/operator_result.py index 1f72f4eb6..662828ce5 100644 --- a/twilio/rest/intelligence/v2/transcript/operator_result.py +++ b/twilio/rest/intelligence/v2/transcript/operator_result.py @@ -111,7 +111,7 @@ def fetch( """ Fetch the OperatorResultInstance - :param redacted: Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + :param redacted: Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. :returns: The fetched OperatorResultInstance """ @@ -125,7 +125,7 @@ async def fetch_async( """ Asynchronous coroutine to fetch the OperatorResultInstance - :param redacted: Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + :param redacted: Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. :returns: The fetched OperatorResultInstance """ @@ -171,7 +171,7 @@ def fetch( """ Fetch the OperatorResultInstance - :param redacted: Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + :param redacted: Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. :returns: The fetched OperatorResultInstance """ @@ -197,7 +197,7 @@ async def fetch_async( """ Asynchronous coroutine to fetch the OperatorResultInstance - :param redacted: Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + :param redacted: Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. :returns: The fetched OperatorResultInstance """ @@ -280,7 +280,7 @@ def stream( is reached. The results are returned as a generator, so this operation is memory efficient. - :param bool redacted: Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + :param bool redacted: Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. :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 @@ -307,7 +307,7 @@ async def stream_async( is reached. The results are returned as a generator, so this operation is memory efficient. - :param bool redacted: Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + :param bool redacted: Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. :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 @@ -333,7 +333,7 @@ def list( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. - :param bool redacted: Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + :param bool redacted: Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. :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 @@ -362,7 +362,7 @@ async def list_async( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. - :param bool redacted: Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + :param bool redacted: Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. :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 @@ -392,7 +392,7 @@ def page( Retrieve a single page of OperatorResultInstance records from the API. Request is executed immediately - :param redacted: Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + :param redacted: Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. :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 @@ -422,7 +422,7 @@ async def page_async( Asynchronously retrieve a single page of OperatorResultInstance records from the API. Request is executed immediately - :param redacted: Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + :param redacted: Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. :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 diff --git a/twilio/rest/intelligence/v2/transcript/sentence.py b/twilio/rest/intelligence/v2/transcript/sentence.py index 6c9acbe5c..0f3176944 100644 --- a/twilio/rest/intelligence/v2/transcript/sentence.py +++ b/twilio/rest/intelligence/v2/transcript/sentence.py @@ -116,7 +116,7 @@ def stream( is reached. The results are returned as a generator, so this operation is memory efficient. - :param bool redacted: Grant access to PII Redacted/Unredacted Sentences. The default is `true` to access redacted sentences. + :param bool redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. :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 @@ -143,7 +143,7 @@ async def stream_async( is reached. The results are returned as a generator, so this operation is memory efficient. - :param bool redacted: Grant access to PII Redacted/Unredacted Sentences. The default is `true` to access redacted sentences. + :param bool redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. :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 @@ -169,7 +169,7 @@ def list( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. - :param bool redacted: Grant access to PII Redacted/Unredacted Sentences. The default is `true` to access redacted sentences. + :param bool redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. :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 @@ -198,7 +198,7 @@ async def list_async( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. - :param bool redacted: Grant access to PII Redacted/Unredacted Sentences. The default is `true` to access redacted sentences. + :param bool redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. :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 @@ -228,7 +228,7 @@ def page( Retrieve a single page of SentenceInstance records from the API. Request is executed immediately - :param redacted: Grant access to PII Redacted/Unredacted Sentences. The default is `true` to access redacted sentences. + :param redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. :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 @@ -258,7 +258,7 @@ async def page_async( Asynchronously retrieve a single page of SentenceInstance records from the API. Request is executed immediately - :param redacted: Grant access to PII Redacted/Unredacted Sentences. The default is `true` to access redacted sentences. + :param redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. :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 diff --git a/twilio/rest/lookups/v2/phone_number.py b/twilio/rest/lookups/v2/phone_number.py index 2346a9a6d..3a3640fbe 100644 --- a/twilio/rest/lookups/v2/phone_number.py +++ b/twilio/rest/lookups/v2/phone_number.py @@ -45,7 +45,7 @@ class ValidationError(object): :ivar identity_match: An object that contains identity match information. The result of comparing user-provided information including name, address, date of birth, national ID, against authoritative phone-based data sources :ivar reassigned_number: An object that contains reassigned number information. Reassigned Numbers will return a phone number's reassignment status given a phone number and date :ivar sms_pumping_risk: An object that contains information on if a phone number has been currently or previously blocked by Verify Fraud Guard for receiving malicious SMS pumping traffic as well as other signals associated with risky carriers and low conversion rates. - :ivar disposable_phone_number_risk: An object that contains information on if a mobile phone number could be a disposable or burner number. + :ivar phone_number_quality_score: An object that contains information of a mobile phone number quality score. Quality score will return a risk score about the phone number. :ivar url: The absolute URL of the resource. """ @@ -81,8 +81,8 @@ def __init__( self.sms_pumping_risk: Optional[Dict[str, object]] = payload.get( "sms_pumping_risk" ) - self.disposable_phone_number_risk: Optional[Dict[str, object]] = payload.get( - "disposable_phone_number_risk" + self.phone_number_quality_score: Optional[Dict[str, object]] = payload.get( + "phone_number_quality_score" ) self.url: Optional[str] = payload.get("url") 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 cfa95e9a5..7ccb53431 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person.py @@ -31,7 +31,7 @@ class UsAppToPersonInstance(InstanceResource): :ivar brand_registration_sid: The unique string to identify the A2P brand. :ivar messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) that the resource is associated with. :ivar description: A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. - :ivar message_samples: Message samples, at least 1 and up to 5 sample messages (at least 2 for starter/sole proprietor), >=20 chars, <=1024 chars each. + :ivar 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. :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. @@ -323,7 +323,7 @@ def create( :param brand_registration_sid: A2P Brand Registration SID :param description: A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. :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 message_samples: Message samples, at least 1 and up to 5 sample messages (at least 2 for sole proprietor), >=20 chars, <=1024 chars each. + :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 us_app_to_person_usecase: A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING..] :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. @@ -388,7 +388,7 @@ async def create_async( :param brand_registration_sid: A2P Brand Registration SID :param description: A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. :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 message_samples: Message samples, at least 1 and up to 5 sample messages (at least 2 for sole proprietor), >=20 chars, <=1024 chars each. + :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 us_app_to_person_usecase: A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING..] :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. diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index 5b9ed673a..74c5a8fee 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -55,6 +55,7 @@ class Status(object): :ivar workspace_sid: The SID of the Workspace that contains the Task. :ivar url: The absolute URL of the Task resource. :ivar links: The URLs of related resources. + :ivar virtual_start_time: The date and time in GMT indicating the ordering for routing of the Task specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. """ def __init__( @@ -101,6 +102,9 @@ def __init__( self.workspace_sid: Optional[str] = payload.get("workspace_sid") self.url: Optional[str] = payload.get("url") self.links: Optional[Dict[str, object]] = payload.get("links") + self.virtual_start_time: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("virtual_start_time") + ) self._solution = { "workspace_sid": workspace_sid, @@ -174,6 +178,7 @@ def update( reason: Union[str, object] = values.unset, priority: Union[int, object] = values.unset, task_channel: Union[str, object] = values.unset, + virtual_start_time: Union[datetime, object] = values.unset, ) -> "TaskInstance": """ Update the TaskInstance @@ -184,6 +189,7 @@ def update( :param reason: The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. :param priority: The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). :param task_channel: When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + :param virtual_start_time: The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. :returns: The updated TaskInstance """ @@ -194,6 +200,7 @@ def update( reason=reason, priority=priority, task_channel=task_channel, + virtual_start_time=virtual_start_time, ) async def update_async( @@ -204,6 +211,7 @@ async def update_async( reason: Union[str, object] = values.unset, priority: Union[int, object] = values.unset, task_channel: Union[str, object] = values.unset, + virtual_start_time: Union[datetime, object] = values.unset, ) -> "TaskInstance": """ Asynchronous coroutine to update the TaskInstance @@ -214,6 +222,7 @@ async def update_async( :param reason: The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. :param priority: The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). :param task_channel: When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + :param virtual_start_time: The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. :returns: The updated TaskInstance """ @@ -224,6 +233,7 @@ async def update_async( reason=reason, priority=priority, task_channel=task_channel, + virtual_start_time=virtual_start_time, ) @property @@ -345,6 +355,7 @@ def update( reason: Union[str, object] = values.unset, priority: Union[int, object] = values.unset, task_channel: Union[str, object] = values.unset, + virtual_start_time: Union[datetime, object] = values.unset, ) -> TaskInstance: """ Update the TaskInstance @@ -355,6 +366,7 @@ def update( :param reason: The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. :param priority: The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). :param task_channel: When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + :param virtual_start_time: The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. :returns: The updated TaskInstance """ @@ -365,6 +377,7 @@ def update( "Reason": reason, "Priority": priority, "TaskChannel": task_channel, + "VirtualStartTime": serialize.iso8601_datetime(virtual_start_time), } ) headers = values.of( @@ -392,6 +405,7 @@ async def update_async( reason: Union[str, object] = values.unset, priority: Union[int, object] = values.unset, task_channel: Union[str, object] = values.unset, + virtual_start_time: Union[datetime, object] = values.unset, ) -> TaskInstance: """ Asynchronous coroutine to update the TaskInstance @@ -402,6 +416,7 @@ async def update_async( :param reason: The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. :param priority: The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). :param task_channel: When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + :param virtual_start_time: The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. :returns: The updated TaskInstance """ @@ -412,6 +427,7 @@ async def update_async( "Reason": reason, "Priority": priority, "TaskChannel": task_channel, + "VirtualStartTime": serialize.iso8601_datetime(virtual_start_time), } ) headers = values.of( @@ -498,6 +514,7 @@ def create( task_channel: Union[str, object] = values.unset, workflow_sid: Union[str, object] = values.unset, attributes: Union[str, object] = values.unset, + virtual_start_time: Union[datetime, object] = values.unset, ) -> TaskInstance: """ Create the TaskInstance @@ -507,6 +524,7 @@ def create( :param task_channel: When MultiTasking is enabled, specify the TaskChannel by passing either its `unique_name` or `sid`. Default value is `default`. :param workflow_sid: The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. :param attributes: A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. + :param virtual_start_time: The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future. :returns: The created TaskInstance """ @@ -517,6 +535,7 @@ def create( "TaskChannel": task_channel, "WorkflowSid": workflow_sid, "Attributes": attributes, + "VirtualStartTime": serialize.iso8601_datetime(virtual_start_time), } ) @@ -537,6 +556,7 @@ async def create_async( task_channel: Union[str, object] = values.unset, workflow_sid: Union[str, object] = values.unset, attributes: Union[str, object] = values.unset, + virtual_start_time: Union[datetime, object] = values.unset, ) -> TaskInstance: """ Asynchronously create the TaskInstance @@ -546,6 +566,7 @@ async def create_async( :param task_channel: When MultiTasking is enabled, specify the TaskChannel by passing either its `unique_name` or `sid`. Default value is `default`. :param workflow_sid: The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. :param attributes: A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. + :param virtual_start_time: The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future. :returns: The created TaskInstance """ @@ -556,6 +577,7 @@ async def create_async( "TaskChannel": task_channel, "WorkflowSid": workflow_sid, "Attributes": attributes, + "VirtualStartTime": serialize.iso8601_datetime(virtual_start_time), } ) @@ -596,7 +618,7 @@ def stream( :param str task_queue_sid: The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. :param str task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param str evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. - :param str ordering: How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `Priority` or `DateCreated` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Multiple sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. + :param str ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. :param bool has_addons: Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @@ -650,7 +672,7 @@ async def stream_async( :param str task_queue_sid: The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. :param str task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param str evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. - :param str ordering: How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `Priority` or `DateCreated` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Multiple sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. + :param str ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. :param bool has_addons: Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @@ -703,7 +725,7 @@ def list( :param str task_queue_sid: The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. :param str task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param str evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. - :param str ordering: How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `Priority` or `DateCreated` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Multiple sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. + :param str ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. :param bool has_addons: Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit @@ -756,7 +778,7 @@ async def list_async( :param str task_queue_sid: The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. :param str task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param str evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. - :param str ordering: How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `Priority` or `DateCreated` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Multiple sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. + :param str ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. :param bool has_addons: Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit @@ -810,7 +832,7 @@ def page( :param task_queue_sid: The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. :param task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. - :param ordering: How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `Priority` or `DateCreated` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Multiple sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. + :param ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. :param has_addons: Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state @@ -864,7 +886,7 @@ async def page_async( :param task_queue_sid: The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. :param task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. - :param ordering: How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `Priority` or `DateCreated` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Multiple sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. + :param ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. :param has_addons: Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state