Skip to content

Commit

Permalink
[Librarian] Regenerated @ c95de69ef589811189089c789616f1b139c1ae3e
Browse files Browse the repository at this point in the history
  • Loading branch information
twilio-dx committed May 5, 2021
1 parent 13fb2ed commit 4567b23
Show file tree
Hide file tree
Showing 22 changed files with 335 additions and 162 deletions.
20 changes: 20 additions & 0 deletions CHANGES.md
Expand Up @@ -3,6 +3,26 @@ twilio-python Changelog

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

[2021-05-05] Version 6.58.0
---------------------------
**Api**
- Corrected the data types for feedback summary fields **(breaking change)**
- Update the conference participant create `from` and `to` param to be endpoint type for supporting client identifier and sip address

**Bulkexports**
- promoting API maturity to GA

**Events**
- Add endpoint to update description in sink
- Remove beta-feature account flag

**Messaging**
- Update `status` field in us_app_to_person api to `campaign_status` **(breaking change)**

**Verify**
- Improve documentation regarding `push` factor and include extra information about `totp` factor.


[2021-04-21] Version 6.57.0
---------------------------
**Api**
Expand Down
46 changes: 21 additions & 25 deletions tests/integration/api/v2010/account/call/test_feedback.py
Expand Up @@ -14,25 +14,22 @@

class FeedbackTestCase(IntegrationTestCase):

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

with self.assertRaises(TwilioException):
self.client.api.v2010.accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.calls("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.feedback().create(quality_score=1)

values = {'QualityScore': 1, }
.feedback().fetch()

self.holodeck.assert_has_request(Request(
'post',
'get',
'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Feedback.json',
data=values,
))

def test_create_response(self):
def test_fetch_response(self):
self.holodeck.mock(Response(
201,
200,
'''
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
Expand All @@ -42,34 +39,37 @@ def test_create_response(self):
"imperfect-audio",
"post-dial-delay"
],
"quality_score": 5,
"quality_score": 1,
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
'''
))

actual = self.client.api.v2010.accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.calls("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.feedback().create(quality_score=1)
.feedback().fetch()

self.assertIsNotNone(actual)

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

with self.assertRaises(TwilioException):
self.client.api.v2010.accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.calls("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.feedback().fetch()
.feedback().create(quality_score=1)

values = {'QualityScore': 1, }

self.holodeck.assert_has_request(Request(
'get',
'post',
'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Feedback.json',
data=values,
))

def test_fetch_response(self):
def test_create_response(self):
self.holodeck.mock(Response(
200,
201,
'''
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
Expand All @@ -79,15 +79,15 @@ def test_fetch_response(self):
"imperfect-audio",
"post-dial-delay"
],
"quality_score": 5,
"quality_score": 1,
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
'''
))

actual = self.client.api.v2010.accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.calls("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.feedback().fetch()
.feedback().create(quality_score=1)

self.assertIsNotNone(actual)

Expand All @@ -97,14 +97,11 @@ def test_update_request(self):
with self.assertRaises(TwilioException):
self.client.api.v2010.accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.calls("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.feedback().update(quality_score=1)

values = {'QualityScore': 1, }
.feedback().update()

self.holodeck.assert_has_request(Request(
'post',
'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Feedback.json',
data=values,
))

def test_update_response(self):
Expand All @@ -116,17 +113,16 @@ def test_update_response(self):
"date_created": "Thu, 20 Aug 2015 21:45:46 +0000",
"date_updated": "Thu, 20 Aug 2015 21:45:46 +0000",
"issues": [
"imperfect-audio",
"post-dial-delay"
"audio-latency"
],
"quality_score": 5,
"quality_score": 2,
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
'''
))

actual = self.client.api.v2010.accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.calls("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.feedback().update(quality_score=1)
.feedback().update()

self.assertIsNotNone(actual)
48 changes: 24 additions & 24 deletions tests/integration/api/v2010/account/call/test_feedback_summary.py
Expand Up @@ -40,26 +40,26 @@ def test_create_response(self):
201,
'''
{
"include_subaccounts": false,
"call_feedback_count": 729,
"quality_score_standard_deviation": "1.0",
"end_date": "2014-01-01",
"quality_score_median": "4.0",
"quality_score_average": "4.5",
"date_updated": "Tue, 31 Aug 2010 20:36:28 +0000",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"status": "completed",
"call_count": 10200,
"call_feedback_count": 729,
"end_date": "2011-01-01",
"include_subaccounts": false,
"sid": "FSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
"start_date": "2014-01-01",
"issues": [
{
"count": 45,
"description": "imperfect-audio",
"percentage_of_total_calls": "0.04%"
}
],
"quality_score_average": 4.5,
"quality_score_median": 4,
"quality_score_standard_deviation": 1,
"sid": "FSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"start_date": "2011-01-01",
"status": "completed",
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000"
]
}
'''
))
Expand Down Expand Up @@ -88,26 +88,26 @@ def test_fetch_response(self):
200,
'''
{
"include_subaccounts": false,
"call_feedback_count": 729,
"quality_score_standard_deviation": "1.0",
"end_date": "2014-01-01",
"quality_score_median": "4.0",
"quality_score_average": "4.5",
"date_updated": "Tue, 31 Aug 2010 20:36:28 +0000",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"status": "completed",
"call_count": 10200,
"call_feedback_count": 729,
"end_date": "2011-01-01",
"include_subaccounts": false,
"sid": "FSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
"start_date": "2014-01-01",
"issues": [
{
"count": 45,
"description": "imperfect-audio",
"percentage_of_total_calls": "0.04%"
}
],
"quality_score_average": 4.5,
"quality_score_median": 4,
"quality_score_standard_deviation": 1,
"sid": "FSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"start_date": "2011-01-01",
"status": "completed",
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000"
]
}
'''
))
Expand Down
58 changes: 58 additions & 0 deletions tests/integration/api/v2010/account/conference/test_participant.py
Expand Up @@ -491,6 +491,64 @@ def test_create_with_friendly_name_recording_track_response(self):

self.assertIsNotNone(actual)

def test_create_with_from_to_client_response(self):
self.holodeck.mock(Response(
201,
'''
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"label": "customer",
"conference_sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "Fri, 18 Feb 2011 21:07:19 +0000",
"date_updated": "Fri, 18 Feb 2011 21:07:19 +0000",
"end_conference_on_exit": false,
"muted": false,
"hold": false,
"status": "complete",
"start_conference_on_enter": true,
"coaching": false,
"call_sid_to_coach": null,
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
}
'''
))

actual = self.client.api.v2010.accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.conferences("CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.participants.create(from_="+15017122661", to="+15558675310")

self.assertIsNotNone(actual)

def test_create_with_from_to_sip_response(self):
self.holodeck.mock(Response(
201,
'''
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"label": "customer",
"conference_sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "Fri, 18 Feb 2011 21:07:19 +0000",
"date_updated": "Fri, 18 Feb 2011 21:07:19 +0000",
"end_conference_on_exit": false,
"muted": false,
"hold": false,
"status": "complete",
"start_conference_on_enter": true,
"coaching": false,
"call_sid_to_coach": null,
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
}
'''
))

actual = self.client.api.v2010.accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.conferences("CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.participants.create(from_="+15017122661", to="+15558675310")

self.assertIsNotNone(actual)

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

Expand Down
27 changes: 14 additions & 13 deletions tests/integration/api/v2010/account/test_message.py
Expand Up @@ -484,33 +484,34 @@ def test_update_request(self):
data=values,
))

def test_update_response(self):
def test_redact_body_response(self):
self.holodeck.mock(Response(
200,
'''
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"api_version": "2010-04-01",
"body": "Hello, this is trash Benson cut and pasted and probably does not do anything useful! \\ud83d\\udc4d",
"date_created": "Thu, 30 Jul 2015 20:12:31 +0000",
"date_sent": "Thu, 30 Jul 2015 20:12:33 +0000",
"date_updated": "Thu, 30 Jul 2015 20:12:33 +0000",
"body": "",
"date_created": "Fri, 24 May 2019 17:18:27 +0000",
"date_sent": "Fri, 24 May 2019 17:18:28 +0000",
"date_updated": "Fri, 24 May 2019 17:18:28 +0000",
"direction": "outbound-api",
"error_code": null,
"error_message": null,
"from": "+14155552345",
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"error_code": 30007,
"error_message": "Carrier violation",
"from": "+12019235161",
"messaging_service_sid": "MGdeadbeefdeadbeefdeadbeefdeadbeef",
"num_media": "0",
"num_segments": "1",
"price": "-0.00750",
"price_unit": "USD",
"sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"sid": "SMb7c0a2ce80504485a6f653a7110836f5",
"status": "sent",
"subresource_uris": {
"media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json"
"media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMb7c0a2ce80504485a6f653a7110836f5/Media.json",
"feedback": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMb7c0a2ce80504485a6f653a7110836f5/Feedback.json"
},
"to": "+14155552345",
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
"to": "+18182008801",
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMb7c0a2ce80504485a6f653a7110836f5.json"
}
'''
))
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/events/v1/schema/test_version.py
Expand Up @@ -59,13 +59,15 @@ def test_read_results_response(self):
{
"id": "Messaging.MessageStatus",
"schema_version": 1,
"public": true,
"date_created": "2015-07-30T20:00:00Z",
"url": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions/1",
"raw": "https://events-schemas.twilio.com/Messaging.MessageStatus/1"
},
{
"id": "Messaging.MessageStatus",
"schema_version": 2,
"public": true,
"date_created": "2015-07-30T20:00:00Z",
"url": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions/2",
"raw": "https://events-schemas.twilio.com/Messaging.MessageStatus/2"
Expand Down Expand Up @@ -108,6 +110,7 @@ def test_fetch_response(self):
{
"id": "Messaging.MessageStatus",
"schema_version": 1,
"public": true,
"date_created": "2015-07-30T20:00:00Z",
"url": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions/1",
"raw": "https://events-schemas.twilio.com/Messaging.MessageStatus/1"
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/events/v1/test_event_type.py
Expand Up @@ -59,6 +59,7 @@ def test_read_results_response(self):
"date_updated": "2020-08-13T13:28:20Z",
"type": "com.twilio.messaging.message.delivered",
"schema_id": "Messaging.MessageStatus",
"public": true,
"description": "Messaging- delivered message",
"url": "https://events.twilio.com/v1/Types/com.twilio.messaging.message.delivered",
"links": {
Expand All @@ -70,6 +71,7 @@ def test_read_results_response(self):
"date_updated": "2020-08-13T13:28:19Z",
"type": "com.twilio.messaging.message.failed",
"schema_id": "Messaging.MessageStatus",
"public": true,
"description": "Messaging- failed message",
"url": "https://events.twilio.com/v1/Types/com.twilio.messaging.message.failed",
"links": {
Expand Down Expand Up @@ -114,6 +116,7 @@ def test_fetch_response(self):
"date_updated": "2020-08-13T13:28:20Z",
"type": "com.twilio.messaging.message.delivered",
"schema_id": "Messaging.MessageStatus",
"public": true,
"description": "Messaging- delivered message",
"url": "https://events.twilio.com/v1/Types/com.twilio.messaging.message.delivered",
"links": {
Expand Down

0 comments on commit 4567b23

Please sign in to comment.