diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 9fdcf4c752..1e1c04d500 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -17,7 +17,7 @@ jobs: timeout-minutes: 20 strategy: matrix: - python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ] + python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] steps: - name: Checkout twilio-python uses: actions/checkout@v3 diff --git a/CHANGES.md b/CHANGES.md index f95edb2e60..b7904a9901 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,15 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2025-01-09] Version 9.4.2 +-------------------------- +**Library - Chore** +- [PR #832](https://github.com/twilio/twilio-python/pull/832): remove test for 3.7. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Numbers** +- Change beta feature flag to use v2/BulkHostedNumberOrders + + [2024-12-13] Version 9.4.1 -------------------------- **Library - Fix** diff --git a/setup.py b/setup.py index d8a0907ea4..0ab6bc732a 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.4.1", + version="9.4.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 586ef4d4ab..145e35680b 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "4", "1") +__version_info__ = ("9", "4", "2") __version__ = ".".join(__version_info__) diff --git a/twilio/rest/api/v2010/account/call/transcription.py b/twilio/rest/api/v2010/account/call/transcription.py index f415928cc8..5921cce12f 100644 --- a/twilio/rest/api/v2010/account/call/transcription.py +++ b/twilio/rest/api/v2010/account/call/transcription.py @@ -287,7 +287,7 @@ def create( :param speech_model: Recognition model used by the transcription engine, among those supported by the provider :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. :param enable_automatic_punctuation: The provider will add punctuation to recognition result - :param intelligence_service: The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. + :param intelligence_service: The SID or the unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. :returns: The created TranscriptionInstance """ @@ -362,7 +362,7 @@ async def create_async( :param speech_model: Recognition model used by the transcription engine, among those supported by the provider :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. :param enable_automatic_punctuation: The provider will add punctuation to recognition result - :param intelligence_service: The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. + :param intelligence_service: The SID or the unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. :returns: The created TranscriptionInstance """ diff --git a/twilio/rest/assistants/v1/assistant/assistants_knowledge.py b/twilio/rest/assistants/v1/assistant/assistants_knowledge.py index c3767223e1..681d71789b 100644 --- a/twilio/rest/assistants/v1/assistant/assistants_knowledge.py +++ b/twilio/rest/assistants/v1/assistant/assistants_knowledge.py @@ -32,6 +32,7 @@ class AssistantsKnowledgeInstance(InstanceResource): :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') :ivar type: The type of knowledge source ('Web', 'Database', 'Text', 'File') :ivar url: The url of the knowledge resource. + :ivar embedding_model: The embedding model to be used for the knowledge source. :ivar date_created: The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. """ @@ -55,6 +56,7 @@ def __init__( self.status: Optional[str] = payload.get("status") self.type: Optional[str] = payload.get("type") self.url: Optional[str] = payload.get("url") + self.embedding_model: Optional[str] = payload.get("embedding_model") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) diff --git a/twilio/rest/assistants/v1/knowledge/__init__.py b/twilio/rest/assistants/v1/knowledge/__init__.py index 993ed922ce..7d616f8682 100644 --- a/twilio/rest/assistants/v1/knowledge/__init__.py +++ b/twilio/rest/assistants/v1/knowledge/__init__.py @@ -34,6 +34,7 @@ class AssistantsV1ServiceCreateKnowledgeRequest(object): :ivar name: The name of the tool. :ivar policy: :ivar type: The type of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. """ def __init__(self, payload: Dict[str, Any]): @@ -48,6 +49,7 @@ def __init__(self, payload: Dict[str, Any]): KnowledgeList.AssistantsV1ServiceCreatePolicyRequest ] = payload.get("policy") self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") def to_dict(self): return { @@ -57,6 +59,7 @@ def to_dict(self): "name": self.name, "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, + "embedding_model": self.embedding_model, } class AssistantsV1ServiceCreatePolicyRequest(object): @@ -94,6 +97,7 @@ class AssistantsV1ServiceUpdateKnowledgeRequest(object): :ivar name: The name of the knowledge source. :ivar policy: :ivar type: The description of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. """ def __init__(self, payload: Dict[str, Any]): @@ -107,6 +111,7 @@ def __init__(self, payload: Dict[str, Any]): KnowledgeList.AssistantsV1ServiceCreatePolicyRequest ] = payload.get("policy") self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") def to_dict(self): return { @@ -115,6 +120,7 @@ def to_dict(self): "name": self.name, "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, + "embedding_model": self.embedding_model, } """ @@ -126,6 +132,7 @@ def to_dict(self): :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') :ivar type: The type of knowledge source ('Web', 'Database', 'Text', 'File') :ivar url: The url of the knowledge resource. + :ivar embedding_model: The embedding model to be used for the knowledge source. :ivar date_created: The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. """ @@ -145,6 +152,7 @@ def __init__( self.status: Optional[str] = payload.get("status") self.type: Optional[str] = payload.get("type") self.url: Optional[str] = payload.get("url") + self.embedding_model: Optional[str] = payload.get("embedding_model") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) @@ -276,6 +284,7 @@ class AssistantsV1ServiceCreateKnowledgeRequest(object): :ivar name: The name of the tool. :ivar policy: :ivar type: The type of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. """ def __init__(self, payload: Dict[str, Any]): @@ -290,6 +299,7 @@ def __init__(self, payload: Dict[str, Any]): KnowledgeList.AssistantsV1ServiceCreatePolicyRequest ] = payload.get("policy") self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") def to_dict(self): return { @@ -299,6 +309,7 @@ def to_dict(self): "name": self.name, "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, + "embedding_model": self.embedding_model, } class AssistantsV1ServiceCreatePolicyRequest(object): @@ -336,6 +347,7 @@ class AssistantsV1ServiceUpdateKnowledgeRequest(object): :ivar name: The name of the knowledge source. :ivar policy: :ivar type: The description of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. """ def __init__(self, payload: Dict[str, Any]): @@ -349,6 +361,7 @@ def __init__(self, payload: Dict[str, Any]): KnowledgeList.AssistantsV1ServiceCreatePolicyRequest ] = payload.get("policy") self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") def to_dict(self): return { @@ -357,6 +370,7 @@ def to_dict(self): "name": self.name, "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, + "embedding_model": self.embedding_model, } def __init__(self, version: Version, id: str): @@ -562,6 +576,7 @@ class AssistantsV1ServiceCreateKnowledgeRequest(object): :ivar name: The name of the tool. :ivar policy: :ivar type: The type of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. """ def __init__(self, payload: Dict[str, Any]): @@ -576,6 +591,7 @@ def __init__(self, payload: Dict[str, Any]): KnowledgeList.AssistantsV1ServiceCreatePolicyRequest ] = payload.get("policy") self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") def to_dict(self): return { @@ -585,6 +601,7 @@ def to_dict(self): "name": self.name, "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, + "embedding_model": self.embedding_model, } class AssistantsV1ServiceCreatePolicyRequest(object): @@ -622,6 +639,7 @@ class AssistantsV1ServiceUpdateKnowledgeRequest(object): :ivar name: The name of the knowledge source. :ivar policy: :ivar type: The description of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. """ def __init__(self, payload: Dict[str, Any]): @@ -635,6 +653,7 @@ def __init__(self, payload: Dict[str, Any]): KnowledgeList.AssistantsV1ServiceCreatePolicyRequest ] = payload.get("policy") self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") def to_dict(self): return { @@ -643,6 +662,7 @@ def to_dict(self): "name": self.name, "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, + "embedding_model": self.embedding_model, } def __init__(self, version: Version): diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index d877b63bc4..60a5b05016 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -247,46 +247,17 @@ class FlowsPageComponent(object): """ :ivar label: :ivar type: - :ivar text: - :ivar options: """ def __init__(self, payload: Dict[str, Any]): self.label: Optional[str] = payload.get("label") self.type: Optional[str] = payload.get("type") - self.text: Optional[str] = payload.get("text") - self.options: Optional[List[ContentList.FlowsPageComponentSelectItem]] = ( - payload.get("options") - ) def to_dict(self): return { "label": self.label, "type": self.type, - "text": self.text, - "options": ( - [options.to_dict() for options in self.options] - if self.options is not None - else None - ), - } - - class FlowsPageComponentSelectItem(object): - """ - :ivar id: - :ivar title: - """ - - def __init__(self, payload: Dict[str, Any]): - - self.id: Optional[str] = payload.get("id") - self.title: Optional[str] = payload.get("title") - - def to_dict(self): - return { - "id": self.id, - "title": self.title, } class ListItem(object): @@ -1106,46 +1077,17 @@ class FlowsPageComponent(object): """ :ivar label: :ivar type: - :ivar text: - :ivar options: """ def __init__(self, payload: Dict[str, Any]): self.label: Optional[str] = payload.get("label") self.type: Optional[str] = payload.get("type") - self.text: Optional[str] = payload.get("text") - self.options: Optional[List[ContentList.FlowsPageComponentSelectItem]] = ( - payload.get("options") - ) def to_dict(self): return { "label": self.label, "type": self.type, - "text": self.text, - "options": ( - [options.to_dict() for options in self.options] - if self.options is not None - else None - ), - } - - class FlowsPageComponentSelectItem(object): - """ - :ivar id: - :ivar title: - """ - - def __init__(self, payload: Dict[str, Any]): - - self.id: Optional[str] = payload.get("id") - self.title: Optional[str] = payload.get("title") - - def to_dict(self): - return { - "id": self.id, - "title": self.title, } class ListItem(object): @@ -1966,46 +1908,17 @@ class FlowsPageComponent(object): """ :ivar label: :ivar type: - :ivar text: - :ivar options: """ def __init__(self, payload: Dict[str, Any]): self.label: Optional[str] = payload.get("label") self.type: Optional[str] = payload.get("type") - self.text: Optional[str] = payload.get("text") - self.options: Optional[List[ContentList.FlowsPageComponentSelectItem]] = ( - payload.get("options") - ) def to_dict(self): return { "label": self.label, "type": self.type, - "text": self.text, - "options": ( - [options.to_dict() for options in self.options] - if self.options is not None - else None - ), - } - - class FlowsPageComponentSelectItem(object): - """ - :ivar id: - :ivar title: - """ - - def __init__(self, payload: Dict[str, Any]): - - self.id: Optional[str] = payload.get("id") - self.title: Optional[str] = payload.get("title") - - def to_dict(self): - return { - "id": self.id, - "title": self.title, } class ListItem(object): diff --git a/twilio/rest/conversations/v1/address_configuration.py b/twilio/rest/conversations/v1/address_configuration.py index 096f023889..4ebfa47fc2 100644 --- a/twilio/rest/conversations/v1/address_configuration.py +++ b/twilio/rest/conversations/v1/address_configuration.py @@ -39,6 +39,7 @@ class Type(object): MESSENGER = "messenger" GBM = "gbm" EMAIL = "email" + RCS = "rcs" """ :ivar sid: A 34 character string that uniquely identifies this resource. diff --git a/twilio/rest/insights/v1/call/call_summary.py b/twilio/rest/insights/v1/call/call_summary.py index f11aa912ed..e21af100a1 100644 --- a/twilio/rest/insights/v1/call/call_summary.py +++ b/twilio/rest/insights/v1/call/call_summary.py @@ -47,6 +47,7 @@ class CallType(object): SIP = "sip" TRUNKING = "trunking" CLIENT = "client" + WHATSAPP = "whatsapp" class ProcessingState(object): COMPLETE = "complete" diff --git a/twilio/rest/insights/v1/call_summaries.py b/twilio/rest/insights/v1/call_summaries.py index 45fcce98c1..0a75e38454 100644 --- a/twilio/rest/insights/v1/call_summaries.py +++ b/twilio/rest/insights/v1/call_summaries.py @@ -48,6 +48,7 @@ class CallType(object): SIP = "sip" TRUNKING = "trunking" CLIENT = "client" + WHATSAPP = "whatsapp" class ProcessingState(object): COMPLETE = "complete" diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 68f078a88d..043364c3d5 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,10 +28,12 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) +from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( + PortingWebhookConfigurationFetchList, +) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) -from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -56,10 +58,12 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None + self._porting_webhook_configuration_fetch: Optional[ + PortingWebhookConfigurationFetchList + ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None - self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -107,18 +111,22 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete + @property + def porting_webhook_configuration_fetch( + self, + ) -> PortingWebhookConfigurationFetchList: + if self._porting_webhook_configuration_fetch is None: + self._porting_webhook_configuration_fetch = ( + PortingWebhookConfigurationFetchList(self) + ) + return self._porting_webhook_configuration_fetch + @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations - @property - def webhook(self) -> WebhookList: - if self._webhook is None: - self._webhook = WebhookList(self) - return self._webhook - def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/webhook.py b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py similarity index 78% rename from twilio/rest/numbers/v1/webhook.py rename to twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py index 69bd556326..5d381768c7 100644 --- a/twilio/rest/numbers/v1/webhook.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class WebhookInstance(InstanceResource): +class PortingWebhookConfigurationFetchInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class WebhookList(ListResource): +class PortingWebhookConfigurationFetchList(ListResource): def __init__(self, version: Version): """ - Initialize the WebhookList + Initialize the PortingWebhookConfigurationFetchList :param version: Version that contains the resource @@ -68,12 +68,12 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> WebhookInstance: + def fetch(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -81,14 +81,14 @@ def fetch(self) -> WebhookInstance: payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) - async def fetch_async(self) -> WebhookInstance: + async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -98,7 +98,7 @@ async def fetch_async(self) -> WebhookInstance: method="GET", uri=self._uri, headers=headers ) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) def __repr__(self) -> str: """ @@ -106,4 +106,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return ""