Class: Twilio::REST::Studio::V2::FlowInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Studio::V2::FlowInstance
- Defined in:
- lib/twilio-ruby/rest/studio/v2/flow.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Flow resource.
-
#commit_message ⇒ String
Description of change made in the revision.
-
#context ⇒ FlowContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#definition ⇒ Hash
JSON representation of flow definition.
-
#delete ⇒ Boolean
Delete the FlowInstance.
-
#errors ⇒ Array<Hash>
List of error in the flow definition.
-
#executions ⇒ executions
Access the executions.
-
#fetch ⇒ FlowInstance
Fetch the FlowInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the Flow.
-
#initialize(version, payload, sid: nil) ⇒ FlowInstance
constructor
Initialize the FlowInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
The URLs of the Flow’s nested resources.
-
#revision ⇒ String
The latest revision number of the Flow’s definition.
-
#revisions ⇒ revisions
Access the revisions.
-
#sid ⇒ String
The unique string that we created to identify the Flow resource.
- #status ⇒ Status
-
#test_users ⇒ test_users
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.
-
#url ⇒ String
The absolute URL of the resource.
-
#valid ⇒ Boolean
Boolean if the flow definition is valid.
-
#warnings ⇒ Array<Hash>
List of warnings in the flow definition.
- #webhook_url ⇒ String
Constructor Details
#initialize(version, payload, sid: nil) ⇒ FlowInstance
Initialize the FlowInstance
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 324 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'friendly_name' => payload['friendly_name'], 'definition' => payload['definition'], 'status' => payload['status'], 'revision' => payload['revision'] == nil ? payload['revision'] : payload['revision'].to_i, 'commit_message' => payload['commit_message'], 'valid' => payload['valid'], 'errors' => payload['errors'], 'warnings' => payload['warnings'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'webhook_url' => payload['webhook_url'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Flow resource.
370 371 372 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 370 def account_sid @properties['account_sid'] end |
#commit_message ⇒ String
Returns Description of change made in the revision.
400 401 402 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 400 def @properties['commit_message'] end |
#context ⇒ FlowContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
355 356 357 358 359 360 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 355 def context unless @instance_context @instance_context = FlowContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
424 425 426 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 424 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
430 431 432 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 430 def date_updated @properties['date_updated'] end |
#definition ⇒ Hash
Returns JSON representation of flow definition.
382 383 384 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 382 def definition @properties['definition'] end |
#delete ⇒ Boolean
Delete the FlowInstance
455 456 457 458 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 455 def delete context.delete end |
#errors ⇒ Array<Hash>
Returns List of error in the flow definition.
412 413 414 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 412 def errors @properties['errors'] end |
#executions ⇒ executions
Access the executions
493 494 495 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 493 def executions context.executions end |
#fetch ⇒ FlowInstance
Fetch the FlowInstance
463 464 465 466 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 463 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the Flow.
376 377 378 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 376 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
520 521 522 523 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 520 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Studio.V2.FlowInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of the Flow’s nested resources.
448 449 450 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 448 def links @properties['links'] end |
#revision ⇒ String
Returns The latest revision number of the Flow’s definition.
394 395 396 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 394 def revision @properties['revision'] end |
#revisions ⇒ revisions
Access the revisions
507 508 509 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 507 def revisions context.revisions end |
#sid ⇒ String
Returns The unique string that we created to identify the Flow resource.
364 365 366 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 364 def sid @properties['sid'] end |
#status ⇒ Status
388 389 390 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 388 def status @properties['status'] end |
#test_users ⇒ test_users
Access the test_users
500 501 502 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 500 def test_users context.test_users end |
#to_s ⇒ Object
Provide a user friendly representation
513 514 515 516 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 513 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Studio.V2.FlowInstance #{values}>" end |
#update(status: nil, friendly_name: :unset, definition: :unset, commit_message: :unset) ⇒ FlowInstance
Update the FlowInstance
475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 475 def update( status: nil, friendly_name: :unset, definition: :unset, commit_message: :unset ) context.update( status: status, friendly_name: friendly_name, definition: definition, commit_message: , ) end |
#url ⇒ String
Returns The absolute URL of the resource.
442 443 444 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 442 def url @properties['url'] end |
#valid ⇒ Boolean
Returns Boolean if the flow definition is valid.
406 407 408 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 406 def valid @properties['valid'] end |
#warnings ⇒ Array<Hash>
Returns List of warnings in the flow definition.
418 419 420 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 418 def warnings @properties['warnings'] end |
#webhook_url ⇒ String
436 437 438 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 436 def webhook_url @properties['webhook_url'] end |