Class: Twilio::REST::Assistants::V1::Knowledge::ChunkInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, 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.



169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb', line 169

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

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Knowledge resource.

Returns:



185
186
187
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb', line 185

def 
    @properties['account_sid']
end

#contentString

Returns The chunk content.

Returns:

  • (String)

    The chunk content.



191
192
193
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb', line 191

def content
    @properties['content']
end

#date_createdTime

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

Returns:



203
204
205
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb', line 203

def date_created
    @properties['date_created']
end

#date_updatedTime

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

Returns:



209
210
211
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb', line 209

def date_updated
    @properties['date_updated']
end

#inspectObject

Provide a detailed, user friendly representation



221
222
223
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb', line 221

def inspect
    "<Twilio.Assistants.V1.ChunkInstance>"
end

#metadataHash

Returns The metadata of the chunk.

Returns:

  • (Hash)

    The metadata of the chunk.



197
198
199
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb', line 197

def 
    @properties['metadata']
end

#to_sObject

Provide a user friendly representation



215
216
217
# File 'lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb', line 215

def to_s
    "<Twilio.Assistants.V1.ChunkInstance>"
end