Class: Twilio::REST::Studio::V2::FlowContext::ExecutionContext::ExecutionContextInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Studio::V2::FlowContext::ExecutionContext::ExecutionContextInstance
- Defined in:
- lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the ExecutionContext resource.
-
#context ⇒ Hash
The current state of the Flow’s Execution.
-
#execution_sid ⇒ String
The SID of the context’s Execution resource.
-
#fetch ⇒ ExecutionContextInstance
Fetch the ExecutionContextInstance.
-
#flow_sid ⇒ String
The SID of the Flow.
-
#initialize(version, payload, flow_sid: nil, execution_sid: nil) ⇒ ExecutionContextInstance
constructor
Initialize the ExecutionContextInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the resource.
Constructor Details
#initialize(version, payload, flow_sid: nil, execution_sid: nil) ⇒ ExecutionContextInstance
Initialize the ExecutionContextInstance
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 132 def initialize(version, payload , flow_sid: nil, execution_sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'context' => payload['context'], 'flow_sid' => payload['flow_sid'], 'execution_sid' => payload['execution_sid'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'flow_sid' => flow_sid || @properties['flow_sid'] ,'execution_sid' => execution_sid || @properties['execution_sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the ExecutionContext resource.
162 163 164 |
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 162 def account_sid @properties['account_sid'] end |
#context ⇒ Hash
Returns The current state of the Flow’s Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution.
153 154 155 156 157 158 |
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 153 def context unless @instance_context @instance_context = ExecutionContextContext.new(@version , @params['flow_sid'], @params['execution_sid']) end @instance_context end |
#execution_sid ⇒ String
Returns The SID of the context’s Execution resource.
180 181 182 |
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 180 def execution_sid @properties['execution_sid'] end |
#fetch ⇒ ExecutionContextInstance
Fetch the ExecutionContextInstance
193 194 195 196 |
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 193 def fetch context.fetch end |
#flow_sid ⇒ String
Returns The SID of the Flow.
174 175 176 |
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 174 def flow_sid @properties['flow_sid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
207 208 209 210 |
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 207 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Studio.V2.ExecutionContextInstance #{values}>" end |
#to_s ⇒ Object
Provide a user friendly representation
200 201 202 203 |
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 200 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Studio.V2.ExecutionContextInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the resource.
186 187 188 |
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 186 def url @properties['url'] end |