Package com.google.genai.types
Class File
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.File
A file uploaded to the API.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic File.Builder
builder()
Instantiates a builder for File.Output only.Optional.Output only.abstract Optional<FileStatus>
error()
Output only.Output only.static File
Deserializes a JSON string to a File object.mimeType()
Output only.name()
The `File` resource name.Output only.Output only.abstract Optional<FileSource>
source()
Output only.state()
Output only.abstract File.Builder
Creates a builder with the same values as this instance.Output only.uri()
Output only.Output only.Methods inherited from class com.google.genai.JsonSerializable
toJson
-
Constructor Details
-
File
public File()
-
-
Method Details
-
name
The `File` resource name. The ID (name excluding the "files/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456` -
displayName
Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image' -
mimeType
Output only. MIME type of the file. -
sizeBytes
Output only. Size of the file in bytes. -
createTime
Output only. The timestamp of when the `File` was created. -
expirationTime
Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire. -
updateTime
Output only. The timestamp of when the `File` was last updated. -
sha256Hash
Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format. -
uri
Output only. The URI of the `File`. -
downloadUri
Output only. The URI of the `File`, only set for downloadable (generated) files. -
state
Output only. Processing state of the File. -
source
Output only. The source of the `File`. -
videoMetadata
Output only. Metadata for a video. -
error
Output only. Error status if File processing failed. -
builder
Instantiates a builder for File. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a File object.
-