Class: Google::Apis::DriveV2::Permission

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

Overview

A permission for a file. A permission grants a user, group, domain, or the world access to a file or a folder hierarchy. Some resource methods (such as permissions.update) require a permissionId. Use the permissions.list method to retrieve the ID for a file, folder, or shared drive.

Defined Under Namespace

Classes: PermissionDetail, TeamDrivePermissionDetail

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Permission

Returns a new instance of Permission.



3712
3713
3714
# File 'lib/google/apis/drive_v2/classes.rb', line 3712

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

Instance Attribute Details

#additional_rolesArray<String>

Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. Corresponds to the JSON property additionalRoles

Returns:

  • (Array<String>)


3589
3590
3591
# File 'lib/google/apis/drive_v2/classes.rb', line 3589

def additional_roles
  @additional_roles
end

#auth_keyString

Output only. Deprecated. Corresponds to the JSON property authKey

Returns:

  • (String)


3594
3595
3596
# File 'lib/google/apis/drive_v2/classes.rb', line 3594

def auth_key
  @auth_key
end

#deletedBoolean Also known as: deleted?

Output only. 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

Returns:

  • (Boolean)


3600
3601
3602
# File 'lib/google/apis/drive_v2/classes.rb', line 3600

def deleted
  @deleted
end

#domainString

Output only. 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

Returns:

  • (String)


3608
3609
3610
# File 'lib/google/apis/drive_v2/classes.rb', line 3608

def domain
  @domain
end

#email_addressString

Output only. 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

Returns:

  • (String)


3615
3616
3617
# File 'lib/google/apis/drive_v2/classes.rb', line 3615

def email_address
  @email_address
end

#etagString

Output only. The ETag of the permission. Corresponds to the JSON property etag

Returns:

  • (String)


3620
3621
3622
# File 'lib/google/apis/drive_v2/classes.rb', line 3620

def etag
  @etag
end

#expiration_dateDateTime

The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: - 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

Returns:

  • (DateTime)


3629
3630
3631
# File 'lib/google/apis/drive_v2/classes.rb', line 3629

def expiration_date
  @expiration_date
end

#idString

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

Returns:

  • (String)


3638
3639
3640
# File 'lib/google/apis/drive_v2/classes.rb', line 3638

def id
  @id
end

#kindString

Output only. This is always drive#permission. Corresponds to the JSON property kind

Returns:

  • (String)


3643
3644
3645
# File 'lib/google/apis/drive_v2/classes.rb', line 3643

def kind
  @kind
end

#nameString

Output only. The name for this permission. Corresponds to the JSON property name

Returns:

  • (String)


3648
3649
3650
# File 'lib/google/apis/drive_v2/classes.rb', line 3648

def name
  @name
end

#pending_ownerBoolean Also known as: pending_owner?

Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. Corresponds to the JSON property pendingOwner

Returns:

  • (Boolean)


3654
3655
3656
# File 'lib/google/apis/drive_v2/classes.rb', line 3654

def pending_owner
  @pending_owner
end

#permission_detailsArray<Google::Apis::DriveV2::Permission::PermissionDetail>

Output only. 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



3662
3663
3664
# File 'lib/google/apis/drive_v2/classes.rb', line 3662

def permission_details
  @permission_details
end

Output only. A link to the profile photo, if available. Corresponds to the JSON property photoLink

Returns:

  • (String)


3667
3668
3669
# File 'lib/google/apis/drive_v2/classes.rb', line 3667

def photo_link
  @photo_link
end

#roleString

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

Returns:

  • (String)


3674
3675
3676
# File 'lib/google/apis/drive_v2/classes.rb', line 3674

def role
  @role
end

Output only. A link back to this permission. Corresponds to the JSON property selfLink

Returns:

  • (String)


3679
3680
3681
# File 'lib/google/apis/drive_v2/classes.rb', line 3679

def self_link
  @self_link
end

#team_drive_permission_detailsArray<Google::Apis::DriveV2::Permission::TeamDrivePermissionDetail>

Output only. Deprecated: Use permissionDetails instead. Corresponds to the JSON property teamDrivePermissionDetails



3684
3685
3686
# File 'lib/google/apis/drive_v2/classes.rb', line 3684

def team_drive_permission_details
  @team_drive_permission_details
end

#typeString

The account type. Allowed values are: * user * group * domain * anyone Corresponds to the JSON property type

Returns:

  • (String)


3689
3690
3691
# File 'lib/google/apis/drive_v2/classes.rb', line 3689

def type
  @type
end

#valueString

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

Returns:

  • (String)


3698
3699
3700
# File 'lib/google/apis/drive_v2/classes.rb', line 3698

def value
  @value
end

#viewString

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

Returns:

  • (String)


3704
3705
3706
# File 'lib/google/apis/drive_v2/classes.rb', line 3704

def view
  @view
end

Whether the link is required for this permission. Corresponds to the JSON property withLink

Returns:

  • (Boolean)


3709
3710
3711
# File 'lib/google/apis/drive_v2/classes.rb', line 3709

def with_link
  @with_link
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
# File 'lib/google/apis/drive_v2/classes.rb', line 3717

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)
  @pending_owner = args[:pending_owner] if args.key?(:pending_owner)
  @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