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.



1373
1374
1375
# File 'lib/google/apis/drive_v2/classes.rb', line 1373

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

Instance Attribute Details

#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)


1347
1348
1349
# File 'lib/google/apis/drive_v2/classes.rb', line 1347

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)


1354
1355
1356
# File 'lib/google/apis/drive_v2/classes.rb', line 1354

def reason
  @reason
end

#restricting_userGoogle::Apis::DriveV2::User

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



1359
1360
1361
# File 'lib/google/apis/drive_v2/classes.rb', line 1359

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)


1365
1366
1367
# File 'lib/google/apis/drive_v2/classes.rb', line 1365

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


1371
1372
1373
# File 'lib/google/apis/drive_v2/classes.rb', line 1371

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1378
1379
1380
1381
1382
1383
1384
# File 'lib/google/apis/drive_v2/classes.rb', line 1378

def update!(**args)
  @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)
  @type = args[:type] if args.key?(:type)
end