Class: Google::Apis::DeveloperknowledgeV1::DocumentChunk

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/developerknowledge_v1/classes.rb,
lib/google/apis/developerknowledge_v1/representations.rb,
lib/google/apis/developerknowledge_v1/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.



141
142
143
# File 'lib/google/apis/developerknowledge_v1/classes.rb', line 141

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)


120
121
122
# File 'lib/google/apis/developerknowledge_v1/classes.rb', line 120

def content
  @content
end

#documentGoogle::Apis::DeveloperknowledgeV1::Document

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



125
126
127
# File 'lib/google/apis/developerknowledge_v1/classes.rb', line 125

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)


132
133
134
# File 'lib/google/apis/developerknowledge_v1/classes.rb', line 132

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)


139
140
141
# File 'lib/google/apis/developerknowledge_v1/classes.rb', line 139

def parent
  @parent
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



146
147
148
149
150
151
# File 'lib/google/apis/developerknowledge_v1/classes.rb', line 146

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