@googleapis/drive
Version:
1,331 lines (1,322 loc) • 439 kB
text/typescript
// Copyright 2020 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.
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-empty-interface */
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable no-irregular-whitespace */
import {
OAuth2Client,
JWT,
Compute,
UserRefreshClient,
BaseExternalAccountClient,
GaxiosResponseWithHTTP2,
GoogleConfigurable,
createAPIRequest,
MethodOptions,
StreamMethodOptions,
GlobalOptions,
GoogleAuth,
BodyResponseCallback,
APIRequestContext,
} from 'googleapis-common';
import {Readable} from 'stream';
export 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;
/**
* 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('v3');
* ```
*/
export class Drive {
context: APIRequestContext;
about: Resource$About;
accessproposals: Resource$Accessproposals;
apps: Resource$Apps;
changes: Resource$Changes;
channels: Resource$Channels;
comments: Resource$Comments;
drives: Resource$Drives;
files: Resource$Files;
operations: Resource$Operations;
permissions: Resource$Permissions;
replies: Resource$Replies;
revisions: Resource$Revisions;
teamdrives: Resource$Teamdrives;
constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this.context = {
_options: options || {},
google,
};
this.about = new Resource$About(this.context);
this.accessproposals = new Resource$Accessproposals(this.context);
this.apps = new Resource$Apps(this.context);
this.changes = new Resource$Changes(this.context);
this.channels = new Resource$Channels(this.context);
this.comments = new Resource$Comments(this.context);
this.drives = new Resource$Drives(this.context);
this.files = new Resource$Files(this.context);
this.operations = new Resource$Operations(this.context);
this.permissions = new Resource$Permissions(this.context);
this.replies = new Resource$Replies(this.context);
this.revisions = new Resource$Revisions(this.context);
this.teamdrives = new Resource$Teamdrives(this.context);
}
}
/**
* 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. For users that are part of an organization with pooled storage, information about the limit and usage across all services is for the organization, rather than the individual user. 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;
}
/**
* The Access Proposal resource for outstanding access proposals on a file
*/
export interface Schema$AccessProposal {
/**
* The creation time
*/
createTime?: string | null;
/**
* The file id that the proposal for access is on
*/
fileId?: string | null;
/**
* The id of the access proposal
*/
proposalId?: string | null;
/**
* The email address of the user that will receive permissions if accepted
*/
recipientEmailAddress?: string | null;
/**
* The email address of the requesting user
*/
requesterEmailAddress?: string | null;
/**
* The message that the requester added to the proposal
*/
requestMessage?: string | null;
/**
* A wrapper for the role and view of an access proposal.
*/
rolesAndViews?: Schema$AccessProposalRoleAndView[];
}
/**
* A wrapper for the role and view of an access proposal.
*/
export interface Schema$AccessProposalRoleAndView {
/**
* The role that was proposed by the requester New values may be added in the future, but the following are currently possible: * `writer` * `commenter` * `reader`
*/
role?: string | null;
/**
* Indicates the view for this access proposal. Only populated for proposals that belong to a view. `published` is the only supported value.
*/
view?: string | null;
}
/**
* The `apps` resource provides a list of apps that a user has installed, with information about each app's supported MIME types, file extensions, and other details. Some resource methods (such as `apps.get`) require an `appId`. Use the `apps.list` method to retrieve the ID for an installed application.
*/
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 file with this app in a given folder. The template contains the {folderId\} to be replaced by the folder ID house the new file.
*/
createInFolderTemplate?: string | null;
/**
* The URL to create a 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?: Schema$AppIcons[];
/**
* The ID of the app.
*/
id?: string | null;
/**
* Whether the app is installed.
*/
installed?: boolean | null;
/**
* Output only. Identifies what kind of resource this is. Value: the fixed string "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 such as a Chart. If empty, the app name should be used instead.
*/
objectType?: string | null;
/**
* The template URL for opening files with this app. The template contains {ids\} or {exportIds\} to be replaced by the actual file IDs. For more information, 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 objects.
*/
supportsCreate?: boolean | null;
/**
* Whether this app supports importing from Google Docs.
*/
supportsImport?: boolean | null;
/**
* Whether this app supports opening more than one file.
*/
supportsMultiOpen?: boolean | null;
/**
* Whether this app supports creating files when offline.
*/
supportsOfflineCreate?: boolean | null;
/**
* Whether the app is selected as the default handler for the types it supports.
*/
useByDefault?: boolean | null;
}
export interface Schema$AppIcons {
/**
* Category of the icon. Allowed values are: * `application` - The icon for the application. * `document` - The icon for a file associated with the app. * `documentShared` - The icon for a shared file associated with the app.
*/
category?: string | null;
/**
* URL for the icon.
*/
iconUrl?: string | null;
/**
* Size of the icon. Represented as the maximum of the width and height.
*/
size?: number | null;
}
/**
* A list of third-party applications which the user has installed or given access to Google Drive.
*/
export interface Schema$AppList {
/**
* The 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 list of apps.
*/
items?: Schema$App[];
/**
* Output only. Identifies what kind of resource this is. Value: the fixed string "drive#appList".
*/
kind?: string | null;
/**
* A link back to this list.
*/
selfLink?: string | null;
}
/**
* 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. The page token doesn't expire.
*/
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. The page token doesn't expire.
*/
nextPageToken?: 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. Valid values are "web_hook" or "webhook".
*/
type?: string | null;
}
/**
* A comment on a file. Some resource methods (such as `comments.update`) require a `commentId`. Use the `comments.list` method to retrieve the ID for a comment in a file.
*/
export interface Schema$Comment {
/**
* A region of the document represented as a JSON string. For details on defining anchor properties, refer to [Manage comments and replies](https://developers.google.com/workspace/drive/api/v3/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;
/**
* 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;
/**
* Output only. Whether the comment has been deleted. A deleted comment has no content.
*/
deleted?: boolean | null;
/**
* Output only. The content of the comment with HTML formatting.
*/
htmlContent?: string | null;
/**
* Output only. The ID of the comment.
*/
id?: string | null;
/**
* Output only. 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;
/**
* Output only. The full list of replies to the comment in chronological order.
*/
replies?: Schema$Reply[];
/**
* Output only. 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. The page token is typically valid for several hours. However, if new items are added or removed, your expected results might differ.
*/
nextPageToken?: 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.
*/
restrictionTime?: string | null;
/**
* Output only. Whether the content restriction was applied by the system, for example due to an esignature. Users cannot modify or remove system restricted content restrictions.
*/
systemRestricted?: boolean | null;
/**
* Output only. The type of the content restriction. Currently the only possible value is `globalContentRestriction`.
*/
type?: string | null;
}
/**
* A restriction for copy and download of the file.
*/
export interface Schema$DownloadRestriction {
/**
* Whether download and copy is restricted for readers.
*/
restrictedForReaders?: boolean | null;
/**
* Whether download and copy is restricted for writers. If true, download is also restricted for readers.
*/
restrictedForWriters?: boolean | null;
}
/**
* Download restrictions applied to the file.
*/
export interface Schema$DownloadRestrictionsMetadata {
/**
* Output only. The effective download restriction applied to this file. This considers all restriction settings and DLP rules.
*/
effectiveDownloadRestrictionWithContext?: Schema$DownloadRestriction;
/**
* The download restriction of the file applied directly by the owner or organizer. This does not take into account shared drive settings or DLP rules.
*/
itemDownloadRestriction?: Schema$DownloadRestriction;
}
/**
* Representation of a shared drive. Some resource methods (such as `drives.update`) require a `driveId`. Use the `drives.list` method to retrieve the ID for 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;
canChangeDownloadRestriction?: 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).
*/
createdTime?: 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. 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;
/**
* 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. Note that restrictions can't be set when creating a shared drive. To add a restriction, first create a shared drive and then use `drives.update` to add restrictions.
*/
restrictions?: {
adminManagedRestrictions?: boolean;
copyRequiresWriterPermission?: boolean;
domainUsersOnly?: boolean;
downloadRestriction?: Schema$DownloadRestriction;
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.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. The page token is typically valid for several hours. However, if new items are added or removed, your expected results might differ.
*/
nextPageToken?: string | null;
}
/**
* The metadata for a file. Some resource methods (such as `files.update`) require a `fileId`. Use the `files.list` method to retrieve the ID 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;
/**
* 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;
canChangeItemDownloadRestriction?: boolean;
canChangeSecurityUpdateEnabled?: boolean;
canChangeViewersCanCopyContent?: boolean;
canComment?: boolean;
canCopy?: boolean;
canDelete?: boolean;
canDeleteChildren?: boolean;
canDisableInheritedPermissions?: boolean;
canDownload?: boolean;
canEdit?: boolean;
canEnableInheritedPermissions?: 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;
/**
* 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;
/**
* Download restrictions applied on the file.
*/
downloadRestrictions?: Schema$DownloadRestrictionsMetadata;
/**
* Output only. ID of the shared drive the file resides in. Only populated for items in shared drives.
*/
driveId?: string | null;
/**
* Output only. Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
*/
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`. This is only available for files with binary content in Google Drive.
*/
fileExtension?: string | null;
/**
* The color for a folder or a shortcut to 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 is used instead.
*/
folderColorRgb?: string | null;
/**
* Output only. 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;
/**
* 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 is currently only available for files with binary content in Google Drive.
*/
headRevisionId?: string | null;
/**
* Output only. A static, unauthenticated link to the file's icon.
*/
iconLink?: string | null;
/**
* The ID of the file.
*/
id?: string | null;
/**
* Output only. 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 this file has inherited permissions disabled. Inherited permissions are enabled by default.
*/
inheritedPermissionsDisabled?: boolean | null;
/**
* Output only. Whether the file was created or opened by the requesting app.
*/
isAppAuthorized?: boolean | null;
/**
* Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#file"`.
*/
kind?: string | null;
/**
* Output only. An overview of the labels on the file.
*/
labelInfo?: {labels?: Schema$Label[]} | null;
/**
* Output only. The last user to modify the file. This field is only populated when the last modification was performed by a signed-in user.
*/
lastModifyingUser?: Schema$User;
/**
* Contains details about the link URLs that clients are using to refer to this item.
*/
linkShareMetadata?: {
securityUpdateEligible?: boolean;
securityUpdateEnabled?: boolean;
} | null;
/**
* Output only. 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 attempts 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 is imported, if possible. The supported import formats are published in the About resource.
*/
mimeType?: string | null;
/**
* Output only. 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;
/**
* he 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;
/**
* Output only. Whether the user owns the file. Not populated for items in shared drives.
*/
ownedByMe?: boolean | 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[];
/**
* The ID of the parent folder containing the file. A file can only have one parent folder; specifying multiple parents isn't supported. If not specified as part of a create request, the file is placed directly in the user's My Drive folder. If not specified as part of a copy request, the file inherits any discoverable parent of the source file. Update requests must use the `addParents` and `removeParents` parameters to modify the parents list.
*/
parents?: string[] | null;
/**
* Output only. List of permission IDs for users with access to this file.
*/
permissionIds?: string[] | null;
/**
* Output only. 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;
/**
* Output only. 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;
/**
* Output only. A key needed to access the item via a shared link.
*/
resourceKey?: 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. 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;
/**
* Output only. 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`. Can only be set on `files.create` requests.
*/
shortcutDetails?: {
targetId?: string;
targetMimeType?: string;
targetResourceKey?: 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.
*/
size?: string | null;
/**
* Output only. 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: Output only. Use `driveId` instead.
*/
teamDriveId?: string | null;
/**
* Output only. A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Not intended for direct usage on web applications due to [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) policies, consider using a proxy server. 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;
/**
* Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
*/
trashed?: boolean | null;
/**
* The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.
*/
trashedTime?: 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. 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;
/**
* Output only. Additional metadata about video media. This may not be available immediately upon upload.
*/
videoMediaMetadata?: {
durationMillis?: string;
height?: number;
width?: number;
} | null;
/**
* Output only. 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;
/**
* Output only. 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;
/**
* Output only. 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 might be missing, since all documents were not searched. This can occur when searching multiple drives with the 'allDrives' corpora, but all corpora couldn't be searched. When this happens, it's 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. The page token is typically valid for several hours. However, if new items are added or removed, your expected results might differ.
*/
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;
}
/**
* Representation of 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;
/**
* This is always drive#label
*/
kind?: string | null;
/**
* The revision ID of the label.
*/
revisionId?: string | null;
}
/**
* Representation of field, which is a typed key-value pair.
*/
export interface Schema$LabelField {
/**
* Only present if valueType is dateString. RFC 3339 formatted date: YYYY-MM-DD.
*/
dateString?: string[] | null;
/**
* The identifier of this label field.
*/
id?: string | null;
/**
* Only present if `valueType` is `integer`.
*/
integer?: string[] | null;
/**
* This is always drive#labelField.
*/
kind?: string | null;
/**
* Only present if `valueType` is `selection`
*/
selection?: string[] | null;
/**
* Only present if `valueType` is `text`.
*/
text?: string[] | null;
/**
* Only present if `valueType` is `user`.
*/
user?: Schema$User[];
/**
* The field type. While new values may be supported in the future, the following are currently allowed: * `dateString` * `integer` * `selection` * `text` * `user`
*/
valueType?: string | null;
}
/**
* A modification to a label's field.
*/
export interface Schema$LabelFieldModification {
/**
* The ID of the field to be modified.
*/
fieldId?: string | null;
/**
* This is always drive#labelFieldModification.
*/
kind?: string | null;
/**
* Replaces the value of a dateString Field with these new values. The string must be in the RFC 3339 full-date format: YYYY-MM-DD.
*/
setDateValues?: string[] | null;
/**
* Replaces the value of an `integer` field with these new values.
*/
setIntegerValues?: string[] | null;
/**
* Replaces a `selection` field with these new values.
*/
setSelectionValues?: string[] | null;
/**
* Sets the value of a `text` field.
*/
setTextValues?: string[] | null;
/**
* Replaces a `user` field with these new values. The values must be valid email addresses.
*/
setUserValues?: string[] | null;
/**
* Unsets the values for this field.
*/
unsetValues?: boolean | null;
}
/**
* A list of labels applied to a file.
*/
export interface Schema$LabelList {
/**
* This is always drive#labelList
*/
kind?: string | null;
/**
* The list of labels.
*/
labels?: Schema$Label[];
/**
* The page token for the next page of labels. This field 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. The page token is typically valid for several hours. However, if new items are added or removed, your expected results might differ.
*/
nextPageToken?: string | null;
}
/**
* A modification to a label on a file. A LabelModification can be used to apply a label to a file, update an existing label on a file, or remove a label from a file.
*/
export interface Schema$LabelModification {
/**
* The list of modifications to this label's fields.
*/
fieldModifications?: Schema$LabelFieldModification[];
/**
* This is always drive#labelModification.
*/
kind?: string | null;
/**
* The ID of the label to modify.
*/
labelId?: string | null;
/**
* If true, the label will be removed from the file.
*/
removeLabel?: boolean | null;
}
/**
* The response to an Access Proposal list request.
*/
export interface Schema$ListAccessProposalsResponse {
/**
* The list of Access Proposals. This field is only populated in v3 and v3beta.
*/
accessProposals?: Schema$AccessProposal[];
/**
* The continuation token for the next page of results. This will be absent if the end of the results 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 request to modify the set of labels on a file. This request may contain many modifications that will either all succeed or all fail atomically.
*/
export interface Schema$ModifyLabelsRequest {
/**
* This is always drive#modifyLabelsRequest.
*/
kind?: string | null;
/**
* The list of modifications to apply to the labels on the file.
*/
labelModifications?: Schema$LabelModification[];
}
/**
* Response to a ModifyLabels request. This contains only those labels which were added or updated by the request.
*/
export interface Schema$ModifyLabelsResponse {
/**
* This is always drive#modifyLabelsResponse
*/
kind?: string | null;
/**
* The list of labels which were added or updated by the request.
*/
modifiedLabels?: Schema$Label[];
}
/**
* This resource represents a long-running operation that is the result of a network API call.
*/
export interface Schema$Operation {
/**
* If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
*/
done?: boolean | null;
/**
* The error result of the operation in case of failure or cancellation.
*/
error?: Schema$Status;
/**
* Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
*/
metadata?: {[key: string]: any} | null;
/**
* The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id\}`.
*/
name?: string | null;
/**
* The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
*/
response?: {[key: string]: any} | null;
}
/**
* A p