class Google::Apis::DriveV2::File

The metadata for a file.

Attributes

app_data_contents[RW]

Whether this file is in the Application Data folder. Corresponds to the JSON property `appDataContents` @return [Boolean]

app_data_contents?[RW]

Whether this file is in the Application Data folder. Corresponds to the JSON property `appDataContents` @return [Boolean]

can_comment[RW]

Deprecated: use capabilities/canComment. Corresponds to the JSON property `canComment` @return [Boolean]

can_comment?[RW]

Deprecated: use capabilities/canComment. Corresponds to the JSON property `canComment` @return [Boolean]

can_read_revisions[RW]

Deprecated: use capabilities/canReadRevisions. Corresponds to the JSON property `canReadRevisions` @return [Boolean]

can_read_revisions?[RW]

Deprecated: use capabilities/canReadRevisions. Corresponds to the JSON property `canReadRevisions` @return [Boolean]

capabilities[RW]

Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. Corresponds to the JSON property `capabilities` @return [Google::Apis::DriveV2::File::Capabilities]

content_restrictions[RW]

Restrictions for accessing the content of the file. Only populated if such a restriction exists. Corresponds to the JSON property `contentRestrictions` @return [Array<Google::Apis::DriveV2::ContentRestriction>]

copy_requires_writer_permission[RW]

Whether the options to copy, print, or download this file, should be disabled for readers and commenters. Corresponds to the JSON property `copyRequiresWriterPermission` @return [Boolean]

copy_requires_writer_permission?[RW]

Whether the options to copy, print, or download this file, should be disabled for readers and commenters. Corresponds to the JSON property `copyRequiresWriterPermission` @return [Boolean]

copyable[RW]

Deprecated: use capabilities/canCopy. Corresponds to the JSON property `copyable` @return [Boolean]

copyable?[RW]

Deprecated: use capabilities/canCopy. Corresponds to the JSON property `copyable` @return [Boolean]

created_date[RW]

Create time for this file (formatted RFC 3339 timestamp). Corresponds to the JSON property `createdDate` @return [DateTime]

description[RW]

A short description of the file. Corresponds to the JSON property `description` @return [String]

download_url[RW]

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 Docs Editors or shortcut files. Corresponds to the JSON property `downloadUrl` @return [String]

drive_id[RW]

ID of the shared drive the file resides in. Only populated for items in shared drives. Corresponds to the JSON property `driveId` @return [String]

editable[RW]

Deprecated: use capabilities/canEdit. Corresponds to the JSON property `editable` @return [Boolean]

editable?[RW]

Deprecated: use capabilities/canEdit. Corresponds to the JSON property `editable` @return [Boolean]

etag[RW]

ETag of the file. Corresponds to the JSON property `etag` @return [String]

explicitly_trashed[RW]

Whether this file has been explicitly trashed, as opposed to recursively trashed. Corresponds to the JSON property `explicitlyTrashed` @return [Boolean]

explicitly_trashed?[RW]

Whether this file has been explicitly trashed, as opposed to recursively trashed. Corresponds to the JSON property `explicitlyTrashed` @return [Boolean]

file_extension[RW]

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. Corresponds to the JSON property `fileExtension` @return [String]

file_size[RW]

The size of the file in bytes. This field is populated for files with content stored in Google Drive and for files in Docs Editors; it is not populated for shortcut files. Corresponds to the JSON property `fileSize` @return [Fixnum]

folder_color_rgb[RW]

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. Corresponds to the JSON property `folderColorRgb` @return [String]

full_file_extension[RW]

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. Corresponds to the JSON property `fullFileExtension` @return [String]

has_augmented_permissions[RW]

Whether there are permissions directly on this file. This field is only populated for items in shared drives. Corresponds to the JSON property `hasAugmentedPermissions` @return [Boolean]

has_augmented_permissions?[RW]

Whether there are permissions directly on this file. This field is only populated for items in shared drives. Corresponds to the JSON property `hasAugmentedPermissions` @return [Boolean]

has_thumbnail[RW]

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. Corresponds to the JSON property `hasThumbnail` @return [Boolean]

has_thumbnail?[RW]

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. Corresponds to the JSON property `hasThumbnail` @return [Boolean]

head_revision_id[RW]

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. Corresponds to the JSON property `headRevisionId` @return [String]

id[RW]

The ID of the file. Corresponds to the JSON property `id` @return [String]

image_media_metadata[RW]

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. Corresponds to the JSON property `imageMediaMetadata` @return [Google::Apis::DriveV2::File::ImageMediaMetadata]

indexable_text[RW]

Indexable text attributes for the file (can only be written) Corresponds to the JSON property `indexableText` @return [Google::Apis::DriveV2::File::IndexableText]

is_app_authorized[RW]

Whether the file was created or opened by the requesting app. Corresponds to the JSON property `isAppAuthorized` @return [Boolean]

is_app_authorized?[RW]

Whether the file was created or opened by the requesting app. Corresponds to the JSON property `isAppAuthorized` @return [Boolean]

kind[RW]

The type of file. This is always drive#file. Corresponds to the JSON property `kind` @return [String]

labels[RW]

A group of labels for the file. Corresponds to the JSON property `labels` @return [Google::Apis::DriveV2::File::Labels]

last_modifying_user[RW]

Information about a Drive user. Corresponds to the JSON property `lastModifyingUser` @return [Google::Apis::DriveV2::User]

last_modifying_user_name[RW]

Name of the last user to modify this file. Corresponds to the JSON property `lastModifyingUserName` @return [String]

last_viewed_by_me_date[RW]

Last time this file was viewed by the user (formatted RFC 3339 timestamp). Corresponds to the JSON property `lastViewedByMeDate` @return [DateTime]

marked_viewed_by_me_date[RW]

Deprecated. Corresponds to the JSON property `markedViewedByMeDate` @return [DateTime]

md5_checksum[RW]

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. Corresponds to the JSON property `md5Checksum` @return [String]

mime_type[RW]

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. Corresponds to the JSON property `mimeType` @return [String]

modified_by_me_date[RW]

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. Corresponds to the JSON property `modifiedByMeDate` @return [DateTime]

modified_date[RW]

Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set. Corresponds to the JSON property `modifiedDate` @return [DateTime]

original_filename[RW]

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. Corresponds to the JSON property `originalFilename` @return [String]

owned_by_me[RW]

Whether the file is owned by the current user. Not populated for items in shared drives. Corresponds to the JSON property `ownedByMe` @return [Boolean]

owned_by_me?[RW]

Whether the file is owned by the current user. Not populated for items in shared drives. Corresponds to the JSON property `ownedByMe` @return [Boolean]

owner_names[RW]

Name(s) of the owner(s) of this file. Not populated for items in shared drives. Corresponds to the JSON property `ownerNames` @return [Array<String>]

owners[RW]

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. Corresponds to the JSON property `owners` @return [Array<Google::Apis::DriveV2::User>]

parents[RW]

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. Corresponds to the JSON property `parents` @return [Array<Google::Apis::DriveV2::ParentReference>]

permission_ids[RW]

List of permission IDs for users with access to this file. Corresponds to the JSON property `permissionIds` @return [Array<String>]

permissions[RW]

The list of permissions for users with access to this file. Not populated for items in shared drives. Corresponds to the JSON property `permissions` @return [Array<Google::Apis::DriveV2::Permission>]

properties[RW]

The list of properties. Corresponds to the JSON property `properties` @return [Array<Google::Apis::DriveV2::Property>]

quota_bytes_used[RW]

The number of quota bytes used by this file. Corresponds to the JSON property `quotaBytesUsed` @return [Fixnum]

resource_key[RW]

A key needed to access the item via a shared link. Corresponds to the JSON property `resourceKey` @return [String]

shareable[RW]

Deprecated: use capabilities/canShare. Corresponds to the JSON property `shareable` @return [Boolean]

shareable?[RW]

Deprecated: use capabilities/canShare. Corresponds to the JSON property `shareable` @return [Boolean]

shared[RW]

Whether the file has been shared. Not populated for items in shared drives. Corresponds to the JSON property `shared` @return [Boolean]

shared?[RW]

Whether the file has been shared. Not populated for items in shared drives. Corresponds to the JSON property `shared` @return [Boolean]

shared_with_me_date[RW]

Time at which this file was shared with the user (formatted RFC 3339 timestamp) . Corresponds to the JSON property `sharedWithMeDate` @return [DateTime]

sharing_user[RW]

Information about a Drive user. Corresponds to the JSON property `sharingUser` @return [Google::Apis::DriveV2::User]

shortcut_details[RW]

Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. Corresponds to the JSON property `shortcutDetails` @return [Google::Apis::DriveV2::File::ShortcutDetails]

spaces[RW]

The list of spaces which contain the file. Supported values are 'drive', ' appDataFolder' and 'photos'. Corresponds to the JSON property `spaces` @return [Array<String>]

team_drive_id[RW]

Deprecated - use driveId instead. Corresponds to the JSON property `teamDriveId` @return [String]

thumbnail[RW]

A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. Corresponds to the JSON property `thumbnail` @return [Google::Apis::DriveV2::File::Thumbnail]

thumbnail_version[RW]

The thumbnail version for use in thumbnail cache invalidation. Corresponds to the JSON property `thumbnailVersion` @return [Fixnum]

title[RW]

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. Corresponds to the JSON property `title` @return [String]

trashed_date[RW]

The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. Corresponds to the JSON property `trashedDate` @return [DateTime]

trashing_user[RW]

Information about a Drive user. Corresponds to the JSON property `trashingUser` @return [Google::Apis::DriveV2::User]

user_permission[RW]

A permission for a file. Corresponds to the JSON property `userPermission` @return [Google::Apis::DriveV2::Permission]

version[RW]

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. Corresponds to the JSON property `version` @return [Fixnum]

video_media_metadata[RW]

Metadata about video media. This will only be present for video types. Corresponds to the JSON property `videoMediaMetadata` @return [Google::Apis::DriveV2::File::VideoMediaMetadata]

writers_can_share[RW]

Whether writers can share the document with other users. Not populated for items in shared drives. Corresponds to the JSON property `writersCanShare` @return [Boolean]

writers_can_share?[RW]

Whether writers can share the document with other users. Not populated for items in shared drives. Corresponds to the JSON property `writersCanShare` @return [Boolean]

Public Class Methods

new(**args) click to toggle source
# File lib/google/apis/drive_v2/classes.rb, line 2203
def initialize(**args)
   update!(**args)
end

Public Instance Methods

update!(**args) click to toggle source

Update properties of this object

# File lib/google/apis/drive_v2/classes.rb, line 2208
def update!(**args)
  @alternate_link = args[:alternate_link] if args.key?(:alternate_link)
  @app_data_contents = args[:app_data_contents] if args.key?(:app_data_contents)
  @can_comment = args[:can_comment] if args.key?(:can_comment)
  @can_read_revisions = args[:can_read_revisions] if args.key?(:can_read_revisions)
  @capabilities = args[:capabilities] if args.key?(:capabilities)
  @content_restrictions = args[:content_restrictions] if args.key?(:content_restrictions)
  @copy_requires_writer_permission = args[:copy_requires_writer_permission] if args.key?(:copy_requires_writer_permission)
  @copyable = args[:copyable] if args.key?(:copyable)
  @created_date = args[:created_date] if args.key?(:created_date)
  @default_open_with_link = args[:default_open_with_link] if args.key?(:default_open_with_link)
  @description = args[:description] if args.key?(:description)
  @download_url = args[:download_url] if args.key?(:download_url)
  @drive_id = args[:drive_id] if args.key?(:drive_id)
  @editable = args[:editable] if args.key?(:editable)
  @embed_link = args[:embed_link] if args.key?(:embed_link)
  @etag = args[:etag] if args.key?(:etag)
  @explicitly_trashed = args[:explicitly_trashed] if args.key?(:explicitly_trashed)
  @export_links = args[:export_links] if args.key?(:export_links)
  @file_extension = args[:file_extension] if args.key?(:file_extension)
  @file_size = args[:file_size] if args.key?(:file_size)
  @folder_color_rgb = args[:folder_color_rgb] if args.key?(:folder_color_rgb)
  @full_file_extension = args[:full_file_extension] if args.key?(:full_file_extension)
  @has_augmented_permissions = args[:has_augmented_permissions] if args.key?(:has_augmented_permissions)
  @has_thumbnail = args[:has_thumbnail] if args.key?(:has_thumbnail)
  @head_revision_id = args[:head_revision_id] if args.key?(:head_revision_id)
  @icon_link = args[:icon_link] if args.key?(:icon_link)
  @id = args[:id] if args.key?(:id)
  @image_media_metadata = args[:image_media_metadata] if args.key?(:image_media_metadata)
  @indexable_text = args[:indexable_text] if args.key?(:indexable_text)
  @is_app_authorized = args[:is_app_authorized] if args.key?(:is_app_authorized)
  @kind = args[:kind] if args.key?(:kind)
  @labels = args[:labels] if args.key?(:labels)
  @last_modifying_user = args[:last_modifying_user] if args.key?(:last_modifying_user)
  @last_modifying_user_name = args[:last_modifying_user_name] if args.key?(:last_modifying_user_name)
  @last_viewed_by_me_date = args[:last_viewed_by_me_date] if args.key?(:last_viewed_by_me_date)
  @link_share_metadata = args[:link_share_metadata] if args.key?(:link_share_metadata)
  @marked_viewed_by_me_date = args[:marked_viewed_by_me_date] if args.key?(:marked_viewed_by_me_date)
  @md5_checksum = args[:md5_checksum] if args.key?(:md5_checksum)
  @mime_type = args[:mime_type] if args.key?(:mime_type)
  @modified_by_me_date = args[:modified_by_me_date] if args.key?(:modified_by_me_date)
  @modified_date = args[:modified_date] if args.key?(:modified_date)
  @open_with_links = args[:open_with_links] if args.key?(:open_with_links)
  @original_filename = args[:original_filename] if args.key?(:original_filename)
  @owned_by_me = args[:owned_by_me] if args.key?(:owned_by_me)
  @owner_names = args[:owner_names] if args.key?(:owner_names)
  @owners = args[:owners] if args.key?(:owners)
  @parents = args[:parents] if args.key?(:parents)
  @permission_ids = args[:permission_ids] if args.key?(:permission_ids)
  @permissions = args[:permissions] if args.key?(:permissions)
  @properties = args[:properties] if args.key?(:properties)
  @quota_bytes_used = args[:quota_bytes_used] if args.key?(:quota_bytes_used)
  @resource_key = args[:resource_key] if args.key?(:resource_key)
  @self_link = args[:self_link] if args.key?(:self_link)
  @shareable = args[:shareable] if args.key?(:shareable)
  @shared = args[:shared] if args.key?(:shared)
  @shared_with_me_date = args[:shared_with_me_date] if args.key?(:shared_with_me_date)
  @sharing_user = args[:sharing_user] if args.key?(:sharing_user)
  @shortcut_details = args[:shortcut_details] if args.key?(:shortcut_details)
  @spaces = args[:spaces] if args.key?(:spaces)
  @team_drive_id = args[:team_drive_id] if args.key?(:team_drive_id)
  @thumbnail = args[:thumbnail] if args.key?(:thumbnail)
  @thumbnail_link = args[:thumbnail_link] if args.key?(:thumbnail_link)
  @thumbnail_version = args[:thumbnail_version] if args.key?(:thumbnail_version)
  @title = args[:title] if args.key?(:title)
  @trashed_date = args[:trashed_date] if args.key?(:trashed_date)
  @trashing_user = args[:trashing_user] if args.key?(:trashing_user)
  @user_permission = args[:user_permission] if args.key?(:user_permission)
  @version = args[:version] if args.key?(:version)
  @video_media_metadata = args[:video_media_metadata] if args.key?(:video_media_metadata)
  @web_content_link = args[:web_content_link] if args.key?(:web_content_link)
  @web_view_link = args[:web_view_link] if args.key?(:web_view_link)
  @writers_can_share = args[:writers_can_share] if args.key?(:writers_can_share)
end