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, EngagementContextInstanceMetadata, EngagementContextList, EngagementContextListResponse, EngagementContextPage, EngagementContextPageMetadata, StepContext, StepInstance, StepInstanceMetadata, StepList, StepListResponse, StepPage, StepPageMetadata
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the EngagementInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the EngagementInstanceMetadata.
-
#engagement_context ⇒ EngagementContextList, EngagementContextContext
Access the engagement_context.
-
#fetch ⇒ EngagementInstance
Fetch the EngagementInstance.
-
#fetch_with_metadata ⇒ EngagementInstance
Fetch the EngagementInstanceMetadata.
-
#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
232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 232 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
247 248 249 250 251 252 253 254 255 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 247 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the EngagementInstanceMetadata
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 260 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) engagement_instance = EngagementInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) EngagementInstanceMetadata.new(@version, engagement_instance, response.headers, response.status_code) end |
#engagement_context ⇒ EngagementContextList, EngagementContextContext
Access the engagement_context
345 346 347 348 349 350 351 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 345 def engagement_context EngagementContextContext.new( @version, @solution[:flow_sid], @solution[:sid] ) end |
#fetch ⇒ EngagementInstance
Fetch the EngagementInstance
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 279 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 |
#fetch_with_metadata ⇒ EngagementInstance
Fetch the EngagementInstanceMetadata
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 299 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) engagement_instance = EngagementInstance.new( @version, response.body, flow_sid: @solution[:flow_sid], sid: @solution[:sid], ) EngagementInstanceMetadata.new( @version, engagement_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
362 363 364 365 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 362 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.EngagementContext #{context}>" end |
#steps(sid = :unset) ⇒ StepList, StepContext
Access the steps
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 326 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
355 356 357 358 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 355 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.EngagementContext #{context}>" end |