Class: Twilio::REST::Knowledge::V2::ChunkInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Knowledge::V2::ChunkInstance
- Defined in:
- lib/twilio-ruby/rest/knowledge/v2/chunk.rb
Instance Method Summary collapse
-
#chunk_index ⇒ String
0-based position of this chunk within its source document for a single ingestion run.
-
#content ⇒ String
The chunk content.
-
#created_at ⇒ Time
The date and time in GMT when the Chunk was created specified in ISO 8601 format.
-
#document_number ⇒ String
Physical page number (1-based).
-
#document_title ⇒ String
Human-readable title of the source document.
-
#document_url ⇒ String
Specific page URL this chunk was crawled from.
-
#initialize(version, payload, kb_id: nil, knowledge_id: nil) ⇒ ChunkInstance
constructor
Initialize the ChunkInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, payload, kb_id: nil, knowledge_id: nil) ⇒ ChunkInstance
Initialize the ChunkInstance
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# 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']), 'chunk_index' => payload['chunk_index'] == nil ? payload['chunk_index'] : payload['chunk_index'].to_i, 'document_title' => payload['document_title'], 'document_url' => payload['document_url'], 'document_number' => payload['document_number'] == nil ? payload['document_number'] : payload['document_number'].to_i, } end |
Instance Method Details
#chunk_index ⇒ String
Returns 0-based position of this chunk within its source document for a single ingestion run.
296 297 298 |
# File 'lib/twilio-ruby/rest/knowledge/v2/chunk.rb', line 296 def chunk_index @properties['chunk_index'] end |
#content ⇒ String
Returns The chunk content.
284 285 286 |
# File 'lib/twilio-ruby/rest/knowledge/v2/chunk.rb', line 284 def content @properties['content'] end |
#created_at ⇒ Time
Returns The date and time in GMT when the Chunk was created specified in ISO 8601 format.
290 291 292 |
# File 'lib/twilio-ruby/rest/knowledge/v2/chunk.rb', line 290 def created_at @properties['created_at'] end |
#document_number ⇒ String
Returns Physical page number (1-based). PDF sources only; omitted for all other source types.
314 315 316 |
# File 'lib/twilio-ruby/rest/knowledge/v2/chunk.rb', line 314 def document_number @properties['document_number'] end |
#document_title ⇒ String
Returns Human-readable title of the source document. Web: HTML
302 303 304 |
# File 'lib/twilio-ruby/rest/knowledge/v2/chunk.rb', line 302 def document_title @properties['document_title'] end |
#document_url ⇒ String
Returns Specific page URL this chunk was crawled from. Web sources only; null for File and Text sources.
308 309 310 |
# File 'lib/twilio-ruby/rest/knowledge/v2/chunk.rb', line 308 def document_url @properties['document_url'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
326 327 328 |
# File 'lib/twilio-ruby/rest/knowledge/v2/chunk.rb', line 326 def inspect "<Twilio.Knowledge.V2.ChunkInstance>" end |
#to_s ⇒ Object
Provide a user friendly representation
320 321 322 |
# File 'lib/twilio-ruby/rest/knowledge/v2/chunk.rb', line 320 def to_s "<Twilio.Knowledge.V2.ChunkInstance>" end |