Class: Google::Apis::DriveV2::File::Capabilities

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

Overview

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

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) ⇒ Capabilities

Returns a new instance of Capabilities



1815
1816
1817
# File 'generated/google/apis/drive_v2/classes.rb', line 1815

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

Instance Attribute Details

#can_add_childrenBoolean Also known as: can_add_children?

Whether the current user can add children to this folder. This is always false when the item is not a folder. Corresponds to the JSON property canAddChildren

Returns:

  • (Boolean)


1711
1712
1713
# File 'generated/google/apis/drive_v2/classes.rb', line 1711

def can_add_children
  @can_add_children
end

#can_commentBoolean Also known as: can_comment?

Whether the current user can comment on the file. Corresponds to the JSON property canComment

Returns:

  • (Boolean)


1717
1718
1719
# File 'generated/google/apis/drive_v2/classes.rb', line 1717

def can_comment
  @can_comment
end

#can_copyBoolean Also known as: can_copy?

Whether the file can be copied by the current user. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied. Corresponds to the JSON property canCopy

Returns:

  • (Boolean)


1725
1726
1727
# File 'generated/google/apis/drive_v2/classes.rb', line 1725

def can_copy
  @can_copy
end

#can_deleteBoolean Also known as: can_delete?

Whether the file can be deleted by the current user. Corresponds to the JSON property canDelete

Returns:

  • (Boolean)


1731
1732
1733
# File 'generated/google/apis/drive_v2/classes.rb', line 1731

def can_delete
  @can_delete
end

#can_downloadBoolean Also known as: can_download?

Whether the file can be downloaded by the current user. Corresponds to the JSON property canDownload

Returns:

  • (Boolean)


1737
1738
1739
# File 'generated/google/apis/drive_v2/classes.rb', line 1737

def can_download
  @can_download
end

#can_editBoolean Also known as: can_edit?

Whether the file can be edited by the current user. Corresponds to the JSON property canEdit

Returns:

  • (Boolean)


1743
1744
1745
# File 'generated/google/apis/drive_v2/classes.rb', line 1743

def can_edit
  @can_edit
end

#can_list_childrenBoolean Also known as: can_list_children?

Whether the current user can list the children of this folder. This is always false when the item is not a folder. Corresponds to the JSON property canListChildren

Returns:

  • (Boolean)


1750
1751
1752
# File 'generated/google/apis/drive_v2/classes.rb', line 1750

def can_list_children
  @can_list_children
end

#can_move_item_into_team_driveBoolean Also known as: can_move_item_into_team_drive?

Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem. Corresponds to the JSON property canMoveItemIntoTeamDrive

Returns:

  • (Boolean)


1757
1758
1759
# File 'generated/google/apis/drive_v2/classes.rb', line 1757

def can_move_item_into_team_drive
  @can_move_item_into_team_drive
end

#can_move_team_drive_itemBoolean Also known as: can_move_team_drive_item?

Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files. Corresponds to the JSON property canMoveTeamDriveItem

Returns:

  • (Boolean)


1766
1767
1768
# File 'generated/google/apis/drive_v2/classes.rb', line 1766

def can_move_team_drive_item
  @can_move_team_drive_item
end

#can_read_revisionsBoolean Also known as: can_read_revisions?

Whether the current user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. Corresponds to the JSON property canReadRevisions

Returns:

  • (Boolean)


1774
1775
1776
# File 'generated/google/apis/drive_v2/classes.rb', line 1774

def can_read_revisions
  @can_read_revisions
end

#can_read_team_driveBoolean Also known as: can_read_team_drive?

Whether the current user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files. Corresponds to the JSON property canReadTeamDrive

Returns:

  • (Boolean)


1781
1782
1783
# File 'generated/google/apis/drive_v2/classes.rb', line 1781

def can_read_team_drive
  @can_read_team_drive
end

#can_remove_childrenBoolean Also known as: can_remove_children?

Whether the current user can remove children from this folder. This is always false when the item is not a folder. Corresponds to the JSON property canRemoveChildren

Returns:

  • (Boolean)


1788
1789
1790
# File 'generated/google/apis/drive_v2/classes.rb', line 1788

def can_remove_children
  @can_remove_children
end

#can_renameBoolean Also known as: can_rename?

Whether the file can be renamed by the current user. Corresponds to the JSON property canRename

Returns:

  • (Boolean)


1794
1795
1796
# File 'generated/google/apis/drive_v2/classes.rb', line 1794

def can_rename
  @can_rename
end

#can_shareBoolean Also known as: can_share?

Whether the file's sharing settings can be modified by the current user. Corresponds to the JSON property canShare

Returns:

  • (Boolean)


1800
1801
1802
# File 'generated/google/apis/drive_v2/classes.rb', line 1800

def can_share
  @can_share
end

#can_trashBoolean Also known as: can_trash?

Whether the file can be trashed by the current user. Corresponds to the JSON property canTrash

Returns:

  • (Boolean)


1806
1807
1808
# File 'generated/google/apis/drive_v2/classes.rb', line 1806

def can_trash
  @can_trash
end

#can_untrashBoolean Also known as: can_untrash?

Whether the file can be restored from the trash by the current user. Corresponds to the JSON property canUntrash

Returns:

  • (Boolean)


1812
1813
1814
# File 'generated/google/apis/drive_v2/classes.rb', line 1812

def can_untrash
  @can_untrash
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
# File 'generated/google/apis/drive_v2/classes.rb', line 1820

def update!(**args)
  @can_add_children = args[:can_add_children] if args.key?(:can_add_children)
  @can_comment = args[:can_comment] if args.key?(:can_comment)
  @can_copy = args[:can_copy] if args.key?(:can_copy)
  @can_delete = args[:can_delete] if args.key?(:can_delete)
  @can_download = args[:can_download] if args.key?(:can_download)
  @can_edit = args[:can_edit] if args.key?(:can_edit)
  @can_list_children = args[:can_list_children] if args.key?(:can_list_children)
  @can_move_item_into_team_drive = args[:can_move_item_into_team_drive] if args.key?(:can_move_item_into_team_drive)
  @can_move_team_drive_item = args[:can_move_team_drive_item] if args.key?(:can_move_team_drive_item)
  @can_read_revisions = args[:can_read_revisions] if args.key?(:can_read_revisions)
  @can_read_team_drive = args[:can_read_team_drive] if args.key?(:can_read_team_drive)
  @can_remove_children = args[:can_remove_children] if args.key?(:can_remove_children)
  @can_rename = args[:can_rename] if args.key?(:can_rename)
  @can_share = args[:can_share] if args.key?(:can_share)
  @can_trash = args[:can_trash] if args.key?(:can_trash)
  @can_untrash = args[:can_untrash] if args.key?(:can_untrash)
end