Package com.google.cloud.dialogflow.v2
Class Document
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.dialogflow.v2.Document
- All Implemented Interfaces:
DocumentOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Serializable
@Generated
public final class Document
extends com.google.protobuf.GeneratedMessage
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- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA knowledge document to be used by a [KnowledgeBase][google.cloud.dialogflow.v2.KnowledgeBase].static enumThe knowledge type of document content.static final classThe status of a reload attempt.static interfacestatic enumstatic enumPossible states of the documentNested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message, T extends Object>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage
com.google.protobuf.AbstractMessage.BuilderParentNested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, loggedPre22TypeNames, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsMetadata(String key) Optional.booleanThe URI where the file content is located.com.google.protobuf.ByteStringThe URI where the file content is located.static Documentstatic final com.google.protobuf.Descriptors.DescriptorRequired.com.google.protobuf.ByteStringRequired.booleanOptional.getKnowledgeTypes(int index) Required.intRequired.Required.intgetKnowledgeTypesValue(int index) Required.Required.Output only.Output only.Deprecated.intOptional.Optional.getMetadataOrDefault(String key, String defaultValue) Optional.getMetadataOrThrow(String key) Optional.Required.com.google.protobuf.ByteStringRequired.getName()Optional.com.google.protobuf.ByteStringOptional.com.google.protobuf.Parser<Document>com.google.protobuf.ByteStringThe raw content of the document.intgetState()Output only.intOutput only.booleanThe URI where the file content is located.inthashCode()booleanOutput only.booleanThe raw content of the document.protected com.google.protobuf.GeneratedMessage.FieldAccessorTableprotected com.google.protobuf.MapFieldReflectionAccessorinternalGetMapFieldReflection(int number) final booleanstatic Document.Builderstatic Document.BuildernewBuilder(Document prototype) protected Document.BuildernewBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) static DocumentparseDelimitedFrom(InputStream input) static DocumentparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static DocumentparseFrom(byte[] data) static DocumentparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static DocumentparseFrom(com.google.protobuf.ByteString data) static DocumentparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static DocumentparseFrom(com.google.protobuf.CodedInputStream input) static DocumentparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static DocumentparseFrom(InputStream input) static DocumentparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static DocumentparseFrom(ByteBuffer data) static DocumentparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<Document>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessage
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER- See Also:
-
DISPLAY_NAME_FIELD_NUMBER
public static final int DISPLAY_NAME_FIELD_NUMBER- See Also:
-
MIME_TYPE_FIELD_NUMBER
public static final int MIME_TYPE_FIELD_NUMBER- See Also:
-
KNOWLEDGE_TYPES_FIELD_NUMBER
public static final int KNOWLEDGE_TYPES_FIELD_NUMBER- See Also:
-
CONTENT_URI_FIELD_NUMBER
public static final int CONTENT_URI_FIELD_NUMBER- See Also:
-
RAW_CONTENT_FIELD_NUMBER
public static final int RAW_CONTENT_FIELD_NUMBER- See Also:
-
ENABLE_AUTO_RELOAD_FIELD_NUMBER
public static final int ENABLE_AUTO_RELOAD_FIELD_NUMBER- See Also:
-
LATEST_RELOAD_STATUS_FIELD_NUMBER
public static final int LATEST_RELOAD_STATUS_FIELD_NUMBER- See Also:
-
METADATA_FIELD_NUMBER
public static final int METADATA_FIELD_NUMBER- See Also:
-
STATE_FIELD_NUMBER
public static final int STATE_FIELD_NUMBER- See Also:
-
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetMapFieldReflection
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) - Overrides:
internalGetMapFieldReflectionin classcom.google.protobuf.GeneratedMessage
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage
-
getSourceCase
- Specified by:
getSourceCasein interfaceDocumentOrBuilder
-
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];- Specified by:
getNamein interfaceDocumentOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.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];- Specified by:
getNameBytesin interfaceDocumentOrBuilder- Returns:
- The bytes for name.
-
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];- Specified by:
getDisplayNamein interfaceDocumentOrBuilder- Returns:
- The displayName.
-
getDisplayNameBytes
public com.google.protobuf.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];- Specified by:
getDisplayNameBytesin interfaceDocumentOrBuilder- Returns:
- The bytes for displayName.
-
getMimeType
Required. The MIME type of this document.
string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getMimeTypein interfaceDocumentOrBuilder- Returns:
- The mimeType.
-
getMimeTypeBytes
public com.google.protobuf.ByteString getMimeTypeBytes()Required. The MIME type of this document.
string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getMimeTypeBytesin interfaceDocumentOrBuilder- Returns:
- The bytes for mimeType.
-
getKnowledgeTypesList
Required. The knowledge type of document content.
repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getKnowledgeTypesListin interfaceDocumentOrBuilder- Returns:
- A list containing the knowledgeTypes.
-
getKnowledgeTypesCount
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];- Specified by:
getKnowledgeTypesCountin interfaceDocumentOrBuilder- Returns:
- The count of knowledgeTypes.
-
getKnowledgeTypes
Required. The knowledge type of document content.
repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getKnowledgeTypesin interfaceDocumentOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The knowledgeTypes at the given index.
-
getKnowledgeTypesValueList
Required. The knowledge type of document content.
repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getKnowledgeTypesValueListin interfaceDocumentOrBuilder- Returns:
- A list containing the enum numeric values on the wire for knowledgeTypes.
-
getKnowledgeTypesValue
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];- Specified by:
getKnowledgeTypesValuein interfaceDocumentOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The enum numeric value on the wire of knowledgeTypes at the given index.
-
hasContentUri
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;- Specified by:
hasContentUriin interfaceDocumentOrBuilder- Returns:
- Whether the contentUri field is set.
-
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;- Specified by:
getContentUriin interfaceDocumentOrBuilder- Returns:
- The contentUri.
-
getContentUriBytes
public com.google.protobuf.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;- Specified by:
getContentUriBytesin interfaceDocumentOrBuilder- Returns:
- The bytes for contentUri.
-
hasRawContent
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;- Specified by:
hasRawContentin interfaceDocumentOrBuilder- Returns:
- Whether the rawContent field is set.
-
getRawContent
public com.google.protobuf.ByteString getRawContent()The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types.
bytes raw_content = 9;- Specified by:
getRawContentin interfaceDocumentOrBuilder- Returns:
- The rawContent.
-
getEnableAutoReload
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. PERMISSION_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];- Specified by:
getEnableAutoReloadin interfaceDocumentOrBuilder- Returns:
- The enableAutoReload.
-
hasLatestReloadStatus
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];- Specified by:
hasLatestReloadStatusin interfaceDocumentOrBuilder- Returns:
- Whether the latestReloadStatus field is set.
-
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];- Specified by:
getLatestReloadStatusin interfaceDocumentOrBuilder- Returns:
- The latestReloadStatus.
-
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];- Specified by:
getLatestReloadStatusOrBuilderin interfaceDocumentOrBuilder
-
getMetadataCount
public int getMetadataCount()Description copied from interface:DocumentOrBuilderOptional. 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];- Specified by:
getMetadataCountin interfaceDocumentOrBuilder
-
containsMetadata
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];- Specified by:
containsMetadatain interfaceDocumentOrBuilder
-
getMetadata
Deprecated.UsegetMetadataMap()instead.- Specified by:
getMetadatain interfaceDocumentOrBuilder
-
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];- Specified by:
getMetadataMapin interfaceDocumentOrBuilder
-
getMetadataOrDefault
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];- Specified by:
getMetadataOrDefaultin interfaceDocumentOrBuilder
-
getMetadataOrThrow
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];- Specified by:
getMetadataOrThrowin interfaceDocumentOrBuilder
-
getStateValue
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];- Specified by:
getStateValuein interfaceDocumentOrBuilder- Returns:
- The enum numeric value on the wire for state.
-
getState
Output only. The current state of the document.
.google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getStatein interfaceDocumentOrBuilder- Returns:
- The state.
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessage- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static Document parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Document parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Document parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Document parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Document parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Document parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Document parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static Document parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Document parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected Document.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForTypein classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-