diff --git a/src/GamCommands.txt b/src/GamCommands.txt index 074e1236..c2f9bc51 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -4860,8 +4860,8 @@ gam sendemail from allowcontentmanagerstosharefolders| copyrequireswriterpermission| domainusersonly| - downloadrestrictedforreaders| - downloadrestrictedforwriters| + downloadrestrictedforreaders|downloadrestrictions.restrictedforreaders| + downloadrestrictedforwriters|downloadrestrictions.restrictedforwriters| drivemembersonly|teammembersonly| sharingfoldersrequiresorganizerpermission @@ -4878,7 +4878,7 @@ In these commands, the Google administrator named in oauth2.txt is used. gam show shareddrivethemes gam create shareddrive [(theme|themeid ) | ([customtheme ] [color ])] - ( )* + ([restrictions.] )* [hide|hidden ] [ou|org|orgunit ] [errorretries ] [updateinitialdelay ] [updateretrydelay ] [movetoorgunitdelay ] @@ -4932,7 +4932,7 @@ In these commands, you specify an administrator and then indicate that you want gam create shareddrive adminaccess [(theme|themeid ) | ([customtheme ] [color ])] - ( )* + ([restrictions.] )* [hide|hidden ] [ou|org|orgunit ] [errorretries ] [updateinitialdelay ] [updateretrydelay ] [movetoorgunitdelay ] @@ -4966,7 +4966,7 @@ In these commands, you specify a user, administrator access is not used. gam create shareddrive [(theme|themeid ) | ([customtheme ] [color ])] - ( )* + ([restrictions.] )* [hide|hidden ] [ou|org|orgunit ] [errorretries ] [updateinitialdelay ] [updateretrydelay ] [movetoorgunitdelay ] @@ -8475,8 +8475,8 @@ gam print tasklists [todrive *] allowcontentmanagerstosharefolders| copyrequireswriterpermission| domainusersonly| - downloadrestrictedforreaders| - downloadrestrictedforwriters| + downloadrestrictedforreaders|downloadrestrictions.restrictedforreaders| + downloadrestrictedforwriters|downloadrestrictions.restrictedforwriters| drivemembersonly|teammembersonly| sharingfoldersrequiresorganizerpermission @@ -8491,13 +8491,13 @@ sharingfoldersrequiresorganizerpermission true gam show shareddrivethemes gam create shareddrive [(theme|themeid ) | ([customtheme ] [color ])] - ( )* + ([restrictions.] )* [hide|hidden ] [errorretries ] [updateinitialdelay ] [updateretrydelay ] [(csv [todrive *] (addcsvdata )*) | returnidonly] gam update shareddrive [name ] [(theme|themeid ) | ([customtheme ] [color ])] - ( )* + ([restrictions.] )* [hide|hidden ] gam delete shareddrive [allowitemdeletion] diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 2f60a065..a3594377 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -1,3 +1,9 @@ +7.15.01 + +Added `downloadrestrictions.restrictedforreaders` and `downloadrestrictions.restrictedforwriters` +to ``; previously, only the abbreviations `downloadrestrictedforreaders` +and `downloadrestrictedforwriters` were supported (they are still supported). + 7.15.00 Updated `gam print shareddriveorganizers` to make `shownoorganizerdrives` default to `True` diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 7f29a059..f02a5533 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki """ __author__ = 'GAM Team ' -__version__ = '7.15.00' +__version__ = '7.15.01' __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' #pylint: disable=wrong-import-position @@ -60309,7 +60309,7 @@ def _checkForExistingShortcut(drive, fileId, fileName, parentId): supportsAllDrives=True, includeItemsFromAllDrives=True, q=f"shortcutDetails.targetId = '{fileId}' and trashed = False", fields='files(id,name,parents)')['files'] for shortcut in existingShortcuts: - if parentId in shortcut['parents'] and fileName == shortcut['name']: + if parentId in shortcut.get('parents', []) and fileName == shortcut['name']: return shortcut['id'] except (GAPI.invalidQuery, GAPI.invalid, GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy): pass @@ -65885,6 +65885,10 @@ SHAREDDRIVE_RESTRICTIONS_MAP = { 'sharingfoldersrequiresorganizerpermission': 'sharingFoldersRequiresOrganizerPermission', 'teammembersonly': 'driveMembersOnly', } +SHAREDDRIVE_DOWNLOAD_RESTRICTIONS_MAP = { + 'restrictedforreaders': 'downloadrestrictedforreaders', + 'restrictedforwriters': 'downloadrestrictedforwriters', + } def _getSharedDriveRestrictions(myarg, body): def _setRestriction(restriction): @@ -65899,7 +65903,12 @@ def _getSharedDriveRestrictions(myarg, body): if myarg.startswith('restrictions.'): _, subField = myarg.split('.', 1) - if subField in SHAREDDRIVE_RESTRICTIONS_MAP: + if subField.startswith('downloadrestrictions.'): + _, subField = subField.split('.', 1) + if subField in SHAREDDRIVE_DOWNLOAD_RESTRICTIONS_MAP: + _setRestriction(SHAREDDRIVE_DOWNLOAD_RESTRICTIONS_MAP[subField]) + return True + elif subField in SHAREDDRIVE_RESTRICTIONS_MAP: _setRestriction(subField) return True invalidChoiceExit(subField, SHAREDDRIVE_RESTRICTIONS_MAP, True)