Class: Twilio::REST::Assistants::V1::AssistantContext::AssistantsToolContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Assistants::V1::AssistantContext::AssistantsToolContext
- Defined in:
- lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb
Instance Method Summary collapse
-
#create ⇒ AssistantsToolInstance
Create the AssistantsToolInstance.
-
#delete ⇒ Boolean
Delete the AssistantsToolInstance.
-
#initialize(version, assistant_id, id) ⇒ AssistantsToolContext
constructor
Initialize the AssistantsToolContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, assistant_id, id) ⇒ AssistantsToolContext
Initialize the AssistantsToolContext
136 137 138 139 140 141 142 143 144 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 136 def initialize(version, assistant_id, id) super(version) # Path Solution @solution = { assistant_id: assistant_id, id: id, } @uri = "/Assistants/#{@solution[:assistant_id]}/Tools/#{@solution[:id]}" end |
Instance Method Details
#create ⇒ AssistantsToolInstance
Create the AssistantsToolInstance
148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 148 def create headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.create('POST', @uri, headers: headers) AssistantsToolInstance.new( @version, payload, assistant_id: @solution[:assistant_id], id: @solution[:id], ) end |
#delete ⇒ Boolean
Delete the AssistantsToolInstance
164 165 166 167 168 169 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 164 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
181 182 183 184 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 181 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.AssistantsToolContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
174 175 176 177 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 174 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.AssistantsToolContext #{context}>" end |