Class: Twilio::REST::Studio::V2::FlowContext::ExecutionContext::ExecutionStepContext::ExecutionStepContextInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_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, payload, flow_sid: nil, execution_sid: nil, step_sid: nil) ⇒ ExecutionStepContextInstance

Initialize the ExecutionStepContextInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • flow_sid (String) (defaults to: nil)

    The SID of the Flow.

  • execution_sid (String) (defaults to: nil)

    The SID of the context’s Execution resource.

  • step_sid (String) (defaults to: nil)

    The SID of the Step that the context is associated with.



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 139

def initialize(version, payload, flow_sid: nil, execution_sid: nil, step_sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'context' => payload['context'],
      'execution_sid' => payload['execution_sid'],
      'flow_sid' => payload['flow_sid'],
      'step_sid' => payload['step_sid'],
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {'flow_sid' => flow_sid, 'execution_sid' => execution_sid, 'step_sid' => step_sid, }
end

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



175
176
177
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 175

def 
  @properties['account_sid']
end

#contextHash

Returns The current state of the flow.

Returns:

  • (Hash)

    The current state of the flow



161
162
163
164
165
166
167
168
169
170
171
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 161

def context
  unless @instance_context
    @instance_context = ExecutionStepContextContext.new(
        @version,
        @params['flow_sid'],
        @params['execution_sid'],
        @params['step_sid'],
    )
  end
  @instance_context
end

#execution_sidString

Returns The SID of the Execution.

Returns:

  • (String)

    The SID of the Execution



187
188
189
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 187

def execution_sid
  @properties['execution_sid']
end

#fetchExecutionStepContextInstance

Fetch the ExecutionStepContextInstance

Returns:



212
213
214
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 212

def fetch
  context.fetch
end

#flow_sidString

Returns The SID of the Flow.

Returns:

  • (String)

    The SID of the Flow



193
194
195
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 193

def flow_sid
  @properties['flow_sid']
end

#inspectObject

Provide a detailed, user friendly representation



225
226
227
228
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 225

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

#step_sidString

Returns Step SID.

Returns:

  • (String)

    Step SID



199
200
201
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 199

def step_sid
  @properties['step_sid']
end

#to_sObject

Provide a user friendly representation



218
219
220
221
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 218

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

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource



205
206
207
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb', line 205

def url
  @properties['url']
end