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

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

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

  • flow_sid (String) (defaults to: nil)

    The SID of the Flow.

  • execution_sid (String) (defaults to: nil)

    The SID of the Step’s Execution resource.

  • sid (String) (defaults to: nil)

    The SID of the ExecutionStep resource to fetch.



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 239

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'],
      'name' => payload['name'],
      'context' => payload['context'],
      'transitioned_from' => payload['transitioned_from'],
      'transitioned_to' => payload['transitioned_to'],
      '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,
      'execution_sid' => execution_sid,
      'sid' => sid || @properties['sid'],
  }
end

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



291
292
293
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 291

def 
  @properties['account_sid']
end

#contextHash

Returns The current state of the flow.

Returns:

  • (Hash)

    The current state of the flow



271
272
273
274
275
276
277
278
279
280
281
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 271

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 ISO 8601 date and time in GMT when the resource was created.

Returns:

  • (Time)

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



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

def date_created
  @properties['date_created']
end

#date_updatedTime

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

Returns:

  • (Time)

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



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

def date_updated
  @properties['date_updated']
end

#execution_sidString

Returns The SID of the Execution.

Returns:

  • (String)

    The SID of the Execution



303
304
305
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 303

def execution_sid
  @properties['execution_sid']
end

#fetchExecutionStepInstance

Fetch a ExecutionStepInstance

Returns:



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

def fetch
  context.fetch
end

#flow_sidString

Returns The SID of the Flow.

Returns:

  • (String)

    The SID of the Flow



297
298
299
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 297

def flow_sid
  @properties['flow_sid']
end

#inspectObject

Provide a detailed, user friendly representation



378
379
380
381
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 378

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

Returns The URLs of related resources.

Returns:

  • (String)

    The URLs of related resources



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

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



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

def name
  @properties['name']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource



285
286
287
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 285

def sid
  @properties['sid']
end

#step_contextstep_context

Access the step_context

Returns:



365
366
367
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 365

def step_context
  context.step_context
end

#to_sObject

Provide a user friendly representation



371
372
373
374
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb', line 371

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



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

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



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

def transitioned_to
  @properties['transitioned_to']
end

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource



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

def url
  @properties['url']
end