Added option contentrestrictions ownerrestricted [<Boolean>] to <DriveFileAttribute>.

This commit is contained in:
Ross Scroggs
2023-07-27 10:00:54 -07:00
parent e26cda1d6b
commit 01aaff9b83
3 changed files with 16 additions and 17 deletions

View File

@ -5833,9 +5833,7 @@ gam <UserTypeEntity> show datastudiopermissions
<FileSelector> | <CSVFileSelector> | <CSVkmdSelector> | <CSVSubkeySelector> | <CSVDataSelector>) <FileSelector> | <CSVFileSelector> | <CSVkmdSelector> | <CSVSubkeySelector> | <CSVDataSelector>)
<DriveFileAttribute> ::= <DriveFileAttribute> ::=
(contentrestrictions ownerrestricted [<Boolean>])| (contentrestrictions (readonly false)|(readonly true [reason <String>]) [ownerrestricted [<Boolean>]])|
(contentrestrictions readonly false)|
(contentrestrictions readonly true [reason <String>])|
(copyrequireswriterpermission [<Boolean>])| (copyrequireswriterpermission [<Boolean>])|
(description <String>)| (description <String>)|
(folderColorRgb <ColorValue>)| (folderColorRgb <ColorValue>)|
@ -5906,9 +5904,7 @@ gam <UserTypeEntity> update drivefile <DriveFileEntity> [copy] [returnidonly|ret
[charset <CharSet>] [columndelimiter <Character>] [charset <CharSet>] [columndelimiter <Character>]
<DriveFileCopyAttribute> ::= <DriveFileCopyAttribute> ::=
(contentrestrictions ownerrestricted [<Boolean>])| (contentrestrictions (readonly false)|(readonly true [reason <String>]) [ownerrestricted [<Boolean>]])|
(contentrestrictions readonly false)|
(contentrestrictions readonly true [reason <String>])|
(copyrequireswriterpermission [<Boolean>])| (copyrequireswriterpermission [<Boolean>])|
(description <String>)| (description <String>)|
ignoredefaultvisibility| ignoredefaultvisibility|

View File

@ -11,7 +11,7 @@ Added option `contentrestrictions ownerrestricted [<Boolean>]` to `<DriveFileAtt
Added `aggregatebyuser [Boolean]` option to `gam report user` to allow data aggregation for users across multiple dates. Added `aggregatebyuser [Boolean]` option to `gam report user` to allow data aggregation for users across multiple dates.
Options `aggregatebyuser` and `aggregatebydate` are mutually exclusive. Options `aggregatebyuser` and `aggregatebydate` are mutually exclusive.
* https://github.com/taers232c/GAMADV-XTD3/wiki/Reports#user-reports * See: https://github.com/taers232c/GAMADV-XTD3/wiki/Reports#user-reports
6.61.13 6.61.13

View File

@ -48669,13 +48669,14 @@ DRIVEFILE_PROPERTY_VISIBILITY_CHOICE_MAP = {
DRIVE_FILE_CONTENT_RESTRICTIONS_CHOICE_MAP = { DRIVE_FILE_CONTENT_RESTRICTIONS_CHOICE_MAP = {
'readonly': 'readOnly', 'readonly': 'readOnly',
'ownerrestricted': 'ownerRestricted',
} }
def getDriveFileProperty(visibility=None): def getDriveFileProperty(visibility=None):
key = getString(Cmd.OB_PROPERTY_KEY) key = getString(Cmd.OB_PROPERTY_KEY)
value = getString(Cmd.OB_PROPERTY_VALUE, minLen=0) or None value = getString(Cmd.OB_PROPERTY_VALUE, minLen=0) or None
if visibility is None: if visibility is None:
if Cmd.PeekArgumentPresent(DRIVEFILE_PROPERTY_VISIBILITY_CHOICE_MAP): if Cmd.PeekArgumentPresent(list(DRIVEFILE_PROPERTY_VISIBILITY_CHOICE_MAP.keys())):
visibility = getChoice(DRIVEFILE_PROPERTY_VISIBILITY_CHOICE_MAP, mapChoice=True) visibility = getChoice(DRIVEFILE_PROPERTY_VISIBILITY_CHOICE_MAP, mapChoice=True)
else: else:
visibility = 'properties' visibility = 'properties'
@ -48746,16 +48747,17 @@ def getDriveFileCopyAttribute(myarg, body, parameters):
elif myarg == 'writerscantshare': elif myarg == 'writerscantshare':
body['writersCanShare'] = not getBoolean() body['writersCanShare'] = not getBoolean()
elif myarg == 'contentrestrictions': elif myarg == 'contentrestrictions':
body['contentRestrictions'] = [{}] while Cmd.PeekArgumentPresent(list(DRIVE_FILE_CONTENT_RESTRICTIONS_CHOICE_MAP.keys())):
restriction = getChoice(DRIVE_FILE_CONTENT_RESTRICTIONS_CHOICE_MAP, mapChoice=True) body.setdefault('contentRestrictions', [{}])
if restriction == 'readOnly': restriction = getChoice(DRIVE_FILE_CONTENT_RESTRICTIONS_CHOICE_MAP, mapChoice=True)
body['contentRestrictions'][0][restriction] = getBoolean() body['contentRestrictions'][0][restriction] = getBoolean()
if checkArgumentPresent(['reason']): if restriction == 'readOnly':
if body['contentRestrictions'][0][restriction]: if checkArgumentPresent(['reason']):
body['contentRestrictions'][0]['reason'] = getString(Cmd.OB_STRING, minLen=0) if body['contentRestrictions'][0][restriction]:
else: body['contentRestrictions'][0]['reason'] = getString(Cmd.OB_STRING, minLen=0)
Cmd.Backup() else:
usageErrorExit(Msg.REASON_ONLY_VALID_WITH_CONTENTRESTRICTIONS_READONLY_TRUE) Cmd.Backup()
usageErrorExit(Msg.REASON_ONLY_VALID_WITH_CONTENTRESTRICTIONS_READONLY_TRUE)
elif myarg == 'property': elif myarg == 'property':
driveprop = getDriveFileProperty() driveprop = getDriveFileProperty()
body.setdefault(driveprop['visibility'], {}) body.setdefault(driveprop['visibility'], {})
@ -49647,6 +49649,7 @@ DRIVE_CAPABILITIES_SUBFIELDS_CHOICE_MAP = {
} }
DRIVE_CONTENT_RESTRICTIONS_SUBFIELDS_CHOICE_MAP = { DRIVE_CONTENT_RESTRICTIONS_SUBFIELDS_CHOICE_MAP = {
'ownerrestricted': 'ownerRestricted',
'readonly': 'readOnly', 'readonly': 'readOnly',
'reason': 'reason', 'reason': 'reason',
'restrictinguser': 'restructingUser', 'restrictinguser': 'restructingUser',