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
240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 240 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
255 256 257 258 259 260 261 262 263 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 255 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
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 268 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
353 354 355 356 357 358 359 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 353 def engagement_context EngagementContextContext.new( @version, @solution[:flow_sid], @solution[:sid] ) end |
#fetch ⇒ EngagementInstance
Fetch the EngagementInstance
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 287 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
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 307 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
370 371 372 373 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 370 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.EngagementContext #{context}>" end |
#steps(sid = :unset) ⇒ StepList, StepContext
Access the steps
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 334 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
363 364 365 366 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement.rb', line 363 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.EngagementContext #{context}>" end |