Class: Twilio::REST::Studio::V2::FlowContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Studio::V2::FlowContext
- Defined in:
- lib/twilio-ruby/rest/studio/v2/flow.rb,
lib/twilio-ruby/rest/studio/v2/flow/execution.rb,
lib/twilio-ruby/rest/studio/v2/flow/test_user.rb,
lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb,
lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb,
lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb,
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.
Defined Under Namespace
Classes: ExecutionContext, ExecutionInstance, ExecutionList, ExecutionPage, FlowRevisionContext, FlowRevisionInstance, FlowRevisionList, FlowRevisionPage, FlowTestUserContext, FlowTestUserInstance, FlowTestUserList, FlowTestUserPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the FlowInstance.
-
#executions(sid = :unset) ⇒ ExecutionList, ExecutionContext
Access the executions.
-
#fetch ⇒ FlowInstance
Fetch a FlowInstance.
-
#initialize(version, sid) ⇒ FlowContext
constructor
Initialize the FlowContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#revisions(revision = :unset) ⇒ FlowRevisionList, FlowRevisionContext
Access the revisions.
-
#test_users ⇒ FlowTestUserList, FlowTestUserContext
Access the test_users.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: nil, friendly_name: :unset, definition: :unset, commit_message: :unset) ⇒ FlowInstance
Update the FlowInstance.
Constructor Details
#initialize(version, sid) ⇒ FlowContext
Initialize the FlowContext
182 183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 182 def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Flows/#{@solution[:sid]}" # Dependents @revisions = nil @test_users = nil @executions = nil end |
Instance Method Details
#delete ⇒ Boolean
Deletes the FlowInstance
238 239 240 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 238 def delete @version.delete('delete', @uri) end |
#executions(sid = :unset) ⇒ ExecutionList, ExecutionContext
Access the executions
272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 272 def executions(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return ExecutionContext.new(@version, @solution[:sid], sid, ) end unless @executions @executions = ExecutionList.new(@version, flow_sid: @solution[:sid], ) end @executions end |
#fetch ⇒ FlowInstance
Fetch a FlowInstance
223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 223 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) FlowInstance.new(@version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
295 296 297 298 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 295 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V2.FlowContext #{context}>" end |
#revisions(revision = :unset) ⇒ FlowRevisionList, FlowRevisionContext
Access the revisions
246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 246 def revisions(revision=:unset) raise ArgumentError, 'revision cannot be nil' if revision.nil? if revision != :unset return FlowRevisionContext.new(@version, @solution[:sid], revision, ) end unless @revisions @revisions = FlowRevisionList.new(@version, sid: @solution[:sid], ) end @revisions end |
#test_users ⇒ FlowTestUserList, FlowTestUserContext
Access the test_users
264 265 266 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 264 def test_users FlowTestUserContext.new(@version, @solution[:sid], ) end |
#to_s ⇒ Object
Provide a user friendly representation
288 289 290 291 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 288 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V2.FlowContext #{context}>" end |
#update(status: nil, friendly_name: :unset, definition: :unset, commit_message: :unset) ⇒ FlowInstance
Update the FlowInstance
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 203 def update(status: nil, friendly_name: :unset, definition: :unset, commit_message: :unset) data = Twilio::Values.of({ 'Status' => status, 'FriendlyName' => friendly_name, 'Definition' => Twilio.serialize_object(definition), 'CommitMessage' => , }) payload = @version.update( 'POST', @uri, data: data, ) FlowInstance.new(@version, payload, sid: @solution[:sid], ) end |