The Drive API requires extra information in order to look for
files on a Team Drive. drive_find() and drive_get() accept this extra
information via team_drive and/or corpora. Regard these two functions
as the official "port of entry" for Team Drive files and folders. Use them
to capture your target(s) in a dribble to pass along to other
googledrive functions. The general flexibility to refer to files by name,
path, or id does not apply to Team Drive files. While it's always a good
idea to get things into a dribble early, for files on a Team Drive,
it's a requirement.
team_drive and/or corpora are pre-processed by drive_corpus() to obtain
query parameters.
Note:
Team Drives
are only available to users of certain enhanced Google services, such as G
Suite Enterprise, G Suite Business, or G Suite for Education.
If you want to search one specific Team Drive, pass its name,
id, or dribble to team_drive somewhere in the call, like so:
drive_find(..., team_drive = "i-am-a-teamdrive-name")
drive_find(..., team_drive = as_id("i-am-a-teamdrive-id"))
drive_find(..., team_drive = teamdrive_dribble)
The value of team_drive is pre-processed with as_teamdrive().
To search other collections, pass the corpora parameter somewhere in the
call, like so:
drive_find(..., corpora = "user,allTeamDrives")
Possible values of corpora and what they mean:
"user": Queries files that the user has accessed, including both Team
and non-Team Drive files.
"user,allTeamDrives": Queries files that the user has accessed and all
Team Drives in which they are a member. Note that both "user" and
"teamDrive" are preferable to "allTeamDrives", in terms of efficiency.
"domain": Queries files that are shared to the domain, including both
Team Drive and non-Team Drive files.
"teamDrive": Queries all items in one specific Team Drive.
teamDriveId must be also specified elsewhere in the request. The
googledrive workflow in this case is to use the team_drive argument as
described above and allow googledrive to infer the need to send
corpora = "teamDrive".