File revisions: list, get, download a blob revision, and pin one with
keep-forever. Drive may omit older revisions of busy Google Docs from
the list, and only blob revisions marked keep-forever (or recent ones)
can be downloaded; Google-native revisions are exported through the
revision's exportLinks.
Scopes. drive.readonly to read; drive (or drive.file) to update.
Values
LIST_FIELDS
LIST_FIELDS: Str "nextPageToken,revisions(id,mimeType,modifiedTime,keepForever,published,size,md5Checksum,originalFilename,lastModifyingUser(displayName,emailAddress),exportLinks)"
REVISION_FIELDS
REVISION_FIELDS: Str "id,mimeType,modifiedTime,keepForever,published,size,md5Checksum,originalFilename,lastModifyingUser(displayName,emailAddress),exportLinks"
Functions
download-revision
fn (file-id: Str, revision-id: Str): ::google::drive/FileContent
fn (file-id: Str, revision-id: Str, opts: Map): ::google::drive/FileContent
GET /files/{id}/revisions/{revisionId}?alt=media - a blob revision's
bytes as a FileContent. Options: acknowledgeAbuse, credentials.
Example
old ::google::drive::revisions/download-revision("1AbCfile", "0B7rev")
old.bytes
get-revision
fn (file-id: Str, revision-id: Str): Map
fn (file-id: Str, revision-id: Str, opts: Map): Map
GET /files/{id}/revisions/{revisionId} - revision metadata ("head" is
not accepted; use the file's headRevisionId).
Example
revision ::google::drive::revisions/get-revision("1AbCfile", "0B7rev")
revision.modifiedTime
keep-forever
fn (file-id: Str, revision-id: Str, keep: Bool): Map
fn (file-id: Str, revision-id: Str, keep: Bool, opts: Map): Map
PATCH a blob revision's keepForever flag (pinned revisions are never
purged; at most 200 per file).
Example
::google::drive::revisions/keep-forever("1AbCfile", "0B7rev", true)
list-all-revisions
fn (file-id: Str): Vec
fn (file-id: Str, opts: Map): Vec
Every revision Drive returns for a file (follows nextPageToken).
Example
revisions ::google::drive::revisions/list-all-revisions("1AbCfile")
map(revisions, %.modifiedTime)
list-revisions
fn (file-id: Str): Map
fn (file-id: Str, opts: Map): Map
GET /files/{id}/revisions - one page ({revisions, nextPageToken?}).
Options: pageSize (max 1000), pageToken, fields, credentials.
Example
page ::google::drive::revisions/list-revisions("1AbCfile", {pageSize: 100})
map(page.revisions, %.id)