Class: Twilio::REST::Assistants::V1::AssistantContext::AssistantsKnowledgeInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Assistants::V1::AssistantContext::AssistantsKnowledgeInstance
- Defined in:
- lib/twilio-ruby/rest/assistants/v1/assistant/assistants_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.
-
#context ⇒ AssistantsKnowledgeContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#create ⇒ AssistantsKnowledgeInstance
Create the AssistantsKnowledgeInstance.
-
#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 AssistantsKnowledgeInstance.
-
#description ⇒ String
The type of knowledge source.
-
#id ⇒ String
The description of knowledge.
-
#initialize(version, payload, assistant_id: nil, id: nil) ⇒ AssistantsKnowledgeInstance
constructor
Initialize the AssistantsKnowledgeInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#knowledge_source_details ⇒ Hash
The details of the knowledge source based on the type.
-
#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’).
-
#url ⇒ String
The url of the knowledge resource.
Constructor Details
#initialize(version, payload, assistant_id: nil, id: nil) ⇒ AssistantsKnowledgeInstance
Initialize the AssistantsKnowledgeInstance
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 234 def initialize(version, payload , assistant_id: nil, 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 = { 'assistant_id' => assistant_id || @properties['assistant_id'] ,'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.
281 282 283 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 281 def account_sid @properties['account_sid'] end |
#context ⇒ AssistantsKnowledgeContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
260 261 262 263 264 265 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 260 def context unless @instance_context @instance_context = AssistantsKnowledgeContext.new(@version , @params['assistant_id'], @params['id']) end @instance_context end |
#create ⇒ AssistantsKnowledgeInstance
Create the AssistantsKnowledgeInstance
330 331 332 333 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 330 def create context.create 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.
317 318 319 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 317 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.
323 324 325 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 323 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the AssistantsKnowledgeInstance
338 339 340 341 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 338 def delete context.delete end |
#description ⇒ String
Returns The type of knowledge source.
269 270 271 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 269 def description @properties['description'] end |
#id ⇒ String
Returns The description of knowledge.
275 276 277 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 275 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
352 353 354 355 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 352 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Assistants.V1.AssistantsKnowledgeInstance #{values}>" end |
#knowledge_source_details ⇒ Hash
Returns The details of the knowledge source based on the type.
287 288 289 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 287 def knowledge_source_details @properties['knowledge_source_details'] end |
#name ⇒ String
Returns The name of the knowledge source.
293 294 295 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 293 def name @properties['name'] end |
#status ⇒ String
Returns The status of processing the knowledge source (‘QUEUED’, ‘PROCESSING’, ‘COMPLETED’, ‘FAILED’).
299 300 301 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 299 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
345 346 347 348 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 345 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Assistants.V1.AssistantsKnowledgeInstance #{values}>" end |
#type ⇒ String
Returns The type of knowledge source (‘Web’, ‘Database’, ‘Text’, ‘File’).
305 306 307 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 305 def type @properties['type'] end |
#url ⇒ String
Returns The url of the knowledge resource.
311 312 313 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb', line 311 def url @properties['url'] end |