Struct google_drive2::api::File

source ·
pub struct File {
Show 75 fields pub alternate_link: Option<String>, pub app_data_contents: Option<bool>, pub can_comment: Option<bool>, pub can_read_revisions: Option<bool>, pub capabilities: Option<FileCapabilities>, pub content_restrictions: Option<Vec<ContentRestriction>>, pub copy_requires_writer_permission: Option<bool>, pub copyable: Option<bool>, pub created_date: Option<DateTime<Utc>>, pub default_open_with_link: Option<String>, pub description: Option<String>, pub download_url: Option<String>, pub drive_id: Option<String>, pub editable: Option<bool>, pub embed_link: Option<String>, pub etag: Option<String>, pub explicitly_trashed: Option<bool>, pub export_links: Option<HashMap<String, String>>, pub file_extension: Option<String>, pub file_size: Option<i64>, pub folder_color_rgb: Option<String>, pub full_file_extension: Option<String>, pub has_augmented_permissions: Option<bool>, pub has_thumbnail: Option<bool>, pub head_revision_id: Option<String>, pub icon_link: Option<String>, pub id: Option<String>, pub image_media_metadata: Option<FileImageMediaMetadata>, pub indexable_text: Option<FileIndexableText>, pub is_app_authorized: Option<bool>, pub kind: Option<String>, pub label_info: Option<FileLabelInfo>, pub labels: Option<FileLabels>, pub last_modifying_user: Option<User>, pub last_modifying_user_name: Option<String>, pub last_viewed_by_me_date: Option<DateTime<Utc>>, pub link_share_metadata: Option<FileLinkShareMetadata>, pub marked_viewed_by_me_date: Option<DateTime<Utc>>, pub md5_checksum: Option<String>, pub mime_type: Option<String>, pub modified_by_me_date: Option<DateTime<Utc>>, pub modified_date: Option<DateTime<Utc>>, pub open_with_links: Option<HashMap<String, String>>, pub original_filename: Option<String>, pub owned_by_me: Option<bool>, pub owner_names: Option<Vec<String>>, pub owners: Option<Vec<User>>, pub parents: Option<Vec<ParentReference>>, pub permission_ids: Option<Vec<String>>, pub permissions: Option<Vec<Permission>>, pub properties: Option<Vec<Property>>, pub quota_bytes_used: Option<i64>, pub resource_key: Option<String>, pub self_link: Option<String>, pub sha1_checksum: Option<String>, pub sha256_checksum: Option<String>, pub shareable: Option<bool>, pub shared: Option<bool>, pub shared_with_me_date: Option<DateTime<Utc>>, pub sharing_user: Option<User>, pub shortcut_details: Option<FileShortcutDetails>, pub spaces: Option<Vec<String>>, pub team_drive_id: Option<String>, pub thumbnail: Option<FileThumbnail>, pub thumbnail_link: Option<String>, pub thumbnail_version: Option<i64>, pub title: Option<String>, pub trashed_date: Option<DateTime<Utc>>, pub trashing_user: Option<User>, pub user_permission: Option<Permission>, pub version: Option<i64>, pub video_media_metadata: Option<FileVideoMediaMetadata>, pub web_content_link: Option<String>, pub web_view_link: Option<String>, pub writers_can_share: Option<bool>,
}
Expand description

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.

§Activities

This type is used in activities, which are methods you may call on this type or where this type is involved in. The list links the activity name, along with information about where it is used (one of request and response).

Fields§

§alternate_link: Option<String>

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

§app_data_contents: Option<bool>

Output only. Whether this file is in the Application Data folder.

§can_comment: Option<bool>

Output only. Deprecated: Use capabilities/canComment instead.

§can_read_revisions: Option<bool>

Output only. Deprecated: Use capabilities/canReadRevisions instead.

§capabilities: Option<FileCapabilities>

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

§content_restrictions: Option<Vec<ContentRestriction>>

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

§copy_requires_writer_permission: Option<bool>

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

§copyable: Option<bool>

Output only. Deprecated: Use capabilities/canCopy instead.

§created_date: Option<DateTime<Utc>>

Create time for this file (formatted RFC 3339 timestamp).

§default_open_with_link: Option<String>

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.

§description: Option<String>

A short description of the file.

§download_url: Option<String>

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.

§drive_id: Option<String>

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

§editable: Option<bool>

Output only. Deprecated: Use capabilities/canEdit instead.

§embed_link: Option<String>

Output only. A link for embedding the file.

§etag: Option<String>

Output only. ETag of the file.

§explicitly_trashed: Option<bool>

Output only. Whether this file has been explicitly trashed, as opposed to recursively trashed.

§export_links: Option<HashMap<String, String>>

Output only. Links for exporting Docs Editors files to specific formats.

§file_extension: Option<String>

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.

§file_size: Option<i64>

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.

§folder_color_rgb: Option<String>

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.

§full_file_extension: Option<String>

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.

§has_augmented_permissions: Option<bool>

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

§has_thumbnail: Option<bool>

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.

§head_revision_id: Option<String>

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.

§icon_link: Option<String>

Output only. A link to the file’s icon.

§id: Option<String>

The ID of the file.

§image_media_metadata: Option<FileImageMediaMetadata>

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.

§indexable_text: Option<FileIndexableText>

Indexable text attributes for the file (can only be written)

§is_app_authorized: Option<bool>

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

§kind: Option<String>

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

§label_info: Option<FileLabelInfo>

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

§labels: Option<FileLabels>

A group of labels for the file.

§last_modifying_user: Option<User>

Output only. The last user to modify this file.

§last_modifying_user_name: Option<String>

Output only. Name of the last user to modify this file.

§last_viewed_by_me_date: Option<DateTime<Utc>>

Last time this file was viewed by the user (formatted RFC 3339 timestamp).

§link_share_metadata: Option<FileLinkShareMetadata>

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

§marked_viewed_by_me_date: Option<DateTime<Utc>>

Deprecated.

§md5_checksum: Option<String>

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.

§mime_type: Option<String>

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.

§modified_by_me_date: Option<DateTime<Utc>>

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.

§modified_date: Option<DateTime<Utc>>

Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.

§open_with_links: Option<HashMap<String, String>>

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.

§original_filename: Option<String>

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.

§owned_by_me: Option<bool>

Output only. Whether the file is owned by the current user. Not populated for items in shared drives.

§owner_names: Option<Vec<String>>

Output only. Name(s) of the owner(s) of this file. Not populated for items in shared drives.

§owners: Option<Vec<User>>

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: Option<Vec<ParentReference>>

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.

§permission_ids: Option<Vec<String>>

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

§permissions: Option<Vec<Permission>>

Output only. The list of permissions for users with access to this file. Not populated for items in shared drives.

§properties: Option<Vec<Property>>

The list of properties.

§quota_bytes_used: Option<i64>

Output only. The number of quota bytes used by this file.

§resource_key: Option<String>

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

§self_link: Option<String>

Output only. A link back to this file.

§sha1_checksum: Option<String>

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.

§sha256_checksum: Option<String>

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.

§shareable: Option<bool>

Output only. Deprecated: Use capabilities/canShare instead.

§shared: Option<bool>

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

§shared_with_me_date: Option<DateTime<Utc>>

Time at which this file was shared with the user (formatted RFC 3339 timestamp).

§sharing_user: Option<User>

Output only. User that shared the item with the current user, if available.

§shortcut_details: Option<FileShortcutDetails>

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

§spaces: Option<Vec<String>>

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

§team_drive_id: Option<String>

Output only. Deprecated: Use driveId instead.

§thumbnail: Option<FileThumbnail>

A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated.

§thumbnail_link: Option<String>

Output only. 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.

§thumbnail_version: Option<i64>

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

§title: Option<String>

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.

§trashed_date: Option<DateTime<Utc>>

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

§trashing_user: Option<User>

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

§user_permission: Option<Permission>

Output only. The permissions for the authenticated user on this file.

§version: Option<i64>

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.

§video_media_metadata: Option<FileVideoMediaMetadata>

Output only. Metadata about video media. This will only be present for video types.

§web_content_link: Option<String>

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.

§web_view_link: Option<String>

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.

§writers_can_share: Option<bool>

Whether writers can share the document with other users. Not populated for items in shared drives.

Trait Implementations§

source§

impl Clone for File

source§

fn clone(&self) -> File

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for File

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for File

source§

fn default() -> File

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for File

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for File

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl RequestValue for File

source§

impl Resource for File

source§

impl ResponseResult for File

Auto Trait Implementations§

§

impl RefUnwindSafe for File

§

impl Send for File

§

impl Sync for File

§

impl Unpin for File

§

impl UnwindSafe for File

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,