class Twilio::REST::Studio::V1::FlowContext::EngagementInstance
Public Class Methods
Initialize the EngagementInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] flow_sid
The SID of the Flow. @param [String] sid The SID of the Engagement resource to fetch. @return [EngagementInstance] EngagementInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 255 def initialize(version, payload, flow_sid: nil, sid: nil) 256 super(version) 257 258 # Marshaled Properties 259 @properties = { 260 'sid' => payload['sid'], 261 'account_sid' => payload['account_sid'], 262 'flow_sid' => payload['flow_sid'], 263 'contact_sid' => payload['contact_sid'], 264 'contact_channel_address' => payload['contact_channel_address'], 265 'context' => payload['context'], 266 'status' => payload['status'], 267 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 268 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 269 'url' => payload['url'], 270 'links' => payload['links'], 271 } 272 273 # Context 274 @instance_context = nil 275 @params = {'flow_sid' => flow_sid, 'sid' => sid || @properties['sid'], } 276 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 297 def account_sid 298 @properties['account_sid'] 299 end
@return [String] The phone number, SIP address or Client
identifier that triggered this Engagement
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 315 def contact_channel_address 316 @properties['contact_channel_address'] 317 end
@return [String] The SID of the Contact
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 309 def contact_sid 310 @properties['contact_sid'] 311 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [EngagementContext] EngagementContext
for this EngagementInstance
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 282 def context 283 unless @instance_context 284 @instance_context = EngagementContext.new(@version, @params['flow_sid'], @params['sid'], ) 285 end 286 @instance_context 287 end
@return [Time] The ISO 8601 date and time in GMT when the Engagement was created
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 333 def date_created 334 @properties['date_created'] 335 end
@return [Time] The ISO 8601 date and time in GMT when the Engagement was last updated
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 339 def date_updated 340 @properties['date_updated'] 341 end
Delete the EngagementInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 365 def delete 366 context.delete 367 end
Access the engagement_context
@return [engagement_context] engagement_context
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 379 def engagement_context 380 context.engagement_context 381 end
Fetch the EngagementInstance
@return [EngagementInstance] Fetched EngagementInstance
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 358 def fetch 359 context.fetch 360 end
@return [String] The SID of the Flow
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 303 def flow_sid 304 @properties['flow_sid'] 305 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 392 def inspect 393 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 394 "<Twilio.Studio.V1.EngagementInstance #{values}>" 395 end
@return [String] The URLs of the Engagement's nested resources
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 351 def links 352 @properties['links'] 353 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 291 def sid 292 @properties['sid'] 293 end
@return [engagement.Status] The status of the Engagement
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 327 def status 328 @properties['status'] 329 end
Access the steps @return [steps] steps
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 372 def steps 373 context.steps 374 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 385 def to_s 386 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 387 "<Twilio.Studio.V1.EngagementInstance #{values}>" 388 end
@return [String] The absolute URL of the resource
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 345 def url 346 @properties['url'] 347 end