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.



198
199
200
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 198

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)


177
178
179
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 177

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



182
183
184
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 182

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)


189
190
191
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 189

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)


196
197
198
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 196

def parent
  @parent
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



203
204
205
206
207
208
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 203

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