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
139 140 141 142 143 144 145 146 147 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 139 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
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 151 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
171 172 173 174 175 176 177 178 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 171 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
190 191 192 193 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 190 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.AssistantsToolContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
183 184 185 186 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 183 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.AssistantsToolContext #{context}>" end |