Show / Hide Table of Contents

Class File

The metadata for a file.

Inheritance
object
File
Implements
IDirectResponseSchema
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.Drive.v2.Data
Assembly: Google.Apis.Drive.v2.dll
Syntax
public class File : IDirectResponseSchema

Properties

AlternateLink

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

Whether this file is in the Application Data folder.

Declaration
[JsonProperty("appDataContents")]
public virtual bool? AppDataContents { get; set; }
Property Value
Type Description
bool?

CanComment

Deprecated: use capabilities/canComment.

Declaration
[JsonProperty("canComment")]
public virtual bool? CanComment { get; set; }
Property Value
Type Description
bool?

CanReadRevisions

Deprecated: use capabilities/canReadRevisions.

Declaration
[JsonProperty("canReadRevisions")]
public virtual bool? CanReadRevisions { get; set; }
Property Value
Type Description
bool?

Capabilities

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
System.Collections.Generic.IList<T><ContentRestriction>

Copyable

Deprecated: use capabilities/canCopy.

Declaration
[JsonProperty("copyable")]
public virtual bool? Copyable { get; set; }
Property Value
Type Description
bool?

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?

CreatedDate

System.DateTime representation of CreatedDateRaw.

Declaration
[JsonIgnore]
public virtual DateTime? CreatedDate { get; set; }
Property Value
Type Description
DateTime?

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

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

Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it isn't populated for Docs Editors or shortcut files.

Declaration
[JsonProperty("downloadUrl")]
public virtual string DownloadUrl { get; set; }
Property Value
Type Description
string

DriveId

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

Editable

Deprecated: use capabilities/canEdit.

Declaration
[JsonProperty("editable")]
public virtual bool? Editable { get; set; }
Property Value
Type Description
bool?

EmbedLink

A link for embedding the file.

Declaration
[JsonProperty("embedLink")]
public virtual string EmbedLink { get; set; }
Property Value
Type Description
string

ETag

ETag of the file.

Declaration
[JsonProperty("etag")]
public virtual string ETag { get; set; }
Property Value
Type Description
string

ExplicitlyTrashed

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

Links for exporting Docs Editors files to specific formats.

Declaration
[JsonProperty("exportLinks")]
public virtual IDictionary<string, string> ExportLinks { get; set; }
Property Value
Type Description
System.Collections.Generic.IDictionary<TKey, TValue><string, string>

FileExtension

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 isn't populated for Docs Editors or shortcut files.

Declaration
[JsonProperty("fileExtension")]
public virtual string FileExtension { get; set; }
Property Value
Type Description
string

FileSize

The size of the file's content in bytes. This field is populated for files with binary content stored in Google Drive and for Docs Editors files; it is not populated for shortcuts or 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

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 isn't populated for Docs Editors or shortcut files.

Declaration
[JsonProperty("fullFileExtension")]
public virtual string FullFileExtension { get; set; }
Property Value
Type Description
string

HasAugmentedPermissions

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

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

The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it isn't populated for Docs Editors or shortcut files.

Declaration
[JsonProperty("headRevisionId")]
public virtual string HeadRevisionId { get; set; }
Property Value
Type Description
string

IconLink

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

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). For more information, see Manage file metadata.

Declaration
[JsonProperty("indexableText")]
public virtual File.IndexableTextData IndexableText { get; set; }
Property Value
Type Description
File.IndexableTextData

IsAppAuthorized

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

The type of file. This is always drive#file.

Declaration
[JsonProperty("kind")]
public virtual string Kind { get; set; }
Property Value
Type Description
string

LabelInfo

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

The last user to modify this file.

Declaration
[JsonProperty("lastModifyingUser")]
public virtual User LastModifyingUser { get; set; }
Property Value
Type Description
User

LastModifyingUserName

Name of the last user to modify this file.

Declaration
[JsonProperty("lastModifyingUserName")]
public virtual string LastModifyingUserName { get; set; }
Property Value
Type Description
string

LastViewedByMeDate

System.DateTime representation of LastViewedByMeDateRaw.

Declaration
[JsonIgnore]
public virtual DateTime? LastViewedByMeDate { get; set; }
Property Value
Type Description
DateTime?

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

System.DateTime representation of MarkedViewedByMeDateRaw.

Declaration
[JsonIgnore]
public virtual DateTime? MarkedViewedByMeDate { get; set; }
Property Value
Type Description
DateTime?

MarkedViewedByMeDateRaw

Deprecated.

Declaration
[JsonProperty("markedViewedByMeDate")]
public virtual string MarkedViewedByMeDateRaw { get; set; }
Property Value
Type Description
string

Md5Checksum

An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it isn't 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

System.DateTime representation of ModifiedByMeDateRaw.

Declaration
[JsonIgnore]
public virtual DateTime? ModifiedByMeDate { get; set; }
Property Value
Type Description
DateTime?

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

System.DateTime representation of ModifiedDateRaw.

Declaration
[JsonIgnore]
public virtual DateTime? ModifiedDate { get; set; }
Property Value
Type Description
DateTime?

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

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
System.Collections.Generic.IDictionary<TKey, TValue><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

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

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
System.Collections.Generic.IList<T><string>

Owners

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
System.Collections.Generic.IList<T><User>

Parents

Collection of parent folders which contain this file. If not specified as part of an insert 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 can also 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
System.Collections.Generic.IList<T><ParentReference>

PermissionIds

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
System.Collections.Generic.IList<T><string>

Permissions

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
System.Collections.Generic.IList<T><Permission>

Properties

The list of properties.

Declaration
[JsonProperty("properties")]
public virtual IList<Property> Properties { get; set; }
Property Value
Type Description
System.Collections.Generic.IList<T><Property>

QuotaBytesUsed

The number of quota bytes used by this file.

Declaration
[JsonProperty("quotaBytesUsed")]
public virtual long? QuotaBytesUsed { get; set; }
Property Value
Type Description
long?

ResourceKey

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

A link back to this file.

Declaration
[JsonProperty("selfLink")]
public virtual string SelfLink { get; set; }
Property Value
Type Description
string

Sha1Checksum

The SHA1 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it isn't populated for Docs Editors or shortcut files.

Declaration
[JsonProperty("sha1Checksum")]
public virtual string Sha1Checksum { get; set; }
Property Value
Type Description
string

Sha256Checksum

The SHA256 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it isn't populated for Docs Editors or shortcut files.

Declaration
[JsonProperty("sha256Checksum")]
public virtual string Sha256Checksum { get; set; }
Property Value
Type Description
string

Shareable

Deprecated: use capabilities/canShare.

Declaration
[JsonProperty("shareable")]
public virtual bool? Shareable { get; set; }
Property Value
Type Description
bool?

Shared

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

System.DateTime representation of SharedWithMeDateRaw.

Declaration
[JsonIgnore]
public virtual DateTime? SharedWithMeDate { get; set; }
Property Value
Type Description
DateTime?

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

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.

Declaration
[JsonProperty("shortcutDetails")]
public virtual File.ShortcutDetailsData ShortcutDetails { get; set; }
Property Value
Type Description
File.ShortcutDetailsData

Spaces

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
System.Collections.Generic.IList<T><string>

TeamDriveId

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

A short-lived link to the file's thumbnail. 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.

Declaration
[JsonProperty("thumbnailLink")]
public virtual string ThumbnailLink { get; set; }
Property Value
Type Description
string

ThumbnailVersion

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

System.DateTime representation of TrashedDateRaw.

Declaration
[JsonIgnore]
public virtual DateTime? TrashedDate { get; set; }
Property Value
Type Description
DateTime?

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

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

The permissions for the authenticated user on this file.

Declaration
[JsonProperty("userPermission")]
public virtual Permission UserPermission { get; set; }
Property Value
Type Description
Permission

Version

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

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

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

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?

Implements

IDirectResponseSchema
In This Article
Back to top Generated by DocFX