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
162 163 164 165 166 167 168 169 170 171 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 162 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
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 175 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
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 195 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
221 222 223 224 225 226 227 228 229 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 221 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
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 234 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
260 261 262 263 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 260 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.AssistantsToolContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
253 254 255 256 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 253 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.AssistantsToolContext #{context}>" end |