REST Resource: files

Resource: File

A file uploaded to the API.

JSON representation
{
  "name": string,
  "displayName": string,
  "mimeType": string,
  "sizeBytes": string,
  "createTime": string,
  "updateTime": string,
  "expirationTime": string,
  "sha256Hash": string,
  "uri": string,
  "state": enum (State),
  "error": {
    object (Status)
  },

  // Union field metadata can be only one of the following:
  "videoMetadata": {
    object (VideoMetadata)
  }
  // End of list of possible types for union field metadata.
}
Fields
name

string

Immutable. Identifier. 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

string

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

string

Output only. MIME type of the file.

sizeBytes

string (int64 format)

Output only. Size of the file in bytes.

createTime

string (Timestamp format)

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

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

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

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

expirationTime

string (Timestamp format)

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

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

sha256Hash

string (bytes format)

Output only. SHA-256 hash of the uploaded bytes.

A base64-encoded string.

uri

string

Output only. The uri of the File.

state

enum (State)

Output only. Processing state of the File.

error

object (Status)

Output only. Error status if File processing failed.

Union field metadata. Metadata for the File. metadata can be only one of the following:
videoMetadata

object (VideoMetadata)

Output only. Metadata for a video.

VideoMetadata

Metadata for a video File.

JSON representation
{
  "videoDuration": string
}
Fields
videoDuration

string (Duration format)

Duration of the video.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

State

States for the lifecycle of a File.

Enums
STATE_UNSPECIFIED The default value. This value is used if the state is omitted.
PROCESSING File is being processed and cannot be used for inference yet.
ACTIVE File is processed and available for inference.
FAILED File failed processing.

Methods

delete

Deletes the File.

get

Gets the metadata for the given File.

list

Lists the metadata for Files owned by the requesting project.