Shared drives and the about resource (user, quota, upload limit and the export/import formats this account supports).

To work inside a shared drive, list its files with ::google::drive::files/list-files({driveId: drive.id}); every files call already sends supportsAllDrives=true.

Scopes. drive.readonly for listing; about works with any Drive scope.

Values

ABOUT_FIELDS

ABOUT_FIELDS: Str "user(displayName,emailAddress,permissionId),storageQuota,maxUploadSize,exportFormats,importFormats,canCreateDrives"

Functions

about

fn (): Map
fn (fields: Str): Map
fn (opts: Map): Map

GET /about - the user, storage quota, maxUploadSize, and the exportFormats / importFormats maps. Drive requires fields; the default is ABOUT_FIELDS. A Str argument is a fields value; a Map is opts.

Example

info ::google::drive::drives/about()
info.user.emailAddress
info.storageQuota.usage

// Only the fields you need
::google::drive::drives/about("maxUploadSize")

export-formats

fn (): Map
fn (opts: Map): Map

The account's live export map from about: {google-mime: [export-mime, ...]}. Use it to check ::google::drive::content/EXPORT_FORMATS against what Drive offers.

Example

formats ::google::drive::drives/export-formats()
get(formats, "application/vnd.google-apps.document")

get-drive

fn (drive-id: Str): Map
fn (drive-id: Str, opts: Map): Map

GET /drives/{id} - one shared drive. Options: useDomainAdminAccess, fields, credentials.

Example

drive ::google::drive::drives/get-drive("0ABCdrive")
drive.name

list-all-drives

fn (): Vec
fn (opts: Map): Vec

Every shared drive the user can see (follows nextPageToken).

Example

drives ::google::drive::drives/list-all-drives()
map(drives, %.id)

list-drives

fn (): Map
fn (opts: Map): Map

GET /drives - one page of the user's shared drives ({drives, nextPageToken?}). Options: q (e.g. "name contains 'Eng'"), pageSize (max 100), pageToken, useDomainAdminAccess (admins: every drive in the domain), fields, credentials.

Example

page ::google::drive::drives/list-drives({q: "name contains 'Eng'", pageSize: 50})
map(page.drives, %.name)