class Twilio::REST::Studio::V2::FlowContext::ExecutionContext

Public Class Methods

new(version, flow_sid, sid) click to toggle source

Initialize the ExecutionContext @param [Version] version Version that contains the resource @param [String] flow_sid The SID of the Flow with the Execution resource to

fetch

@param [String] sid The SID of the Execution resource to fetch. @return [ExecutionContext] ExecutionContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/studio/v2/flow/execution.rb
207 def initialize(version, flow_sid, sid)
208   super(version)
209 
210   # Path Solution
211   @solution = {flow_sid: flow_sid, sid: sid, }
212   @uri = "/Flows/#{@solution[:flow_sid]}/Executions/#{@solution[:sid]}"
213 
214   # Dependents
215   @steps = nil
216   @execution_context = nil
217 end

Public Instance Methods

delete() click to toggle source

Delete the ExecutionInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/studio/v2/flow/execution.rb
231 def delete
232    @version.delete('DELETE', @uri)
233 end
execution_context() click to toggle source

Access the execution_context @return [ExecutionContextList] @return [ExecutionContextContext]

    # File lib/twilio-ruby/rest/studio/v2/flow/execution.rb
274 def execution_context
275   ExecutionContextContext.new(@version, @solution[:flow_sid], @solution[:sid], )
276 end
fetch() click to toggle source

Fetch the ExecutionInstance @return [ExecutionInstance] Fetched ExecutionInstance

    # File lib/twilio-ruby/rest/studio/v2/flow/execution.rb
222 def fetch
223   payload = @version.fetch('GET', @uri)
224 
225   ExecutionInstance.new(@version, payload, flow_sid: @solution[:flow_sid], sid: @solution[:sid], )
226 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/studio/v2/flow/execution.rb
287 def inspect
288   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
289   "#<Twilio.Studio.V2.ExecutionContext #{context}>"
290 end
steps(sid=:unset) click to toggle source

Access the steps @return [ExecutionStepList] @return [ExecutionStepContext] if sid was passed.

    # File lib/twilio-ruby/rest/studio/v2/flow/execution.rb
252 def steps(sid=:unset)
253   raise ArgumentError, 'sid cannot be nil' if sid.nil?
254 
255   if sid != :unset
256     return ExecutionStepContext.new(@version, @solution[:flow_sid], @solution[:sid], sid, )
257   end
258 
259   unless @steps
260     @steps = ExecutionStepList.new(
261         @version,
262         flow_sid: @solution[:flow_sid],
263         execution_sid: @solution[:sid],
264     )
265   end
266 
267   @steps
268 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/studio/v2/flow/execution.rb
280 def to_s
281   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
282   "#<Twilio.Studio.V2.ExecutionContext #{context}>"
283 end
update(status: nil) click to toggle source

Update the ExecutionInstance @param [execution.Status] status The status of the Execution. Can only be

`ended`.

@return [ExecutionInstance] Updated ExecutionInstance

    # File lib/twilio-ruby/rest/studio/v2/flow/execution.rb
240 def update(status: nil)
241   data = Twilio::Values.of({'Status' => status, })
242 
243   payload = @version.update('POST', @uri, data: data)
244 
245   ExecutionInstance.new(@version, payload, flow_sid: @solution[:flow_sid], sid: @solution[:sid], )
246 end