Skip to content

Commit 1fd739f

Browse files
committed
[Librarian] Regenerated @ 480d240ca25b1c4186b4f9485e0f0debf1e14978
1 parent 33e0caa commit 1fd739f

File tree

26 files changed

+1139
-35
lines changed

26 files changed

+1139
-35
lines changed

CHANGES.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@ twilio-python Changelog
33

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

6+
[2021-08-25] Version 6.63.1
7+
---------------------------
8+
**Api**
9+
- Add Programmabled Voice SIP Refer call transfers (`calls-transfers`) to usage records
10+
- Add Flex Voice Usage category (`flex-usage`) to usage records
11+
12+
**Conversations**
13+
- Add `Order` query parameter to Message resource read operation
14+
15+
**Insights**
16+
- Added `partial` to enum processing_state_request
17+
- Added abnormal session filter in Call Summaries
18+
19+
**Messaging**
20+
- Add brand_registration_sid as an optional query param for us_app_to_person_usecase api
21+
22+
**Pricing**
23+
- add trunking_numbers resource (v2)
24+
- add trunking_country resource (v2)
25+
26+
**Verify**
27+
- Changed to private beta the `TemplateSid` optional parameter on Verification creation.
28+
- Added the optional parameter `Order` to the list Challenges endpoint to define the list order.
29+
30+
631
[2021-08-11] Version 6.63.0
732
---------------------------
833
**Library - Fix**

tests/integration/conversations/v1/conversation/test_message.py

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def test_read_full_response(self):
334334
"attributes": "{ \\"importance\\": \\"high\\" }",
335335
"date_created": "2016-03-24T20:38:21Z",
336336
"date_updated": "2016-03-24T20:38:21Z",
337-
"index": 0,
337+
"index": 5,
338338
"delivery": {
339339
"total": 2,
340340
"sent": "all",
@@ -366,7 +366,64 @@ def test_read_full_response(self):
366366
"attributes": "{ \\"importance\\": \\"high\\" }",
367367
"date_created": "2016-03-24T20:38:21Z",
368368
"date_updated": "2016-03-24T20:38:21Z",
369-
"index": 0,
369+
"index": 9,
370+
"delivery": {
371+
"total": 2,
372+
"sent": "all",
373+
"delivered": "some",
374+
"read": "some",
375+
"failed": "none",
376+
"undelivered": "none"
377+
},
378+
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
379+
"links": {
380+
"delivery_receipts": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts"
381+
}
382+
}
383+
]
384+
}
385+
'''
386+
))
387+
388+
actual = self.client.conversations.v1.conversations("CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
389+
.messages.list()
390+
391+
self.assertIsNotNone(actual)
392+
393+
def test_read_last_message_response(self):
394+
self.holodeck.mock(Response(
395+
200,
396+
'''
397+
{
398+
"meta": {
399+
"page": 0,
400+
"page_size": 1,
401+
"first_page_url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?Order=desc&PageSize=1&Page=0",
402+
"previous_page_url": null,
403+
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?Order=desc&PageSize=1&Page=0",
404+
"next_page_url": null,
405+
"key": "messages"
406+
},
407+
"messages": [
408+
{
409+
"sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
410+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
411+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
412+
"body": null,
413+
"media": [
414+
{
415+
"sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
416+
"size": 42056,
417+
"content_type": "image/jpeg",
418+
"filename": "car.jpg"
419+
}
420+
],
421+
"author": "cake_lover",
422+
"participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
423+
"attributes": "{ \\"importance\\": \\"high\\" }",
424+
"date_created": "2016-03-24T20:38:21Z",
425+
"date_updated": "2016-03-24T20:38:21Z",
426+
"index": 9,
370427
"delivery": {
371428
"total": 2,
372429
"sent": "all",

tests/integration/conversations/v1/service/conversation/test_message.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,3 +409,62 @@ def test_read_full_response(self):
409409
.messages.list()
410410

411411
self.assertIsNotNone(actual)
412+
413+
def test_read_last_message_response(self):
414+
self.holodeck.mock(Response(
415+
200,
416+
'''
417+
{
418+
"meta": {
419+
"page": 0,
420+
"page_size": 1,
421+
"first_page_url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?Order=desc&PageSize=1&Page=0",
422+
"previous_page_url": null,
423+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?Order=desc&PageSize=1&Page=0",
424+
"next_page_url": null,
425+
"key": "messages"
426+
},
427+
"messages": [
428+
{
429+
"sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
430+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
431+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
432+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
433+
"body": null,
434+
"media": [
435+
{
436+
"sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
437+
"size": 42056,
438+
"content_type": "image/jpeg",
439+
"filename": "car.jpg"
440+
}
441+
],
442+
"author": "cake_lover",
443+
"participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
444+
"attributes": "{ \\"importance\\": \\"high\\" }",
445+
"date_created": "2016-03-24T20:38:21Z",
446+
"date_updated": "2016-03-24T20:38:21Z",
447+
"index": 9,
448+
"delivery": {
449+
"total": 2,
450+
"sent": "all",
451+
"delivered": "some",
452+
"read": "some",
453+
"failed": "none",
454+
"undelivered": "none"
455+
},
456+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
457+
"links": {
458+
"delivery_receipts": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts"
459+
}
460+
}
461+
]
462+
}
463+
'''
464+
))
465+
466+
actual = self.client.conversations.v1.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
467+
.conversations("CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
468+
.messages.list()
469+
470+
self.assertIsNotNone(actual)

tests/integration/messaging/v1/service/test_us_app_to_person_usecase.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,33 @@ def test_fetch_request(self):
2626
'https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Compliance/Usa2p/Usecases',
2727
))
2828

29-
def test_fetch_response(self):
29+
def test_fetch_with_brand_registration_sid_response(self):
30+
self.holodeck.mock(Response(
31+
200,
32+
'''
33+
{
34+
"us_app_to_person_usecases": [
35+
{
36+
"code": "MARKETING",
37+
"name": "Marketing",
38+
"description": "Send marketing messages about sales and offers to opted in customers."
39+
},
40+
{
41+
"code": "DELIVERY_NOTIFICATION",
42+
"name": "Delivery Notification",
43+
"description": "Information about the status of the delivery of a product or service."
44+
}
45+
]
46+
}
47+
'''
48+
))
49+
50+
actual = self.client.messaging.v1.services("MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
51+
.us_app_to_person_usecases.fetch()
52+
53+
self.assertIsNotNone(actual)
54+
55+
def test_fetch_without_brand_registration_sid_response(self):
3056
self.holodeck.mock(Response(
3157
200,
3258
'''
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
# coding=utf-8
2+
r"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
9+
from tests import IntegrationTestCase
10+
from tests.holodeck import Request
11+
from twilio.base.exceptions import TwilioException
12+
from twilio.http.response import Response
13+
14+
15+
class CountryTestCase(IntegrationTestCase):
16+
17+
def test_list_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.pricing.v2.countries.list()
22+
23+
self.holodeck.assert_has_request(Request(
24+
'get',
25+
'https://pricing.twilio.com/v2/Trunking/Countries',
26+
))
27+
28+
def test_read_full_response(self):
29+
self.holodeck.mock(Response(
30+
200,
31+
'''
32+
{
33+
"countries": [
34+
{
35+
"country": "Andorra",
36+
"iso_country": "AD",
37+
"url": "https://pricing.twilio.com/v2/Trunking/Countries/AD"
38+
}
39+
],
40+
"meta": {
41+
"first_page_url": "https://pricing.twilio.com/v2/Trunking/Countries?PageSize=50&Page=0",
42+
"key": "countries",
43+
"next_page_url": null,
44+
"page": 0,
45+
"page_size": 50,
46+
"previous_page_url": null,
47+
"url": "https://pricing.twilio.com/v2/Trunking/Countries?PageSize=50&Page=0"
48+
}
49+
}
50+
'''
51+
))
52+
53+
actual = self.client.pricing.v2.countries.list()
54+
55+
self.assertIsNotNone(actual)
56+
57+
def test_read_empty_response(self):
58+
self.holodeck.mock(Response(
59+
200,
60+
'''
61+
{
62+
"countries": [],
63+
"meta": {
64+
"first_page_url": "https://pricing.twilio.com/v2/Trunking/Countries?PageSize=50&Page=0",
65+
"key": "countries",
66+
"next_page_url": null,
67+
"page": 0,
68+
"page_size": 50,
69+
"previous_page_url": null,
70+
"url": "https://pricing.twilio.com/v2/Trunking/Countries?PageSize=50&Page=0"
71+
}
72+
}
73+
'''
74+
))
75+
76+
actual = self.client.pricing.v2.countries.list()
77+
78+
self.assertIsNotNone(actual)
79+
80+
def test_fetch_request(self):
81+
self.holodeck.mock(Response(500, ''))
82+
83+
with self.assertRaises(TwilioException):
84+
self.client.pricing.v2.countries("US").fetch()
85+
86+
self.holodeck.assert_has_request(Request(
87+
'get',
88+
'https://pricing.twilio.com/v2/Trunking/Countries/US',
89+
))
90+
91+
def test_fetch_response(self):
92+
self.holodeck.mock(Response(
93+
200,
94+
'''
95+
{
96+
"country": "United States",
97+
"originating_call_prices": [
98+
{
99+
"base_price": "",
100+
"current_price": "0.0085",
101+
"number_type": "local"
102+
},
103+
{
104+
"base_price": "",
105+
"current_price": "0.022",
106+
"number_type": "toll free"
107+
}
108+
],
109+
"iso_country": "US",
110+
"terminating_prefix_prices": [
111+
{
112+
"base_price": "",
113+
"current_price": "0.090",
114+
"destination_prefixes": [
115+
"1907"
116+
],
117+
"friendly_name": "Outbound Trunking Minute - United States - Alaska",
118+
"origination_prefixes": [
119+
"ALL"
120+
]
121+
},
122+
{
123+
"base_price": "",
124+
"current_price": "0.013",
125+
"destination_prefixes": [
126+
"1808"
127+
],
128+
"friendly_name": "Outbound Trunking Minute - United States - Hawaii",
129+
"origination_prefixes": [
130+
"ALL"
131+
]
132+
},
133+
{
134+
"base_price": "",
135+
"current_price": "0.013",
136+
"destination_prefixes": [
137+
"1800",
138+
"1844",
139+
"1855",
140+
"1866",
141+
"1877",
142+
"1888"
143+
],
144+
"friendly_name": "Outbound Trunking Minute - United States & Canada - Toll Free",
145+
"origination_prefixes": [
146+
"ALL"
147+
]
148+
},
149+
{
150+
"base_price": "",
151+
"current_price": "0.013",
152+
"destination_prefixes": [
153+
"1"
154+
],
155+
"friendly_name": "Outbound Trunking Minute - United States & Canada",
156+
"origination_prefixes": [
157+
"ALL"
158+
]
159+
}
160+
],
161+
"price_unit": "USD",
162+
"url": "https://pricing.twilio.com/v2/Trunking/Countries/US"
163+
}
164+
'''
165+
))
166+
167+
actual = self.client.pricing.v2.countries("US").fetch()
168+
169+
self.assertIsNotNone(actual)

0 commit comments

Comments
 (0)