8000 [Librarian] Regenerated @ 54f479b2e9ba3ddad939d35c077bf4875093bb86 · Skotha/twilio-python@fcef667 · GitHub
[go: up one dir, main page]

Skip to content

Commit fcef667

Browse files
committed
[Librarian] Regenerated @ 54f479b2e9ba3ddad939d35c077bf4875093bb86
1 parent 125ca93 commit fcef667

File tree

5 files changed

+129
-7
lines changed

5 files changed

+129
-7
lines changed

CHANGES.md

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

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

6+
[2022-07-21] Version 7.12.0
7+
---------------------------
8+
**Flex**
9+
- Add `status`, `error_code`, and `error_message` fields to Interaction `Channel`
10+
- Adding `messenger` and `gbm` as supported channels for Interactions API
11+
12+
**Messaging**
13+
- Update alpha_sender docs with new valid characters
14+
15+
**Verify**
16+
- Reorder Verification Check parameters so `code` stays as the first parameter **(breaking change)**
17+
- Rollback List Attempts API V2 back to pilot stage.
18+
19+
620
[2022-07-13] Version 7.11.0
721
---------------------------
822
**Library - Fix**

tests/integration/flex_api/v1/interaction/test_interaction_channel.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ def test_fetch_response(self):
3434
"sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1",
3535
"type": "chat",
3636
"interaction_sid": "KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
37+
"status": "closed",
38+
"error_code": 19025,
39+
"error_message": "Channel validation error",
3740
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1",
3841
"links": {
3942
"participants": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1/Participants",
@@ -70,6 +73,9 @@ def test_read_response(self):
7073
"sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1",
7174
"type": "chat",
7275
"interaction_sid": "KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
76+
"status": "closed",
77+
"error_code": 19025,
78+
"error_message": "Channel validation error",
7379
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1",
7480
"links": {
7581
"participants": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1/Participants",
@@ -80,11 +86,53 @@ def test_read_response(self):
8086
"sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2",
8187
"type": "sms",
8288
"interaction_sid": "KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
89+
"status": "active",
90+
"error_code": null,
91+
"error_message": null,
8392
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2",
8493
"links": {
8594
"participants": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2/Participants",
8695
"invites": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2/Invites"
8796
}
97+
},
98+
{
99+
"sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3",
100+
"type": "email",
101+
"interaction_sid": "KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
102+
"status": "failed",
103+
"error_code": 19025,
104+
"error_message": "Channel validation error",
105+
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3",
106+
"links": {
107+
"participants": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3/Participants",
108+
"invites": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3/Invites"
109+
}
110+
},
111+
{
112+
"sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4",
113+
"type": "voice",
114+
"interaction_sid": "KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
115+
"status": "setup",
116+
"error_code": null,
117+
"error_message": null,
118+
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4",
119+
"links": {
120+
"participants": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4/Participants",
121+
"invites": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4/Invites"
122+
}
123+
},
124+
{
125+
"sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5",
126+
"type": "gbm",
127+
"interaction_sid": "KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
128+
"status": "failed",
129+
"error_code": 19025,
130+
"error_message": "Channel validation error",
131+
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5",
132+
"links": {
133+
"participants": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5/Participants",
134+
"invites": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5/Invites"
135+
}
88136
}
89137
],
90138
"meta": {
@@ -128,6 +176,9 @@ def test_update_response(self):
128176
"sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1",
129177
"interaction_sid": "KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
130178
"type": "chat",
179+
"status": "closed",
180+
"error_code": 19025,
181+
"error_message": "Channel validation error",
131182
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1",
132183
"links": {
133184
"participants": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1/Participants",
@@ -150,6 +201,9 @@ def test_update_status_closed_response(self):
150201
"sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1",
151202
"interaction_sid": "KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
152203
"type": "chat",
204+
"status": "failed",
205+
"error_code": 19025,
206+
"error_message": "Channel validation error",
153207
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1",
154208
"links": {
155209
"participants": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1/Participants",

tests/integration/verify/v2/service/test_verification_check.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def test_verification_checks_response(self):
4040
"valid": true,
4141
"amount": null,
4242
"payee": null,
43+
"sna_attempts_error_codes": [],
4344
"date_created": "2015-07-30T20:00:00Z",
4445
"date_updated": "2015-07-30T20:00:00Z"
4546
}
@@ -65,6 +66,7 @@ def test_email_verification_checks_response(self):
6566
"valid": true,
6667
"amount": null,
6768
"payee": null,
69+
"sna_attempts_error_codes": [],
6870
"date_created": "2020-01-30T20:00:00Z",
6971
"date_updated": "2020-01-30T20:00:00Z"
7072
}
@@ -90,6 +92,12 @@ def test_sna_verification_checks_response(self):
9092
"valid": true,
9193
"amount": null,
9294
"payee": null,
95+
"sna_attempts_error_codes": [
96+
{
97+
"attempt_sid": "VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
98+
"code": 60001
99+
}
100+
],
93101
"date_created": "2015-07-30T20:00:00Z",
94102
"date_updated": "2015-07-30T20:00:00Z"
95103
}

twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/ /
77
"""
88

9+
from twilio.base import deserialize
910
from twilio.base import serialize
1011
from twilio.base import values
1112
from twilio.base.instance_context import InstanceContext
@@ -23,7 +24,7 @@ def __init__(self, version, interaction_sid):
2324
Initialize the InteractionChannelList
2425
2526
:param Version version: Version that contains the resource
26-
:param interaction_sid: The unique string that identifies the resource
27+
:param interaction_sid: The unique string that identifies the resource.
2728
2829
:returns: twilio.rest.flex_api.v1.interaction.interaction_channel.InteractionChannelList
2930
:rtype: twilio.rest.flex_api.v1.interaction.interaction_channel.InteractionChannelList
@@ -159,7 +160,7 @@ def __init__(self, version, response, solution):
159160
160161
:param Version version: Version that contains the resource
161162
:param Response response: Response from the API
162-
:param interaction_sid: The unique string that identifies the resource
163+
:param interaction_sid: The unique string that identifies the resource.
163164
164165
:returns: twilio.rest.flex_api.v1.interaction.interaction_channel.InteractionChannelPage
165166
:rtype: twilio.rest.flex_api.v1.interaction.interaction_channel.InteractionChannelPage
@@ -311,6 +312,14 @@ class Type(object):
311312
WEB = "web"
312313
WHATSAPP = "whatsapp"
313314
CHAT = "chat"
315+
MESSENGER = "messenger"
316+
GBM = "gbm"
317+
318+
class ChannelStatus(object):
319+
SETUP = "setup"
320+
ACTIVE = "active"
321+
FAILED = "failed"
322+
CLOSED = "closed"
314323

315324
def __init__(self, version, payload, interaction_sid, sid=None):
316325
"""
@@ -326,6 +335,9 @@ def __init__(self, version, payload, interaction_sid, sid=None):
326335
'sid': payload.get('sid'),
327336
'interaction_sid': payload.get('interaction_sid'),
328337
'type': payload.get('type'),
338+
'status': payload.get('status'),
339+
'error_code': deserialize.integer(payload.get('error_code')),
340+
'error_message': payload.get('error_message'),
329341
'url': payload.get('url'),
330342
'links': payload.get('links'),
331343
}
@@ -362,7 +374,7 @@ def sid(self):
362374
@property
363375
def interaction_sid(self):
364376
"""
365-
:returns: The unique string that identifies the resource
377+
:returns: The unique string that identifies the resource.
366378
:rtype: unicode
367379
"""
368380
return self._properties['interaction_sid']
@@ -375,6 +387,30 @@ def type(self):
375387
"""
376388
return self._properties['type']
377389

390+
@property
391+
def status(self):
392+
"""
393+
:returns: The status of this channel.
394+
:rtype: InteractionChannelInstance.ChannelStatus
395+
"""
396+
return self._properties['status']
397+
398+
@property
399+
def error_code(self):
400+
"""
401+
:returns: The Twilio error code for a failed channel.
402+
:rtype: unicode
403+
"""
404+
return self._properties['error_code']
405+
406+
@property
407+
def error_message(self):
408+
"""
409+
:returns: The error message for a failed channel.
410+
:rtype: unicode
411+
"""
412+
return self._properties['error_message']
413+
378414
@property
379415
def url(self):
380416
"""

twilio/rest/verify/v2/service/verification_check.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,27 @@ def __init__(self, version, service_sid):
3131
self._solution = {'service_sid': service_sid, }
3232
self._uri = '/Services/{service_sid}/VerificationCheck'.format(**self._solution)
3333

34-
def create(self, to=values.unset, verification_sid=values.unset,
35-
amount=values.unset, payee=values.unset, code=values.unset):
34+
def create(self, code=values.unset, to=values.unset,
35+
verification_sid=values.unset, amount=values.unset,
36+
payee=values.unset):
3637
"""
3738
Create the VerificationCheckInstance
3839
40+
:param unicode code: The verification string
3941
:param unicode to: The phone number or email to verify
4042
:param unicode verification_sid: A SID that uniquely identifies the Verification Check
4143
:param unicode amount: The amount of the associated PSD2 compliant transaction.
4244
:param unicode payee: The payee of the associated PSD2 compliant transaction
43-
:param unicode code: The verification string
4445
4546
:returns: The created VerificationCheckInstance
4647
:rtype: twilio.rest.verify.v2.service.verification_check.VerificationCheckInstance
4748
"""
4849
data = values.of({
50+
'Code': code,
4951
'To': to,
5052
'VerificationSid': verification_sid,
5153
'Amount': amount,
5254
'Payee': payee,
53-
'Code': code,
5455
})
5556

5657
payload = self._version.create(method='POST', uri=self._uri, data=data, )
@@ -137,6 +138,7 @@ def __init__(self, version, payload, service_sid):
137138
'payee': payload.get('payee'),
138139
'date_created': deserialize.iso8601_datetime(payload.get('date_created')),
139140
'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')),
141+
'sna_attempts_error_codes': payload.get('sna_attempts_error_codes'),
140142
}
141143

142144
# Context
@@ -231,6 +233,14 @@ def date_updated(self):
231233
"""
232234
return self._properties['date_updated']
233235

236+
@property
237+
def sna_attempts_error_codes(self):
238+
"""
239+
:returns: List of error codes as a result of attempting a verification using the `sna` channel.
240+
:rtype: list[dict]
241+
"""
242+
return self._properties['sna_attempts_error_codes']
243+
234244
def __repr__(self):
235245
"""
236246
Provide a friendly representation

0 commit comments

Comments
 (0)
0