Skip to content

Commit

Permalink
[Librarian] Regenerated @ 6112a581d3189fe96d26eb29eb9adfdbd1c2ada5
Browse files Browse the repository at this point in the history
  • Loading branch information
twilio-dx committed Feb 8, 2023
1 parent cee0dcf commit 3aec618
Show file tree
Hide file tree
Showing 39 changed files with 5,430 additions and 41 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ twilio-python Changelog

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

[2023-02-08] Version 7.16.3
---------------------------
**Lookups**
- Add `disposable_phone_number_risk` package to the lookup response
- Add `sms_pumping_risk` package to the lookup response


[2023-01-25] Version 7.16.2
---------------------------
**Library - Chore**
Expand Down
145 changes: 145 additions & 0 deletions tests/integration/content/v1/test_legacy_content.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# 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 LegacyContentTestCase(IntegrationTestCase):

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

with self.assertRaises(TwilioException):
self.client.content.v1.legacy_contents.list()

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

def test_read_empty_response(self):
self.holodeck.mock(Response(
200,
'''
{
"contents": [],
"meta": {
"page": 0,
"page_size": 10,
"first_page_url": "https://content.twilio.com/v1/LegacyContent?PageSize=10&Page=0",
"previous_page_url": null,
"url": "https://content.twilio.com/v1/LegacyContent?PageSize=10&Page=0",
"next_page_url": null,
"key": "contents"
}
}
'''
))

actual = self.client.content.v1.legacy_contents.list()

self.assertIsNotNone(actual)

def test_read_results_response(self):
self.holodeck.mock(Response(
200,
'''
{
"contents": [
{
"sid": "HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "Some content",
"language": "en",
"variables": {
"name": "foo"
},
"legacy_template_name": "legacy_template_1",
"legacy_body": "a body",
"types": {
"twilio/text": {
"body": "Foo Bar Co is located at 39.7392, 104.9903"
},
"twilio/location": {
"longitude": 104.9903,
"latitude": 39.7392,
"label": "Foo Bar Co"
}
},
"url": "https://content.twilio.com/v1/LegacyContent",
"date_created": "2015-07-30T19:00:00Z",
"date_updated": "2015-07-30T19:00:00Z"
},
{
"sid": "HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "Anotha content",
"language": "en",
"variables": {
"name": "foo"
},
"legacy_template_name": "legacy_template_2",
"legacy_body": "another body",
"types": {
"twilio/text": {
"body": "Foo Bar Co is located at 39.7392, 104.9903"
},
"twilio/location": {
"longitude": 104.9903,
"latitude": 39.7392,
"label": "Foo Bar Co"
}
},
"url": "https://content.twilio.com/v1/LegacyContent",
"date_created": "2015-07-30T19:00:00Z",
"date_updated": "2015-07-30T19:00:00Z"
},
{
"sid": "HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "Third content",
"language": "en",
"variables": {
"name": "foo"
},
"legacy_template_name": "legacy_template_3",
"legacy_body": "a third body",
"types": {
"twilio/text": {
"body": "Foo Bar Co is located at 39.7392, 104.9903"
},
"twilio/location": {
"longitude": 104.9903,
"latitude": 39.7392,
"label": "Foo Bar Co"
}
},
"url": "https://content.twilio.com/v1/LegacyContent",
"date_created": "2015-07-30T19:00:00Z",
"date_updated": "2015-07-30T19:00:00Z"
}
],
"meta": {
"page": 0,
"page_size": 20,
"first_page_url": "https://content.twilio.com/v1/LegacyContent?PageSize=20&Page=0",
"previous_page_url": null,
"url": "https://content.twilio.com/v1/LegacyContent?PageSize=20&Page=0",
"next_page_url": null,
"key": "contents"
}
}
'''
))

actual = self.client.content.v1.legacy_contents.list()

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

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

with self.assertRaises(TwilioException):
self.client.flex_api.v1.insights_assessments_comment.create(category_id="category_id", category_name="category_name", comment="comment", segment_id="segment_id", user_name="user_name", user_email="user_email", agent_id="agent_id", offset="-0.0300", token="token")

values = {
'CategoryId': "category_id",
'CategoryName': "category_name",
'Comment': "comment",
'SegmentId': "segment_id",
'UserName': "user_name",
'UserEmail': "user_email",
'AgentId': "agent_id",
'Offset': "-0.0300",
}

headers = {'Token': "token", }
self.holodeck.assert_has_request(Request(
'post',
'https://flex-api.twilio.com/v1/Insights/QM/Assessments/Comments',
headers=headers,
))
self.holodeck.assert_has_request(Request(
'post',
'https://flex-api.twilio.com/v1/Insights/QM/Assessments/Comments',
data=values,
))

def test_create_response(self):
self.holodeck.mock(Response(
201,
'''
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"assessment_id": "123",
"offset": "0.0",
"report": true,
"weight": "1",
"agent_id": "5d80ee80-7608-55df-b2b2-5ab5608b9831",
"segment_id": "0105be7a-9b87-51f1-8df8-aa74ddb9c4a7",
"user_name": "Linda Houghton",
"user_email": "[email protected]",
"timestamp": "1657329694199",
"comment": {
"comment": "log0zu0268",
"category": {
"category_id": "c9ba34ca-7174-4dcd-ab3e-91fbb1932f1e",
"name": "Good for Training"
}
},
"url": "https://flex-api.twilio.com/v1/Insights/QM/Assessments/Comments/123"
}
'''
))

actual = self.client.flex_api.v1.insights_assessments_comment.create(category_id="category_id", category_name="category_name", comment="comment", segment_id="segment_id", user_name="user_name", user_email="user_email", agent_id="agent_id", offset="-0.0300")

self.assertIsNotNone(actual)

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

with self.assertRaises(TwilioException):
self.client.flex_api.v1.insights_assessments_comment.list(token="token")

headers = {'Token': "token", }
self.holodeck.assert_has_request(Request(
'get',
'https://flex-api.twilio.com/v1/Insights/QM/Assessments/Comments',
headers=headers,
))

def test_read_by_segment_id_response(self):
self.holodeck.mock(Response(
200,
'''
{
"comments": [
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"assessment_id": "123",
"offset": "0.0",
"report": true,
"weight": "1",
"agent_id": "5d80ee80-7608-55df-b2b2-5ab5608b9831",
"segment_id": "0105be7a-9b87-51f1-8df8-aa74ddb9c4a7",
"user_name": "Linda Houghton",
"user_email": "[email protected]",
"timestamp": "1657329694199",
"comment": {
"comment": "log0zu0268",
"category": {
"category_id": "c9ba34ca-7174-4dcd-ab3e-91fbb1932f1e",
"name": "Good for Training"
}
},
"url": "https://flex-api.twilio.com/v1/Insights/QM/Assessments/Comments/123"
}
],
"meta": {
"first_page_url": "https://flex-api.twilio.com/v1/Insights/QM/Assessments/Comments?SegmentId=0105be7a-9b87-51f1-8df8-aa74ddb9c4a7&PageSize=50&Page=0",
"key": "comments",
"next_page_url": null,
"page": 0,
"page_size": 50,
"previous_page_url": null,
"url": "https://flex-api.twilio.com/v1/Insights/QM/Assessments/Comments?SegmentId=0105be7a-9b87-51f1-8df8-aa74ddb9c4a7&PageSize=50&Page=0"
}
}
'''
))

actual = self.client.flex_api.v1.insights_assessments_comment.list()

self.assertIsNotNone(actual)

def test_read_by_agent_id_response(self):
self.holodeck.mock(Response(
200,
'''
{
"comments": [
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"assessment_id": "123",
"offset": "0.0",
"report": true,
"weight": "1",
"agent_id": "5d80ee80-7608-55df-b2b2-5ab5608b9831",
"segment_id": "0105be7a-9b87-51f1-8df8-aa74ddb9c4a7",
"user_name": "Linda Houghton",
"user_email": "[email protected]",
"timestamp": "1657329694199",
"comment": {
"comment": "log0zu0268",
"category": {
"category_id": "c9ba34ca-7174-4dcd-ab3e-91fbb1932f1e",
"name": "Good for Training"
}
},
"url": "https://flex-api.twilio.com/v1/Insights/QM/Assessments/Comments/123"
}
],
"meta": {
"first_page_url": "https://flex-api.twilio.com/v1/Insights/QM/Assessments/Comments?AgentId=5d80ee80-7608-55df-b2b2-5ab5608b9831&PageSize=50&Page=0",
"key": "comments",
"next_page_url": null,
"page": 0,
"page_size": 50,
"previous_page_url": null,
"url": "https://flex-api.twilio.com/v1/Insights/QM/Assessments/Comments?AgentId=5d80ee80-7608-55df-b2b2-5ab5608b9831&PageSize=50&Page=0"
}
}
'''
))

actual = self.client.flex_api.v1.insights_assessments_comment.list()

self.assertIsNotNone(actual)

def test_read_empty_response(self):
self.holodeck.mock(Response(
200,
'''
{
"comments": [],
"meta": {
"first_page_url": "https://flex-api.twilio.com/v1/Insights/QM/Assessments/Comments?SegmentId=0105be7a-9b87-51f1-8df8-aa74ddb9c4a7&PageSize=50&Page=0",
"key": "comments",
"next_page_url": null,
"page": 0,
"page_size": 50,
"previous_page_url": null,
"url": "https://flex-api.twilio.com/v1/Insights/QM/Assessments/Comments?SegmentId=0105be7a-9b87-51f1-8df8-aa74ddb9c4a7&PageSize=50&Page=0"
}
}
'''
))

actual = self.client.flex_api.v1.insights_assessments_comment.list()

self.assertIsNotNone(actual)
Loading

0 comments on commit 3aec618

Please sign in to comment.