googleapis
Version:
Google APIs Client Library for Node.js
1,311 lines • 221 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_v2 {
export interface Options extends GlobalOptions {
version: 'v2';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient | BaseExternalAccountClient | GoogleAuth;
/**
* V1 error format.
*/
'$.xgafv'?: string;
/**
* OAuth access token.
*/
access_token?: string;
/**
* Data format for response.
*/
alt?: string;
/**
* JSONP
*/
callback?: 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;
/**
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
*/
quotaUser?: string;
/**
* Legacy upload protocol for media (e.g. "media", "multipart").
*/
uploadType?: string;
/**
* Upload protocol for media (e.g. "raw", "multipart").
*/
upload_protocol?: string;
}
/**
* Google Drive API
*
* The Google Drive API allows clients to access resources from Google Drive.
*
* @example
* ```js
* const {google} = require('googleapis');
* const drive = google.drive('v2');
* ```
*/
export 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;
replies: Resource$Replies;
revisions: Resource$Revisions;
teamdrives: Resource$Teamdrives;
constructor(options: GlobalOptions, google?: GoogleConfigurable);
}
/**
* An item with user information and settings.
*/
export 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;
}> | null;
/**
* Whether the user can create shared drives.
*/
canCreateDrives?: boolean | null;
/**
* Deprecated: Use `canCreateDrives` instead.
*/
canCreateTeamDrives?: boolean | null;
/**
* The domain sharing policy for the current user. Possible values are: * `allowed` * `allowedWithWarning` * `incomingOnly` * `disallowed`
*/
domainSharingPolicy?: string | null;
/**
* A list of themes that are supported for shared drives.
*/
driveThemes?: Array<{
backgroundImageLink?: string;
colorRgb?: string;
id?: string;
}> | null;
/**
* The ETag of the item.
*/
etag?: string | null;
/**
* The allowable export formats.
*/
exportFormats?: Array<{
source?: string;
targets?: string[];
}> | null;
/**
* List of additional features enabled on this account.
*/
features?: Array<{
featureName?: string;
featureRate?: number;
}> | null;
/**
* The palette of allowable folder colors as RGB hex strings.
*/
folderColorPalette?: string[] | null;
/**
* The allowable import formats.
*/
importFormats?: Array<{
source?: string;
targets?: string[];
}> | null;
/**
* A boolean indicating whether the authenticated app is installed by the authenticated user.
*/
isCurrentAppInstalled?: boolean | null;
/**
* This is always `drive#about`.
*/
kind?: string | null;
/**
* 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 | null;
/**
* The largest change id.
*/
largestChangeId?: string | null;
/**
* List of max upload sizes for each file type. The most specific type takes precedence.
*/
maxUploadSizes?: Array<{
size?: string;
type?: string;
}> | null;
/**
* The name of the current user.
*/
name?: string | null;
/**
* The current user's ID as visible in the permissions collection.
*/
permissionId?: string | null;
/**
* The amount of storage quota used by different Google services.
*/
quotaBytesByService?: Array<{
bytesUsed?: string;
serviceName?: string;
}> | null;
/**
* The total number of quota bytes. This is only relevant when quotaType is LIMITED.
*/
quotaBytesTotal?: string | null;
/**
* The number of quota bytes used by Google Drive.
*/
quotaBytesUsed?: string | null;
/**
* The number of quota bytes used by all Google apps (Drive, Picasa, etc.).
*/
quotaBytesUsedAggregate?: string | null;
/**
* The number of quota bytes used by trashed items.
*/
quotaBytesUsedInTrash?: string | null;
/**
* The type of the user's storage quota. Possible values are: * `LIMITED` * `UNLIMITED`
*/
quotaType?: string | null;
/**
* The number of remaining change ids, limited to no more than 2500.
*/
remainingChangeIds?: string | null;
/**
* The id of the root folder.
*/
rootFolderId?: string | null;
/**
* A link back to this item.
*/
selfLink?: string | null;
/**
* Deprecated: Use `driveThemes` instead.
*/
teamDriveThemes?: Array<{
backgroundImageLink?: string;
colorRgb?: string;
id?: string;
}> | null;
/**
* 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.
*/
export interface Schema$App {
/**
* Whether the app is authorized to access data on the user's Drive.
*/
authorized?: boolean | null;
/**
* 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 | null;
/**
* The url to create a new file with this app.
*/
createUrl?: string | null;
/**
* Whether the app has drive-wide scope. An app with drive-wide scope can access all files in the user's drive.
*/
hasDriveWideScope?: boolean | null;
/**
* The various icons for the app.
*/
icons?: Array<{
category?: string;
iconUrl?: string;
size?: number;
}> | null;
/**
* The ID of the app.
*/
id?: string | null;
/**
* Whether the app is installed.
*/
installed?: boolean | null;
/**
* This is always `drive#app`.
*/
kind?: string | null;
/**
* A long description of the app.
*/
longDescription?: string | null;
/**
* The name of the app.
*/
name?: string | null;
/**
* The type of object this app creates (e.g. Chart). If empty, the app name should be used instead.
*/
objectType?: string | null;
/**
* 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 | null;
/**
* The list of primary file extensions.
*/
primaryFileExtensions?: string[] | null;
/**
* The list of primary mime types.
*/
primaryMimeTypes?: string[] | null;
/**
* The ID of the product listing for this app.
*/
productId?: string | null;
/**
* A link to the product listing for this app.
*/
productUrl?: string | null;
/**
* The list of secondary file extensions.
*/
secondaryFileExtensions?: string[] | null;
/**
* The list of secondary mime types.
*/
secondaryMimeTypes?: string[] | null;
/**
* A short description of the app.
*/
shortDescription?: string | null;
/**
* Whether this app supports creating new objects.
*/
supportsCreate?: boolean | null;
/**
* Whether this app supports importing from Docs Editors.
*/
supportsImport?: boolean | null;
/**
* Whether this app supports opening more than one file.
*/
supportsMultiOpen?: boolean | null;
/**
* Whether this app supports creating new files when offline.
*/
supportsOfflineCreate?: boolean | null;
/**
* Whether the app is selected as the default handler for the types it supports.
*/
useByDefault?: boolean | null;
}
/**
* A list of third-party applications which the user has installed or given access to Google Drive.
*/
export 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[] | null;
/**
* The ETag of the list.
*/
etag?: string | null;
/**
* The list of apps.
*/
items?: Schema$App[];
/**
* This is always `drive#appList`.
*/
kind?: string | null;
/**
* A link back to this list.
*/
selfLink?: string | null;
}
/**
* Representation of 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;
/**
* Whether the file or shared drive has been removed from this list of changes, for example by deletion or loss of access.
*/
deleted?: boolean | 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 associated with this change.
*/
fileId?: string | null;
/**
* The ID of the change.
*/
id?: string | null;
/**
* This is always `drive#change`.
*/
kind?: string | null;
/**
* The time of this modification.
*/
modificationDate?: string | null;
/**
* A link back to this change.
*/
selfLink?: string | null;
/**
* Deprecated: Use `drive` instead.
*/
teamDrive?: Schema$TeamDrive;
/**
* Deprecated: Use `driveId` instead.
*/
teamDriveId?: string | null;
/**
* Deprecated: Use `changeType` instead.
*/
type?: string | null;
}
/**
* A list of changes for a user.
*/
export interface Schema$ChangeList {
/**
* The ETag of the list.
*/
etag?: string | null;
/**
* 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 | null;
/**
* The current largest change ID.
*/
largestChangeId?: 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;
/**
* A link to the next page of changes.
*/
nextLink?: 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;
/**
* A link back to this list.
*/
selfLink?: string | null;
}
/**
* A 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.
*/
type?: string | null;
}
/**
* A list of children of a file.
*/
export interface Schema$ChildList {
/**
* The ETag of the list.
*/
etag?: string | null;
/**
* 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 | null;
/**
* A link to the next page of children.
*/
nextLink?: string | null;
/**
* 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 | null;
/**
* A link back to this list.
*/
selfLink?: string | null;
}
/**
* A reference to a folder's child.
*/
export interface Schema$ChildReference {
/**
* Output only. A link to the child.
*/
childLink?: string | null;
/**
* The ID of the child.
*/
id?: string | null;
/**
* Output only. This is always `drive#childReference`.
*/
kind?: string | null;
/**
* Output only. A link back to this reference.
*/
selfLink?: string | null;
}
/**
* A comment on a file in Google Drive.
*/
export interface Schema$Comment {
/**
* A region of the document represented as a JSON string. For details on defining anchor properties, refer to [Add comments and replies](https://developers.google.com/drive/api/v2/manage-comments).
*/
anchor?: string | null;
/**
* Output only. The author of the comment. The author's email address and permission ID will not be populated.
*/
author?: Schema$User;
/**
* Output only. The ID of the comment.
*/
commentId?: string | null;
/**
* 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 | null;
/**
* The context of the file which is being commented on.
*/
context?: {
type?: string;
value?: string;
} | null;
/**
* The date when this comment was first created.
*/
createdDate?: string | null;
/**
* Output only. 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 | null;
/**
* Output only. The file which this comment is addressing.
*/
fileId?: string | null;
/**
* Output only. The title of the file which this comment is addressing.
*/
fileTitle?: string | null;
/**
* Output only. HTML formatted content for this comment.
*/
htmlContent?: string | null;
/**
* Output only. This is always `drive#comment`.
*/
kind?: string | null;
/**
* The date when this comment or any of its replies were last modified.
*/
modifiedDate?: string | null;
/**
* Output only. Replies to this post.
*/
replies?: Schema$CommentReply[];
/**
* Output only. A link back to this comment.
*/
selfLink?: string | null;
/**
* Output only. 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 | null;
}
/**
* A list of comments on a file in Google Drive.
*/
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.
*/
items?: Schema$Comment[];
/**
* This is always `drive#commentList`.
*/
kind?: string | null;
/**
* A link to the next page of comments.
*/
nextLink?: 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 link back to this list.
*/
selfLink?: string | null;
}
/**
* A comment on a file in Google Drive.
*/
export interface Schema$CommentReply {
/**
* Output only. The author of the reply. The author's email address and permission ID will not be populated.
*/
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 | null;
/**
* The date when this reply was first created.
*/
createdDate?: string | null;
/**
* Output only. 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 | null;
/**
* Output only. HTML formatted content for this reply.
*/
htmlContent?: string | null;
/**
* Output only. This is always `drive#commentReply`.
*/
kind?: string | null;
/**
* The date when this reply was last modified.
*/
modifiedDate?: string | null;
/**
* Output only. The ID of the reply.
*/
replyId?: string | null;
/**
* 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 | null;
}
/**
* A list of replies to a comment on a file in Google Drive.
*/
export 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 | null;
/**
* A link to the next page of replies.
*/
nextLink?: 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;
/**
* A link back to this list.
*/
selfLink?: string | null;
}
/**
* A restriction for accessing the content of the file.
*/
export interface Schema$ContentRestriction {
/**
* Whether the content restriction can only be modified or removed by a user who owns the file. For files in shared drives, any user with `organizer` capabilities can modify or remove this content restriction.
*/
ownerRestricted?: boolean | null;
/**
* 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;
/**
* Output only. 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.
*/
restrictionDate?: string | null;
/**
* Output only. 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;
/**
* Output only. A short-lived link to this shared drive's background image.
*/
backgroundImageLink?: string | null;
/**
* Output only. Capabilities the current user has on this shared drive.
*/
capabilities?: {
canAddChildren?: boolean;
canChangeCopyRequiresWriterPermissionRestriction?: boolean;
canChangeDomainUsersOnlyRestriction?: boolean;
canChangeDriveBackground?: boolean;
canChangeDriveMembersOnlyRestriction?: boolean;
canChangeSharingFoldersRequiresOrganizerPermissionRestriction?: boolean;
canComment?: boolean;
canCopy?: boolean;
canDeleteChildren?: boolean;
canDeleteDrive?: boolean;
canDownload?: boolean;
canEdit?: boolean;
canListChildren?: boolean;
canManageMembers?: boolean;
canReadRevisions?: boolean;
canRename?: boolean;
canRenameDrive?: boolean;
canResetDriveRestrictions?: 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).
*/
createdDate?: string | null;
/**
* Whether the shared drive is hidden from default view.
*/
hidden?: boolean | null;
/**
* Output only. The ID of this shared drive which is also the ID of the top level folder of this shared drive.
*/
id?: string | null;
/**
* Output only. This is always `drive#drive`
*/
kind?: string | null;
/**
* The name of this shared drive.
*/
name?: string | null;
/**
* 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`.
*/
orgUnitId?: 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;
sharingFoldersRequiresOrganizerPermission?: 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.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 | 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.
*/
items?: Schema$Drive[];
/**
* This is always `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 {
/**
* Output only. A link for opening the file in a relevant Google editor or viewer.
*/
alternateLink?: string | null;
/**
* Output only. Whether this file is in the Application Data folder.
*/
appDataContents?: boolean | null;
/**
* Output only. Deprecated: Use `capabilities/canComment` instead.
*/
canComment?: boolean | null;
/**
* Output only. Deprecated: Use `capabilities/canReadRevisions` instead.
*/
canReadRevisions?: boolean | null;
/**
* Output only. Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
*/
capabilities?: {
canAcceptOwnership?: boolean;
canAddChildren?: boolean;
canAddFolderFromAnotherDrive?: boolean;
canAddMyDriveParent?: boolean;
canChangeCopyRequiresWriterPermission?: boolean;
canChangeRestrictedDownload?: boolean;
canChangeSecurityUpdateEnabled?: boolean;
canComment?: boolean;
canCopy?: boolean;
canDelete?: boolean;
canDeleteChildren?: boolean;
canDownload?: boolean;
canEdit?: boolean;
canListChildren?: boolean;
canModifyContent?: boolean;
canModifyContentRestriction?: boolean;
canModifyEditorContentRestriction?: boolean;
canModifyLabels?: boolean;
canModifyOwnerContentRestriction?: boolean;
canMoveChildrenOutOfDrive?: boolean;
canMoveChildrenOutOfTeamDrive?: boolean;
canMoveChildrenWithinDrive?: boolean;
canMoveChildrenWithinTeamDrive?: boolean;
canMoveItemIntoTeamDrive?: boolean;
canMoveItemOutOfDrive?: boolean;
canMoveItemOutOfTeamDrive?: boolean;
canMoveItemWithinDrive?: boolean;
canMoveItemWithinTeamDrive?: boolean;
canMoveTeamDriveItem?: boolean;
canReadDrive?: boolean;
canReadLabels?: boolean;
canReadRevisions?: boolean;
canReadTeamDrive?: boolean;
canRemoveChildren?: boolean;
canRemoveContentRestriction?: boolean;
canRemoveMyDriveParent?: boolean;
canRename?: boolean;
canShare?: boolean;
canTrash?: boolean;
canTrashChildren?: boolean;
canUntrash?: boolean;
} | null;
/**
* Restrictions for accessing the content of the file. Only populated if such a restriction exists.
*/
contentRestrictions?: Schema$ContentRestriction[];
/**
* Output only. Deprecated: Use `capabilities/canCopy` instead.
*/
copyable?: boolean | null;
/**
* Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
*/
copyRequiresWriterPermission?: boolean | null;
/**
* Create time for this file (formatted RFC 3339 timestamp).
*/
createdDate?: string | null;
/**
* Output only. 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 | null;
/**
* A short description of the file.
*/
description?: string | null;
/**
* Output only. 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 | null;
/**
* Output only. ID of the shared drive the file resides in. Only populated for items in shared drives.
*/
driveId?: string | null;
/**
* Output only. Deprecated: Use `capabilities/canEdit` instead.
*/
editable?: boolean | null;
/**
* Output only. A link for embedding the file.
*/
embedLink?: string | null;
/**
* Output only. ETag of the file.
*/
etag?: string | null;
/**
* Output only. Whether this file has been explicitly trashed, as opposed to recursively trashed.
*/
explicitlyTrashed?: boolean | null;
/**
* Output only. Links for exporting Docs Editors files to specific formats.
*/
exportLinks?: {
[key: string]: string;
} | null;
/**
* Output only. 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 Docs Editors or shortcut files.
*/
fileExtension?: string | null;
/**
* Output only. Size in bytes of blobs and first party editor files. Won't be populated for files that have no size, like shortcuts and folders.
*/
fileSize?: string | null;
/**
* Folder color as an RGB hex string if the file is a folder or a shortcut to 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.
*/
folderColorRgb?: string | null;
/**
* Output only. 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 Docs Editors or shortcut files.
*/
fullFileExtension?: string | null;
/**
* Output only. Whether there are permissions directly on this file. This field is only populated for items in shared drives.
*/
hasAugmentedPermissions?: boolean | null;
/**
* Output only. 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;
/**
* Output only. 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 Docs Editors or shortcut files.
*/
headRevisionId?: string | null;
/**
* Output only. A link to the file's icon.
*/
iconLink?: string | null;
/**
* The ID of the file.
*/
id?: string | null;
/**
* Output only. 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;
} | null;
/**
* Indexable text attributes for the file (can only be written)
*/
indexableText?: {
text?: string;
} | null;
/**
* Output only. Whether the file was created or opened by the requesting app.
*/
isAppAuthorized?: boolean | null;
/**
* Output only. The type of file. This is always `drive#file`.
*/
kind?: string | null;
/**
* Output only. An overview of the labels on the file.
*/
labelInfo?: {
labels?: Schema$Label[];
} | null;
/**
* A group of labels for the file.
*/
labels?: {
hidden?: boolean;
modified?: boolean;
restricted?: boolean;
starred?: boolean;
trashed?: boolean;
viewed?: boolean;
} | null;
/**
* Output only. The last user to modify this file.
*/
lastModifyingUser?: Schema$User;
/**
* Output only. Name of the last user to modify this file.
*/
lastModifyingUserName?: string | null;
/**
* Last time this file was viewed by the user (formatted RFC 3339 timestamp).
*/
lastViewedByMeDate?: string | null;
/**
* Contains details about the link URLs that clients are using to refer to this item.
*/
linkShareMetadata?: {
securityUpdateEligible?: boolean;
securityUpdateEnabled?: boolean;
} | null;
/**
* Deprecated.
*/
markedViewedByMeDate?: string | null;
/**
* Output only. 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 Docs Editors or shortcut files.
*/
md5Checksum?: string | null;
/**
* 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 | null;
/**
* 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 | null;
/**
* 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 | null;
/**
* Output only. 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;
} | null;
/**
* 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 | null;
/**
* Output only. Whether the file is owned by the current user. Not populated for items in shared drives.
*/
ownedByMe?: boolean | null;
/**
* Output only. Name(s) of the owner(s) of this file. Not populated for items in shared drives.
*/
ownerNames?: string[] | null;
/**
* Output only. The owner of this file. Only certain legacy files may have more than one owner. This field isn't 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[];
/**
* Output only. List of permission IDs for users with access to this file.
*/
permissionIds?: string[] | null;
/**
* Output only. 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[];
/**
* Output only. The number of quota bytes used by this file.
*/
quotaBytesUsed?: string | null;
/**
* Output only. A key needed to access the item via a shared link.
*/
resourceKey?: string | null;
/**
* Output only. A link back to this file.
*/
selfLink?: string | null;
/**
* Output only. The SHA1 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.
*/
sha1Checksum?: string | null;
/**
* Output only. The SHA256 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.
*/
sha256Checksum?: string | null;
/**
* Output only. Deprecated: Use `capabilities/canShare` instead.
*/
shareable?: boolean | null;
/**
* Output only. Whether the file has been shared. Not populated for items in shared drives.
*/
shared?: boolean | null;
/**
* Time at which this file was shared with the user (formatted RFC 3339 timestamp).
*/
sharedWithMeDate?: string | null;
/**
* Output only. User that shared the item with the current user, if available.
*/
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;
targetResourceKey?: string;
} | null;
/**
* Output only. The list of spaces which contain the file. Supported values are `drive`, `appDataFolder` and `photos`.
*/
spaces?: string[] | null;
/**
* Output only. Deprecated: Use `driveId` instead.
*/
teamDriveId?: string | null;
/**
* A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated.
*/
thumbnail?: {
image?: string;
mimeType?: string;
} | null;
/**
* Output only. 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;
/**
* Output only. The thumbnail version for use in thumbnail cache invalidation.
*/
thumbnailVersion?: string | null;
/**
* 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 | null;
/**
* The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives.
*/
trashedDate?: string | null;
/**
* Output only. If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives.
*/
trashingUser?: Schema$User;
/**
* Output only. The permissions for the authenticated user on this file.
*/
userPermission?: Schema$Permission;
/**
* Output only. 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 | null;
/**
* Output only. Metadata about video media. This will only be present for video types.
*/
videoMediaMetadata?: {
durationMillis?: string;
height?: number;
width?: number;
} | null;
/**
* Output only. 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 | null;
/**
* Output only. 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 | null;
/**
* Whether writers can share the document with other users. Not populated for items in shared drives.
*/
writersCanShare?: boolean | null;
}
/**
* A list of files.
*/
export interface Schema$FileList {
/**
* The ETag of the list.
*/
etag?: string | null;
/**
* 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 | null;
/**
* 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 | null;
/**
* A link to the next page of files.
*/
nextLink?: 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 link back to this list.
*/
selfLink?: string | null;
}
/**
* A list of generated IDs which can be provided in insert requests
*/
export interface Schema$GeneratedIds {
/**
* The IDs generated for the requesting user in the specified space.
*/
ids?: string[] | null;
/**
* This is always `drive#generatedIds`
*/
kind?: string | null;
/**
* The type of file that can be created with these IDs.
*/
space?: string | null;
}
/**
* Representation of a label and label fields.
*/
export interface Schema$Label {
/**
* A map of the fields on the label, keyed by the field's ID.
*/
fields?: {
[key: string]: Schema$LabelField;
} | null;
/**
* The ID of the label.
*/
id?: string | null;
/**
* T