Skip to content

Commit 335410e

Browse files
committed
[Librarian] Regenerated @ c35acb6403159875204e9df8c17f07aca438b6e3 73d02e4e1f49601fe81e10b2293248aeafda0e43
1 parent 2aa9e67 commit 335410e

File tree

61 files changed

+830
-312
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+830
-312
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-10-14] Version 9.8.4
7+
--------------------------
8+
**Library - Chore**
9+
- [PR #887](https://github.com/twilio/twilio-python/pull/887): remove auth from request.__str__(). Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
10+
11+
**Library - Docs**
12+
- [PR #886](https://github.com/twilio/twilio-python/pull/886): update oauth example. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
13+
14+
**Api**
15+
- Updated description for property `CallerDisplayName` for participant create request
16+
- Updated description for property `CallerDisplayName` for participant create request
17+
18+
**Accounts**
19+
- FILE_IS_AUTO_GENERATED: false
20+
21+
622
[2025-09-30] Version 9.8.3
723
--------------------------
824
**Library - Chore**

tests/unit/http/test_http_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def test_str_excludes_authorization_header(self):
320320
data={"FriendlyName": "My New Account"},
321321
headers={
322322
"Authorization": "Bearer secret-token",
323-
"X-Custom-Header": "Value"
323+
"X-Custom-Header": "Value",
324324
},
325325
)
326326
expected = (

twilio/http/request.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ def __str__(self) -> str:
7171
headers = ""
7272
if self.headers and self.headers != Match.ANY:
7373
headers = "\n{}".format(
74-
"\n".join(' -H "{}: {}"'.format(k, v) for k, v in self.headers.items() if k.lower() != "authorization")
74+
"\n".join(
75+
' -H "{}: {}"'.format(k, v)
76+
for k, v in self.headers.items()
77+
if k.lower() != "authorization"
78+
)
7579
)
7680

7781
return "{method} {url}{params}{data}{headers}".format(

twilio/rest/accounts/v1/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from twilio.rest.accounts.v1.bulk_consents import BulkConsentsList
2020
from twilio.rest.accounts.v1.bulk_contacts import BulkContactsList
2121
from twilio.rest.accounts.v1.credential import CredentialList
22+
from twilio.rest.accounts.v1.messaging_geopermissions import MessagingGeopermissionsList
2223
from twilio.rest.accounts.v1.safelist import SafelistList
2324
from twilio.rest.accounts.v1.secondary_auth_token import SecondaryAuthTokenList
2425

@@ -36,6 +37,7 @@ def __init__(self, domain: Domain):
3637
self._bulk_consents: Optional[BulkConsentsList] = None
3738
self._bulk_contacts: Optional[BulkContactsList] = None
3839
self._credentials: Optional[CredentialList] = None
40+
self._messaging_geopermissions: Optional[MessagingGeopermissionsList] = None
3941
self._safelist: Optional[SafelistList] = None
4042
self._secondary_auth_token: Optional[SecondaryAuthTokenList] = None
4143

@@ -63,6 +65,12 @@ def credentials(self) -> CredentialList:
6365
self._credentials = CredentialList(self)
6466
return self._credentials
6567

68+
@property
69+
def messaging_geopermissions(self) -> MessagingGeopermissionsList:
70+
if self._messaging_geopermissions is None:
71+
self._messaging_geopermissions = MessagingGeopermissionsList(self)
72+
return self._messaging_geopermissions
73+
6674
@property
6775
def safelist(self) -> SafelistList:
6876
if self._safelist is None:
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
r"""
2+
This code was generated by
3+
___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
| | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
| |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
7+
Twilio - Accounts
8+
This is the public Twilio REST API.
9+
10+
NOTE: This class is auto generated by OpenAPI Generator.
11+
https://openapi-generator.tech
12+
Do not edit the class manually.
13+
"""
14+
15+
from typing import Any, Dict, List, Optional, Union
16+
from twilio.base import serialize, values
17+
18+
from twilio.base.instance_resource import InstanceResource
19+
from twilio.base.list_resource import ListResource
20+
from twilio.base.version import Version
21+
22+
23+
class MessagingGeopermissionsInstance(InstanceResource):
24+
"""
25+
:ivar permissions: A list of objects where each object represents the result of processing a messaging Geo Permission. Each object contains the following fields: `country_code`, the country code of the country for which the permission was updated; `type`, the type of the permission i.e. country; `enabled`, true if the permission is enabled else false; `error_code`, an integer where 0 indicates success and any non-zero value represents an error; and `error_messages`, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty.
26+
"""
27+
28+
def __init__(self, version: Version, payload: Dict[str, Any]):
29+
super().__init__(version)
30+
31+
self.permissions: Optional[Dict[str, object]] = payload.get("permissions")
32+
33+
def __repr__(self) -> str:
34+
"""
35+
Provide a friendly representation
36+
37+
:returns: Machine friendly representation
38+
"""
39+
40+
return "<Twilio.Accounts.V1.MessagingGeopermissionsInstance>"
41+
42+
43+
class MessagingGeopermissionsList(ListResource):
44+
45+
def __init__(self, version: Version):
46+
"""
47+
Initialize the MessagingGeopermissionsList
48+
49+
:param version: Version that contains the resource
50+
51+
"""
52+
super().__init__(version)
53+
54+
self._uri = "/Messaging/GeoPermissions"
55+
56+
def fetch(
57+
self, country_code: Union[str, object] = values.unset
58+
) -> MessagingGeopermissionsInstance:
59+
"""
60+
Asynchronously fetch the MessagingGeopermissionsInstance
61+
62+
:param country_code: The country code to filter the geo permissions. If provided, only the geo permission for the specified country will be returned.
63+
:returns: The fetched MessagingGeopermissionsInstance
64+
"""
65+
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
66+
67+
headers["Accept"] = "application/json"
68+
69+
params = values.of(
70+
{
71+
"CountryCode": country_code,
72+
}
73+
)
74+
75+
payload = self._version.fetch(
76+
method="GET", uri=self._uri, headers=headers, params=params
77+
)
78+
79+
return MessagingGeopermissionsInstance(self._version, payload)
80+
81+
async def fetch_async(
82+
self, country_code: Union[str, object] = values.unset
83+
) -> MessagingGeopermissionsInstance:
84+
"""
85+
Asynchronously fetch the MessagingGeopermissionsInstance
86+
87+
:param country_code: The country code to filter the geo permissions. If provided, only the geo permission for the specified country will be returned.
88+
:returns: The fetched MessagingGeopermissionsInstance
89+
"""
90+
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
91+
92+
headers["Accept"] = "application/json"
93+
94+
params = values.of(
95+
{
96+
"CountryCode": country_code,
97+
}
98+
)
99+
100+
payload = await self._version.fetch_async(
101+
method="GET", uri=self._uri, headers=headers, params=params
102+
)
103+
104+
return MessagingGeopermissionsInstance(self._version, payload)
105+
106+
def update(self, permissions: List[object]) -> MessagingGeopermissionsInstance:
107+
"""
108+
Update the MessagingGeopermissionsInstance
109+
110+
:param permissions: A list of objects where each object represents the Geo Permission to be updated. Each object contains the following fields: `country_code`, unique code for each country of Geo Permission; `type`, permission type of the Geo Permission i.e. country; `enabled`, configure true for enabling the Geo Permission, false for disabling the Geo Permission.
111+
112+
:returns: The created MessagingGeopermissionsInstance
113+
"""
114+
115+
data = values.of(
116+
{
117+
"Permissions": serialize.map(
118+
permissions, lambda e: serialize.object(e)
119+
),
120+
}
121+
)
122+
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
123+
124+
headers["Content-Type"] = "application/x-www-form-urlencoded"
125+
126+
headers["Accept"] = "application/json"
127+
128+
payload = self._version.update(
129+
method="PATCH", uri=self._uri, data=data, headers=headers
130+
)
131+
132+
return MessagingGeopermissionsInstance(self._version, payload)
133+
134+
async def update_async(
135+
self, permissions: List[object]
136+
) -> MessagingGeopermissionsInstance:
137+
"""
138+
Asynchronously update the MessagingGeopermissionsInstance
139+
140+
:param permissions: A list of objects where each object represents the Geo Permission to be updated. Each object contains the following fields: `country_code`, unique code for each country of Geo Permission; `type`, permission type of the Geo Permission i.e. country; `enabled`, configure true for enabling the Geo Permission, false for disabling the Geo Permission.
141+
142+
:returns: The created MessagingGeopermissionsInstance
143+
"""
144+
145+
data = values.of(
146+
{
147+
"Permissions": serialize.map(
148+
permissions, lambda e: serialize.object(e)
149+
),
150+
}
151+
)
152+
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
153+
154+
headers["Content-Type"] = "application/x-www-form-urlencoded"
155+
156+
headers["Accept"] = "application/json"
157+
158+
payload = await self._version.update_async(
159+
method="PATCH", uri=self._uri, data=data, headers=headers
160+
)
161+
162+
return MessagingGeopermissionsInstance(self._version, payload)
163+
164+
def __repr__(self) -> str:
165+
"""
166+
Provide a friendly representation
167+
168+
:returns: Machine friendly representation
169+
"""
170+
return "<Twilio.Accounts.V1.MessagingGeopermissionsList>"

twilio/rest/accounts/v1/secondary_auth_token.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,15 @@ def create(self) -> SecondaryAuthTokenInstance:
124124
125125
:returns: The created SecondaryAuthTokenInstance
126126
"""
127+
127128
data = values.of({})
129+
headers = values.of({})
128130

129-
payload = self._version.create(method="POST", uri=self._uri, data=data)
131+
headers["Accept"] = "application/json"
132+
133+
payload = self._version.create(
134+
method="POST", uri=self._uri, data=data, headers=headers
135+
)
130136

131137
return SecondaryAuthTokenInstance(self._version, payload)
132138

@@ -137,10 +143,14 @@ async def create_async(self) -> SecondaryAuthTokenInstance:
137143
138144
:returns: The created SecondaryAuthTokenInstance
139145
"""
146+
140147
data = values.of({})
148+
headers = values.of({})
149+
150+
headers["Accept"] = "application/json"
141151

142152
payload = await self._version.create_async(
143-
method="POST", uri=self._uri, data=data
153+
method="POST", uri=self._uri, data=data, headers=headers
144154
)
145155

146156
return SecondaryAuthTokenInstance(self._version, payload)

twilio/rest/api/v2010/account/conference/participant.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ def create(
648648
: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`.
649649
: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`.
650650
: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.
651-
:param caller_display_name: The name that appears to the called party for this call. Must be between 2 and 255 characters.
651+
:param caller_display_name: The name that populates the display name in the From header. Must be between 2 and 255 characters. Only applicable for calls to sip address.
652652
653653
:returns: The created ParticipantInstance
654654
"""
@@ -840,7 +840,7 @@ async def create_async(
840840
: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`.
841841
: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`.
842842
: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.
843-
:param caller_display_name: The name that appears to the called party for this call. Must be between 2 and 255 characters.
843+
:param caller_display_name: The name that populates the display name in the From header. Must be between 2 and 255 characters. Only applicable for calls to sip address.
844844
845845
:returns: The created ParticipantInstance
846846
"""

0 commit comments

Comments
 (0)