Class: Twilio::REST::Assistants::V1::KnowledgeInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Assistants::V1::KnowledgeInstance
- Defined in:
- lib/twilio-ruby/rest/assistants/v1/knowledge.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
-
#chunks ⇒ chunks
Access the chunks.
-
#context ⇒ KnowledgeContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the Knowledge was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#delete ⇒ Boolean
Delete the KnowledgeInstance.
-
#description ⇒ String
The type of knowledge source.
-
#fetch ⇒ KnowledgeInstance
Fetch the KnowledgeInstance.
-
#id ⇒ String
The description of knowledge.
-
#initialize(version, payload, id: nil) ⇒ KnowledgeInstance
constructor
Initialize the KnowledgeInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#knowledge_source_details ⇒ Hash
The details of the knowledge source based on the type.
-
#knowledge_status ⇒ knowledge_status
Access the knowledge_status.
-
#name ⇒ String
The name of the knowledge source.
-
#status ⇒ String
The status of processing the knowledge source (‘QUEUED’, ‘PROCESSING’, ‘COMPLETED’, ‘FAILED’).
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#type ⇒ String
The type of knowledge source (‘Web’, ‘Database’, ‘Text’, ‘File’).
-
#update(assistants_v1_service_update_knowledge_request: :unset) ⇒ KnowledgeInstance
Update the KnowledgeInstance.
-
#url ⇒ String
The url of the knowledge resource.
Constructor Details
#initialize(version, payload, id: nil) ⇒ KnowledgeInstance
Initialize the KnowledgeInstance
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 439 def initialize(version, payload , id: nil) super(version) # Marshaled Properties @properties = { 'description' => payload['description'], 'id' => payload['id'], 'account_sid' => payload['account_sid'], 'knowledge_source_details' => payload['knowledge_source_details'], 'name' => payload['name'], 'status' => payload['status'], 'type' => payload['type'], 'url' => payload['url'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), } # Context @instance_context = nil @params = { 'id' => id || @properties['id'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
486 487 488 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 486 def account_sid @properties['account_sid'] end |
#chunks ⇒ chunks
Access the chunks
562 563 564 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 562 def chunks context.chunks end |
#context ⇒ KnowledgeContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
465 466 467 468 469 470 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 465 def context unless @instance_context @instance_context = KnowledgeContext.new(@version , @params['id']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the Knowledge was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
522 523 524 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 522 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
528 529 530 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 528 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the KnowledgeInstance
535 536 537 538 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 535 def delete context.delete end |
#description ⇒ String
Returns The type of knowledge source.
474 475 476 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 474 def description @properties['description'] end |
#fetch ⇒ KnowledgeInstance
Fetch the KnowledgeInstance
543 544 545 546 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 543 def fetch context.fetch end |
#id ⇒ String
Returns The description of knowledge.
480 481 482 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 480 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
582 583 584 585 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 582 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Assistants.V1.KnowledgeInstance #{values}>" end |
#knowledge_source_details ⇒ Hash
Returns The details of the knowledge source based on the type.
492 493 494 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 492 def knowledge_source_details @properties['knowledge_source_details'] end |
#knowledge_status ⇒ knowledge_status
Access the knowledge_status
569 570 571 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 569 def knowledge_status context.knowledge_status end |
#name ⇒ String
Returns The name of the knowledge source.
498 499 500 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 498 def name @properties['name'] end |
#status ⇒ String
Returns The status of processing the knowledge source (‘QUEUED’, ‘PROCESSING’, ‘COMPLETED’, ‘FAILED’).
504 505 506 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 504 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
575 576 577 578 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 575 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Assistants.V1.KnowledgeInstance #{values}>" end |
#type ⇒ String
Returns The type of knowledge source (‘Web’, ‘Database’, ‘Text’, ‘File’).
510 511 512 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 510 def type @properties['type'] end |
#update(assistants_v1_service_update_knowledge_request: :unset) ⇒ KnowledgeInstance
Update the KnowledgeInstance
552 553 554 555 556 557 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 552 def update(assistants_v1_service_update_knowledge_request: :unset ) context.update( ) end |
#url ⇒ String
Returns The url of the knowledge resource.
516 517 518 |
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge.rb', line 516 def url @properties['url'] end |