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.v2.Data
Assembly: Google.Apis.Drive.v2.dll
Syntax
public class File : IDirectResponseSchema
Properties
AlternateLink
Output only. A link for opening the file in a relevant Google editor or viewer.
Declaration
[JsonProperty("alternateLink")]
public virtual string AlternateLink { get; set; }
Property Value
Type | Description |
---|---|
string |
AppDataContents
Output only. Whether this file is in the Application Data folder.
Declaration
[JsonProperty("appDataContents")]
public virtual bool? AppDataContents { get; set; }
Property Value
Type | Description |
---|---|
bool? |
CanComment
Output only. Deprecated: Use capabilities/canComment
instead.
Declaration
[JsonProperty("canComment")]
public virtual bool? CanComment { get; set; }
Property Value
Type | Description |
---|---|
bool? |
CanReadRevisions
Output only. Deprecated: Use capabilities/canReadRevisions
instead.
Declaration
[JsonProperty("canReadRevisions")]
public virtual bool? CanReadRevisions { get; set; }
Property Value
Type | Description |
---|---|
bool? |
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 |
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? |
Copyable
Output only. Deprecated: Use capabilities/canCopy
instead.
Declaration
[JsonProperty("copyable")]
public virtual bool? Copyable { get; set; }
Property Value
Type | Description |
---|---|
bool? |
CreatedDate
DateTime representation of CreatedDateRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use CreatedDateDateTimeOffset instead.")]
public virtual DateTime? CreatedDate { get; set; }
Property Value
Type | Description |
---|---|
DateTime? |
CreatedDateDateTimeOffset
DateTimeOffset representation of CreatedDateRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? CreatedDateDateTimeOffset { get; set; }
Property Value
Type | Description |
---|---|
DateTimeOffset? |
CreatedDateRaw
Create time for this file (formatted RFC 3339 timestamp).
Declaration
[JsonProperty("createdDate")]
public virtual string CreatedDateRaw { get; set; }
Property Value
Type | Description |
---|---|
string |
DefaultOpenWithLink
Output only. A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
Declaration
[JsonProperty("defaultOpenWithLink")]
public virtual string DefaultOpenWithLink { 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 |
DownloadUrl
Output only. Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files.
Declaration
[JsonProperty("downloadUrl")]
public virtual string DownloadUrl { 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
Output only. ETag of the file.
Declaration
[JsonProperty("etag")]
public virtual string ETag { get; set; }
Property Value
Type | Description |
---|---|
string |
Editable
Output only. Deprecated: Use capabilities/canEdit
instead.
Declaration
[JsonProperty("editable")]
public virtual bool? Editable { get; set; }
Property Value
Type | Description |
---|---|
bool? |
EmbedLink
Output only. A link for embedding the file.
Declaration
[JsonProperty("embedLink")]
public virtual string EmbedLink { get; set; }
Property Value
Type | Description |
---|---|
string |
ExplicitlyTrashed
Output only. Whether this file has been explicitly trashed, as opposed to recursively trashed.
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
with trailing text that does not appear to be part
of the extension removed. This field is only populated for files with content stored in Google Drive; it is
not populated for Docs Editors or shortcut files.
Declaration
[JsonProperty("fileExtension")]
public virtual string FileExtension { get; set; }
Property Value
Type | Description |
---|---|
string |
FileSize
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("fileSize")]
public virtual long? FileSize { get; set; }
Property Value
Type | Description |
---|---|
long? |
FolderColorRgb
Folder color as an RGB hex string if the file is a folder or a shortcut to a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
Declaration
[JsonProperty("folderColorRgb")]
public virtual string FolderColorRgb { get; set; }
Property Value
Type | Description |
---|---|
string |
FullFileExtension
Output only. The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.
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 field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.
Declaration
[JsonProperty("headRevisionId")]
public virtual string HeadRevisionId { get; set; }
Property Value
Type | Description |
---|---|
string |
IconLink
Output only. A 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. Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Declaration
[JsonProperty("imageMediaMetadata")]
public virtual File.ImageMediaMetadataData ImageMediaMetadata { get; set; }
Property Value
Type | Description |
---|---|
File.ImageMediaMetadataData |
IndexableText
Indexable text attributes for the file (can only be written)
Declaration
[JsonProperty("indexableText")]
public virtual File.IndexableTextData IndexableText { get; set; }
Property Value
Type | Description |
---|---|
File.IndexableTextData |
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. The type of file. This is always 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 |
Labels
A group of labels for the file.
Declaration
[JsonProperty("labels")]
public virtual File.LabelsData Labels { get; set; }
Property Value
Type | Description |
---|---|
File.LabelsData |
LastModifyingUser
Output only. The last user to modify this 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 |
LastModifyingUserName
Output only. Name of the last user to modify this file.
Declaration
[JsonProperty("lastModifyingUserName")]
public virtual string LastModifyingUserName { get; set; }
Property Value
Type | Description |
---|---|
string |
LastViewedByMeDate
DateTime representation of LastViewedByMeDateRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use LastViewedByMeDateDateTimeOffset instead.")]
public virtual DateTime? LastViewedByMeDate { get; set; }
Property Value
Type | Description |
---|---|
DateTime? |
LastViewedByMeDateDateTimeOffset
DateTimeOffset representation of LastViewedByMeDateRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? LastViewedByMeDateDateTimeOffset { get; set; }
Property Value
Type | Description |
---|---|
DateTimeOffset? |
LastViewedByMeDateRaw
Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Declaration
[JsonProperty("lastViewedByMeDate")]
public virtual string LastViewedByMeDateRaw { get; set; }
Property Value
Type | Description |
---|---|
string |
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 |
MarkedViewedByMeDate
DateTime representation of MarkedViewedByMeDateRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use MarkedViewedByMeDateDateTimeOffset instead.")]
public virtual DateTime? MarkedViewedByMeDate { get; set; }
Property Value
Type | Description |
---|---|
DateTime? |
MarkedViewedByMeDateDateTimeOffset
DateTimeOffset representation of MarkedViewedByMeDateRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? MarkedViewedByMeDateDateTimeOffset { get; set; }
Property Value
Type | Description |
---|---|
DateTimeOffset? |
MarkedViewedByMeDateRaw
Deprecated.
Declaration
[JsonProperty("markedViewedByMeDate")]
public virtual string MarkedViewedByMeDateRaw { get; set; }
Property Value
Type | Description |
---|---|
string |
Md5Checksum
Output only. An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.
Declaration
[JsonProperty("md5Checksum")]
public virtual string Md5Checksum { get; set; }
Property Value
Type | Description |
---|---|
string |
MimeType
The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Declaration
[JsonProperty("mimeType")]
public virtual string MimeType { get; set; }
Property Value
Type | Description |
---|---|
string |
ModifiedByMeDate
DateTime representation of ModifiedByMeDateRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use ModifiedByMeDateDateTimeOffset instead.")]
public virtual DateTime? ModifiedByMeDate { get; set; }
Property Value
Type | Description |
---|---|
DateTime? |
ModifiedByMeDateDateTimeOffset
DateTimeOffset representation of ModifiedByMeDateRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? ModifiedByMeDateDateTimeOffset { get; set; }
Property Value
Type | Description |
---|---|
DateTimeOffset? |
ModifiedByMeDateRaw
Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Declaration
[JsonProperty("modifiedByMeDate")]
public virtual string ModifiedByMeDateRaw { get; set; }
Property Value
Type | Description |
---|---|
string |
ModifiedDate
DateTime representation of ModifiedDateRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use ModifiedDateDateTimeOffset instead.")]
public virtual DateTime? ModifiedDate { get; set; }
Property Value
Type | Description |
---|---|
DateTime? |
ModifiedDateDateTimeOffset
DateTimeOffset representation of ModifiedDateRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? ModifiedDateDateTimeOffset { get; set; }
Property Value
Type | Description |
---|---|
DateTimeOffset? |
ModifiedDateRaw
Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Declaration
[JsonProperty("modifiedDate")]
public virtual string ModifiedDateRaw { get; set; }
Property Value
Type | Description |
---|---|
string |
OpenWithLinks
Output only. A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
Declaration
[JsonProperty("openWithLinks")]
public virtual IDictionary<string, string> OpenWithLinks { get; set; }
Property Value
Type | Description |
---|---|
IDictionary<string, string> |
OriginalFilename
The original filename of the uploaded content if available, or else the original value of the title
field.
This is only available for files with binary content in Google Drive.
Declaration
[JsonProperty("originalFilename")]
public virtual string OriginalFilename { get; set; }
Property Value
Type | Description |
---|---|
string |
OwnedByMe
Output only. Whether the file is owned by the current user. Not populated for items in shared drives.
Declaration
[JsonProperty("ownedByMe")]
public virtual bool? OwnedByMe { get; set; }
Property Value
Type | Description |
---|---|
bool? |
OwnerNames
Output only. Name(s) of the owner(s) of this file. Not populated for items in shared drives.
Declaration
[JsonProperty("ownerNames")]
public virtual IList<string> OwnerNames { get; set; }
Property Value
Type | Description |
---|---|
IList<string> |
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 an insert 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<ParentReference> Parents { get; set; }
Property Value
Type | Description |
---|---|
IList<ParentReference> |
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 list of permissions for users with access to this 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
The list of properties.
Declaration
[JsonProperty("properties")]
public virtual IList<Property> Properties { get; set; }
Property Value
Type | Description |
---|---|
IList<Property> |
QuotaBytesUsed
Output only. The number of quota bytes used by this file.
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 |
SelfLink
Output only. A link back to this file.
Declaration
[JsonProperty("selfLink")]
public virtual string SelfLink { 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 |
Shareable
Output only. Deprecated: Use capabilities/canShare
instead.
Declaration
[JsonProperty("shareable")]
public virtual bool? Shareable { get; set; }
Property Value
Type | Description |
---|---|
bool? |
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? |
SharedWithMeDate
DateTime representation of SharedWithMeDateRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use SharedWithMeDateDateTimeOffset instead.")]
public virtual DateTime? SharedWithMeDate { get; set; }
Property Value
Type | Description |
---|---|
DateTime? |
SharedWithMeDateDateTimeOffset
DateTimeOffset representation of SharedWithMeDateRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? SharedWithMeDateDateTimeOffset { get; set; }
Property Value
Type | Description |
---|---|
DateTimeOffset? |
SharedWithMeDateRaw
Time at which this file was shared with the user (formatted RFC 3339 timestamp).
Declaration
[JsonProperty("sharedWithMeDate")]
public virtual string SharedWithMeDateRaw { get; set; }
Property Value
Type | Description |
---|---|
string |
SharingUser
Output only. User that shared the item with the current user, if available.
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.insert
requests.
Declaration
[JsonProperty("shortcutDetails")]
public virtual File.ShortcutDetailsData ShortcutDetails { get; set; }
Property Value
Type | Description |
---|---|
File.ShortcutDetailsData |
Spaces
Output only. The list of spaces which contain the file. Supported values are drive
, appDataFolder
and
photos
.
Declaration
[JsonProperty("spaces")]
public virtual IList<string> Spaces { get; set; }
Property Value
Type | Description |
---|---|
IList<string> |
TeamDriveId
Output only. Deprecated: Use driveId
instead.
Declaration
[JsonProperty("teamDriveId")]
public virtual string TeamDriveId { get; set; }
Property Value
Type | Description |
---|---|
string |
Thumbnail
A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated.
Declaration
[JsonProperty("thumbnail")]
public virtual File.ThumbnailData Thumbnail { get; set; }
Property Value
Type | Description |
---|---|
File.ThumbnailData |
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), 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? |
Title
The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant.
Declaration
[JsonProperty("title")]
public virtual string Title { get; set; }
Property Value
Type | Description |
---|---|
string |
TrashedDate
DateTime representation of TrashedDateRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use TrashedDateDateTimeOffset instead.")]
public virtual DateTime? TrashedDate { get; set; }
Property Value
Type | Description |
---|---|
DateTime? |
TrashedDateDateTimeOffset
DateTimeOffset representation of TrashedDateRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? TrashedDateDateTimeOffset { get; set; }
Property Value
Type | Description |
---|---|
DateTimeOffset? |
TrashedDateRaw
The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives.
Declaration
[JsonProperty("trashedDate")]
public virtual string TrashedDateRaw { 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 |
UserPermission
Output only. The permissions for the authenticated user on this file.
Declaration
[JsonProperty("userPermission")]
public virtual Permission UserPermission { get; set; }
Property Value
Type | Description |
---|---|
Permission |
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 requesting user.
Declaration
[JsonProperty("version")]
public virtual long? Version { get; set; }
Property Value
Type | Description |
---|---|
long? |
VideoMediaMetadata
Output only. Metadata about video media. This will only be present for video types.
Declaration
[JsonProperty("videoMediaMetadata")]
public virtual File.VideoMediaMetadataData VideoMediaMetadata { get; set; }
Property Value
Type | Description |
---|---|
File.VideoMediaMetadataData |
WebContentLink
Output only. A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
Declaration
[JsonProperty("webContentLink")]
public virtual string WebContentLink { get; set; }
Property Value
Type | Description |
---|---|
string |
WebViewLink
Output only. A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
Declaration
[JsonProperty("webViewLink")]
public virtual string WebViewLink { get; set; }
Property Value
Type | Description |
---|---|
string |
WritersCanShare
Whether writers can share the document with other users. Not populated for items in shared drives.
Declaration
[JsonProperty("writersCanShare")]
public virtual bool? WritersCanShare { get; set; }
Property Value
Type | Description |
---|---|
bool? |