Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

File

import type { File } from "https://googleapis.deno.dev/v1/drive:v3.ts";

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.

interface File {
appProperties?: {
[key: string]: string;
}
;
capabilities?: {
canAcceptOwnership?: boolean;
canAddChildren?: boolean;
canAddFolderFromAnotherDrive?: boolean;
canAddMyDriveParent?: boolean;
canChangeCopyRequiresWriterPermission?: boolean;
canChangeSecurityUpdateEnabled?: boolean;
canChangeViewersCanCopyContent?: 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;
}
;
contentHints?: {
indexableText?: string;
thumbnail?: {
image?: Uint8Array;
mimeType?: string;
}
;
}
;
contentRestrictions?: ContentRestriction[];
copyRequiresWriterPermission?: boolean;
createdTime?: Date;
description?: string;
driveId?: string;
explicitlyTrashed?: boolean;
readonly exportLinks?: {
[key: string]: string;
}
;
fileExtension?: string;
folderColorRgb?: string;
fullFileExtension?: string;
hasAugmentedPermissions?: boolean;
hasThumbnail?: boolean;
headRevisionId?: string;
iconLink?: string;
id?: string;
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;
}
;
isAppAuthorized?: boolean;
kind?: string;
labelInfo?: {
labels?: Label[];
}
;
lastModifyingUser?: User;
linkShareMetadata?: {
securityUpdateEligible?: boolean;
securityUpdateEnabled?: boolean;
}
;
md5Checksum?: string;
mimeType?: string;
modifiedByMe?: boolean;
modifiedByMeTime?: Date;
modifiedTime?: Date;
name?: string;
originalFilename?: string;
ownedByMe?: boolean;
owners?: User[];
parents?: string[];
permissionIds?: string[];
permissions?: Permission[];
properties?: {
[key: string]: string;
}
;
quotaBytesUsed?: bigint;
resourceKey?: string;
sha1Checksum?: string;
sha256Checksum?: string;
shared?: boolean;
sharedWithMeTime?: Date;
sharingUser?: User;
shortcutDetails?: {
targetId?: string;
targetMimeType?: string;
targetResourceKey?: string;
}
;
size?: bigint;
spaces?: string[];
starred?: boolean;
teamDriveId?: string;
thumbnailLink?: string;
thumbnailVersion?: bigint;
trashed?: boolean;
trashedTime?: Date;
trashingUser?: User;
version?: bigint;
videoMediaMetadata?: {
durationMillis?: bigint;
height?: number;
width?: number;
}
;
viewedByMe?: boolean;
viewedByMeTime?: Date;
viewersCanCopyContent?: boolean;
webContentLink?: string;
webViewLink?: string;
writersCanShare?: boolean;
}

§Properties

§
appProperties?: {
[key: string]: string;
}
[src]

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.

§
capabilities?: {
canAcceptOwnership?: boolean;
canAddChildren?: boolean;
canAddFolderFromAnotherDrive?: boolean;
canAddMyDriveParent?: boolean;
canChangeCopyRequiresWriterPermission?: boolean;
canChangeSecurityUpdateEnabled?: boolean;
canChangeViewersCanCopyContent?: 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;
}
[src]

Output only. Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.

§
contentHints?: {
indexableText?: string;
thumbnail?: {
image?: Uint8Array;
mimeType?: string;
}
;
}
[src]

Additional information about the content of the file. These fields are never populated in responses.

§
contentRestrictions?: ContentRestriction[]
[src]

Restrictions for accessing the content of the file. Only populated if such a restriction exists.

§
copyRequiresWriterPermission?: boolean
[src]

Whether the options to copy, print, or download this file, should be disabled for readers and commenters.

§
createdTime?: Date
[src]

The time at which the file was created (RFC 3339 date-time).

§
description?: string
[src]

A short description of the file.

§
driveId?: string
[src]

Output only. ID of the shared drive the file resides in. Only populated for items in shared drives.

§
explicitlyTrashed?: boolean
[src]

Output only. Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.

§
fileExtension?: string
[src]

Output only. The final component of fullFileExtension. This is only available for files with binary content in Google Drive.

§
folderColorRgb?: string
[src]

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.

§
fullFileExtension?: string
[src]

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.

§
hasAugmentedPermissions?: boolean
[src]

Output only. Whether there are permissions directly on this file. This field is only populated for items in shared drives.

§
hasThumbnail?: boolean
[src]

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.

§
headRevisionId?: string
[src]

Output only. The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.

§
id?: string
[src]

The ID of the file.

§
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;
}
[src]

Output only. Additional metadata about image media, if available.

§
isAppAuthorized?: boolean
[src]

Output only. Whether the file was created or opened by the requesting app.

§
kind?: string
[src]

Output only. Identifies what kind of resource this is. Value: the fixed string "drive#file".

§
labelInfo?: {
labels?: Label[];
}
[src]

Output only. An overview of the labels on the file.

§
lastModifyingUser?: User
[src]

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.

§
linkShareMetadata?: {
securityUpdateEligible?: boolean;
securityUpdateEnabled?: boolean;
}
[src]

Contains details about the link URLs that clients are using to refer to this item.

§
md5Checksum?: string
[src]

Output only. The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.

§
mimeType?: string
[src]

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.

§
modifiedByMe?: boolean
[src]

Output only. Whether the file has been modified by this user.

§
modifiedByMeTime?: Date
[src]

The last time the file was modified by the user (RFC 3339 date-time).

§
modifiedTime?: Date
[src]

he last time the file was modified by anyone (RFC 3339 date-time). Note that setting modifiedTime will also update modifiedByMeTime for the user.

§
name?: string
[src]

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.

§
originalFilename?: string
[src]

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.

§
ownedByMe?: boolean
[src]

Output only. Whether the user owns the file. Not populated for items in shared drives.

§
owners?: User[]
[src]

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.

§
parents?: string[]
[src]

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.

§
permissionIds?: string[]
[src]

Output only. List of permission IDs for users with access to this file.

§
permissions?: Permission[]
[src]

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.

§
properties?: {
[key: string]: string;
}
[src]

A collection of arbitrary key-value pairs which are visible to all apps. Entries with null values are cleared in update and copy requests.

§
quotaBytesUsed?: bigint
[src]

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.

§
resourceKey?: string
[src]

Output only. A key needed to access the item via a shared link.

§
sha1Checksum?: string
[src]

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.

§
sha256Checksum?: string
[src]

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.

§
shared?: boolean
[src]

Output only. Whether the file has been shared. Not populated for items in shared drives.

§
sharedWithMeTime?: Date
[src]

The time at which the file was shared with the user, if applicable (RFC 3339 date-time).

§
sharingUser?: User
[src]

Output only. The user who shared the file with the requesting user, if applicable.

§
shortcutDetails?: {
targetId?: string;
targetMimeType?: string;
targetResourceKey?: string;
}
[src]

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.

§
size?: bigint
[src]

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.

§
spaces?: string[]
[src]

Output only. The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.

§
starred?: boolean
[src]

Whether the user has starred the file.

§
teamDriveId?: string
[src]

Deprecated: Output only. Use driveId instead.

§
thumbnailVersion?: bigint
[src]

Output only. The thumbnail version for use in thumbnail cache invalidation.

§
trashed?: boolean
[src]

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.

§
trashedTime?: Date
[src]

The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.

§
trashingUser?: User
[src]

Output only. If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives.

§
version?: bigint
[src]

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.

§
videoMediaMetadata?: {
durationMillis?: bigint;
height?: number;
width?: number;
}
[src]

Output only. Additional metadata about video media. This may not be available immediately upon upload.

§
viewedByMe?: boolean
[src]

Output only. Whether the file has been viewed by this user.

§
viewedByMeTime?: Date
[src]

The last time the file was viewed by the user (RFC 3339 date-time).

§
viewersCanCopyContent?: boolean
[src]

Deprecated: Use copyRequiresWriterPermission instead.

§
writersCanShare?: boolean
[src]

Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.