googleapis
Version:
Google APIs Client Library for Node.js
1,418 lines • 236 kB
TypeScript
/**
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { OAuth2Client, JWT, Compute, UserRefreshClient } from 'google-auth-library';
import { GoogleConfigurable, MethodOptions, GlobalOptions, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
import { GaxiosPromise } from 'gaxios';
export declare namespace drive_v2 {
interface Options extends GlobalOptions {
version: 'v2';
}
interface StandardParameters {
/**
* 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
* const {google} = require('googleapis');
* const drive = google.drive('v2');
*
* @namespace drive
* @type {Function}
* @version v2
* @variation v2
* @param {object=} options Options for Drive
*/
class Drive {
context: APIRequestContext;
about: Resource$About;
apps: Resource$Apps;
changes: Resource$Changes;
channels: Resource$Channels;
children: Resource$Children;
comments: Resource$Comments;
drives: Resource$Drives;
files: Resource$Files;
parents: Resource$Parents;
permissions: Resource$Permissions;
properties: Resource$Properties;
realtime: Resource$Realtime;
replies: Resource$Replies;
revisions: Resource$Revisions;
teamdrives: Resource$Teamdrives;
constructor(options: GlobalOptions, google?: GoogleConfigurable);
}
/**
* An item with user information and settings.
*/
interface Schema$About {
/**
* Information about supported additional roles per file type. The most specific type takes precedence.
*/
additionalRoleInfo?: Array<{
roleSets?: Array<{
additionalRoles?: string[];
primaryRole?: string;
}>;
type?: string;
}>;
/**
* Whether the user can create shared drives.
*/
canCreateDrives?: boolean;
/**
* Deprecated - use canCreateDrives instead.
*/
canCreateTeamDrives?: boolean;
/**
* The domain sharing policy for the current user. Possible values are: - allowed - allowedWithWarning - incomingOnly - disallowed
*/
domainSharingPolicy?: string;
/**
* A list of themes that are supported for shared drives.
*/
driveThemes?: Array<{
backgroundImageLink?: string;
colorRgb?: string;
id?: string;
}>;
/**
* The ETag of the item.
*/
etag?: string;
/**
* The allowable export formats.
*/
exportFormats?: Array<{
source?: string;
targets?: string[];
}>;
/**
* List of additional features enabled on this account.
*/
features?: Array<{
featureName?: string;
featureRate?: number;
}>;
/**
* The palette of allowable folder colors as RGB hex strings.
*/
folderColorPalette?: string[];
/**
* The allowable import formats.
*/
importFormats?: Array<{
source?: string;
targets?: string[];
}>;
/**
* A boolean indicating whether the authenticated app is installed by the authenticated user.
*/
isCurrentAppInstalled?: boolean;
/**
* This is always drive#about.
*/
kind?: string;
/**
* The user's language or locale code, as defined by BCP 47, with some extensions from Unicode's LDML format (http://www.unicode.org/reports/tr35/).
*/
languageCode?: string;
/**
* The largest change id.
*/
largestChangeId?: string;
/**
* List of max upload sizes for each file type. The most specific type takes precedence.
*/
maxUploadSizes?: Array<{
size?: string;
type?: string;
}>;
/**
* The name of the current user.
*/
name?: string;
/**
* The current user's ID as visible in the permissions collection.
*/
permissionId?: string;
/**
* The amount of storage quota used by different Google services.
*/
quotaBytesByService?: Array<{
bytesUsed?: string;
serviceName?: string;
}>;
/**
* The total number of quota bytes.
*/
quotaBytesTotal?: string;
/**
* The number of quota bytes used by Google Drive.
*/
quotaBytesUsed?: string;
/**
* The number of quota bytes used by all Google apps (Drive, Picasa, etc.).
*/
quotaBytesUsedAggregate?: string;
/**
* The number of quota bytes used by trashed items.
*/
quotaBytesUsedInTrash?: string;
/**
* The type of the user's storage quota. Possible values are: - LIMITED - UNLIMITED
*/
quotaType?: string;
/**
* The number of remaining change ids, limited to no more than 2500.
*/
remainingChangeIds?: string;
/**
* The id of the root folder.
*/
rootFolderId?: string;
/**
* A link back to this item.
*/
selfLink?: string;
/**
* Deprecated - use driveThemes instead.
*/
teamDriveThemes?: Array<{
backgroundImageLink?: string;
colorRgb?: string;
id?: string;
}>;
/**
* The authenticated user.
*/
user?: Schema$User;
}
/**
* The apps resource provides a list of the apps that a user has installed, with information about each app's supported MIME types, file extensions, and other details.
*/
interface Schema$App {
/**
* Whether the app is authorized to access data on the user's Drive.
*/
authorized?: boolean;
/**
* The template url to create a new file with this app in a given folder. The template will contain {folderId} to be replaced by the folder to create the new file in.
*/
createInFolderTemplate?: string;
/**
* The url to create a new file with this app.
*/
createUrl?: string;
/**
* Whether the app has drive-wide scope. An app with drive-wide scope can access all files in the user's drive.
*/
hasDriveWideScope?: boolean;
/**
* The various icons for the app.
*/
icons?: Array<{
category?: string;
iconUrl?: string;
size?: number;
}>;
/**
* The ID of the app.
*/
id?: string;
/**
* Whether the app is installed.
*/
installed?: boolean;
/**
* This is always drive#app.
*/
kind?: string;
/**
* A long description of the app.
*/
longDescription?: string;
/**
* The name of the app.
*/
name?: string;
/**
* The type of object this app creates (e.g. Chart). If empty, the app name should be used instead.
*/
objectType?: string;
/**
* The template url for opening files with this app. The template will contain {ids} and/or {exportIds} to be replaced by the actual file ids. See Open Files for the full documentation.
*/
openUrlTemplate?: string;
/**
* The list of primary file extensions.
*/
primaryFileExtensions?: string[];
/**
* The list of primary mime types.
*/
primaryMimeTypes?: string[];
/**
* The ID of the product listing for this app.
*/
productId?: string;
/**
* A link to the product listing for this app.
*/
productUrl?: string;
/**
* The list of secondary file extensions.
*/
secondaryFileExtensions?: string[];
/**
* The list of secondary mime types.
*/
secondaryMimeTypes?: string[];
/**
* A short description of the app.
*/
shortDescription?: string;
/**
* Whether this app supports creating new objects.
*/
supportsCreate?: boolean;
/**
* Whether this app supports importing Google Docs.
*/
supportsImport?: boolean;
/**
* Whether this app supports opening more than one file.
*/
supportsMultiOpen?: boolean;
/**
* Whether this app supports creating new files when offline.
*/
supportsOfflineCreate?: boolean;
/**
* Whether the app is selected as the default handler for the types it supports.
*/
useByDefault?: boolean;
}
/**
* A list of third-party applications which the user has installed or given access to Google Drive.
*/
interface Schema$AppList {
/**
* List of app IDs that the user has specified to use by default. The list is in reverse-priority order (lowest to highest).
*/
defaultAppIds?: string[];
/**
* The ETag of the list.
*/
etag?: string;
/**
* The list of apps.
*/
items?: Schema$App[];
/**
* This is always drive#appList.
*/
kind?: string;
/**
* A link back to this list.
*/
selfLink?: string;
}
/**
* Representation of a change to a file or shared drive.
*/
interface Schema$Change {
/**
* The type of the change. Possible values are file and drive.
*/
changeType?: string;
/**
* Whether the file or shared drive has been removed from this list of changes, for example by deletion or loss of access.
*/
deleted?: boolean;
/**
* 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;
/**
* 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 associated with this change.
*/
fileId?: string;
/**
* The ID of the change.
*/
id?: string;
/**
* This is always drive#change.
*/
kind?: string;
/**
* The time of this modification.
*/
modificationDate?: string;
/**
* A link back to this change.
*/
selfLink?: string;
/**
* Deprecated - use drive instead.
*/
teamDrive?: Schema$TeamDrive;
/**
* Deprecated - use driveId instead.
*/
teamDriveId?: string;
/**
* Deprecated - use changeType instead.
*/
type?: string;
}
/**
* A list of changes for a user.
*/
interface Schema$ChangeList {
/**
* The ETag of the list.
*/
etag?: string;
/**
* The list of changes. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
items?: Schema$Change[];
/**
* This is always drive#changeList.
*/
kind?: string;
/**
* The current largest change ID.
*/
largestChangeId?: string;
/**
* 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;
/**
* A link to the next page of changes.
*/
nextLink?: string;
/**
* 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;
/**
* A link back to this list.
*/
selfLink?: string;
}
/**
* An notification channel used to watch for resource changes.
*/
interface Schema$Channel {
/**
* The address where notifications are delivered for this channel.
*/
address?: string;
/**
* Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
*/
expiration?: string;
/**
* A UUID or similar unique string that identifies this channel.
*/
id?: string;
/**
* Identifies this as a notification channel used to watch for changes to a resource, which is "api#channel".
*/
kind?: string;
/**
* Additional parameters controlling delivery channel behavior. Optional.
*/
params?: {
[key: string]: string;
};
/**
* A Boolean value to indicate whether payload is wanted. Optional.
*/
payload?: boolean;
/**
* An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
*/
resourceId?: string;
/**
* A version-specific identifier for the watched resource.
*/
resourceUri?: string;
/**
* An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
*/
token?: string;
/**
* The type of delivery mechanism used for this channel.
*/
type?: string;
}
/**
* A list of children of a file.
*/
interface Schema$ChildList {
/**
* The ETag of the list.
*/
etag?: string;
/**
* The list of children. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
items?: Schema$ChildReference[];
/**
* This is always drive#childList.
*/
kind?: string;
/**
* A link to the next page of children.
*/
nextLink?: string;
/**
* The page token for the next page of children. This will be absent if the end of the children 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;
/**
* A link back to this list.
*/
selfLink?: string;
}
/**
* A reference to a folder's child.
*/
interface Schema$ChildReference {
/**
* A link to the child.
*/
childLink?: string;
/**
* The ID of the child.
*/
id?: string;
/**
* This is always drive#childReference.
*/
kind?: string;
/**
* A link back to this reference.
*/
selfLink?: string;
}
/**
* A comment on a file in Google Drive.
*/
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;
/**
* The user who wrote this comment.
*/
author?: Schema$User;
/**
* The ID of the comment.
*/
commentId?: string;
/**
* The plain text content used to create this comment. This is not HTML safe and should only be used as a starting point to make edits to a comment's content.
*/
content?: string;
/**
* The context of the file which is being commented on.
*/
context?: {
type?: string;
value?: string;
};
/**
* The date when this comment was first created.
*/
createdDate?: string;
/**
* Whether this comment has been deleted. If a comment has been deleted the content will be cleared and this will only represent a comment that once existed.
*/
deleted?: boolean;
/**
* The file which this comment is addressing.
*/
fileId?: string;
/**
* The title of the file which this comment is addressing.
*/
fileTitle?: string;
/**
* HTML formatted content for this comment.
*/
htmlContent?: string;
/**
* This is always drive#comment.
*/
kind?: string;
/**
* The date when this comment or any of its replies were last modified.
*/
modifiedDate?: string;
/**
* Replies to this post.
*/
replies?: Schema$CommentReply[];
/**
* A link back to this comment.
*/
selfLink?: string;
/**
* The status of this comment. Status can be changed by posting a reply to a comment with the desired status. - "open" - The comment is still open. - "resolved" - The comment has been resolved by one of its replies.
*/
status?: string;
}
/**
* A list of comments on a file in Google Drive.
*/
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.
*/
items?: Schema$Comment[];
/**
* This is always drive#commentList.
*/
kind?: string;
/**
* A link to the next page of comments.
*/
nextLink?: string;
/**
* 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;
/**
* A link back to this list.
*/
selfLink?: string;
}
/**
* A comment on a file in Google Drive.
*/
interface Schema$CommentReply {
/**
* The user who wrote this reply.
*/
author?: Schema$User;
/**
* The plain text content used to create this reply. This is not HTML safe and should only be used as a starting point to make edits to a reply's content. This field is required on inserts if no verb is specified (resolve/reopen).
*/
content?: string;
/**
* The date when this reply was first created.
*/
createdDate?: string;
/**
* Whether this reply has been deleted. If a reply has been deleted the content will be cleared and this will only represent a reply that once existed.
*/
deleted?: boolean;
/**
* HTML formatted content for this reply.
*/
htmlContent?: string;
/**
* This is always drive#commentReply.
*/
kind?: string;
/**
* The date when this reply was last modified.
*/
modifiedDate?: string;
/**
* The ID of the reply.
*/
replyId?: string;
/**
* The action this reply performed to the parent comment. When creating a new reply this is the action to be perform to the parent comment. Possible values are: - "resolve" - To resolve a comment. - "reopen" - To reopen (un-resolve) a comment.
*/
verb?: string;
}
/**
* A list of replies to a comment on a file in Google Drive.
*/
interface Schema$CommentReplyList {
/**
* The list of replies. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
items?: Schema$CommentReply[];
/**
* This is always drive#commentReplyList.
*/
kind?: string;
/**
* A link to the next page of replies.
*/
nextLink?: string;
/**
* 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;
/**
* A link back to this list.
*/
selfLink?: string;
}
/**
* Representation of a shared drive.
*/
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;
};
/**
* A short-lived link to this shared drive's background image.
*/
backgroundImageLink?: string;
/**
* 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;
};
/**
* 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;
/**
* The time at which the shared drive was created (RFC 3339 date-time).
*/
createdDate?: string;
/**
* Whether the shared drive is hidden from default view.
*/
hidden?: boolean;
/**
* The ID of this shared drive which is also the ID of the top level folder of this shared drive.
*/
id?: string;
/**
* This is always drive#drive
*/
kind?: string;
/**
* The name of this shared drive.
*/
name?: string;
/**
* 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;
};
/**
* 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.insert 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;
}
/**
* A list of shared drives.
*/
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.
*/
items?: Schema$Drive[];
/**
* This is always drive#driveList
*/
kind?: string;
/**
* 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;
}
/**
* The metadata for a file.
*/
interface Schema$File {
/**
* A link for opening the file in a relevant Google editor or viewer.
*/
alternateLink?: string;
/**
* Whether this file is in the Application Data folder.
*/
appDataContents?: boolean;
/**
* Deprecated: use capabilities/canComment.
*/
canComment?: boolean;
/**
* Deprecated: use capabilities/canReadRevisions.
*/
canReadRevisions?: boolean;
/**
* Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
*/
capabilities?: {
canAddChildren?: boolean;
canChangeCopyRequiresWriterPermission?: boolean;
canChangeRestrictedDownload?: boolean;
canComment?: boolean;
canCopy?: boolean;
canDelete?: boolean;
canDeleteChildren?: boolean;
canDownload?: boolean;
canEdit?: boolean;
canListChildren?: 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;
canRename?: boolean;
canShare?: boolean;
canTrash?: boolean;
canTrashChildren?: boolean;
canUntrash?: boolean;
};
/**
* Deprecated: use capabilities/canCopy.
*/
copyable?: boolean;
/**
* Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
*/
copyRequiresWriterPermission?: boolean;
/**
* Create time for this file (formatted RFC 3339 timestamp).
*/
createdDate?: string;
/**
* A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
*/
defaultOpenWithLink?: string;
/**
* A short description of the file.
*/
description?: string;
/**
* Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files.
*/
downloadUrl?: string;
/**
* ID of the shared drive the file resides in. Only populated for items in shared drives.
*/
driveId?: string;
/**
* Deprecated: use capabilities/canEdit.
*/
editable?: boolean;
/**
* A link for embedding the file.
*/
embedLink?: string;
/**
* ETag of the file.
*/
etag?: string;
/**
* Whether this file has been explicitly trashed, as opposed to recursively trashed.
*/
explicitlyTrashed?: boolean;
/**
* Links for exporting Google Docs to specific formats.
*/
exportLinks?: {
[key: string]: string;
};
/**
* The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files.
*/
fileExtension?: string;
/**
* The size of the file in bytes. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files.
*/
fileSize?: string;
/**
* Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for items in shared drives.
*/
folderColorRgb?: string;
/**
* The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files.
*/
fullFileExtension?: string;
/**
* Whether any users are granted file access directly on this file. This field is only populated for items in shared drives.
*/
hasAugmentedPermissions?: boolean;
/**
* 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;
/**
* The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files.
*/
headRevisionId?: string;
/**
* A link to the file's icon.
*/
iconLink?: string;
/**
* The ID of the file.
*/
id?: string;
/**
* Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
*/
imageMediaMetadata?: {
aperture?: number;
cameraMake?: string;
cameraModel?: string;
colorSpace?: string;
date?: 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;
whiteBalance?: string;
width?: number;
};
/**
* Indexable text attributes for the file (can only be written)
*/
indexableText?: {
text?: string;
};
/**
* Whether the file was created or opened by the requesting app.
*/
isAppAuthorized?: boolean;
/**
* The type of file. This is always drive#file.
*/
kind?: string;
/**
* A group of labels for the file.
*/
labels?: {
hidden?: boolean;
modified?: boolean;
restricted?: boolean;
starred?: boolean;
trashed?: boolean;
viewed?: boolean;
};
/**
* The last user to modify this file.
*/
lastModifyingUser?: Schema$User;
/**
* Name of the last user to modify this file.
*/
lastModifyingUserName?: string;
/**
* Last time this file was viewed by the user (formatted RFC 3339 timestamp).
*/
lastViewedByMeDate?: string;
/**
* Deprecated.
*/
markedViewedByMeDate?: string;
/**
* An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files.
*/
md5Checksum?: string;
/**
* The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
*/
mimeType?: string;
/**
* Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
*/
modifiedByMeDate?: string;
/**
* Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
*/
modifiedDate?: string;
/**
* A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
*/
openWithLinks?: {
[key: string]: string;
};
/**
* The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Google Drive.
*/
originalFilename?: string;
/**
* Whether the file is owned by the current user. Not populated for items in shared drives.
*/
ownedByMe?: boolean;
/**
* Name(s) of the owner(s) of this file. Not populated for items in shared drives.
*/
ownerNames?: string[];
/**
* The owner(s) of this file. Not populated for items in shared drives.
*/
owners?: Schema$User[];
/**
* Collection of parent folders which contain this file. If not specified as part of an insert 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 can also use the addParents and removeParents parameters to modify the parents list.
*/
parents?: Schema$ParentReference[];
/**
* List of permission IDs for users with access to this file.
*/
permissionIds?: string[];
/**
* The list of permissions for users with access to this file. Not populated for items in shared drives.
*/
permissions?: Schema$Permission[];
/**
* The list of properties.
*/
properties?: Schema$Property[];
/**
* The number of quota bytes used by this file.
*/
quotaBytesUsed?: string;
/**
* A link back to this file.
*/
selfLink?: string;
/**
* Deprecated: use capabilities/canShare.
*/
shareable?: boolean;
/**
* Whether the file has been shared. Not populated for items in shared drives.
*/
shared?: boolean;
/**
* Time at which this file was shared with the user (formatted RFC 3339 timestamp).
*/
sharedWithMeDate?: string;
/**
* User that shared the item with the current user, if available.
*/
sharingUser?: Schema$User;
/**
* The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
*/
spaces?: string[];
/**
* Deprecated - use driveId instead.
*/
teamDriveId?: string;
/**
* A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated.
*/
thumbnail?: {
image?: string;
mimeType?: string;
};
/**
* A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
*/
thumbnailLink?: string;
/**
* The thumbnail version for use in thumbnail cache invalidation.
*/
thumbnailVersion?: string;
/**
* The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant.
*/
title?: string;
/**
* The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives.
*/
trashedDate?: string;
/**
* If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives.
*/
trashingUser?: Schema$User;
/**
* The permissions for the authenticated user on this file.
*/
userPermission?: Schema$Permission;
/**
* 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 requesting user.
*/
version?: string;
/**
* Metadata about video media. This will only be present for video types.
*/
videoMediaMetadata?: {
durationMillis?: string;
height?: number;
width?: number;
};
/**
* A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
*/
webContentLink?: string;
/**
* A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
*/
webViewLink?: string;
/**
* Whether writers can share the document with other users. Not populated for items in shared drives.
*/
writersCanShare?: boolean;
}
/**
* A list of files.
*/
interface Schema$FileList {
/**
* The ETag of the list.
*/
etag?: string;
/**
* 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 "default" or "drive".
*/
incompleteSearch?: boolean;
/**
* The list of files. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
items?: Schema$File[];
/**
* This is always drive#fileList.
*/
kind?: string;
/**
* A link to the next page of files.
*/
nextLink?: string;
/**
* 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;
/**
* A link back to this list.
*/
selfLink?: string;
}
/**
* A list of generated IDs which can be provided in insert requests
*/
interface Schema$GeneratedIds {
/**
* The IDs generated for the requesting user in the specified space.
*/
ids?: string[];
/**
* This is always drive#generatedIds
*/
kind?: string;
/**
* The type of file that can be created with these IDs.
*/
space?: string;
}
/**
* A list of a file's parents.
*/
interface Schema$ParentList {
/**
* The ETag of the list.
*/
etag?: string;
/**
* The list of parents.
*/
items?: Schema$ParentReference[];
/**
* This is always drive#parentList.
*/
kind?: string;
/**
* A link back to this list.
*/
selfLink?: string;
}
/**
* A reference to a file's parent.
*/
interface Schema$ParentReference {
/**
* The ID of the parent.
*/
id?: string;
/**
* Whether or not the parent is the root folder.
*/
isRoot?: boolean;
/**
* This is always drive#parentReference.
*/
kind?: string;
/**
* A link to the parent.
*/
parentLink?: string;
/**
* A link back to this reference.
*/
selfLink?: string;
}
/**
* A permission for a file.
*/
interface Schema$Permission {
/**
* Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
*/
additionalRoles?: string[];
/**
* Deprecated.
*/
authKey?: string;
/**
* Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
*/
deleted?: boolean;
/**
* The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
*/
domain?: string;
/**
* The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
*/
emailAddress?: string;
/**
* The ETag of the permission.
*/
etag?: string;
/**
* The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: - They can only be set on user and group permissions - The date must be in the future - The date cannot be more than a year in the future - The date can only be set on drive.permissions.update or drive.permissions.patch requests
*/
expirationDate?: string;
/**
* The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
*/
id?: string;
/**
* This is always drive#permission.
*/
kind?: string;
/**
* The name for this permission.
*/
name?: string;
/**
* 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<{
additionalRoles?: string[];
inherited?: boolean;
inheritedFrom?: string;
permissionType?: string;
role?: string;
}>;
/**
* A link to the profile photo, if available.
*/
photoLink?: string;
/**
* The primary role for this user. While new values may be supported in the future, the following are currently allowed: - owner - organizer - fileOrganizer - writer - reader
*/
role?: string;
/**
* A link back to this permission.
*/
selfLink?: string;
/**
* Deprecated - use permissionDetails instead.
*/
teamDrivePermissionDetails?: Array<{
additionalRoles?: string[];
inherited?: boolean;
inheritedFrom?: string;
role?: string;
teamDrivePermissionType?: string;
}>;
/**
* The account type. Allowed values are: - user - group - domain - anyone
*/
type?: string;
/**
* The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
*/
value?: string;
/**
* Whether the link is required for this permission.
*/
withLink?: boolean;
}
/**
* An ID for a user or group as seen in Permission items.
*/
interface Schema$PermissionId {
/**
* The permission ID.
*/
id?: string;
/**
* This is always drive#permissionId.
*/
kind?: string;
}
/**
* A list of permissions associated with a file.
*/
interface Schema$PermissionList {
/**
* The ETag of the list.
*/
etag?: string;
/**
* The list of permissions.
*/
items?: Schema$Permission[];
/**
* This is always drive#permissionList.
*/
kind?: string;
/**
* 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;
/**
* A link back to this list.
*/
selfLink?: string;
}
/**
* A key-value pair attached to a file that is either public or private to an application. The following limits apply to file properties: - Maximum of 100 properties total per file - Maximum of 30 private properties per app - Maximum of 30 public properties - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
*/
interface Schema$Property {
/**
* ETag of the property.
*/
etag?: string;
/**
* The key of this property.
*/
key?: string;
/**
* This is always drive#property.
*/
kind?: string;
/**
* The link back to this property.
*/
selfLink?: string;
/**
* The value of this property.
*/
value?: string;
/**
* The visibility of this property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE)
*/
visibility?: string;
}
/**
* A collection of properties, key-value pairs that are either public or private to an application.
*/
interface Schema$PropertyList {
/**
* The ETag o