twilio-ruby 5.33.0 → 5.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +9 -1
- data/CHANGES.md +29 -0
- data/README.md +2 -2
- data/lib/twilio-ruby.rb +3 -11
- data/lib/twilio-ruby/jwt/jwt.rb +6 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +3 -3
- data/lib/twilio-ruby/rest/studio.rb +2 -2
- data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +26 -0
- data/lib/twilio-ruby/rest/studio/v2.rb +3 -3
- data/lib/twilio-ruby/rest/studio/v2/flow.rb +7 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +71 -24
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +12 -11
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +21 -20
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +18 -15
- data/lib/twilio-ruby/twiml/twiml.rb +4 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +3 -2
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/bulkexports/v1/export/day_spec.rb +1 -1
- data/spec/integration/preview/bulk_exports/export/day_spec.rb +1 -1
- data/spec/integration/studio/v1/flow/execution_spec.rb +46 -0
- data/spec/integration/studio/v2/flow/execution_spec.rb +45 -0
- data/spec/integration/studio/v2/flow_spec.rb +4 -0
- data/spec/integration/studio/v2/flow_validate_spec.rb +2 -2
- data/spec/integration/video/v1/composition_settings_spec.rb +2 -2
- data/spec/integration/video/v1/recording_settings_spec.rb +2 -2
- data/spec/integration/video/v1/recording_spec.rb +2 -2
- data/spec/integration/video/v1/room/recording_spec.rb +2 -2
- data/twilio-ruby.gemspec +2 -2
- metadata +13 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bc2375a785a81e777ac954cf9e7a4f01253074c3b68ce2d2dd0e78490ed18dd3
|
|
4
|
+
data.tar.gz: b9886861ae41d1122f6ae717d38f8f2d55d4576f474f8027a1c280f1557dc385
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 64fffab9445d38a5ed7e5480e9ef87c3154ecfd4016d28316cb56532e6cf87ba0654917ddfa59297dba68dc98f97b0a7ea63633d60eaac2556364f58d72a245a
|
|
7
|
+
data.tar.gz: 15fa8917d0fc09a101cdb184b8e6e365c140d213ea4df25bd62e0f0b922bda74177ce5e3a3300c9c71095d18668bbbc1318ef095a973c23aca2be33d2babf245
|
data/.travis.yml
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
sudo: false
|
|
2
1
|
language: ruby
|
|
3
2
|
cache: bundler
|
|
4
3
|
bundler_args: --without development
|
|
@@ -34,3 +33,12 @@ deploy:
|
|
|
34
33
|
on:
|
|
35
34
|
tags: true
|
|
36
35
|
rvm: "2.4"
|
|
36
|
+
|
|
37
|
+
notifications:
|
|
38
|
+
slack:
|
|
39
|
+
if: branch = master
|
|
40
|
+
on_pull_requests: false
|
|
41
|
+
on_success: never
|
|
42
|
+
on_failure: change
|
|
43
|
+
rooms:
|
|
44
|
+
- secure: AxzkBxp8izIXqkOEDiUaGjjym60GvuJeV1sBAHnLXqujDDpvdCeM+G8r274Xp48l7YqFz72PR2prFrAl8qMY5IVVFBolH1BtXqa7MsgclFKXXhq87y7OqzrUHVwdB1TAhse7k/wkeVN+mFPZswzSYqDzR3WmAbBG0iT6d1szO6c=
|
data/CHANGES.md
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
twilio-ruby changelog
|
|
2
2
|
=====================
|
|
3
3
|
|
|
4
|
+
[2020-04-15] Version 5.33.1
|
|
5
|
+
---------------------------
|
|
6
|
+
**Library - Fix**
|
|
7
|
+
- [PR #506](https://github.com/twilio/twilio-ruby/pull/506): loosen the faraday version requirement. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
|
8
|
+
|
|
9
|
+
**Library - Chore**
|
|
10
|
+
- [PR #508](https://github.com/twilio/twilio-ruby/pull/508): Refer to https:// homepage in gemspec. Thanks to [@olleolleolle](https://github.com/olleolleolle)!
|
|
11
|
+
- [PR #507](https://github.com/twilio/twilio-ruby/pull/507): Travis: Drop unused "sudo: false" directive. Thanks to [@olleolleolle](https://github.com/olleolleolle)!
|
|
12
|
+
- [PR #498](https://github.com/twilio/twilio-ruby/pull/498): autoload TwiML to save memory on load. Thanks to [@philnash](https://github.com/philnash)!
|
|
13
|
+
- [PR #499](https://github.com/twilio/twilio-ruby/pull/499): autoload JWT classes. Thanks to [@philnash](https://github.com/philnash)!
|
|
14
|
+
- [PR #505](https://github.com/twilio/twilio-ruby/pull/505): remove S3 URLs from test data. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
|
15
|
+
|
|
16
|
+
**Api**
|
|
17
|
+
- Updated description for property `call_reason` in the call create request
|
|
18
|
+
|
|
19
|
+
**Contacts**
|
|
20
|
+
- Added Read, Delete All, and Delete by SID docs
|
|
21
|
+
- Initial Release
|
|
22
|
+
|
|
23
|
+
**Studio**
|
|
24
|
+
- Rename `flow_valid` to `flow_validate`
|
|
25
|
+
- Removed `errors` and `warnings` from flows error response and added new property named `details`
|
|
26
|
+
- Add Update Execution endpoints to v1 and v2 to end execution via API
|
|
27
|
+
- Add new `warnings` attribute v2 flow POST api
|
|
28
|
+
|
|
29
|
+
**Twiml**
|
|
30
|
+
- Add enhanced attribute to use with `speech_model` for the `Gather` verb
|
|
31
|
+
|
|
32
|
+
|
|
4
33
|
[2020-04-01] Version 5.33.0
|
|
5
34
|
---------------------------
|
|
6
35
|
**Library - Chore**
|
data/README.md
CHANGED
|
@@ -32,13 +32,13 @@ This library supports the following Ruby implementations:
|
|
|
32
32
|
To install using [Bundler][bundler] grab the latest stable version:
|
|
33
33
|
|
|
34
34
|
```ruby
|
|
35
|
-
gem 'twilio-ruby', '~> 5.33.
|
|
35
|
+
gem 'twilio-ruby', '~> 5.33.1'
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
gem install twilio-ruby -v 5.33.
|
|
41
|
+
gem install twilio-ruby -v 5.33.1
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
To build and install the development branch yourself from the latest source:
|
data/lib/twilio-ruby.rb
CHANGED
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
require 'net/http'
|
|
4
4
|
require 'net/https'
|
|
5
|
-
require 'nokogiri'
|
|
6
5
|
require 'cgi'
|
|
7
6
|
require 'openssl'
|
|
8
7
|
require 'base64'
|
|
9
8
|
require 'forwardable'
|
|
10
|
-
require 'jwt'
|
|
11
9
|
require 'time'
|
|
12
10
|
require 'json'
|
|
13
11
|
|
|
@@ -15,18 +13,9 @@ require 'twilio-ruby/version' unless defined?(Twilio::VERSION)
|
|
|
15
13
|
require 'rack/twilio_webhook_authentication'
|
|
16
14
|
|
|
17
15
|
require 'twilio-ruby/util'
|
|
18
|
-
require 'twilio-ruby/jwt/jwt'
|
|
19
|
-
require 'twilio-ruby/jwt/access_token'
|
|
20
|
-
require 'twilio-ruby/jwt/client_capability'
|
|
21
|
-
require 'twilio-ruby/jwt/task_router'
|
|
22
16
|
require 'twilio-ruby/security/request_validator'
|
|
23
17
|
require 'twilio-ruby/util/configuration'
|
|
24
18
|
|
|
25
|
-
require 'twilio-ruby/twiml/twiml'
|
|
26
|
-
require 'twilio-ruby/twiml/fax_response'
|
|
27
|
-
require 'twilio-ruby/twiml/messaging_response'
|
|
28
|
-
require 'twilio-ruby/twiml/voice_response'
|
|
29
|
-
|
|
30
19
|
Dir[File.dirname(__FILE__) + '/twilio-ruby/http/**/*.rb'].sort.each do |file|
|
|
31
20
|
require file
|
|
32
21
|
end
|
|
@@ -46,6 +35,9 @@ end
|
|
|
46
35
|
module Twilio
|
|
47
36
|
extend SingleForwardable
|
|
48
37
|
|
|
38
|
+
autoload :JWT, File.join(File.dirname(__FILE__), 'twilio-ruby', 'jwt', 'jwt.rb')
|
|
39
|
+
autoload :TwiML, File.join(File.dirname(__FILE__), 'twilio-ruby', 'twiml', 'twiml.rb')
|
|
40
|
+
|
|
49
41
|
def_delegators :configuration, :account_sid, :auth_token, :http_client
|
|
50
42
|
|
|
51
43
|
##
|
data/lib/twilio-ruby/jwt/jwt.rb
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'jwt'
|
|
4
|
+
|
|
3
5
|
module Twilio
|
|
4
6
|
module JWT
|
|
7
|
+
autoload :AccessToken, File.join(File.dirname(__FILE__), 'access_token.rb')
|
|
8
|
+
autoload :ClientCapability, File.join(File.dirname(__FILE__), 'client_capability.rb')
|
|
9
|
+
autoload :TaskRouterCapability, File.join(File.dirname(__FILE__), 'task_router.rb')
|
|
10
|
+
|
|
5
11
|
class BaseJWT
|
|
6
12
|
# valid_until overrides ttl if specified
|
|
7
13
|
def initialize(secret_key: nil, issuer: nil, subject: nil, nbf: nil, ttl: 3600, valid_until: nil)
|
|
@@ -139,9 +139,9 @@ module Twilio
|
|
|
139
139
|
# @param [String] byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route
|
|
140
140
|
# this call with. Note that `byoc` is only meaningful when `to` is a phone number;
|
|
141
141
|
# it will otherwise be ignored. (Beta)
|
|
142
|
-
# @param [String] call_reason The Reason for the outgoing call. Use
|
|
143
|
-
#
|
|
144
|
-
#
|
|
142
|
+
# @param [String] call_reason The Reason for the outgoing call. Use it to specify
|
|
143
|
+
# the purpose of the call that is presented on the called party's phone. (Branded
|
|
144
|
+
# Calls Beta)
|
|
145
145
|
# @param [String] url The absolute URL that returns the TwiML instructions for the
|
|
146
146
|
# call. We will call this URL using the `method` when the call connects. For more
|
|
147
147
|
# information, see the [Url
|
|
@@ -245,6 +245,23 @@ module Twilio
|
|
|
245
245
|
@version.delete('delete', @uri)
|
|
246
246
|
end
|
|
247
247
|
|
|
248
|
+
##
|
|
249
|
+
# Update the ExecutionInstance
|
|
250
|
+
# @param [execution.Status] status The status of the Execution. Can only be
|
|
251
|
+
# `ended`.
|
|
252
|
+
# @return [ExecutionInstance] Updated ExecutionInstance
|
|
253
|
+
def update(status: nil)
|
|
254
|
+
data = Twilio::Values.of({'Status' => status, })
|
|
255
|
+
|
|
256
|
+
payload = @version.update(
|
|
257
|
+
'POST',
|
|
258
|
+
@uri,
|
|
259
|
+
data: data,
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
ExecutionInstance.new(@version, payload, flow_sid: @solution[:flow_sid], sid: @solution[:sid], )
|
|
263
|
+
end
|
|
264
|
+
|
|
248
265
|
##
|
|
249
266
|
# Access the steps
|
|
250
267
|
# @return [ExecutionStepList]
|
|
@@ -412,6 +429,15 @@ module Twilio
|
|
|
412
429
|
context.delete
|
|
413
430
|
end
|
|
414
431
|
|
|
432
|
+
##
|
|
433
|
+
# Update the ExecutionInstance
|
|
434
|
+
# @param [execution.Status] status The status of the Execution. Can only be
|
|
435
|
+
# `ended`.
|
|
436
|
+
# @return [ExecutionInstance] Updated ExecutionInstance
|
|
437
|
+
def update(status: nil)
|
|
438
|
+
context.update(status: status, )
|
|
439
|
+
end
|
|
440
|
+
|
|
415
441
|
##
|
|
416
442
|
# Access the steps
|
|
417
443
|
# @return [steps] steps
|
|
@@ -16,7 +16,7 @@ module Twilio
|
|
|
16
16
|
super
|
|
17
17
|
@version = 'v2'
|
|
18
18
|
@flows = nil
|
|
19
|
-
@
|
|
19
|
+
@flow_validate = nil
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
##
|
|
@@ -35,8 +35,8 @@ module Twilio
|
|
|
35
35
|
|
|
36
36
|
##
|
|
37
37
|
# @return [Twilio::REST::Studio::V2::FlowValidateContext]
|
|
38
|
-
def
|
|
39
|
-
@
|
|
38
|
+
def flow_validate
|
|
39
|
+
@flow_validate ||= FlowValidateList.new self
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
##
|
|
@@ -321,6 +321,7 @@ module Twilio
|
|
|
321
321
|
'commit_message' => payload['commit_message'],
|
|
322
322
|
'valid' => payload['valid'],
|
|
323
323
|
'errors' => payload['errors'],
|
|
324
|
+
'warnings' => payload['warnings'],
|
|
324
325
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
|
325
326
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
326
327
|
'webhook_url' => payload['webhook_url'],
|
|
@@ -398,6 +399,12 @@ module Twilio
|
|
|
398
399
|
@properties['errors']
|
|
399
400
|
end
|
|
400
401
|
|
|
402
|
+
##
|
|
403
|
+
# @return [Hash] List of warnings in the flow definition
|
|
404
|
+
def warnings
|
|
405
|
+
@properties['warnings']
|
|
406
|
+
end
|
|
407
|
+
|
|
401
408
|
##
|
|
402
409
|
# @return [Time] The ISO 8601 date and time in GMT when the resource was created
|
|
403
410
|
def date_created
|
|
@@ -17,7 +17,7 @@ module Twilio
|
|
|
17
17
|
##
|
|
18
18
|
# Initialize the ExecutionList
|
|
19
19
|
# @param [Version] version Version that contains the resource
|
|
20
|
-
# @param [String] flow_sid The
|
|
20
|
+
# @param [String] flow_sid The SID of the Flow.
|
|
21
21
|
# @return [ExecutionList] ExecutionList
|
|
22
22
|
def initialize(version, flow_sid: nil)
|
|
23
23
|
super(version)
|
|
@@ -31,8 +31,12 @@ module Twilio
|
|
|
31
31
|
# Lists ExecutionInstance records from the API as a list.
|
|
32
32
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
33
33
|
# memory before returning.
|
|
34
|
-
# @param [Time] date_created_from
|
|
35
|
-
#
|
|
34
|
+
# @param [Time] date_created_from Only show Execution resources starting on or
|
|
35
|
+
# after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given
|
|
36
|
+
# as `YYYY-MM-DDThh:mm:ss-hh:mm`.
|
|
37
|
+
# @param [Time] date_created_to Only show Execution resources starting before this
|
|
38
|
+
# [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as
|
|
39
|
+
# `YYYY-MM-DDThh:mm:ss-hh:mm`.
|
|
36
40
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
37
41
|
# guarantees to never return more than limit. Default is no limit
|
|
38
42
|
# @param [Integer] page_size Number of records to fetch per request, when
|
|
@@ -53,8 +57,12 @@ module Twilio
|
|
|
53
57
|
# Streams ExecutionInstance records from the API as an Enumerable.
|
|
54
58
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
55
59
|
# is reached.
|
|
56
|
-
# @param [Time] date_created_from
|
|
57
|
-
#
|
|
60
|
+
# @param [Time] date_created_from Only show Execution resources starting on or
|
|
61
|
+
# after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given
|
|
62
|
+
# as `YYYY-MM-DDThh:mm:ss-hh:mm`.
|
|
63
|
+
# @param [Time] date_created_to Only show Execution resources starting before this
|
|
64
|
+
# [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as
|
|
65
|
+
# `YYYY-MM-DDThh:mm:ss-hh:mm`.
|
|
58
66
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
59
67
|
# guarantees to never return more than limit. Default is no limit.
|
|
60
68
|
# @param [Integer] page_size Number of records to fetch per request, when
|
|
@@ -91,8 +99,12 @@ module Twilio
|
|
|
91
99
|
##
|
|
92
100
|
# Retrieve a single page of ExecutionInstance records from the API.
|
|
93
101
|
# Request is executed immediately.
|
|
94
|
-
# @param [Time] date_created_from
|
|
95
|
-
#
|
|
102
|
+
# @param [Time] date_created_from Only show Execution resources starting on or
|
|
103
|
+
# after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given
|
|
104
|
+
# as `YYYY-MM-DDThh:mm:ss-hh:mm`.
|
|
105
|
+
# @param [Time] date_created_to Only show Execution resources starting before this
|
|
106
|
+
# [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as
|
|
107
|
+
# `YYYY-MM-DDThh:mm:ss-hh:mm`.
|
|
96
108
|
# @param [String] page_token PageToken provided by the API
|
|
97
109
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
98
110
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
@@ -129,9 +141,17 @@ module Twilio
|
|
|
129
141
|
##
|
|
130
142
|
# Retrieve a single page of ExecutionInstance records from the API.
|
|
131
143
|
# Request is executed immediately.
|
|
132
|
-
# @param [String] to The to
|
|
133
|
-
#
|
|
134
|
-
# @param [
|
|
144
|
+
# @param [String] to The Contact phone number to start a Studio Flow Execution,
|
|
145
|
+
# available as variable `{{contact.channel.address}}`.
|
|
146
|
+
# @param [String] from The Twilio phone number to send messages or initiate calls
|
|
147
|
+
# from during the Flow's Execution. Available as variable
|
|
148
|
+
# `{{flow.channel.address}}`.
|
|
149
|
+
# @param [Hash] parameters JSON data that will be added to the Flow's context and
|
|
150
|
+
# that can be accessed as variables inside your Flow. For example, if you pass in
|
|
151
|
+
# `Parameters={"name":"Zeke"}`, a widget in your Flow can reference the variable
|
|
152
|
+
# `{{flow.data.name}}`, which returns "Zeke". Note: the JSON value must explicitly
|
|
153
|
+
# be passed as a string, not as a hash object. Depending on your particular HTTP
|
|
154
|
+
# library, you may need to add quotes or URL encode the JSON string.
|
|
135
155
|
# @return [ExecutionInstance] Newly created ExecutionInstance
|
|
136
156
|
def create(to: nil, from: nil, parameters: :unset)
|
|
137
157
|
data = Twilio::Values.of({
|
|
@@ -193,8 +213,9 @@ module Twilio
|
|
|
193
213
|
##
|
|
194
214
|
# Initialize the ExecutionContext
|
|
195
215
|
# @param [Version] version Version that contains the resource
|
|
196
|
-
# @param [String] flow_sid The
|
|
197
|
-
#
|
|
216
|
+
# @param [String] flow_sid The SID of the Flow with the Execution resource to
|
|
217
|
+
# fetch
|
|
218
|
+
# @param [String] sid The SID of the Execution resource to fetch.
|
|
198
219
|
# @return [ExecutionContext] ExecutionContext
|
|
199
220
|
def initialize(version, flow_sid, sid)
|
|
200
221
|
super(version)
|
|
@@ -230,6 +251,23 @@ module Twilio
|
|
|
230
251
|
@version.delete('delete', @uri)
|
|
231
252
|
end
|
|
232
253
|
|
|
254
|
+
##
|
|
255
|
+
# Update the ExecutionInstance
|
|
256
|
+
# @param [execution.Status] status The status of the Execution. Can only be
|
|
257
|
+
# `ended`.
|
|
258
|
+
# @return [ExecutionInstance] Updated ExecutionInstance
|
|
259
|
+
def update(status: nil)
|
|
260
|
+
data = Twilio::Values.of({'Status' => status, })
|
|
261
|
+
|
|
262
|
+
payload = @version.update(
|
|
263
|
+
'POST',
|
|
264
|
+
@uri,
|
|
265
|
+
data: data,
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
ExecutionInstance.new(@version, payload, flow_sid: @solution[:flow_sid], sid: @solution[:sid], )
|
|
269
|
+
end
|
|
270
|
+
|
|
233
271
|
##
|
|
234
272
|
# Access the steps
|
|
235
273
|
# @return [ExecutionStepList]
|
|
@@ -282,8 +320,8 @@ module Twilio
|
|
|
282
320
|
# Initialize the ExecutionInstance
|
|
283
321
|
# @param [Version] version Version that contains the resource
|
|
284
322
|
# @param [Hash] payload payload that contains response from Twilio
|
|
285
|
-
# @param [String] flow_sid The
|
|
286
|
-
# @param [String] sid The
|
|
323
|
+
# @param [String] flow_sid The SID of the Flow.
|
|
324
|
+
# @param [String] sid The SID of the Execution resource to fetch.
|
|
287
325
|
# @return [ExecutionInstance] ExecutionInstance
|
|
288
326
|
def initialize(version, payload, flow_sid: nil, sid: nil)
|
|
289
327
|
super(version)
|
|
@@ -319,61 +357,61 @@ module Twilio
|
|
|
319
357
|
end
|
|
320
358
|
|
|
321
359
|
##
|
|
322
|
-
# @return [String] The
|
|
360
|
+
# @return [String] The unique string that identifies the resource
|
|
323
361
|
def sid
|
|
324
362
|
@properties['sid']
|
|
325
363
|
end
|
|
326
364
|
|
|
327
365
|
##
|
|
328
|
-
# @return [String] The
|
|
366
|
+
# @return [String] The SID of the Account that created the resource
|
|
329
367
|
def account_sid
|
|
330
368
|
@properties['account_sid']
|
|
331
369
|
end
|
|
332
370
|
|
|
333
371
|
##
|
|
334
|
-
# @return [String] The
|
|
372
|
+
# @return [String] The SID of the Flow
|
|
335
373
|
def flow_sid
|
|
336
374
|
@properties['flow_sid']
|
|
337
375
|
end
|
|
338
376
|
|
|
339
377
|
##
|
|
340
|
-
# @return [String] The
|
|
378
|
+
# @return [String] The phone number, SIP address or Client identifier that triggered the Execution
|
|
341
379
|
def contact_channel_address
|
|
342
380
|
@properties['contact_channel_address']
|
|
343
381
|
end
|
|
344
382
|
|
|
345
383
|
##
|
|
346
|
-
# @return [Hash] The
|
|
384
|
+
# @return [Hash] The current state of the flow
|
|
347
385
|
def context
|
|
348
386
|
@properties['context']
|
|
349
387
|
end
|
|
350
388
|
|
|
351
389
|
##
|
|
352
|
-
# @return [execution.Status] The status
|
|
390
|
+
# @return [execution.Status] The status of the Execution
|
|
353
391
|
def status
|
|
354
392
|
@properties['status']
|
|
355
393
|
end
|
|
356
394
|
|
|
357
395
|
##
|
|
358
|
-
# @return [Time] The
|
|
396
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was created
|
|
359
397
|
def date_created
|
|
360
398
|
@properties['date_created']
|
|
361
399
|
end
|
|
362
400
|
|
|
363
401
|
##
|
|
364
|
-
# @return [Time] The
|
|
402
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
|
|
365
403
|
def date_updated
|
|
366
404
|
@properties['date_updated']
|
|
367
405
|
end
|
|
368
406
|
|
|
369
407
|
##
|
|
370
|
-
# @return [String] The
|
|
408
|
+
# @return [String] The absolute URL of the resource
|
|
371
409
|
def url
|
|
372
410
|
@properties['url']
|
|
373
411
|
end
|
|
374
412
|
|
|
375
413
|
##
|
|
376
|
-
# @return [String]
|
|
414
|
+
# @return [String] Nested resource URLs
|
|
377
415
|
def links
|
|
378
416
|
@properties['links']
|
|
379
417
|
end
|
|
@@ -392,6 +430,15 @@ module Twilio
|
|
|
392
430
|
context.delete
|
|
393
431
|
end
|
|
394
432
|
|
|
433
|
+
##
|
|
434
|
+
# Update the ExecutionInstance
|
|
435
|
+
# @param [execution.Status] status The status of the Execution. Can only be
|
|
436
|
+
# `ended`.
|
|
437
|
+
# @return [ExecutionInstance] Updated ExecutionInstance
|
|
438
|
+
def update(status: nil)
|
|
439
|
+
context.update(status: status, )
|
|
440
|
+
end
|
|
441
|
+
|
|
395
442
|
##
|
|
396
443
|
# Access the steps
|
|
397
444
|
# @return [steps] steps
|
|
@@ -18,8 +18,8 @@ module Twilio
|
|
|
18
18
|
##
|
|
19
19
|
# Initialize the ExecutionContextList
|
|
20
20
|
# @param [Version] version Version that contains the resource
|
|
21
|
-
# @param [String] flow_sid The
|
|
22
|
-
# @param [String] execution_sid The
|
|
21
|
+
# @param [String] flow_sid The SID of the Flow.
|
|
22
|
+
# @param [String] execution_sid The SID of the context's Execution resource.
|
|
23
23
|
# @return [ExecutionContextList] ExecutionContextList
|
|
24
24
|
def initialize(version, flow_sid: nil, execution_sid: nil)
|
|
25
25
|
super(version)
|
|
@@ -77,8 +77,9 @@ module Twilio
|
|
|
77
77
|
##
|
|
78
78
|
# Initialize the ExecutionContextContext
|
|
79
79
|
# @param [Version] version Version that contains the resource
|
|
80
|
-
# @param [String] flow_sid The
|
|
81
|
-
#
|
|
80
|
+
# @param [String] flow_sid The SID of the Flow with the Execution context to
|
|
81
|
+
# fetch.
|
|
82
|
+
# @param [String] execution_sid The SID of the Execution context to fetch.
|
|
82
83
|
# @return [ExecutionContextContext] ExecutionContextContext
|
|
83
84
|
def initialize(version, flow_sid, execution_sid)
|
|
84
85
|
super(version)
|
|
@@ -130,8 +131,8 @@ module Twilio
|
|
|
130
131
|
# Initialize the ExecutionContextInstance
|
|
131
132
|
# @param [Version] version Version that contains the resource
|
|
132
133
|
# @param [Hash] payload payload that contains response from Twilio
|
|
133
|
-
# @param [String] flow_sid The
|
|
134
|
-
# @param [String] execution_sid The
|
|
134
|
+
# @param [String] flow_sid The SID of the Flow.
|
|
135
|
+
# @param [String] execution_sid The SID of the context's Execution resource.
|
|
135
136
|
# @return [ExecutionContextInstance] ExecutionContextInstance
|
|
136
137
|
def initialize(version, payload, flow_sid: nil, execution_sid: nil)
|
|
137
138
|
super(version)
|
|
@@ -166,31 +167,31 @@ module Twilio
|
|
|
166
167
|
end
|
|
167
168
|
|
|
168
169
|
##
|
|
169
|
-
# @return [String] The
|
|
170
|
+
# @return [String] The SID of the Account that created the resource
|
|
170
171
|
def account_sid
|
|
171
172
|
@properties['account_sid']
|
|
172
173
|
end
|
|
173
174
|
|
|
174
175
|
##
|
|
175
|
-
# @return [Hash] The
|
|
176
|
+
# @return [Hash] The current state of the flow
|
|
176
177
|
def context
|
|
177
178
|
@properties['context']
|
|
178
179
|
end
|
|
179
180
|
|
|
180
181
|
##
|
|
181
|
-
# @return [String] The
|
|
182
|
+
# @return [String] The SID of the Flow
|
|
182
183
|
def flow_sid
|
|
183
184
|
@properties['flow_sid']
|
|
184
185
|
end
|
|
185
186
|
|
|
186
187
|
##
|
|
187
|
-
# @return [String] The
|
|
188
|
+
# @return [String] The SID of the Execution
|
|
188
189
|
def execution_sid
|
|
189
190
|
@properties['execution_sid']
|
|
190
191
|
end
|
|
191
192
|
|
|
192
193
|
##
|
|
193
|
-
# @return [String] The
|
|
194
|
+
# @return [String] The absolute URL of the resource
|
|
194
195
|
def url
|
|
195
196
|
@properties['url']
|
|
196
197
|
end
|
|
@@ -18,8 +18,8 @@ module Twilio
|
|
|
18
18
|
##
|
|
19
19
|
# Initialize the ExecutionStepList
|
|
20
20
|
# @param [Version] version Version that contains the resource
|
|
21
|
-
# @param [String] flow_sid The
|
|
22
|
-
# @param [String] execution_sid The
|
|
21
|
+
# @param [String] flow_sid The SID of the Flow.
|
|
22
|
+
# @param [String] execution_sid The SID of the Step's Execution resource.
|
|
23
23
|
# @return [ExecutionStepList] ExecutionStepList
|
|
24
24
|
def initialize(version, flow_sid: nil, execution_sid: nil)
|
|
25
25
|
super(version)
|
|
@@ -160,9 +160,10 @@ module Twilio
|
|
|
160
160
|
##
|
|
161
161
|
# Initialize the ExecutionStepContext
|
|
162
162
|
# @param [Version] version Version that contains the resource
|
|
163
|
-
# @param [String] flow_sid The
|
|
164
|
-
# @param [String] execution_sid The
|
|
165
|
-
#
|
|
163
|
+
# @param [String] flow_sid The SID of the Flow with the Step to fetch.
|
|
164
|
+
# @param [String] execution_sid The SID of the Execution resource with the Step to
|
|
165
|
+
# fetch.
|
|
166
|
+
# @param [String] sid The SID of the ExecutionStep resource to fetch.
|
|
166
167
|
# @return [ExecutionStepContext] ExecutionStepContext
|
|
167
168
|
def initialize(version, flow_sid, execution_sid, sid)
|
|
168
169
|
super(version)
|
|
@@ -231,9 +232,9 @@ module Twilio
|
|
|
231
232
|
# Initialize the ExecutionStepInstance
|
|
232
233
|
# @param [Version] version Version that contains the resource
|
|
233
234
|
# @param [Hash] payload payload that contains response from Twilio
|
|
234
|
-
# @param [String] flow_sid The
|
|
235
|
-
# @param [String] execution_sid The
|
|
236
|
-
# @param [String] sid The
|
|
235
|
+
# @param [String] flow_sid The SID of the Flow.
|
|
236
|
+
# @param [String] execution_sid The SID of the Step's Execution resource.
|
|
237
|
+
# @param [String] sid The SID of the ExecutionStep resource to fetch.
|
|
237
238
|
# @return [ExecutionStepInstance] ExecutionStepInstance
|
|
238
239
|
def initialize(version, payload, flow_sid: nil, execution_sid: nil, sid: nil)
|
|
239
240
|
super(version)
|
|
@@ -280,73 +281,73 @@ module Twilio
|
|
|
280
281
|
end
|
|
281
282
|
|
|
282
283
|
##
|
|
283
|
-
# @return [String] The
|
|
284
|
+
# @return [String] The unique string that identifies the resource
|
|
284
285
|
def sid
|
|
285
286
|
@properties['sid']
|
|
286
287
|
end
|
|
287
288
|
|
|
288
289
|
##
|
|
289
|
-
# @return [String] The
|
|
290
|
+
# @return [String] The SID of the Account that created the resource
|
|
290
291
|
def account_sid
|
|
291
292
|
@properties['account_sid']
|
|
292
293
|
end
|
|
293
294
|
|
|
294
295
|
##
|
|
295
|
-
# @return [String] The
|
|
296
|
+
# @return [String] The SID of the Flow
|
|
296
297
|
def flow_sid
|
|
297
298
|
@properties['flow_sid']
|
|
298
299
|
end
|
|
299
300
|
|
|
300
301
|
##
|
|
301
|
-
# @return [String] The
|
|
302
|
+
# @return [String] The SID of the Execution
|
|
302
303
|
def execution_sid
|
|
303
304
|
@properties['execution_sid']
|
|
304
305
|
end
|
|
305
306
|
|
|
306
307
|
##
|
|
307
|
-
# @return [String] The
|
|
308
|
+
# @return [String] The event that caused the Flow to transition to the Step
|
|
308
309
|
def name
|
|
309
310
|
@properties['name']
|
|
310
311
|
end
|
|
311
312
|
|
|
312
313
|
##
|
|
313
|
-
# @return [Hash] The
|
|
314
|
+
# @return [Hash] The current state of the flow
|
|
314
315
|
def context
|
|
315
316
|
@properties['context']
|
|
316
317
|
end
|
|
317
318
|
|
|
318
319
|
##
|
|
319
|
-
# @return [String] The
|
|
320
|
+
# @return [String] The Widget that preceded the Widget for the Step
|
|
320
321
|
def transitioned_from
|
|
321
322
|
@properties['transitioned_from']
|
|
322
323
|
end
|
|
323
324
|
|
|
324
325
|
##
|
|
325
|
-
# @return [String] The
|
|
326
|
+
# @return [String] The Widget that will follow the Widget for the Step
|
|
326
327
|
def transitioned_to
|
|
327
328
|
@properties['transitioned_to']
|
|
328
329
|
end
|
|
329
330
|
|
|
330
331
|
##
|
|
331
|
-
# @return [Time] The
|
|
332
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was created
|
|
332
333
|
def date_created
|
|
333
334
|
@properties['date_created']
|
|
334
335
|
end
|
|
335
336
|
|
|
336
337
|
##
|
|
337
|
-
# @return [Time] The
|
|
338
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
|
|
338
339
|
def date_updated
|
|
339
340
|
@properties['date_updated']
|
|
340
341
|
end
|
|
341
342
|
|
|
342
343
|
##
|
|
343
|
-
# @return [String] The
|
|
344
|
+
# @return [String] The absolute URL of the resource
|
|
344
345
|
def url
|
|
345
346
|
@properties['url']
|
|
346
347
|
end
|
|
347
348
|
|
|
348
349
|
##
|
|
349
|
-
# @return [String] The
|
|
350
|
+
# @return [String] The URLs of related resources
|
|
350
351
|
def links
|
|
351
352
|
@properties['links']
|
|
352
353
|
end
|
|
@@ -19,9 +19,10 @@ module Twilio
|
|
|
19
19
|
##
|
|
20
20
|
# Initialize the ExecutionStepContextList
|
|
21
21
|
# @param [Version] version Version that contains the resource
|
|
22
|
-
# @param [String] flow_sid The
|
|
23
|
-
# @param [String] execution_sid The
|
|
24
|
-
# @param [String] step_sid The
|
|
22
|
+
# @param [String] flow_sid The SID of the Flow.
|
|
23
|
+
# @param [String] execution_sid The SID of the context's Execution resource.
|
|
24
|
+
# @param [String] step_sid The SID of the Step that the context is associated
|
|
25
|
+
# with.
|
|
25
26
|
# @return [ExecutionStepContextList] ExecutionStepContextList
|
|
26
27
|
def initialize(version, flow_sid: nil, execution_sid: nil, step_sid: nil)
|
|
27
28
|
super(version)
|
|
@@ -80,9 +81,10 @@ module Twilio
|
|
|
80
81
|
##
|
|
81
82
|
# Initialize the ExecutionStepContextContext
|
|
82
83
|
# @param [Version] version Version that contains the resource
|
|
83
|
-
# @param [String] flow_sid The
|
|
84
|
-
# @param [String] execution_sid The
|
|
85
|
-
#
|
|
84
|
+
# @param [String] flow_sid The SID of the Flow with the Step to fetch.
|
|
85
|
+
# @param [String] execution_sid The SID of the Execution resource with the Step to
|
|
86
|
+
# fetch.
|
|
87
|
+
# @param [String] step_sid The SID of the Step to fetch.
|
|
86
88
|
# @return [ExecutionStepContextContext] ExecutionStepContextContext
|
|
87
89
|
def initialize(version, flow_sid, execution_sid, step_sid)
|
|
88
90
|
super(version)
|
|
@@ -135,9 +137,10 @@ module Twilio
|
|
|
135
137
|
# Initialize the ExecutionStepContextInstance
|
|
136
138
|
# @param [Version] version Version that contains the resource
|
|
137
139
|
# @param [Hash] payload payload that contains response from Twilio
|
|
138
|
-
# @param [String] flow_sid The
|
|
139
|
-
# @param [String] execution_sid The
|
|
140
|
-
# @param [String] step_sid The
|
|
140
|
+
# @param [String] flow_sid The SID of the Flow.
|
|
141
|
+
# @param [String] execution_sid The SID of the context's Execution resource.
|
|
142
|
+
# @param [String] step_sid The SID of the Step that the context is associated
|
|
143
|
+
# with.
|
|
141
144
|
# @return [ExecutionStepContextInstance] ExecutionStepContextInstance
|
|
142
145
|
def initialize(version, payload, flow_sid: nil, execution_sid: nil, step_sid: nil)
|
|
143
146
|
super(version)
|
|
@@ -174,37 +177,37 @@ module Twilio
|
|
|
174
177
|
end
|
|
175
178
|
|
|
176
179
|
##
|
|
177
|
-
# @return [String] The
|
|
180
|
+
# @return [String] The SID of the Account that created the resource
|
|
178
181
|
def account_sid
|
|
179
182
|
@properties['account_sid']
|
|
180
183
|
end
|
|
181
184
|
|
|
182
185
|
##
|
|
183
|
-
# @return [Hash] The
|
|
186
|
+
# @return [Hash] The current state of the flow
|
|
184
187
|
def context
|
|
185
188
|
@properties['context']
|
|
186
189
|
end
|
|
187
190
|
|
|
188
191
|
##
|
|
189
|
-
# @return [String] The
|
|
192
|
+
# @return [String] The SID of the Execution
|
|
190
193
|
def execution_sid
|
|
191
194
|
@properties['execution_sid']
|
|
192
195
|
end
|
|
193
196
|
|
|
194
197
|
##
|
|
195
|
-
# @return [String] The
|
|
198
|
+
# @return [String] The SID of the Flow
|
|
196
199
|
def flow_sid
|
|
197
200
|
@properties['flow_sid']
|
|
198
201
|
end
|
|
199
202
|
|
|
200
203
|
##
|
|
201
|
-
# @return [String]
|
|
204
|
+
# @return [String] Step SID
|
|
202
205
|
def step_sid
|
|
203
206
|
@properties['step_sid']
|
|
204
207
|
end
|
|
205
208
|
|
|
206
209
|
##
|
|
207
|
-
# @return [String] The
|
|
210
|
+
# @return [String] The absolute URL of the resource
|
|
208
211
|
def url
|
|
209
212
|
@properties['url']
|
|
210
213
|
end
|
|
@@ -2,6 +2,10 @@ require 'nokogiri'
|
|
|
2
2
|
|
|
3
3
|
module Twilio
|
|
4
4
|
module TwiML
|
|
5
|
+
autoload :FaxResponse, File.join(File.dirname(__FILE__), "fax_response.rb")
|
|
6
|
+
autoload :MessagingResponse, File.join(File.dirname(__FILE__), "messaging_response.rb")
|
|
7
|
+
autoload :VoiceResponse, File.join(File.dirname(__FILE__), "voice_response.rb")
|
|
8
|
+
|
|
5
9
|
class TwiMLError < StandardError; end
|
|
6
10
|
|
|
7
11
|
class LeafNode
|
|
@@ -96,9 +96,10 @@ module Twilio
|
|
|
96
96
|
# debug:: Allow debug for gather
|
|
97
97
|
# action_on_empty_result:: Force webhook to the action URL event if there is no input
|
|
98
98
|
# speech_model:: Specify the model that is best suited for your use case
|
|
99
|
+
# enhanced:: Use enhanced speech model
|
|
99
100
|
# keyword_args:: additional attributes
|
|
100
|
-
def gather(input: nil, action: nil, method: nil, timeout: nil, speech_timeout: nil, max_speech_time: nil, profanity_filter: nil, finish_on_key: nil, num_digits: nil, partial_result_callback: nil, partial_result_callback_method: nil, language: nil, hints: nil, barge_in: nil, debug: nil, action_on_empty_result: nil, speech_model: nil, **keyword_args)
|
|
101
|
-
gather = Gather.new(input: input, action: action, method: method, timeout: timeout, speech_timeout: speech_timeout, max_speech_time: max_speech_time, profanity_filter: profanity_filter, finish_on_key: finish_on_key, num_digits: num_digits, partial_result_callback: partial_result_callback, partial_result_callback_method: partial_result_callback_method, language: language, hints: hints, barge_in: barge_in, debug: debug, action_on_empty_result: action_on_empty_result, speech_model: speech_model, **keyword_args)
|
|
101
|
+
def gather(input: nil, action: nil, method: nil, timeout: nil, speech_timeout: nil, max_speech_time: nil, profanity_filter: nil, finish_on_key: nil, num_digits: nil, partial_result_callback: nil, partial_result_callback_method: nil, language: nil, hints: nil, barge_in: nil, debug: nil, action_on_empty_result: nil, speech_model: nil, enhanced: nil, **keyword_args)
|
|
102
|
+
gather = Gather.new(input: input, action: action, method: method, timeout: timeout, speech_timeout: speech_timeout, max_speech_time: max_speech_time, profanity_filter: profanity_filter, finish_on_key: finish_on_key, num_digits: num_digits, partial_result_callback: partial_result_callback, partial_result_callback_method: partial_result_callback_method, language: language, hints: hints, barge_in: barge_in, debug: debug, action_on_empty_result: action_on_empty_result, speech_model: speech_model, enhanced: enhanced, **keyword_args)
|
|
102
103
|
|
|
103
104
|
yield(gather) if block_given?
|
|
104
105
|
append(gather)
|
data/lib/twilio-ruby/version.rb
CHANGED
|
@@ -168,4 +168,50 @@ describe 'Execution' do
|
|
|
168
168
|
|
|
169
169
|
expect(actual).to eq(true)
|
|
170
170
|
end
|
|
171
|
+
|
|
172
|
+
it "can update" do
|
|
173
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
|
174
|
+
|
|
175
|
+
expect {
|
|
176
|
+
@client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
|
177
|
+
.executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(status: 'active')
|
|
178
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
|
179
|
+
|
|
180
|
+
values = {'Status' => 'active', }
|
|
181
|
+
expect(
|
|
182
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
|
183
|
+
method: 'post',
|
|
184
|
+
url: 'https://studio.twilio.com/v1/Flows/FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Executions/FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
|
185
|
+
data: values,
|
|
186
|
+
))).to eq(true)
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
it "receives update responses" do
|
|
190
|
+
@holodeck.mock(Twilio::Response.new(
|
|
191
|
+
200,
|
|
192
|
+
%q[
|
|
193
|
+
{
|
|
194
|
+
"url": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
195
|
+
"sid": "FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
196
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
197
|
+
"flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
198
|
+
"context": {},
|
|
199
|
+
"contact_sid": "FCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
200
|
+
"contact_channel_address": "+14155555555",
|
|
201
|
+
"status": "ended",
|
|
202
|
+
"date_created": "2017-11-06T12:00:00Z",
|
|
203
|
+
"date_updated": "2017-11-06T12:00:00Z",
|
|
204
|
+
"links": {
|
|
205
|
+
"steps": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps",
|
|
206
|
+
"execution_context": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
))
|
|
211
|
+
|
|
212
|
+
actual = @client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
|
213
|
+
.executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(status: 'active')
|
|
214
|
+
|
|
215
|
+
expect(actual).to_not eq(nil)
|
|
216
|
+
end
|
|
171
217
|
end
|
|
@@ -166,4 +166,49 @@ describe 'Execution' do
|
|
|
166
166
|
|
|
167
167
|
expect(actual).to eq(true)
|
|
168
168
|
end
|
|
169
|
+
|
|
170
|
+
it "can update" do
|
|
171
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
|
172
|
+
|
|
173
|
+
expect {
|
|
174
|
+
@client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
|
175
|
+
.executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(status: 'active')
|
|
176
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
|
177
|
+
|
|
178
|
+
values = {'Status' => 'active', }
|
|
179
|
+
expect(
|
|
180
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
|
181
|
+
method: 'post',
|
|
182
|
+
url: 'https://studio.twilio.com/v2/Flows/FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Executions/FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
|
183
|
+
data: values,
|
|
184
|
+
))).to eq(true)
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
it "receives update responses" do
|
|
188
|
+
@holodeck.mock(Twilio::Response.new(
|
|
189
|
+
200,
|
|
190
|
+
%q[
|
|
191
|
+
{
|
|
192
|
+
"url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
193
|
+
"sid": "FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
194
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
195
|
+
"flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
196
|
+
"context": {},
|
|
197
|
+
"contact_channel_address": "+14155555555",
|
|
198
|
+
"status": "ended",
|
|
199
|
+
"date_created": "2017-11-06T12:00:00Z",
|
|
200
|
+
"date_updated": "2017-11-06T12:00:00Z",
|
|
201
|
+
"links": {
|
|
202
|
+
"steps": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps",
|
|
203
|
+
"execution_context": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context"
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
))
|
|
208
|
+
|
|
209
|
+
actual = @client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
|
210
|
+
.executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(status: 'active')
|
|
211
|
+
|
|
212
|
+
expect(actual).to_not eq(nil)
|
|
213
|
+
end
|
|
169
214
|
end
|
|
@@ -45,6 +45,7 @@ describe 'Flow' do
|
|
|
45
45
|
"commit_message": null,
|
|
46
46
|
"valid": true,
|
|
47
47
|
"errors": [],
|
|
48
|
+
"warnings": [],
|
|
48
49
|
"webhook_url": "http://webhooks.twilio.com/v1/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
49
50
|
"date_created": "2017-11-06T12:00:00Z",
|
|
50
51
|
"date_updated": null,
|
|
@@ -95,6 +96,7 @@ describe 'Flow' do
|
|
|
95
96
|
"commit_message": null,
|
|
96
97
|
"valid": true,
|
|
97
98
|
"errors": [],
|
|
99
|
+
"warnings": [],
|
|
98
100
|
"webhook_url": "http://webhooks.twilio.com/v1/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
99
101
|
"date_created": "2017-11-06T12:00:00Z",
|
|
100
102
|
"date_updated": "2017-11-06T12:00:00Z",
|
|
@@ -153,6 +155,7 @@ describe 'Flow' do
|
|
|
153
155
|
"commit_message": null,
|
|
154
156
|
"valid": null,
|
|
155
157
|
"errors": null,
|
|
158
|
+
"warnings": null,
|
|
156
159
|
"webhook_url": "http://webhooks.twilio.com/v1/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
157
160
|
"date_created": "2017-11-06T12:00:00Z",
|
|
158
161
|
"date_updated": "2017-11-06T12:00:00Z",
|
|
@@ -204,6 +207,7 @@ describe 'Flow' do
|
|
|
204
207
|
"commit_message": "commit",
|
|
205
208
|
"valid": true,
|
|
206
209
|
"errors": [],
|
|
210
|
+
"warnings": [],
|
|
207
211
|
"webhook_url": "http://webhooks.twilio.com/v1/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
208
212
|
"date_created": "2017-11-06T12:00:00Z",
|
|
209
213
|
"date_updated": null,
|
|
@@ -13,7 +13,7 @@ describe 'FlowValidate' do
|
|
|
13
13
|
@holodeck.mock(Twilio::Response.new(500, ''))
|
|
14
14
|
|
|
15
15
|
expect {
|
|
16
|
-
@client.studio.v2.
|
|
16
|
+
@client.studio.v2.flow_validate.update(friendly_name: 'friendly_name', status: 'draft', definition: {})
|
|
17
17
|
}.to raise_exception(Twilio::REST::TwilioError)
|
|
18
18
|
|
|
19
19
|
values = {
|
|
@@ -39,7 +39,7 @@ describe 'FlowValidate' do
|
|
|
39
39
|
]
|
|
40
40
|
))
|
|
41
41
|
|
|
42
|
-
actual = @client.studio.v2.
|
|
42
|
+
actual = @client.studio.v2.flow_validate.update(friendly_name: 'friendly_name', status: 'draft', definition: {})
|
|
43
43
|
|
|
44
44
|
expect(actual).to_not eq(nil)
|
|
45
45
|
end
|
|
@@ -33,7 +33,7 @@ describe 'CompositionSettings' do
|
|
|
33
33
|
"friendly_name": "string",
|
|
34
34
|
"aws_credentials_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
35
35
|
"encryption_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
36
|
-
"aws_s3_url": "https://
|
|
36
|
+
"aws_s3_url": "https://www.twilio.com",
|
|
37
37
|
"aws_storage_enabled": true,
|
|
38
38
|
"encryption_enabled": true,
|
|
39
39
|
"url": "https://video.twilio.com/v1/CompositionSettings/Default"
|
|
@@ -71,7 +71,7 @@ describe 'CompositionSettings' do
|
|
|
71
71
|
"friendly_name": "friendly_name",
|
|
72
72
|
"aws_credentials_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
73
73
|
"encryption_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
74
|
-
"aws_s3_url": "https://
|
|
74
|
+
"aws_s3_url": "https://www.twilio.com",
|
|
75
75
|
"aws_storage_enabled": true,
|
|
76
76
|
"encryption_enabled": true,
|
|
77
77
|
"url": "https://video.twilio.com/v1/CompositionSettings/Default"
|
|
@@ -33,7 +33,7 @@ describe 'RecordingSettings' do
|
|
|
33
33
|
"friendly_name": "string",
|
|
34
34
|
"aws_credentials_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
35
35
|
"encryption_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
36
|
-
"aws_s3_url": "https://
|
|
36
|
+
"aws_s3_url": "https://www.twilio.com",
|
|
37
37
|
"aws_storage_enabled": true,
|
|
38
38
|
"encryption_enabled": true,
|
|
39
39
|
"url": "https://video.twilio.com/v1/RecordingSettings/Default"
|
|
@@ -71,7 +71,7 @@ describe 'RecordingSettings' do
|
|
|
71
71
|
"friendly_name": "friendly_name",
|
|
72
72
|
"aws_credentials_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
73
73
|
"encryption_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
74
|
-
"aws_s3_url": "https://
|
|
74
|
+
"aws_s3_url": "https://www.twilio.com",
|
|
75
75
|
"aws_storage_enabled": true,
|
|
76
76
|
"encryption_enabled": true,
|
|
77
77
|
"url": "https://video.twilio.com/v1/RecordingSettings/Default"
|
|
@@ -47,7 +47,7 @@ describe 'Recording' do
|
|
|
47
47
|
"grouping_sids": {
|
|
48
48
|
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
49
49
|
},
|
|
50
|
-
"media_external_location": "https://
|
|
50
|
+
"media_external_location": "https://www.twilio.com",
|
|
51
51
|
"encryption_key": "public_key",
|
|
52
52
|
"links": {
|
|
53
53
|
"media": "https://video.twilio.com/v1/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
|
|
@@ -125,7 +125,7 @@ describe 'Recording' do
|
|
|
125
125
|
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
126
126
|
"participant_sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
127
127
|
},
|
|
128
|
-
"media_external_location": "https://
|
|
128
|
+
"media_external_location": "https://www.twilio.com",
|
|
129
129
|
"encryption_key": "public_key",
|
|
130
130
|
"url": "https://video.twilio.com/v1/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
131
131
|
"links": {
|
|
@@ -47,7 +47,7 @@ describe 'RoomRecording' do
|
|
|
47
47
|
"grouping_sids": {
|
|
48
48
|
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
49
49
|
},
|
|
50
|
-
"media_external_location": "https://
|
|
50
|
+
"media_external_location": "https://www.twilio.com",
|
|
51
51
|
"encryption_key": "public_key",
|
|
52
52
|
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
53
53
|
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
@@ -130,7 +130,7 @@ describe 'RoomRecording' do
|
|
|
130
130
|
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
131
131
|
"participant_sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
132
132
|
},
|
|
133
|
-
"media_external_location": "https://
|
|
133
|
+
"media_external_location": "https://www.twilio.com",
|
|
134
134
|
"encryption_key": "public_key",
|
|
135
135
|
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
136
136
|
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
data/twilio-ruby.gemspec
CHANGED
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
|
12
12
|
'building TwiML, and generating Twilio JWT Capability Tokens'
|
|
13
13
|
spec.description = 'The official library for communicating with the Twilio REST API, '\
|
|
14
14
|
'building TwiML, and generating Twilio JWT Capability Tokens'
|
|
15
|
-
spec.homepage = '
|
|
15
|
+
spec.homepage = 'https://github.com/twilio/twilio-ruby'
|
|
16
16
|
spec.license = 'MIT'
|
|
17
17
|
spec.metadata = { 'yard.run' => 'yri' } # use "yard" to build full HTML docs
|
|
18
18
|
|
|
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
|
26
26
|
|
|
27
27
|
spec.add_dependency('jwt', '>= 1.5', '<= 2.5')
|
|
28
28
|
spec.add_dependency('nokogiri', '>= 1.6', '< 2.0')
|
|
29
|
-
spec.add_dependency('faraday', '
|
|
29
|
+
spec.add_dependency('faraday', '>= 0.9', '< 2.0')
|
|
30
30
|
# Workaround for RBX <= 2.2.1, should be fixed in next version
|
|
31
31
|
spec.add_dependency('rubysl') if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
|
|
32
32
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: twilio-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.33.
|
|
4
|
+
version: 5.33.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Twilio API Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-04-
|
|
11
|
+
date: 2020-04-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jwt
|
|
@@ -54,16 +54,22 @@ dependencies:
|
|
|
54
54
|
name: faraday
|
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
|
56
56
|
requirements:
|
|
57
|
-
- - "
|
|
57
|
+
- - ">="
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
|
-
version:
|
|
59
|
+
version: '0.9'
|
|
60
|
+
- - "<"
|
|
61
|
+
- !ruby/object:Gem::Version
|
|
62
|
+
version: '2.0'
|
|
60
63
|
type: :runtime
|
|
61
64
|
prerelease: false
|
|
62
65
|
version_requirements: !ruby/object:Gem::Requirement
|
|
63
66
|
requirements:
|
|
64
|
-
- - "
|
|
67
|
+
- - ">="
|
|
65
68
|
- !ruby/object:Gem::Version
|
|
66
|
-
version:
|
|
69
|
+
version: '0.9'
|
|
70
|
+
- - "<"
|
|
71
|
+
- !ruby/object:Gem::Version
|
|
72
|
+
version: '2.0'
|
|
67
73
|
- !ruby/object:Gem::Dependency
|
|
68
74
|
name: bundler
|
|
69
75
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -1024,7 +1030,7 @@ files:
|
|
|
1024
1030
|
- spec/util/configuration_spec.rb
|
|
1025
1031
|
- spec/util/url_encode_spec.rb
|
|
1026
1032
|
- twilio-ruby.gemspec
|
|
1027
|
-
homepage:
|
|
1033
|
+
homepage: https://github.com/twilio/twilio-ruby
|
|
1028
1034
|
licenses:
|
|
1029
1035
|
- MIT
|
|
1030
1036
|
metadata:
|