googleapis
Version:
Google APIs Client Library for Node.js
1,227 lines (1,226 loc) • 279 kB
TypeScript
/// <reference types="node" />
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosPromise, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
import { Readable } from 'stream';
export declare namespace drive_v3 {
export interface Options extends GlobalOptions {
version: 'v3';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient | BaseExternalAccountClient | GoogleAuth;
/**
* Data format for the response.
*/
alt?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
*/
quotaUser?: string;
/**
* Deprecated. Please use quotaUser instead.
*/
userIp?: string;
}
/**
* Drive API
*
* Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.
*
* @example
* ```js
* const {google} = require('googleapis');
* const drive = google.drive('v3');
* ```
*/
export class Drive {
context: APIRequestContext;
about: Resource$About;
changes: Resource$Changes;
channels: Resource$Channels;
comments: Resource$Comments;
drives: Resource$Drives;
files: Resource$Files;
permissions: Resource$Permissions;
replies: Resource$Replies;
revisions: Resource$Revisions;
teamdrives: Resource$Teamdrives;
constructor(options: GlobalOptions, google?: GoogleConfigurable);
}
/**
* Information about the user, the user's Drive, and system capabilities.
*/
export interface Schema$About {
/**
* Whether the user has installed the requesting app.
*/
appInstalled?: boolean | null;
/**
* Whether the user can create shared drives.
*/
canCreateDrives?: boolean | null;
/**
* Deprecated - use canCreateDrives instead.
*/
canCreateTeamDrives?: boolean | null;
/**
* A list of themes that are supported for shared drives.
*/
driveThemes?: Array<{
backgroundImageLink?: string;
colorRgb?: string;
id?: string;
}> | null;
/**
* A map of source MIME type to possible targets for all supported exports.
*/
exportFormats?: {
[key: string]: string[];
} | null;
/**
* The currently supported folder colors as RGB hex strings.
*/
folderColorPalette?: string[] | null;
/**
* A map of source MIME type to possible targets for all supported imports.
*/
importFormats?: {
[key: string]: string[];
} | null;
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#about".
*/
kind?: string | null;
/**
* A map of maximum import sizes by MIME type, in bytes.
*/
maxImportSizes?: {
[key: string]: string;
} | null;
/**
* The maximum upload size in bytes.
*/
maxUploadSize?: string | null;
/**
* The user's storage quota limits and usage. All fields are measured in bytes.
*/
storageQuota?: {
limit?: string;
usage?: string;
usageInDrive?: string;
usageInDriveTrash?: string;
} | null;
/**
* Deprecated - use driveThemes instead.
*/
teamDriveThemes?: Array<{
backgroundImageLink?: string;
colorRgb?: string;
id?: string;
}> | null;
/**
* The authenticated user.
*/
user?: Schema$User;
}
/**
* A change to a file or shared drive.
*/
export interface Schema$Change {
/**
* The type of the change. Possible values are file and drive.
*/
changeType?: string | null;
/**
* The updated state of the shared drive. Present if the changeType is drive, the user is still a member of the shared drive, and the shared drive has not been deleted.
*/
drive?: Schema$Drive;
/**
* The ID of the shared drive associated with this change.
*/
driveId?: string | null;
/**
* The updated state of the file. Present if the type is file and the file has not been removed from this list of changes.
*/
file?: Schema$File;
/**
* The ID of the file which has changed.
*/
fileId?: string | null;
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#change".
*/
kind?: string | null;
/**
* Whether the file or shared drive has been removed from this list of changes, for example by deletion or loss of access.
*/
removed?: boolean | null;
/**
* Deprecated - use drive instead.
*/
teamDrive?: Schema$TeamDrive;
/**
* Deprecated - use driveId instead.
*/
teamDriveId?: string | null;
/**
* The time of this change (RFC 3339 date-time).
*/
time?: string | null;
/**
* Deprecated - use changeType instead.
*/
type?: string | null;
}
/**
* A list of changes for a user.
*/
export interface Schema$ChangeList {
/**
* The list of changes. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
changes?: Schema$Change[];
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#changeList".
*/
kind?: string | null;
/**
* The starting page token for future changes. This will be present only if the end of the current changes list has been reached.
*/
newStartPageToken?: string | null;
/**
* The page token for the next page of changes. This will be absent if the end of the changes list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.
*/
nextPageToken?: string | null;
}
/**
* An notification channel used to watch for resource changes.
*/
export interface Schema$Channel {
/**
* The address where notifications are delivered for this channel.
*/
address?: string | null;
/**
* Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
*/
expiration?: string | null;
/**
* A UUID or similar unique string that identifies this channel.
*/
id?: string | null;
/**
* Identifies this as a notification channel used to watch for changes to a resource, which is "api#channel".
*/
kind?: string | null;
/**
* Additional parameters controlling delivery channel behavior. Optional.
*/
params?: {
[key: string]: string;
} | null;
/**
* A Boolean value to indicate whether payload is wanted. Optional.
*/
payload?: boolean | null;
/**
* An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
*/
resourceId?: string | null;
/**
* A version-specific identifier for the watched resource.
*/
resourceUri?: string | null;
/**
* An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
*/
token?: string | null;
/**
* The type of delivery mechanism used for this channel. Valid values are "web_hook" (or "webhook"). Both values refer to a channel where Http requests are used to deliver messages.
*/
type?: string | null;
}
/**
* A comment on a file.
*/
export interface Schema$Comment {
/**
* A region of the document represented as a JSON string. See anchor documentation for details on how to define and interpret anchor properties.
*/
anchor?: string | null;
/**
* The author of the comment. The author's email address and permission ID will not be populated.
*/
author?: Schema$User;
/**
* The plain text content of the comment. This field is used for setting the content, while htmlContent should be displayed.
*/
content?: string | null;
/**
* The time at which the comment was created (RFC 3339 date-time).
*/
createdTime?: string | null;
/**
* Whether the comment has been deleted. A deleted comment has no content.
*/
deleted?: boolean | null;
/**
* The content of the comment with HTML formatting.
*/
htmlContent?: string | null;
/**
* The ID of the comment.
*/
id?: string | null;
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#comment".
*/
kind?: string | null;
/**
* The last time the comment or any of its replies was modified (RFC 3339 date-time).
*/
modifiedTime?: string | null;
/**
* The file content to which the comment refers, typically within the anchor region. For a text file, for example, this would be the text at the location of the comment.
*/
quotedFileContent?: {
mimeType?: string;
value?: string;
} | null;
/**
* The full list of replies to the comment in chronological order.
*/
replies?: Schema$Reply[];
/**
* Whether the comment has been resolved by one of its replies.
*/
resolved?: boolean | null;
}
/**
* A list of comments on a file.
*/
export interface Schema$CommentList {
/**
* The list of comments. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
comments?: Schema$Comment[];
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#commentList".
*/
kind?: string | null;
/**
* The page token for the next page of comments. This will be absent if the end of the comments list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.
*/
nextPageToken?: string | null;
}
/**
* A restriction for accessing the content of the file.
*/
export interface Schema$ContentRestriction {
/**
* Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified.
*/
readOnly?: boolean | null;
/**
* Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true.
*/
reason?: string | null;
/**
* The user who set the content restriction. Only populated if readOnly is true.
*/
restrictingUser?: Schema$User;
/**
* The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true.
*/
restrictionTime?: string | null;
/**
* The type of the content restriction. Currently the only possible value is globalContentRestriction.
*/
type?: string | null;
}
/**
* Representation of a shared drive.
*/
export interface Schema$Drive {
/**
* 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.
*/
backgroundImageFile?: {
id?: string;
width?: number;
xCoordinate?: number;
yCoordinate?: number;
} | null;
/**
* A short-lived link to this shared drive's background image.
*/
backgroundImageLink?: string | null;
/**
* Capabilities the current user has on this shared drive.
*/
capabilities?: {
canAddChildren?: boolean;
canChangeCopyRequiresWriterPermissionRestriction?: boolean;
canChangeDomainUsersOnlyRestriction?: boolean;
canChangeDriveBackground?: boolean;
canChangeDriveMembersOnlyRestriction?: boolean;
canComment?: boolean;
canCopy?: boolean;
canDeleteChildren?: boolean;
canDeleteDrive?: boolean;
canDownload?: boolean;
canEdit?: boolean;
canListChildren?: boolean;
canManageMembers?: boolean;
canReadRevisions?: boolean;
canRename?: boolean;
canRenameDrive?: boolean;
canShare?: boolean;
canTrashChildren?: boolean;
} | null;
/**
* 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.
*/
colorRgb?: string | null;
/**
* The time at which the shared drive was created (RFC 3339 date-time).
*/
createdTime?: string | null;
/**
* Whether the shared drive is hidden from default view.
*/
hidden?: boolean | null;
/**
* The ID of this shared drive which is also the ID of the top level folder of this shared drive.
*/
id?: string | null;
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#drive".
*/
kind?: string | null;
/**
* The name of this shared drive.
*/
name?: string | null;
/**
* A set of restrictions that apply to this shared drive or items inside this shared drive.
*/
restrictions?: {
adminManagedRestrictions?: boolean;
copyRequiresWriterPermission?: boolean;
domainUsersOnly?: boolean;
driveMembersOnly?: boolean;
} | null;
/**
* 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.
*/
themeId?: string | null;
}
/**
* A list of shared drives.
*/
export interface Schema$DriveList {
/**
* The list of shared drives. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
drives?: Schema$Drive[];
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#driveList".
*/
kind?: string | null;
/**
* The page token for the next page of shared drives. This will be absent if the end of the list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.
*/
nextPageToken?: string | null;
}
/**
* The metadata for a file.
*/
export interface Schema$File {
/**
* A collection of arbitrary key-value pairs which are private to the requesting app.
* Entries with null values are cleared in update and copy requests. These properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties.
*/
appProperties?: {
[key: string]: string;
} | null;
/**
* Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
*/
capabilities?: {
canAddChildren?: boolean;
canAddFolderFromAnotherDrive?: boolean;
canAddMyDriveParent?: boolean;
canChangeCopyRequiresWriterPermission?: boolean;
canChangeViewersCanCopyContent?: boolean;
canComment?: boolean;
canCopy?: boolean;
canDelete?: boolean;
canDeleteChildren?: boolean;
canDownload?: boolean;
canEdit?: boolean;
canListChildren?: boolean;
canModifyContent?: boolean;
canModifyContentRestriction?: boolean;
canMoveChildrenOutOfDrive?: boolean;
canMoveChildrenOutOfTeamDrive?: boolean;
canMoveChildrenWithinDrive?: boolean;
canMoveChildrenWithinTeamDrive?: boolean;
canMoveItemIntoTeamDrive?: boolean;
canMoveItemOutOfDrive?: boolean;
canMoveItemOutOfTeamDrive?: boolean;
canMoveItemWithinDrive?: boolean;
canMoveItemWithinTeamDrive?: boolean;
canMoveTeamDriveItem?: boolean;
canReadDrive?: boolean;
canReadRevisions?: boolean;
canReadTeamDrive?: boolean;
canRemoveChildren?: boolean;
canRemoveMyDriveParent?: boolean;
canRename?: boolean;
canShare?: boolean;
canTrash?: boolean;
canTrashChildren?: boolean;
canUntrash?: boolean;
} | null;
/**
* Additional information about the content of the file. These fields are never populated in responses.
*/
contentHints?: {
indexableText?: string;
thumbnail?: {
image?: string;
mimeType?: string;
};
} | null;
/**
* Restrictions for accessing the content of the file. Only populated if such a restriction exists.
*/
contentRestrictions?: Schema$ContentRestriction[];
/**
* Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
*/
copyRequiresWriterPermission?: boolean | null;
/**
* The time at which the file was created (RFC 3339 date-time).
*/
createdTime?: string | null;
/**
* A short description of the file.
*/
description?: string | null;
/**
* ID of the shared drive the file resides in. Only populated for items in shared drives.
*/
driveId?: string | null;
/**
* Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
*/
explicitlyTrashed?: boolean | null;
/**
* Links for exporting Docs Editors files to specific formats.
*/
exportLinks?: {
[key: string]: string;
} | null;
/**
* The final component of fullFileExtension. This is only available for files with binary content in Google Drive.
*/
fileExtension?: string | null;
/**
* The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
* If an unsupported color is specified, the closest color in the palette will be used instead.
*/
folderColorRgb?: string | null;
/**
* The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive.
* This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
*/
fullFileExtension?: string | null;
/**
* Whether there are permissions directly on this file. This field is only populated for items in shared drives.
*/
hasAugmentedPermissions?: boolean | null;
/**
* Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field.
*/
hasThumbnail?: boolean | null;
/**
* The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.
*/
headRevisionId?: string | null;
/**
* A static, unauthenticated link to the file's icon.
*/
iconLink?: string | null;
/**
* The ID of the file.
*/
id?: string | null;
/**
* Additional metadata about image media, if available.
*/
imageMediaMetadata?: {
aperture?: number;
cameraMake?: string;
cameraModel?: string;
colorSpace?: string;
exposureBias?: number;
exposureMode?: string;
exposureTime?: number;
flashUsed?: boolean;
focalLength?: number;
height?: number;
isoSpeed?: number;
lens?: string;
location?: {
altitude?: number;
latitude?: number;
longitude?: number;
};
maxApertureValue?: number;
meteringMode?: string;
rotation?: number;
sensor?: string;
subjectDistance?: number;
time?: string;
whiteBalance?: string;
width?: number;
} | null;
/**
* Whether the file was created or opened by the requesting app.
*/
isAppAuthorized?: boolean | null;
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#file".
*/
kind?: string | null;
/**
* The last user to modify the file.
*/
lastModifyingUser?: Schema$User;
/**
* The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
*/
md5Checksum?: string | null;
/**
* The MIME type of the file.
* Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded.
* If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.
*/
mimeType?: string | null;
/**
* Whether the file has been modified by this user.
*/
modifiedByMe?: boolean | null;
/**
* The last time the file was modified by the user (RFC 3339 date-time).
*/
modifiedByMeTime?: string | null;
/**
* The last time the file was modified by anyone (RFC 3339 date-time).
* Note that setting modifiedTime will also update modifiedByMeTime for the user.
*/
modifiedTime?: string | null;
/**
* The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant.
*/
name?: string | null;
/**
* The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Google Drive.
*/
originalFilename?: string | null;
/**
* Whether the user owns the file. Not populated for items in shared drives.
*/
ownedByMe?: boolean | null;
/**
* The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives.
*/
owners?: Schema$User[];
/**
* The IDs of the parent folders which contain the file.
* If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests must use the addParents and removeParents parameters to modify the parents list.
*/
parents?: string[] | null;
/**
* List of permission IDs for users with access to this file.
*/
permissionIds?: string[] | null;
/**
* The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for items in shared drives.
*/
permissions?: Schema$Permission[];
/**
* A collection of arbitrary key-value pairs which are visible to all apps.
* Entries with null values are cleared in update and copy requests.
*/
properties?: {
[key: string]: string;
} | null;
/**
* The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.
*/
quotaBytesUsed?: string | null;
/**
* Whether the file has been shared. Not populated for items in shared drives.
*/
shared?: boolean | null;
/**
* The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
*/
sharedWithMeTime?: string | null;
/**
* The user who shared the file with the requesting user, if applicable.
*/
sharingUser?: Schema$User;
/**
* Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut.
*/
shortcutDetails?: {
targetId?: string;
targetMimeType?: string;
} | null;
/**
* The size of the file's content in bytes. This is applicable to binary files in Google Drive and Google Docs files.
*/
size?: string | null;
/**
* The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
*/
spaces?: string[] | null;
/**
* Whether the user has starred the file.
*/
starred?: boolean | null;
/**
* Deprecated - use driveId instead.
*/
teamDriveId?: string | null;
/**
* A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request.
*/
thumbnailLink?: string | null;
/**
* The thumbnail version for use in thumbnail cache invalidation.
*/
thumbnailVersion?: string | null;
/**
* Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file.
*/
trashed?: boolean | null;
/**
* The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.
*/
trashedTime?: string | null;
/**
* If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives.
*/
trashingUser?: Schema$User;
/**
* A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the user.
*/
version?: string | null;
/**
* Additional metadata about video media. This may not be available immediately upon upload.
*/
videoMediaMetadata?: {
durationMillis?: string;
height?: number;
width?: number;
} | null;
/**
* Whether the file has been viewed by this user.
*/
viewedByMe?: boolean | null;
/**
* The last time the file was viewed by the user (RFC 3339 date-time).
*/
viewedByMeTime?: string | null;
/**
* Deprecated - use copyRequiresWriterPermission instead.
*/
viewersCanCopyContent?: boolean | null;
/**
* A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive.
*/
webContentLink?: string | null;
/**
* A link for opening the file in a relevant Google editor or viewer in a browser.
*/
webViewLink?: string | null;
/**
* Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.
*/
writersCanShare?: boolean | null;
}
/**
* A list of files.
*/
export interface Schema$FileList {
/**
* The list of files. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
files?: Schema$File[];
/**
* Whether the search process was incomplete. If true, then some search results may be missing, since all documents were not searched. This may occur when searching multiple drives with the "allDrives" corpora, but all corpora could not be searched. When this happens, it is suggested that clients narrow their query by choosing a different corpus such as "user" or "drive".
*/
incompleteSearch?: boolean | null;
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#fileList".
*/
kind?: string | null;
/**
* The page token for the next page of files. This will be absent if the end of the files list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.
*/
nextPageToken?: string | null;
}
/**
* A list of generated file IDs which can be provided in create requests.
*/
export interface Schema$GeneratedIds {
/**
* The IDs generated for the requesting user in the specified space.
*/
ids?: string[] | null;
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#generatedIds".
*/
kind?: string | null;
/**
* The type of file that can be created with these IDs.
*/
space?: string | null;
}
/**
* A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
*/
export interface Schema$Permission {
/**
* Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
*/
allowFileDiscovery?: boolean | null;
/**
* Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
*/
deleted?: boolean | null;
/**
* The "pretty" name of the value of the permission. The following is a list of examples for each type of permission:
* - user - User's full name, as defined for their Google account, such as "Joe Smith."
* - group - Name of the Google Group, such as "The Company Administrators."
* - domain - String domain name, such as "thecompany.com."
* - anyone - No displayName is present.
*/
displayName?: string | null;
/**
* The domain to which this permission refers.
*/
domain?: string | null;
/**
* The email address of the user or group to which this permission refers.
*/
emailAddress?: string | null;
/**
* The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
* - They can only be set on user and group permissions
* - The time must be in the future
* - The time cannot be more than a year in the future
*/
expirationTime?: string | null;
/**
* The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values.
*/
id?: string | null;
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#permission".
*/
kind?: string | null;
/**
* Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
*/
permissionDetails?: Array<{
inherited?: boolean;
inheritedFrom?: string;
permissionType?: string;
role?: string;
}> | null;
/**
* A link to the user's profile photo, if available.
*/
photoLink?: string | null;
/**
* The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
* - owner
* - organizer
* - fileOrganizer
* - writer
* - commenter
* - reader
*/
role?: string | null;
/**
* Deprecated - use permissionDetails instead.
*/
teamDrivePermissionDetails?: Array<{
inherited?: boolean;
inheritedFrom?: string;
role?: string;
teamDrivePermissionType?: string;
}> | null;
/**
* The type of the grantee. Valid values are:
* - user
* - group
* - domain
* - anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn't extra information required for a anyone type.
*/
type?: string | null;
/**
* Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value.
*/
view?: string | null;
}
/**
* A list of permissions for a file.
*/
export interface Schema$PermissionList {
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#permissionList".
*/
kind?: string | null;
/**
* The page token for the next page of permissions. This field will be absent if the end of the permissions list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.
*/
nextPageToken?: string | null;
/**
* The list of permissions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
permissions?: Schema$Permission[];
}
/**
* A reply to a comment on a file.
*/
export interface Schema$Reply {
/**
* The action the reply performed to the parent comment. Valid values are:
* - resolve
* - reopen
*/
action?: string | null;
/**
* The author of the reply. The author's email address and permission ID will not be populated.
*/
author?: Schema$User;
/**
* The plain text content of the reply. This field is used for setting the content, while htmlContent should be displayed. This is required on creates if no action is specified.
*/
content?: string | null;
/**
* The time at which the reply was created (RFC 3339 date-time).
*/
createdTime?: string | null;
/**
* Whether the reply has been deleted. A deleted reply has no content.
*/
deleted?: boolean | null;
/**
* The content of the reply with HTML formatting.
*/
htmlContent?: string | null;
/**
* The ID of the reply.
*/
id?: string | null;
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#reply".
*/
kind?: string | null;
/**
* The last time the reply was modified (RFC 3339 date-time).
*/
modifiedTime?: string | null;
}
/**
* A list of replies to a comment on a file.
*/
export interface Schema$ReplyList {
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#replyList".
*/
kind?: string | null;
/**
* The page token for the next page of replies. This will be absent if the end of the replies list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.
*/
nextPageToken?: string | null;
/**
* The list of replies. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
replies?: Schema$Reply[];
}
/**
* The metadata for a revision to a file.
*/
export interface Schema$Revision {
/**
* Links for exporting Docs Editors files to specific formats.
*/
exportLinks?: {
[key: string]: string;
} | null;
/**
* The ID of the revision.
*/
id?: string | null;
/**
* Whether to keep this revision forever, even if it is no longer the head revision. If not set, the revision will be automatically purged 30 days after newer content is uploaded. This can be set on a maximum of 200 revisions for a file.
* This field is only applicable to files with binary content in Drive.
*/
keepForever?: boolean | null;
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#revision".
*/
kind?: string | null;
/**
* The last user to modify this revision.
*/
lastModifyingUser?: Schema$User;
/**
* The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive.
*/
md5Checksum?: string | null;
/**
* The MIME type of the revision.
*/
mimeType?: string | null;
/**
* The last time the revision was modified (RFC 3339 date-time).
*/
modifiedTime?: string | null;
/**
* The original filename used to create this revision. This is only applicable to files with binary content in Drive.
*/
originalFilename?: string | null;
/**
* Whether subsequent revisions will be automatically republished. This is only applicable to Docs Editors files.
*/
publishAuto?: boolean | null;
/**
* Whether this revision is published. This is only applicable to Docs Editors files.
*/
published?: boolean | null;
/**
* A link to the published revision. This is only populated for Google Sites files.
*/
publishedLink?: string | null;
/**
* Whether this revision is published outside the domain. This is only applicable to Docs Editors files.
*/
publishedOutsideDomain?: boolean | null;
/**
* The size of the revision's content in bytes. This is only applicable to files with binary content in Drive.
*/
size?: string | null;
}
/**
* A list of revisions of a file.
*/
export interface Schema$RevisionList {
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#revisionList".
*/
kind?: string | null;
/**
* The page token for the next page of revisions. This will be absent if the end of the revisions list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.
*/
nextPageToken?: string | null;
/**
* The list of revisions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
revisions?: Schema$Revision[];
}
export interface Schema$StartPageToken {
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#startPageToken".
*/
kind?: string | null;
/**
* The starting page token for listing changes.
*/
startPageToken?: string | null;
}
/**
* Deprecated: use the drive collection instead.
*/
export interface Schema$TeamDrive {
/**
* An image file and cropping parameters from which a background image for this Team Drive is set. This is a write only field; it can only be set on drive.teamdrives.update requests that don't set themeId. When specified, all fields of the backgroundImageFile must be set.
*/
backgroundImageFile?: {
id?: string;
width?: number;
xCoordinate?: number;
yCoordinate?: number;
} | null;
/**
* A short-lived link to this Team Drive's background image.
*/
backgroundImageLink?: string | null;
/**
* Capabilities the current user has on this Team Drive.
*/
capabilities?: {
canAddChildren?: boolean;
canChangeCopyRequiresWriterPermissionRestriction?: boolean;
canChangeDomainUsersOnlyRestriction?: boolean;
canChangeTeamDriveBackground?: boolean;
canChangeTeamMembersOnlyRestriction?: boolean;
canComment?: boolean;
canCopy?: boolean;
canDeleteChildren?: boolean;
canDeleteTeamDrive?: boolean;
canDownload?: boolean;
canEdit?: boolean;
canListChildren?: boolean;
canManageMembers?: boolean;
canReadRevisions?: boolean;
canRemoveChildren?: boolean;
canRename?: boolean;
canRenameTeamDrive?: boolean;
canShare?: boolean;
canTrashChildren?: boolean;
} | null;
/**
* The color of this Team Drive as an RGB hex string. It can only be set on a drive.teamdrives.update request that does not set themeId.
*/
colorRgb?: string | null;
/**
* The time at which the Team Drive was created (RFC 3339 date-time).
*/
createdTime?: string | null;
/**
* The ID of this Team Drive which is also the ID of the top level folder of this Team Drive.
*/
id?: string | null;
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#teamDrive".
*/
kind?: string | null;
/**
* The name of this Team Drive.
*/
name?: string | null;
/**
* A set of restrictions that apply to this Team Drive or items inside this Team Drive.
*/
restrictions?: {
adminManagedRestrictions?: boolean;
copyRequiresWriterPermission?: boolean;
domainUsersOnly?: boolean;
teamMembersOnly?: boolean;
} | null;
/**
* The ID of the theme from which the background image and color will be set. The set of possible teamDriveThemes can be retrieved from a drive.about.get response. When not specified on a drive.teamdrives.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.
*/
themeId?: string | null;
}
/**
* A list of Team Drives.
*/
export interface Schema$TeamDriveList {
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#teamDriveList".
*/
kind?: string | null;
/**
* The page token for the next page of Team Drives. This will be absent if the end of the Team Drives list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.
*/
nextPageToken?: string | null;
/**
* The list of Team Drives. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
teamDrives?: Schema$TeamDrive[];
}
/**
* Information about a Drive user.
*/
export interface Schema$User {
/**
* A plain text displayable name for this user.
*/
displayName?: string | null;
/**
* The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
*/
emailAddress?: string | null;
/**
* Identifies what kind of resource this is. Value: the fixed string "drive#user".
*/
kind?: string | null;
/**
* Whether this user is the requesting user.
*/
me?: boolean | null;
/**
* The user's ID as visible in Permission resources.
*/
permissionId?: string | null;
/**
* A link to the user's profile photo, if available.
*/
photoLink?: string | null;
}
export class Resource$About {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* Gets information about the user, the user's Drive, and system capabilities.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/drive.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const drive = google.drive('v3');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: [
* 'https://www.googleapis.com/auth/drive',
* 'https://www.googleapis.com/auth/drive.appdata',
* 'https://www.googleapis.com/auth/drive.file',
* 'https://www.googleapis.com/auth/drive.metadata',
* 'https://www.googleapis.com/auth/drive.metadata.readonly',
* 'https://www.googleapis.com/auth/drive.photos.readonly',
* 'https://www.googleapis.com/auth/drive.readonly',
* ],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await drive.about.get({});