Class: Twilio::REST::Knowledge::V2::KnowledgeBasisInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Knowledge::V2::KnowledgeBasisInstance
- Defined in:
- lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb
Instance Method Summary collapse
-
#context ⇒ KnowledgeBasisContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#created_at ⇒ Time
The ISO 8601 timestamp when the Knowledge Base was created.
-
#delete ⇒ Boolean
Delete the KnowledgeBasisInstance.
-
#description ⇒ String
A human readable description of this resource, up to 128 characters.
-
#display_name ⇒ String
Provides a unique and addressable name to be assigned to this Knowledge Base.
-
#fetch ⇒ KnowledgeBasisInstance
Fetch the KnowledgeBasisInstance.
-
#id ⇒ String
The unique identifier for the Knowledge Base.
-
#initialize(version, payload, kb_id: nil) ⇒ KnowledgeBasisInstance
constructor
Initialize the KnowledgeBasisInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #message ⇒ String
-
#status ⇒ String
The provisioning status of the Knowledge Base.
-
#status_url ⇒ String
URI to check operation status.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(if_match: :unset, update_knowledge_base_request: nil) ⇒ KnowledgeBasisInstance
Update the KnowledgeBasisInstance.
-
#updated_at ⇒ Time
The ISO 8601 timestamp when the Knowledge Base was last updated.
-
#version ⇒ String
The current version number of the Knowledge Base.
Constructor Details
#initialize(version, payload, kb_id: nil) ⇒ KnowledgeBasisInstance
Initialize the KnowledgeBasisInstance
601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 601 def initialize(version, payload , kb_id: nil) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Marshaled Properties @properties = { 'message' => payload['message'], 'status_url' => payload['status_url'], 'display_name' => payload['display_name'], 'description' => payload['description'], 'id' => payload['id'], 'status' => payload['status'], 'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']), 'updated_at' => Twilio.deserialize_iso8601_datetime(payload['updated_at']), 'version' => payload['version'] == nil ? payload['version'] : payload['version'].to_i, } # Context @instance_context = nil @params = { 'kb_id' => kb_id || @properties['kb_id'] , } end |
Instance Method Details
#context ⇒ KnowledgeBasisContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
628 629 630 631 632 633 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 628 def context unless @instance_context @instance_context = KnowledgeBasisContext.new(@version , @params['kb_id']) end @instance_context end |
#created_at ⇒ Time
Returns The ISO 8601 timestamp when the Knowledge Base was created.
673 674 675 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 673 def created_at @properties['created_at'] end |
#delete ⇒ Boolean
Delete the KnowledgeBasisInstance
692 693 694 695 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 692 def delete context.delete end |
#description ⇒ String
Returns A human readable description of this resource, up to 128 characters.
655 656 657 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 655 def description @properties['description'] end |
#display_name ⇒ String
Returns Provides a unique and addressable name to be assigned to this Knowledge Base. This name is assigned by the developer and can be used in addition to the ID. It is intended to be human-readable and unique within the account.
649 650 651 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 649 def display_name @properties['display_name'] end |
#fetch ⇒ KnowledgeBasisInstance
Fetch the KnowledgeBasisInstance
700 701 702 703 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 700 def fetch context.fetch end |
#id ⇒ String
Returns The unique identifier for the Knowledge Base.
661 662 663 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 661 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
730 731 732 733 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 730 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Knowledge.V2.KnowledgeBasisInstance #{values}>" end |
#message ⇒ String
637 638 639 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 637 def @properties['message'] end |
#status ⇒ String
Returns The provisioning status of the Knowledge Base.
667 668 669 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 667 def status @properties['status'] end |
#status_url ⇒ String
Returns URI to check operation status.
643 644 645 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 643 def status_url @properties['status_url'] end |
#to_s ⇒ Object
Provide a user friendly representation
723 724 725 726 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 723 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Knowledge.V2.KnowledgeBasisInstance #{values}>" end |
#update(if_match: :unset, update_knowledge_base_request: nil) ⇒ KnowledgeBasisInstance
Update the KnowledgeBasisInstance
710 711 712 713 714 715 716 717 718 719 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 710 def update( if_match: :unset, update_knowledge_base_request: nil ) context.update( if_match: if_match, update_knowledge_base_request: update_knowledge_base_request, ) end |
#updated_at ⇒ Time
Returns The ISO 8601 timestamp when the Knowledge Base was last updated.
679 680 681 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 679 def updated_at @properties['updated_at'] end |
#version ⇒ String
Returns The current version number of the Knowledge Base. Incremented on each successful mutable update.
685 686 687 |
# File 'lib/twilio-ruby/rest/knowledge/v2/knowledge_basis.rb', line 685 def version @properties['version'] end |