class Google::Apis::DriveV3::File

The metadata for a file.

Attributes

app_properties[RW]

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

capabilities[RW]

Capabilities the current user has on the file. Corresponds to the JSON property `capabilities` @return [Google::Apis::DriveV3::File::Capabilities]

content_hints[RW]

Additional information about the content of the file. These fields are never populated in responses. Corresponds to the JSON property `contentHints` @return [Google::Apis::DriveV3::File::ContentHints]

created_time[RW]

The time at which the file was created (RFC 3339 date-time). Corresponds to the JSON property `createdTime` @return [DateTime]

description[RW]

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

explicitly_trashed[RW]

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

explicitly_trashed?[RW]

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

file_extension[RW]

The final component of fullFileExtension. This is only available for files with binary content in Drive. Corresponds to the JSON property `fileExtension` @return [String]

folder_color_rgb[RW]

The color for 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 will be used instead. Corresponds to the JSON property `folderColorRgb` @return [String]

full_file_extension[RW]

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

head_revision_id[RW]

The ID of the file's head revision. This is currently only available for files with binary content in Drive. 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]

Additional metadata about image media, if available. Corresponds to the JSON property `imageMediaMetadata` @return [Google::Apis::DriveV3::File::ImageMediaMetadata]

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]

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

last_modifying_user[RW]

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

md5_checksum[RW]

The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive. Corresponds to the JSON property `md5Checksum` @return [String]

mime_type[RW]

The MIME type of the file. Drive will attempt 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 will be imported if possible. The supported import formats are published in the About resource. Corresponds to the JSON property `mimeType` @return [String]

modified_by_me_time[RW]

The last time the file was modified by the user (RFC 3339 date-time). Corresponds to the JSON property `modifiedByMeTime` @return [DateTime]

modified_time[RW]

The last time the file was modified by anyone (RFC 3339 date-time). Note that setting modifiedTime will also update modifiedByMeTime for the user. Corresponds to the JSON property `modifiedTime` @return [DateTime]

name[RW]

The name of the file. This is not necessarily unique within a folder. Corresponds to the JSON property `name` @return [String]

original_filename[RW]

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

owned_by_me[RW]

Whether the user owns the file. Corresponds to the JSON property `ownedByMe` @return [Boolean]

owned_by_me?[RW]

Whether the user owns the file. Corresponds to the JSON property `ownedByMe` @return [Boolean]

owners[RW]

The owners of the file. Currently, only certain legacy files may have more than one owner. Corresponds to the JSON property `owners` @return [Array<Google::Apis::DriveV3::User>]

parents[RW]

The IDs of the parent folders which contain the file. If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values. Corresponds to the JSON property `parents` @return [Array<String>]

permissions[RW]

The full list of permissions for the file. This is only available if the requesting user can share the file. Corresponds to the JSON property `permissions` @return [Array<Google::Apis::DriveV3::Permission>]

properties[RW]

A collection of arbitrary key-value pairs which are visible to all apps. Entries with null values are cleared in update and copy requests. Corresponds to the JSON property `properties` @return [Hash<String,String>]

quota_bytes_used[RW]

The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled. Corresponds to the JSON property `quotaBytesUsed` @return [String]

shared[RW]

Whether the file has been shared. Corresponds to the JSON property `shared` @return [Boolean]

shared?[RW]

Whether the file has been shared. Corresponds to the JSON property `shared` @return [Boolean]

shared_with_me_time[RW]

The time at which the file was shared with the user, if applicable (RFC 3339 date-time). Corresponds to the JSON property `sharedWithMeTime` @return [DateTime]

sharing_user[RW]

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

size[RW]

The size of the file's content in bytes. This is only applicable to files with binary content in Drive. Corresponds to the JSON property `size` @return [String]

spaces[RW]

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

starred[RW]

Whether the user has starred the file. Corresponds to the JSON property `starred` @return [Boolean]

starred?[RW]

Whether the user has starred the file. Corresponds to the JSON property `starred` @return [Boolean]

trashed[RW]

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

trashed?[RW]

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

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

video_media_metadata[RW]

Additional metadata about video media. This may not be available immediately upon upload. Corresponds to the JSON property `videoMediaMetadata` @return [Google::Apis::DriveV3::File::VideoMediaMetadata]

viewed_by_me[RW]

Whether the file has been viewed by this user. Corresponds to the JSON property `viewedByMe` @return [Boolean]

viewed_by_me?[RW]

Whether the file has been viewed by this user. Corresponds to the JSON property `viewedByMe` @return [Boolean]

viewed_by_me_time[RW]

The last time the file was viewed by the user (RFC 3339 date-time). Corresponds to the JSON property `viewedByMeTime` @return [DateTime]

viewers_can_copy_content[RW]

Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations. Corresponds to the JSON property `viewersCanCopyContent` @return [Boolean]

viewers_can_copy_content?[RW]

Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations. Corresponds to the JSON property `viewersCanCopyContent` @return [Boolean]

writers_can_share[RW]

Whether users with only writer permission can modify the file's permissions. Corresponds to the JSON property `writersCanShare` @return [Boolean]

writers_can_share?[RW]

Whether users with only writer permission can modify the file's permissions. Corresponds to the JSON property `writersCanShare` @return [Boolean]

Public Class Methods

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

Public Instance Methods

update!(**args) click to toggle source

Update properties of this object

# File generated/google/apis/drive_v3/classes.rb, line 723
def update!(**args)
  @app_properties = args[:app_properties] if args.key?(:app_properties)
  @capabilities = args[:capabilities] if args.key?(:capabilities)
  @content_hints = args[:content_hints] if args.key?(:content_hints)
  @created_time = args[:created_time] if args.key?(:created_time)
  @description = args[:description] if args.key?(:description)
  @explicitly_trashed = args[:explicitly_trashed] if args.key?(:explicitly_trashed)
  @file_extension = args[:file_extension] if args.key?(:file_extension)
  @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)
  @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)
  @is_app_authorized = args[:is_app_authorized] if args.key?(:is_app_authorized)
  @kind = args[:kind] if args.key?(:kind)
  @last_modifying_user = args[:last_modifying_user] if args.key?(:last_modifying_user)
  @md5_checksum = args[:md5_checksum] if args.key?(:md5_checksum)
  @mime_type = args[:mime_type] if args.key?(:mime_type)
  @modified_by_me_time = args[:modified_by_me_time] if args.key?(:modified_by_me_time)
  @modified_time = args[:modified_time] if args.key?(:modified_time)
  @name = args[:name] if args.key?(:name)
  @original_filename = args[:original_filename] if args.key?(:original_filename)
  @owned_by_me = args[:owned_by_me] if args.key?(:owned_by_me)
  @owners = args[:owners] if args.key?(:owners)
  @parents = args[:parents] if args.key?(:parents)
  @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)
  @shared = args[:shared] if args.key?(:shared)
  @shared_with_me_time = args[:shared_with_me_time] if args.key?(:shared_with_me_time)
  @sharing_user = args[:sharing_user] if args.key?(:sharing_user)
  @size = args[:size] if args.key?(:size)
  @spaces = args[:spaces] if args.key?(:spaces)
  @starred = args[:starred] if args.key?(:starred)
  @thumbnail_link = args[:thumbnail_link] if args.key?(:thumbnail_link)
  @trashed = args[:trashed] if args.key?(:trashed)
  @version = args[:version] if args.key?(:version)
  @video_media_metadata = args[:video_media_metadata] if args.key?(:video_media_metadata)
  @viewed_by_me = args[:viewed_by_me] if args.key?(:viewed_by_me)
  @viewed_by_me_time = args[:viewed_by_me_time] if args.key?(:viewed_by_me_time)
  @viewers_can_copy_content = args[:viewers_can_copy_content] if args.key?(:viewers_can_copy_content)
  @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