Class: Twilio::REST::Assistants::V1::AssistantContext::AssistantsKnowledgeContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Assistants::V1::AssistantContext::AssistantsKnowledgeContext
- Defined in:
- lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb
Instance Method Summary collapse
-
#create ⇒ AssistantsKnowledgeInstance
Create the AssistantsKnowledgeInstance.
-
#delete ⇒ Boolean
Delete the AssistantsKnowledgeInstance.
-
#initialize(version, assistant_id, id) ⇒ AssistantsKnowledgeContext
constructor
Initialize the AssistantsKnowledgeContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, assistant_id, id) ⇒ AssistantsKnowledgeContext
Initialize the AssistantsKnowledgeContext
139 140 141 142 143 144 145 146 147 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 139 def initialize(version, assistant_id, id) super(version) # Path Solution @solution = { assistant_id: assistant_id, id: id, } @uri = "/Assistants/#{@solution[:assistant_id]}/Knowledge/#{@solution[:id]}" end |
Instance Method Details
#create ⇒ AssistantsKnowledgeInstance
Create the AssistantsKnowledgeInstance
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 151 def create headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.create('POST', @uri, headers: headers) AssistantsKnowledgeInstance.new( @version, payload, assistant_id: @solution[:assistant_id], id: @solution[:id], ) end |
#delete ⇒ Boolean
Delete the AssistantsKnowledgeInstance
171 172 173 174 175 176 177 178 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 171 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
190 191 192 193 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 190 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.AssistantsKnowledgeContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
183 184 185 186 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 183 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.AssistantsKnowledgeContext #{context}>" end |