Class: Twilio::REST::Studio::V1::FlowContext::EngagementContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Studio::V1::FlowContext::EngagementContext
- Defined in:
- 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/engagement/step/step_context.rb,
lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Defined Under Namespace
Classes: EngagementContextContext, EngagementContextInstance, EngagementContextList, EngagementContextPage, StepContext, StepInstance, StepList, StepPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the EngagementInstance.
-
#engagement_context ⇒ EngagementContextList, EngagementContextContext
Access the engagement_context.
-
#fetch ⇒ EngagementInstance
Fetch a EngagementInstance.
-
#initialize(version, flow_sid, sid) ⇒ EngagementContext
constructor
Initialize the EngagementContext.
-
#steps(sid = :unset) ⇒ StepList, StepContext
Access the steps.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, flow_sid, sid) ⇒ EngagementContext
Initialize the EngagementContext
190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 190 def initialize(version, flow_sid, sid) super(version) # Path Solution @solution = {flow_sid: flow_sid, sid: sid, } @uri = "/Flows/#{@solution[:flow_sid]}/Engagements/#{@solution[:sid]}" # Dependents @steps = nil @engagement_context = nil end |
Instance Method Details
#delete ⇒ Boolean
Deletes the EngagementInstance
220 221 222 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 220 def delete @version.delete('delete', @uri) end |
#engagement_context ⇒ EngagementContextList, EngagementContextContext
Access the engagement_context
246 247 248 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 246 def engagement_context EngagementContextContext.new(@version, @solution[:flow_sid], @solution[:sid], ) end |
#fetch ⇒ EngagementInstance
Fetch a EngagementInstance
205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 205 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) EngagementInstance.new(@version, payload, flow_sid: @solution[:flow_sid], sid: @solution[:sid], ) end |
#steps(sid = :unset) ⇒ StepList, StepContext
Access the steps
228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 228 def steps(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return StepContext.new(@version, @solution[:flow_sid], @solution[:sid], sid, ) end unless @steps @steps = StepList.new(@version, flow_sid: @solution[:flow_sid], engagement_sid: @solution[:sid], ) end @steps end |
#to_s ⇒ Object
Provide a user friendly representation
252 253 254 255 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 252 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.EngagementContext #{context}>" end |