Class: Twilio::REST::Assistants::V1::KnowledgeContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Assistants::V1::KnowledgeContext
- Defined in:
- lib/twilio-ruby/rest/assistants/v1/knowledge.rb
Instance Method Summary collapse
-
#chunks ⇒ ChunkList, ChunkContext
Access the chunks.
-
#delete ⇒ Boolean
Delete the KnowledgeInstance.
-
#fetch ⇒ KnowledgeInstance
Fetch the KnowledgeInstance.
-
#initialize(version, id) ⇒ KnowledgeContext
constructor
Initialize the KnowledgeContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#knowledge_status ⇒ KnowledgeStatusList, KnowledgeStatusContext
Access the knowledge_status.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(assistants_v1_service_update_knowledge_request: :unset) ⇒ KnowledgeInstance
Update the KnowledgeInstance.
Constructor Details
#initialize(version, id) ⇒ KnowledgeContext
Initialize the KnowledgeContext
332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 332 def initialize(version, id) super(version) # Path Solution @solution = { id: id, } @uri = "/Knowledge/#{@solution[:id]}" # Dependents @chunks = nil @knowledge_status = nil end |
Instance Method Details
#chunks ⇒ ChunkList, ChunkContext
Access the chunks
399 400 401 402 403 404 405 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 399 def chunks unless @chunks @chunks = ChunkList.new( @version, ) end @chunks end |
#delete ⇒ Boolean
Delete the KnowledgeInstance
346 347 348 349 350 351 352 353 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 346 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ KnowledgeInstance
Fetch the KnowledgeInstance
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 358 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) KnowledgeInstance.new( @version, payload, id: @solution[:id], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
426 427 428 429 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 426 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.KnowledgeContext #{context}>" end |
#knowledge_status ⇒ KnowledgeStatusList, KnowledgeStatusContext
Access the knowledge_status
410 411 412 413 414 415 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 410 def knowledge_status KnowledgeStatusContext.new( @version, @solution[:id] ) end |
#to_s ⇒ Object
Provide a user friendly representation
419 420 421 422 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 419 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.KnowledgeContext #{context}>" end |
#update(assistants_v1_service_update_knowledge_request: :unset) ⇒ KnowledgeInstance
Update the KnowledgeInstance
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 378 def update(assistants_v1_service_update_knowledge_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_knowledge_request.to_json) KnowledgeInstance.new( @version, payload, id: @solution[:id], ) end |