Skip to content

Commit cab9126

Browse files
committed
[Librarian] Regenerated @ 1e3bd5443f24e7424f5cb5232ca01c29c46cc9c8
1 parent 4fba93a commit cab9126

File tree

34 files changed

+2076
-864
lines changed

34 files changed

+2076
-864
lines changed

CHANGES.md

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

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

6+
[2019-03-15] Version 6.25.2
7+
----------------------------
8+
**Library**
9+
- PR #457: Add Help Center and Support Ticket links to the README. Thanks to @childish-sambino!
10+
11+
**Api**
12+
- Add `machine_detection_speech_threshold`, `machine_detection_speech_end_threshold`, `machine_detection_silence_timeout` optional params to Call create request
13+
14+
**Flex**
15+
- Adding Flex Channel Orchestration
16+
- Adding Flex Flow
17+
18+
619
[2019-03-06] Version 6.25.1
720
----------------------------
821
**Twiml**
Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
# coding=utf-8
2+
"""
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 FlexFlowTestCase(IntegrationTestCase):
16+
17+
def test_list_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.flex_api.v1.flex_flow.list()
22+
23+
self.holodeck.assert_has_request(Request(
24+
'get',
25+
'https://flex-api.twilio.com/v1/FlexFlows',
26+
))
27+
28+
def test_read_full_response(self):
29+
self.holodeck.mock(Response(
30+
200,
31+
'''
32+
{
33+
"meta": {
34+
"page": 0,
35+
"page_size": 50,
36+
"first_page_url": "https://flex-api.twilio.com/v1/FlexFlows?PageSize=50&Page=0",
37+
"previous_page_url": null,
38+
"url": "https://flex-api.twilio.com/v1/FlexFlows?PageSize=50&Page=0",
39+
"next_page_url": null,
40+
"key": "flex_flows"
41+
},
42+
"flex_flows": [
43+
{
44+
"sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
45+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
46+
"date_created": "2016-08-01T22:10:40Z",
47+
"date_updated": "2016-08-01T22:10:40Z",
48+
"friendly_name": "friendly_name",
49+
"chat_service_sid": "SIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
50+
"channel_type": "sms",
51+
"contact_identity": "12345",
52+
"enabled": true,
53+
"integration_type": "studio",
54+
"integration": {
55+
"flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
56+
},
57+
"long_lived": true,
58+
"url": "https://flex-api.twilio.com/v1/FlexFlows/FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
59+
}
60+
]
61+
}
62+
'''
63+
))
64+
65+
actual = self.client.flex_api.v1.flex_flow.list()
66+
67+
self.assertIsNotNone(actual)
68+
69+
def test_read_empty_response(self):
70+
self.holodeck.mock(Response(
71+
200,
72+
'''
73+
{
74+
"meta": {
75+
"page": 0,
76+
"page_size": 50,
77+
"first_page_url": "https://flex-api.twilio.com/v1/FlexFlows?PageSize=50&Page=0",
78+
"previous_page_url": null,
79+
"url": "https://flex-api.twilio.com/v1/FlexFlows?PageSize=50&Page=0",
80+
"next_page_url": null,
81+
"key": "flex_flows"
82+
},
83+
"flex_flows": []
84+
}
85+
'''
86+
))
87+
88+
actual = self.client.flex_api.v1.flex_flow.list()
89+
90+
self.assertIsNotNone(actual)
91+
92+
def test_fetch_request(self):
93+
self.holodeck.mock(Response(500, ''))
94+
95+
with self.assertRaises(TwilioException):
96+
self.client.flex_api.v1.flex_flow(sid="FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch()
97+
98+
self.holodeck.assert_has_request(Request(
99+
'get',
100+
'https://flex-api.twilio.com/v1/FlexFlows/FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
101+
))
102+
103+
def test_fetch_response(self):
104+
self.holodeck.mock(Response(
105+
200,
106+
'''
107+
{
108+
"sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
109+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
110+
"date_created": "2016-08-01T22:10:40Z",
111+
"date_updated": "2016-08-01T22:10:40Z",
112+
"friendly_name": "friendly_name",
113+
"chat_service_sid": "SIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
114+
"channel_type": "sms",
115+
"contact_identity": "12345",
116+
"enabled": true,
117+
"integration_type": "studio",
118+
"integration": {
119+
"flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
120+
},
121+
"long_lived": true,
122+
"url": "https://flex-api.twilio.com/v1/FlexFlows/FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
123+
}
124+
'''
125+
))
126+
127+
actual = self.client.flex_api.v1.flex_flow(sid="FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch()
128+
129+
self.assertIsNotNone(actual)
130+
131+
def test_create_request(self):
132+
self.holodeck.mock(Response(500, ''))
133+
134+
with self.assertRaises(TwilioException):
135+
self.client.flex_api.v1.flex_flow.create(friendly_name="friendly_name", chat_service_sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", channel_type="web")
136+
137+
values = {
138+
'FriendlyName': "friendly_name",
139+
'ChatServiceSid': "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
140+
'ChannelType': "web",
141+
}
142+
143+
self.holodeck.assert_has_request(Request(
144+
'post',
145+
'https://flex-api.twilio.com/v1/FlexFlows',
146+
data=values,
147+
))
148+
149+
def test_create_response(self):
150+
self.holodeck.mock(Response(
151+
201,
152+
'''
153+
{
154+
"sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
155+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
156+
"date_created": "2016-08-01T22:10:40Z",
157+
"date_updated": "2016-08-01T22:10:40Z",
158+
"friendly_name": "friendly_name",
159+
"chat_service_sid": "SIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
160+
"channel_type": "sms",
161+
"contact_identity": "12345",
162+
"enabled": true,
163+
"integration_type": "studio",
164+
"integration": {
165+
"flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
166+
},
167+
"long_lived": true,
168+
"url": "https://flex-api.twilio.com/v1/FlexFlows/FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
169+
}
170+
'''
171+
))
172+
173+
actual = self.client.flex_api.v1.flex_flow.create(friendly_name="friendly_name", chat_service_sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", channel_type="web")
174+
175+
self.assertIsNotNone(actual)
176+
177+
def test_update_request(self):
178+
self.holodeck.mock(Response(500, ''))
179+
180+
with self.assertRaises(TwilioException):
181+
self.client.flex_api.v1.flex_flow(sid="FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update()
182+
183+
self.holodeck.assert_has_request(Request(
184+
'post',
185+
'https://flex-api.twilio.com/v1/FlexFlows/FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
186+
))
187+
188+
def test_update_response(self):
189+
self.holodeck.mock(Response(
190+
200,
191+
'''
192+
{
193+
"sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
194+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
195+
"date_created": "2016-08-01T22:10:40Z",
196+
"date_updated": "2016-08-01T22:10:40Z",
197+
"friendly_name": "friendly_name",
198+
"chat_service_sid": "SIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
199+
"channel_type": "sms",
200+
"contact_identity": "12345",
201+
"enabled": true,
202+
"integration_type": "studio",
203+
"integration": {
204+
"flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
205+
},
206+
"long_lived": true,
207+
"url": "https://flex-api.twilio.com/v1/FlexFlows/FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
208+
}
209+
'''
210+
))
211+
212+
actual = self.client.flex_api.v1.flex_flow(sid="FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update()
213+
214+
self.assertIsNotNone(actual)
215+
216+
def test_delete_request(self):
217+
self.holodeck.mock(Response(500, ''))
218+
219+
with self.assertRaises(TwilioException):
220+
self.client.flex_api.v1.flex_flow(sid="FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete()
221+
222+
self.holodeck.assert_has_request(Request(
223+
'delete',
224+
'https://flex-api.twilio.com/v1/FlexFlows/FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
225+
))
226+
227+
def test_delete_response(self):
228+
self.holodeck.mock(Response(
229+
204,
230+
None,
231+
))
232+
233+
actual = self.client.flex_api.v1.flex_flow(sid="FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete()
234+
235+
self.assertTrue(actual)
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# coding=utf-8
2+
"""
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 SettingsTestCase(IntegrationTestCase):
16+
17+
def test_fetch_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.voice.v1.voice_permissions \
22+
.settings().fetch()
23+
24+
self.holodeck.assert_has_request(Request(
25+
'get',
26+
'https://voice.twilio.com/v1/Settings',
27+
))
28+
29+
def test_fetch_response(self):
30+
self.holodeck.mock(Response(
31+
200,
32+
'''
33+
{
34+
"dialing_permissions_inheritance": true,
35+
"url": "https://voice.twilio.com/v1/Settings"
36+
}
37+
'''
38+
))
39+
40+
actual = self.client.voice.v1.voice_permissions \
41+
.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.voice.v1.voice_permissions \
50+
.settings().update()
51+
52+
self.holodeck.assert_has_request(Request(
53+
'post',
54+
'https://voice.twilio.com/v1/Settings',
55+
))
56+
57+
def test_update_response(self):
58+
self.holodeck.mock(Response(
59+
202,
60+
'''
61+
{
62+
"dialing_permissions_inheritance": true,
63+
"url": "https://voice.twilio.com/v1/Settings"
64+
}
65+
'''
66+
))
67+
68+
actual = self.client.voice.v1.voice_permissions \
69+
.settings().update()
70+
71+
self.assertIsNotNone(actual)

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ def create(self, to, from_, method=values.unset, fallback_url=values.unset,
5353
machine_detection=values.unset,
5454
machine_detection_timeout=values.unset,
5555
recording_status_callback_event=values.unset, trim=values.unset,
56-
caller_id=values.unset, url=values.unset,
56+
caller_id=values.unset,
57+
machine_detection_speech_threshold=values.unset,
58+
machine_detection_speech_end_threshold=values.unset,
59+
machine_detection_silence_timeout=values.unset, url=values.unset,
5760
application_sid=values.unset):
5861
"""
5962
Create a new CallInstance
@@ -76,10 +79,13 @@ def create(self, to, from_, method=values.unset, fallback_url=values.unset,
7679
:param unicode sip_auth_username: The username used to authenticate the caller making a SIP call
7780
:param unicode sip_auth_password: The password required to authenticate the user account specified in `sip_auth_username`.
7881
:param unicode machine_detection: Enable machine detection or end of greeting detection
79-
:param unicode machine_detection_timeout: Number of milliseconds to wait for machine detection
82+
:param unicode machine_detection_timeout: Number of seconds to wait for machine detection
8083
:param unicode recording_status_callback_event: The recording status events that will trigger calls to the URL specified in `recording_status_callback`
8184
:param unicode trim: Set this parameter to control trimming of silence on the recording.
8285
:param unicode caller_id: The phone number, SIP address, or Client identifier that made this call. Phone numbers are in E.164 format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`.
86+
:param unicode machine_detection_speech_threshold: Number of milliseconds for measuring stick for the length of the speech activity
87+
:param unicode machine_detection_speech_end_threshold: Number of milliseconds of silence after speech activity
88+
:param unicode machine_detection_silence_timeout: Number of milliseconds of initial silence
8389
:param unicode url: The absolute URL that returns TwiML for this call
8490
:param unicode application_sid: The SID of the Application resource that will handle the call
8591
@@ -111,6 +117,9 @@ def create(self, to, from_, method=values.unset, fallback_url=values.unset,
111117
'RecordingStatusCallbackEvent': serialize.map(recording_status_callback_event, lambda e: e),
112118
'Trim': trim,
113119
'CallerId': caller_id,
120+
'MachineDetectionSpeechThreshold': machine_detection_speech_threshold,
121+
'MachineDetectionSpeechEndThreshold': machine_detection_speech_end_threshold,
122+
'MachineDetectionSilenceTimeout': machine_detection_silence_timeout,
114123
})
115124

116125
payload = self._version.create(

0 commit comments

Comments
 (0)