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.


2501
2502
2503
# File 'generated/google/apis/drive_v2/classes.rb', line 2501

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)

2274
2275
2276
# File 'generated/google/apis/drive_v2/classes.rb', line 2274

def can_add_children
  @can_add_children
end

#can_add_folder_from_another_driveBoolean Also known as: can_add_folder_from_another_drive?

Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. Corresponds to the JSON property canAddFolderFromAnotherDrive

Returns:

  • (Boolean)

2282
2283
2284
# File 'generated/google/apis/drive_v2/classes.rb', line 2282

def can_add_folder_from_another_drive
  @can_add_folder_from_another_drive
end

#can_add_my_drive_parentBoolean Also known as: can_add_my_drive_parent?

Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. Corresponds to the JSON property canAddMyDriveParent

Returns:

  • (Boolean)

2289
2290
2291
# File 'generated/google/apis/drive_v2/classes.rb', line 2289

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

2296
2297
2298
# File 'generated/google/apis/drive_v2/classes.rb', line 2296

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)

2302
2303
2304
# File 'generated/google/apis/drive_v2/classes.rb', line 2302

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)

2308
2309
2310
# File 'generated/google/apis/drive_v2/classes.rb', line 2308

def can_comment
  @can_comment
end

#can_copyBoolean Also known as: can_copy?

Whether the current user can copy this file. For an item in a shared drive, 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)

2316
2317
2318
# File 'generated/google/apis/drive_v2/classes.rb', line 2316

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)

2322
2323
2324
# File 'generated/google/apis/drive_v2/classes.rb', line 2322

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 items in shared drives. Corresponds to the JSON property canDeleteChildren

Returns:

  • (Boolean)

2329
2330
2331
# File 'generated/google/apis/drive_v2/classes.rb', line 2329

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)

2335
2336
2337
# File 'generated/google/apis/drive_v2/classes.rb', line 2335

def can_download
  @can_download
end

#can_editBoolean Also known as: can_edit?

Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. Corresponds to the JSON property canEdit

Returns:

  • (Boolean)

2343
2344
2345
# File 'generated/google/apis/drive_v2/classes.rb', line 2343

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)

2350
2351
2352
# File 'generated/google/apis/drive_v2/classes.rb', line 2350

def can_list_children
  @can_list_children
end

#can_modify_contentBoolean Also known as: can_modify_content?

Whether the current user can modify the content of this file. Corresponds to the JSON property canModifyContent

Returns:

  • (Boolean)

2356
2357
2358
# File 'generated/google/apis/drive_v2/classes.rb', line 2356

def can_modify_content
  @can_modify_content
end

#can_modify_content_restrictionBoolean Also known as: can_modify_content_restriction?

Whether the current user can modify restrictions on content of this file. Corresponds to the JSON property canModifyContentRestriction

Returns:

  • (Boolean)

2362
2363
2364
# File 'generated/google/apis/drive_v2/classes.rb', line 2362

def can_modify_content_restriction
  @can_modify_content_restriction
end

#can_move_children_out_of_driveBoolean Also known as: can_move_children_out_of_drive?

Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. Corresponds to the JSON property canMoveChildrenOutOfDrive

Returns:

  • (Boolean)

2370
2371
2372
# File 'generated/google/apis/drive_v2/classes.rb', line 2370

def can_move_children_out_of_drive
  @can_move_children_out_of_drive
end

#can_move_children_out_of_team_driveBoolean Also known as: can_move_children_out_of_team_drive?

Deprecated - use canMoveChildrenOutOfDrive instead. Corresponds to the JSON property canMoveChildrenOutOfTeamDrive

Returns:

  • (Boolean)

2376
2377
2378
# File 'generated/google/apis/drive_v2/classes.rb', line 2376

def can_move_children_out_of_team_drive
  @can_move_children_out_of_team_drive
end

#can_move_children_within_driveBoolean Also known as: can_move_children_within_drive?

Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. Corresponds to the JSON property canMoveChildrenWithinDrive

Returns:

  • (Boolean)

2385
2386
2387
# File 'generated/google/apis/drive_v2/classes.rb', line 2385

def can_move_children_within_drive
  @can_move_children_within_drive
end

#can_move_children_within_team_driveBoolean Also known as: can_move_children_within_team_drive?

Deprecated - use canMoveChildrenWithinDrive instead. Corresponds to the JSON property canMoveChildrenWithinTeamDrive

Returns:

  • (Boolean)

2391
2392
2393
# File 'generated/google/apis/drive_v2/classes.rb', line 2391

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?

Deprecated - use canMoveItemOutOfDrive instead. Corresponds to the JSON property canMoveItemIntoTeamDrive

Returns:

  • (Boolean)

2397
2398
2399
# File 'generated/google/apis/drive_v2/classes.rb', line 2397

def can_move_item_into_team_drive
  @can_move_item_into_team_drive
end

#can_move_item_out_of_driveBoolean Also known as: can_move_item_out_of_drive?

Whether the current user can move this item outside of this 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. Corresponds to the JSON property canMoveItemOutOfDrive

Returns:

  • (Boolean)

2405
2406
2407
# File 'generated/google/apis/drive_v2/classes.rb', line 2405

def can_move_item_out_of_drive
  @can_move_item_out_of_drive
end

#can_move_item_out_of_team_driveBoolean Also known as: can_move_item_out_of_team_drive?

Deprecated - use canMoveItemOutOfDrive instead. Corresponds to the JSON property canMoveItemOutOfTeamDrive

Returns:

  • (Boolean)

2411
2412
2413
# File 'generated/google/apis/drive_v2/classes.rb', line 2411

def can_move_item_out_of_team_drive
  @can_move_item_out_of_team_drive
end

#can_move_item_within_driveBoolean Also known as: can_move_item_within_drive?

Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. Corresponds to the JSON property canMoveItemWithinDrive

Returns:

  • (Boolean)

2419
2420
2421
# File 'generated/google/apis/drive_v2/classes.rb', line 2419

def can_move_item_within_drive
  @can_move_item_within_drive
end

#can_move_item_within_team_driveBoolean Also known as: can_move_item_within_team_drive?

Deprecated - use canMoveItemWithinDrive instead. Corresponds to the JSON property canMoveItemWithinTeamDrive

Returns:

  • (Boolean)

2425
2426
2427
# File 'generated/google/apis/drive_v2/classes.rb', line 2425

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 canMoveItemWithinDrive or canMoveItemOutOfDrive instead. Corresponds to the JSON property canMoveTeamDriveItem

Returns:

  • (Boolean)

2431
2432
2433
# File 'generated/google/apis/drive_v2/classes.rb', line 2431

def can_move_team_drive_item
  @can_move_team_drive_item
end

#can_read_driveBoolean Also known as: can_read_drive?

Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. Corresponds to the JSON property canReadDrive

Returns:

  • (Boolean)

2438
2439
2440
# File 'generated/google/apis/drive_v2/classes.rb', line 2438

def can_read_drive
  @can_read_drive
end

#can_read_revisionsBoolean Also known as: can_read_revisions?

Whether the current user can read the revisions resource of this file. For a shared 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)

2446
2447
2448
# File 'generated/google/apis/drive_v2/classes.rb', line 2446

def can_read_revisions
  @can_read_revisions
end

#can_read_team_driveBoolean Also known as: can_read_team_drive?

Deprecated - use canReadDrive instead. Corresponds to the JSON property canReadTeamDrive

Returns:

  • (Boolean)

2452
2453
2454
# File 'generated/google/apis/drive_v2/classes.rb', line 2452

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 a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. Corresponds to the JSON property canRemoveChildren

Returns:

  • (Boolean)

2460
2461
2462
# File 'generated/google/apis/drive_v2/classes.rb', line 2460

def can_remove_children
  @can_remove_children
end

#can_remove_my_drive_parentBoolean Also known as: can_remove_my_drive_parent?

Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. Corresponds to the JSON property canRemoveMyDriveParent

Returns:

  • (Boolean)

2467
2468
2469
# File 'generated/google/apis/drive_v2/classes.rb', line 2467

def can_remove_my_drive_parent
  @can_remove_my_drive_parent
end

#can_renameBoolean Also known as: can_rename?

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

Returns:

  • (Boolean)

2473
2474
2475
# File 'generated/google/apis/drive_v2/classes.rb', line 2473

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)

2479
2480
2481
# File 'generated/google/apis/drive_v2/classes.rb', line 2479

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)

2485
2486
2487
# File 'generated/google/apis/drive_v2/classes.rb', line 2485

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 items in shared drives. Corresponds to the JSON property canTrashChildren

Returns:

  • (Boolean)

2492
2493
2494
# File 'generated/google/apis/drive_v2/classes.rb', line 2492

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)

2498
2499
2500
# File 'generated/google/apis/drive_v2/classes.rb', line 2498

def can_untrash
  @can_untrash
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
# File 'generated/google/apis/drive_v2/classes.rb', line 2506

def update!(**args)
  @can_add_children = args[:can_add_children] if args.key?(:can_add_children)
  @can_add_folder_from_another_drive = args[:can_add_folder_from_another_drive] if args.key?(:can_add_folder_from_another_drive)
  @can_add_my_drive_parent = args[:can_add_my_drive_parent] if args.key?(:can_add_my_drive_parent)
  @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_modify_content = args[:can_modify_content] if args.key?(:can_modify_content)
  @can_modify_content_restriction = args[:can_modify_content_restriction] if args.key?(:can_modify_content_restriction)
  @can_move_children_out_of_drive = args[:can_move_children_out_of_drive] if args.key?(:can_move_children_out_of_drive)
  @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_drive = args[:can_move_children_within_drive] if args.key?(:can_move_children_within_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_drive = args[:can_move_item_out_of_drive] if args.key?(:can_move_item_out_of_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_drive = args[:can_move_item_within_drive] if args.key?(:can_move_item_within_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_drive = args[:can_read_drive] if args.key?(:can_read_drive)
  @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_remove_my_drive_parent = args[:can_remove_my_drive_parent] if args.key?(:can_remove_my_drive_parent)
  @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