public final class Document extends GeneratedMessageV3 implements DocumentOrBuilder
A knowledge document to be used by a [KnowledgeBase][google.cloud.dialogflow.v2.KnowledgeBase]. For more information, see the [knowledge base guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases). Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.Protobuf type
google.cloud.dialogflow.v2.Document
Modifier and Type | Class and Description |
---|---|
static class |
Document.Builder
A knowledge document to be used by a [KnowledgeBase][google.cloud.dialogflow.v2.KnowledgeBase].
|
static class |
Document.KnowledgeType
The knowledge type of document content.
|
static class |
Document.ReloadStatus
The status of a reload attempt.
|
static interface |
Document.ReloadStatusOrBuilder |
static class |
Document.SourceCase |
static class |
Document.State
Possible states of the document
|
GeneratedMessageV3.BuilderParent, GeneratedMessageV3.ExtendableBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage,BuilderType extends GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageV3.ExtendableMessage<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.FieldAccessorTable, GeneratedMessageV3.UnusedPrivateParameter
AbstractMessageLite.InternalOneOfEnum
Modifier and Type | Field and Description |
---|---|
static int |
CONTENT_URI_FIELD_NUMBER |
static int |
DISPLAY_NAME_FIELD_NUMBER |
static int |
ENABLE_AUTO_RELOAD_FIELD_NUMBER |
static int |
KNOWLEDGE_TYPES_FIELD_NUMBER |
static int |
LATEST_RELOAD_STATUS_FIELD_NUMBER |
static int |
METADATA_FIELD_NUMBER |
static int |
MIME_TYPE_FIELD_NUMBER |
static int |
NAME_FIELD_NUMBER |
static int |
RAW_CONTENT_FIELD_NUMBER |
static int |
STATE_FIELD_NUMBER |
alwaysUseFieldBuilders, unknownFields
memoizedSize
memoizedHashCode
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof
toByteArray, toByteString, writeDelimitedTo, writeTo
public static final int NAME_FIELD_NUMBER
public static final int DISPLAY_NAME_FIELD_NUMBER
public static final int MIME_TYPE_FIELD_NUMBER
public static final int KNOWLEDGE_TYPES_FIELD_NUMBER
public static final int CONTENT_URI_FIELD_NUMBER
public static final int RAW_CONTENT_FIELD_NUMBER
public static final int ENABLE_AUTO_RELOAD_FIELD_NUMBER
public static final int LATEST_RELOAD_STATUS_FIELD_NUMBER
public static final int METADATA_FIELD_NUMBER
public static final int STATE_FIELD_NUMBER
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance
in class GeneratedMessageV3
public final UnknownFieldSet getUnknownFields()
getUnknownFields
in interface MessageOrBuilder
getUnknownFields
in class GeneratedMessageV3
public static final Descriptors.Descriptor getDescriptor()
protected MapField internalGetMapField(int number)
internalGetMapField
in class GeneratedMessageV3
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3
public Document.SourceCase getSourceCase()
getSourceCase
in interface DocumentOrBuilder
public String getName()
Optional. The document resource name. The name must be empty when creating a document. Format: `projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
string name = 1 [(.google.api.field_behavior) = OPTIONAL];
getName
in interface DocumentOrBuilder
public ByteString getNameBytes()
Optional. The document resource name. The name must be empty when creating a document. Format: `projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
string name = 1 [(.google.api.field_behavior) = OPTIONAL];
getNameBytes
in interface DocumentOrBuilder
public String getDisplayName()
Required. The display name of the document. The name must be 1024 bytes or less; otherwise, the creation request fails.
string display_name = 2 [(.google.api.field_behavior) = REQUIRED];
getDisplayName
in interface DocumentOrBuilder
public ByteString getDisplayNameBytes()
Required. The display name of the document. The name must be 1024 bytes or less; otherwise, the creation request fails.
string display_name = 2 [(.google.api.field_behavior) = REQUIRED];
getDisplayNameBytes
in interface DocumentOrBuilder
public String getMimeType()
Required. The MIME type of this document.
string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];
getMimeType
in interface DocumentOrBuilder
public ByteString getMimeTypeBytes()
Required. The MIME type of this document.
string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];
getMimeTypeBytes
in interface DocumentOrBuilder
public List<Document.KnowledgeType> getKnowledgeTypesList()
Required. The knowledge type of document content.
repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
getKnowledgeTypesList
in interface DocumentOrBuilder
public int getKnowledgeTypesCount()
Required. The knowledge type of document content.
repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
getKnowledgeTypesCount
in interface DocumentOrBuilder
public Document.KnowledgeType getKnowledgeTypes(int index)
Required. The knowledge type of document content.
repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
getKnowledgeTypes
in interface DocumentOrBuilder
index
- The index of the element to return.public List<Integer> getKnowledgeTypesValueList()
Required. The knowledge type of document content.
repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
getKnowledgeTypesValueList
in interface DocumentOrBuilder
public int getKnowledgeTypesValue(int index)
Required. The knowledge type of document content.
repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
getKnowledgeTypesValue
in interface DocumentOrBuilder
index
- The index of the value to return.public boolean hasContentUri()
The URI where the file content is located. For documents stored in Google Cloud Storage, these URIs must have the form `gs://<bucket-name>/<object-name>`. NOTE: External URLs must correspond to public webpages, i.e., they must be indexed by Google Search. In particular, URLs for showing documents in Google Cloud Storage (i.e. the URL in your browser) are not supported. Instead use the `gs://` format URI described above.
string content_uri = 5;
hasContentUri
in interface DocumentOrBuilder
public String getContentUri()
The URI where the file content is located. For documents stored in Google Cloud Storage, these URIs must have the form `gs://<bucket-name>/<object-name>`. NOTE: External URLs must correspond to public webpages, i.e., they must be indexed by Google Search. In particular, URLs for showing documents in Google Cloud Storage (i.e. the URL in your browser) are not supported. Instead use the `gs://` format URI described above.
string content_uri = 5;
getContentUri
in interface DocumentOrBuilder
public ByteString getContentUriBytes()
The URI where the file content is located. For documents stored in Google Cloud Storage, these URIs must have the form `gs://<bucket-name>/<object-name>`. NOTE: External URLs must correspond to public webpages, i.e., they must be indexed by Google Search. In particular, URLs for showing documents in Google Cloud Storage (i.e. the URL in your browser) are not supported. Instead use the `gs://` format URI described above.
string content_uri = 5;
getContentUriBytes
in interface DocumentOrBuilder
public boolean hasRawContent()
The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types.
bytes raw_content = 9;
hasRawContent
in interface DocumentOrBuilder
public ByteString getRawContent()
The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types.
bytes raw_content = 9;
getRawContent
in interface DocumentOrBuilder
public boolean getEnableAutoReload()
Optional. If true, we try to automatically reload the document every day (at a time picked by the system). If false or unspecified, we don't try to automatically reload the document. Currently you can only enable automatic reload for documents sourced from a public url, see `source` field for the source types. Reload status can be tracked in `latest_reload_status`. If a reload fails, we will keep the document unchanged. If a reload fails with internal errors, the system will try to reload the document on the next day. If a reload fails with non-retriable errors (e.g. PERMISION_DENIED), the system will not try to reload the document anymore. You need to manually reload the document successfully by calling `ReloadDocument` and clear the errors.
bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL];
getEnableAutoReload
in interface DocumentOrBuilder
public boolean hasLatestReloadStatus()
Output only. The time and status of the latest reload. This reload may have been triggered automatically or manually and may not have succeeded.
.google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
hasLatestReloadStatus
in interface DocumentOrBuilder
public Document.ReloadStatus getLatestReloadStatus()
Output only. The time and status of the latest reload. This reload may have been triggered automatically or manually and may not have succeeded.
.google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
getLatestReloadStatus
in interface DocumentOrBuilder
public Document.ReloadStatusOrBuilder getLatestReloadStatusOrBuilder()
Output only. The time and status of the latest reload. This reload may have been triggered automatically or manually and may not have succeeded.
.google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
getLatestReloadStatusOrBuilder
in interface DocumentOrBuilder
public int getMetadataCount()
DocumentOrBuilder
Optional. Metadata for the document. The metadata supports arbitrary key-value pairs. Suggested use cases include storing a document's title, an external URL distinct from the document's content_uri, etc. The max size of a `key` or a `value` of the metadata is 1024 bytes.
map<string, string> metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
getMetadataCount
in interface DocumentOrBuilder
public boolean containsMetadata(String key)
Optional. Metadata for the document. The metadata supports arbitrary key-value pairs. Suggested use cases include storing a document's title, an external URL distinct from the document's content_uri, etc. The max size of a `key` or a `value` of the metadata is 1024 bytes.
map<string, string> metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
containsMetadata
in interface DocumentOrBuilder
@Deprecated public Map<String,String> getMetadata()
getMetadataMap()
instead.getMetadata
in interface DocumentOrBuilder
public Map<String,String> getMetadataMap()
Optional. Metadata for the document. The metadata supports arbitrary key-value pairs. Suggested use cases include storing a document's title, an external URL distinct from the document's content_uri, etc. The max size of a `key` or a `value` of the metadata is 1024 bytes.
map<string, string> metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
getMetadataMap
in interface DocumentOrBuilder
public String getMetadataOrDefault(String key, String defaultValue)
Optional. Metadata for the document. The metadata supports arbitrary key-value pairs. Suggested use cases include storing a document's title, an external URL distinct from the document's content_uri, etc. The max size of a `key` or a `value` of the metadata is 1024 bytes.
map<string, string> metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
getMetadataOrDefault
in interface DocumentOrBuilder
public String getMetadataOrThrow(String key)
Optional. Metadata for the document. The metadata supports arbitrary key-value pairs. Suggested use cases include storing a document's title, an external URL distinct from the document's content_uri, etc. The max size of a `key` or a `value` of the metadata is 1024 bytes.
map<string, string> metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
getMetadataOrThrow
in interface DocumentOrBuilder
public int getStateValue()
Output only. The current state of the document.
.google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
getStateValue
in interface DocumentOrBuilder
public Document.State getState()
Output only. The current state of the document.
.google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
getState
in interface DocumentOrBuilder
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3
public void writeTo(CodedOutputStream output) throws IOException
writeTo
in interface MessageLite
writeTo
in class GeneratedMessageV3
IOException
public int getSerializedSize()
getSerializedSize
in interface MessageLite
getSerializedSize
in class GeneratedMessageV3
public boolean equals(Object obj)
equals
in interface Message
equals
in class AbstractMessage
public int hashCode()
hashCode
in interface Message
hashCode
in class AbstractMessage
public static Document parseFrom(ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Document parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Document parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Document parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Document parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Document parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Document parseFrom(InputStream input) throws IOException
IOException
public static Document parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static Document parseDelimitedFrom(InputStream input) throws IOException
IOException
public static Document parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static Document parseFrom(CodedInputStream input) throws IOException
IOException
public static Document parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public Document.Builder newBuilderForType()
newBuilderForType
in interface Message
newBuilderForType
in interface MessageLite
public static Document.Builder newBuilder()
public static Document.Builder newBuilder(Document prototype)
public Document.Builder toBuilder()
toBuilder
in interface Message
toBuilder
in interface MessageLite
protected Document.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType
in class GeneratedMessageV3
public static Document getDefaultInstance()
public Parser<Document> getParserForType()
getParserForType
in interface Message
getParserForType
in interface MessageLite
getParserForType
in class GeneratedMessageV3
public Document getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
Copyright © 2022 Google LLC. All rights reserved.