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
Defined Under Namespace
Classes: EngagementContextContext, EngagementContextInstance, EngagementContextList, EngagementContextPage, StepContext, StepInstance, StepList, StepPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the EngagementInstance.
-
#engagement_context ⇒ EngagementContextList, EngagementContextContext
Access the engagement_context.
-
#fetch ⇒ EngagementInstance
Fetch the EngagementInstance.
-
#initialize(version, flow_sid, sid) ⇒ EngagementContext
constructor
Initialize the EngagementContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#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
171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 171 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
Delete the EngagementInstance
185 186 187 188 189 190 191 192 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 185 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#engagement_context ⇒ EngagementContextList, EngagementContextContext
Access the engagement_context
237 238 239 240 241 242 243 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 237 def engagement_context EngagementContextContext.new( @version, @solution[:flow_sid], @solution[:sid] ) end |
#fetch ⇒ EngagementInstance
Fetch the EngagementInstance
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 197 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) EngagementInstance.new( @version, payload, flow_sid: @solution[:flow_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
254 255 256 257 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 254 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.EngagementContext #{context}>" end |
#steps(sid = :unset) ⇒ StepList, StepContext
Access the steps
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 218 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
247 248 249 250 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 247 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.EngagementContext #{context}>" end |