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
338 339 340 341 342 343 344 345 346 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 338 def initialize(version, id) super(version) # Path Solution @solution = { id: id, } @uri = "/Tools/#{@solution[:id]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the ToolInstance
350 351 352 353 354 355 356 357 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 350 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
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 362 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
409 410 411 412 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 409 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.ToolContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
402 403 404 405 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 402 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
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 382 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 |