twilio-ruby 5.33.0 → 5.36.0
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/.rubocop.yml +8 -0
- data/.rubocop_todo.yml +5 -26
- data/.travis.yml +9 -1
- data/CHANGES.md +110 -0
- data/README.md +17 -2
- data/lib/twilio-ruby.rb +4 -12
- data/lib/twilio-ruby/framework/error.rb +3 -3
- data/lib/twilio-ruby/jwt/jwt.rb +6 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +90 -90
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +14 -0
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +75 -72
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +29 -29
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +38 -3
- data/lib/twilio-ruby/rest/autopilot.rb +6 -0
- data/lib/twilio-ruby/rest/autopilot/v1.rb +7 -0
- data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +198 -0
- data/lib/twilio-ruby/rest/client.rb +35 -8
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +19 -3
- data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +27 -4
- data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +2 -1
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
- data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +20 -11
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +26 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +324 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +26 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb +239 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +266 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +197 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +7 -0
- 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/rest/supersim.rb +18 -0
- data/lib/twilio-ruby/rest/supersim/v1.rb +30 -0
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +53 -10
- data/lib/twilio-ruby/rest/supersim/v1/network.rb +315 -0
- data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +378 -0
- data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +352 -0
- data/lib/twilio-ruby/rest/verify.rb +9 -0
- data/lib/twilio-ruby/rest/verify/v2.rb +16 -0
- data/lib/twilio-ruby/rest/verify/v2/form.rb +197 -0
- data/lib/twilio-ruby/rest/verify/v2/service.rb +48 -3
- data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +379 -0
- data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +500 -0
- data/lib/twilio-ruby/rest/verify/v2/service/entity/factor/challenge.rb +494 -0
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -3
- data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +8 -12
- data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +8 -12
- data/lib/twilio-ruby/rest/voice.rb +36 -0
- data/lib/twilio-ruby/rest/voice/v1.rb +64 -0
- data/lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb +513 -0
- data/lib/twilio-ruby/rest/voice/v1/connection_policy.rb +379 -0
- data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +458 -0
- data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +366 -0
- data/lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb +346 -0
- data/lib/twilio-ruby/twiml/twiml.rb +4 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +3 -2
- data/lib/twilio-ruby/util/configuration.rb +9 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/call_spec.rb +5 -5
- data/spec/integration/api/v2010/account/conference_spec.rb +42 -14
- data/spec/integration/api/v2010/account/sip/domain_spec.rb +12 -4
- data/spec/integration/api/v2010/account/token_spec.rb +23 -11
- data/spec/integration/autopilot/v1/restore_assistant_spec.rb +53 -0
- data/spec/integration/bulkexports/v1/export/day_spec.rb +1 -1
- data/spec/integration/conversations/v1/conversation/participant_spec.rb +7 -0
- data/spec/integration/conversations/v1/conversation_spec.rb +4 -0
- data/spec/integration/flex_api/v1/configuration_spec.rb +3 -0
- data/spec/integration/numbers/v2/regulatory_compliance/bundle/evaluation_spec.rb +623 -0
- data/spec/integration/numbers/v2/regulatory_compliance/bundle_spec.rb +4 -0
- data/spec/integration/preview/bulk_exports/export/day_spec.rb +1 -1
- data/spec/integration/preview/trusted_comms/business/brand/branded_channel/channel_spec.rb +54 -0
- data/spec/integration/preview/trusted_comms/business/brand/branded_channel_spec.rb +52 -0
- data/spec/integration/preview/trusted_comms/business/brand_spec.rb +49 -0
- data/spec/integration/preview/trusted_comms/business_spec.rb +1 -0
- data/spec/integration/serverless/v1/service/asset/asset_version_spec.rb +1 -1
- data/spec/integration/serverless/v1/service/build_spec.rb +4 -4
- data/spec/integration/serverless/v1/service/environment/log_spec.rb +1 -0
- data/spec/integration/serverless/v1/service/function/function_version_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/supersim/v1/fleet_spec.rb +12 -4
- data/spec/integration/supersim/v1/network_access_profile/network_access_profile_network_spec.rb +179 -0
- data/spec/integration/supersim/v1/network_access_profile_spec.rb +223 -0
- data/spec/integration/supersim/v1/network_spec.rb +139 -0
- data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +13 -13
- data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +23 -23
- data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +28 -28
- data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +17 -17
- data/spec/integration/trunking/v1/trunk_spec.rb +33 -33
- data/spec/integration/verify/v2/form_spec.rb +48 -0
- data/spec/integration/verify/v2/service/entity/factor/challenge_spec.rb +353 -0
- data/spec/integration/verify/v2/service/entity/factor_spec.rb +298 -0
- data/spec/integration/verify/v2/service/entity_spec.rb +201 -0
- data/spec/integration/verify/v2/service_spec.rb +28 -4
- 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/spec/integration/voice/v1/byoc_trunk_spec.rb +250 -0
- data/spec/integration/voice/v1/connection_policy/connection_policy_target_spec.rb +246 -0
- data/spec/integration/voice/v1/connection_policy_spec.rb +226 -0
- data/spec/integration/voice/v1/ip_record_spec.rb +223 -0
- data/spec/integration/voice/v1/source_ip_mapping_spec.rb +219 -0
- data/spec/rest/client_spec.rb +173 -23
- data/spec/util/configuration_spec.rb +12 -0
- data/twilio-ruby.gemspec +4 -4
- metadata +67 -10
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# \ / _ _ _| _ _
|
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
# / /
|
|
6
|
+
#
|
|
7
|
+
# frozen_string_literal: true
|
|
8
|
+
|
|
9
|
+
module Twilio
|
|
10
|
+
module REST
|
|
11
|
+
class Preview < Domain
|
|
12
|
+
class TrustedComms < Version
|
|
13
|
+
class BusinessContext < InstanceContext
|
|
14
|
+
class BrandContext < InstanceContext
|
|
15
|
+
class BrandedChannelContext < InstanceContext
|
|
16
|
+
##
|
|
17
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
18
|
+
class ChannelList < ListResource
|
|
19
|
+
##
|
|
20
|
+
# Initialize the ChannelList
|
|
21
|
+
# @param [Version] version Version that contains the resource
|
|
22
|
+
# @param [String] business_sid The unique SID identifier of the Business.
|
|
23
|
+
# @param [String] brand_sid The unique SID identifier of the Brand.
|
|
24
|
+
# @param [String] branded_channel_sid The unique SID identifier of the Branded
|
|
25
|
+
# Channel.
|
|
26
|
+
# @return [ChannelList] ChannelList
|
|
27
|
+
def initialize(version, business_sid: nil, brand_sid: nil, branded_channel_sid: nil)
|
|
28
|
+
super(version)
|
|
29
|
+
|
|
30
|
+
# Path Solution
|
|
31
|
+
@solution = {
|
|
32
|
+
business_sid: business_sid,
|
|
33
|
+
brand_sid: brand_sid,
|
|
34
|
+
branded_channel_sid: branded_channel_sid
|
|
35
|
+
}
|
|
36
|
+
@uri = "/Businesses/#{@solution[:business_sid]}/Brands/#{@solution[:brand_sid]}/BrandedChannels/#{@solution[:branded_channel_sid]}/Channels"
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
##
|
|
40
|
+
# Retrieve a single page of ChannelInstance records from the API.
|
|
41
|
+
# Request is executed immediately.
|
|
42
|
+
# @param [String] phone_number_sid The unique SID identifier of the Phone Number
|
|
43
|
+
# of the Phone number to be assigned to the Branded Channel.
|
|
44
|
+
# @param [String] phone_number The phone number given in [E.164
|
|
45
|
+
# format](https://www.twilio.com/docs/glossary/what-e164) to assign to the Branded
|
|
46
|
+
# Channel. It must be a Twilio number that from your account.
|
|
47
|
+
# @return [ChannelInstance] Newly created ChannelInstance
|
|
48
|
+
def create(phone_number_sid: nil, phone_number: nil)
|
|
49
|
+
data = Twilio::Values.of({'PhoneNumberSid' => phone_number_sid, 'PhoneNumber' => phone_number, })
|
|
50
|
+
|
|
51
|
+
payload = @version.create(
|
|
52
|
+
'POST',
|
|
53
|
+
@uri,
|
|
54
|
+
data: data
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
ChannelInstance.new(
|
|
58
|
+
@version,
|
|
59
|
+
payload,
|
|
60
|
+
business_sid: @solution[:business_sid],
|
|
61
|
+
brand_sid: @solution[:brand_sid],
|
|
62
|
+
branded_channel_sid: @solution[:branded_channel_sid],
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
##
|
|
67
|
+
# Provide a user friendly representation
|
|
68
|
+
def to_s
|
|
69
|
+
'#<Twilio.Preview.TrustedComms.ChannelList>'
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
##
|
|
74
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
75
|
+
class ChannelPage < Page
|
|
76
|
+
##
|
|
77
|
+
# Initialize the ChannelPage
|
|
78
|
+
# @param [Version] version Version that contains the resource
|
|
79
|
+
# @param [Response] response Response from the API
|
|
80
|
+
# @param [Hash] solution Path solution for the resource
|
|
81
|
+
# @return [ChannelPage] ChannelPage
|
|
82
|
+
def initialize(version, response, solution)
|
|
83
|
+
super(version, response)
|
|
84
|
+
|
|
85
|
+
# Path Solution
|
|
86
|
+
@solution = solution
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
##
|
|
90
|
+
# Build an instance of ChannelInstance
|
|
91
|
+
# @param [Hash] payload Payload response from the API
|
|
92
|
+
# @return [ChannelInstance] ChannelInstance
|
|
93
|
+
def get_instance(payload)
|
|
94
|
+
ChannelInstance.new(
|
|
95
|
+
@version,
|
|
96
|
+
payload,
|
|
97
|
+
business_sid: @solution[:business_sid],
|
|
98
|
+
brand_sid: @solution[:brand_sid],
|
|
99
|
+
branded_channel_sid: @solution[:branded_channel_sid],
|
|
100
|
+
)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
##
|
|
104
|
+
# Provide a user friendly representation
|
|
105
|
+
def to_s
|
|
106
|
+
'<Twilio.Preview.TrustedComms.ChannelPage>'
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
##
|
|
111
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
112
|
+
class ChannelInstance < InstanceResource
|
|
113
|
+
##
|
|
114
|
+
# Initialize the ChannelInstance
|
|
115
|
+
# @param [Version] version Version that contains the resource
|
|
116
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
117
|
+
# @param [String] business_sid The unique SID identifier of the Business.
|
|
118
|
+
# @param [String] brand_sid The unique SID identifier of the Brand.
|
|
119
|
+
# @param [String] branded_channel_sid The unique SID identifier of the Branded
|
|
120
|
+
# Channel.
|
|
121
|
+
# @return [ChannelInstance] ChannelInstance
|
|
122
|
+
def initialize(version, payload, business_sid: nil, brand_sid: nil, branded_channel_sid: nil)
|
|
123
|
+
super(version)
|
|
124
|
+
|
|
125
|
+
# Marshaled Properties
|
|
126
|
+
@properties = {
|
|
127
|
+
'account_sid' => payload['account_sid'],
|
|
128
|
+
'business_sid' => payload['business_sid'],
|
|
129
|
+
'brand_sid' => payload['brand_sid'],
|
|
130
|
+
'branded_channel_sid' => payload['branded_channel_sid'],
|
|
131
|
+
'phone_number_sid' => payload['phone_number_sid'],
|
|
132
|
+
'phone_number' => payload['phone_number'],
|
|
133
|
+
'url' => payload['url'],
|
|
134
|
+
}
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
##
|
|
138
|
+
# @return [String] Account Sid.
|
|
139
|
+
def account_sid
|
|
140
|
+
@properties['account_sid']
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
##
|
|
144
|
+
# @return [String] Business Sid.
|
|
145
|
+
def business_sid
|
|
146
|
+
@properties['business_sid']
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
##
|
|
150
|
+
# @return [String] Brand Sid.
|
|
151
|
+
def brand_sid
|
|
152
|
+
@properties['brand_sid']
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
##
|
|
156
|
+
# @return [String] Branded Channel Sid.
|
|
157
|
+
def branded_channel_sid
|
|
158
|
+
@properties['branded_channel_sid']
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
##
|
|
162
|
+
# @return [String] Phone Number Sid to be branded.
|
|
163
|
+
def phone_number_sid
|
|
164
|
+
@properties['phone_number_sid']
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
##
|
|
168
|
+
# @return [String] Twilio number to assign to the Branded Channel
|
|
169
|
+
def phone_number
|
|
170
|
+
@properties['phone_number']
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
##
|
|
174
|
+
# @return [String] The URL of this resource.
|
|
175
|
+
def url
|
|
176
|
+
@properties['url']
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
##
|
|
180
|
+
# Provide a user friendly representation
|
|
181
|
+
def to_s
|
|
182
|
+
"<Twilio.Preview.TrustedComms.ChannelInstance>"
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
##
|
|
186
|
+
# Provide a detailed, user friendly representation
|
|
187
|
+
def inspect
|
|
188
|
+
"<Twilio.Preview.TrustedComms.ChannelInstance>"
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
end
|
|
@@ -266,6 +266,7 @@ module Twilio
|
|
|
266
266
|
'account_sid' => payload['account_sid'],
|
|
267
267
|
'service_sid' => payload['service_sid'],
|
|
268
268
|
'environment_sid' => payload['environment_sid'],
|
|
269
|
+
'build_sid' => payload['build_sid'],
|
|
269
270
|
'deployment_sid' => payload['deployment_sid'],
|
|
270
271
|
'function_sid' => payload['function_sid'],
|
|
271
272
|
'request_sid' => payload['request_sid'],
|
|
@@ -324,6 +325,12 @@ module Twilio
|
|
|
324
325
|
@properties['environment_sid']
|
|
325
326
|
end
|
|
326
327
|
|
|
328
|
+
##
|
|
329
|
+
# @return [String] The SID of the build that corresponds to the log
|
|
330
|
+
def build_sid
|
|
331
|
+
@properties['build_sid']
|
|
332
|
+
end
|
|
333
|
+
|
|
327
334
|
##
|
|
328
335
|
# @return [String] The SID of the deployment that corresponds to the log
|
|
329
336
|
def deployment_sid
|
|
@@ -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
|