Skip to content

Commit f8ee261

Browse files
committed
[Librarian] Regenerated @ 262cdcd92a729094d792ceac9c0d3fcf895fea3d
1 parent c36a16f commit f8ee261

File tree

37 files changed

+1676
-1754
lines changed

37 files changed

+1676
-1754
lines changed

CHANGES.md

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

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

6+
[2022-11-30] Version 7.15.4
7+
---------------------------
8+
**Flex**
9+
- Adding new `assessments` api in version `v1`
10+
11+
**Lookups**
12+
- Add `identity_match` package to the lookup response
13+
14+
**Messaging**
15+
- Added `validated` parameter to Link Shortening API
16+
17+
**Serverless**
18+
- Add node16 as a valid Build runtime
19+
- Add ie1 and au1 as supported regions for all endpoints.
20+
21+
622
[2022-11-16] Version 7.15.3
723
---------------------------
824
**Library - Chore**
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 ApprovalFetchTestCase(IntegrationTestCase):
16+
17+
def test_fetch_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.content.v1.contents("HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
22+
.approval_fetch().fetch()
23+
24+
self.holodeck.assert_has_request(Request(
25+
'get',
26+
'https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests',
27+
))
28+
29+
def test_get_approval_response(self):
30+
self.holodeck.mock(Response(
31+
200,
32+
'''
33+
{
34+
"sid": "HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
36+
"whatsapp": {
37+
"type": "whatsapp",
38+
"name": "tree_fiddy",
39+
"category": "ACCOUNT_UPDATE",
40+
"content_type": "twilio/location",
41+
"status": "unsubmitted",
42+
"rejection_reason": ""
43+
},
44+
"url": "https://content.twilio.com/v1/Content/HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ApprovalRequests"
45+
}
46+
'''
47+
))
48+
49+
actual = self.client.content.v1.contents("HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
50+
.approval_fetch().fetch()
51+
52+
self.assertIsNotNone(actual)

tests/integration/content/v1/test_content.py

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -62,54 +62,6 @@ def test_fetch_response(self):
6262

6363
self.assertIsNotNone(actual)
6464

65-
def test_create_request(self):
66-
self.holodeck.mock(Response(500, ''))
67-
68-
with self.assertRaises(TwilioException):
69-
self.client.content.v1.contents.create()
70-
71-
self.holodeck.assert_has_request(Request(
72-
'post',
73-
'https://content.twilio.com/v1/Content',
74-
))
75-
76-
def test_create_response(self):
77-
self.holodeck.mock(Response(
78-
201,
79-
'''
80-
{
81-
"sid": "HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
82-
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
83-
"friendly_name": "",
84-
"language": "en",
85-
"variables": {
86-
"name": "foo"
87-
},
88-
"types": {
89-
"twilio/text": {
90-
"body": "Foo Bar Co is located at 39.7392, 104.9903"
91-
},
92-
"twilio/location": {
93-
"longitude": 104.9903,
94-
"latitude": 39.7392,
95-
"label": "Foo Bar Co"
96-
}
97-
},
98-
"url": "https://content.twilio.com/v1/Content/HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
99-
"date_created": "2015-07-30T19:00:00Z",
100-
"date_updated": "2015-07-30T19:00:00Z",
101-
"links": {
102-
"approval_create": "https://content.twilio.com/v1/Content/HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ApprovalRequests/whatsapp",
103-
"approval_fetch": "https://content.twilio.com/v1/Content/HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ApprovalRequests"
104-
}
105-
}
106-
'''
107-
))
108-
109-
actual = self.client.content.v1.contents.create()
110-
111-
self.assertIsNotNone(actual)
112-
11365
def test_delete_request(self):
11466
self.holodeck.mock(Response(500, ''))
11567

tests/integration/flex_api/v1/interaction/interaction_channel/test_interaction_channel_invite.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,25 @@ def test_create_response(self):
3737
'''
3838
{
3939
"sid": "KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40-
"channel_sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1",
40+
"channel_sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4141
"interaction_sid": "KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4242
"routing": {
43+
"reservation": null,
4344
"properties": {
4445
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4546
"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4647
"sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4748
"date_created": 1634845217,
4849
"date_updated": 1634845217,
49-
"attributes": "{\\"customerAddress\\":\\"customer email address\\",\\"conversationSid\\":\\"UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1\\",\\"customerName\\":\\"customer name\\"}",
50+
"attributes": "{\\"customerAddress\\":\\"customer phone address\\",\\"flexChannelInviteSid\\":\\"KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"conversationSid\\":\\"CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"channelType\\":\\"sms\\",\\"customers\\":{\\"phone\\":\\"customer phone address\\",\\"name\\":\\"customer name\\"},\\"conversations\\":{\\"conversation_id\\":\\"KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"media\\":[{\\"type\\":\\"ChatTranscript\\",\\"sid\\":\\"CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\"}]},\\"customerName\\":\\"customer name\\",\\"flexInteractionChannelSid\\":\\"UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"flexInteractionSid\\":\\"KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\"}",
5051
"assignment_status": "pending",
5152
"workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5253
"workflow_name": "Default Fifo Workflow",
5354
"queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5455
"queue_name": "Sample Queue",
5556
"priority": 0,
5657
"age": 0,
57-
"reason": null,
58+
"reason": "",
5859
"timeout": 86400,
5960
"assignmentCounter": 0,
6061
"task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -65,7 +66,7 @@ def test_create_response(self):
6566
"addons": "{}"
6667
}
6768
},
68-
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1/Invites/KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
69+
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
6970
}
7071
'''
7172
))
@@ -97,24 +98,25 @@ def test_read_response(self):
9798
"invites": [
9899
{
99100
"sid": "KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1",
100-
"channel_sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1",
101+
"channel_sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
101102
"interaction_sid": "KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
102103
"routing": {
104+
"reservation": null,
103105
"properties": {
104106
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
105107
"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
106108
"sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
107109
"date_created": 1634845217,
108110
"date_updated": 1634845217,
109-
"attributes": "{\\"customerAddress\\":\\"customer email address\\",\\"conversationSid\\":\\"UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1\\",\\"customerName\\":\\"customer name\\"}",
111+
"attributes": "{\\"customerAddress\\":\\"customer phone address\\",\\"flexChannelInviteSid\\":\\"KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"conversationSid\\":\\"CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"channelType\\":\\"sms\\",\\"customers\\":{\\"phone\\":\\"customer phone address\\",\\"name\\":\\"customer name\\"},\\"conversations\\":{\\"conversation_id\\":\\"KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"media\\":[{\\"type\\":\\"ChatTranscript\\",\\"sid\\":\\"CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\"}]},\\"customerName\\":\\"customer name\\",\\"flexInteractionChannelSid\\":\\"UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"flexInteractionSid\\":\\"KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\"}",
110112
"assignment_status": "pending",
111113
"workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
112114
"workflow_name": "Default Fifo Workflow",
113115
"queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
114116
"queue_name": "Sample Queue",
115117
"priority": 0,
116118
"age": 0,
117-
"reason": null,
119+
"reason": "",
118120
"timeout": 86400,
119121
"assignmentCounter": 0,
120122
"task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -125,28 +127,29 @@ def test_read_response(self):
125127
"addons": "{}"
126128
}
127129
},
128-
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1/Invites/KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1"
130+
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1"
129131
},
130132
{
131133
"sid": "KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2",
132-
"channel_sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1",
134+
"channel_sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
133135
"interaction_sid": "KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
134136
"routing": {
137+
"reservation": null,
135138
"properties": {
136139
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
137140
"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
138141
"sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
139142
"date_created": 1634845217,
140143
"date_updated": 1634845217,
141-
"attributes": "{\\"customerAddress\\":\\"customer email address\\",\\"conversationSid\\":\\"UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1\\",\\"customerName\\":\\"customer name\\"}",
144+
"attributes": "{\\"customerAddress\\":\\"customer phone address\\",\\"flexChannelInviteSid\\":\\"KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"conversationSid\\":\\"CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"channelType\\":\\"sms\\",\\"customers\\":{\\"phone\\":\\"customer phone address\\",\\"name\\":\\"customer name\\"},\\"conversations\\":{\\"conversation_id\\":\\"KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"media\\":[{\\"type\\":\\"ChatTranscript\\",\\"sid\\":\\"CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\"}]},\\"customerName\\":\\"customer name\\",\\"flexInteractionChannelSid\\":\\"UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"flexInteractionSid\\":\\"KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\"}",
142145
"assignment_status": "pending",
143146
"workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
144147
"workflow_name": "Default Fifo Workflow",
145148
"queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
146149
"queue_name": "Sample Queue",
147150
"priority": 0,
148151
"age": 0,
149-
"reason": null,
152+
"reason": "",
150153
"timeout": 86400,
151154
"assignmentCounter": 0,
152155
"task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -157,15 +160,15 @@ def test_read_response(self):
157160
"addons": "{}"
158161
}
159162
},
160-
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1/Invites/KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2"
163+
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2"
161164
}
162165
],
163166
"meta": {
164167
"page": 0,
165168
"page_size": 50,
166-
"first_page_url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1/Invites?PageSize=50&Page=0",
169+
"first_page_url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0",
167170
"previous_page_url": null,
168-
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1/Invites?PageSize=50&Page=0",
171+
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0",
169172
"next_page_url": null,
170173
"key": "invites"
171174
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 AssessmentsTestCase(IntegrationTestCase):
16+
17+
def test_create_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.flex_api.v1.assessments().create()
22+
23+
self.holodeck.assert_has_request(Request(
24+
'post',
25+
'https://flex-api.twilio.com/v1/Accounts/Assessments',
26+
))
27+
28+
def test_create_response(self):
29+
self.holodeck.mock(Response(
30+
201,
31+
'''
32+
{
33+
"url": "https://flex-api.twilio.com/v1/Accounts/Assessments"
34+
}
35+
'''
36+
))
37+
38+
actual = self.client.flex_api.v1.assessments().create()
39+
40+
self.assertIsNotNone(actual)

tests/integration/flex_api/v1/test_interaction.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,30 @@ def test_create_response(self):
8282
"sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
8383
},
8484
"routing": {
85+
"reservation": null,
8586
"properties": {
86-
"workflow_sid": "WWxx",
87-
"attributes": "WWxx",
88-
"task_channel_unique_name": "sms",
89-
"routing_target": "WKXX",
90-
"queue_name": "WQXX"
87+
"date_updated": 1634845217,
88+
"task_queue_entered_date": 1634845217,
89+
"workflow_name": "Default Fifo Workflow",
90+
"age_in_queue": 0,
91+
"task_channel_unique_name": "default",
92+
"assignment_status": "pending",
93+
"queue_name": "Sample Queue",
94+
"assignmentCounter": 0,
95+
"priority": 0,
96+
"sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
97+
"workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
98+
"routing_target": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
99+
"reason": "",
100+
"attributes": "{\\"customerAddress\\":\\"customer phone address\\",\\"flexChannelInviteSid\\":\\"KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"conversationSid\\":\\"CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"channelType\\":\\"sms\\",\\"customers\\":{\\"phone\\":\\"customer phone address\\",\\"name\\":\\"customer name\\"},\\"conversations\\":{\\"initiated_by\\":\\"customer\\",\\"conversation_id\\":\\"KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"media\\":[{\\"type\\":\\"ChatTranscript\\",\\"sid\\":\\"CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\"}]},\\"customerName\\":\\"customer name\\",\\"flexInteractionChannelSid\\":\\"UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"initiatedBy\\":\\"customer\\",\\"flexInteractionSid\\":\\"KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\",\\"direction\\":\\"inbound\\"}",
101+
"task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
102+
"age": 0,
103+
"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
104+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
105+
"timeout": 86400,
106+
"date_created": 1634845217,
107+
"addons": "{}",
108+
"queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
91109
}
92110
},
93111
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",

0 commit comments

Comments
 (0)