Class: Google::Apis::DriveV2::ContentRestriction

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 restriction for accessing the content of the file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ContentRestriction

Returns a new instance of ContentRestriction.



1427
1428
1429
# File 'lib/google/apis/drive_v2/classes.rb', line 1427

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

Instance Attribute Details

#owner_restrictedBoolean Also known as: owner_restricted?

Whether the content restriction can only be modified or removed by a user who owns the file. For files in shared drives, any user with organizer capabilities can modify or remove this content restriction. Corresponds to the JSON property ownerRestricted

Returns:

  • (Boolean)


1385
1386
1387
# File 'lib/google/apis/drive_v2/classes.rb', line 1385

def owner_restricted
  @owner_restricted
end

#read_onlyBoolean Also known as: read_only?

Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. Corresponds to the JSON property readOnly

Returns:

  • (Boolean)


1393
1394
1395
# File 'lib/google/apis/drive_v2/classes.rb', line 1393

def read_only
  @read_only
end

#reasonString

Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true. Corresponds to the JSON property reason

Returns:

  • (String)


1400
1401
1402
# File 'lib/google/apis/drive_v2/classes.rb', line 1400

def reason
  @reason
end

#restricting_userGoogle::Apis::DriveV2::User

Information about a Drive user. Corresponds to the JSON property restrictingUser



1405
1406
1407
# File 'lib/google/apis/drive_v2/classes.rb', line 1405

def restricting_user
  @restricting_user
end

#restriction_dateDateTime

The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. Corresponds to the JSON property restrictionDate

Returns:

  • (DateTime)


1411
1412
1413
# File 'lib/google/apis/drive_v2/classes.rb', line 1411

def restriction_date
  @restriction_date
end

#system_restrictedBoolean Also known as: system_restricted?

Output only. Whether the content restriction was applied by the system, for example due to an esignature. Users cannot modify or remove system restricted content restrictions. Corresponds to the JSON property systemRestricted

Returns:

  • (Boolean)


1418
1419
1420
# File 'lib/google/apis/drive_v2/classes.rb', line 1418

def system_restricted
  @system_restricted
end

#typeString

Output only. The type of the content restriction. Currently the only possible value is globalContentRestriction. Corresponds to the JSON property type

Returns:

  • (String)


1425
1426
1427
# File 'lib/google/apis/drive_v2/classes.rb', line 1425

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1432
1433
1434
1435
1436
1437
1438
1439
1440
# File 'lib/google/apis/drive_v2/classes.rb', line 1432

def update!(**args)
  @owner_restricted = args[:owner_restricted] if args.key?(:owner_restricted)
  @read_only = args[:read_only] if args.key?(:read_only)
  @reason = args[:reason] if args.key?(:reason)
  @restricting_user = args[:restricting_user] if args.key?(:restricting_user)
  @restriction_date = args[:restriction_date] if args.key?(:restriction_date)
  @system_restricted = args[:system_restricted] if args.key?(:system_restricted)
  @type = args[:type] if args.key?(:type)
end