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

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, 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 flow_sid

  • engagement_sid (String) (defaults to: nil)

    The engagement_sid

  • sid (String) (defaults to: nil)

    The sid



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

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,
      'engagement_sid' => engagement_sid,
      'sid' => sid || @properties['sid'],
  }
end

Instance Method Details

#account_sidString

Returns The account_sid.

Returns:

  • (String)

    The account_sid



276
277
278
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 276

def 
  @properties['account_sid']
end

#contextHash

Returns The context.

Returns:

  • (Hash)

    The context



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

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_created.

Returns:

  • (Time)

    The date_created



318
319
320
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 318

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date_updated.

Returns:

  • (Time)

    The date_updated



324
325
326
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 324

def date_updated
  @properties['date_updated']
end

#engagement_sidString

Returns The engagement_sid.

Returns:

  • (String)

    The engagement_sid



288
289
290
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 288

def engagement_sid
  @properties['engagement_sid']
end

#fetchStepInstance

Fetch a StepInstance

Returns:



343
344
345
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 343

def fetch
  context.fetch
end

#flow_sidString

Returns The flow_sid.

Returns:

  • (String)

    The flow_sid



282
283
284
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 282

def flow_sid
  @properties['flow_sid']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

Returns The links.

Returns:

  • (String)

    The links



336
337
338
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 336

def links
  @properties['links']
end

#nameString

Returns The name.

Returns:

  • (String)

    The name



294
295
296
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 294

def name
  @properties['name']
end

#sidString

Returns The sid.

Returns:

  • (String)

    The sid



270
271
272
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 270

def sid
  @properties['sid']
end

#step_contextstep_context

Access the step_context

Returns:



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

def step_context
  context.step_context
end

#to_sObject

Provide a user friendly representation



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

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

#transitioned_fromString

Returns The transitioned_from.

Returns:

  • (String)

    The transitioned_from



306
307
308
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 306

def transitioned_from
  @properties['transitioned_from']
end

#transitioned_toString

Returns The transitioned_to.

Returns:

  • (String)

    The transitioned_to



312
313
314
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 312

def transitioned_to
  @properties['transitioned_to']
end

#urlString

Returns The url.

Returns:

  • (String)

    The url



330
331
332
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 330

def url
  @properties['url']
end