Class: Twilio::REST::Studio::V1::FlowContext::EngagementContext::StepInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, flow_sid: nil, engagement_sid: nil, sid: nil) ⇒ StepInstance

Initialize the StepInstance

Parameters:

  • version (Version) —

    Version that contains the resource

  • payload (Hash) —

    payload that contains response from Twilio

  • account_sid (String) —

    The SID of the Account that created this Step resource.

  • sid (String) (defaults to: nil) —

    The SID of the Call resource to fetch.



405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 405

def initialize(version, payload , flow_sid: nil, engagement_sid: nil, sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'flow_sid' => payload['flow_sid'],
        'engagement_sid' => payload['engagement_sid'],
        'name' => payload['name'],
        'context' => payload['context'],
        'parent_step_sid' => payload['parent_step_sid'],
        'transitioned_from' => payload['transitioned_from'],
        'transitioned_to' => payload['transitioned_to'],
        'type' => payload['type'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
        'links' => payload['links'],
    }

    # Context
    @instance_context = nil
    @params = { 'flow_sid' => flow_sid  || @properties['flow_sid']  ,'engagement_sid' => engagement_sid  || @properties['engagement_sid']  ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sid ⇒ String

Returns The SID of the Account that created the Step resource.

Returns:

  • (String) —

    The SID of the Account that created the Step resource.



451
452
453
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 451

def 
    @properties['account_sid']
end

#context ⇒ Hash

Returns The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution.

Returns:

  • (Hash) —

    The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution.



436
437
438
439
440
441
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 436

def context
    unless @instance_context
        @instance_context = StepContext.new(@version , @params['flow_sid'], @params['engagement_sid'], @params['sid'])
    end
    @instance_context
end

#date_created ⇒ Time

Returns The date and time in GMT when the resource was created specified in ISO 8601 format.

Returns:

  • (Time) —

    The date and time in GMT when the resource was created specified in ISO 8601 format.



505
506
507
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 505

def date_created
    @properties['date_created']
end

#date_updated ⇒ Time

Returns The date and time in GMT when the resource was last updated specified in ISO 8601 format.

Returns:

  • (Time) —

    The date and time in GMT when the resource was last updated specified in ISO 8601 format.



511
512
513
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 511

def date_updated
    @properties['date_updated']
end

#engagement_sid ⇒ String

Returns The SID of the Engagement.

Returns:

  • (String) —

    The SID of the Engagement.



463
464
465
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 463

def engagement_sid
    @properties['engagement_sid']
end

#fetch ⇒ StepInstance

Fetch the StepInstance

Returns:



530
531
532
533
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 530

def fetch

    context.fetch
end

#flow_sid ⇒ String

Returns The SID of the Flow.

Returns:

  • (String) —

    The SID of the Flow.



457
458
459
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 457

def flow_sid
    @properties['flow_sid']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



551
552
553
554
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 551

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Studio.V1.StepInstance #{values}>"
end

Returns The URLs of related resources.

Returns:

  • (Hash) —

    The URLs of related resources.



523
524
525
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 523

def links
    @properties['links']
end

#name ⇒ String

Returns The event that caused the Flow to transition to the Step.

Returns:

  • (String) —

    The event that caused the Flow to transition to the Step.



469
470
471
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 469

def name
    @properties['name']
end

#parent_step_sid ⇒ String

Returns The SID of the parent Step.

Returns:

  • (String) —

    The SID of the parent Step.



481
482
483
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 481

def parent_step_sid
    @properties['parent_step_sid']
end

#sid ⇒ String

Returns The unique string that we created to identify the Step resource.

Returns:

  • (String) —

    The unique string that we created to identify the Step resource.



445
446
447
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 445

def sid
    @properties['sid']
end

#step_context ⇒ step_context

Access the step_context

Returns:



538
539
540
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 538

def step_context
    context.step_context
end

#to_s ⇒ Object

Provide a user friendly representation



544
545
546
547
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 544

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Studio.V1.StepInstance #{values}>"
end

#transitioned_from ⇒ String

Returns The Widget that preceded the Widget for the Step.

Returns:

  • (String) —

    The Widget that preceded the Widget for the Step.



487
488
489
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 487

def transitioned_from
    @properties['transitioned_from']
end

#transitioned_to ⇒ String

Returns The Widget that will follow the Widget for the Step.

Returns:

  • (String) —

    The Widget that will follow the Widget for the Step.



493
494
495
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 493

def transitioned_to
    @properties['transitioned_to']
end

#type ⇒ String

Returns The type of the widget that was executed.

Returns:

  • (String) —

    The type of the widget that was executed.



499
500
501
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 499

def type
    @properties['type']
end

#url ⇒ String

Returns The absolute URL of the resource.

Returns:

  • (String) —

    The absolute URL of the resource.



517
518
519
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 517

def url
    @properties['url']
end