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
}
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.

Methods

delete

Deletes the File.

get

Gets the metadata for the given File.

list

Lists the metadata for Files owned by the requesting project.