Class: Twilio::REST::Studio::V2::FlowContext::ExecutionContext::ExecutionStepInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, flow_sid: nil, execution_sid: nil, sid: nil) ⇒ ExecutionStepInstance

Initialize the ExecutionStepInstance

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 ExecutionStep resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 397

def initialize(version, payload , flow_sid: nil, execution_sid: nil, sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'flow_sid' => payload['flow_sid'],
        'execution_sid' => payload['execution_sid'],
        'parent_step_sid' => payload['parent_step_sid'],
        'name' => payload['name'],
        'context' => payload['context'],
        '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']  ,'execution_sid' => execution_sid  || @properties['execution_sid']  ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the ExecutionStep resource.

Returns:



443
444
445
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 443

def 
    @properties['account_sid']
end

#contextHash

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.



428
429
430
431
432
433
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 428

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

#date_createdTime

Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



497
498
499
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 497

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



503
504
505
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 503

def date_updated
    @properties['date_updated']
end

#execution_sidString

Returns The SID of the Step’s Execution resource.

Returns:

  • (String)

    The SID of the Step’s Execution resource.



455
456
457
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 455

def execution_sid
    @properties['execution_sid']
end

#fetchExecutionStepInstance

Fetch the ExecutionStepInstance

Returns:



522
523
524
525
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 522

def fetch

    context.fetch
end

#flow_sidString

Returns The SID of the Flow.

Returns:

  • (String)

    The SID of the Flow.



449
450
451
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 449

def flow_sid
    @properties['flow_sid']
end

#inspectObject

Provide a detailed, user friendly representation



543
544
545
546
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 543

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

Returns The URLs of related resources.

Returns:

  • (Hash)

    The URLs of related resources.



515
516
517
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 515

def links
    @properties['links']
end

#nameString

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.



467
468
469
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 467

def name
    @properties['name']
end

#parent_step_sidString

Returns The SID of the parent Step.

Returns:

  • (String)

    The SID of the parent Step.



461
462
463
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 461

def parent_step_sid
    @properties['parent_step_sid']
end

#sidString

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

Returns:

  • (String)

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



437
438
439
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 437

def sid
    @properties['sid']
end

#step_contextstep_context

Access the step_context

Returns:



530
531
532
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 530

def step_context
    context.step_context
end

#to_sObject

Provide a user friendly representation



536
537
538
539
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 536

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

#transitioned_fromString

Returns The Widget that preceded the Widget for the Step.

Returns:

  • (String)

    The Widget that preceded the Widget for the Step.



479
480
481
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 479

def transitioned_from
    @properties['transitioned_from']
end

#transitioned_toString

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

Returns:

  • (String)

    The Widget that will follow the Widget for the Step.



485
486
487
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 485

def transitioned_to
    @properties['transitioned_to']
end

#typeString

Returns The type of the widget that was executed.

Returns:

  • (String)

    The type of the widget that was executed.



491
492
493
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 491

def type
    @properties['type']
end

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource.



509
510
511
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 509

def url
    @properties['url']
end