Skip to content

Commit

Permalink
[Librarian] Regenerated @ 964f1611ab7481d828261f49551385a276499e30
Browse files Browse the repository at this point in the history
  • Loading branch information
twilio-dx committed Dec 14, 2022
1 parent c9b385b commit 9b57e31
Show file tree
Hide file tree
Showing 28 changed files with 763 additions and 87 deletions.
42 changes: 42 additions & 0 deletions CHANGES.md
Expand Up @@ -3,6 +3,48 @@ twilio-python Changelog

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

[2022-12-14] Version 7.16.0
---------------------------
**Library - Docs**
- [PR #631](https://github.com/twilio/twilio-python/pull/631): Updated docstrings for timeout to be float instead of int. Thanks to [@byarmis](https://github.com/byarmis)!

**Library - Chore**
- [PR #627](https://github.com/twilio/twilio-python/pull/627): add support for python 3.11. Thanks to [@JenniferMah](https://github.com/JenniferMah)!

**Library - Test**
- [PR #628](https://github.com/twilio/twilio-python/pull/628): Pinning ubuntu version for python 3.6 test runs. Thanks to [@rakatyal](https://github.com/rakatyal)!

**Api**
- Add `street_secondary` param to address create and update
- Make `method` optional for user defined message subscription **(breaking change)**

**Flex**
- Flex Conversations is now Generally Available
- Adding the ie1 mapping for authorization api, updating service base uri and base url response attribute **(breaking change)**
- Change web channels to GA and library visibility to public
- Changing the uri for authorization api from using Accounts to Insights **(breaking change)**

**Media**
- Gate Twilio Live endpoints behind beta_feature for EOS

**Messaging**
- Mark `MessageFlow` as a required field for Campaign Creation **(breaking change)**

**Oauth**
- updated openid discovery endpoint uri **(breaking change)**
- Added device code authorization endpoint

**Supersim**
- Allow filtering the SettingsUpdates resource by `status`

**Twiml**
- Add new Polly Neural voices
- Add tr-TR, ar-AE, yue-CN, fi-FI languages to SSML `<lang>` element.
- Add x-amazon-jyutping, x-amazon-pinyin, x-amazon-pron-kana, x-amazon-yomigana alphabets to SSML `<phoneme>` element.
- Rename `character` value for SSML `<say-as>` `interpret-as` attribute to `characters`. **(breaking change)**
- Rename `role` attribute to `format` in SSML `<say-as>` element. **(breaking change)**


[2022-11-30] Version 7.15.4
---------------------------
**Flex**
Expand Down
Expand Up @@ -20,9 +20,9 @@ def test_create_request(self):
with self.assertRaises(TwilioException):
self.client.api.v2010.accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.calls("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.user_defined_message_subscriptions.create(callback="https://example.com", method="GET")
.user_defined_message_subscriptions.create(callback="https://example.com")

values = {'Callback': "https://example.com", 'Method': "GET", }
values = {'Callback': "https://example.com", }

self.holodeck.assert_has_request(Request(
'post',
Expand All @@ -46,7 +46,7 @@ def test_create_response(self):

actual = self.client.api.v2010.accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.calls("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.user_defined_message_subscriptions.create(callback="https://example.com", method="GET")
.user_defined_message_subscriptions.create(callback="https://example.com")

self.assertIsNotNone(actual)

Expand Down
4 changes: 4 additions & 0 deletions tests/integration/api/v2010/account/test_address.py
Expand Up @@ -53,6 +53,7 @@ def test_create_response(self):
"region": "CA",
"sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"street": "4th",
"street_secondary": null,
"validated": false,
"verified": false,
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
Expand Down Expand Up @@ -117,6 +118,7 @@ def test_fetch_response(self):
"region": "CA",
"sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"street": "4th",
"street_secondary": null,
"validated": false,
"verified": false,
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
Expand Down Expand Up @@ -158,6 +160,7 @@ def test_update_response(self):
"region": "CA",
"sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"street": "4th",
"street_secondary": null,
"validated": false,
"verified": false,
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
Expand Down Expand Up @@ -201,6 +204,7 @@ def test_read_full_response(self):
"region": "CA",
"sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"street": "4th",
"street_secondary": null,
"validated": false,
"verified": false,
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/flex_api/v1/test_good_data.py
Expand Up @@ -23,7 +23,7 @@ def test_create_request(self):
headers = {'Token': "token", }
self.holodeck.assert_has_request(Request(
'post',
'https://flex-api.twilio.com/v1/Accounts/GoodData',
'https://flex-api.twilio.com/v1/Insights/Session',
headers=headers,
))

Expand All @@ -35,8 +35,8 @@ def test_create_response(self):
"session_expiry": "2022-09-27T09:28:01Z",
"workspace_id": "clbi1eelh1x8z4.......ijpnyu",
"session_id": "-----BEGIN PGP MESSAGE-----\\n\\nwcBMA11tX1FL13rp\\u2026\\u2026kHXd\\n=vOBk\\n-----END PGP MESSAGE-----\\n",
"gd_base_url": "https://analytics.ytica.com/",
"url": "https://flex-api.twilio.com/v1/Accounts/GoodData"
"base_url": "https://analytics.ytica.com/",
"url": "https://flex-api.twilio.com/v1/Insights/Session"
}
'''
))
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/flex_api/v1/test_user_roles.py
Expand Up @@ -23,7 +23,7 @@ def test_fetch_request(self):
headers = {'Token': "token", }
self.holodeck.assert_has_request(Request(
'get',
'https://flex-api.twilio.com/v1/Accounts/UserRoles',
'https://flex-api.twilio.com/v1/Insights/UserRoles',
headers=headers,
))

Expand All @@ -35,7 +35,7 @@ def test_fetch_response(self):
"roles": [
"wfo.full_access"
],
"url": "https://flex-api.twilio.com/v1/Accounts/UserRoles"
"url": "https://flex-api.twilio.com/v1/Insights/UserRoles"
}
'''
))
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/flex_api/v2/__init__.py
@@ -0,0 +1,8 @@
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""

44 changes: 44 additions & 0 deletions tests/integration/flex_api/v2/test_web_channels.py
@@ -0,0 +1,44 @@
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""

from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response


class WebChannelsTestCase(IntegrationTestCase):

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

with self.assertRaises(TwilioException):
self.client.flex_api.v2.web_channels.create(address_sid="address_sid")

values = {'AddressSid': "address_sid", }

self.holodeck.assert_has_request(Request(
'post',
'https://flex-api.twilio.com/v2/WebChats',
data=values,
))

def test_create_response(self):
self.holodeck.mock(Response(
201,
'''
{
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"identity": "seinfeld"
}
'''
))

actual = self.client.flex_api.v2.web_channels.create(address_sid="address_sid")

self.assertIsNotNone(actual)
Expand Up @@ -20,11 +20,12 @@ def test_create_request(self):

with self.assertRaises(TwilioException):
self.client.messaging.v1.services("MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.us_app_to_person.create(brand_registration_sid="BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", description="description", message_samples=['message_samples'], us_app_to_person_usecase="us_app_to_person_usecase", has_embedded_links=True, has_embedded_phone=True)
.us_app_to_person.create(brand_registration_sid="BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", description="description", message_flow="message_flow", message_samples=['message_samples'], us_app_to_person_usecase="us_app_to_person_usecase", has_embedded_links=True, has_embedded_phone=True)

values = {
'BrandRegistrationSid': "BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
'Description': "description",
'MessageFlow': "message_flow",
'MessageSamples': serialize.map(['message_samples'], lambda e: e),
'UsAppToPersonUsecase': "us_app_to_person_usecase",
'HasEmbeddedLinks': True,
Expand Down Expand Up @@ -88,7 +89,7 @@ def test_create_response(self):
))

actual = self.client.messaging.v1.services("MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.us_app_to_person.create(brand_registration_sid="BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", description="description", message_samples=['message_samples'], us_app_to_person_usecase="us_app_to_person_usecase", has_embedded_links=True, has_embedded_phone=True)
.us_app_to_person.create(brand_registration_sid="BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", description="description", message_flow="message_flow", message_samples=['message_samples'], us_app_to_person_usecase="us_app_to_person_usecase", has_embedded_links=True, has_embedded_phone=True)

self.assertIsNotNone(actual)

Expand Down Expand Up @@ -149,7 +150,7 @@ def test_create_with_defaults_response(self):
))

actual = self.client.messaging.v1.services("MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.us_app_to_person.create(brand_registration_sid="BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", description="description", message_samples=['message_samples'], us_app_to_person_usecase="us_app_to_person_usecase", has_embedded_links=True, has_embedded_phone=True)
.us_app_to_person.create(brand_registration_sid="BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", description="description", message_flow="message_flow", message_samples=['message_samples'], us_app_to_person_usecase="us_app_to_person_usecase", has_embedded_links=True, has_embedded_phone=True)

self.assertIsNotNone(actual)

Expand Down
3 changes: 3 additions & 0 deletions tests/integration/microvisor/v1/test_device.py
Expand Up @@ -75,6 +75,7 @@ def test_read_full_response(self):
"date_updated": "2021-01-01T12:34:56Z",
"url": "https://microvisor.twilio.com/v1/Devices/UVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"device_configs": "https://microvisor.twilio.com/v1/Devices/UVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configs",
"device_secrets": "https://microvisor.twilio.com/v1/Devices/UVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Secrets"
}
}
Expand Down Expand Up @@ -132,6 +133,7 @@ def test_fetch_response(self):
"date_updated": "2021-01-01T12:34:56Z",
"url": "https://microvisor.twilio.com/v1/Devices/UVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"device_configs": "https://microvisor.twilio.com/v1/Devices/UVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configs",
"device_secrets": "https://microvisor.twilio.com/v1/Devices/UVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Secrets"
}
}
Expand Down Expand Up @@ -178,6 +180,7 @@ def test_update_response(self):
"date_updated": "2015-07-30T20:00:00Z",
"url": "https://microvisor.twilio.com/v1/Devices/UVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"device_configs": "https://microvisor.twilio.com/v1/Devices/UVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configs",
"device_secrets": "https://microvisor.twilio.com/v1/Devices/UVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Secrets"
}
}
Expand Down
49 changes: 49 additions & 0 deletions tests/integration/oauth/v1/test_device_code.py
@@ -0,0 +1,49 @@
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""

from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base import serialize
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response


class DeviceCodeTestCase(IntegrationTestCase):

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

with self.assertRaises(TwilioException):
self.client.oauth.v1.device_code.create(client_sid="client_sid", scopes=['scopes'])

values = {'ClientSid': "client_sid", 'Scopes': serialize.map(['scopes'], lambda e: e), }

self.holodeck.assert_has_request(Request(
'post',
'https://oauth.twilio.com/v1/device/code',
data=values,
))

def test_create_response(self):
self.holodeck.mock(Response(
201,
'''
{
"device_code": "LiwuhE0bIhqemK6sd34tXfobVCR9yrk0",
"user_code": "Hkf1WaID3",
"verification_uri": "v1/oauth2/device/activate",
"verification_uri_complete": "v1/oauth2/device/activate?user_code=Hkf1WaID3",
"expires_in": 299,
"interval": 5
}
'''
))

actual = self.client.oauth.v1.device_code.create(client_sid="client_sid", scopes=['scopes'])

self.assertIsNotNone(actual)
4 changes: 2 additions & 2 deletions tests/integration/oauth/v1/test_openid_discovery.py
Expand Up @@ -22,7 +22,7 @@ def test_fetch_request(self):

self.holodeck.assert_has_request(Request(
'get',
'https://oauth.twilio.com/v1/well-known/openid-configuration',
'https://oauth.twilio.com/v1/.well-known/openid-configuration',
))

def test_fetch_response(self):
Expand Down Expand Up @@ -67,7 +67,7 @@ def test_fetch_response(self):
"scp",
"sub"
],
"url": "https://oauth.twilio.com/v1/well-known/openid-configuration"
"url": "https://oauth.twilio.com/v1/.well-known/openid-configuration"
}
'''
))
Expand Down

0 comments on commit 9b57e31

Please sign in to comment.