Skip to content

Commit 159ac80

Browse files
committed
[Librarian] Regenerated @ 0abbad22a16b8d30bf075bd4ce86bc83cc998b3b
1 parent 2ef74d3 commit 159ac80

File tree

17 files changed

+756
-26
lines changed

17 files changed

+756
-26
lines changed

CHANGES.md

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

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

6+
[2021-12-15] Version 7.4.0
7+
--------------------------
8+
**Library - Feature**
9+
- [PR #582](https://github.com/twilio/twilio-python/pull/582): run tests before deploying. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
10+
11+
**Api**
12+
- Add optional boolean send_as_mms parameter to the create action of Message resource **(breaking change)**
13+
- Change team ownership for `call` delete
14+
15+
**Conversations**
16+
- Change wording for `Service Webhook Configuration` resource fields
17+
18+
**Insights**
19+
- Added new APIs for updating and getting voice insights flags by accountSid.
20+
21+
**Media**
22+
- Add max_duration param to MediaProcessor
23+
24+
**Video**
25+
- Add `EmptyRoomTimeout` and `UnusedRoomTimeout` properties to a room; add corresponding parameters to room creation
26+
27+
**Voice**
28+
- Add endpoint to delete archived Calls
29+
30+
631
[2021-12-01] Version 7.3.2
732
--------------------------
833
**Conversations**
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# coding=utf-8
2+
r"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
9+
from tests import IntegrationTestCase
10+
from tests.holodeck import Request
11+
from twilio.base.exceptions import TwilioException
12+
from twilio.http.response import Response
13+
14+
15+
class SettingTestCase(IntegrationTestCase):
16+
17+
def test_fetch_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.insights.v1.settings().fetch()
22+
23+
self.holodeck.assert_has_request(Request(
24+
'get',
25+
'https://insights.twilio.com/v1/Voice/Settings',
26+
))
27+
28+
def test_fetch_response(self):
29+
self.holodeck.mock(Response(
30+
200,
31+
'''
32+
{
33+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34+
"voice_trace": true,
35+
"advanced_features": true,
36+
"url": "https://insights.twilio.com/v1/Voice/Settings"
37+
}
38+
'''
39+
))
40+
41+
actual = self.client.insights.v1.settings().fetch()
42+
43+
self.assertIsNotNone(actual)
44+
45+
def test_update_request(self):
46+
self.holodeck.mock(Response(500, ''))
47+
48+
with self.assertRaises(TwilioException):
49+
self.client.insights.v1.settings().update()
50+
51+
self.holodeck.assert_has_request(Request(
52+
'post',
53+
'https://insights.twilio.com/v1/Voice/Settings',
54+
))
55+
56+
def test_update_response(self):
57+
self.holodeck.mock(Response(
58+
200,
59+
'''
60+
{
61+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
62+
"voice_trace": true,
63+
"advanced_features": true,
64+
"url": "https://insights.twilio.com/v1/Voice/Settings"
65+
}
66+
'''
67+
))
68+
69+
actual = self.client.insights.v1.settings().update()
70+
71+
self.assertIsNotNone(actual)

tests/integration/media/v1/test_media_processor.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def test_create_response(self):
4343
"status_callback": "http://www.example.com",
4444
"status_callback_method": "POST",
4545
"ended_reason": null,
46-
"url": "https://media.twilio.com/v1/MediaProcessors/ZXdeadbeefdeadbeefdeadbeefdeadbeef"
46+
"url": "https://media.twilio.com/v1/MediaProcessors/ZXdeadbeefdeadbeefdeadbeefdeadbeef",
47+
"max_duration": 300
4748
}
4849
'''
4950
))
@@ -78,7 +79,8 @@ def test_fetch_response(self):
7879
"status_callback": "http://www.example.com",
7980
"status_callback_method": "POST",
8081
"ended_reason": null,
81-
"url": "https://media.twilio.com/v1/MediaProcessors/ZXdeadbeefdeadbeefdeadbeefdeadbeef"
82+
"url": "https://media.twilio.com/v1/MediaProcessors/ZXdeadbeefdeadbeefdeadbeefdeadbeef",
83+
"max_duration": 300
8284
}
8385
'''
8486
))
@@ -116,7 +118,8 @@ def test_update_ended_response(self):
116118
"status_callback": "http://www.example.com",
117119
"status_callback_method": "POST",
118120
"ended_reason": "ended-via-api",
119-
"url": "https://media.twilio.com/v1/MediaProcessors/ZXdeadbeefdeadbeefdeadbeefdeadbeef"
121+
"url": "https://media.twilio.com/v1/MediaProcessors/ZXdeadbeefdeadbeefdeadbeefdeadbeef",
122+
"max_duration": 300
120123
}
121124
'''
122125
))
@@ -185,7 +188,8 @@ def test_read_items_response(self):
185188
"status_callback": "http://www.example.com",
186189
"status_callback_method": "POST",
187190
"ended_reason": "ended-via-api",
188-
"url": "https://media.twilio.com/v1/MediaProcessors/ZXdeadbeefdeadbeefdeadbeefdeadbeef"
191+
"url": "https://media.twilio.com/v1/MediaProcessors/ZXdeadbeefdeadbeefdeadbeefdeadbeef",
192+
"max_duration": 300
189193
}
190194
]
191195
}
@@ -222,7 +226,8 @@ def test_read_items_using_page_token_response(self):
222226
"status_callback": "http://www.example.com",
223227
"status_callback_method": "POST",
224228
"ended_reason": "ended-via-api",
225-
"url": "https://media.twilio.com/v1/MediaProcessors/ZXdeadbeefdeadbeefdeadbeefdeadbeef"
229+
"url": "https://media.twilio.com/v1/MediaProcessors/ZXdeadbeefdeadbeefdeadbeefdeadbeef",
230+
"max_duration": 300
226231
}
227232
]
228233
}
@@ -259,7 +264,8 @@ def test_read_items_page_larger_than_max_response(self):
259264
"status_callback": "http://www.example.com",
260265
"status_callback_method": "POST",
261266
"ended_reason": "ended-via-api",
262-
"url": "https://media.twilio.com/v1/MediaProcessors/ZXdeadbeefdeadbeefdeadbeefdeadbeef"
267+
"url": "https://media.twilio.com/v1/MediaProcessors/ZXdeadbeefdeadbeefdeadbeefdeadbeef",
268+
"max_duration": 300
263269
}
264270
]
265271
}

tests/integration/notify/v1/test_credential.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ def test_read_full_response(self):
4444
],
4545
"meta": {
4646
"page": 0,
47-
"page_size": 1,
48-
"first_page_url": "https://notify.twilio.com/v1/Credentials?PageSize=1&Page=0",
47+
"page_size": 50,
48+
"first_page_url": "https://notify.twilio.com/v1/Credentials?PageSize=50&Page=0",
4949
"previous_page_url": null,
50-
"url": "https://notify.twilio.com/v1/Credentials?PageSize=1&Page=0",
50+
"url": "https://notify.twilio.com/v1/Credentials?PageSize=50&Page=0",
5151
"next_page_url": null,
5252
"key": "credentials"
5353
}
@@ -67,10 +67,10 @@ def test_read_empty_response(self):
6767
"credentials": [],
6868
"meta": {
6969
"page": 0,
70-
"page_size": 1,
71-
"first_page_url": "https://notify.twilio.com/v1/Credentials?PageSize=1&Page=0",
70+
"page_size": 50,
71+
"first_page_url": "https://notify.twilio.com/v1/Credentials?PageSize=50&Page=0",
7272
"previous_page_url": null,
73-
"url": "https://notify.twilio.com/v1/Credentials?PageSize=1&Page=0",
73+
"url": "https://notify.twilio.com/v1/Credentials?PageSize=50&Page=0",
7474
"next_page_url": null,
7575
"key": "credentials"
7676
}

tests/integration/video/v1/test_room.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def test_fetch_response(self):
5050
],
5151
"audio_only": false,
5252
"media_region": "us1",
53+
"empty_room_timeout": 5,
54+
"unused_room_timeout": 5,
5355
"end_time": "2015-07-30T20:00:00Z",
5456
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5557
"links": {
@@ -101,6 +103,8 @@ def test_create_response(self):
101103
],
102104
"media_region": "us1",
103105
"audio_only": false,
106+
"empty_room_timeout": 5,
107+
"unused_room_timeout": 5,
104108
"end_time": "2015-07-30T20:00:00Z",
105109
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
106110
"links": {
@@ -141,6 +145,8 @@ def test_create_webrtc_go_response(self):
141145
],
142146
"media_region": "us1",
143147
"audio_only": false,
148+
"empty_room_timeout": 5,
149+
"unused_room_timeout": 5,
144150
"end_time": "2015-07-30T20:00:00Z",
145151
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
146152
"links": {
@@ -181,6 +187,8 @@ def test_create_group_rooms_response(self):
181187
],
182188
"media_region": "us1",
183189
"audio_only": false,
190+
"empty_room_timeout": 5,
191+
"unused_room_timeout": 5,
184192
"end_time": "2015-07-30T20:00:00Z",
185193
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
186194
"links": {
@@ -219,6 +227,8 @@ def test_create_group_rooms_with_audio_only_enabled_response(self):
219227
"video_codecs": [],
220228
"media_region": "us1",
221229
"audio_only": true,
230+
"empty_room_timeout": 5,
231+
"unused_room_timeout": 5,
222232
"end_time": "2015-07-30T20:00:00Z",
223233
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
224234
"links": {
@@ -259,6 +269,8 @@ def test_create_small_group_rooms_response(self):
259269
],
260270
"media_region": "us1",
261271
"audio_only": false,
272+
"empty_room_timeout": 5,
273+
"unused_room_timeout": 5,
262274
"end_time": "2015-07-30T20:00:00Z",
263275
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
264276
"links": {
@@ -299,6 +311,8 @@ def test_create_large_group_rooms_response(self):
299311
],
300312
"media_region": "us1",
301313
"audio_only": false,
314+
"empty_room_timeout": 5,
315+
"unused_room_timeout": 5,
302316
"end_time": "2015-07-30T20:00:00Z",
303317
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
304318
"links": {
@@ -337,6 +351,8 @@ def test_create_large_group_rooms_with_audio_only_enabled_response(self):
337351
"video_codecs": [],
338352
"media_region": "us1",
339353
"audio_only": true,
354+
"empty_room_timeout": 5,
355+
"unused_room_timeout": 5,
340356
"end_time": "2015-07-30T20:00:00Z",
341357
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
342358
"links": {
@@ -414,6 +430,8 @@ def test_read_with_status_response(self):
414430
],
415431
"media_region": "us1",
416432
"audio_only": false,
433+
"empty_room_timeout": 5,
434+
"unused_room_timeout": 5,
417435
"url": "https://video.twilio.com/v1/Rooms/RM4070b618362c1682b2385b1f9982833c",
418436
"links": {
419437
"participants": "https://video.twilio.com/v1/Rooms/RM4070b618362c1682b2385b1f9982833c/Participants",
@@ -477,6 +495,8 @@ def test_update_response(self):
477495
],
478496
"media_region": "us1",
479497
"audio_only": false,
498+
"empty_room_timeout": 5,
499+
"unused_room_timeout": 5,
480500
"end_time": "2015-07-30T20:00:00Z",
481501
"duration": 10,
482502
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# coding=utf-8
2+
r"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
9+
from datetime import date
10+
from tests import IntegrationTestCase
11+
from tests.holodeck import Request
12+
from twilio.base.exceptions import TwilioException
13+
from twilio.http.response import Response
14+
15+
16+
class ArchivedCallTestCase(IntegrationTestCase):
17+
18+
def test_delete_request(self):
19+
self.holodeck.mock(Response(500, ''))
20+
21+
with self.assertRaises(TwilioException):
22+
self.client.voice.v1.archived_calls(date(2008, 1, 2), "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete()
23+
24+
self.holodeck.assert_has_request(Request(
25+
'delete',
26+
'https://voice.twilio.com/v1/Archives/2008-01-02/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
27+
))
28+
29+
def test_delete_response(self):
30+
self.holodeck.mock(Response(
31+
204,
32+
None,
33+
))
34+
35+
actual = self.client.voice.v1.archived_calls(date(2008, 1, 2), "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete()
36+
37+
self.assertTrue(actual)

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def create(self, to, status_callback=values.unset, application_sid=values.unset,
4040
attempt=values.unset, validity_period=values.unset,
4141
force_delivery=values.unset, content_retention=values.unset,
4242
address_retention=values.unset, smart_encoded=values.unset,
43-
persistent_action=values.unset, from_=values.unset,
44-
messaging_service_sid=values.unset, body=values.unset,
45-
media_url=values.unset):
43+
persistent_action=values.unset, send_as_mms=values.unset,
44+
from_=values.unset, messaging_service_sid=values.unset,
45+
body=values.unset, media_url=values.unset):
4646
"""
4747
Create the MessageInstance
4848
@@ -58,6 +58,7 @@ def create(self, to, status_callback=values.unset, application_sid=values.unset,
5858
:param MessageInstance.AddressRetention address_retention: Determines if the address can be stored or obfuscated based on privacy settings
5959
:param bool smart_encoded: Whether to detect Unicode characters that have a similar GSM-7 character and replace them
6060
:param list[unicode] persistent_action: Rich actions for Channels Messages.
61+
:param bool send_as_mms: If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media
6162
:param unicode from_: The phone number that initiated the message
6263
:param unicode messaging_service_sid: The SID of the Messaging Service you want to associate with the message.
6364
:param unicode body: The text of the message you want to send. Can be up to 1,600 characters in length.
@@ -83,6 +84,7 @@ def create(self, to, status_callback=values.unset, application_sid=values.unset,
8384
'AddressRetention': address_retention,
8485
'SmartEncoded': smart_encoded,
8586
'PersistentAction': serialize.map(persistent_action, lambda e: e),
87+
'SendAsMms': send_as_mms,
8688
})
8789

8890
payload = self._version.create(method='POST', uri=self._uri, data=data, )

twilio/rest/conversations/v1/service/configuration/webhook.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def __init__(self, version, chat_service_sid):
105105
Initialize the WebhookContext
106106
107107
:param Version version: Version that contains the resource
108-
:param chat_service_sid: The unique ID of the Conversation Service this conversation belongs to.
108+
:param chat_service_sid: The unique ID of the `Conversation Service <https://www.twilio.com/docs/conversations/api/service-resource>`_ this conversation belongs to.
109109
110110
:returns: twilio.rest.conversations.v1.service.configuration.webhook.WebhookContext
111111
:rtype: twilio.rest.conversations.v1.service.configuration.webhook.WebhookContext
@@ -123,7 +123,7 @@ def update(self, pre_webhook_url=values.unset, post_webhook_url=values.unset,
123123
124124
:param unicode pre_webhook_url: The absolute url the pre-event webhook request should be sent to.
125125
:param unicode post_webhook_url: The absolute url the post-event webhook request should be sent to.
126-
:param list[unicode] filters: The list of webhook event triggers that are enabled for this Service.
126+
:param list[unicode] filters: The list of events that your configured webhook targets will receive. Events not configured here will not fire.
127127
:param unicode method: The HTTP method to be used when sending a webhook request
128128
129129
:returns: The updated WebhookInstance
@@ -216,7 +216,7 @@ def account_sid(self):
216216
@property
217217
def chat_service_sid(self):
218218
"""
219-
:returns: The chat_service_sid
219+
:returns: The unique ID of the `Conversation Service <https://www.twilio.com/docs/conversations/api/service-resource>`_ this conversation belongs to.
220220
:rtype: unicode
221221
"""
222222
return self._properties['chat_service_sid']
@@ -240,7 +240,7 @@ def post_webhook_url(self):
240240
@property
241241
def filters(self):
242242
"""
243-
:returns: The list of webhook event triggers that are enabled for this Service.
243+
:returns: The list of events that your configured webhook targets will receive. Events not configured here will not fire.
244244
:rtype: list[unicode]
245245
"""
246246
return self._properties['filters']
@@ -268,7 +268,7 @@ def update(self, pre_webhook_url=values.unset, post_webhook_url=values.unset,
268268
269269
:param unicode pre_webhook_url: The absolute url the pre-event webhook request should be sent to.
270270
:param unicode post_webhook_url: The absolute url the post-event webhook request should be sent to.
271-
:param list[unicode] filters: The list of webhook event triggers that are enabled for this Service.
271+
:param list[unicode] filters: The list of events that your configured webhook targets will receive. Events not configured here will not fire.
272272
:param unicode method: The HTTP method to be used when sending a webhook request
273273
274274
:returns: The updated WebhookInstance

0 commit comments

Comments
 (0)