REST Resource: projects.locations.repositories.files

Resource: File

Files store content that is potentially associated with Packages or Versions.

JSON representation
{
  "name": string,
  "sizeBytes": string,
  "hashes": [
    {
      object (Hash)
    }
  ],
  "createTime": string,
  "updateTime": string,
  "owner": string,
  "fetchTime": string,
  "annotations": {
    string: string,
    ...
  }
}
Fields
name

string

The name of the file, for example: projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt. If the file ID part contains slashes, they are escaped.

sizeBytes

string (int64 format)

The size of the File in bytes.

hashes[]

object (Hash)

The hashes of the file content.

createTime

string (Timestamp format)

Output only. The time 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 time 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".

owner

string

The name of the Package or Version that owns this file, if any.

fetchTime

string (Timestamp format)

Output only. The time when the last attempt to refresh the file's data was made. Only set when the repository is remote.

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

annotations

map (key: string, value: string)

Optional. Client specified annotations.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

Hash

A hash of file content.

JSON representation
{
  "type": enum (HashType),
  "value": string
}
Fields
type

enum (HashType)

The algorithm used to compute the hash value.

value

string (bytes format)

The hash value.

A base64-encoded string.

HashType

The algorithm used to compute the hash.

Enums
HASH_TYPE_UNSPECIFIED Unspecified.
SHA256 SHA256 hash.
MD5 MD5 hash.

Methods

delete

Deletes a file and all of its content.

download

Download a file.

get

Gets a file.

list

Lists files.

patch

Updates a file.

upload

Directly uploads a file to a repository.