diff --git a/CHANGES.md b/CHANGES.md index 1a652208c..92294761d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,24 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2023-11-06] Version 8.10.1 +--------------------------- +**Flex** +- Adding `provisioning_status` for Email Manager + +**Intelligence** +- Add text-generation operator (for example conversation summary) results to existing OperatorResults collection. + +**Messaging** +- Add DELETE support to Tollfree Verification resource + +**Serverless** +- Add node18 as a valid Build runtime + +**Verify** +- Update Verify TOTP maturity to GA. + + [2023-10-19] Version 8.10.0 --------------------------- **Library - Fix** diff --git a/twilio/rest/flex_api/v1/__init__.py b/twilio/rest/flex_api/v1/__init__.py index 64701c623..59e697bd9 100644 --- a/twilio/rest/flex_api/v1/__init__.py +++ b/twilio/rest/flex_api/v1/__init__.py @@ -40,6 +40,7 @@ ) from twilio.rest.flex_api.v1.insights_user_roles import InsightsUserRolesList from twilio.rest.flex_api.v1.interaction import InteractionList +from twilio.rest.flex_api.v1.provisioning_status import ProvisioningStatusList from twilio.rest.flex_api.v1.web_channel import WebChannelList @@ -74,6 +75,7 @@ def __init__(self, domain: Domain): self._insights_settings_comment: Optional[InsightsSettingsCommentList] = None self._insights_user_roles: Optional[InsightsUserRolesList] = None self._interaction: Optional[InteractionList] = None + self._provisioning_status: Optional[ProvisioningStatusList] = None self._web_channel: Optional[WebChannelList] = None @property @@ -170,6 +172,12 @@ def interaction(self) -> InteractionList: self._interaction = InteractionList(self) return self._interaction + @property + def provisioning_status(self) -> ProvisioningStatusList: + if self._provisioning_status is None: + self._provisioning_status = ProvisioningStatusList(self) + return self._provisioning_status + @property def web_channel(self) -> WebChannelList: if self._web_channel is None: diff --git a/twilio/rest/flex_api/v1/provisioning_status.py b/twilio/rest/flex_api/v1/provisioning_status.py new file mode 100644 index 000000000..7b00927e0 --- /dev/null +++ b/twilio/rest/flex_api/v1/provisioning_status.py @@ -0,0 +1,174 @@ +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 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 ProvisioningStatusInstance(InstanceResource): + class Status(object): + ACTIVE = "active" + IN_PROGRESS = "in-progress" + NOT_CONFIGURED = "not-configured" + FAILED = "failed" + + """ + :ivar status: + :ivar url: The absolute URL of the resource. + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.status: Optional["ProvisioningStatusInstance.Status"] = payload.get( + "status" + ) + self.url: Optional[str] = payload.get("url") + + self._context: Optional[ProvisioningStatusContext] = None + + @property + def _proxy(self) -> "ProvisioningStatusContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: ProvisioningStatusContext for this ProvisioningStatusInstance + """ + if self._context is None: + self._context = ProvisioningStatusContext( + self._version, + ) + return self._context + + def fetch(self) -> "ProvisioningStatusInstance": + """ + Fetch the ProvisioningStatusInstance + + + :returns: The fetched ProvisioningStatusInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "ProvisioningStatusInstance": + """ + Asynchronous coroutine to fetch the ProvisioningStatusInstance + + + :returns: The fetched ProvisioningStatusInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class ProvisioningStatusContext(InstanceContext): + def __init__(self, version: Version): + """ + Initialize the ProvisioningStatusContext + + :param version: Version that contains the resource + """ + super().__init__(version) + + self._uri = "/account/provision/status" + + def fetch(self) -> ProvisioningStatusInstance: + """ + Fetch the ProvisioningStatusInstance + + + :returns: The fetched ProvisioningStatusInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return ProvisioningStatusInstance( + self._version, + payload, + ) + + async def fetch_async(self) -> ProvisioningStatusInstance: + """ + Asynchronous coroutine to fetch the ProvisioningStatusInstance + + + :returns: The fetched ProvisioningStatusInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return ProvisioningStatusInstance( + self._version, + payload, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class ProvisioningStatusList(ListResource): + def __init__(self, version: Version): + """ + Initialize the ProvisioningStatusList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self) -> ProvisioningStatusContext: + """ + Constructs a ProvisioningStatusContext + + """ + return ProvisioningStatusContext(self._version) + + def __call__(self) -> ProvisioningStatusContext: + """ + Constructs a ProvisioningStatusContext + + """ + return ProvisioningStatusContext(self._version) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/intelligence/v2/transcript/operator_result.py b/twilio/rest/intelligence/v2/transcript/operator_result.py index 662828ce5..40e4e5888 100644 --- a/twilio/rest/intelligence/v2/transcript/operator_result.py +++ b/twilio/rest/intelligence/v2/transcript/operator_result.py @@ -43,6 +43,7 @@ class OperatorType(object): :ivar predicted_probability: Percentage of 'matching' class needed to consider a sentence matches. :ivar label_probabilities: The labels probabilities. This might be available on conversation classify model outputs. :ivar extract_results: List of text extraction results. This might be available on classify-extract model outputs. + :ivar text_generation_results: Output of a text generation operator for example Conversation Sumamary. :ivar transcript_sid: A 34 character string that uniquely identifies this Transcript. :ivar url: The URL of this resource. """ @@ -80,6 +81,9 @@ def __init__( self.extract_results: Optional[Dict[str, object]] = payload.get( "extract_results" ) + self.text_generation_results: Optional[Dict[str, object]] = payload.get( + "text_generation_results" + ) self.transcript_sid: Optional[str] = payload.get("transcript_sid") self.url: Optional[str] = payload.get("url") diff --git a/twilio/rest/messaging/v1/tollfree_verification.py b/twilio/rest/messaging/v1/tollfree_verification.py index 47b73d7da..3cb6e4081 100644 --- a/twilio/rest/messaging/v1/tollfree_verification.py +++ b/twilio/rest/messaging/v1/tollfree_verification.py @@ -168,6 +168,24 @@ def _proxy(self) -> "TollfreeVerificationContext": ) return self._context + def delete(self) -> bool: + """ + Deletes the TollfreeVerificationInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the TollfreeVerificationInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + def fetch(self) -> "TollfreeVerificationInstance": """ Fetch the TollfreeVerificationInstance @@ -360,6 +378,30 @@ def __init__(self, version: Version, sid: str): } self._uri = "/Tollfree/Verifications/{sid}".format(**self._solution) + def delete(self) -> bool: + """ + Deletes the TollfreeVerificationInstance + + + :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 TollfreeVerificationInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + def fetch(self) -> TollfreeVerificationInstance: """ Fetch the TollfreeVerificationInstance diff --git a/twilio/rest/serverless/v1/service/build/__init__.py b/twilio/rest/serverless/v1/service/build/__init__.py index 0fe3b8f92..e38f9117d 100644 --- a/twilio/rest/serverless/v1/service/build/__init__.py +++ b/twilio/rest/serverless/v1/service/build/__init__.py @@ -32,6 +32,7 @@ class Runtime(object): NODE12 = "node12" NODE14 = "node14" NODE16 = "node16" + NODE18 = "node18" class Status(object): BUILDING = "building" diff --git a/twilio/rest/trusthub/v1/__init__.py b/twilio/rest/trusthub/v1/__init__.py index 10c3fd825..7d11abd1e 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_tollfree_inquiries import ( + ComplianceTollfreeInquiriesList, +) from twilio.rest.trusthub.v1.customer_profiles import CustomerProfilesList from twilio.rest.trusthub.v1.end_user import EndUserList from twilio.rest.trusthub.v1.end_user_type import EndUserTypeList @@ -34,6 +37,9 @@ def __init__(self, domain: Domain): """ super().__init__(domain, "v1") self._compliance_inquiries: Optional[ComplianceInquiriesList] = None + self._compliance_tollfree_inquiries: Optional[ + ComplianceTollfreeInquiriesList + ] = None self._customer_profiles: Optional[CustomerProfilesList] = None self._end_users: Optional[EndUserList] = None self._end_user_types: Optional[EndUserTypeList] = None @@ -48,6 +54,12 @@ def compliance_inquiries(self) -> ComplianceInquiriesList: self._compliance_inquiries = ComplianceInquiriesList(self) return self._compliance_inquiries + @property + def compliance_tollfree_inquiries(self) -> ComplianceTollfreeInquiriesList: + if self._compliance_tollfree_inquiries is None: + self._compliance_tollfree_inquiries = ComplianceTollfreeInquiriesList(self) + return self._compliance_tollfree_inquiries + @property def customer_profiles(self) -> CustomerProfilesList: if self._customer_profiles is None: diff --git a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py new file mode 100644 index 000000000..14df68438 --- /dev/null +++ b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py @@ -0,0 +1,262 @@ +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 +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 +from twilio.base.version import Version + + +class ComplianceTollfreeInquiriesInstance(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. + :ivar tollfree_id: The TolfreeId matching the Tollfree 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], + tollfree_id: Optional[str] = None, + ): + super().__init__(version) + + self.inquiry_id: Optional[str] = payload.get("inquiry_id") + self.inquiry_session_token: Optional[str] = payload.get("inquiry_session_token") + self.tollfree_id: Optional[str] = payload.get("tollfree_id") + self.url: Optional[str] = payload.get("url") + + self._solution = { + "tollfree_id": tollfree_id or self.tollfree_id, + } + self._context: Optional[ComplianceTollfreeInquiriesContext] = None + + @property + def _proxy(self) -> "ComplianceTollfreeInquiriesContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: ComplianceTollfreeInquiriesContext for this ComplianceTollfreeInquiriesInstance + """ + if self._context is None: + self._context = ComplianceTollfreeInquiriesContext( + self._version, + tollfree_id=self._solution["tollfree_id"], + ) + return self._context + + def update(self, did: str) -> "ComplianceTollfreeInquiriesInstance": + """ + Update the ComplianceTollfreeInquiriesInstance + + :param did: The Tollfree phone number to be verified + + :returns: The updated ComplianceTollfreeInquiriesInstance + """ + return self._proxy.update( + did=did, + ) + + async def update_async(self, did: str) -> "ComplianceTollfreeInquiriesInstance": + """ + Asynchronous coroutine to update the ComplianceTollfreeInquiriesInstance + + :param did: The Tollfree phone number to be verified + + :returns: The updated ComplianceTollfreeInquiriesInstance + """ + return await self._proxy.update_async( + did=did, + ) + + 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 ComplianceTollfreeInquiriesContext(InstanceContext): + def __init__(self, version: Version, tollfree_id: str): + """ + Initialize the ComplianceTollfreeInquiriesContext + + :param version: Version that contains the resource + :param tollfree_id: The unique TolfreeId matching the Compliance Tollfree Verification Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Compliance Tollfree Verification Inquiry creation call. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "tollfree_id": tollfree_id, + } + self._uri = "/ComplianceInquiries/Tollfree/{tollfree_id}/Initialize".format( + **self._solution + ) + + def update(self, did: str) -> ComplianceTollfreeInquiriesInstance: + """ + Update the ComplianceTollfreeInquiriesInstance + + :param did: The Tollfree phone number to be verified + + :returns: The updated ComplianceTollfreeInquiriesInstance + """ + data = values.of( + { + "Did": did, + } + ) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return ComplianceTollfreeInquiriesInstance( + self._version, payload, tollfree_id=self._solution["tollfree_id"] + ) + + async def update_async(self, did: str) -> ComplianceTollfreeInquiriesInstance: + """ + Asynchronous coroutine to update the ComplianceTollfreeInquiriesInstance + + :param did: The Tollfree phone number to be verified + + :returns: The updated ComplianceTollfreeInquiriesInstance + """ + data = values.of( + { + "Did": did, + } + ) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return ComplianceTollfreeInquiriesInstance( + self._version, payload, tollfree_id=self._solution["tollfree_id"] + ) + + 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 ComplianceTollfreeInquiriesList(ListResource): + def __init__(self, version: Version): + """ + Initialize the ComplianceTollfreeInquiriesList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/ComplianceInquiries/Tollfree/Initialize" + + def create(self, did: str) -> ComplianceTollfreeInquiriesInstance: + """ + Create the ComplianceTollfreeInquiriesInstance + + :param did: The Tollfree phone number to be verified + + :returns: The created ComplianceTollfreeInquiriesInstance + """ + data = values.of( + { + "Did": did, + } + ) + + payload = self._version.create( + method="POST", + uri=self._uri, + data=data, + ) + + return ComplianceTollfreeInquiriesInstance(self._version, payload) + + async def create_async(self, did: str) -> ComplianceTollfreeInquiriesInstance: + """ + Asynchronously create the ComplianceTollfreeInquiriesInstance + + :param did: The Tollfree phone number to be verified + + :returns: The created ComplianceTollfreeInquiriesInstance + """ + data = values.of( + { + "Did": did, + } + ) + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + data=data, + ) + + return ComplianceTollfreeInquiriesInstance(self._version, payload) + + def get(self, tollfree_id: str) -> ComplianceTollfreeInquiriesContext: + """ + Constructs a ComplianceTollfreeInquiriesContext + + :param tollfree_id: The unique TolfreeId matching the Compliance Tollfree Verification Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Compliance Tollfree Verification Inquiry creation call. + """ + return ComplianceTollfreeInquiriesContext( + self._version, tollfree_id=tollfree_id + ) + + def __call__(self, tollfree_id: str) -> ComplianceTollfreeInquiriesContext: + """ + Constructs a ComplianceTollfreeInquiriesContext + + :param tollfree_id: The unique TolfreeId matching the Compliance Tollfree Verification Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Compliance Tollfree Verification Inquiry creation call. + """ + return ComplianceTollfreeInquiriesContext( + self._version, tollfree_id=tollfree_id + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return ""