class Twilio::REST::Studio::V1::FlowContext

Public Class Methods

new(version, sid) click to toggle source

Initialize the FlowContext @param [Version] version Version that contains the resource @param [String] sid The SID of the Flow resource to fetch. @return [FlowContext] FlowContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/studio/v1/flow.rb
148 def initialize(version, sid)
149   super(version)
150 
151   # Path Solution
152   @solution = {sid: sid, }
153   @uri = "/Flows/#{@solution[:sid]}"
154 
155   # Dependents
156   @engagements = nil
157   @executions = nil
158 end

Public Instance Methods

delete() click to toggle source

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

    # File lib/twilio-ruby/rest/studio/v1/flow.rb
172 def delete
173    @version.delete('DELETE', @uri)
174 end
engagements(sid=:unset) click to toggle source

Access the engagements @return [EngagementList] @return [EngagementContext] if sid was passed.

    # File lib/twilio-ruby/rest/studio/v1/flow.rb
180 def engagements(sid=:unset)
181   raise ArgumentError, 'sid cannot be nil' if sid.nil?
182 
183   if sid != :unset
184     return EngagementContext.new(@version, @solution[:sid], sid, )
185   end
186 
187   unless @engagements
188     @engagements = EngagementList.new(@version, flow_sid: @solution[:sid], )
189   end
190 
191   @engagements
192 end
executions(sid=:unset) click to toggle source

Access the executions @return [ExecutionList] @return [ExecutionContext] if sid was passed.

    # File lib/twilio-ruby/rest/studio/v1/flow.rb
198 def executions(sid=:unset)
199   raise ArgumentError, 'sid cannot be nil' if sid.nil?
200 
201   if sid != :unset
202     return ExecutionContext.new(@version, @solution[:sid], sid, )
203   end
204 
205   unless @executions
206     @executions = ExecutionList.new(@version, flow_sid: @solution[:sid], )
207   end
208 
209   @executions
210 end
fetch() click to toggle source

Fetch the FlowInstance @return [FlowInstance] Fetched FlowInstance

    # File lib/twilio-ruby/rest/studio/v1/flow.rb
163 def fetch
164   payload = @version.fetch('GET', @uri)
165 
166   FlowInstance.new(@version, payload, sid: @solution[:sid], )
167 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/studio/v1/flow.rb
221 def inspect
222   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
223   "#<Twilio.Studio.V1.FlowContext #{context}>"
224 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/studio/v1/flow.rb
214 def to_s
215   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
216   "#<Twilio.Studio.V1.FlowContext #{context}>"
217 end