Class FileMetadata (0.66.0)

public final class FileMetadata extends GeneratedMessageV3 implements FileMetadataOrBuilder

Represents a file attached to a session (context file)

Protobuf type google.cloud.discoveryengine.v1alpha.FileMetadata

Static Fields

BYTE_SIZE_FIELD_NUMBER

public static final int BYTE_SIZE_FIELD_NUMBER
Field Value
Type Description
int

DOWNLOAD_URI_FIELD_NUMBER

public static final int DOWNLOAD_URI_FIELD_NUMBER
Field Value
Type Description
int

FILE_ID_FIELD_NUMBER

public static final int FILE_ID_FIELD_NUMBER
Field Value
Type Description
int

FILE_ORIGIN_TYPE_FIELD_NUMBER

public static final int FILE_ORIGIN_TYPE_FIELD_NUMBER
Field Value
Type Description
int

LAST_ADD_TIME_FIELD_NUMBER

public static final int LAST_ADD_TIME_FIELD_NUMBER
Field Value
Type Description
int

METADATA_FIELD_NUMBER

public static final int METADATA_FIELD_NUMBER
Field Value
Type Description
int

MIME_TYPE_FIELD_NUMBER

public static final int MIME_TYPE_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

ORIGINAL_SOURCE_TYPE_FIELD_NUMBER

public static final int ORIGINAL_SOURCE_TYPE_FIELD_NUMBER
Field Value
Type Description
int

ORIGINAL_URI_FIELD_NUMBER

public static final int ORIGINAL_URI_FIELD_NUMBER
Field Value
Type Description
int

UPLOAD_TIME_FIELD_NUMBER

public static final int UPLOAD_TIME_FIELD_NUMBER
Field Value
Type Description
int

VIEWS_FIELD_NUMBER

public static final int VIEWS_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static FileMetadata getDefaultInstance()
Returns
Type Description
FileMetadata

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static FileMetadata.Builder newBuilder()
Returns
Type Description
FileMetadata.Builder

newBuilder(FileMetadata prototype)

public static FileMetadata.Builder newBuilder(FileMetadata prototype)
Parameter
Name Description
prototype FileMetadata
Returns
Type Description
FileMetadata.Builder

parseDelimitedFrom(InputStream input)

public static FileMetadata parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
FileMetadata
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static FileMetadata parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FileMetadata
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static FileMetadata parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
FileMetadata
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static FileMetadata parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FileMetadata
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static FileMetadata parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
FileMetadata
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static FileMetadata parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FileMetadata
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static FileMetadata parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
FileMetadata
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static FileMetadata parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FileMetadata
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static FileMetadata parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
FileMetadata
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static FileMetadata parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FileMetadata
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static FileMetadata parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
FileMetadata
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static FileMetadata parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FileMetadata
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<FileMetadata> parser()
Returns
Type Description
Parser<FileMetadata>

Methods

containsMetadata(String key)

public boolean containsMetadata(String key)

Optional. Represents metadata related to the file that can suit particular use cases. The prefix "google." is reserved for the key for use by Google, but other prefixes can be freely used.

map<string, string> metadata = 18 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
boolean

containsViews(String key)

public boolean containsViews(String key)

Output only. Alternate views of this file object. Each file view is attached to a specific role. Possible example keys:

  • "thumbnail"
  • "mobile_thumbnail"
  • "clip"
  • "summary"
  • "translation"

map<string, .google.cloud.discoveryengine.v1alpha.FileView> views = 22 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getByteSize()

public long getByteSize()

Output only. The size of the context file in bytes.

int64 byte_size = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
long

The byteSize.

getDefaultInstanceForType()

public FileMetadata getDefaultInstanceForType()
Returns
Type Description
FileMetadata

getDownloadUri()

public String getDownloadUri()

Output only. The AssistantService.DownloadSessionFile URL to download the file. This URL will need the same credentials as AssistantService.ListSessionFileMetadata method and will provide the resource.

string download_uri = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The downloadUri.

getDownloadUriBytes()

public ByteString getDownloadUriBytes()

Output only. The AssistantService.DownloadSessionFile URL to download the file. This URL will need the same credentials as AssistantService.ListSessionFileMetadata method and will provide the resource.

string download_uri = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for downloadUri.

getFileId()

public String getFileId()

Output only. The ID of the file.

string file_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The fileId.

getFileIdBytes()

public ByteString getFileIdBytes()

Output only. The ID of the file.

string file_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for fileId.

getFileOriginType()

public FileOriginType getFileOriginType()

Optional. The origin of the file.

.google.cloud.discoveryengine.v1alpha.FileOriginType file_origin_type = 21 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
FileOriginType

The fileOriginType.

getFileOriginTypeValue()

public int getFileOriginTypeValue()

Optional. The origin of the file.

.google.cloud.discoveryengine.v1alpha.FileOriginType file_origin_type = 21 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The enum numeric value on the wire for fileOriginType.

getLastAddTime()

public Timestamp getLastAddTime()

Output only. The time the file was added to the session. Note that if a file was added, then modified externally, then added again, the add time will be updated.

.google.protobuf.Timestamp last_add_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The lastAddTime.

getLastAddTimeOrBuilder()

public TimestampOrBuilder getLastAddTimeOrBuilder()

Output only. The time the file was added to the session. Note that if a file was added, then modified externally, then added again, the add time will be updated.

.google.protobuf.Timestamp last_add_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getMetadata() (deprecated)

public Map<String,String> getMetadata()

Use #getMetadataMap() instead.

Returns
Type Description
Map<String,String>

getMetadataCount()

public int getMetadataCount()

Optional. Represents metadata related to the file that can suit particular use cases. The prefix "google." is reserved for the key for use by Google, but other prefixes can be freely used.

map<string, string> metadata = 18 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getMetadataMap()

public Map<String,String> getMetadataMap()

Optional. Represents metadata related to the file that can suit particular use cases. The prefix "google." is reserved for the key for use by Google, but other prefixes can be freely used.

map<string, string> metadata = 18 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Map<String,String>

getMetadataOrDefault(String key, String defaultValue)

public String getMetadataOrDefault(String key, String defaultValue)

Optional. Represents metadata related to the file that can suit particular use cases. The prefix "google." is reserved for the key for use by Google, but other prefixes can be freely used.

map<string, string> metadata = 18 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getMetadataOrThrow(String key)

public String getMetadataOrThrow(String key)

Optional. Represents metadata related to the file that can suit particular use cases. The prefix "google." is reserved for the key for use by Google, but other prefixes can be freely used.

map<string, string> metadata = 18 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
String

getMimeType()

public String getMimeType()

The content type of the file, see https://www.iana.org/assignments/media-types/media-types.xhtml.

string mime_type = 3;

Returns
Type Description
String

The mimeType.

getMimeTypeBytes()

public ByteString getMimeTypeBytes()

The content type of the file, see https://www.iana.org/assignments/media-types/media-types.xhtml.

string mime_type = 3;

Returns
Type Description
ByteString

The bytes for mimeType.

getName()

public String getName()

Output only. The name of the file uploaded.

string name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Output only. The name of the file uploaded.

string name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for name.

getOriginalSourceType()

public FileSource getOriginalSourceType()

Optional. The type of the original source of the file.

.google.cloud.discoveryengine.v1alpha.FileSource original_source_type = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
FileSource

The originalSourceType.

getOriginalSourceTypeValue()

public int getOriginalSourceTypeValue()

Optional. The type of the original source of the file.

.google.cloud.discoveryengine.v1alpha.FileSource original_source_type = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The enum numeric value on the wire for originalSourceType.

getOriginalUri()

public String getOriginalUri()

Optional. The original location of the file. It may be a local file path, or any other URI that allows accessing the file in an external system. There are two scenarios in which this url may be empty:

  1. If the file was sent as inline data (e.g. pasted from the clipboard).
  2. If the original location is not available.

    Note that there's no guarantee that the URI will be pointing to a valid or actually existing file. For example, a file might have been uploaded to the session, and then deleted from the original source.

string original_uri = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The originalUri.

getOriginalUriBytes()

public ByteString getOriginalUriBytes()

Optional. The original location of the file. It may be a local file path, or any other URI that allows accessing the file in an external system. There are two scenarios in which this url may be empty:

  1. If the file was sent as inline data (e.g. pasted from the clipboard).
  2. If the original location is not available.

    Note that there's no guarantee that the URI will be pointing to a valid or actually existing file. For example, a file might have been uploaded to the session, and then deleted from the original source.

string original_uri = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for originalUri.

getParserForType()

public Parser<FileMetadata> getParserForType()
Returns
Type Description
Parser<FileMetadata>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getUploadTime()

public Timestamp getUploadTime()

Output only. The time the file was uploaded (If this is a file generated by an internal process and then made available to the session, this indicates the moment it happened).

.google.protobuf.Timestamp upload_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The uploadTime.

getUploadTimeOrBuilder()

public TimestampOrBuilder getUploadTimeOrBuilder()

Output only. The time the file was uploaded (If this is a file generated by an internal process and then made available to the session, this indicates the moment it happened).

.google.protobuf.Timestamp upload_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getViews() (deprecated)

public Map<String,FileView> getViews()

Use #getViewsMap() instead.

Returns
Type Description
Map<String,FileView>

getViewsCount()

public int getViewsCount()

Output only. Alternate views of this file object. Each file view is attached to a specific role. Possible example keys:

  • "thumbnail"
  • "mobile_thumbnail"
  • "clip"
  • "summary"
  • "translation"

map<string, .google.cloud.discoveryengine.v1alpha.FileView> views = 22 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

getViewsMap()

public Map<String,FileView> getViewsMap()

Output only. Alternate views of this file object. Each file view is attached to a specific role. Possible example keys:

  • "thumbnail"
  • "mobile_thumbnail"
  • "clip"
  • "summary"
  • "translation"

map<string, .google.cloud.discoveryengine.v1alpha.FileView> views = 22 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Map<String,FileView>

getViewsOrDefault(String key, FileView defaultValue)

public FileView getViewsOrDefault(String key, FileView defaultValue)

Output only. Alternate views of this file object. Each file view is attached to a specific role. Possible example keys:

  • "thumbnail"
  • "mobile_thumbnail"
  • "clip"
  • "summary"
  • "translation"

map<string, .google.cloud.discoveryengine.v1alpha.FileView> views = 22 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
key String
defaultValue FileView
Returns
Type Description
FileView

getViewsOrThrow(String key)

public FileView getViewsOrThrow(String key)

Output only. Alternate views of this file object. Each file view is attached to a specific role. Possible example keys:

  • "thumbnail"
  • "mobile_thumbnail"
  • "clip"
  • "summary"
  • "translation"

map<string, .google.cloud.discoveryengine.v1alpha.FileView> views = 22 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
key String
Returns
Type Description
FileView

hasLastAddTime()

public boolean hasLastAddTime()

Output only. The time the file was added to the session. Note that if a file was added, then modified externally, then added again, the add time will be updated.

.google.protobuf.Timestamp last_add_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the lastAddTime field is set.

hasUploadTime()

public boolean hasUploadTime()

Output only. The time the file was uploaded (If this is a file generated by an internal process and then made available to the session, this indicates the moment it happened).

.google.protobuf.Timestamp upload_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the uploadTime field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public FileMetadata.Builder newBuilderForType()
Returns
Type Description
FileMetadata.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected FileMetadata.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
FileMetadata.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public FileMetadata.Builder toBuilder()
Returns
Type Description
FileMetadata.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException