Drive
import { Drive } from "https://googleapis.deno.dev/v1/drive:v3.ts";
The Google Drive API allows clients to access resources from Google Drive.
§Methods
Gets information about the user, the user's Drive, and system
capabilities. For more information, see Return user
info.
Required: The fields
parameter must be set. To return the exact fields
you need, see Return specific
fields.
Retrieves an access proposal by ID. For more information, see Manage pending access proposals.
Required. The ID of the item the request is on.
Required. The ID of the access proposal to resolve.
List the access proposals on a file. For more information, see Manage pending access proposals. Note: Only approvers are able to list access proposals on a file. If the user isn't an approver, a 403 error is returned.
Required. The ID of the item the request is on.
Approves or denies an access proposal. For more information, see Manage pending access proposals.
Required. The ID of the item the request is on.
Required. The ID of the access proposal to resolve.
Gets a specific app. For more information, see Return user info.
The ID of the app.
Lists a user's installed apps. For more information, see Return user info.
Gets the starting pageToken for listing future changes. For more information, see Retrieve changes.
Lists the changes for a user or shared drive. For more information, see Retrieve changes.
Subscribes to changes for a user. For more information, see Notifications for resource changes.
Stops watching resources through this channel. For more information, see Notifications for resource changes.
Creates a comment on a file. For more information, see Manage comments
and
replies.
Required: The fields
parameter must be set. To return the exact fields
you need, see Return specific
fields.
The ID of the file.
Deletes a comment. For more information, see Manage comments and replies.
The ID of the comment.
The ID of the file.
Gets a comment by ID. For more information, see Manage comments and
replies.
Required: The fields
parameter must be set. To return the exact fields
you need, see Return specific
fields.
The ID of the comment.
The ID of the file.
Lists a file's comments. For more information, see Manage comments and
replies.
Required: The fields
parameter must be set. To return the exact fields
you need, see Return specific
fields.
The ID of the file.
Updates a comment with patch semantics. For more information, see Manage
comments and
replies.
Required: The fields
parameter must be set. To return the exact fields
you need, see Return specific
fields.
The ID of the comment.
The ID of the file.
Creates a shared drive. For more information, see Manage shared drives.
Permanently deletes a shared drive for which the user is an organizer
.
The shared drive cannot contain any untrashed items. For more information,
see Manage shared
drives.
The ID of the shared drive.
Gets a shared drive's metadata by ID. For more information, see Manage shared drives.
The ID of the shared drive.
Hides a shared drive from the default view. For more information, see Manage shared drives.
The ID of the shared drive.
Lists the user's shared drives. This method accepts the q
parameter,
which is a search query combining one or more search terms. For more
information, see the Search for shared
drives guide.
Restores a shared drive to the default view. For more information, see Manage shared drives.
The ID of the shared drive.
Updates the metadata for a shared drive. For more information, see Manage shared drives.
The ID of the shared drive.
Creates a copy of a file and applies any requested updates with patch semantics. For more information, see Create and manage files.
The ID of the file.
Creates a file. For more information, see Create and manage
files. This method supports an
/upload URI and accepts uploaded media with the following
characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME
types: *\/*
(Specify a valid MIME type, rather than the literal *\/*
value. The literal *\/*
is only used to indicate that any valid MIME type
can be uploaded. For more information, see Google Workspace and Google
Drive supported MIME types.) For
more information on uploading files, see Upload file
data. Apps creating shortcuts
with the create
method must specify the MIME type
application/vnd.google-apps.shortcut
. Apps should specify a file
extension in the name
property when inserting files with the API. For
example, an operation to insert a JPEG file should specify something like
"name": "cat.jpg"
in the metadata. Subsequent GET
requests include the
read-only fileExtension
property populated with the extension originally
specified in the name
property. When a Google Drive user requests to
download a file, or when the file is downloaded through the sync client,
Drive builds a full filename (with extension) based on the name. In cases
where the extension is missing, Drive attempts to determine the extension
based on the file's MIME type.
Permanently deletes a file owned by the user without moving it to the
trash. For more information, see Trash or delete files and
folders.
If the file belongs to a shared drive, the user must be an organizer
on
the parent folder. If the target is a folder, all descendants owned by the
user are also deleted.
The ID of the file.
Downloads the content of a file. For more information, see Download and export files. Operations are valid for 24 hours from the time of creation.
Required. The ID of the file to download.
Permanently deletes all of the user's trashed files. For more information, see Trash or delete files and folders.
Exports a Google Workspace document to the requested MIME type and returns exported byte content. For more information, see Download and export files. Note that the exported content is limited to 10 MB.
The ID of the file.
Generates a set of file IDs which can be provided in create or copy requests. For more information, see Create and manage files.
Gets a file's metadata or content by ID. For more information, see
Search for files and folders.
If you provide the URL parameter alt=media
, then the response includes
the file contents in the response body. Downloading content with
alt=media
only works if the file is stored in Drive. To download Google
Docs, Sheets, and Slides use
files.export
instead. For more information, see Download and export
files.
The ID of the file.
Lists the user's files. For more information, see Search for files and
folders. This method accepts the
q
parameter, which is a search query combining one or more search terms.
This method returns all files by default, including trashed files. If you
don't want trashed files to appear in the list, use the trashed=false
query parameter to remove trashed files from the results.
Lists the labels on a file. For more information, see List labels on a file.
The ID for the file.
Modifies the set of labels applied to a file. For more information, see Set a label field on a file. Returns a list of the labels that were added or modified.
The ID of the file to which the labels belong.
Updates a file's metadata, content, or both. When calling this method,
only populate fields in the request that you want to modify. When updating
fields, some fields might be changed automatically, such as modifiedDate
.
This method supports patch semantics. This method supports an /upload
URI and accepts uploaded media with the following characteristics: -
Maximum file size: 5,120 GB - Accepted Media MIME types: *\/*
(Specify a valid MIME type, rather than the literal *\/*
value. The
literal *\/*
is only used to indicate that any valid MIME type can be
uploaded. For more information, see Google Workspace and Google Drive
supported MIME types.) For more
information on uploading files, see Upload file
data.
The ID of the file.
Subscribes to changes to a file. For more information, see Notifications for resource changes.
The ID of the file.
Creates a permission for a file or shared drive. Warning: Concurrent permissions operations on the same file are not supported; only the last update is applied.
The ID of the file or shared drive.
Deletes a permission. Warning: Concurrent permissions operations on the same file are not supported; only the last update is applied.
The ID of the file or shared drive.
The ID of the permission.
Gets a permission by ID.
The ID of the file.
The ID of the permission.
Lists a file's or shared drive's permissions.
The ID of the file or shared drive.
Updates a permission with patch semantics. Warning: Concurrent permissions operations on the same file are not supported; only the last update is applied.
The ID of the file or shared drive.
The ID of the permission.
Deletes a reply.
The ID of the comment.
The ID of the file.
The ID of the reply.
Gets a reply by ID.
The ID of the comment.
The ID of the file.
The ID of the reply.
Lists a comment's replies.
The ID of the comment.
The ID of the file.
Permanently deletes a file version. You can only delete revisions for files with binary content in Google Drive, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted. For more information, see Manage file revisions.
The ID of the file.
The ID of the revision.
Gets a revision's metadata or content by ID. For more information, see Manage file revisions.
The ID of the file.
The ID of the revision.
Lists a file's revisions. For more information, see Manage file revisions.
The ID of the file.
Updates a revision with patch semantics. For more information, see Manage file revisions.
The ID of the file.
The ID of the revision.
Deprecated: Use drives.delete
instead.
The ID of the Team Drive
Deprecated: Use drives.list
instead.
Deprecated: Use drives.update
instead.
The ID of the Team Drive
§Properties
An image file and cropping parameters from which a background image for
this shared drive is set. This is a write only field; it can only be set on
drive.drives.update
requests that don't set themeId
. When specified,
all fields of the backgroundImageFile
must be set.
Output only. A short-lived link to this shared drive's background image.
Output only. Capabilities the current user has on this shared drive.
The color of this shared drive as an RGB hex string. It can only be set on
a drive.drives.update
request that does not set themeId
.
Output only. The ID of this shared drive which is also the ID of the top level folder of this shared drive.
Output only. Identifies what kind of resource this is. Value: the fixed
string "drive#drive"
.
Output only. The organizational unit of this shared drive. This field is
only populated on drives.list
responses when the useDomainAdminAccess
parameter is set to true
.
A set of restrictions that apply to this shared drive or items inside this
shared drive. Note that restrictions can't be set when creating a shared
drive. To add a restriction, first create a shared drive and then use
drives.update
to add restrictions.
The ID of the theme from which the background image and color will be set.
The set of possible driveThemes
can be retrieved from a drive.about.get
response. When not specified on a drive.drives.create
request, a random
theme is chosen from which the background image and color are set. This is
a write-only field; it can only be set on requests that don't set
colorRgb
or backgroundImageFile
.