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
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 608 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.
655 656 657 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 655 def account_sid @properties['account_sid'] end |
#commit_message ⇒ String
Returns Description of change made in the revision.
685 686 687 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 685 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
640 641 642 643 644 645 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 640 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.
709 710 711 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 709 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.
715 716 717 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 715 def date_updated @properties['date_updated'] end |
#definition ⇒ Hash
Returns JSON representation of flow definition.
667 668 669 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 667 def definition @properties['definition'] end |
#delete ⇒ Boolean
Delete the FlowInstance
740 741 742 743 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 740 def delete context.delete end |
#errors ⇒ Array<Hash>
Returns List of error in the flow definition.
697 698 699 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 697 def errors @properties['errors'] end |
#executions ⇒ executions
Access the executions
778 779 780 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 778 def executions context.executions end |
#fetch ⇒ FlowInstance
Fetch the FlowInstance
748 749 750 751 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 748 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the Flow.
661 662 663 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 661 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
805 806 807 808 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 805 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.
733 734 735 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 733 def links @properties['links'] end |
#revision ⇒ String
Returns The latest revision number of the Flow’s definition.
679 680 681 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 679 def revision @properties['revision'] end |
#revisions ⇒ revisions
Access the revisions
792 793 794 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 792 def revisions context.revisions end |
#sid ⇒ String
Returns The unique string that we created to identify the Flow resource.
649 650 651 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 649 def sid @properties['sid'] end |
#status ⇒ Status
673 674 675 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 673 def status @properties['status'] end |
#test_users ⇒ test_users
Access the test_users
785 786 787 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 785 def test_users context.test_users end |
#to_s ⇒ Object
Provide a user friendly representation
798 799 800 801 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 798 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
760 761 762 763 764 765 766 767 768 769 770 771 772 773 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 760 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.
727 728 729 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 727 def url @properties['url'] end |
#valid ⇒ Boolean
Returns Boolean if the flow definition is valid.
691 692 693 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 691 def valid @properties['valid'] end |
#warnings ⇒ Array<Hash>
Returns List of warnings in the flow definition.
703 704 705 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 703 def warnings @properties['warnings'] end |
#webhook_url ⇒ String
721 722 723 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 721 def webhook_url @properties['webhook_url'] end |