Class: Twilio::REST::Knowledge::V1::KnowledgeInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Knowledge::V1::KnowledgeInstance
- Defined in:
- lib/twilio-ruby/rest/knowledge/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.
-
#embedding_model ⇒ String
The embedding model to be used for the 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(knowledge_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
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 464 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'], 'embedding_model' => payload['embedding_model'], '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.
512 513 514 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 512 def account_sid @properties['account_sid'] end |
#chunks ⇒ chunks
Access the chunks
594 595 596 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 594 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
491 492 493 494 495 496 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 491 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.
554 555 556 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 554 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.
560 561 562 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 560 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the KnowledgeInstance
567 568 569 570 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 567 def delete context.delete end |
#description ⇒ String
Returns The type of knowledge source.
500 501 502 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 500 def description @properties['description'] end |
#embedding_model ⇒ String
Returns The embedding model to be used for the knowledge source.
548 549 550 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 548 def @properties['embedding_model'] end |
#fetch ⇒ KnowledgeInstance
Fetch the KnowledgeInstance
575 576 577 578 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 575 def fetch context.fetch end |
#id ⇒ String
Returns The description of knowledge.
506 507 508 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 506 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
614 615 616 617 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 614 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Knowledge.V1.KnowledgeInstance #{values}>" end |
#knowledge_source_details ⇒ Hash
Returns The details of the knowledge source based on the type.
518 519 520 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 518 def knowledge_source_details @properties['knowledge_source_details'] end |
#knowledge_status ⇒ knowledge_status
Access the knowledge_status
601 602 603 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 601 def knowledge_status context.knowledge_status end |
#name ⇒ String
Returns The name of the knowledge source.
524 525 526 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 524 def name @properties['name'] end |
#status ⇒ String
Returns The status of processing the knowledge source (‘QUEUED’, ‘PROCESSING’, ‘COMPLETED’, ‘FAILED’).
530 531 532 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 530 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
607 608 609 610 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 607 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Knowledge.V1.KnowledgeInstance #{values}>" end |
#type ⇒ String
Returns The type of knowledge source (‘Web’, ‘Database’, ‘Text’, ‘File’).
536 537 538 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 536 def type @properties['type'] end |
#update(knowledge_v1_service_update_knowledge_request: :unset) ⇒ KnowledgeInstance
Update the KnowledgeInstance
584 585 586 587 588 589 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 584 def update(knowledge_v1_service_update_knowledge_request: :unset ) context.update( ) end |
#url ⇒ String
Returns The url of the knowledge resource.
542 543 544 |
# File 'lib/twilio-ruby/rest/knowledge/v1/knowledge.rb', line 542 def url @properties['url'] end |