class Twilio::REST::Studio::V2::FlowInstance
Public Class Methods
Initialize the FlowInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] sid The SID of the Flow resource to fetch. @return [FlowInstance] FlowInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/studio/v2/flow.rb 285 def initialize(version, payload, sid: nil) 286 super(version) 287 288 # Marshaled Properties 289 @properties = { 290 'sid' => payload['sid'], 291 'account_sid' => payload['account_sid'], 292 'friendly_name' => payload['friendly_name'], 293 'definition' => payload['definition'], 294 'status' => payload['status'], 295 'revision' => payload['revision'].to_i, 296 'commit_message' => payload['commit_message'], 297 'valid' => payload['valid'], 298 'errors' => payload['errors'], 299 'warnings' => payload['warnings'], 300 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 301 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 302 'webhook_url' => payload['webhook_url'], 303 'url' => payload['url'], 304 'links' => payload['links'], 305 } 306 307 # Context 308 @instance_context = nil 309 @params = {'sid' => sid || @properties['sid'], } 310 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/studio/v2/flow.rb 331 def account_sid 332 @properties['account_sid'] 333 end
@return [String] Description of change made in the revision
# File lib/twilio-ruby/rest/studio/v2/flow.rb 361 def commit_message 362 @properties['commit_message'] 363 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [FlowContext] FlowContext
for this FlowInstance
# File lib/twilio-ruby/rest/studio/v2/flow.rb 316 def context 317 unless @instance_context 318 @instance_context = FlowContext.new(@version, @params['sid'], ) 319 end 320 @instance_context 321 end
@return [Time] The ISO 8601 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/studio/v2/flow.rb 385 def date_created 386 @properties['date_created'] 387 end
@return [Time] The ISO 8601 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/studio/v2/flow.rb 391 def date_updated 392 @properties['date_updated'] 393 end
@return [Hash] JSON representation of flow definition
# File lib/twilio-ruby/rest/studio/v2/flow.rb 343 def definition 344 @properties['definition'] 345 end
Delete the FlowInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/studio/v2/flow.rb 440 def delete 441 context.delete 442 end
@return [Array] List of error in the flow definition
# File lib/twilio-ruby/rest/studio/v2/flow.rb 373 def errors 374 @properties['errors'] 375 end
Access the executions @return [executions] executions
# File lib/twilio-ruby/rest/studio/v2/flow.rb 461 def executions 462 context.executions 463 end
Fetch the FlowInstance
@return [FlowInstance] Fetched FlowInstance
# File lib/twilio-ruby/rest/studio/v2/flow.rb 433 def fetch 434 context.fetch 435 end
@return [String] The string that you assigned to describe the Flow
# File lib/twilio-ruby/rest/studio/v2/flow.rb 337 def friendly_name 338 @properties['friendly_name'] 339 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/studio/v2/flow.rb 474 def inspect 475 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 476 "<Twilio.Studio.V2.FlowInstance #{values}>" 477 end
@return [String] Nested resource URLs
# File lib/twilio-ruby/rest/studio/v2/flow.rb 409 def links 410 @properties['links'] 411 end
@return [String] The latest revision number of the Flow's definition
# File lib/twilio-ruby/rest/studio/v2/flow.rb 355 def revision 356 @properties['revision'] 357 end
Access the revisions @return [revisions] revisions
# File lib/twilio-ruby/rest/studio/v2/flow.rb 447 def revisions 448 context.revisions 449 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/studio/v2/flow.rb 325 def sid 326 @properties['sid'] 327 end
@return [flow.Status] The status of the Flow
# File lib/twilio-ruby/rest/studio/v2/flow.rb 349 def status 350 @properties['status'] 351 end
Access the test_users
@return [test_users] test_users
# File lib/twilio-ruby/rest/studio/v2/flow.rb 454 def test_users 455 context.test_users 456 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/studio/v2/flow.rb 467 def to_s 468 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 469 "<Twilio.Studio.V2.FlowInstance #{values}>" 470 end
Update the FlowInstance
@param [flow.Status] status The status of the Flow. Can be: `draft` or
`published`.
@param [String] friendly_name
The string that you assigned to describe the Flow. @param [Hash] definition JSON representation of flow definition. @param [String] commit_message
Description of change made in the revision. @return [FlowInstance] Updated FlowInstance
# File lib/twilio-ruby/rest/studio/v2/flow.rb 421 def update(status: nil, friendly_name: :unset, definition: :unset, commit_message: :unset) 422 context.update( 423 status: status, 424 friendly_name: friendly_name, 425 definition: definition, 426 commit_message: commit_message, 427 ) 428 end
@return [String] The absolute URL of the resource
# File lib/twilio-ruby/rest/studio/v2/flow.rb 403 def url 404 @properties['url'] 405 end
@return [Boolean] Boolean if the flow definition is valid
# File lib/twilio-ruby/rest/studio/v2/flow.rb 367 def valid 368 @properties['valid'] 369 end
@return [Array] List of warnings in the flow definition
# File lib/twilio-ruby/rest/studio/v2/flow.rb 379 def warnings 380 @properties['warnings'] 381 end
@return [String] The webhook_url
# File lib/twilio-ruby/rest/studio/v2/flow.rb 397 def webhook_url 398 @properties['webhook_url'] 399 end