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

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

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

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

  • flow_sid (String) (defaults to: nil)

    The unique SID identifier of the Flow.

  • engagement_sid (String) (defaults to: nil)

    The unique SID identifier of the Engagement.

  • sid (String) (defaults to: nil)

    The sid



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/twilio-ruby/rest/preview/studio/flow/engagement/step.rb', line 215

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'],
  }

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

Instance Method Details

#account_sidString

Returns Account Sid.

Returns:

  • (String)

    Account Sid.



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

def 
  @properties['account_sid']
end

#contextHash

Returns Nested resource URLs.

Returns:

  • (Hash)

    Nested resource URLs.



246
247
248
249
250
251
252
253
254
255
256
# File 'lib/twilio-ruby/rest/preview/studio/flow/engagement/step.rb', line 246

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 this Step was created.

Returns:

  • (Time)

    The date this Step was created



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

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date this Step was updated.

Returns:

  • (Time)

    The date this Step was updated



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

def date_updated
  @properties['date_updated']
end

#engagement_sidString

Returns Engagement Sid.

Returns:

  • (String)

    Engagement Sid.



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

def engagement_sid
  @properties['engagement_sid']
end

#fetchStepInstance

Fetch a StepInstance

Returns:



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

def fetch
  context.fetch
end

#flow_sidString

Returns Flow Sid.

Returns:

  • (String)

    Flow Sid.



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

def flow_sid
  @properties['flow_sid']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#nameString

Returns The Widget that implemented this Step.

Returns:

  • (String)

    The Widget that implemented this Step.



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

def name
  @properties['name']
end

#sidString

Returns A string that uniquely identifies this Step.

Returns:

  • (String)

    A string that uniquely identifies this Step.



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

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



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

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

#transitioned_fromString

Returns The Widget that preceded the Widget for this Step.

Returns:

  • (String)

    The Widget that preceded the Widget for this Step.



296
297
298
# File 'lib/twilio-ruby/rest/preview/studio/flow/engagement/step.rb', line 296

def transitioned_from
  @properties['transitioned_from']
end

#transitioned_toString

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

Returns:

  • (String)

    The Widget that will follow the Widget for this Step.



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

def transitioned_to
  @properties['transitioned_to']
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



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

def url
  @properties['url']
end