Skip to content

Commit 0340147

Browse files
committed
[Librarian] Regenerated @ 86e712bb98e901aebd01edb01085d4f2becccd4c 8aaa87554258fca95fe9a1d38e0058f0c2c055c5
1 parent fbec376 commit 0340147

File tree

12 files changed

+909
-17
lines changed

12 files changed

+909
-17
lines changed

CHANGES.md

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

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

6+
[2025-12-03] Version 9.8.8
7+
--------------------------
8+
**Library - Fix**
9+
- [PR #895](https://github.com/twilio/twilio-python/pull/895): Regional API domain processing. Thanks to [@manisha1997](https://github.com/manisha1997)!
10+
11+
**Api**
12+
- Add `twiml_session` resource for calls
13+
- Add `twiml_session` resource for calls
14+
15+
**Monitor**
16+
- Update default output properties
17+
18+
**Trusthub**
19+
- Added customer_profile_sid in toll-free initialize api payload.
20+
21+
622
[2025-11-20] Version 9.8.7
723
--------------------------
824
**Memory**

tests/unit/rest/test_client.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,32 @@ def test_periods_in_query(self):
8181
def test_edge_deprecation_warning_when_only_edge_is_set(self):
8282
with warnings.catch_warnings(record=True) as w:
8383
warnings.simplefilter("always") # Ensure all warnings are caught
84-
Client(username="username", password="password", edge="edge") # Trigger the warning
84+
Client(
85+
username="username", password="password", edge="edge"
86+
) # Trigger the warning
8587

8688
# Check if a warning was raised
8789
self.assertGreater(len(w), 0)
8890
self.assertTrue(issubclass(w[-1].category, DeprecationWarning))
89-
self.assertIn("For regional processing, DNS is of format product.<edge>.<region>.twilio.com; otherwise use product.twilio.com.", str(w[-1].message))
91+
self.assertIn(
92+
"For regional processing, DNS is of format product.<edge>.<region>.twilio.com; otherwise use product.twilio.com.",
93+
str(w[-1].message),
94+
)
9095

9196
def test_edge_deprecation_warning_when_only_region_is_set(self):
9297
with warnings.catch_warnings(record=True) as w:
9398
warnings.simplefilter("always") # Ensure all warnings are caught
94-
Client(username="username", password="password", region="us1") # Trigger the warning
99+
Client(
100+
username="username", password="password", region="us1"
101+
) # Trigger the warning
95102

96103
# Check if a warning was raised
97104
self.assertGreater(len(w), 0)
98105
self.assertTrue(issubclass(w[-1].category, DeprecationWarning))
99-
self.assertIn("For regional processing, DNS is of format product.<edge>.<region>.twilio.com; otherwise use product.twilio.com.", str(w[-1].message))
100-
106+
self.assertIn(
107+
"For regional processing, DNS is of format product.<edge>.<region>.twilio.com; otherwise use product.twilio.com.",
108+
str(w[-1].message),
109+
)
101110

102111

103112
class TestUserAgentClients(unittest.TestCase):

twilio/base/client_base.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
class ClientBase(object):
1515
"""A client for accessing the Twilio API."""
16+
1617
region_mappings = {
1718
"au1": "sydney",
1819
"br1": "sao-paulo",
@@ -22,8 +23,9 @@ class ClientBase(object):
2223
"jp2": "osaka",
2324
"sg1": "singapore",
2425
"us1": "ashburn",
25-
"us2": "umatilla"
26+
"us2": "umatilla",
2627
}
28+
2729
def __init__(
2830
self,
2931
username: Optional[str] = None,
@@ -56,13 +58,19 @@ def __init__(
5658
""" :type : str """
5759
self.password = password or environment.get("TWILIO_AUTH_TOKEN")
5860
""" :type : str """
59-
if (edge is not None and region is None) or (region is not None and edge is None):
61+
if (edge is not None and region is None) or (
62+
region is not None and edge is None
63+
):
6064
warnings.warn(
6165
"For regional processing, DNS is of format product.<edge>.<region>.twilio.com; otherwise use product.twilio.com.",
6266
DeprecationWarning,
63-
stacklevel=2
67+
stacklevel=2,
6468
)
65-
self.edge = edge or environment.get("TWILIO_EDGE") or (self.region_mappings[region] if region is not None else "")
69+
self.edge = (
70+
edge
71+
or environment.get("TWILIO_EDGE")
72+
or (self.region_mappings[region] if region is not None else "")
73+
)
6674
""" :type : str """
6775
self.region = region or environment.get("TWILIO_REGION")
6876
""" :type : str """

twilio/rest/content/v1/content/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class ContentCreateRequest(object):
207207
def __init__(self, payload: Dict[str, Any]):
208208

209209
self.friendly_name: Optional[str] = payload.get("friendly_name")
210-
self.variables: Optional[dict[str, str]] = payload.get("variables")
210+
self.variables: Optional[Dict[str, str]] = payload.get("variables")
211211
self.language: Optional[str] = payload.get("language")
212212
self.types: Optional[ContentList.Types] = payload.get("types")
213213

@@ -230,7 +230,7 @@ class ContentUpdateRequest(object):
230230
def __init__(self, payload: Dict[str, Any]):
231231

232232
self.friendly_name: Optional[str] = payload.get("friendly_name")
233-
self.variables: Optional[dict[str, str]] = payload.get("variables")
233+
self.variables: Optional[Dict[str, str]] = payload.get("variables")
234234
self.language: Optional[str] = payload.get("language")
235235
self.types: Optional[ContentList.Types] = payload.get("types")
236236

@@ -1181,7 +1181,7 @@ class ContentCreateRequest(object):
11811181
def __init__(self, payload: Dict[str, Any]):
11821182

11831183
self.friendly_name: Optional[str] = payload.get("friendly_name")
1184-
self.variables: Optional[dict[str, str]] = payload.get("variables")
1184+
self.variables: Optional[Dict[str, str]] = payload.get("variables")
11851185
self.language: Optional[str] = payload.get("language")
11861186
self.types: Optional[ContentList.Types] = payload.get("types")
11871187

@@ -1204,7 +1204,7 @@ class ContentUpdateRequest(object):
12041204
def __init__(self, payload: Dict[str, Any]):
12051205

12061206
self.friendly_name: Optional[str] = payload.get("friendly_name")
1207-
self.variables: Optional[dict[str, str]] = payload.get("variables")
1207+
self.variables: Optional[Dict[str, str]] = payload.get("variables")
12081208
self.language: Optional[str] = payload.get("language")
12091209
self.types: Optional[ContentList.Types] = payload.get("types")
12101210

@@ -2170,7 +2170,7 @@ class ContentCreateRequest(object):
21702170
def __init__(self, payload: Dict[str, Any]):
21712171

21722172
self.friendly_name: Optional[str] = payload.get("friendly_name")
2173-
self.variables: Optional[dict[str, str]] = payload.get("variables")
2173+
self.variables: Optional[Dict[str, str]] = payload.get("variables")
21742174
self.language: Optional[str] = payload.get("language")
21752175
self.types: Optional[ContentList.Types] = payload.get("types")
21762176

@@ -2193,7 +2193,7 @@ class ContentUpdateRequest(object):
21932193
def __init__(self, payload: Dict[str, Any]):
21942194

21952195
self.friendly_name: Optional[str] = payload.get("friendly_name")
2196-
self.variables: Optional[dict[str, str]] = payload.get("variables")
2196+
self.variables: Optional[Dict[str, str]] = payload.get("variables")
21972197
self.language: Optional[str] = payload.get("language")
21982198
self.types: Optional[ContentList.Types] = payload.get("types")
21992199

twilio/rest/iam/v1/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from twilio.rest.iam.v1.api_key import ApiKeyList
1919
from twilio.rest.iam.v1.get_api_keys import GetApiKeysList
2020
from twilio.rest.iam.v1.new_api_key import NewApiKeyList
21+
from twilio.rest.iam.v1.o_auth_app import OAuthAppList
2122
from twilio.rest.iam.v1.token import TokenList
2223

2324

@@ -33,6 +34,7 @@ def __init__(self, domain: Domain):
3334
self._api_key: Optional[ApiKeyList] = None
3435
self._get_api_keys: Optional[GetApiKeysList] = None
3536
self._new_api_key: Optional[NewApiKeyList] = None
37+
self._o_auth_apps: Optional[OAuthAppList] = None
3638
self._token: Optional[TokenList] = None
3739

3840
@property
@@ -53,6 +55,12 @@ def new_api_key(self) -> NewApiKeyList:
5355
self._new_api_key = NewApiKeyList(self)
5456
return self._new_api_key
5557

58+
@property
59+
def o_auth_apps(self) -> OAuthAppList:
60+
if self._o_auth_apps is None:
61+
self._o_auth_apps = OAuthAppList(self)
62+
return self._o_auth_apps
63+
5664
@property
5765
def token(self) -> TokenList:
5866
if self._token is None:

0 commit comments

Comments
 (0)