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.



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 230

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'],
        '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  || @properties['flow_sid']  ,'engagement_sid' => engagement_sid  || @properties['engagement_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 Step resource.

Returns:



273
274
275
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 273

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.



258
259
260
261
262
263
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 258

def context
    unless @instance_context
        @instance_context = StepContext.new(@version , @params['flow_sid'], @params['engagement_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:



315
316
317
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 315

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:



321
322
323
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 321

def date_updated
    @properties['date_updated']
end

#engagement_sidString

Returns The SID of the Engagement.

Returns:

  • (String)

    The SID of the Engagement.



285
286
287
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 285

def engagement_sid
    @properties['engagement_sid']
end

#fetchStepInstance

Fetch the StepInstance

Returns:



340
341
342
343
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 340

def fetch

    context.fetch
end

#flow_sidString

Returns The SID of the Flow.

Returns:

  • (String)

    The SID of the Flow.



279
280
281
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 279

def flow_sid
    @properties['flow_sid']
end

#inspectObject

Provide a detailed, user friendly representation



361
362
363
364
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 361

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.



333
334
335
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 333

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.



291
292
293
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 291

def name
    @properties['name']
end

#sidString

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.



267
268
269
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 267

def sid
    @properties['sid']
end

#step_contextstep_context

Access the step_context

Returns:



348
349
350
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 348

def step_context
    context.step_context
end

#to_sObject

Provide a user friendly representation



354
355
356
357
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 354

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



303
304
305
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 303

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.



309
310
311
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 309

def transitioned_to
    @properties['transitioned_to']
end

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource.



327
328
329
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 327

def url
    @properties['url']
end