Class: Twilio::REST::Knowledge::V2::ChunkInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/knowledge/v2/chunk.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, kb_id: nil, knowledge_id: nil) ⇒ ChunkInstance

Initialize the ChunkInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Chunk resource.

  • sid (String)

    The SID of the Call resource to fetch.



265
266
267
268
269
270
271
272
273
274
275
# File 'lib/twilio-ruby/rest/knowledge/v2/chunk.rb', line 265

def initialize(version, payload , kb_id: nil, knowledge_id: nil)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    
    # Marshaled Properties
    @properties = { 
        'content' => payload['content'],
        'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
    }
end

Instance Method Details

#contentString

Returns The chunk content.

Returns:

  • (String)

    The chunk content.



280
281
282
# File 'lib/twilio-ruby/rest/knowledge/v2/chunk.rb', line 280

def content
    @properties['content']
end

#created_atTime

Returns The date and time in GMT when the Chunk was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



286
287
288
# File 'lib/twilio-ruby/rest/knowledge/v2/chunk.rb', line 286

def created_at
    @properties['created_at']
end

#inspectObject

Provide a detailed, user friendly representation



298
299
300
# File 'lib/twilio-ruby/rest/knowledge/v2/chunk.rb', line 298

def inspect
    "<Twilio.Knowledge.V2.ChunkInstance>"
end

#to_sObject

Provide a user friendly representation



292
293
294
# File 'lib/twilio-ruby/rest/knowledge/v2/chunk.rb', line 292

def to_s
    "<Twilio.Knowledge.V2.ChunkInstance>"
end