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 this 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



1931
1932
1933
# File 'generated/google/apis/drive_v2/classes.rb', line 1931

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)


1768
1769
1770
# File 'generated/google/apis/drive_v2/classes.rb', line 1768

def can_add_children
  @can_add_children
end

#can_change_copy_requires_writer_permissionBoolean Also known as: can_change_copy_requires_writer_permission?

Whether the current user can change the copyRequiresWriterPermission restriction of this file. Corresponds to the JSON property canChangeCopyRequiresWriterPermission

Returns:

  • (Boolean)


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

def can_change_copy_requires_writer_permission
  @can_change_copy_requires_writer_permission
end

#can_change_restricted_downloadBoolean Also known as: can_change_restricted_download?

Deprecated Corresponds to the JSON property canChangeRestrictedDownload

Returns:

  • (Boolean)


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

def can_change_restricted_download
  @can_change_restricted_download
end

#can_commentBoolean Also known as: can_comment?

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

Returns:

  • (Boolean)


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

def can_comment
  @can_comment
end

#can_copyBoolean Also known as: can_copy?

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

Returns:

  • (Boolean)


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

def can_copy
  @can_copy
end

#can_deleteBoolean Also known as: can_delete?

Whether the current user can delete this file. Corresponds to the JSON property canDelete

Returns:

  • (Boolean)


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

def can_delete
  @can_delete
end

#can_delete_childrenBoolean Also known as: can_delete_children?

Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for Team Drive items. Corresponds to the JSON property canDeleteChildren

Returns:

  • (Boolean)


1808
1809
1810
# File 'generated/google/apis/drive_v2/classes.rb', line 1808

def can_delete_children
  @can_delete_children
end

#can_downloadBoolean Also known as: can_download?

Whether the current user can download this file. Corresponds to the JSON property canDownload

Returns:

  • (Boolean)


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

def can_download
  @can_download
end

#can_editBoolean Also known as: can_edit?

Whether the current user can edit this file. Corresponds to the JSON property canEdit

Returns:

  • (Boolean)


1820
1821
1822
# File 'generated/google/apis/drive_v2/classes.rb', line 1820

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)


1827
1828
1829
# File 'generated/google/apis/drive_v2/classes.rb', line 1827

def can_list_children
  @can_list_children
end

#can_move_children_out_of_team_driveBoolean Also known as: can_move_children_out_of_team_drive?

Whether the current user can move children of this folder outside of the Team Drive. This is false when the item is not a folder. Only populated for Team Drive items. Corresponds to the JSON property canMoveChildrenOutOfTeamDrive

Returns:

  • (Boolean)


1835
1836
1837
# File 'generated/google/apis/drive_v2/classes.rb', line 1835

def can_move_children_out_of_team_drive
  @can_move_children_out_of_team_drive
end

#can_move_children_within_team_driveBoolean Also known as: can_move_children_within_team_drive?

Whether the current user can move children of this folder within the Team Drive. This is false when the item is not a folder. Only populated for Team Drive items. Corresponds to the JSON property canMoveChildrenWithinTeamDrive

Returns:

  • (Boolean)


1843
1844
1845
# File 'generated/google/apis/drive_v2/classes.rb', line 1843

def can_move_children_within_team_drive
  @can_move_children_within_team_drive
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)


1850
1851
1852
# File 'generated/google/apis/drive_v2/classes.rb', line 1850

def can_move_item_into_team_drive
  @can_move_item_into_team_drive
end

#can_move_item_out_of_team_driveBoolean Also known as: can_move_item_out_of_team_drive?

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

Returns:

  • (Boolean)


1859
1860
1861
# File 'generated/google/apis/drive_v2/classes.rb', line 1859

def can_move_item_out_of_team_drive
  @can_move_item_out_of_team_drive
end

#can_move_item_within_team_driveBoolean Also known as: can_move_item_within_team_drive?

Whether the current user can move this Team Drive item within this Team Drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for Team Drive items. Corresponds to the JSON property canMoveItemWithinTeamDrive

Returns:

  • (Boolean)


1867
1868
1869
# File 'generated/google/apis/drive_v2/classes.rb', line 1867

def can_move_item_within_team_drive
  @can_move_item_within_team_drive
end

#can_move_team_drive_itemBoolean Also known as: can_move_team_drive_item?

Deprecated - use canMoveItemWithinTeamDrive or canMoveItemOutOfTeamDrive instead. Corresponds to the JSON property canMoveTeamDriveItem

Returns:

  • (Boolean)


1874
1875
1876
# File 'generated/google/apis/drive_v2/classes.rb', line 1874

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 can read the revisions resource of this 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)


1882
1883
1884
# File 'generated/google/apis/drive_v2/classes.rb', line 1882

def can_read_revisions
  @can_read_revisions
end

#can_read_team_driveBoolean Also known as: can_read_team_drive?

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

Returns:

  • (Boolean)


1889
1890
1891
# File 'generated/google/apis/drive_v2/classes.rb', line 1889

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. For Team Drive items, use canDeleteChildren or canTrashChildren instead. Corresponds to the JSON property canRemoveChildren

Returns:

  • (Boolean)


1897
1898
1899
# File 'generated/google/apis/drive_v2/classes.rb', line 1897

def can_remove_children
  @can_remove_children
end

#can_renameBoolean Also known as: can_rename?

Whether the current user can rename this file. Corresponds to the JSON property canRename

Returns:

  • (Boolean)


1903
1904
1905
# File 'generated/google/apis/drive_v2/classes.rb', line 1903

def can_rename
  @can_rename
end

#can_shareBoolean Also known as: can_share?

Whether the current user can modify the sharing settings for this file. Corresponds to the JSON property canShare

Returns:

  • (Boolean)


1909
1910
1911
# File 'generated/google/apis/drive_v2/classes.rb', line 1909

def can_share
  @can_share
end

#can_trashBoolean Also known as: can_trash?

Whether the current user can move this file to trash. Corresponds to the JSON property canTrash

Returns:

  • (Boolean)


1915
1916
1917
# File 'generated/google/apis/drive_v2/classes.rb', line 1915

def can_trash
  @can_trash
end

#can_trash_childrenBoolean Also known as: can_trash_children?

Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for Team Drive items. Corresponds to the JSON property canTrashChildren

Returns:

  • (Boolean)


1922
1923
1924
# File 'generated/google/apis/drive_v2/classes.rb', line 1922

def can_trash_children
  @can_trash_children
end

#can_untrashBoolean Also known as: can_untrash?

Whether the current user can restore this file from trash. Corresponds to the JSON property canUntrash

Returns:

  • (Boolean)


1928
1929
1930
# File 'generated/google/apis/drive_v2/classes.rb', line 1928

def can_untrash
  @can_untrash
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
# File 'generated/google/apis/drive_v2/classes.rb', line 1936

def update!(**args)
  @can_add_children = args[:can_add_children] if args.key?(:can_add_children)
  @can_change_copy_requires_writer_permission = args[:can_change_copy_requires_writer_permission] if args.key?(:can_change_copy_requires_writer_permission)
  @can_change_restricted_download = args[:can_change_restricted_download] if args.key?(:can_change_restricted_download)
  @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_delete_children = args[:can_delete_children] if args.key?(:can_delete_children)
  @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_children_out_of_team_drive = args[:can_move_children_out_of_team_drive] if args.key?(:can_move_children_out_of_team_drive)
  @can_move_children_within_team_drive = args[:can_move_children_within_team_drive] if args.key?(:can_move_children_within_team_drive)
  @can_move_item_into_team_drive = args[:can_move_item_into_team_drive] if args.key?(:can_move_item_into_team_drive)
  @can_move_item_out_of_team_drive = args[:can_move_item_out_of_team_drive] if args.key?(:can_move_item_out_of_team_drive)
  @can_move_item_within_team_drive = args[:can_move_item_within_team_drive] if args.key?(:can_move_item_within_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_trash_children = args[:can_trash_children] if args.key?(:can_trash_children)
  @can_untrash = args[:can_untrash] if args.key?(:can_untrash)
end