twilio-ruby 5.31.4 → 5.31.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -0
- data/.rubocop_todo.yml +0 -11
- data/CHANGES.md +38 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +27 -1
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -1
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
- data/lib/twilio-ruby/rest/messaging.rb +0 -15
- data/lib/twilio-ruby/rest/messaging/v1.rb +0 -22
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb +322 -0
- data/lib/twilio-ruby/rest/studio/v2/flow.rb +49 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +427 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +224 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +387 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +239 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/test_user.rb +215 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +10 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +7 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +14 -0
- data/lib/twilio-ruby/rest/verify/v2/service.rb +5 -3
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +5 -4
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/call_spec.rb +30 -10
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +29 -0
- data/spec/integration/api/v2010/account/notification_spec.rb +1 -1
- data/spec/integration/api/v2010/account_spec.rb +45 -0
- data/spec/integration/flex_api/v1/configuration_spec.rb +3 -0
- data/spec/integration/numbers/v2/regulatory_compliance/regulation_spec.rb +183 -0
- data/spec/integration/studio/v2/flow/execution/execution_context_spec.rb +51 -0
- data/spec/integration/studio/v2/flow/execution/execution_step/execution_step_context_spec.rb +54 -0
- data/spec/integration/studio/v2/flow/execution/execution_step_spec.rb +101 -0
- data/spec/integration/studio/v2/flow/execution_spec.rb +169 -0
- data/spec/integration/studio/v2/flow/test_user_spec.rb +86 -0
- data/spec/integration/studio/v2/flow_spec.rb +16 -4
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics_spec.rb +6 -0
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics_spec.rb +2 -0
- data/spec/integration/taskrouter/v1/workspace/task_spec.rb +4 -0
- data/twilio-ruby.gemspec +1 -1
- metadata +22 -19
- data/lib/twilio-ruby/rest/messaging/v1/session.rb +0 -513
- data/lib/twilio-ruby/rest/messaging/v1/session/message.rb +0 -439
- data/lib/twilio-ruby/rest/messaging/v1/session/participant.rb +0 -458
- data/lib/twilio-ruby/rest/messaging/v1/session/webhook.rb +0 -444
- data/lib/twilio-ruby/rest/messaging/v1/webhook.rb +0 -299
- data/spec/integration/messaging/v1/session/message_spec.rb +0 -238
- data/spec/integration/messaging/v1/session/participant_spec.rb +0 -256
- data/spec/integration/messaging/v1/session/webhook_spec.rb +0 -300
- data/spec/integration/messaging/v1/session_spec.rb +0 -227
- data/spec/integration/messaging/v1/webhook_spec.rb +0 -94
@@ -0,0 +1,224 @@
|
|
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 Studio < Domain
|
12
|
+
class V2 < Version
|
13
|
+
class FlowContext < InstanceContext
|
14
|
+
class ExecutionContext < InstanceContext
|
15
|
+
##
|
16
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
17
|
+
class ExecutionContextList < ListResource
|
18
|
+
##
|
19
|
+
# Initialize the ExecutionContextList
|
20
|
+
# @param [Version] version Version that contains the resource
|
21
|
+
# @param [String] flow_sid The flow_sid
|
22
|
+
# @param [String] execution_sid The execution_sid
|
23
|
+
# @return [ExecutionContextList] ExecutionContextList
|
24
|
+
def initialize(version, flow_sid: nil, execution_sid: nil)
|
25
|
+
super(version)
|
26
|
+
|
27
|
+
# Path Solution
|
28
|
+
@solution = {flow_sid: flow_sid, execution_sid: execution_sid}
|
29
|
+
end
|
30
|
+
|
31
|
+
##
|
32
|
+
# Provide a user friendly representation
|
33
|
+
def to_s
|
34
|
+
'#<Twilio.Studio.V2.ExecutionContextList>'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
##
|
39
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
40
|
+
class ExecutionContextPage < Page
|
41
|
+
##
|
42
|
+
# Initialize the ExecutionContextPage
|
43
|
+
# @param [Version] version Version that contains the resource
|
44
|
+
# @param [Response] response Response from the API
|
45
|
+
# @param [Hash] solution Path solution for the resource
|
46
|
+
# @return [ExecutionContextPage] ExecutionContextPage
|
47
|
+
def initialize(version, response, solution)
|
48
|
+
super(version, response)
|
49
|
+
|
50
|
+
# Path Solution
|
51
|
+
@solution = solution
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# Build an instance of ExecutionContextInstance
|
56
|
+
# @param [Hash] payload Payload response from the API
|
57
|
+
# @return [ExecutionContextInstance] ExecutionContextInstance
|
58
|
+
def get_instance(payload)
|
59
|
+
ExecutionContextInstance.new(
|
60
|
+
@version,
|
61
|
+
payload,
|
62
|
+
flow_sid: @solution[:flow_sid],
|
63
|
+
execution_sid: @solution[:execution_sid],
|
64
|
+
)
|
65
|
+
end
|
66
|
+
|
67
|
+
##
|
68
|
+
# Provide a user friendly representation
|
69
|
+
def to_s
|
70
|
+
'<Twilio.Studio.V2.ExecutionContextPage>'
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
##
|
75
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
76
|
+
class ExecutionContextContext < InstanceContext
|
77
|
+
##
|
78
|
+
# Initialize the ExecutionContextContext
|
79
|
+
# @param [Version] version Version that contains the resource
|
80
|
+
# @param [String] flow_sid The flow_sid
|
81
|
+
# @param [String] execution_sid The execution_sid
|
82
|
+
# @return [ExecutionContextContext] ExecutionContextContext
|
83
|
+
def initialize(version, flow_sid, execution_sid)
|
84
|
+
super(version)
|
85
|
+
|
86
|
+
# Path Solution
|
87
|
+
@solution = {flow_sid: flow_sid, execution_sid: execution_sid, }
|
88
|
+
@uri = "/Flows/#{@solution[:flow_sid]}/Executions/#{@solution[:execution_sid]}/Context"
|
89
|
+
end
|
90
|
+
|
91
|
+
##
|
92
|
+
# Fetch a ExecutionContextInstance
|
93
|
+
# @return [ExecutionContextInstance] Fetched ExecutionContextInstance
|
94
|
+
def fetch
|
95
|
+
params = Twilio::Values.of({})
|
96
|
+
|
97
|
+
payload = @version.fetch(
|
98
|
+
'GET',
|
99
|
+
@uri,
|
100
|
+
params,
|
101
|
+
)
|
102
|
+
|
103
|
+
ExecutionContextInstance.new(
|
104
|
+
@version,
|
105
|
+
payload,
|
106
|
+
flow_sid: @solution[:flow_sid],
|
107
|
+
execution_sid: @solution[:execution_sid],
|
108
|
+
)
|
109
|
+
end
|
110
|
+
|
111
|
+
##
|
112
|
+
# Provide a user friendly representation
|
113
|
+
def to_s
|
114
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
115
|
+
"#<Twilio.Studio.V2.ExecutionContextContext #{context}>"
|
116
|
+
end
|
117
|
+
|
118
|
+
##
|
119
|
+
# Provide a detailed, user friendly representation
|
120
|
+
def inspect
|
121
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
122
|
+
"#<Twilio.Studio.V2.ExecutionContextContext #{context}>"
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
##
|
127
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
128
|
+
class ExecutionContextInstance < InstanceResource
|
129
|
+
##
|
130
|
+
# Initialize the ExecutionContextInstance
|
131
|
+
# @param [Version] version Version that contains the resource
|
132
|
+
# @param [Hash] payload payload that contains response from Twilio
|
133
|
+
# @param [String] flow_sid The flow_sid
|
134
|
+
# @param [String] execution_sid The execution_sid
|
135
|
+
# @return [ExecutionContextInstance] ExecutionContextInstance
|
136
|
+
def initialize(version, payload, flow_sid: nil, execution_sid: nil)
|
137
|
+
super(version)
|
138
|
+
|
139
|
+
# Marshaled Properties
|
140
|
+
@properties = {
|
141
|
+
'account_sid' => payload['account_sid'],
|
142
|
+
'context' => payload['context'],
|
143
|
+
'flow_sid' => payload['flow_sid'],
|
144
|
+
'execution_sid' => payload['execution_sid'],
|
145
|
+
'url' => payload['url'],
|
146
|
+
}
|
147
|
+
|
148
|
+
# Context
|
149
|
+
@instance_context = nil
|
150
|
+
@params = {'flow_sid' => flow_sid, 'execution_sid' => execution_sid, }
|
151
|
+
end
|
152
|
+
|
153
|
+
##
|
154
|
+
# Generate an instance context for the instance, the context is capable of
|
155
|
+
# performing various actions. All instance actions are proxied to the context
|
156
|
+
# @return [ExecutionContextContext] ExecutionContextContext for this ExecutionContextInstance
|
157
|
+
def context
|
158
|
+
unless @instance_context
|
159
|
+
@instance_context = ExecutionContextContext.new(
|
160
|
+
@version,
|
161
|
+
@params['flow_sid'],
|
162
|
+
@params['execution_sid'],
|
163
|
+
)
|
164
|
+
end
|
165
|
+
@instance_context
|
166
|
+
end
|
167
|
+
|
168
|
+
##
|
169
|
+
# @return [String] The account_sid
|
170
|
+
def account_sid
|
171
|
+
@properties['account_sid']
|
172
|
+
end
|
173
|
+
|
174
|
+
##
|
175
|
+
# @return [Hash] The context
|
176
|
+
def context
|
177
|
+
@properties['context']
|
178
|
+
end
|
179
|
+
|
180
|
+
##
|
181
|
+
# @return [String] The flow_sid
|
182
|
+
def flow_sid
|
183
|
+
@properties['flow_sid']
|
184
|
+
end
|
185
|
+
|
186
|
+
##
|
187
|
+
# @return [String] The execution_sid
|
188
|
+
def execution_sid
|
189
|
+
@properties['execution_sid']
|
190
|
+
end
|
191
|
+
|
192
|
+
##
|
193
|
+
# @return [String] The url
|
194
|
+
def url
|
195
|
+
@properties['url']
|
196
|
+
end
|
197
|
+
|
198
|
+
##
|
199
|
+
# Fetch a ExecutionContextInstance
|
200
|
+
# @return [ExecutionContextInstance] Fetched ExecutionContextInstance
|
201
|
+
def fetch
|
202
|
+
context.fetch
|
203
|
+
end
|
204
|
+
|
205
|
+
##
|
206
|
+
# Provide a user friendly representation
|
207
|
+
def to_s
|
208
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
209
|
+
"<Twilio.Studio.V2.ExecutionContextInstance #{values}>"
|
210
|
+
end
|
211
|
+
|
212
|
+
##
|
213
|
+
# Provide a detailed, user friendly representation
|
214
|
+
def inspect
|
215
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
216
|
+
"<Twilio.Studio.V2.ExecutionContextInstance #{values}>"
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
@@ -0,0 +1,387 @@
|
|
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 Studio < Domain
|
12
|
+
class V2 < Version
|
13
|
+
class FlowContext < InstanceContext
|
14
|
+
class ExecutionContext < InstanceContext
|
15
|
+
##
|
16
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
17
|
+
class ExecutionStepList < ListResource
|
18
|
+
##
|
19
|
+
# Initialize the ExecutionStepList
|
20
|
+
# @param [Version] version Version that contains the resource
|
21
|
+
# @param [String] flow_sid The flow_sid
|
22
|
+
# @param [String] execution_sid The execution_sid
|
23
|
+
# @return [ExecutionStepList] ExecutionStepList
|
24
|
+
def initialize(version, flow_sid: nil, execution_sid: nil)
|
25
|
+
super(version)
|
26
|
+
|
27
|
+
# Path Solution
|
28
|
+
@solution = {flow_sid: flow_sid, execution_sid: execution_sid}
|
29
|
+
@uri = "/Flows/#{@solution[:flow_sid]}/Executions/#{@solution[:execution_sid]}/Steps"
|
30
|
+
end
|
31
|
+
|
32
|
+
##
|
33
|
+
# Lists ExecutionStepInstance records from the API as a list.
|
34
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
35
|
+
# memory before returning.
|
36
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
37
|
+
# guarantees to never return more than limit. Default is no limit
|
38
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
39
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
40
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
41
|
+
# efficient page size, i.e. min(limit, 1000)
|
42
|
+
# @return [Array] Array of up to limit results
|
43
|
+
def list(limit: nil, page_size: nil)
|
44
|
+
self.stream(limit: limit, page_size: page_size).entries
|
45
|
+
end
|
46
|
+
|
47
|
+
##
|
48
|
+
# Streams ExecutionStepInstance records from the API as an Enumerable.
|
49
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
50
|
+
# is reached.
|
51
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
52
|
+
# guarantees to never return more than limit. Default is no limit.
|
53
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
54
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
55
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
56
|
+
# efficient page size, i.e. min(limit, 1000)
|
57
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
58
|
+
def stream(limit: nil, page_size: nil)
|
59
|
+
limits = @version.read_limits(limit, page_size)
|
60
|
+
|
61
|
+
page = self.page(page_size: limits[:page_size], )
|
62
|
+
|
63
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
64
|
+
end
|
65
|
+
|
66
|
+
##
|
67
|
+
# When passed a block, yields ExecutionStepInstance records from the API.
|
68
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
69
|
+
# is reached.
|
70
|
+
def each
|
71
|
+
limits = @version.read_limits
|
72
|
+
|
73
|
+
page = self.page(page_size: limits[:page_size], )
|
74
|
+
|
75
|
+
@version.stream(page,
|
76
|
+
limit: limits[:limit],
|
77
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
78
|
+
end
|
79
|
+
|
80
|
+
##
|
81
|
+
# Retrieve a single page of ExecutionStepInstance records from the API.
|
82
|
+
# Request is executed immediately.
|
83
|
+
# @param [String] page_token PageToken provided by the API
|
84
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
85
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
86
|
+
# @return [Page] Page of ExecutionStepInstance
|
87
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
88
|
+
params = Twilio::Values.of({
|
89
|
+
'PageToken' => page_token,
|
90
|
+
'Page' => page_number,
|
91
|
+
'PageSize' => page_size,
|
92
|
+
})
|
93
|
+
response = @version.page(
|
94
|
+
'GET',
|
95
|
+
@uri,
|
96
|
+
params
|
97
|
+
)
|
98
|
+
ExecutionStepPage.new(@version, response, @solution)
|
99
|
+
end
|
100
|
+
|
101
|
+
##
|
102
|
+
# Retrieve a single page of ExecutionStepInstance records from the API.
|
103
|
+
# Request is executed immediately.
|
104
|
+
# @param [String] target_url API-generated URL for the requested results page
|
105
|
+
# @return [Page] Page of ExecutionStepInstance
|
106
|
+
def get_page(target_url)
|
107
|
+
response = @version.domain.request(
|
108
|
+
'GET',
|
109
|
+
target_url
|
110
|
+
)
|
111
|
+
ExecutionStepPage.new(@version, response, @solution)
|
112
|
+
end
|
113
|
+
|
114
|
+
##
|
115
|
+
# Provide a user friendly representation
|
116
|
+
def to_s
|
117
|
+
'#<Twilio.Studio.V2.ExecutionStepList>'
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
##
|
122
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
123
|
+
class ExecutionStepPage < Page
|
124
|
+
##
|
125
|
+
# Initialize the ExecutionStepPage
|
126
|
+
# @param [Version] version Version that contains the resource
|
127
|
+
# @param [Response] response Response from the API
|
128
|
+
# @param [Hash] solution Path solution for the resource
|
129
|
+
# @return [ExecutionStepPage] ExecutionStepPage
|
130
|
+
def initialize(version, response, solution)
|
131
|
+
super(version, response)
|
132
|
+
|
133
|
+
# Path Solution
|
134
|
+
@solution = solution
|
135
|
+
end
|
136
|
+
|
137
|
+
##
|
138
|
+
# Build an instance of ExecutionStepInstance
|
139
|
+
# @param [Hash] payload Payload response from the API
|
140
|
+
# @return [ExecutionStepInstance] ExecutionStepInstance
|
141
|
+
def get_instance(payload)
|
142
|
+
ExecutionStepInstance.new(
|
143
|
+
@version,
|
144
|
+
payload,
|
145
|
+
flow_sid: @solution[:flow_sid],
|
146
|
+
execution_sid: @solution[:execution_sid],
|
147
|
+
)
|
148
|
+
end
|
149
|
+
|
150
|
+
##
|
151
|
+
# Provide a user friendly representation
|
152
|
+
def to_s
|
153
|
+
'<Twilio.Studio.V2.ExecutionStepPage>'
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
##
|
158
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
159
|
+
class ExecutionStepContext < InstanceContext
|
160
|
+
##
|
161
|
+
# Initialize the ExecutionStepContext
|
162
|
+
# @param [Version] version Version that contains the resource
|
163
|
+
# @param [String] flow_sid The flow_sid
|
164
|
+
# @param [String] execution_sid The execution_sid
|
165
|
+
# @param [String] sid The sid
|
166
|
+
# @return [ExecutionStepContext] ExecutionStepContext
|
167
|
+
def initialize(version, flow_sid, execution_sid, sid)
|
168
|
+
super(version)
|
169
|
+
|
170
|
+
# Path Solution
|
171
|
+
@solution = {flow_sid: flow_sid, execution_sid: execution_sid, sid: sid, }
|
172
|
+
@uri = "/Flows/#{@solution[:flow_sid]}/Executions/#{@solution[:execution_sid]}/Steps/#{@solution[:sid]}"
|
173
|
+
|
174
|
+
# Dependents
|
175
|
+
@step_context = nil
|
176
|
+
end
|
177
|
+
|
178
|
+
##
|
179
|
+
# Fetch a ExecutionStepInstance
|
180
|
+
# @return [ExecutionStepInstance] Fetched ExecutionStepInstance
|
181
|
+
def fetch
|
182
|
+
params = Twilio::Values.of({})
|
183
|
+
|
184
|
+
payload = @version.fetch(
|
185
|
+
'GET',
|
186
|
+
@uri,
|
187
|
+
params,
|
188
|
+
)
|
189
|
+
|
190
|
+
ExecutionStepInstance.new(
|
191
|
+
@version,
|
192
|
+
payload,
|
193
|
+
flow_sid: @solution[:flow_sid],
|
194
|
+
execution_sid: @solution[:execution_sid],
|
195
|
+
sid: @solution[:sid],
|
196
|
+
)
|
197
|
+
end
|
198
|
+
|
199
|
+
##
|
200
|
+
# Access the step_context
|
201
|
+
# @return [ExecutionStepContextList]
|
202
|
+
# @return [ExecutionStepContextContext]
|
203
|
+
def step_context
|
204
|
+
ExecutionStepContextContext.new(
|
205
|
+
@version,
|
206
|
+
@solution[:flow_sid],
|
207
|
+
@solution[:execution_sid],
|
208
|
+
@solution[:sid],
|
209
|
+
)
|
210
|
+
end
|
211
|
+
|
212
|
+
##
|
213
|
+
# Provide a user friendly representation
|
214
|
+
def to_s
|
215
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
216
|
+
"#<Twilio.Studio.V2.ExecutionStepContext #{context}>"
|
217
|
+
end
|
218
|
+
|
219
|
+
##
|
220
|
+
# Provide a detailed, user friendly representation
|
221
|
+
def inspect
|
222
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
223
|
+
"#<Twilio.Studio.V2.ExecutionStepContext #{context}>"
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
##
|
228
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
229
|
+
class ExecutionStepInstance < InstanceResource
|
230
|
+
##
|
231
|
+
# Initialize the ExecutionStepInstance
|
232
|
+
# @param [Version] version Version that contains the resource
|
233
|
+
# @param [Hash] payload payload that contains response from Twilio
|
234
|
+
# @param [String] flow_sid The flow_sid
|
235
|
+
# @param [String] execution_sid The execution_sid
|
236
|
+
# @param [String] sid The sid
|
237
|
+
# @return [ExecutionStepInstance] ExecutionStepInstance
|
238
|
+
def initialize(version, payload, flow_sid: nil, execution_sid: nil, sid: nil)
|
239
|
+
super(version)
|
240
|
+
|
241
|
+
# Marshaled Properties
|
242
|
+
@properties = {
|
243
|
+
'sid' => payload['sid'],
|
244
|
+
'account_sid' => payload['account_sid'],
|
245
|
+
'flow_sid' => payload['flow_sid'],
|
246
|
+
'execution_sid' => payload['execution_sid'],
|
247
|
+
'name' => payload['name'],
|
248
|
+
'context' => payload['context'],
|
249
|
+
'transitioned_from' => payload['transitioned_from'],
|
250
|
+
'transitioned_to' => payload['transitioned_to'],
|
251
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
252
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
253
|
+
'url' => payload['url'],
|
254
|
+
'links' => payload['links'],
|
255
|
+
}
|
256
|
+
|
257
|
+
# Context
|
258
|
+
@instance_context = nil
|
259
|
+
@params = {
|
260
|
+
'flow_sid' => flow_sid,
|
261
|
+
'execution_sid' => execution_sid,
|
262
|
+
'sid' => sid || @properties['sid'],
|
263
|
+
}
|
264
|
+
end
|
265
|
+
|
266
|
+
##
|
267
|
+
# Generate an instance context for the instance, the context is capable of
|
268
|
+
# performing various actions. All instance actions are proxied to the context
|
269
|
+
# @return [ExecutionStepContext] ExecutionStepContext for this ExecutionStepInstance
|
270
|
+
def context
|
271
|
+
unless @instance_context
|
272
|
+
@instance_context = ExecutionStepContext.new(
|
273
|
+
@version,
|
274
|
+
@params['flow_sid'],
|
275
|
+
@params['execution_sid'],
|
276
|
+
@params['sid'],
|
277
|
+
)
|
278
|
+
end
|
279
|
+
@instance_context
|
280
|
+
end
|
281
|
+
|
282
|
+
##
|
283
|
+
# @return [String] The sid
|
284
|
+
def sid
|
285
|
+
@properties['sid']
|
286
|
+
end
|
287
|
+
|
288
|
+
##
|
289
|
+
# @return [String] The account_sid
|
290
|
+
def account_sid
|
291
|
+
@properties['account_sid']
|
292
|
+
end
|
293
|
+
|
294
|
+
##
|
295
|
+
# @return [String] The flow_sid
|
296
|
+
def flow_sid
|
297
|
+
@properties['flow_sid']
|
298
|
+
end
|
299
|
+
|
300
|
+
##
|
301
|
+
# @return [String] The execution_sid
|
302
|
+
def execution_sid
|
303
|
+
@properties['execution_sid']
|
304
|
+
end
|
305
|
+
|
306
|
+
##
|
307
|
+
# @return [String] The name
|
308
|
+
def name
|
309
|
+
@properties['name']
|
310
|
+
end
|
311
|
+
|
312
|
+
##
|
313
|
+
# @return [Hash] The context
|
314
|
+
def context
|
315
|
+
@properties['context']
|
316
|
+
end
|
317
|
+
|
318
|
+
##
|
319
|
+
# @return [String] The transitioned_from
|
320
|
+
def transitioned_from
|
321
|
+
@properties['transitioned_from']
|
322
|
+
end
|
323
|
+
|
324
|
+
##
|
325
|
+
# @return [String] The transitioned_to
|
326
|
+
def transitioned_to
|
327
|
+
@properties['transitioned_to']
|
328
|
+
end
|
329
|
+
|
330
|
+
##
|
331
|
+
# @return [Time] The date_created
|
332
|
+
def date_created
|
333
|
+
@properties['date_created']
|
334
|
+
end
|
335
|
+
|
336
|
+
##
|
337
|
+
# @return [Time] The date_updated
|
338
|
+
def date_updated
|
339
|
+
@properties['date_updated']
|
340
|
+
end
|
341
|
+
|
342
|
+
##
|
343
|
+
# @return [String] The url
|
344
|
+
def url
|
345
|
+
@properties['url']
|
346
|
+
end
|
347
|
+
|
348
|
+
##
|
349
|
+
# @return [String] The links
|
350
|
+
def links
|
351
|
+
@properties['links']
|
352
|
+
end
|
353
|
+
|
354
|
+
##
|
355
|
+
# Fetch a ExecutionStepInstance
|
356
|
+
# @return [ExecutionStepInstance] Fetched ExecutionStepInstance
|
357
|
+
def fetch
|
358
|
+
context.fetch
|
359
|
+
end
|
360
|
+
|
361
|
+
##
|
362
|
+
# Access the step_context
|
363
|
+
# @return [step_context] step_context
|
364
|
+
def step_context
|
365
|
+
context.step_context
|
366
|
+
end
|
367
|
+
|
368
|
+
##
|
369
|
+
# Provide a user friendly representation
|
370
|
+
def to_s
|
371
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
372
|
+
"<Twilio.Studio.V2.ExecutionStepInstance #{values}>"
|
373
|
+
end
|
374
|
+
|
375
|
+
##
|
376
|
+
# Provide a detailed, user friendly representation
|
377
|
+
def inspect
|
378
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
379
|
+
"<Twilio.Studio.V2.ExecutionStepInstance #{values}>"
|
380
|
+
end
|
381
|
+
end
|
382
|
+
end
|
383
|
+
end
|
384
|
+
end
|
385
|
+
end
|
386
|
+
end
|
387
|
+
end
|