Skip to content

Commit

Permalink
[Librarian] Regenerated @ 1f092ba9afa4c22854ac65f8a1af7e63b84aae2a
Browse files Browse the repository at this point in the history
  • Loading branch information
twilio-dx committed Oct 19, 2022
1 parent caa9c42 commit f9e142e
Show file tree
Hide file tree
Showing 30 changed files with 1,758 additions and 60 deletions.
22 changes: 22 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@ twilio-python Changelog

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

[2022-10-19] Version 7.15.0
---------------------------
**Api**
- Make link shortening parameters public **(breaking change)**

**Oauth**
- added oauth JWKS endpoint
- Get userinfo resource
- OpenID discovery resource
- Add new API for token endpoint

**Supersim**
- Add SettingsUpdates resource

**Verify**
- Update Verify Push endpoints to `ga` maturity
- Verify BYOT add Channels property to the Get Templates response

**Twiml**
- Add `requireMatchingInputs` attribute and `input-matching-failed` errorType to `<Prompt>`


[2022-10-05] Version 7.14.2
---------------------------
**Api**
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/oauth/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""

8 changes: 8 additions & 0 deletions tests/integration/oauth/v1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""

52 changes: 52 additions & 0 deletions tests/integration/oauth/v1/test_oauth.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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 OauthTestCase(IntegrationTestCase):

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

with self.assertRaises(TwilioException):
self.client.oauth.v1.oauth().fetch()

self.holodeck.assert_has_request(Request(
'get',
'https://oauth.twilio.com/v1/certs',
))

def test_fetch_response(self):
self.holodeck.mock(Response(
200,
'''
{
"keys": [
{
"alg": "ES256",
"kid": "IC10c8172f35dd36f20d9ed2fcc0b818c7",
"key_ops": [],
"use": "sig",
"crv": "P-256",
"x": "hrJ4NKauVYBiREgIY_EPPj10zHIiOHeIf3-LGODt_KM",
"y": "c3IcyhpvfMIMpqd_ku9Q_4n20nMlelUF-zSmRXEIFEU",
"kty": "EC"
}
],
"url": "https://oauth.twilio.com/v1/certs"
}
'''
))

actual = self.client.oauth.v1.oauth().fetch()

self.assertIsNotNone(actual)
77 changes: 77 additions & 0 deletions tests/integration/oauth/v1/test_openid_discovery.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# 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 OpenidDiscoveryTestCase(IntegrationTestCase):

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

with self.assertRaises(TwilioException):
self.client.oauth.v1.openid_discovery().fetch()

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

def test_fetch_response(self):
self.holodeck.mock(Response(
200,
'''
{
"issuer": "https://iam.twilio.com",
"authorization_endpoint": "https://oauth.twilio.com/oauth2/authorize",
"device_authorization_endpoint": "https://oauth.twilio.com/oauth2/device/authorize",
"token_endpoint": "https://oauth.twilio.com/oauth2/token",
"userinfo_endpoint": "https://oauth.twilio.com/oauth2/userinfo",
"revocation_endpoint": "https://oauth.twilio.com/oauth2/revoke",
"jwk_uri": "https://oauth.twilio.com/oauth2/certs",
"response_type_supported": [
"code",
"token"
],
"subject_type_supported": [
"account_sid",
"user_sid"
],
"id_token_signing_alg_values_supported": [
"ECDSA",
"RSA256"
],
"scopes_supported": [
"openid",
"profile",
"email"
],
"claims_supported": [
"act",
"aud",
"cid",
"device_id",
"exp",
"jti",
"iat",
"iss",
"nbf",
"scp",
"sub"
],
"url": "https://oauth.twilio.com/v1/well-known/openid-configuration"
}
'''
))

actual = self.client.oauth.v1.openid_discovery().fetch()

self.assertIsNotNone(actual)
47 changes: 47 additions & 0 deletions tests/integration/oauth/v1/test_token.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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 TokenTestCase(IntegrationTestCase):

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

with self.assertRaises(TwilioException):
self.client.oauth.v1.token.create(grant_type="grant_type", client_sid="client_sid")

values = {'GrantType': "grant_type", 'ClientSid': "client_sid", }

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

def test_create_response(self):
self.holodeck.mock(Response(
201,
'''
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"refresh_token": "ghjbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"id_token": "eyJhbdGciOiIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"refresh_token_expires_at": "2015-07-31T04:00:00Z",
"access_token_expires_at": "2015-07-31T04:00:00Z"
}
'''
))

actual = self.client.oauth.v1.token.create(grant_type="grant_type", client_sid="client_sid")

self.assertIsNotNone(actual)
45 changes: 45 additions & 0 deletions tests/integration/oauth/v1/test_user_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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 UserInfoTestCase(IntegrationTestCase):

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

with self.assertRaises(TwilioException):
self.client.oauth.v1.user_info().fetch()

self.holodeck.assert_has_request(Request(
'get',
'https://oauth.twilio.com/v1/userinfo',
))

def test_fetch_response(self):
self.holodeck.mock(Response(
200,
'''
{
"user_sid": "US57cc2449f1b38ed85cf1a43cd8166349",
"first_name": "Mafalda",
"last_name": "Rolfson",
"friendly_name": "mafalda.rolfson+oBgz@ct.sink.twilio.com",
"email": "mafalda.rolfson+oBgz@ct.sink.twilio.com",
"url": "https://oauth.twilio.com/v1/userinfo"
}
'''
))

actual = self.client.oauth.v1.user_info().fetch()

self.assertIsNotNone(actual)
90 changes: 90 additions & 0 deletions tests/integration/supersim/v1/test_settings_update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# 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 SettingsUpdateTestCase(IntegrationTestCase):

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

with self.assertRaises(TwilioException):
self.client.supersim.v1.settings_updates.list()

self.holodeck.assert_has_request(Request(
'get',
'https://supersim.twilio.com/v1/SettingsUpdates',
))

def test_read_empty_response(self):
self.holodeck.mock(Response(
200,
'''
{
"settings_updates": [],
"meta": {
"page": 0,
"page_size": 50,
"first_page_url": "https://supersim.twilio.com/v1/SettingsUpdates?Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
"previous_page_url": null,
"url": "https://supersim.twilio.com/v1/SettingsUpdates?Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
"next_page_url": null,
"key": "settings_updates"
}
}
'''
))

actual = self.client.supersim.v1.settings_updates.list()

self.assertIsNotNone(actual)

def test_read_full_response(self):
self.holodeck.mock(Response(
200,
'''
{
"settings_updates": [
{
"sid": "OBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"iccid": "89883070000123456789",
"sim_sid": "HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"status": "scheduled",
"packages": [
{
"sid": "OVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"name": "base-settings",
"version": "1.0.0",
"more_info": "https://twilio.com/docs/iot/supersim/settings-packages/base-settings"
}
],
"date_completed": "2015-07-30T20:00:00Z",
"date_created": "2015-07-30T20:00:00Z",
"date_updated": "2015-07-30T20:00:00Z"
}
],
"meta": {
"page": 0,
"page_size": 50,
"first_page_url": "https://supersim.twilio.com/v1/SettingsUpdates?Sim=1234567890123456789&PageSize=50&Page=0",
"previous_page_url": null,
"url": "https://supersim.twilio.com/v1/SettingsUpdates?Sim=1234567890123456789&PageSize=50&Page=0",
"next_page_url": null,
"key": "settings_updates"
}
}
'''
))

actual = self.client.supersim.v1.settings_updates.list()

self.assertIsNotNone(actual)
3 changes: 3 additions & 0 deletions tests/integration/verify/v2/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def test_list_verification_templates_response(self):
"sid": "HJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "Base Verification Template 2 with do not share",
"channels": [
"sms"
],
"translations": {
"en": {
"is_default_translation": true,
Expand Down
Loading

0 comments on commit f9e142e

Please sign in to comment.