Class: Twilio::REST::Assistants::V1::Knowledge::KnowledgeStatusInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, id: nil) ⇒ KnowledgeStatusInstance

Initialize the KnowledgeStatusInstance



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 268

def initialize(version, payload , id: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'status' => payload['status'],
        'last_status' => payload['last_status'],
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
    }

    # Context
    @instance_context = nil
    @params = { 'id' => id  || @properties['id']  , }
end

Instance Method Details

#account_sidString



298
299
300
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 298

def 
    @properties['account_sid']
end

#contextKnowledgeStatusContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



289
290
291
292
293
294
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 289

def context
    unless @instance_context
        @instance_context = KnowledgeStatusContext.new(@version , @params['id'])
    end
    @instance_context
end

#date_updatedTime



316
317
318
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 316

def date_updated
    @properties['date_updated']
end

#fetchKnowledgeStatusInstance

Fetch the KnowledgeStatusInstance



323
324
325
326
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 323

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



337
338
339
340
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 337

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Assistants.V1.KnowledgeStatusInstance #{values}>"
end

#last_statusString



310
311
312
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 310

def last_status
    @properties['last_status']
end

#statusString



304
305
306
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 304

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



330
331
332
333
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb', line 330

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Assistants.V1.KnowledgeStatusInstance #{values}>"
end