Class File
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.
Implements
Inherited Members
Namespace: Google.Apis.Drive.v3.Data
Assembly: Google.Apis.Drive.v3.dll
Syntax
public class File : IDirectResponseSchema
Properties
AppProperties
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.
Declaration
[JsonProperty("appProperties")]
public virtual IDictionary<string, string> AppProperties { get; set; }
Property Value
Type | Description |
---|---|
IDictionary<string, string> |
Capabilities
Output only. Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
Declaration
[JsonProperty("capabilities")]
public virtual File.CapabilitiesData Capabilities { get; set; }
Property Value
Type | Description |
---|---|
File.CapabilitiesData |
ContentHints
Additional information about the content of the file. These fields are never populated in responses.
Declaration
[JsonProperty("contentHints")]
public virtual File.ContentHintsData ContentHints { get; set; }
Property Value
Type | Description |
---|---|
File.ContentHintsData |
ContentRestrictions
Restrictions for accessing the content of the file. Only populated if such a restriction exists.
Declaration
[JsonProperty("contentRestrictions")]
public virtual IList<ContentRestriction> ContentRestrictions { get; set; }
Property Value
Type | Description |
---|---|
IList<ContentRestriction> |
CopyRequiresWriterPermission
Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
Declaration
[JsonProperty("copyRequiresWriterPermission")]
public virtual bool? CopyRequiresWriterPermission { get; set; }
Property Value
Type | Description |
---|---|
bool? |
CreatedTime
DateTime representation of CreatedTimeRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use CreatedTimeDateTimeOffset instead.")]
public virtual DateTime? CreatedTime { get; set; }
Property Value
Type | Description |
---|---|
DateTime? |
CreatedTimeDateTimeOffset
DateTimeOffset representation of CreatedTimeRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? CreatedTimeDateTimeOffset { get; set; }
Property Value
Type | Description |
---|---|
DateTimeOffset? |
CreatedTimeRaw
The time at which the file was created (RFC 3339 date-time).
Declaration
[JsonProperty("createdTime")]
public virtual string CreatedTimeRaw { get; set; }
Property Value
Type | Description |
---|---|
string |
Description
A short description of the file.
Declaration
[JsonProperty("description")]
public virtual string Description { get; set; }
Property Value
Type | Description |
---|---|
string |
DriveId
Output only. ID of the shared drive the file resides in. Only populated for items in shared drives.
Declaration
[JsonProperty("driveId")]
public virtual string DriveId { get; set; }
Property Value
Type | Description |
---|---|
string |
ETag
The ETag of the item.
Declaration
public virtual string ETag { get; set; }
Property Value
Type | Description |
---|---|
string |
ExplicitlyTrashed
Output only. Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Declaration
[JsonProperty("explicitlyTrashed")]
public virtual bool? ExplicitlyTrashed { get; set; }
Property Value
Type | Description |
---|---|
bool? |
ExportLinks
Output only. Links for exporting Docs Editors files to specific formats.
Declaration
[JsonProperty("exportLinks")]
public virtual IDictionary<string, string> ExportLinks { get; set; }
Property Value
Type | Description |
---|---|
IDictionary<string, string> |
FileExtension
Output only. The final component of fullFileExtension
. This is only available for files with binary
content in Google Drive.
Declaration
[JsonProperty("fileExtension")]
public virtual string FileExtension { get; set; }
Property Value
Type | Description |
---|---|
string |
FolderColorRgb
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.
Declaration
[JsonProperty("folderColorRgb")]
public virtual string FolderColorRgb { get; set; }
Property Value
Type | Description |
---|---|
string |
FullFileExtension
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.
Declaration
[JsonProperty("fullFileExtension")]
public virtual string FullFileExtension { get; set; }
Property Value
Type | Description |
---|---|
string |
HasAugmentedPermissions
Output only. Whether there are permissions directly on this file. This field is only populated for items in shared drives.
Declaration
[JsonProperty("hasAugmentedPermissions")]
public virtual bool? HasAugmentedPermissions { get; set; }
Property Value
Type | Description |
---|---|
bool? |
HasThumbnail
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.
Declaration
[JsonProperty("hasThumbnail")]
public virtual bool? HasThumbnail { get; set; }
Property Value
Type | Description |
---|---|
bool? |
HeadRevisionId
Output only. The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.
Declaration
[JsonProperty("headRevisionId")]
public virtual string HeadRevisionId { get; set; }
Property Value
Type | Description |
---|---|
string |
IconLink
Output only. A static, unauthenticated link to the file's icon.
Declaration
[JsonProperty("iconLink")]
public virtual string IconLink { get; set; }
Property Value
Type | Description |
---|---|
string |
Id
The ID of the file.
Declaration
[JsonProperty("id")]
public virtual string Id { get; set; }
Property Value
Type | Description |
---|---|
string |
ImageMediaMetadata
Output only. Additional metadata about image media, if available.
Declaration
[JsonProperty("imageMediaMetadata")]
public virtual File.ImageMediaMetadataData ImageMediaMetadata { get; set; }
Property Value
Type | Description |
---|---|
File.ImageMediaMetadataData |
IsAppAuthorized
Output only. Whether the file was created or opened by the requesting app.
Declaration
[JsonProperty("isAppAuthorized")]
public virtual bool? IsAppAuthorized { get; set; }
Property Value
Type | Description |
---|---|
bool? |
Kind
Output only. Identifies what kind of resource this is. Value: the fixed string "drive#file"
.
Declaration
[JsonProperty("kind")]
public virtual string Kind { get; set; }
Property Value
Type | Description |
---|---|
string |
LabelInfo
Output only. An overview of the labels on the file.
Declaration
[JsonProperty("labelInfo")]
public virtual File.LabelInfoData LabelInfo { get; set; }
Property Value
Type | Description |
---|---|
File.LabelInfoData |
LastModifyingUser
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.
Declaration
[JsonProperty("lastModifyingUser")]
public virtual User LastModifyingUser { get; set; }
Property Value
Type | Description |
---|---|
User |
LinkShareMetadata
Contains details about the link URLs that clients are using to refer to this item.
Declaration
[JsonProperty("linkShareMetadata")]
public virtual File.LinkShareMetadataData LinkShareMetadata { get; set; }
Property Value
Type | Description |
---|---|
File.LinkShareMetadataData |
Md5Checksum
Output only. The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
Declaration
[JsonProperty("md5Checksum")]
public virtual string Md5Checksum { get; set; }
Property Value
Type | Description |
---|---|
string |
MimeType
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.
Declaration
[JsonProperty("mimeType")]
public virtual string MimeType { get; set; }
Property Value
Type | Description |
---|---|
string |
ModifiedByMe
Output only. Whether the file has been modified by this user.
Declaration
[JsonProperty("modifiedByMe")]
public virtual bool? ModifiedByMe { get; set; }
Property Value
Type | Description |
---|---|
bool? |
ModifiedByMeTime
DateTime representation of ModifiedByMeTimeRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use ModifiedByMeTimeDateTimeOffset instead.")]
public virtual DateTime? ModifiedByMeTime { get; set; }
Property Value
Type | Description |
---|---|
DateTime? |
ModifiedByMeTimeDateTimeOffset
DateTimeOffset representation of ModifiedByMeTimeRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? ModifiedByMeTimeDateTimeOffset { get; set; }
Property Value
Type | Description |
---|---|
DateTimeOffset? |
ModifiedByMeTimeRaw
The last time the file was modified by the user (RFC 3339 date-time).
Declaration
[JsonProperty("modifiedByMeTime")]
public virtual string ModifiedByMeTimeRaw { get; set; }
Property Value
Type | Description |
---|---|
string |
ModifiedTime
DateTime representation of ModifiedTimeRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use ModifiedTimeDateTimeOffset instead.")]
public virtual DateTime? ModifiedTime { get; set; }
Property Value
Type | Description |
---|---|
DateTime? |
ModifiedTimeDateTimeOffset
DateTimeOffset representation of ModifiedTimeRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? ModifiedTimeDateTimeOffset { get; set; }
Property Value
Type | Description |
---|---|
DateTimeOffset? |
ModifiedTimeRaw
he last time the file was modified by anyone (RFC 3339 date-time). Note that setting modifiedTime will also update modifiedByMeTime for the user.
Declaration
[JsonProperty("modifiedTime")]
public virtual string ModifiedTimeRaw { get; set; }
Property Value
Type | Description |
---|---|
string |
Name
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.
Declaration
[JsonProperty("name")]
public virtual string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
OriginalFilename
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.
Declaration
[JsonProperty("originalFilename")]
public virtual string OriginalFilename { get; set; }
Property Value
Type | Description |
---|---|
string |
OwnedByMe
Output only. Whether the user owns the file. Not populated for items in shared drives.
Declaration
[JsonProperty("ownedByMe")]
public virtual bool? OwnedByMe { get; set; }
Property Value
Type | Description |
---|---|
bool? |
Owners
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.
Declaration
[JsonProperty("owners")]
public virtual IList<User> Owners { get; set; }
Property Value
Type | Description |
---|---|
IList<User> |
Parents
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.
Declaration
[JsonProperty("parents")]
public virtual IList<string> Parents { get; set; }
Property Value
Type | Description |
---|---|
IList<string> |
PermissionIds
Output only. List of permission IDs for users with access to this file.
Declaration
[JsonProperty("permissionIds")]
public virtual IList<string> PermissionIds { get; set; }
Property Value
Type | Description |
---|---|
IList<string> |
Permissions
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.
Declaration
[JsonProperty("permissions")]
public virtual IList<Permission> Permissions { get; set; }
Property Value
Type | Description |
---|---|
IList<Permission> |
Properties
A collection of arbitrary key-value pairs which are visible to all apps. Entries with null values are cleared in update and copy requests.
Declaration
[JsonProperty("properties")]
public virtual IDictionary<string, string> Properties { get; set; }
Property Value
Type | Description |
---|---|
IDictionary<string, string> |
QuotaBytesUsed
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.
Declaration
[JsonProperty("quotaBytesUsed")]
public virtual long? QuotaBytesUsed { get; set; }
Property Value
Type | Description |
---|---|
long? |
ResourceKey
Output only. A key needed to access the item via a shared link.
Declaration
[JsonProperty("resourceKey")]
public virtual string ResourceKey { get; set; }
Property Value
Type | Description |
---|---|
string |
Sha1Checksum
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.
Declaration
[JsonProperty("sha1Checksum")]
public virtual string Sha1Checksum { get; set; }
Property Value
Type | Description |
---|---|
string |
Sha256Checksum
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.
Declaration
[JsonProperty("sha256Checksum")]
public virtual string Sha256Checksum { get; set; }
Property Value
Type | Description |
---|---|
string |
Shared
Output only. Whether the file has been shared. Not populated for items in shared drives.
Declaration
[JsonProperty("shared")]
public virtual bool? Shared { get; set; }
Property Value
Type | Description |
---|---|
bool? |
SharedWithMeTime
DateTime representation of SharedWithMeTimeRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use SharedWithMeTimeDateTimeOffset instead.")]
public virtual DateTime? SharedWithMeTime { get; set; }
Property Value
Type | Description |
---|---|
DateTime? |
SharedWithMeTimeDateTimeOffset
DateTimeOffset representation of SharedWithMeTimeRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? SharedWithMeTimeDateTimeOffset { get; set; }
Property Value
Type | Description |
---|---|
DateTimeOffset? |
SharedWithMeTimeRaw
The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Declaration
[JsonProperty("sharedWithMeTime")]
public virtual string SharedWithMeTimeRaw { get; set; }
Property Value
Type | Description |
---|---|
string |
SharingUser
Output only. The user who shared the file with the requesting user, if applicable.
Declaration
[JsonProperty("sharingUser")]
public virtual User SharingUser { get; set; }
Property Value
Type | Description |
---|---|
User |
ShortcutDetails
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.
Declaration
[JsonProperty("shortcutDetails")]
public virtual File.ShortcutDetailsData ShortcutDetails { get; set; }
Property Value
Type | Description |
---|---|
File.ShortcutDetailsData |
Size
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.
Declaration
[JsonProperty("size")]
public virtual long? Size { get; set; }
Property Value
Type | Description |
---|---|
long? |
Spaces
Output only. The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
Declaration
[JsonProperty("spaces")]
public virtual IList<string> Spaces { get; set; }
Property Value
Type | Description |
---|---|
IList<string> |
Starred
Whether the user has starred the file.
Declaration
[JsonProperty("starred")]
public virtual bool? Starred { get; set; }
Property Value
Type | Description |
---|---|
bool? |
TeamDriveId
Deprecated: Output only. Use driveId
instead.
Declaration
[JsonProperty("teamDriveId")]
public virtual string TeamDriveId { get; set; }
Property Value
Type | Description |
---|---|
string |
ThumbnailLink
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) 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.
Declaration
[JsonProperty("thumbnailLink")]
public virtual string ThumbnailLink { get; set; }
Property Value
Type | Description |
---|---|
string |
ThumbnailVersion
Output only. The thumbnail version for use in thumbnail cache invalidation.
Declaration
[JsonProperty("thumbnailVersion")]
public virtual long? ThumbnailVersion { get; set; }
Property Value
Type | Description |
---|---|
long? |
Trashed
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.
Declaration
[JsonProperty("trashed")]
public virtual bool? Trashed { get; set; }
Property Value
Type | Description |
---|---|
bool? |
TrashedTime
DateTime representation of TrashedTimeRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use TrashedTimeDateTimeOffset instead.")]
public virtual DateTime? TrashedTime { get; set; }
Property Value
Type | Description |
---|---|
DateTime? |
TrashedTimeDateTimeOffset
DateTimeOffset representation of TrashedTimeRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? TrashedTimeDateTimeOffset { get; set; }
Property Value
Type | Description |
---|---|
DateTimeOffset? |
TrashedTimeRaw
The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.
Declaration
[JsonProperty("trashedTime")]
public virtual string TrashedTimeRaw { get; set; }
Property Value
Type | Description |
---|---|
string |
TrashingUser
Output only. If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives.
Declaration
[JsonProperty("trashingUser")]
public virtual User TrashingUser { get; set; }
Property Value
Type | Description |
---|---|
User |
Version
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.
Declaration
[JsonProperty("version")]
public virtual long? Version { get; set; }
Property Value
Type | Description |
---|---|
long? |
VideoMediaMetadata
Output only. Additional metadata about video media. This may not be available immediately upon upload.
Declaration
[JsonProperty("videoMediaMetadata")]
public virtual File.VideoMediaMetadataData VideoMediaMetadata { get; set; }
Property Value
Type | Description |
---|---|
File.VideoMediaMetadataData |
ViewedByMe
Output only. Whether the file has been viewed by this user.
Declaration
[JsonProperty("viewedByMe")]
public virtual bool? ViewedByMe { get; set; }
Property Value
Type | Description |
---|---|
bool? |
ViewedByMeTime
DateTime representation of ViewedByMeTimeRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use ViewedByMeTimeDateTimeOffset instead.")]
public virtual DateTime? ViewedByMeTime { get; set; }
Property Value
Type | Description |
---|---|
DateTime? |
ViewedByMeTimeDateTimeOffset
DateTimeOffset representation of ViewedByMeTimeRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? ViewedByMeTimeDateTimeOffset { get; set; }
Property Value
Type | Description |
---|---|
DateTimeOffset? |
ViewedByMeTimeRaw
The last time the file was viewed by the user (RFC 3339 date-time).
Declaration
[JsonProperty("viewedByMeTime")]
public virtual string ViewedByMeTimeRaw { get; set; }
Property Value
Type | Description |
---|---|
string |
ViewersCanCopyContent
Deprecated: Use copyRequiresWriterPermission
instead.
Declaration
[JsonProperty("viewersCanCopyContent")]
public virtual bool? ViewersCanCopyContent { get; set; }
Property Value
Type | Description |
---|---|
bool? |
WebContentLink
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.
Declaration
[JsonProperty("webContentLink")]
public virtual string WebContentLink { get; set; }
Property Value
Type | Description |
---|---|
string |
WebViewLink
Output only. A link for opening the file in a relevant Google editor or viewer in a browser.
Declaration
[JsonProperty("webViewLink")]
public virtual string WebViewLink { get; set; }
Property Value
Type | Description |
---|---|
string |
WritersCanShare
Whether users with only writer
permission can modify the file's permissions. Not populated for items in
shared drives.
Declaration
[JsonProperty("writersCanShare")]
public virtual bool? WritersCanShare { get; set; }
Property Value
Type | Description |
---|---|
bool? |