Class: Twilio::REST::Studio::V2::FlowContext::ExecutionContext::ExecutionStepContext::ExecutionStepContextInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, flow_sid: nil, execution_sid: nil, step_sid: nil) ⇒ ExecutionStepContextInstance

Initialize the ExecutionStepContextInstance

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

  • sid (String) —

    The SID of the Call resource to fetch.



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 276

def initialize(version, payload , flow_sid: nil, execution_sid: nil, step_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'context' => payload['context'],
        'execution_sid' => payload['execution_sid'],
        'flow_sid' => payload['flow_sid'],
        'step_sid' => payload['step_sid'],
        'url' => payload['url'],
    }

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

Instance Method Details

#account_sid ⇒ String

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

Returns:

  • (String) —

    The SID of the Account that created the ExecutionStepContext resource.



308
309
310
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 308

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.



299
300
301
302
303
304
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 299

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

#execution_sid ⇒ String

Returns The SID of the context's Execution resource.

Returns:

  • (String) —

    The SID of the context's Execution resource.



320
321
322
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 320

def execution_sid
    @properties['execution_sid']
end

#fetch ⇒ ExecutionStepContextInstance

Fetch the ExecutionStepContextInstance

Returns:



345
346
347
348
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 345

def fetch

    context.fetch
end

#flow_sid ⇒ String

Returns The SID of the Flow.

Returns:

  • (String) —

    The SID of the Flow.



326
327
328
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 326

def flow_sid
    @properties['flow_sid']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



359
360
361
362
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 359

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

#step_sid ⇒ String

Returns The SID of the Step that the context is associated with.

Returns:

  • (String) —

    The SID of the Step that the context is associated with.



332
333
334
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 332

def step_sid
    @properties['step_sid']
end

#to_s ⇒ Object

Provide a user friendly representation



352
353
354
355
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 352

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

#url ⇒ String

Returns The absolute URL of the resource.

Returns:

  • (String) —

    The absolute URL of the resource.



338
339
340
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 338

def url
    @properties['url']
end