Interface Schema$File

The metadata for a file.

Hierarchy

  • Schema$File

Properties

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

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.

Type declaration

  • [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;
    canMoveChildrenOutOfDrive?: boolean;
    canMoveChildrenOutOfTeamDrive?: boolean;
    canMoveChildrenWithinDrive?: boolean;
    canMoveChildrenWithinTeamDrive?: boolean;
    canMoveItemIntoTeamDrive?: boolean;
    canMoveItemOutOfDrive?: boolean;
    canMoveItemOutOfTeamDrive?: boolean;
    canMoveItemWithinDrive?: boolean;
    canMoveItemWithinTeamDrive?: boolean;
    canMoveTeamDriveItem?: boolean;
    canReadDrive?: boolean;
    canReadRevisions?: boolean;
    canReadTeamDrive?: boolean;
    canRemoveChildren?: boolean;
    canRemoveMyDriveParent?: boolean;
    canRename?: boolean;
    canShare?: boolean;
    canTrash?: boolean;
    canTrashChildren?: boolean;
    canUntrash?: boolean;
}

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

Type declaration

  • Optional canAcceptOwnership?: boolean
  • Optional canAddChildren?: boolean
  • Optional canAddFolderFromAnotherDrive?: boolean
  • Optional canAddMyDriveParent?: boolean
  • Optional canChangeCopyRequiresWriterPermission?: boolean
  • Optional canChangeSecurityUpdateEnabled?: boolean
  • Optional canChangeViewersCanCopyContent?: boolean
  • Optional canComment?: boolean
  • Optional canCopy?: boolean
  • Optional canDelete?: boolean
  • Optional canDeleteChildren?: boolean
  • Optional canDownload?: boolean
  • Optional canEdit?: boolean
  • Optional canListChildren?: boolean
  • Optional canModifyContent?: boolean
  • Optional canModifyContentRestriction?: boolean
  • Optional canMoveChildrenOutOfDrive?: boolean
  • Optional canMoveChildrenOutOfTeamDrive?: boolean
  • Optional canMoveChildrenWithinDrive?: boolean
  • Optional canMoveChildrenWithinTeamDrive?: boolean
  • Optional canMoveItemIntoTeamDrive?: boolean
  • Optional canMoveItemOutOfDrive?: boolean
  • Optional canMoveItemOutOfTeamDrive?: boolean
  • Optional canMoveItemWithinDrive?: boolean
  • Optional canMoveItemWithinTeamDrive?: boolean
  • Optional canMoveTeamDriveItem?: boolean
  • Optional canReadDrive?: boolean
  • Optional canReadRevisions?: boolean
  • Optional canReadTeamDrive?: boolean
  • Optional canRemoveChildren?: boolean
  • Optional canRemoveMyDriveParent?: boolean
  • Optional canRename?: boolean
  • Optional canShare?: boolean
  • Optional canTrash?: boolean
  • Optional canTrashChildren?: boolean
  • Optional canUntrash?: boolean
contentHints?: {
    indexableText?: string;
    thumbnail?: {
        image?: string;
        mimeType?: string;
    };
}

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

Type declaration

  • Optional indexableText?: string
  • Optional thumbnail?: {
        image?: string;
        mimeType?: string;
    }
    • Optional image?: string
    • Optional mimeType?: string
contentRestrictions?: Schema$ContentRestriction[]

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

copyRequiresWriterPermission?: boolean

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

createdTime?: string

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

description?: string

A short description of the file.

driveId?: string

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

explicitlyTrashed?: boolean

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

exportLinks?: {
    [key: string]: string;
}

Links for exporting Docs Editors files to specific formats.

Type declaration

  • [key: string]: string
fileExtension?: string

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

folderColorRgb?: string

The color for a folder or 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 will be used instead.

fullFileExtension?: string

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

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

hasThumbnail?: boolean

Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field.

headRevisionId?: string

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

iconLink?: string

A static, unauthenticated link to the file's icon.

id?: string

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;
}

Additional metadata about image media, if available.

Type declaration

  • Optional aperture?: number
  • Optional cameraMake?: string
  • Optional cameraModel?: string
  • Optional colorSpace?: string
  • Optional exposureBias?: number
  • Optional exposureMode?: string
  • Optional exposureTime?: number
  • Optional flashUsed?: boolean
  • Optional focalLength?: number
  • Optional height?: number
  • Optional isoSpeed?: number
  • Optional lens?: string
  • Optional location?: {
        altitude?: number;
        latitude?: number;
        longitude?: number;
    }
    • Optional altitude?: number
    • Optional latitude?: number
    • Optional longitude?: number
  • Optional maxApertureValue?: number
  • Optional meteringMode?: string
  • Optional rotation?: number
  • Optional sensor?: string
  • Optional subjectDistance?: number
  • Optional time?: string
  • Optional whiteBalance?: string
  • Optional width?: number
isAppAuthorized?: boolean

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

kind?: string

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

lastModifyingUser?: Schema$User

The last user to modify the file.

linkShareMetadata?: {
    securityUpdateEligible?: boolean;
    securityUpdateEnabled?: boolean;
}

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

Type declaration

  • Optional securityUpdateEligible?: boolean
  • Optional securityUpdateEnabled?: boolean
md5Checksum?: string

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

mimeType?: string

The MIME type of the file. Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded. If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.

modifiedByMe?: boolean

Whether the file has been modified by this user.

modifiedByMeTime?: string

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

modifiedTime?: string

The 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

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

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

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

owners?: Schema$User[]

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[]

The IDs of the parent folders which contain the file. If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests must use the addParents and removeParents parameters to modify the parents list.

permissionIds?: string[]

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

permissions?: Schema$Permission[]

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;
}

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

Type declaration

  • [key: string]: string
quotaBytesUsed?: string

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

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

shared?: boolean

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

sharedWithMeTime?: string

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

sharingUser?: Schema$User

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

shortcutDetails?: {
    targetId?: string;
    targetMimeType?: string;
    targetResourceKey?: string;
}

Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut.

Type declaration

  • Optional targetId?: string
  • Optional targetMimeType?: string
  • Optional targetResourceKey?: string
size?: string

The size of the file's content in bytes. This is applicable to binary files in Google Drive and Google Docs files.

spaces?: string[]

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

starred?: boolean

Whether the user has starred the file.

teamDriveId?: string

Deprecated - use driveId instead.

thumbnailLink?: string

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.

thumbnailVersion?: string

The thumbnail version for use in thumbnail cache invalidation.

trashed?: boolean

Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file.

trashedTime?: string

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

trashingUser?: Schema$User

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

version?: string

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?: string;
    height?: number;
    width?: number;
}

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

Type declaration

  • Optional durationMillis?: string
  • Optional height?: number
  • Optional width?: number
viewedByMe?: boolean

Whether the file has been viewed by this user.

viewedByMeTime?: string

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

viewersCanCopyContent?: boolean

Deprecated - use copyRequiresWriterPermission instead.

webContentLink?: string

A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive.

webViewLink?: string

A link for opening the file in a relevant Google editor or viewer in a browser.

writersCanShare?: boolean

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

Generated using TypeDoc