8000 [Librarian] Regenerated @ 0d6397ea462cf38ccee74f7de204ee1261bb0d8f · DataXujing/twilio-python@b339e23 · GitHub
[go: up one dir, main page]

Skip to content

Commit b339e23

Browse files
committed
[Librarian] Regenerated @ 0d6397ea462cf38ccee74f7de204ee1261bb0d8f
1 parent 37ce12a commit b339e23

File tree

14 files changed

+804
-42
lines changed

14 files changed

+804
-42
lines changed

CHANGES.md

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

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

6+
[2018-03-22] Version 6.11.0
7+
----------------------------
8+
**Lookups**
9+
- Disable support for `fraud` lookups *(breaking change)*
10+
11+
**Preview**
12+
- Add `BuildDuration` and `ErrorCode` to Understand ModelBuild
13+
14+
**Studio**
15+
- Add new /Context endpoint for step and engagement resources.
16+
17+
618
[2018-03-12] Version 6.10.5
719
----------------------------
820
**Api**

tests/integration/lookups/v1/test_phone_number.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,6 @@ def test_fetch_response(self):
4242
"name": "verizon",
4343
"type": "mobile"
4444
},
45-
"fraud": {
46-
"error_code": null,
47-
"advanced_line_type": "voip",
48-
"is_prepaid": false,
49-
"mobile_country_code": "310",
50-
"mobile_network_code": "456",
51-
"carrier_name": "verizon",
52-
"caller_name": "Delicious Cheese Cake",
53-
"caller_type": "CONSUMER"
54-
},
5545
"country_code": "US",
5646
"national_format": "(510) 867-5309",
5747
"phone_number": "+15108675309",

tests/integration/preview/understand/service/test_model_build.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def test_fetch_response(self):
3838
"service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3939
"date_created": "2015-07-30T20:00:00Z",
4040
"sid": "UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
41-
"unique_name": "unique_name"
41+
"unique_name": "unique_name",
42+
"build_duration": null,
43+
"error_code": null
4244
}
4345
'''
4446
))
@@ -103,11 +105,13 @@ def test_read_full_response(self):
103105
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
104106
"date_updated": "2015-07-30T20:00:00Z",
105107
"url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
106-
"status": "enqueued",
108+
"status": "failed",
107109
"service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
108110
"date_created": "2015-07-30T20:00:00Z",
109111
"sid": "UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
110-
"unique_name": "unique_name"
112+
"unique_name": "unique_name",
113+
"build_duration": null,
114+
"error_code": 23001
111115
}
112116
]
113117
}
@@ -143,7 +147,9 @@ def test_create_response(self):
143147
"service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
144148
"date_created": "2015-07-30T20:00:00Z",
145149
"sid": "UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
146-
"unique_name": "unique_name"
150+
"unique_name": "unique_name",
151+
"build_duration": null,
152+
"error_code": null
147153
}
148154
'''
149155
))
@@ -173,11 +179,13 @@ def test_update_response(self):
173179
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
174180
"date_updated": "2015-07-30T20:00:00Z",
175181
"url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
176-
"status": "enqueued",
182+
"status": "completed",
177183
"service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
178184
"date_created": "2015-07-30T20:00:00Z",
179185
"sid": "UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
180-
"unique_name": "unique_name"
186+
"unique_name": "unique_name",
187+
"build_duration": 100,
188+
"error_code": null
181189
}
182190
'''
183191
))
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# coding=utf-8
2+
"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# coding=utf-8
2+
"""
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 StepContextTestCase(IntegrationTestCase):
16+
17+
def test_fetch_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.studio.v1.flows(sid="FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
22+
.engagements(sid="FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
23+
.steps(sid="FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
24+
.step_context().fetch()
25+
26+
self.holodeck.assert_has_request(Request(
27+
'get',
28+
'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context',
29+
))
30+
31+
def test_fetch_response(self):
32+
self.holodeck.mock(Response(
33+
200,
34+
'''
35+
{
36+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
37+
"context": {
38+
"foo": "bar"
39+
},
40+
"flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
41+
"engagement_sid": "FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
42+
"step_sid": "FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
43+
"url": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context"
44+
}
45+
'''
46+
))
47+
48+
actual = self.client.studio.v1.flows(sid="FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
49+
.engagements(sid="FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
50+
.steps(sid="FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
51+
.step_context().fetch()
52+
53+
self.assertIsNotNone(actual)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# coding=utf-8
2+
"""
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 EngagementContextTestCase(IntegrationTestCase):
16+
17+
def test_fetch_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.studio.v1.flows(sid="FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
22+
.engagements(sid="FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
23+
.engagement_context().fetch()
24+
25+
self.holodeck.assert_has_request(Request(
26+
'get',
27+
'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context',
28+
))
29+
30+
def test_fetch_response(self):
31+
self.holodeck.mock(Response(
32+
200,
33+
'''
34+
{
35+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
36+
"context": {
37+
"foo": "bar"
38+
},
39+
"flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40+
"engagement_sid": "FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
41+
"url": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context"
42+
}
43+
'''
44+
))
45+
46+
actual = self.client.studio.v1.flows(sid="FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
47+
.engagements(sid="FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
48+
.engagement_context().fetch()
49+
50+
self.assertIsNotNone(actual)

tests/integration/studio/v1/flow/engagement/test_step.py

Lines changed: 4 additions & 1 deletion
< 10000 /tr>
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ def test_fetch_response(self):
8080
"transitioned_to": "Ended",
8181
"date_created": "2017-11-06T12:00:00Z",
8282
"date_updated": null,
83-
"url": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
83+
"url": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
84+
"links": {
85+
"step_context": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context"
86+
}
8487
}
8588
'''
8689
))

tests/integration/studio/v1/flow/test_engagement.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def test_fetch_response(self):
7878
"date_updated": null,
7979
"url": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
8080
"links": {
81-
"steps": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps"
81+
"steps": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps",
82+
"engagement_context": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context"
8283
}
8384
}
8485
'''
@@ -113,18 +114,15 @@ def test_create_response(self):
113114
"sid": "FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
114115
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
115116
"flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
116-
"context": {
117-
"flow": {
118-
"first_name": "Foo"
119-
}
120-
},
117+
"context": {},
121118
"contact_sid": "FCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
122119
"contact_channel_address": "+18001234567",
123120
"status": "active",
124121
"date_created": "2015-07-30T20:00:00Z",
125122
"date_updated": "2015-07-30T20:00:00Z",
126123
"links": {
127-
"steps": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps"
124+
"steps": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps",
125+
"engagement_context": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context"
128126
}
129127
}
130128
'''

twilio/rest/lookups/v1/phone_number.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ def __init__(self, version, payload, phone_number=None):
184184
'phone_number': payload['phone_number'],
185185
'national_format': payload['national_format'],
186186
'carrier': payload['carrier'],
187-
'fraud': payload['fraud'],
188187
'add_ons': payload['add_ons'],
189188
'url': payload['url'],
190189
}
@@ -246,14 +245,6 @@ def carrier(self):
246245
"""
247246
return self._properties['carrier']
248247

249-
@property
250-
def fraud(self):
251-
"""
252-
:returns: The fraud
253-
:rtype: unicode
254-
"""
255-
return self._properties['fraud']
256-
257248
@property
258249
def add_ons(self):
259250
"""

twilio/rest/preview/understand/service/model_build.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ def __init__(self, version, payload, service_sid, sid=None):
329329
'status': payload['status'],
330330
'unique_name': payload['unique_name'],
331331
'url': payload['url'],
332+
'build_duration': deserialize.integer(payload['build_duration']),
333+
'error_code': deserialize.integer(payload['error_code']),
332334
}
333335

334336
# Context
@@ -416,6 +418,22 @@ def url(self):
416418
"""
417419
return self._properties['url']
418420

421+
@property
422+
def build_duration(self):
423+
"""
424+
:returns: The build_duration
425+
:rtype: unicode
426+
"""
427+
return self._properties['build_duration']
428+
429+
@property
430+
def error_code(self):
431+
"""
432+
:returns: The error_code
433+
:rtype: unicode
434+
"""
435+
return self._properties['error_code']
436+
419437
def fetch(self):
420438
"""
421439
Fetch a ModelBuildInstance

twilio/rest/studio/v1/flow/engagement/__init__.py

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from twilio.base.instance_resource import InstanceResource
1313
from twilio.base.list_resource import ListResource
1414
from twilio.base.page import Page
15+
from twilio.rest.studio.v1.flow.engagement.engagement_context import EngagementContextList
1516
from twilio.rest.studio.v1.flow.engagement.step import StepList
1617

1718

@@ -233,6 +234,7 @@ def __init__(self, version, flow_sid, sid):
233234

234235
# Dependents
235236
self._steps = None
237+
self._engagement_context = None
236238

237239
def fetch(self):
238240
"""
@@ -272,6 +274,22 @@ def steps(self):
272274
)
273275
return self._steps
274276

277+
@property
278+
def engagement_context(self):
279+
"""
280+
Access the engagement_context
281+
282+
:returns: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextList
283+
:rtype: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextList
D7AE 284+
"""
285+
if self._engagement_context is None:
286+
self._engagement_context = EngagementContextList(
287+
self._version,
288+
flow_sid=self._solution['flow_sid'],
289+
engagement_sid=self._solution['sid'],
290+
)
291+
return self._engagement_context
292+
275293
def __repr__(self):
276294
"""
277295
Provide a friendly representation
@@ -307,8 +325,8 @@ def __init__(self, version, payload, flow_sid, sid=None):
307325
'flow_sid': payload['flow_sid'],
308326
'contact_sid': payload['contact_sid'],
309327
'contact_channel_address': payload['contact_channel_address'],
310-
'status': payload['status'],
311328
'context': payload['context'],
329+
'status': payload['status'],
312330
'date_created': deserialize.iso8601_datetime(payload['date_created']),
313331
'date_updated': deserialize.iso8601_datetime(payload['date_updated']),
314332
'url': payload['url'],
@@ -376,14 +394,6 @@ def contact_channel_address(self):
376394
"""
377395
return self._properties['contact_channel_address']
378396

379-
@property
380-
def status(self):
381-
"""
382-
:returns: The status
383-
:rtype: EngagementInstance.Status
384-
"""
385-
return self._properties['status']
386-
387397
@property
388398
def context(self):
389399
"""
@@ -392,6 +402,14 @@ def context(self):
392402
"""
393403
return self._properties['context']
394404

405+
@property
406+
def status(self):
407+
"""
408+
:returns: The status
409+
:rtype: EngagementInstance.Status
410+
"""
411+
return self._properties['status']
412+
395413
@property
396414
def date_created(self):
397415
"""
@@ -443,6 +461,16 @@ def steps(self):
443461
"""
444462
return self._proxy.steps
445463

464+
@property
465+
def engagement_context(self):
466+
"""
467+
Access the engagement_context
468+
469+
:returns: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextList
470+
:rtype: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextList
471+
"""
472+
return self._proxy.engagement_context
473+
446474
def __repr__(self):
447475
"""
448476
Provide a friendly representation

0 commit comments

Comments
 (0)
0