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
320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 320 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
387 388 389 390 391 392 393 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 387 def chunks unless @chunks @chunks = ChunkList.new( @version, ) end @chunks end |
#delete ⇒ Boolean
Delete the KnowledgeInstance
334 335 336 337 338 339 340 341 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 334 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
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 346 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
414 415 416 417 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 414 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.KnowledgeContext #{context}>" end |
#knowledge_status ⇒ KnowledgeStatusList, KnowledgeStatusContext
Access the knowledge_status
398 399 400 401 402 403 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 398 def knowledge_status KnowledgeStatusContext.new( @version, @solution[:id] ) end |
#to_s ⇒ Object
Provide a user friendly representation
407 408 409 410 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 407 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
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 366 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 |