Class: Twilio::REST::Assistants::V1::AssistantContext::AssistantsKnowledgeContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Assistants::V1::AssistantContext::AssistantsKnowledgeContext
- Defined in:
- lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb
Instance Method Summary collapse
-
#create ⇒ AssistantsKnowledgeInstance
Create the AssistantsKnowledgeInstance.
-
#create_with_metadata ⇒ AssistantsKnowledgeInstance
Create the AssistantsKnowledgeInstanceMetadata.
-
#delete ⇒ Boolean
Delete the AssistantsKnowledgeInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the AssistantsKnowledgeInstanceMetadata.
-
#initialize(version, assistant_id, id) ⇒ AssistantsKnowledgeContext
constructor
Initialize the AssistantsKnowledgeContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, assistant_id, id) ⇒ AssistantsKnowledgeContext
Initialize the AssistantsKnowledgeContext
162 163 164 165 166 167 168 169 170 171 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.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]}/Knowledge/#{@solution[:id]}" end |
Instance Method Details
#create ⇒ AssistantsKnowledgeInstance
Create the AssistantsKnowledgeInstance
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_knowledge.rb', line 175 def create headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.create('POST', @uri, headers: headers) AssistantsKnowledgeInstance.new( @version, payload, assistant_id: @solution[:assistant_id], id: @solution[:id], ) end |
#create_with_metadata ⇒ AssistantsKnowledgeInstance
Create the AssistantsKnowledgeInstanceMetadata
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_knowledge.rb', line 195 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('POST', @uri, headers: headers) assistants_knowledge_instance = AssistantsKnowledgeInstance.new( @version, response.body, assistant_id: @solution[:assistant_id], id: @solution[:id], ) AssistantsKnowledgeInstanceMetadata.new( @version, assistants_knowledge_instance, response.headers, response.status_code ) end |
#delete ⇒ Boolean
Delete the AssistantsKnowledgeInstance
221 222 223 224 225 226 227 228 229 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.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 AssistantsKnowledgeInstanceMetadata
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 234 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) assistantsKnowledge_instance = AssistantsKnowledgeInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) AssistantsKnowledgeInstanceMetadata.new(@version, assistantsKnowledge_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_knowledge.rb', line 260 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.AssistantsKnowledgeContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
253 254 255 256 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 253 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.AssistantsKnowledgeContext #{context}>" end |