Class: Google::Apis::DeveloperknowledgeV1alpha::DocumentChunk

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/developerknowledge_v1alpha/classes.rb,
lib/google/apis/developerknowledge_v1alpha/representations.rb,
lib/google/apis/developerknowledge_v1alpha/representations.rb

Overview

A DocumentChunk represents a piece of content from a Document in the DeveloperKnowledge corpus. To fetch the entire document content, pass the parent to DeveloperKnowledge.GetDocument or DeveloperKnowledge. BatchGetDocuments.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ DocumentChunk

Returns a new instance of DocumentChunk.



284
285
286
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 284

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#contentString

Output only. Contains the content of the document chunk. Corresponds to the JSON property content

Returns:

  • (String)


263
264
265
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 263

def content
  @content
end

#documentGoogle::Apis::DeveloperknowledgeV1alpha::Document

A Document represents a piece of content from the Developer Knowledge corpus. Corresponds to the JSON property document



268
269
270
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 268

def document
  @document
end

#idString

Output only. Specifies the ID of this chunk within the document. The chunk ID is unique within a document, but not globally unique across documents. The chunk ID is not stable and may change over time. Corresponds to the JSON property id

Returns:

  • (String)


275
276
277
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 275

def id
  @id
end

#parentString

Output only. Contains the resource name of the document this chunk is from. Format: documents/uri_without_scheme`Example:documents/docs.cloud.google. com/storage/docs/creating-buckets Corresponds to the JSON propertyparent`

Returns:

  • (String)


282
283
284
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 282

def parent
  @parent
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



289
290
291
292
293
294
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 289

def update!(**args)
  @content = args[:content] if args.key?(:content)
  @document = args[:document] if args.key?(:document)
  @id = args[:id] if args.key?(:id)
  @parent = args[:parent] if args.key?(:parent)
end