File

@Serializable
data class File(val name: String? = null, val displayName: String? = null, val mimeType: String? = null, val sizeBytes: Long? = null, val createTime: Instant? = null, val expirationTime: Instant? = null, val updateTime: Instant? = null, val sha256Hash: String? = null, val uri: String? = null, val downloadUri: String? = null, val state: FileState? = null, val source: FileSource? = null, val videoMetadata: Map<String, JsonElement>? = null, val error: FileStatus? = null)

A file uploaded to the API.

Constructors

Link copied to clipboard
constructor(name: String? = null, displayName: String? = null, mimeType: String? = null, sizeBytes: Long? = null, createTime: Instant? = null, expirationTime: Instant? = null, updateTime: Instant? = null, sha256Hash: String? = null, uri: String? = null, downloadUri: String? = null, state: FileState? = null, source: FileSource? = null, videoMetadata: Map<String, JsonElement>? = null, error: FileStatus? = null)

Properties

Link copied to clipboard
@Serializable(with = InstantSerializer::class)
val createTime: Instant? = null

Output only. The timestamp of when the File was created.

Link copied to clipboard
val displayName: String? = null

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'

Link copied to clipboard
val downloadUri: String? = null

Output only. The URI of the File, only set for downloadable (generated) files.

Link copied to clipboard
val error: FileStatus? = null

Output only. Error status if File processing failed.

Link copied to clipboard
@Serializable(with = InstantSerializer::class)
val expirationTime: Instant? = null

Output only. The timestamp of when the File will be deleted. Only set if the File is scheduled to expire.

Link copied to clipboard
val mimeType: String? = null

Output only. MIME type of the file.

Link copied to clipboard
val name: String? = null

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

Link copied to clipboard
val sha256Hash: String? = null

Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.

Link copied to clipboard
val sizeBytes: Long? = null

Output only. Size of the file in bytes.

Link copied to clipboard
val source: FileSource? = null

Output only. The source of the File.

Link copied to clipboard
val state: FileState? = null

Output only. Processing state of the File.

Link copied to clipboard
@Serializable(with = InstantSerializer::class)
val updateTime: Instant? = null

Output only. The timestamp of when the File was last updated.

Link copied to clipboard
val uri: String? = null

Output only. The URI of the File.

Link copied to clipboard
val videoMetadata: Map<String, JsonElement>? = null

Output only. Metadata for a video.