Class: Twilio::REST::Assistants::V1::ToolInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Assistants::V1::ToolInstance
- Defined in:
- lib/twilio-ruby/rest/assistants/v1/tool.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Tool resource.
-
#context ⇒ ToolContext
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 Tool was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the Tool was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#delete ⇒ Boolean
Delete the ToolInstance.
-
#description ⇒ String
The description of the tool.
-
#enabled ⇒ Boolean
True if the tool is enabled.
-
#fetch ⇒ ToolInstance
Fetch the ToolInstance.
-
#id ⇒ String
The tool ID.
-
#initialize(version, payload, id: nil) ⇒ ToolInstance
constructor
Initialize the ToolInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#meta ⇒ Hash
The metadata related to method, url, input_schema to used with the Tool.
-
#name ⇒ String
The name of the tool.
-
#policies ⇒ Array<AssistantsV1ServicePolicy>
The Policies associated with the tool.
-
#requires_auth ⇒ Boolean
The authentication requirement for the tool.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#type ⇒ String
The type of the tool.
-
#update(assistants_v1_service_update_tool_request: :unset) ⇒ ToolInstance
Update the ToolInstance.
-
#url ⇒ String
The url of the tool resource.
Constructor Details
#initialize(version, payload, id: nil) ⇒ ToolInstance
Initialize the ToolInstance
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 693 def initialize(version, payload , id: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'description' => payload['description'], 'enabled' => payload['enabled'], 'id' => payload['id'], 'meta' => payload['meta'], 'name' => payload['name'], 'requires_auth' => payload['requires_auth'], 'type' => payload['type'], 'url' => payload['url'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'policies' => payload['policies'], } # Context @instance_context = nil @params = { 'id' => id || @properties['id'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Tool resource.
731 732 733 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 731 def account_sid @properties['account_sid'] end |
#context ⇒ ToolContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
722 723 724 725 726 727 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 722 def context unless @instance_context @instance_context = ToolContext.new(@version , @params['id']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the Tool was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
785 786 787 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 785 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the Tool was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
791 792 793 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 791 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ToolInstance
804 805 806 807 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 804 def delete context.delete end |
#description ⇒ String
Returns The description of the tool.
737 738 739 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 737 def description @properties['description'] end |
#enabled ⇒ Boolean
Returns True if the tool is enabled.
743 744 745 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 743 def enabled @properties['enabled'] end |
#fetch ⇒ ToolInstance
Fetch the ToolInstance
812 813 814 815 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 812 def fetch context.fetch end |
#id ⇒ String
Returns The tool ID.
749 750 751 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 749 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
838 839 840 841 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 838 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Assistants.V1.ToolInstance #{values}>" end |
#meta ⇒ Hash
Returns The metadata related to method, url, input_schema to used with the Tool.
755 756 757 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 755 def @properties['meta'] end |
#name ⇒ String
Returns The name of the tool.
761 762 763 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 761 def name @properties['name'] end |
#policies ⇒ Array<AssistantsV1ServicePolicy>
Returns The Policies associated with the tool.
797 798 799 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 797 def policies @properties['policies'] end |
#requires_auth ⇒ Boolean
Returns The authentication requirement for the tool.
767 768 769 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 767 def requires_auth @properties['requires_auth'] end |
#to_s ⇒ Object
Provide a user friendly representation
831 832 833 834 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 831 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Assistants.V1.ToolInstance #{values}>" end |
#type ⇒ String
Returns The type of the tool. (‘WEBHOOK’).
773 774 775 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 773 def type @properties['type'] end |
#update(assistants_v1_service_update_tool_request: :unset) ⇒ ToolInstance
Update the ToolInstance
821 822 823 824 825 826 827 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 821 def update(assistants_v1_service_update_tool_request: :unset ) context.update( assistants_v1_service_update_tool_request: assistants_v1_service_update_tool_request, ) end |
#url ⇒ String
Returns The url of the tool resource.
779 780 781 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 779 def url @properties['url'] end |