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



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

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



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

def 
  @properties['account_sid']
end

#contextHash



249
250
251
252
253
254
255
256
257
258
259
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 249

def context
  unless @instance_context
    @instance_context = StepContext.new(
        @version,
        @params['flow_sid'],
        @params['engagement_sid'],
        @params['sid'],
    )
  end
  @instance_context
end

#date_createdTime



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

def date_created
  @properties['date_created']
end

#date_updatedTime



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

def date_updated
  @properties['date_updated']
end

#engagement_sidString



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

def engagement_sid
  @properties['engagement_sid']
end

#fetchStepInstance

Fetch the StepInstance



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

def fetch
  context.fetch
end

#flow_sidString



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

def flow_sid
  @properties['flow_sid']
end

#inspectObject

Provide a detailed, user friendly representation



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

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


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

def links
  @properties['links']
end

#nameString



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

def name
  @properties['name']
end

#sidString



263
264
265
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 263

def sid
  @properties['sid']
end

#step_contextstep_context

Access the step_context



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

def step_context
  context.step_context
end

#to_sObject

Provide a user friendly representation



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

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

#transitioned_fromString



299
300
301
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 299

def transitioned_from
  @properties['transitioned_from']
end

#transitioned_toString



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

def transitioned_to
  @properties['transitioned_to']
end

#urlString



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

def url
  @properties['url']
end