Class: Twilio::REST::Studio::V1::FlowContext::ExecutionContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Studio::V1::FlowContext::ExecutionContext
- Defined in:
- lib/twilio-ruby/rest/studio/v1/flow/execution.rb,
lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step.rb,
lib/twilio-ruby/rest/studio/v1/flow/execution/execution_context.rb,
lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step/execution_step_context.rb
Defined Under Namespace
Classes: ExecutionContextContext, ExecutionContextInstance, ExecutionContextList, ExecutionContextPage, ExecutionStepContext, ExecutionStepInstance, ExecutionStepList, ExecutionStepPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the ExecutionInstance.
-
#execution_context ⇒ ExecutionContextList, ExecutionContextContext
Access the execution_context.
-
#fetch ⇒ ExecutionInstance
Fetch the ExecutionInstance.
-
#initialize(version, flow_sid, sid) ⇒ ExecutionContext
constructor
Initialize the ExecutionContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#steps(sid = :unset) ⇒ ExecutionStepList, ExecutionStepContext
Access the steps.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: nil) ⇒ ExecutionInstance
Update the ExecutionInstance.
Constructor Details
#initialize(version, flow_sid, sid) ⇒ ExecutionContext
Initialize the ExecutionContext
183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/execution.rb', line 183 def initialize(version, flow_sid, sid) super(version) # Path Solution @solution = { flow_sid: flow_sid, sid: sid, } @uri = "/Flows/#{@solution[:flow_sid]}/Executions/#{@solution[:sid]}" # Dependents @execution_context = nil @steps = nil end |
Instance Method Details
#delete ⇒ Boolean
Delete the ExecutionInstance
197 198 199 200 201 202 203 204 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/execution.rb', line 197 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#execution_context ⇒ ExecutionContextList, ExecutionContextContext
Access the execution_context
257 258 259 260 261 262 263 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/execution.rb', line 257 def execution_context ExecutionContextContext.new( @version, @solution[:flow_sid], @solution[:sid] ) end |
#fetch ⇒ ExecutionInstance
Fetch the ExecutionInstance
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/execution.rb', line 209 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ExecutionInstance.new( @version, payload, flow_sid: @solution[:flow_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
293 294 295 296 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/execution.rb', line 293 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.ExecutionContext #{context}>" end |
#steps(sid = :unset) ⇒ ExecutionStepList, ExecutionStepContext
Access the steps
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/execution.rb', line 268 def steps(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return ExecutionStepContext.new(@version, @solution[:flow_sid], @solution[:sid],sid ) end unless @steps @steps = ExecutionStepList.new( @version, flow_sid: @solution[:flow_sid], execution_sid: @solution[:sid], ) end @steps end |
#to_s ⇒ Object
Provide a user friendly representation
286 287 288 289 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/execution.rb', line 286 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.ExecutionContext #{context}>" end |
#update(status: nil) ⇒ ExecutionInstance
Update the ExecutionInstance
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/execution.rb', line 230 def update( status: nil ) data = Twilio::Values.of({ 'Status' => status, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) ExecutionInstance.new( @version, payload, flow_sid: @solution[:flow_sid], sid: @solution[:sid], ) end |