Class: Twilio::REST::Studio::V1::FlowContext::EngagementContext::StepContext::StepContextContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.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, flow_sid, engagement_sid, step_sid) ⇒ StepContextContext

Initialize the StepContextContext

Parameters:

  • version (Version)

    Version that contains the resource

  • flow_sid (String)

    The flow_sid

  • engagement_sid (String)

    The engagement_sid

  • step_sid (String)

    The step_sid



85
86
87
88
89
90
91
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb', line 85

def initialize(version, flow_sid, engagement_sid, step_sid)
  super(version)

  # Path Solution
  @solution = {flow_sid: flow_sid, engagement_sid: engagement_sid, step_sid: step_sid, }
  @uri = "/Flows/#{@solution[:flow_sid]}/Engagements/#{@solution[:engagement_sid]}/Steps/#{@solution[:step_sid]}/Context"
end

Instance Method Details

#fetchStepContextInstance

Fetch a StepContextInstance

Returns:



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb', line 96

def fetch
  params = Twilio::Values.of({})

  payload = @version.fetch(
      'GET',
      @uri,
      params,
  )

  StepContextInstance.new(
      @version,
      payload,
      flow_sid: @solution[:flow_sid],
      engagement_sid: @solution[:engagement_sid],
      step_sid: @solution[:step_sid],
  )
end

#to_sObject

Provide a user friendly representation



116
117
118
119
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb', line 116

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Studio.V1.StepContextContext #{context}>"
end