Skip to content

Commit 518dc8a

Browse files
committed
[Librarian] Regenerated @ 160660ccc2266b2b6f15f8e8291a4b07d233dc21 817197bb9e54bf7b3518030a6183a4c45eb689fa
1 parent 317a5bb commit 518dc8a

File tree

25 files changed

+257
-6115
lines changed

25 files changed

+257
-6115
lines changed

CHANGES.md

+12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ twilio-python Changelog
33

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

6+
[2025-03-20] Version 9.5.1
7+
--------------------------
8+
**Accounts**
9+
- Update Safelist API docs as part of prefix supoort
10+
11+
**Flex**
12+
- Removing `first_name`, `last_name`, and `friendly_name` from the Flex User API
13+
14+
**Messaging**
15+
- Add missing tests under transaction/phone_numbers and transaction/short_code
16+
17+
618
[2025-03-11] Version 9.5.0
719
--------------------------
820
**Library - Feature**

twilio/rest/accounts/v1/safelist.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
class SafelistInstance(InstanceResource):
2424
"""
2525
:ivar sid: The unique string that we created to identify the SafeList resource.
26-
:ivar phone_number: The phone number in SafeList.
26+
:ivar phone_number: The phone number or phone number 1k prefix in SafeList.
2727
"""
2828

2929
def __init__(self, version: Version, payload: Dict[str, Any]):
@@ -59,7 +59,7 @@ def create(self, phone_number: str) -> SafelistInstance:
5959
"""
6060
Create the SafelistInstance
6161
62-
:param phone_number: The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
62+
:param phone_number: The phone number or phone number 1k prefix to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
6363
6464
:returns: The created SafelistInstance
6565
"""
@@ -85,7 +85,7 @@ async def create_async(self, phone_number: str) -> SafelistInstance:
8585
"""
8686
Asynchronously create the SafelistInstance
8787
88-
:param phone_number: The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
88+
:param phone_number: The phone number or phone number 1k prefix to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
8989
9090
:returns: The created SafelistInstance
9191
"""
@@ -111,7 +111,7 @@ def delete(self, phone_number: Union[str, object] = values.unset) -> bool:
111111
"""
112112
Asynchronously delete the SafelistInstance
113113
114-
:param phone_number: The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
114+
:param phone_number: The phone number or phone number 1k prefix to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
115115
:returns: True if delete succeeds, False otherwise
116116
"""
117117
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
@@ -131,7 +131,7 @@ async def delete_async(
131131
"""
132132
Asynchronously delete the SafelistInstance
133133
134-
:param phone_number: The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
134+
:param phone_number: The phone number or phone number 1k prefix to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
135135
:returns: True if delete succeeds, False otherwise
136136
"""
137137
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
@@ -151,7 +151,7 @@ def fetch(
151151
"""
152152
Asynchronously fetch the SafelistInstance
153153
154-
:param phone_number: The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
154+
:param phone_number: The phone number or phone number 1k prefix to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
155155
:returns: The fetched SafelistInstance
156156
"""
157157
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
@@ -176,7 +176,7 @@ async def fetch_async(
176176
"""
177177
Asynchronously fetch the SafelistInstance
178178
179-
:param phone_number: The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
179+
:param phone_number: The phone number or phone number 1k prefix to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
180180
:returns: The fetched SafelistInstance
181181
"""
182182
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class UpdateStatus(object):
5151
:ivar date_updated: The date and time in UTC that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
5252
:ivar api_version: The API version used to create this conference.
5353
:ivar friendly_name: A string that you assigned to describe this conference room. Maximum length is 128 characters.
54-
:ivar region: A string that represents the Twilio Region where the conference audio was mixed. May be `us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, and `jp1`. Basic conference audio will always be mixed in `us1`. Global Conference audio will be mixed nearest to the majority of participants.
54+
:ivar region: A string that represents the Twilio Region where the conference audio was mixed. May be `us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, and `jp1`. Basic conference audio will always be mixed in `us1`. Global Conference audio will be mixed nearest to the majority of participants.
5555
:ivar sid: The unique, Twilio-provided string used to identify this Conference resource.
5656
:ivar status:
5757
:ivar uri: The URI of this resource, relative to `https://api.twilio.com`.

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ def create(
625625
:param recording_status_callback_method: The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
626626
:param sip_auth_username: The SIP username used for authentication.
627627
:param sip_auth_password: The SIP password for authentication.
628-
:param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
628+
:param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
629629
:param conference_recording_status_callback: The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available.
630630
:param conference_recording_status_callback_method: The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
631631
:param recording_status_callback_event: The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`.
@@ -814,7 +814,7 @@ async def create_async(
814814
:param recording_status_callback_method: The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
815815
:param sip_auth_username: The SIP username used for authentication.
816816
:param sip_auth_password: The SIP password for authentication.
817-
:param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
817+
:param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
818818
:param conference_recording_status_callback: The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available.
819819
:param conference_recording_status_callback_method: The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
820820
:param recording_status_callback_event: The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`.

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

+9
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class Status(object):
6262
PARTIALLY_DELIVERED = "partially_delivered"
6363
CANCELED = "canceled"
6464

65+
class TrafficType(object):
66+
FREE = "free"
67+
6568
class UpdateStatus(object):
6669
CANCELED = "canceled"
6770

@@ -505,6 +508,7 @@ def create(
505508
] = values.unset,
506509
smart_encoded: Union[bool, object] = values.unset,
507510
persistent_action: Union[List[str], object] = values.unset,
511+
traffic_type: Union["MessageInstance.TrafficType", object] = values.unset,
508512
shorten_urls: Union[bool, object] = values.unset,
509513
schedule_type: Union["MessageInstance.ScheduleType", object] = values.unset,
510514
send_at: Union[datetime, object] = values.unset,
@@ -532,6 +536,7 @@ def create(
532536
:param address_retention:
533537
:param smart_encoded: Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`.
534538
:param persistent_action: Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp).
539+
:param traffic_type:
535540
:param shorten_urls: For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided.
536541
:param schedule_type:
537542
:param send_at: The time that Twilio will send the message. Must be in ISO 8601 format.
@@ -561,6 +566,7 @@ def create(
561566
"AddressRetention": address_retention,
562567
"SmartEncoded": serialize.boolean_to_string(smart_encoded),
563568
"PersistentAction": serialize.map(persistent_action, lambda e: e),
569+
"TrafficType": traffic_type,
564570
"ShortenUrls": serialize.boolean_to_string(shorten_urls),
565571
"ScheduleType": schedule_type,
566572
"SendAt": serialize.iso8601_datetime(send_at),
@@ -606,6 +612,7 @@ async def create_async(
606612
] = values.unset,
607613
smart_encoded: Union[bool, object] = values.unset,
608614
persistent_action: Union[List[str], object] = values.unset,
615+
traffic_type: Union["MessageInstance.TrafficType", object] = values.unset,
609616
shorten_urls: Union[bool, object] = values.unset,
610617
schedule_type: Union["MessageInstance.ScheduleType", object] = values.unset,
611618
send_at: Union[datetime, object] = values.unset,
@@ -633,6 +640,7 @@ async def create_async(
633640
:param address_retention:
634641
:param smart_encoded: Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`.
635642
:param persistent_action: Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp).
643+
:param traffic_type:
636644
:param shorten_urls: For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided.
637645
:param schedule_type:
638646
:param send_at: The time that Twilio will send the message. Must be in ISO 8601 format.
@@ -662,6 +670,7 @@ async def create_async(
662670
"AddressRetention": address_retention,
663671
"SmartEncoded": serialize.boolean_to_string(smart_encoded),
664672
"PersistentAction": serialize.map(persistent_action, lambda e: e),
673+
"TrafficType": traffic_type,
665674
"ShortenUrls": serialize.boolean_to_string(shorten_urls),
666675
"ScheduleType": schedule_type,
667676
"SendAt": serialize.iso8601_datetime(send_at),

twilio/rest/flex_api/v2/flex_user.py

-42
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,8 @@ class FlexUserInstance(InstanceResource):
3030
:ivar worker_sid: The unique SID identifier of the worker.
3131
:ivar workspace_sid: The unique SID identifier of the workspace.
3232
:ivar flex_team_sid: The unique SID identifier of the Flex Team.
33-
:ivar first_name: First name of the User.
34-
:ivar last_name: Last name of the User.
3533
:ivar username: Username of the User.
3634
:ivar email: Email of the User.
37-
:ivar friendly_name: Friendly name of the User.
3835
:ivar locale: The locale preference of the user.
3936
:ivar roles: The roles of the user.
4037
:ivar created_date: The date that this user was created, given in ISO 8601 format.
@@ -59,11 +56,8 @@ def __init__(
5956
self.worker_sid: Optional[str] = payload.get("worker_sid")
6057
self.workspace_sid: Optional[str] = payload.get("workspace_sid")
6158
self.flex_team_sid: Optional[str] = payload.get("flex_team_sid")
62-
self.first_name: Optional[str] = payload.get("first_name")
63-
self.last_name: Optional[str] = payload.get("last_name")
6459
self.username: Optional[str] = payload.get("username")
6560
self.email: Optional[str] = payload.get("email")
66-
self.friendly_name: Optional[str] = payload.get("friendly_name")
6761
self.locale: Optional[str] = payload.get("locale")
6862
self.roles: Optional[List[str]] = payload.get("roles")
6963
self.created_date: Optional[datetime] = deserialize.iso8601_datetime(
@@ -117,60 +111,42 @@ async def fetch_async(self) -> "FlexUserInstance":
117111

118112
def update(
119113
self,
120-
first_name: Union[str, object] = values.unset,
121-
last_name: Union[str, object] = values.unset,
122114
email: Union[str, object] = values.unset,
123-
friendly_name: Union[str, object] = values.unset,
124115
user_sid: Union[str, object] = values.unset,
125116
locale: Union[str, object] = values.unset,
126117
) -> "FlexUserInstance":
127118
"""
128119
Update the FlexUserInstance
129120
130-
:param first_name: First name of the User.
131-
:param last_name: Last name of the User.
132121
:param email: Email of the User.
133-
:param friendly_name: Friendly name of the User.
134122
:param user_sid: The unique SID identifier of the Twilio Unified User.
135123
:param locale: The locale preference of the user.
136124
137125
:returns: The updated FlexUserInstance
138126
"""
139127
return self._proxy.update(
140-
first_name=first_name,
141-
last_name=last_name,
142128
email=email,
143-
friendly_name=friendly_name,
144129
user_sid=user_sid,
145130
locale=locale,
146131
)
147132

148133
async def update_async(
149134
self,
150-
first_name: Union[str, object] = values.unset,
151-
last_name: Union[str, object] = values.unset,
152135
email: Union[str, object] = values.unset,
153-
friendly_name: Union[str, object] = values.unset,
154136
user_sid: Union[str, object] = values.unset,
155137
locale: Union[str, object] = values.unset,
156138
) -> "FlexUserInstance":
157139
"""
158140
Asynchronous coroutine to update the FlexUserInstance
159141
160-
:param first_name: First name of the User.
161-
:param last_name: Last name of the User.
162142
:param email: Email of the User.
163-
:param friendly_name: Friendly name of the User.
164143
:param user_sid: The unique SID identifier of the Twilio Unified User.
165144
:param locale: The locale preference of the user.
166145
167146
:returns: The updated FlexUserInstance
168147
"""
169148
return await self._proxy.update_async(
170-
first_name=first_name,
171-
last_name=last_name,
172149
email=email,
173-
friendly_name=friendly_name,
174150
user_sid=user_sid,
175151
locale=locale,
176152
)
@@ -252,20 +228,14 @@ async def fetch_async(self) -> FlexUserInstance:
252228

253229
def update(
254230
self,
255-
first_name: Union[str, object] = values.unset,
256-
last_name: Union[str, object] = values.unset,
257231
email: Union[str, object] = values.unset,
258-
friendly_name: Union[str, object] = values.unset,
259232
user_sid: Union[str, object] = values.unset,
260233
locale: Union[str, object] = values.unset,
261234
) -> FlexUserInstance:
262235
"""
263236
Update the FlexUserInstance
264237
265-
:param first_name: First name of the User.
266-
:param last_name: Last name of the User.
267238
:param email: Email of the User.
268-
:param friendly_name: Friendly name of the User.
269239
:param user_sid: The unique SID identifier of the Twilio Unified User.
270240
:param locale: The locale preference of the user.
271241
@@ -274,10 +244,7 @@ def update(
274244

275245
data = values.of(
276246
{
277-
"FirstName": first_name,
278-
"LastName": last_name,
279247
"Email": email,
280-
"FriendlyName": friendly_name,
281248
"UserSid": user_sid,
282249
"Locale": locale,
283250
}
@@ -301,20 +268,14 @@ def update(
301268

302269
async def update_async(
303270
self,
304-
first_name: Union[str, object] = values.unset,
305-
last_name: Union[str, object] = values.unset,
306271
email: Union[str, object] = values.unset,
307-
friendly_name: Union[str, object] = values.unset,
308272
user_sid: Union[str, object] = values.unset,
309273
locale: Union[str, object] = values.unset,
310274
) -> FlexUserInstance:
311275
"""
312276
Asynchronous coroutine to update the FlexUserInstance
313277
314-
:param first_name: First name of the User.
315-
:param last_name: Last name of the User.
316278
:param email: Email of the User.
317-
:param friendly_name: Friendly name of the User.
318279
:param user_sid: The unique SID identifier of the Twilio Unified User.
319280
:param locale: The locale preference of the user.
320281
@@ -323,10 +284,7 @@ async def update_async(
323284

324285
data = values.of(
325286
{
326-
"FirstName": first_name,
327-
"LastName": last_name,
328287
"Email": email,
329-
"FriendlyName": friendly_name,
330288
"UserSid": user_sid,
331289
"Locale": locale,
332290
}

twilio/rest/iam/v1/__init__.py

+8
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.token import TokenList
2122

2223

2324
class V1(Version):
@@ -32,6 +33,7 @@ def __init__(self, domain: Domain):
3233
self._api_key: Optional[ApiKeyList] = None
3334
self._get_api_keys: Optional[GetApiKeysList] = None
3435
self._new_api_key: Optional[NewApiKeyList] = None
36+
self._token: Optional[TokenList] = None
3537

3638
@property
3739
def api_key(self) -> ApiKeyList:
@@ -51,6 +53,12 @@ def new_api_key(self) -> NewApiKeyList:
5153
self._new_api_key = NewApiKeyList(self)
5254
return self._new_api_key
5355

56+
@property
57+
def token(self) -> TokenList:
58+
if self._token is None:
59+
self._token = TokenList(self)
60+
return self._token
61+
5462
def __repr__(self) -> str:
5563
"""
5664
Provide a friendly representation

0 commit comments

Comments
 (0)