Skip to content

Commit 0a26588

Browse files
authored
Merge branch 'main' into snyk-fix-ae4ac38fefde26335928ee53bb0962de
2 parents 4444c2b + 317a5bb commit 0a26588

File tree

29 files changed

+1316
-41
lines changed

29 files changed

+1316
-41
lines changed

.github/workflows/test-and-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }}
4848
TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }}
4949
TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }}
50+
ASSISTANT_ID: ${{ secrets.ASSISTANT_ID }}
5051
run: make cluster-test
5152

5253
- name: Verify docs generation

CHANGES.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,80 @@ twilio-python Changelog
33

44
Here you can see the full list of changes between each twilio-python release.
55

6+
[2025-03-11] Version 9.5.0
7+
--------------------------
8+
**Library - Feature**
9+
- [PR #850](https://github.com/twilio/twilio-python/pull/850): Update UPGRADE.md. Thanks to [@manisha1997](https://github.com/manisha1997)!
10+
11+
**Library - Fix**
12+
- [PR #847](https://github.com/twilio/twilio-python/pull/847): AssistantsBase import. Thanks to [@sbansla](https://github.com/sbansla)!
13+
14+
**Api**
15+
- Add the missing `emergency_enabled` field for `Address Service` endpoints
16+
17+
**Messaging**
18+
- Add missing enums for A2P and TF
19+
20+
**Numbers**
21+
- add missing enum values to hosted_number_order_status
22+
23+
**Twiml**
24+
- Convert Twiml Attribute `speechModel` of type enum to string **(breaking change)**
25+
26+
27+
[2025-02-20] Version 9.4.6
28+
--------------------------
29+
**Library - Chore**
30+
- [PR #842](https://github.com/twilio/twilio-python/pull/842): issue 841. Thanks to [@manisha1997](https://github.com/manisha1997)!
31+
32+
**Flex**
33+
- Adding Digital Transfers APIs under v1/Interactions
34+
35+
**Numbers**
36+
- Convert webhook_type to ienum type in v1/Porting/Configuration/Webhook/{webhook_type}
37+
38+
**Trusthub**
39+
- Changing TrustHub SupportingDocument status enum from lowercase to uppercase since kyc-orch returns status capitalized and rest proxy requires strict casing
40+
41+
42+
[2025-02-11] Version 9.4.5
43+
--------------------------
44+
**Api**
45+
- Change downstream url and change media type for file `base/api/v2010/validation_request.json`.
46+
47+
**Intelligence**
48+
- Add json_results for Generative JSON operator results
49+
50+
**Messaging**
51+
- Add DestinationAlphaSender API to support Country-Specific Alpha Senders
52+
53+
**Video**
54+
- Change codec type from enum to case-insensitive enum in recording and room_recording apis
55+
56+
57+
[2025-01-28] Version 9.4.4
58+
--------------------------
59+
**Library - Fix**
60+
- [PR #822](https://github.com/twilio/twilio-python/pull/822): Fix for 10 vulnerabilities. Thanks to [@twilio-product-security](https://github.com/twilio-product-security)!
61+
62+
**Library - Chore**
63+
- [PR #834](https://github.com/twilio/twilio-python/pull/834): update httpclient. Thanks to [@manisha1997](https://github.com/manisha1997)!
64+
- [PR #837](https://github.com/twilio/twilio-python/pull/837): enable newer versions of aiohttp-retry. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
65+
- [PR #833](https://github.com/twilio/twilio-python/pull/833): created bug report issue template. Thanks to [@sbansla](https://github.com/sbansla)!
66+
67+
**Api**
68+
- Add open-api file tag to `conference/call recordings` and `recording_transcriptions`.
69+
70+
**Events**
71+
- Add support for subaccount subscriptions (beta)
72+
73+
**Insights**
74+
- add new region to conference APIs
75+
76+
**Lookups**
77+
- Add new `parnter_sub_id` query parameter to the lookup request
78+
79+
680
[2025-01-13] Version 9.4.3
781
--------------------------
882
**Messaging**

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ client = Client()
135135

136136
### Specify Region and/or Edge
137137

138-
To take advantage of Twilio's [Global Infrastructure](https://www.twilio.com/docs/global-infrastructure), specify the target Region and/or Edge for the client:
138+
To take advantage of Twilio's [Global Infrastructure](https://www.twilio.com/docs/global-infrastructure), specify the target Region and Edge for the client:
139+
140+
> **Note:** When specifying a `region` parameter for a helper library client, be sure to also specify the `edge` parameter. For backward compatibility purposes, specifying a `region` without specifying an `edge` will result in requests being routed to US1.
139141
140142
```python
141143
from twilio.rest import Client

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
setup(
1515
name="twilio",
16-
version="9.4.3",
16+
version="9.5.0",
1717
description="Twilio API client and TwiML generator",
1818
author="Twilio",
1919
help_center="https://www.twilio.com/help/contact",

tests/cluster/test_cluster.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def setUp(self):
1212
self.api_key = os.environ["TWILIO_API_KEY"]
1313
self.api_secret = os.environ["TWILIO_API_SECRET"]
1414
self.account_sid = os.environ["TWILIO_ACCOUNT_SID"]
15+
self.assistant_id = os.environ["ASSISTANT_ID"]
1516
self.client = Client(
1617
username=self.api_key,
1718
password=self.api_secret,
@@ -65,6 +66,11 @@ def test_list_available_numbers(self):
6566
self.assertIsNotNone(toll_free_numbers)
6667
self.assertEqual(len(toll_free_numbers), 2)
6768

69+
def test_fetch_assistant(self):
70+
assistant = self.client.assistants.v1.assistants(self.assistant_id).fetch()
71+
self.assertIsNotNone(assistant)
72+
self.assertEqual(assistant.account_sid, self.account_sid)
73+
6874
def test_calling_twiml_string(self):
6975
call = self.client.calls.create(
7076
to=self.to_number, from_=self.from_number, twiml=str(self.voice_twiml)

tests/unit/http/test_http_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ def test_session_not_preserved(self):
293293
self.assertEqual(response_2.content, "response_2")
294294

295295

296-
297296
class MyVersion(Version):
298297
def __init__(self, domain):
299298
super().__init__(domain, "v1")

twilio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version_info__ = ("9", "4", "3")
1+
__version_info__ = ("9", "5", "0")
22
__version__ = ".".join(__version_info__)

twilio/rest/api/v2010/account/address/__init__.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def update(
148148
"""
149149
Update the AddressInstance
150150
151-
:param friendly_name: A descriptive string that you create to describe the address. It can be up to 64 characters long.
151+
:param friendly_name: A descriptive string that you create to describe the new address. It can be up to 64 characters long for Regulatory Compliance addresses and 32 characters long for Emergency addresses.
152152
:param customer_name: The name to associate with the address.
153153
:param street: The number and street address of the address.
154154
:param city: The city of the address.
@@ -187,7 +187,7 @@ async def update_async(
187187
"""
188188
Asynchronous coroutine to update the AddressInstance
189189
190-
:param friendly_name: A descriptive string that you create to describe the address. It can be up to 64 characters long.
190+
:param friendly_name: A descriptive string that you create to describe the new address. It can be up to 64 characters long for Regulatory Compliance addresses and 32 characters long for Emergency addresses.
191191
:param customer_name: The name to associate with the address.
192192
:param street: The number and street address of the address.
193193
:param city: The city of the address.
@@ -336,7 +336,7 @@ def update(
336336
"""
337337
Update the AddressInstance
338338
339-
:param friendly_name: A descriptive string that you create to describe the address. It can be up to 64 characters long.
339+
:param friendly_name: A descriptive string that you create to describe the new address. It can be up to 64 characters long for Regulatory Compliance addresses and 32 characters long for Emergency addresses.
340340
:param customer_name: The name to associate with the address.
341341
:param street: The number and street address of the address.
342342
:param city: The city of the address.
@@ -394,7 +394,7 @@ async def update_async(
394394
"""
395395
Asynchronous coroutine to update the AddressInstance
396396
397-
:param friendly_name: A descriptive string that you create to describe the address. It can be up to 64 characters long.
397+
:param friendly_name: A descriptive string that you create to describe the new address. It can be up to 64 characters long for Regulatory Compliance addresses and 32 characters long for Emergency addresses.
398398
:param customer_name: The name to associate with the address.
399399
:param street: The number and street address of the address.
400400
:param city: The city of the address.
@@ -619,6 +619,7 @@ def stream(
619619
self,
620620
customer_name: Union[str, object] = values.unset,
621621
friendly_name: Union[str, object] = values.unset,
622+
emergency_enabled: Union[bool, object] = values.unset,
622623
iso_country: Union[str, object] = values.unset,
623624
limit: Optional[int] = None,
624625
page_size: Optional[int] = None,
@@ -631,6 +632,7 @@ def stream(
631632
632633
:param str customer_name: The `customer_name` of the Address resources to read.
633634
:param str friendly_name: The string that identifies the Address resources to read.
635+
:param bool emergency_enabled: Whether the address can be associated to a number for emergency calling.
634636
:param str iso_country: The ISO country code of the Address resources to read.
635637
:param limit: Upper limit for the number of records to return. stream()
636638
guarantees to never return more than limit. Default is no limit
@@ -645,6 +647,7 @@ def stream(
645647
page = self.page(
646648
customer_name=customer_name,
647649
friendly_name=friendly_name,
650+
emergency_enabled=emergency_enabled,
648651
iso_country=iso_country,
649652
page_size=limits["page_size"],
650653
)
@@ -655,6 +658,7 @@ async def stream_async(
655658
self,
656659
customer_name: Union[str, object] = values.unset,
657660
friendly_name: Union[str, object] = values.unset,
661+
emergency_enabled: Union[bool, object] = values.unset,
658662
iso_country: Union[str, object] = values.unset,
659663
limit: Optional[int] = None,
660664
page_size: Optional[int] = None,
@@ -667,6 +671,7 @@ async def stream_async(
667671
668672
:param str customer_name: The `customer_name` of the Address resources to read.
669673
:param str friendly_name: The string that identifies the Address resources to read.
674+
:param bool emergency_enabled: Whether the address can be associated to a number for emergency calling.
670675
:param str iso_country: The ISO country code of the Address resources to read.
671676
:param limit: Upper limit for the number of records to return. stream()
672677
guarantees to never return more than limit. Default is no limit
@@ -681,6 +686,7 @@ async def stream_async(
681686
page = await self.page_async(
682687
customer_name=customer_name,
683688
friendly_name=friendly_name,
689+
emergency_enabled=emergency_enabled,
684690
iso_country=iso_country,
685691
page_size=limits["page_size"],
686692
)
@@ -691,6 +697,7 @@ def list(
691697
self,
692698
customer_name: Union[str, object] = values.unset,
693699
friendly_name: Union[str, object] = values.unset,
700+
emergency_enabled: Union[bool, object] = values.unset,
694701
iso_country: Union[str, object] = values.unset,
695702
limit: Optional[int] = None,
696703
page_size: Optional[int] = None,
@@ -702,6 +709,7 @@ def list(
702709
703710
:param str customer_name: The `customer_name` of the Address resources to read.
704711
:param str friendly_name: The string that identifies the Address resources to read.
712+
:param bool emergency_enabled: Whether the address can be associated to a number for emergency calling.
705713
:param str iso_country: The ISO country code of the Address resources to read.
706714
:param limit: Upper limit for the number of records to return. list() guarantees
707715
never to return more than limit. Default is no limit
@@ -716,6 +724,7 @@ def list(
716724
self.stream(
717725
customer_name=customer_name,
718726
friendly_name=friendly_name,
727+
emergency_enabled=emergency_enabled,
719728
iso_country=iso_country,
720729
limit=limit,
721730
page_size=page_size,
@@ -726,6 +735,7 @@ async def list_async(
726735
self,
727736
customer_name: Union[str, object] = values.unset,
728737
friendly_name: Union[str, object] = values.unset,
738+
emergency_enabled: Union[bool, object] = values.unset,
729739
iso_country: Union[str, object] = values.unset,
730740
limit: Optional[int] = None,
731741
page_size: Optional[int] = None,
@@ -737,6 +747,7 @@ async def list_async(
737747
738748
:param str customer_name: The `customer_name` of the Address resources to read.
739749
:param str friendly_name: The string that identifies the Address resources to read.
750+
:param bool emergency_enabled: Whether the address can be associated to a number for emergency calling.
740751
:param str iso_country: The ISO country code of the Address resources to read.
741752
:param limit: Upper limit for the number of records to return. list() guarantees
742753
never to return more than limit. Default is no limit
@@ -752,6 +763,7 @@ async def list_async(
752763
async for record in await self.stream_async(
753764
customer_name=customer_name,
754765
friendly_name=friendly_name,
766+
emergency_enabled=emergency_enabled,
755767
iso_country=iso_country,
756768
limit=limit,
757769
page_size=page_size,
@@ -762,6 +774,7 @@ def page(
762774
self,
763775
customer_name: Union[str, object] = values.unset,
764776
friendly_name: Union[str, object] = values.unset,
777+
emergency_enabled: Union[bool, object] = values.unset,
765778
iso_country: Union[str, object] = values.unset,
766779
page_token: Union[str, object] = values.unset,
767780
page_number: Union[int, object] = values.unset,
@@ -773,6 +786,7 @@ def page(
773786
774787
:param customer_name: The `customer_name` of the Address resources to read.
775788
:param friendly_name: The string that identifies the Address resources to read.
789+
:param emergency_enabled: Whether the address can be associated to a number for emergency calling.
776790
:param iso_country: The ISO country code of the Address resources to read.
777791
:param page_token: PageToken provided by the API
778792
:param page_number: Page Number, this value is simply for client state
@@ -784,6 +798,7 @@ def page(
784798
{
785799
"CustomerName": customer_name,
786800
"FriendlyName": friendly_name,
801+
"EmergencyEnabled": serialize.boolean_to_string(emergency_enabled),
787802
"IsoCountry": iso_country,
788803
"PageToken": page_token,
789804
"Page": page_number,
@@ -804,6 +819,7 @@ async def page_async(
804819
self,
805820
customer_name: Union[str, object] = values.unset,
806821
friendly_name: Union[str, object] = values.unset,
822+
emergency_enabled: Union[bool, object] = values.unset,
807823
iso_country: Union[str, object] = values.unset,
808824
page_token: Union[str, object] = values.unset,
809825
page_number: Union[int, object] = values.unset,
@@ -815,6 +831,7 @@ async def page_async(
815831
816832
:param customer_name: The `customer_name` of the Address resources to read.
817833
:param friendly_name: The string that identifies the Address resources to read.
834+
:param emergency_enabled: Whether the address can be associated to a number for emergency calling.
818835
:param iso_country: The ISO country code of the Address resources to read.
819836
:param page_token: PageToken provided by the API
820837
:param page_number: Page Number, this value is simply for client state
@@ -826,6 +843,7 @@ async def page_async(
826843
{
827844
"CustomerName": customer_name,
828845
"FriendlyName": friendly_name,
846+
"EmergencyEnabled": serialize.boolean_to_string(emergency_enabled),
829847
"IsoCountry": iso_country,
830848
"PageToken": page_token,
831849
"Page": page_number,

twilio/rest/api/v2010/account/call/transcription.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def create(
287287
:param speech_model: Recognition model used by the transcription engine, among those supported by the provider
288288
:param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them.
289289
:param enable_automatic_punctuation: The provider will add punctuation to recognition result
290-
:param intelligence_service: The SID of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators .
290+
:param intelligence_service: The SID or unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators .
291291
292292
:returns: The created TranscriptionInstance
293293
"""
@@ -362,7 +362,7 @@ async def create_async(
362362
:param speech_model: Recognition model used by the transcription engine, among those supported by the provider
363363
:param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them.
364364
:param enable_automatic_punctuation: The provider will add punctuation to recognition result
365-
:param intelligence_service: The SID of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators .
365+
:param intelligence_service: The SID or unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators .
366366
367367
:returns: The created TranscriptionInstance
368368
"""

twilio/rest/assistants/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from warnings import warn
22

3-
from twilio.rest.assistants import AssistantsBase
3+
from twilio.rest.assistants.AssistantsBase import AssistantsBase
44
from twilio.rest.assistants.v1.assistant import AssistantList
55
from twilio.rest.assistants.v1.knowledge import KnowledgeList
66
from twilio.rest.assistants.v1.policy import PolicyList

0 commit comments

Comments
 (0)