Skip to content

Commit

Permalink
[Librarian] Regenerated @ 9419ae9766a1f3421c32308ef0a457ca0c0248fd
Browse files Browse the repository at this point in the history
  • Loading branch information
twilio-dx committed Aug 24, 2022
1 parent 91c0ab9 commit cd8cc60
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 189 deletions.
16 changes: 16 additions & 0 deletions CHANGES.md
Expand Up @@ -3,6 +3,22 @@ twilio-python Changelog

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

[2022-08-24] Version 7.13.0
---------------------------
**Library - Test**
- [PR #614](https://github.com/twilio/twilio-python/pull/614): add test-docker rule. Thanks to [@beebzz](https://github.com/beebzz)!

**Api**
- Remove `beta feature` from scheduling params and remove optimize parameters. **(breaking change)**

**Routes**
- Remove Duplicate Create Method - Update Method will work even if Inbound Processing Region is currently empty/404. **(breaking change)**

**Twiml**
- Add new Polly Neural voices
- Add new languages to SSML `<lang>`.


[2022-08-10] Version 7.12.1
---------------------------
**Routes**
Expand Down
39 changes: 2 additions & 37 deletions tests/integration/routes/v2/test_phone_number.py
Expand Up @@ -14,50 +14,15 @@

class PhoneNumberTestCase(IntegrationTestCase):

def test_create_request(self):
self.holodeck.mock(Response(500, ''))

with self.assertRaises(TwilioException):
self.client.routes.v2.phone_numbers("phone_number").create()

self.holodeck.assert_has_request(Request(
'post',
'https://routes.twilio.com/v2/PhoneNumbers/phone_number',
))

def test_create_response(self):
self.holodeck.mock(Response(
201,
'''
{
"phone_number": "+18001234567",
"url": "https://routes.twilio.com/v2/PhoneNumbers/+18001234567",
"sid": "QQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "friendly_name",
"voice_region": "au1",
"date_created": "2015-07-30T20:00:00Z",
"date_updated": "2015-07-30T20:00:00Z"
}
'''
))

actual = self.client.routes.v2.phone_numbers("phone_number").create()

self.assertIsNotNone(actual)

def test_update_request(self):
self.holodeck.mock(Response(500, ''))

with self.assertRaises(TwilioException):
self.client.routes.v2.phone_numbers("phone_number").update(voice_region="voice_region", friendly_name="friendly_name")

values = {'VoiceRegion': "voice_region", 'FriendlyName': "friendly_name", }
self.client.routes.v2.phone_numbers("phone_number").update()

self.holodeck.assert_has_request(Request(
'post',
'https://routes.twilio.com/v2/PhoneNumbers/phone_number',
data=values,
))

def test_update_response(self):
Expand All @@ -77,7 +42,7 @@ def test_update_response(self):
'''
))

actual = self.client.routes.v2.phone_numbers("phone_number").update(voice_region="voice_region", friendly_name="friendly_name")
actual = self.client.routes.v2.phone_numbers("phone_number").update()

self.assertIsNotNone(actual)

Expand Down
32 changes: 0 additions & 32 deletions tests/integration/routes/v2/test_sip_domain.py
Expand Up @@ -14,38 +14,6 @@

class SipDomainTestCase(IntegrationTestCase):

def test_create_request(self):
self.holodeck.mock(Response(500, ''))

with self.assertRaises(TwilioException):
self.client.routes.v2.sip_domains("sip_domain").create()

self.holodeck.assert_has_request(Request(
'post',
'https://routes.twilio.com/v2/SipDomains/sip_domain',
))

def test_create_response(self):
self.holodeck.mock(Response(
201,
'''
{
"url": "https://routes.twilio.com/v2/SipDomains/test.sip.twilio.com",
"sip_domain": "test.sip.twilio.com",
"sid": "QQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "friendly_name",
"voice_region": "au1",
"date_created": "2020-08-07T22:29:24Z",
"date_updated": "2020-08-07T22:29:24Z"
}
'''
))

actual = self.client.routes.v2.sip_domains("sip_domain").create()

self.assertIsNotNone(actual)

def test_update_request(self):
self.holodeck.mock(Response(500, ''))

Expand Down
32 changes: 0 additions & 32 deletions tests/integration/routes/v2/test_trunk.py
Expand Up @@ -14,38 +14,6 @@

class TrunkTestCase(IntegrationTestCase):

def test_create_request(self):
self.holodeck.mock(Response(500, ''))

with self.assertRaises(TwilioException):
self.client.routes.v2.trunks("sip_trunk_domain").create()

self.holodeck.assert_has_request(Request(
'post',
'https://routes.twilio.com/v2/Trunks/sip_trunk_domain',
))

def test_create_response(self):
self.holodeck.mock(Response(
201,
'''
{
"sip_trunk_domain": "test.pstn.twilio.com",
"url": "https://routes.twilio.com/v2/Trunks/test.pstn.twilio.com",
"sid": "QQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "friendly_name",
"voice_region": "au1",
"date_created": "2020-08-07T22:29:24Z",
"date_updated": "2020-08-07T22:29:24Z"
}
'''
))

actual = self.client.routes.v2.trunks("sip_trunk_domain").create()

self.assertIsNotNone(actual)

def test_update_request(self):
self.holodeck.mock(Response(500, ''))

Expand Down
34 changes: 3 additions & 31 deletions twilio/rest/routes/v2/phone_number.py
Expand Up @@ -118,23 +118,7 @@ def __init__(self, version, phone_number):
self._solution = {'phone_number': phone_number, }
self._uri = '/PhoneNumbers/{phone_number}'.format(**self._solution)

def create(self, voice_region=values.unset, friendly_name=values.unset):
"""
Create the PhoneNumberInstance
:param unicode voice_region: The Inbound Processing Region used for this phone number for voice
:param unicode friendly_name: A human readable description of this resource.
:returns: The created PhoneNumberInstance
:rtype: twilio.rest.routes.v2.phone_number.PhoneNumberInstance
"""
data = values.of({'VoiceRegion': voice_region, 'FriendlyName': friendly_name, })

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

return PhoneNumberInstance(self._version, payload, phone_number=self._solution['phone_number'], )

def update(self, voice_region, friendly_name):
def update(self, voice_region=values.unset, friendly_name=values.unset):
"""
Update the PhoneNumberInstance
Expand Down Expand Up @@ -276,19 +260,7 @@ def date_updated(self):
"""
return self._properties['date_updated']

def create(self, voice_region=values.unset, friendly_name=values.unset):
"""
Create the PhoneNumberInstance
:param unicode voice_region: The Inbound Processing Region used for this phone number for voice
:param unicode friendly_name: A human readable description of this resource.
:returns: The created PhoneNumberInstance
:rtype: twilio.rest.routes.v2.phone_number.PhoneNumberInstance
"""
return self._proxy.create(voice_region=voice_region, friendly_name=friendly_name, )

def update(self, voice_region, friendly_name):
def update(self, voice_region=values.unset, friendly_name=values.unset):
"""
Update the PhoneNumberInstance
Expand All @@ -298,7 +270,7 @@ def update(self, voice_region, friendly_name):
:returns: The updated PhoneNumberInstance
:rtype: twilio.rest.routes.v2.phone_number.PhoneNumberInstance
"""
return self._proxy.update(voice_region, friendly_name, )
return self._proxy.update(voice_region=voice_region, friendly_name=friendly_name, )

def fetch(self):
"""
Expand Down
28 changes: 0 additions & 28 deletions twilio/rest/routes/v2/sip_domain.py
Expand Up @@ -118,22 +118,6 @@ def __init__(self, version, sip_domain):
self._solution = {'sip_domain': sip_domain, }
self._uri = '/SipDomains/{sip_domain}'.format(**self._solution)

def create(self, voice_region=values.unset, friendly_name=values.unset):
"""
Create the SipDomainInstance
:param unicode voice_region: The voice_region
:param unicode friendly_name: The friendly_name
:returns: The created SipDomainInstance
:rtype: twilio.rest.routes.v2.sip_domain.SipDomainInstance
"""
data = values.of({'VoiceRegion': voice_region, 'FriendlyName': friendly_name, })

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

return SipDomainInstance(self._version, payload, sip_domain=self._solution['sip_domain'], )

def update(self, voice_region=values.unset, friendly_name=values.unset):
"""
Update the SipDomainInstance
Expand Down Expand Up @@ -276,18 +260,6 @@ def date_updated(self):
"""
return self._properties['date_updated']

def create(self, voice_region=values.unset, friendly_name=values.unset):
"""
Create the SipDomainInstance
:param unicode voice_region: The voice_region
:param unicode friendly_name: The friendly_name
:returns: The created SipDomainInstance
:rtype: twilio.rest.routes.v2.sip_domain.SipDomainInstance
"""
return self._proxy.create(voice_region=voice_region, friendly_name=friendly_name, )

def update(self, voice_region=values.unset, friendly_name=values.unset):
"""
Update the SipDomainInstance
Expand Down
28 changes: 0 additions & 28 deletions twilio/rest/routes/v2/trunk.py
Expand Up @@ -118,22 +118,6 @@ def __init__(self, version, sip_trunk_domain):
self._solution = {'sip_trunk_domain': sip_trunk_domain, }
self._uri = '/Trunks/{sip_trunk_domain}'.format(**self._solution)

def create(self, voice_region=values.unset, friendly_name=values.unset):
"""
Create the TrunkInstance
:param unicode voice_region: The Inbound Processing Region used for this SIP Trunk for voice
:param unicode friendly_name: A human readable description of this resource.
:returns: The created TrunkInstance
:rtype: twilio.rest.routes.v2.trunk.TrunkInstance
"""
data = values.of({'VoiceRegion': voice_region, 'FriendlyName': friendly_name, })

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

return TrunkInstance(self._version, payload, sip_trunk_domain=self._solution['sip_trunk_domain'], )

def update(self, voice_region=values.unset, friendly_name=values.unset):
"""
Update the TrunkInstance
Expand Down Expand Up @@ -276,18 +260,6 @@ def date_updated(self):
"""
return self._properties['date_updated']

def create(self, voice_region=values.unset, friendly_name=values.unset):
"""
Create the TrunkInstance
:param unicode voice_region: The Inbound Processing Region used for this SIP Trunk for voice
:param unicode friendly_name: A human readable description of this resource.
:returns: The created TrunkInstance
:rtype: twilio.rest.routes.v2.trunk.TrunkInstance
"""
return self._proxy.create(voice_region=voice_region, friendly_name=friendly_name, )

def update(self, voice_region=values.unset, friendly_name=values.unset):
"""
Update the TrunkInstance
Expand Down
2 changes: 1 addition & 1 deletion twilio/rest/verify/v2/service/verification.py
Expand Up @@ -48,7 +48,7 @@ def create(self, to, channel, custom_friendly_name=values.unset,
:param unicode custom_friendly_name: A custom user defined friendly name
:param unicode custom_message: The text of a custom message to use for the verification
:param unicode send_digits: The digits to send after a phone call is answered
:param unicode locale: The locale to use for the verification SMS, WhatsApp or call
:param unicode locale: The override locale to use for the verification SMS, WhatsApp or call
:param unicode custom_code: A pre-generated code
:param unicode amount: The amount of the associated PSD2 compliant transaction.
:param unicode payee: The payee of the associated PSD2 compliant transaction
Expand Down

0 comments on commit cd8cc60

Please sign in to comment.