10000 [Librarian] Regenerated @ 075f0c561354c80a55d6973850c0404c6b218e94 · thecodeflash/twilio-python@96a35dd · GitHub
[go: up one dir, main page]

Skip to content

Commit 96a35dd

Browse files
author
Doug Black
committed
[Librarian] Regenerated @ 075f0c561354c80a55d6973850c0404c6b218e94
1 parent a77bfe5 commit 96a35dd

File tree

19 files changed

+201
-34
lines changed

19 files changed

+201
-34
lines changed

CHANGES.md

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

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

6+
[2017-10-13] Version 6.8.0
7+
---------------------------
8+
**Api**
9+
- Add `smart_encoded` param for Messages
10+
- Add `identity_sid` param to IncomingPhoneNumbers create and update
11+
12+
**Preview**
13+
- Make 'address_sid' and 'email' optional fields when creating a HostedNumberOrder
14+
- Add AuthorizationDocuments preview API.
15+
16+
**Proxy**
17+
- Initial Release
18+
19+
**Wireless**
20+
- Added `ip_address` to sim resource
21+
22+
**Twiml**
23+
- Rename `number` to `phone_number` in Voice Number TwiML. *(breaking change)*
24+
- Rename `message` to `body` in Messaging TwiML. *(breaking change)*
25+
26+
627
[2017-10-06] Version 6.7.1
728
---------------------------
829
**Preview**

tests/integration/api/v2010/account/incoming_phone_number/test_local.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_read_full_response(self):
4848
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
4949
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
5050
"friendly_name": "(808) 925-5327",
51+
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5152
"phone_number": "+18089255327",
5253
"origin": "origin",
5354
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -149,6 +150,7 @@ def test_create_response(self):
149150
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
150151
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
151152
"friendly_name": "(808) 925-5327",
153+
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
152154
"phone_number": "+18089255327",
153155
"origin": "origin",
154156
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",

tests/integration/api/v2010/account/incoming_phone_number/test_mobile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_read_full_response(self):
4848
"date_created": "Tue, 08 Sep 2015 16:21:16 +0000",
4949
"date_updated": "Tue, 08 Sep 2015 16:21:16 +0000",
5050
"friendly_name": "61429099450",
51+
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5152
"phone_number": "+61429099450",
5253
"origin": "origin",
5354
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -148,6 +149,7 @@ def test_create_response(self):
148149
},
149150
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
150151
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
152+
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
151153
"friendly_name": "(808) 925-5327",
152154
"phone_number": "+18089255327",
153155
"origin": "origin",

tests/integration/api/v2010/account/incoming_phone_number/test_toll_free.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_read_full_response(self):
4848
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
4949
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
5050
"friendly_name": "(808) 925-5327",
51+
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5152
"phone_number": "+18089255327",
5253
"origin": "origin",
5354
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -149,6 +150,7 @@ def test_create_response(self):
149150
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
150151
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
151152
"friendly_name": "(808) 925-5327",
153+
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
152154
"phone_number": "+18089255327",
153155
"origin": "origin",
154156
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def test_update_response(self):
4545
"emergency_status": "Inactive",
4646
"emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4747
"friendly_name": "(808) 925-5327",
48+
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4849
"origin": "origin",
4950
"phone_number": "+18089255327",
5051
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -103,6 +104,7 @@ def test_fetch_response(self):
103104
"emergency_status": "Active",
104105
"emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
105106
"friendly_name": "(808) 925-5327",
107+
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
106108
"origin": "origin",
107109
"phone_number": "+18089255327",
108110
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -188,6 +190,7 @@ def test_read_full_response(self):
188190
"emergency_status": "Active",
189191
"emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
190192
"friendly_name": "(808) 925-5327",
193+
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
191194
"origin": "origin",
192195
"phone_number": "+18089255327",
193196
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -283,6 +286,7 @@ def test_create_response(self):
283286
"emergency_status": "Active",
284287
"emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
285288
"friendly_name": "(808) 925-5327",
289+
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
286290
"origin": "origin",
287291
"phone_number": "+18089255327",
288292
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",

tests/integration/preview/hosted_numbers/test_hosted_number_order.py

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,12 @@ def test_create_request(self):
213213
self.holodeck.mock(Response(500, ''))
214214

215215
with self.assertRaises(TwilioException):
216-
self.client.preview.hosted_numbers.hosted_number_orders.create(address_sid="ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", phone_number="+987654321", iso_country="iso_country", sms_capability=True, email="email")
216+
self.client.preview.hosted_numbers.hosted_number_orders.create(phone_number="+987654321", iso_country="iso_country", sms_capability=True)
217217

218218
values = {
219-
'AddressSid': "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
220219
'PhoneNumber': "+987654321",
221220
'IsoCountry': "iso_country",
222221
'SmsCapability': True,
223-
'Email': "email",
224222
}
225223

226224
self.holodeck.assert_has_request(Request(
@@ -257,6 +255,38 @@ def test_create_response(self):
257255
'''
258256
))
259257

260-
actual = self.client.preview.hosted_numbers.hosted_number_orders.create(address_sid="ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", phone_number="+987654321", iso_country="iso_country", sms_capability=True, email="email")
258+
actual = self.client.preview.hosted_numbers.hosted_number_orders.create(phone_number="+987654321", iso_country="iso_country", sms_capability=True)
259+
260+
self.assertIsNotNone(actual)
261+
262+
def test_create_without_optional_loa_fields_response(self):
263+
self.holodeck.mock(Response(
264+
201,
265+
'''
266+
{
267+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
268+
"address_sid": null,
269+
"capabilities": {
270+
"sms": true,
271+
"voice": false
272+
},
273+
"cc_emails": [],
274+
"date_created": "2017-03-28T20:06:39Z",
275+
"date_updated": "2017-03-28T20:06:39Z",
276+
"email": null,
277+
"friendly_name": null,
278+
"incoming_phone_number_sid": "PN11111111111111111111111111111111",
279+
"phone_number": "+14153608311",
280+
"sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
281+
"signing_document_sid": null,
282+
"status": "received",
283+
"unique_name": null,
284+
"url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
285+
"verification_attempts": 0
286+
}
287+
'''
288+
))
289+
290+
actual = self.client.preview.hosted_numbers.hosted_number_orders.create(phone_number="+987654321", iso_country="iso_country", sms_capability=True)
261291

262292
self.assertIsNotNone(actual)

tests/integration/wireless/v1/test_sim.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ def test_fetch_response(self):
5555
"iccid": "iccid",
5656
"e_id": "e_id",
5757
"status": "new",
58-
"url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
58+
"url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
59+
"ip_address": "192.168.1.1"
5960
}
6061
'''
6162
))
@@ -130,7 +131,8 @@ def test_read_full_response(self):
130131
"voice_fallback_url": "http://www.example.com",
131132
"voice_method": "http_method",
132133
"voice_url": "http://www.example.com",
133-
"url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
134+
"url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
135+
"ip_address": "192.168.1.30"
134136
}
135137
],
136138
"meta": {
@@ -191,7 +193,8 @@ def test_update_response(self):
191193
"voice_fallback_url": "http://www.example.com",
192194
"voice_method": "http_method",
193195
"voice_url": "http://www.example.com",
194-
"url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
196+
"url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
197+
"ip_address": "192.168.1.30"
195198
}
196199
'''
197200
))

twilio/rest/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def __init__(self, username=None, password=None, account_sid=None, region=None,
6262
self._notify = None
6363
self._preview = None
6464
self._pricing = None
65+
self._proxy = None
6566
self._taskrouter = None
6667
self._trunking = None
6768
self._video = None
@@ -250,6 +251,19 @@ def pricing(self):
250251
self._pricing = Pricing(self)
251252
return self._pricing
252253

254+
@property
255+
def proxy(self):
256+
"""
257+
Access the Proxy Twilio Domain
258+
259+
:returns: Proxy Twilio Domain
260+
:rtype: twilio.rest.proxy.Proxy
261+
"""
262+
if self._proxy is None:
263+
from twilio.rest.proxy import Proxy
264+
self._proxy = Proxy(self)
265+
return self._proxy
266+
253267
@property
254268
def taskrouter(self):
255269
"""

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

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ def create(self, api_version=values.unset, friendly_name=values.unset,
174174
voice_fallback_method=values.unset, voice_fallback_url=values.unset,
175175
voice_method=values.unset, voice_url=values.unset,
176176
emergency_status=values.unset, e D7AE mergency_address_sid=values.unset,
177-
trunk_sid=values.unset, phone_number=values.unset,
178-
area_code=values.unset):
177+
trunk_sid=values.unset, identity_sid=values.unset,
178+
phone_number=values.unset, area_code=values.unset):
179179
"""
180180
Create a new IncomingPhoneNumberInstance
181181
@@ -197,6 +197,7 @@ def create(self, api_version=values.unset, friendly_name=values.unset,
197197
:param IncomingPhoneNumberInstance.EmergencyStatus emergency_status: The emergency_status
198198
:param unicode emergency_address_sid: The emergency_address_sid
199199
:param unicode trunk_sid: Unique string to identify the trunk
200+
:param unicode identity_sid: Unique string that identifies the identity associated with number
200201
:param unicode phone_number: The phone number
201202
:param unicode area_code: The desired area code for the new number
202203
@@ -224,6 +225,7 @@ def create(self, api_version=values.unset, friendly_name=values.unset,
224225
'EmergencyStatus': emergency_status,
225226
'EmergencyAddressSid': emergency_address_sid,
226227
'TrunkSid': trunk_sid,
228+
'IdentitySid': identity_sid,
227229
})
228230

229231
payload = self._version.create(
@@ -403,7 +405,8 @@ def update(self, account_sid=values.unset, api_version=values.unset,
403405
voice_fallback_method=values.unset, voice_fallback_url=values.unset,
404406
voice_method=values.unset, voice_url=values.unset,
405407
emergency_status=values.unset, emergency_address_sid=values.unset,
406-
trunk_sid=values.unset, voice_receive_mode=values.unset):
408+
trunk_sid=values.unset, voice_receive_mode=values.unset,
409+
identity_sid=values.unset):
407410
"""
408411
Update the IncomingPhoneNumberInstance
409412
@@ -427,6 +430,7 @@ def update(self, account_sid=values.unset, api_version=values.unset,
427430
:param unicode emergency_address_sid: The emergency_address_sid
428431
:param unicode trunk_sid: Unique string to identify the trunk
429432
:param IncomingPhoneNumberInstance.VoiceReceiveMode voice_receive_mode: The voice_receive_mode
433+
:param unicode identity_sid: Unique string that identifies the identity associated with number
430434
431435
:returns: Updated IncomingPhoneNumberInstance
432436
:rtype: twilio.rest.api.v2010.account.incoming_phone_number.IncomingPhoneNumberInstance
@@ -452,6 +456,7 @@ def update(self, account_sid=values.unset, api_version=values.unset,
452456
'EmergencyAddressSid': emergency_address_sid,
453457
'TrunkSid': trunk_sid,
454458
'VoiceReceiveMode': voice_receive_mode,
459+
'IdentitySid': identity_sid,
455460
})
456461

457462
payload = self._version.update(
@@ -561,6 +566,7 @@ def __init__(self, version, payload, account_sid, sid=None):
561566
'date_created': deserialize.rfc2822_datetime(payload['date_created']),
562567
'date_updated': deserialize.rfc2822_datetime(payload['date_updated']),
563568
'friendly_name': payload['friendly_name'],
569+
'identity_sid': payload['identity_sid'],
564570
'phone_number': payload['phone_number'],
565571
'origin': payload['origin'],
566572
'sid': payload['sid'],
@@ -671,6 +677,14 @@ def friendly_name(self):
671677
"""
672678
return self._properties['friendly_name']
673679

680+
@property
681+
def identity_sid(self):
682+
"""
683+
:returns: Unique string that identifies the identity associated with number
684+
:rtype: unicode
685+
"""
686+
return self._properties['identity_sid']
687+
674688
@property
675689
def phone_number(self):
676690
"""
@@ -841,7 +855,8 @@ def update(self, account_sid=values.unset, api_version=values.unset,
841855
voice_fallback_method=values.unset, voice_fallback_url=values.unset,
842856
voice_method=values.unset, voice_url=values.unset,
843857
emergency_status=values.unset, emergency_address_sid=values.unset,
844-
trunk_sid=values.unset, voice_receive_mode=values.unset):
858+
trunk_sid=values.unset, voice_receive_mode=values.unset,
859+
identity_sid=values.unset):
845860
"""
846861
Update the IncomingPhoneNumberInstance
847862
@@ -865,6 +880,7 @@ def update(self, account_sid=values.unset, api_version=values.unset,
865880
:param unicode emergency_address_sid: The emergency_address_sid
866881
:param unicode trunk_sid: Unique string to identify the trunk
867882
:param IncomingPhoneNumberInstance.VoiceReceiveMode voice_receive_mode: The voice_receive_mode
883+
:param unicode identity_sid: Unique string that identifies the identity associated with number
868884
869885
:returns: Updated IncomingPhoneNumberInstance
870886
:rtype: twilio.rest.api.v2010.account.incoming_phone_number.IncomingPhoneNumberInstance
@@ -890,6 +906,7 @@ def update(self, account_sid=values.unset, api_version=values.unset,
890906
emergency_address_sid=emergency_address_sid,
891907
trunk_sid=trunk_sid,
892908
voice_receive_mode=voice_receive_mode,
909+
identity_sid=identity_sid,
893910
)
894911

895912
def fetch(self):

twilio/rest/api/v2010/account/incoming_phone_number/local.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ def create(self, phone_number, api_version=values.unset,
162162
voice_application_sid=values.unset,
163163
voice_caller_id_lookup=values.unset,
164164
voice_fallback_method=values.unset, voice_fallback_url=values.unset,
165-
voice_method=values.unset, voice_url=values.unset):
165+
voice_method=values.unset, voice_url=values.unset,
166+
identity_sid=values.unset):
166167
"""
167168
Create a new LocalInstance
168169
@@ -182,6 +183,7 @@ def create(self, phone_number, api_version=values.unset,
182183
:param unicode voice_fallback_url: The voice_fallback_url
183184
:param unicode voice_method: The voice_method
184185
:param unicode voice_url: The voice_url
186+
:param unicode identity_sid: The identity_sid
185187
186188
:returns: Newly created LocalInstance
187189
:rtype: twilio.rest.api.v2010.account.incoming_phone_number.local.LocalInstance
@@ -203,6 +205,7 @@ def create(self, phone_number, api_version=values.unset,
203205
'VoiceFallbackUrl': voice_fallback_url,
204206
'VoiceMethod': voice_method,
205207
'VoiceUrl': voice_url,
208+
'IdentitySid': identity_sid,
206209
})
207210

208211
payload = self._version.create(
@@ -299,6 +302,7 @@ def __init__(self, version, payload, account_sid):
299302
'date_created': deserialize.rfc2822_datetime(payload['date_created']),
300303
'date_updated': deserialize.rfc2822_datetime(payload['date_updated']),
301304
'friendly_name': payload['friendly_name'],
305+
'identity_sid': payload['identity_sid'],
302306
'phone_number': payload['phone_number'],
303307
'origin': payload['origin'],
304308
'sid': payload['sid'],
@@ -389,6 +393,14 @@ def friendly_name(self):
389393
"""
390394
return self._properties['friendly_name']
391395

396+
@property
397+
def identity_sid(self):
398+
"""
399+
:returns: The identity_sid
400+
:rtype: unicode
401+
"""
402+
return self._properties['identity_sid']
403+
392404
@property
393405
def phone_number(self):
394406
"""

0 commit comments

Comments
 (0)
0