Class: Twilio::REST::Assistants::V1::ToolContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Assistants::V1::ToolContext
- Defined in:
- lib/twilio-ruby/rest/assistants/v1/tool.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the ToolInstance.
-
#fetch ⇒ ToolInstance
Fetch the ToolInstance.
-
#initialize(version, id) ⇒ ToolContext
constructor
Initialize the ToolContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(assistants_v1_service_update_tool_request: :unset) ⇒ ToolInstance
Update the ToolInstance.
Constructor Details
#initialize(version, id) ⇒ ToolContext
Initialize the ToolContext
329 330 331 332 333 334 335 336 337 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 329 def initialize(version, id) super(version) # Path Solution @solution = { id: id, } @uri = "/Tools/#{@solution[:id]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the ToolInstance
341 342 343 344 345 346 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 341 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ ToolInstance
Fetch the ToolInstance
351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 351 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ToolInstance.new( @version, payload, id: @solution[:id], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
390 391 392 393 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 390 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.ToolContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
383 384 385 386 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 383 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.ToolContext #{context}>" end |
#update(assistants_v1_service_update_tool_request: :unset) ⇒ ToolInstance
Update the ToolInstance
367 368 369 370 371 372 373 374 375 376 377 378 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 367 def update(assistants_v1_service_update_tool_request: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' payload = @version.update('PUT', @uri, headers: headers, data: assistants_v1_service_update_tool_request.to_json) ToolInstance.new( @version, payload, id: @solution[:id], ) end |