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
Lists a user's installed apps.
Gets the starting pageToken for listing future changes.
Lists the changes for a user or shared drive.
Deletes a comment.
The ID of the comment.
The ID of the file.
Permanently deletes a shared drive for which the user is an organizer
.
The shared drive cannot contain any untrashed items.
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.
List the AccessProposals on a file. Note: Only approvers are able to list AccessProposals on a file. If the user is not an approver, returns a 403.
Required. The id of the item the request is on.
Used to approve or deny an Access Proposal.
Required. The id of the item the request is on.
Required. The id of the access proposal to resolve.
Creates a copy of a file and applies any requested updates with patch semantics.
The ID of the file.
Creates a new file. This method supports an /upload URI and accepts
uploaded media with the following characteristics: - Maximum file size:
5,120 GB - *Accepted Media MIME types:**\/*
Note: 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
on uploading files, see Upload file
data. Apps creating shortcuts with
files.create
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 title
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 title. 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. 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 content of a file. 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.
Exports a Google Workspace document to the requested MIME type and returns exported byte content. Note that the exported content is limited to 10MB.
The ID of the file.
Generates a set of file IDs which can be provided in create or copy requests.
Gets a file's metadata or content by ID. 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 & export
files.
The ID of the file.
Lists the user's files. This method accepts the q
parameter, which is a
search query combining one or more search terms. For more information, see
the Search for files & folders guide.
Note: 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.
Modifies the set of labels applied to 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 and/or content. 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:**\/*
Note:
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 on uploading files, see Upload file
data.
The ID of the file.
Starts asynchronous cancellation on a long-running operation. The server
makes a best effort to cancel the operation, but success is not guaranteed.
If the server doesn't support this method, it returns
google.rpc.Code.UNIMPLEMENTED
. Clients can use Operations.GetOperation or
other methods to check whether the cancellation succeeded or whether the
operation completed despite cancellation. On successful cancellation, the
operation is not deleted; instead, it becomes an operation with an
Operation.error value with a google.rpc.Status.code of 1, corresponding to
Code.CANCELLED
.
The name of the operation resource to be cancelled.
Deletes a long-running operation. This method indicates that the client is
no longer interested in the operation result. It does not cancel the
operation. If the server doesn't support this method, it returns
google.rpc.Code.UNIMPLEMENTED
.
The name of the operation resource to be deleted.
Lists operations that match the specified filter in the request. If the
server doesn't support this method, it returns UNIMPLEMENTED
.
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.
The ID of the file.
The ID of the revision.
Gets a revision's metadata or content by ID.
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
.