Skip to content

Commit 9fd1eb2

Browse files
committed
[Librarian] Regenerated @ a7fa662b873c238736743a9396578a110b073193
1 parent ca3d1a7 commit 9fd1eb2

32 files changed

+520
-23
lines changed

CHANGES.md

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

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

6+
[2019-07-10] Version 6.29.1
7+
----------------------------
8+
**Api**
9+
- Make `friendly_name` optional for applications create
10+
- Add new property `as_of` date to Usage Record API calls
11+
12+
**Wireless**
13+
- Added Usage Records resource.
14+
15+
616
[2019-06-26] Version 6.29.0
717
----------------------------
818
**Autopilot**

tests/integration/api/v2010/account/test_application.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,11 @@ def test_create_request(self):
1919

2020
with self.assertRaises(TwilioException):
2121
self.client.api.v2010.accounts(sid="ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
22-
.applications.create(friendly_name="friendly_name")
23-
24-
values = {'FriendlyName': "friendly_name", }
22+
.applications.create()
2523

2624
self.holodeck.assert_has_request(Request(
2725
'post',
2826
'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Applications.json',
29-
data=values,
3027
))
3128

3229
def test_create_response(self):
@@ -59,7 +56,7 @@ def test_create_response(self):
5956
))
6057

6158
actual = self.client.api.v2010.accounts(sid="ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
62-
.applications.create(friendly_name="friendly_name")
59+
.applications.create()
6360

6461
self.assertIsNotNone(actual)
6562

tests/integration/api/v2010/account/test_token.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ def test_create_response(self):
3636
"date_updated": "Fri, 24 Jul 2015 18:43:58 +0000",
3737
"ice_servers": [
3838
{
39-
"url": "stun:global.stun:3478?transport=udp"
39+
"url": "stun:global.stun:3478?transport=udp",
40+
"urls": "stun:global.stun:3478?transport=udp"
4041
},
4142
{
4243
"credential": "5SR2x8mZK1lTFJW3NVgLGw6UM9C0dja4jI/Hdw3xr+w=",
4344
"url": "turn:global.turn:3478?transport=udp",
45+
"urls": "turn:global.turn:3478?transport=udp",
4446
"username": "cda92e5006c7810494639fc466ecc80182cef8183fdf400f84c4126f3b59d0bb"
4547
}
4648
],

tests/integration/api/v2010/account/usage/record/test_all_time.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_read_full_response(self):
4848
{
4949
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5050
"api_version": "2010-04-01",
51+
"as_of": "2019-06-24T22:32:49+00:00",
5152
"category": "sms-inbound-shortcode",
5253
"count": "0",
5354
"count_unit": "messages",

tests/integration/api/v2010/account/usage/record/test_daily.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_read_full_response(self):
4848
{
4949
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5050
"api_version": "2010-04-01",
51+
"as_of": "2019-06-24T22:32:49+00:00",
5152
"category": "sms-inbound-shortcode",
5253
"count": "0",
5354
"count_unit": "messages",

tests/integration/api/v2010/account/usage/record/test_last_month.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_read_full_response(self):
4848
{
4949
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5050
"api_version": "2010-04-01",
51+
"as_of": "2019-06-24T22:32:49+00:00",
5152
"category": "sms-inbound-shortcode",
5253
"count": "0",
5354
"count_unit": "messages",

tests/integration/api/v2010/account/usage/record/test_monthly.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_read_full_response(self):
4848
{
4949
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5050
"api_version": "2010-04-01",
51+
"as_of": "2019-06-24T22:32:49+00:00",
5152
"category": "sms-inbound-shortcode",
5253
"count": "0",
5354
"count_unit": "messages",

tests/integration/api/v2010/account/usage/record/test_this_month.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_read_full_response(self):
4848
{
4949
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5050
"api_version": "2010-04-01",
51+
"as_of": "2019-06-24T22:32:49+00:00",
5152
"category": "sms-inbound-shortcode",
5253
"count": "0",
5354
"count_unit": "messages",

tests/integration/api/v2010/account/usage/record/test_today.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_read_full_response(self):
4848
{
4949
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5050
"api_version": "2010-04-01",
51+
"as_of": "2019-06-24T22:32:49+00:00",
5152
"category": "sms-inbound-shortcode",
5253
"count": "0",
5354
"count_unit": "messages",

tests/integration/api/v2010/account/usage/record/test_yearly.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_read_full_response(self):
4848
{
4949
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5050
"api_version": "2010-04-01",
51+
"as_of": "2019-06-24T22:32:49+00:00",
5152
"category": "sms-inbound-shortcode",
5253
"count": "0",
5354
"count_unit": "messages",

tests/integration/api/v2010/account/usage/record/test_yesterday.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_read_full_response(self):
4848
{
4949
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5050
"api_version": "2010-04-01",
51+
"as_of": "2019-06-24T22:32:49+00:00",
5152
"category": "sms-inbound-shortcode",
5253
"count": "0",
5354
"count_unit": "messages",

tests/integration/api/v2010/account/usage/test_record.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def test_read_full_response(self):
4747
{
4848
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4949
"api_version": "2010-04-01",
50+
"as_of": "2019-06-24T22:32:49+00:00",
5051
"category": "totalprice",
5152
"count": null,
5253
"count_unit": "",

tests/integration/preview/acc_security/service/test_verification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_create_verification_response(self):
3737
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3838
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3939
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40-
"to": "+14159373912",
40+
"to": "+15017122661",
4141
"channel": "sms",
4242
"status": "pending",
4343
"valid": null,

tests/integration/preview/acc_security/service/test_verification_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_verification_checks_response(self):
3737
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3838
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3939
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40-
"to": "+14159373912",
40+
"to": "+15017122661",
4141
"channel": "sms",
4242
"status": "approved",
4343
"valid": false,

tests/integration/verify/v2/service/test_verification.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_create_verification_response(self):
3737
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3838
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3939
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40-
"to": "+14159373912",
40+
"to": "+15017122661",
4141
"channel": "sms",
4242
"status": "pending",
4343
"valid": false,
@@ -72,7 +72,7 @@ def test_create_verification_with_rate_limits_response(self):
7272
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7373
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7474
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
75-
"to": "+14159373912",
75+
"to": "+15017122661",
7676
"channel": "sms",
7777
"status": "pending",
7878
"valid": false,
@@ -122,7 +122,7 @@ def test_update_verification_response(self):
122122
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
123123
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
124124
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
125-
"to": "+14159373912",
125+
"to": "+15017122661",
126126
"channel": "sms",
127127
"status": "canceled",
128128
"valid": false,
@@ -169,7 +169,7 @@ def test_fetch_verification_response(self):
169169
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
170170
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
171171
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
172-
"to": "+14159373912",
172+
"to": "+15017122661",
173173
"channel": "sms",
174174
"status": "pending",
175175
"valid": false,

tests/integration/verify/v2/service/test_verification_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_verification_checks_response(self):
3737
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3838
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3939
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40-
"to": "+14159373912",
40+
"to": "+15017122661",
4141
"channel": "sms",
4242
"status": "approved",
4343
"valid": true,

tests/integration/video/v1/room/room_participant/test_room_participant_subscribe_rule.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,16 @@ def test_read_empty_response(self):
3636
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3737
"date_created": null,
3838
"date_updated": null,
39-
"rules": []
39+
"rules": [
40+
{
41+
"type": "include",
42+
"all": true,
43+
"publisher": null,
44+
"track": null,
45+
"kind": null,
46+
"priority": null
47+
}
48+
]
4049
}
4150
'''
4251
))
@@ -72,7 +81,11 @@ def test_update_filters_response(self):
7281
"rules": [
7382
{
7483
"type": "exclude",
75-
"all": true
84+
"all": true,
85+
"publisher": null,
86+
"track": null,
87+
"kind": null,
88+
"priority": null
7689
}
7790
]
7891
}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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 UsageRecordTestCase(IntegrationTestCase):
16+
17+
def test_list_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.wireless.v1.usage_records.list()
22+
23+
self.holodeck.assert_has_request(Request(
24+
'get',
25+
'https://wireless.twilio.com/v1/UsageRecords',
26+
))
27+
28+
def test_fetch_response(self):
29+
self.holodeck.mock(Response(
30+
200,
31+
'''
32+
{
33+
"usage_records": [
34+
{
35+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
36+
"commands": {
37+
"billing_units": "USD",
38+
"billed": 0,
39+
"total": 3,
40+
"from_sim": 1,
41+
"to_sim": 2,
42+
"home": {
43+
"billing_units": "USD",
44+
"billed": 0,
45+
"total": 3,
46+
"from_sim": 1,
47+
"to_sim": 2
48+
},
49+
"national_roaming": {
50+
"billing_units": "USD",
51+
"billed": 0,
52+
"total": 0,
53+
"from_sim": 0,
54+
"to_sim": 0
55+
},
56+
"international_roaming": []
57+
},
58+
"data": {
59+
"billing_units": "USD",
60+
"billed": 0.35,
61+
"total": 3494609,
62+
"upload": 731560,
63+
"download": 2763049,
64+
"units": "bytes",
65+
"home": {
66+
"billing_units": "USD",
67+
"billed": 0.35,
68+
"total": 3494609,
69+
"upload": 731560,
70+
"download": 2763049,
71+
"units": "bytes"
72+
},
73+
"national_roaming": {
74+
"billing_units": "USD",
75+
"billed": 0,
76+
"total": 0,
77+
"upload": 0,
78+
"download": 0,
79+
"units": "bytes"
80+
},
81+
"international_roaming": []
82+
},
83+
"period": {
84+
"start": "2015-07-30T20:00:00Z",
85+
"end": "2015-07-30T20:00:00Z"
86+
}
87+
},
88+
{
89+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
90+
"commands": {},
91+
"data": {},
92+
"period": {}
93+
}
94+
],
95+
"meta": {
96+
"first_page_url": "https://wireless.twilio.com/v1/UsageRecords?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0",
97+
"key": "usage_records",
98+
"next_page_url": null,
99+
"page": 0,
100+
"page_size": 50,
101+
"previous_page_url": null,
102+
"url": "https://wireless.twilio.com/v1/UsageRecords?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0"
103+
}
104+
}
105+
'''
106+
))
107+
108+
actual = self.client.wireless.v1.usage_records.list()
109+
110+
self.assertIsNotNone(actual)

twilio/rest/api/v2010/account/application.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,17 @@ def __init__(self, version, account_sid):
3333
self._solution = {'account_sid': account_sid, }
3434
self._uri = '/Accounts/{account_sid}/Applications.json'.format(**self._solution)
3535

36-
def create(self, friendly_name, api_version=values.unset,
37-
voice_url=values.unset, voice_method=values.unset,
38-
voice_fallback_url=values.unset, voice_fallback_method=values.unset,
39-
status_callback=values.unset, status_callback_method=values.unset,
36+
def create(self, api_version=values.unset, voice_url=values.unset,
37+
voice_method=values.unset, voice_fallback_url=values.unset,
38+
voice_fallback_method=values.unset, status_callback=values.unset,
39+
status_callback_method=values.unset,
4040
voice_caller_id_lookup=values.unset, sms_url=values.unset,
4141
sms_method=values.unset, sms_fallback_url=values.unset,
4242
sms_fallback_method=values.unset, sms_status_callback=values.unset,
43-
message_status_callback=values.unset):
43+
message_status_callback=values.unset, friendly_name=values.unset):
4444
"""
4545
Create a new ApplicationInstance
4646
47-
:param unicode friendly_name: A string to describe the new resource
4847
:param unicode api_version: The API version to use to start a new TwiML session
4948
:param unicode voice_url: The URL to call when the phone number receives a call
5049
:param unicode voice_method: The HTTP method to use with the voice_url
@@ -59,12 +58,12 @@ def create(self, friendly_name, api_version=values.unset,
5958
:param unicode sms_fallback_method: The HTTP method to use with sms_fallback_url
6059
:param unicode sms_status_callback: The URL to send status information to your application
6160
:param unicode message_status_callback: The URL to send message status information to your application
61+
:param unicode friendly_name: A string to describe the new resource
6262
6363
:returns: Newly created ApplicationInstance
6464
:rtype: twilio.rest.api.v2010.account.application.ApplicationInstance
6565
"""
6666
data = values.of({
67-
'FriendlyName': friendly_name,
6867
'ApiVersion': api_version,
6968
'VoiceUrl': voice_url,
7069
'VoiceMethod': voice_method,
@@ -79,6 +78,7 @@ def create(self, friendly_name, api_version=values.unset,
7978
'SmsFallbackMethod': sms_fallback_method,
8079
'SmsStatusCallback': sms_status_callback,
8180
'MessageStatusCallback': message_status_callback,
81+
'FriendlyName': friendly_name,
8282
})
8383

8484
payload = self._version.create(

0 commit comments

Comments
 (0)