Class: Twilio::REST::Assistants::V1::Knowledge::KnowledgeStatusContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, id) ⇒ KnowledgeStatusContext

Initialize the KnowledgeStatusContext

Parameters:

  • version (Version)

    Version that contains the resource

  • id (String)

    the Knowledge ID.



51
52
53
54
55
56
57
58
59
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 51

def initialize(version, id)
    super(version)

    # Path Solution
    @solution = { id: id,  }
    @uri = "/Knowledge/#{@solution[:id]}/Status"

    
end

Instance Method Details

#fetchKnowledgeStatusInstance

Fetch the KnowledgeStatusInstance

Returns:



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 63

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    KnowledgeStatusInstance.new(
        @version,
        payload,
        id: @solution[:id],
    )
end

#inspectObject

Provide a detailed, user friendly representation



89
90
91
92
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 89

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Assistants.V1.KnowledgeStatusContext #{context}>"
end

#to_sObject

Provide a user friendly representation



82
83
84
85
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 82

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Assistants.V1.KnowledgeStatusContext #{context}>"
end