Class: Google::Apis::DriveV3::File

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/drive_v3/classes.rb,
generated/google/apis/drive_v3/representations.rb,
generated/google/apis/drive_v3/representations.rb

Overview

The metadata for a file.

Defined Under Namespace

Classes: Capabilities, ContentHints, ImageMediaMetadata, VideoMediaMetadata

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ File

Returns a new instance of File.



723
724
725
# File 'generated/google/apis/drive_v3/classes.rb', line 723

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#app_propertiesHash<String,String>

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

Returns:

  • (Hash<String,String>)


459
460
461
# File 'generated/google/apis/drive_v3/classes.rb', line 459

def app_properties
  @app_properties
end

#capabilitiesGoogle::Apis::DriveV3::File::Capabilities

Capabilities the current user has on the file. Corresponds to the JSON property capabilities



464
465
466
# File 'generated/google/apis/drive_v3/classes.rb', line 464

def capabilities
  @capabilities
end

#content_hintsGoogle::Apis::DriveV3::File::ContentHints

Additional information about the content of the file. These fields are never populated in responses. Corresponds to the JSON property contentHints



470
471
472
# File 'generated/google/apis/drive_v3/classes.rb', line 470

def content_hints
  @content_hints
end

#created_timeDateTime

The time at which the file was created (RFC 3339 date-time). Corresponds to the JSON property createdTime

Returns:

  • (DateTime)


475
476
477
# File 'generated/google/apis/drive_v3/classes.rb', line 475

def created_time
  @created_time
end

#descriptionString

A short description of the file. Corresponds to the JSON property description

Returns:

  • (String)


480
481
482
# File 'generated/google/apis/drive_v3/classes.rb', line 480

def description
  @description
end

#explicitly_trashedBoolean Also known as: explicitly_trashed?

Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. Corresponds to the JSON property explicitlyTrashed

Returns:

  • (Boolean)


486
487
488
# File 'generated/google/apis/drive_v3/classes.rb', line 486

def explicitly_trashed
  @explicitly_trashed
end

#file_extensionString

The final component of fullFileExtension. This is only available for files with binary content in Drive. Corresponds to the JSON property fileExtension

Returns:

  • (String)


493
494
495
# File 'generated/google/apis/drive_v3/classes.rb', line 493

def file_extension
  @file_extension
end

#folder_color_rgbString

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

Returns:

  • (String)


501
502
503
# File 'generated/google/apis/drive_v3/classes.rb', line 501

def folder_color_rgb
  @folder_color_rgb
end

#full_file_extensionString

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

Returns:

  • (String)


510
511
512
# File 'generated/google/apis/drive_v3/classes.rb', line 510

def full_file_extension
  @full_file_extension
end

#head_revision_idString

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

Returns:

  • (String)


516
517
518
# File 'generated/google/apis/drive_v3/classes.rb', line 516

def head_revision_id
  @head_revision_id
end

A static, unauthenticated link to the file's icon. Corresponds to the JSON property iconLink

Returns:

  • (String)


521
522
523
# File 'generated/google/apis/drive_v3/classes.rb', line 521

def icon_link
  @icon_link
end

#idString

The ID of the file. Corresponds to the JSON property id

Returns:

  • (String)


526
527
528
# File 'generated/google/apis/drive_v3/classes.rb', line 526

def id
  @id
end

#image_media_metadataGoogle::Apis::DriveV3::File::ImageMediaMetadata

Additional metadata about image media, if available. Corresponds to the JSON property imageMediaMetadata



531
532
533
# File 'generated/google/apis/drive_v3/classes.rb', line 531

def 
  @image_media_metadata
end

#is_app_authorizedBoolean Also known as: is_app_authorized?

Whether the file was created or opened by the requesting app. Corresponds to the JSON property isAppAuthorized

Returns:

  • (Boolean)


536
537
538
# File 'generated/google/apis/drive_v3/classes.rb', line 536

def is_app_authorized
  @is_app_authorized
end

#kindString

Identifies what kind of resource this is. Value: the fixed string "drive#file". Corresponds to the JSON property kind

Returns:

  • (String)


542
543
544
# File 'generated/google/apis/drive_v3/classes.rb', line 542

def kind
  @kind
end

#last_modifying_userGoogle::Apis::DriveV3::User

Information about a Drive user. Corresponds to the JSON property lastModifyingUser



547
548
549
# File 'generated/google/apis/drive_v3/classes.rb', line 547

def last_modifying_user
  @last_modifying_user
end

#md5_checksumString

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

Returns:

  • (String)


553
554
555
# File 'generated/google/apis/drive_v3/classes.rb', line 553

def md5_checksum
  @md5_checksum
end

#mime_typeString

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

Returns:

  • (String)


564
565
566
# File 'generated/google/apis/drive_v3/classes.rb', line 564

def mime_type
  @mime_type
end

#modified_by_me_timeDateTime

The last time the file was modified by the user (RFC 3339 date-time). Corresponds to the JSON property modifiedByMeTime

Returns:

  • (DateTime)


569
570
571
# File 'generated/google/apis/drive_v3/classes.rb', line 569

def modified_by_me_time
  @modified_by_me_time
end

#modified_timeDateTime

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

Returns:

  • (DateTime)


575
576
577
# File 'generated/google/apis/drive_v3/classes.rb', line 575

def modified_time
  @modified_time
end

#nameString

The name of the file. This is not necessarily unique within a folder. Corresponds to the JSON property name

Returns:

  • (String)


580
581
582
# File 'generated/google/apis/drive_v3/classes.rb', line 580

def name
  @name
end

#original_filenameString

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

Returns:

  • (String)


587
588
589
# File 'generated/google/apis/drive_v3/classes.rb', line 587

def original_filename
  @original_filename
end

#owned_by_meBoolean Also known as: owned_by_me?

Whether the user owns the file. Corresponds to the JSON property ownedByMe

Returns:

  • (Boolean)


592
593
594
# File 'generated/google/apis/drive_v3/classes.rb', line 592

def owned_by_me
  @owned_by_me
end

#ownersArray<Google::Apis::DriveV3::User>

The owners of the file. Currently, only certain legacy files may have more than one owner. Corresponds to the JSON property owners

Returns:



599
600
601
# File 'generated/google/apis/drive_v3/classes.rb', line 599

def owners
  @owners
end

#parentsArray<String>

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

Returns:

  • (Array<String>)


607
608
609
# File 'generated/google/apis/drive_v3/classes.rb', line 607

def parents
  @parents
end

#permissionsArray<Google::Apis::DriveV3::Permission>

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



613
614
615
# File 'generated/google/apis/drive_v3/classes.rb', line 613

def permissions
  @permissions
end

#propertiesHash<String,String>

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

Returns:

  • (Hash<String,String>)


619
620
621
# File 'generated/google/apis/drive_v3/classes.rb', line 619

def properties
  @properties
end

#quota_bytes_usedString

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

Returns:

  • (String)


625
626
627
# File 'generated/google/apis/drive_v3/classes.rb', line 625

def quota_bytes_used
  @quota_bytes_used
end

#sharedBoolean Also known as: shared?

Whether the file has been shared. Corresponds to the JSON property shared

Returns:

  • (Boolean)


630
631
632
# File 'generated/google/apis/drive_v3/classes.rb', line 630

def shared
  @shared
end

#shared_with_me_timeDateTime

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

Returns:

  • (DateTime)


637
638
639
# File 'generated/google/apis/drive_v3/classes.rb', line 637

def shared_with_me_time
  @shared_with_me_time
end

#sharing_userGoogle::Apis::DriveV3::User

Information about a Drive user. Corresponds to the JSON property sharingUser



642
643
644
# File 'generated/google/apis/drive_v3/classes.rb', line 642

def sharing_user
  @sharing_user
end

#sizeString

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

Returns:

  • (String)


648
649
650
# File 'generated/google/apis/drive_v3/classes.rb', line 648

def size
  @size
end

#spacesArray<String>

The list of spaces which contain the file. The currently supported values are ' drive', 'appDataFolder' and 'photos'. Corresponds to the JSON property spaces

Returns:

  • (Array<String>)


654
655
656
# File 'generated/google/apis/drive_v3/classes.rb', line 654

def spaces
  @spaces
end

#starredBoolean Also known as: starred?

Whether the user has starred the file. Corresponds to the JSON property starred

Returns:

  • (Boolean)


659
660
661
# File 'generated/google/apis/drive_v3/classes.rb', line 659

def starred
  @starred
end

A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Corresponds to the JSON property thumbnailLink

Returns:

  • (String)


666
667
668
# File 'generated/google/apis/drive_v3/classes.rb', line 666

def thumbnail_link
  @thumbnail_link
end

#trashedBoolean Also known as: trashed?

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

Returns:

  • (Boolean)


673
674
675
# File 'generated/google/apis/drive_v3/classes.rb', line 673

def trashed
  @trashed
end

#versionString

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

Returns:

  • (String)


680
681
682
# File 'generated/google/apis/drive_v3/classes.rb', line 680

def version
  @version
end

#video_media_metadataGoogle::Apis::DriveV3::File::VideoMediaMetadata

Additional metadata about video media. This may not be available immediately upon upload. Corresponds to the JSON property videoMediaMetadata



686
687
688
# File 'generated/google/apis/drive_v3/classes.rb', line 686

def 
  @video_media_metadata
end

#viewed_by_meBoolean Also known as: viewed_by_me?

Whether the file has been viewed by this user. Corresponds to the JSON property viewedByMe

Returns:

  • (Boolean)


691
692
693
# File 'generated/google/apis/drive_v3/classes.rb', line 691

def viewed_by_me
  @viewed_by_me
end

#viewed_by_me_timeDateTime

The last time the file was viewed by the user (RFC 3339 date-time). Corresponds to the JSON property viewedByMeTime

Returns:

  • (DateTime)


697
698
699
# File 'generated/google/apis/drive_v3/classes.rb', line 697

def viewed_by_me_time
  @viewed_by_me_time
end

#viewers_can_copy_contentBoolean Also known as: viewers_can_copy_content?

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

Returns:

  • (Boolean)


703
704
705
# File 'generated/google/apis/drive_v3/classes.rb', line 703

def viewers_can_copy_content
  @viewers_can_copy_content
end

A link for downloading the content of the file in a browser. This is only available for files with binary content in Drive. Corresponds to the JSON property webContentLink

Returns:

  • (String)


710
711
712
# File 'generated/google/apis/drive_v3/classes.rb', line 710

def web_content_link
  @web_content_link
end

A link for opening the file in a relevant Google editor or viewer in a browser. Corresponds to the JSON property webViewLink

Returns:

  • (String)


715
716
717
# File 'generated/google/apis/drive_v3/classes.rb', line 715

def web_view_link
  @web_view_link
end

#writers_can_shareBoolean Also known as: writers_can_share?

Whether users with only writer permission can modify the file's permissions. Corresponds to the JSON property writersCanShare

Returns:

  • (Boolean)


720
721
722
# File 'generated/google/apis/drive_v3/classes.rb', line 720

def writers_can_share
  @writers_can_share
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
# File 'generated/google/apis/drive_v3/classes.rb', line 728

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