8000 [Librarian] Regenerated @ 953393918a4ed8e51336de8abce74e9c58ff12ce · githubib/twilio-python@11c641b · GitHub
[go: up one dir, main page]

Skip to content

Commit 11c641b

Browse files
committed
[Librarian] Regenerated @ 953393918a4ed8e51336de8abce74e9c58ff12ce
1 parent d45d26a commit 11c641b

File tree

22 files changed

+961
-87
lines changed

22 files changed

+961
-87
lines changed

CHANGES.md

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

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

6+
[2019-12-18] Version 6.35.1
7+
---------------------------
8+
**Preview**
9+
- Add `/Insights/SuccessRate` endpoint for Businesses Branded Calls (Verified by Twilio)
10+
11+
**Studio**
12+
- StudioV2 API in beta
13+
14+
**Verify**
15+
- Add `MailerSid` property to Verify Service resource.
16+
17+
**Wireless**
18+
- Added `data_limit_strategy` to Rate Plan resource.
19+
20+
621
[2019-12-12] Version 6.35.0
722
---------------------------
823
**Library**

tests/integration/api/v2010/test_account.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@ def test_update_response(self):
229229
200,
230230
'''
231231
{
232-
"auth_token": "AUTHTOKEN",
233-
"date_created": "Sun, 15 Mar 2009 02:08:47 +0000",
234-
"date_updated": "Wed, 25 Aug 2010 01:30:09 +0000",
235-
"friendly_name": "Test Account",
232+
"auth_token": "auth_token",
233+
"date_created": "Thu, 30 Jul 2015 20:00:00 +0000",
234+
"date_updated": "Thu, 30 Jul 2015 20:00:00 +0000",
235+
"friendly_name": "friendly_name",
236+
"owner_account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
236237
"sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
237-
"owner_account_sid": "ACbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
238238
"status": "active",
239239
"subresource_uris": {
240240
"available_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json",
@@ -244,8 +244,19 @@ def test_update_response(self):
244244
"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",
245245
"outgoing_caller_ids": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json",
246246
"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
247-
"sms_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/Messages.json",
248-
"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json"
247+
"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",
248+
"addresses": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json",
249+
"signing_keys": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json",
250+
"connect_apps": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json",
251+
"sip": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP.json",
252+
"authorized_connect_apps": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json",
253+
"usage": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage.json",
254+
"keys": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json",
255+
"applications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json",
256+
"short_codes": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json",
257+
"queues": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json",
258+
"messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json",
259+
"balance": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Balance.json"
249260
},
250261
"type": "Full",
251262
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"

tests/integration/lookups/v1/test_phone_number.py

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,14 @@ def test_fetch_response(self):
3030
200,
3131
'''
3232
{
33-
"caller_name": {
34-
"caller_name": "Delicious Cheese Cake",
35-
"caller_type": "CONSUMER",
36-
"error_code": null
37-
},
38-
"carrier": {
39-
"error_code": null,
40-
"mobile_country_code": "310",
41-
"mobile_network_code": "456",
42-
"name": "verizon",
43-
"type": "mobile"
44-
},
45-
"fraud": {
46-
"error_code": null,
47-
"mobile_country_code": "310",
48-
"mobile_network_code": "456",
49-
"advanced_line_type": "voip",
50-
"caller_name": "Delicious Cheese Cake",
51-
"is_ported": false,
52-
"last_ported_date": "2018-05-01 04:05:11"
53-
},
33+
"caller_name": null,
34+
"carrier": null,
35+
"fraud": null,
36+
"add_ons": null,
5437
"country_code": "US",
5538
"national_format": "(510) 867-5310",
5639
"phone_number": "+15108675310",
57-
"add_ons": {
58-
"status": "successful",
59-
"message": null,
60-
"code": null,
61-
"results": {}
62-
},
63-
"url": "https://lookups.twilio.com/v1/PhoneNumbers/phone_number"
40+
"url": "https://lookups.twilio.com/v1/PhoneNumbers/+15108675310"
6441
}
6542
'''
6643
))
@@ -87,7 +64,34 @@ def test_fetch_carrier_response(self):
8764
"phone_number": "+15108675310",
8865
"fraud": null,
8966
"add_ons": null,
90-
"url": "https://lookups.twilio.com/v1/PhoneNumbers/phone_number"
67+
"url": "https://lookups.twilio.com/v1/PhoneNumbers/+15108675310?Type=carrier"
68+
}
69+
'''
70+
))
71+
72+
actual = self.client.lookups.v1.phone_numbers(phone_number="+15017122661").fetch()
73+
74+
self.assertIsNotNone(actual)
75+
76+
def test_fetch_carrier_international_response(self):
77+
self.holodeck.mock(Response(
78+
200,
79+
'''
80+
{
81+
"caller_name": null,
82+
"carrier": {
83+
"error_code": null,
84+
"mobile_country_code": null,
85+
"mobile_network_code": null,
86+
"name": "Vodafone Business Solutions",
87+
"type": "landline"
88+
},
89+
"country_code": "GB",
90+
"national_format": "020 7765 1182",
91+
"phone_number": "+4402077651182",
92+
"fraud": null,
93+
"add_ons": null,
94+
"url": "https://lookups.twilio.com/v1/PhoneNumbers/+4402077651182?Type=carrier"
9195
}
9296
'''
9397
))
@@ -112,7 +116,7 @@ def test_fetch_caller_name_response(self):
112116
"national_format": "(510) 867-5310",
113117
"phone_number": "+15108675310",
114118
"add_ons": null,
115-
"url": "https://lookups.twilio.com/v1/PhoneNumbers/phone_number"
119+
"url": "https://lookups.twilio.com/v1/PhoneNumbers/+15108675310?Type=caller-name"
116120
}
117121
'''
118122
))
@@ -148,7 +152,7 @@ def test_fetch_carrier_and_caller_name_response(self):
148152
"code": null,
149153
"results": {}
150154
},
151-
"url": "https://lookups.twilio.com/v1/PhoneNumbers/+15108675310"
155+
"url": "https://lookups.twilio.com/v1/PhoneNumbers/+15108675310?Type=carrier&Type=caller-name"
152156
}
153157
'''
154158
))
@@ -222,7 +226,7 @@ def test_fetch_addons_whitepages_pro_response(self):
222226
}
223227
}
224228
},
225-
"url": "https://lookups.twilio.com/v1/PhoneNumbers/+12127363100?Type=carrier"
229+
"url": "https://lookups.twilio.com/v1/PhoneNumbers/+12127363100?Type=caller-name"
226230
}
227231
'''
228232
))
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# coding=utf-8
2+
r"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# coding=utf-8
2+
r"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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 SuccessRateTestCase(IntegrationTestCase):
16+
17+
def test_fetch_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.preview.trusted_comms.businesses(sid="BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
22+
.insights \
23+
.success_rate().fetch()
24+
25+
self.holodeck.assert_has_request(Request(
26+
'get',
27+
'https://preview.twilio.com/TrustedComms/Businesses/BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Insights/SuccessRate',
28+
))
29+
30+
def test_fetch_response(self):
31+
self.holodeck.mock(Response(
32+
200,
33+
'''
34+
{
35+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
36+
"business_sid": "BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
37+
"start": "2015-07-30T20:00:00Z",
38+
"end": "2015-07-30T21:00:00Z",
39+
"interval": "minute",
40+
"reports": {
41+
"success_rate": {
42+
"timestamp": "2015-07-30T20:00:00",
43+
"calls": 1200,
44+
"branded": 800,
45+
"value": 66.67
46+
}
47+
},
48+
"url": "https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Insights/SuccessRate"
49+
}
50+
'''
51+
))
52+
53+
actual = self.client.preview.trusted_comms.businesses(sid="BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
54+
.insights \
55+
.success_rate().fetch()
56+
57+
self.assertIsNotNone(actual)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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 InsightsTestCase(IntegrationTestCase):
16+
pass
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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 BusinessTestCase(IntegrationTestCase):
16+
17+
def test_fetch_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.preview.trusted_comms.businesses(sid="BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch()
22+
23+
self.holodeck.assert_has_request(Request(
24+
'get',
25+
'https://preview.twilio.com/TrustedComms/Businesses/BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
26+
))
27+
28+
def test_fetch_response(self):
29+
self.holodeck.mock(Response(
30+
200,
31+
'''
32+
{
33+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34+
"sid": "BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35+
"url": "https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
36+
"links": {
37+
"insights": "https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Insights"
38+
}
39+
}
40+
'''
41+
))
42+
43+
actual = self.client.preview.trusted_comms.businesses(sid="BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch()
44+
45+
self.assertIsNotNone(actual)

tests/integration/verify/v2/test_service.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def test_create_record_response(self):
4242
"skip_sms_to_landlines": false,
4343
"dtmf_input_required": false,
4444
"tts_name": "name",
45+
"mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4546
"date_created": "2015-07-30T20:00:00Z",
4647
"date_updated": "2015-07-30T20:00:00Z",
4748
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -84,6 +85,7 @@ def test_fetch_record_response(self):
8485
"skip_sms_to_landlines": false,
8586
"dtmf_input_required": false,
8687
"tts_name": "name",
88+
"mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
8789
"date_created": "2015-07-30T20:00:00Z",
8890
"date_updated": "2015-07-30T20:00:00Z",
8991
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -158,6 +160,7 @@ def test_read_all_response(self):
158160
"skip_sms_to_landlines": false,
159161
"dtmf_input_required": false,
160162
"tts_name": "name",
163+
"mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
161164
"date_created": "2015-07-30T20:00:00Z",
162165
"date_updated": "2015-07-30T20:00:00Z",
163166
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -202,6 +205,7 @@ def test_update_record_response(self):
202205
"skip_sms_to_landlines": false,
203206
"dtmf_input_required": false,
204207
"tts_name": "name",
208+
"mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
205209
"date_created": "2015-07-30T20:00:00Z",
206210
"date_updated": "2015-07-30T20:00:00Z",
207211
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",

tests/integration/wireless/v1/test_rate_plan.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def test_read_full_response(self):
8585
"sid": "WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
8686
"usage_notification_method": "POST",
8787
"usage_notification_url": "https://callback.com",
88+
"data_limit_strategy": "block",
8889
"url": "https://wireless.twilio.com/v1/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
8990
}
9091
]
@@ -133,6 +134,7 @@ def test_fetch_response(self):
133134
"sid": "WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
134135
"usage_notification_method": "POST",
135136
"usage_notification_url": "https://callback.com",
137+
"data_limit_strategy": "block",
136138
"url": "https://wireless.twilio.com/v1/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
137139
}
138140
'''
@@ -162,6 +164,7 @@ def test_create_response(self):
162164
"unique_name": "unique_name",
163165
"data_enabled": true,
164166
"data_limit": 1000,
167+
"data_limit_strategy": "block",
165168
"data_metering": "payg",
166169
"date_created": "2019-07-30T20:00:00Z",
167170
"date_updated": "2019-07-30T20:00:00Z",
@@ -225,6 +228,7 @@ def test_update_response(self):
225228
"sid": "WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
226229
"usage_notification_method": "POST",
227230
"usage_notification_url": "https://callback.com",
231+
"data_limit_strategy": "block",
228232
"url": "https://wireless.twilio.com/v1/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
229233
}
230234
'''

twilio/rest/preview/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,13 @@ def branded_calls(self):
223223
"""
224224
return self.trusted_comms.branded_calls
225225

226+
@property
227+
def businesses(self):
228+
"""
229+
:rtype: twilio.rest.preview.trusted_comms.business.BusinessList
230+
"""
231+
return self.trusted_comms.businesses
232+
226233
@property
227234
def cps(self):
228235
"""

0 commit comments

Comments
 (0)
0