Class: Twilio::REST::Studio::V1::FlowContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Studio::V1::FlowContext
- Defined in:
- lib/twilio-ruby/rest/studio/v1/flow.rb,
lib/twilio-ruby/rest/studio/v1/flow/execution.rb,
lib/twilio-ruby/rest/studio/v1/flow/engagement.rb,
lib/twilio-ruby/rest/studio/v1/flow/engagement/step.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/engagement/step/step_context.rb,
lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb,
lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step/execution_step_context.rb
Defined Under Namespace
Classes: EngagementContext, EngagementInstance, EngagementList, EngagementPage, ExecutionContext, ExecutionInstance, ExecutionList, ExecutionPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the FlowInstance.
-
#engagements(sid = :unset) ⇒ EngagementList, EngagementContext
Access the engagements.
-
#executions(sid = :unset) ⇒ ExecutionList, ExecutionContext
Access the executions.
-
#fetch ⇒ FlowInstance
Fetch a FlowInstance.
-
#initialize(version, sid) ⇒ FlowContext
constructor
Initialize the FlowContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ FlowContext
Initialize the FlowContext
150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/twilio-ruby/rest/studio/v1/flow.rb', line 150 def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Flows/#{@solution[:sid]}" # Dependents @engagements = nil @executions = nil end |
Instance Method Details
#delete ⇒ Boolean
Deletes the FlowInstance
180 181 182 |
# File 'lib/twilio-ruby/rest/studio/v1/flow.rb', line 180 def delete @version.delete('delete', @uri) end |
#engagements(sid = :unset) ⇒ EngagementList, EngagementContext
Access the engagements
188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/twilio-ruby/rest/studio/v1/flow.rb', line 188 def engagements(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return EngagementContext.new(@version, @solution[:sid], sid, ) end unless @engagements @engagements = EngagementList.new(@version, flow_sid: @solution[:sid], ) end @engagements end |
#executions(sid = :unset) ⇒ ExecutionList, ExecutionContext
Access the executions
206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/twilio-ruby/rest/studio/v1/flow.rb', line 206 def executions(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return ExecutionContext.new(@version, @solution[:sid], sid, ) end unless @executions @executions = ExecutionList.new(@version, flow_sid: @solution[:sid], ) end @executions end |
#fetch ⇒ FlowInstance
Fetch a FlowInstance
165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/twilio-ruby/rest/studio/v1/flow.rb', line 165 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) FlowInstance.new(@version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
229 230 231 232 |
# File 'lib/twilio-ruby/rest/studio/v1/flow.rb', line 229 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.FlowContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
222 223 224 225 |
# File 'lib/twilio-ruby/rest/studio/v1/flow.rb', line 222 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.FlowContext #{context}>" end |