class Google::Apis::DriveV2::Permission

A permission for a file.

Attributes

additional_roles[RW]

Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. Corresponds to the JSON property `additionalRoles` @return [Array<String>]

auth_key[RW]

Deprecated. Corresponds to the JSON property `authKey` @return [String]

deleted[RW]

Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. Corresponds to the JSON property `deleted` @return [Boolean]

deleted?[RW]

Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. Corresponds to the JSON property `deleted` @return [Boolean]

domain[RW]

The domain name of the entity this permission refers to. This is an output- only field which is present when the permission type is user, group or domain. Corresponds to the JSON property `domain` @return [String]

email_address[RW]

The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group. Corresponds to the JSON property `emailAddress` @return [String]

etag[RW]

The ETag of the permission. Corresponds to the JSON property `etag` @return [String]

expiration_date[RW]

The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:

  • They cannot be set on shared drive items

  • They can only be set on user and group permissions

  • The date must be in the future

  • The date cannot be more than a year in the future

  • The date can only be set on drive.permissions.update or drive.permissions.

patch requests Corresponds to the JSON property `expirationDate` @return [DateTime]

id[RW]

The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions. insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored. Corresponds to the JSON property `id` @return [String]

kind[RW]

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

name[RW]

The name for this permission. Corresponds to the JSON property `name` @return [String]

permission_details[RW]

Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. Corresponds to the JSON property `permissionDetails` @return [Array<Google::Apis::DriveV2::Permission::PermissionDetail>]

role[RW]

The primary role for this user. While new values may be supported in the future, the following are currently allowed:

  • owner

  • organizer

  • fileOrganizer

  • writer

  • reader

Corresponds to the JSON property `role` @return [String]

team_drive_permission_details[RW]

Deprecated - use permissionDetails instead. Corresponds to the JSON property `teamDrivePermissionDetails` @return [Array<Google::Apis::DriveV2::Permission::TeamDrivePermissionDetail>]

type[RW]

The account type. Allowed values are:

  • user

  • group

  • domain

  • anyone

Corresponds to the JSON property `type` @return [String]

value[RW]

The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored. Corresponds to the JSON property `value` @return [String]

view[RW]

Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. Corresponds to the JSON property `view` @return [String]

Public Class Methods

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

Public Instance Methods

update!(**args) click to toggle source

Update properties of this object

# File lib/google/apis/drive_v2/classes.rb, line 3256
def update!(**args)
  @additional_roles = args[:additional_roles] if args.key?(:additional_roles)
  @auth_key = args[:auth_key] if args.key?(:auth_key)
  @deleted = args[:deleted] if args.key?(:deleted)
  @domain = args[:domain] if args.key?(:domain)
  @email_address = args[:email_address] if args.key?(:email_address)
  @etag = args[:etag] if args.key?(:etag)
  @expiration_date = args[:expiration_date] if args.key?(:expiration_date)
  @id = args[:id] if args.key?(:id)
  @kind = args[:kind] if args.key?(:kind)
  @name = args[:name] if args.key?(:name)
  @permission_details = args[:permission_details] if args.key?(:permission_details)
  @photo_link = args[:photo_link] if args.key?(:photo_link)
  @role = args[:role] if args.key?(:role)
  @self_link = args[:self_link] if args.key?(:self_link)
  @team_drive_permission_details = args[:team_drive_permission_details] if args.key?(:team_drive_permission_details)
  @type = args[:type] if args.key?(:type)
  @value = args[:value] if args.key?(:value)
  @view = args[:view] if args.key?(:view)
  @with_link = args[:with_link] if args.key?(:with_link)
end