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.
-
#create_with_metadata ⇒ AssistantsToolInstance
Create the AssistantsToolInstanceMetadata.
-
#delete ⇒ Boolean
Delete the AssistantsToolInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the AssistantsToolInstanceMetadata.
-
#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
170 171 172 173 174 175 176 177 178 179 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 170 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
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 183 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 |
#create_with_metadata ⇒ AssistantsToolInstance
Create the AssistantsToolInstanceMetadata
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 203 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('POST', @uri, headers: headers) assistants_tool_instance = AssistantsToolInstance.new( @version, response.body, assistant_id: @solution[:assistant_id], id: @solution[:id], ) AssistantsToolInstanceMetadata.new( @version, assistants_tool_instance, response.headers, response.status_code ) end |
#delete ⇒ Boolean
Delete the AssistantsToolInstance
229 230 231 232 233 234 235 236 237 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 229 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the AssistantsToolInstanceMetadata
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 242 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) assistantsTool_instance = AssistantsToolInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) AssistantsToolInstanceMetadata.new(@version, assistantsTool_instance, response.headers, response.status_code) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
268 269 270 271 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 268 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.AssistantsToolContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
261 262 263 264 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 261 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.AssistantsToolContext #{context}>" end |