gam7 7.10.4__py3-none-any.whl → 7.10.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gam7 might be problematic. Click here for more details.
- gam/__init__.py +41 -11
- gam/gamlib/glgapi.py +6 -2
- {gam7-7.10.4.dist-info → gam7-7.10.6.dist-info}/METADATA +1 -1
- {gam7-7.10.4.dist-info → gam7-7.10.6.dist-info}/RECORD +7 -7
- {gam7-7.10.4.dist-info → gam7-7.10.6.dist-info}/WHEEL +0 -0
- {gam7-7.10.4.dist-info → gam7-7.10.6.dist-info}/entry_points.txt +0 -0
- {gam7-7.10.4.dist-info → gam7-7.10.6.dist-info}/licenses/LICENSE +0 -0
gam/__init__.py
CHANGED
|
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
27
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
|
28
|
-
__version__ = '7.10.
|
|
28
|
+
__version__ = '7.10.06'
|
|
29
29
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
|
30
30
|
|
|
31
31
|
#pylint: disable=wrong-import-position
|
|
@@ -29508,6 +29508,7 @@ def getCIDeviceEntity():
|
|
|
29508
29508
|
return ([], ci, customer, False)
|
|
29509
29509
|
|
|
29510
29510
|
DEVICE_USERNAME_PATTERN = re.compile(r'^(devices/.+)/(deviceUsers/.+)$')
|
|
29511
|
+
DEVICE_USERNAME_CLIENT_STATE_PATTERN = re.compile(r'^(devices/.+/deviceUsers/.+)/clientStates/(.+)$')
|
|
29511
29512
|
DEVICE_USERNAME_FORMAT_REQUIRED = 'devices/<String>/deviceUsers/<String>'
|
|
29512
29513
|
def getCIDeviceUserEntity():
|
|
29513
29514
|
ci = buildGAPICIDeviceServiceObject()
|
|
@@ -29956,6 +29957,7 @@ DEVICE_ORDERBY_CHOICE_MAP = {
|
|
|
29956
29957
|
# [orderby <DeviceOrderByFieldName> [ascending|descending]]
|
|
29957
29958
|
# [all|company|personal|nocompanydevices|nopersonaldevices]
|
|
29958
29959
|
# [nodeviceusers|oneuserperrow]
|
|
29960
|
+
# [clientstates]
|
|
29959
29961
|
# [formatjson [quotechar <Character>]]
|
|
29960
29962
|
# [showitemcountonly]
|
|
29961
29963
|
def doPrintCIDevices():
|
|
@@ -29971,6 +29973,7 @@ def doPrintCIDevices():
|
|
|
29971
29973
|
queries = [None]
|
|
29972
29974
|
view, entityType = DEVICE_VIEW_CHOICE_MAP['all']
|
|
29973
29975
|
getDeviceUsers = True
|
|
29976
|
+
getClientStates = False
|
|
29974
29977
|
oneUserPerRow = showItemCountOnly = False
|
|
29975
29978
|
while Cmd.ArgumentsRemaining():
|
|
29976
29979
|
myarg = getArgument()
|
|
@@ -29986,6 +29989,8 @@ def doPrintCIDevices():
|
|
|
29986
29989
|
view, entityType = DEVICE_VIEW_CHOICE_MAP[myarg]
|
|
29987
29990
|
elif myarg == 'nodeviceusers':
|
|
29988
29991
|
getDeviceUsers = False
|
|
29992
|
+
elif myarg == 'clientstates':
|
|
29993
|
+
getClientStates = True
|
|
29989
29994
|
elif myarg in {'oneuserperrow', 'oneitemperrow'}:
|
|
29990
29995
|
getDeviceUsers = oneUserPerRow = True
|
|
29991
29996
|
elif getFieldsList(myarg, DEVICE_FIELDS_CHOICE_MAP, fieldsList, initialField='name'):
|
|
@@ -30004,14 +30009,16 @@ def doPrintCIDevices():
|
|
|
30004
30009
|
if FJQC.formatJSON and oneUserPerRow:
|
|
30005
30010
|
csvPF.SetJSONTitles(['name', 'user.name', 'JSON'])
|
|
30006
30011
|
itemCount = 0
|
|
30012
|
+
throwReasons = [GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED]
|
|
30013
|
+
retryReasons = GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS
|
|
30007
30014
|
for query in queries:
|
|
30008
30015
|
printGettingAllAccountEntities(entityType, query)
|
|
30009
30016
|
pageMessage = getPageMessage()
|
|
30010
30017
|
try:
|
|
30011
30018
|
devices = callGAPIpages(ci.devices(), 'list', 'devices',
|
|
30012
30019
|
pageMessage=pageMessage,
|
|
30013
|
-
throwReasons=
|
|
30014
|
-
retryReasons=
|
|
30020
|
+
throwReasons=throwReasons,
|
|
30021
|
+
retryReasons=retryReasons,
|
|
30015
30022
|
customer=customer, filter=query,
|
|
30016
30023
|
orderBy=OBY.orderBy, view=view, fields=fields, pageSize=100)
|
|
30017
30024
|
if showItemCountOnly:
|
|
@@ -30030,10 +30037,27 @@ def doPrintCIDevices():
|
|
|
30030
30037
|
try:
|
|
30031
30038
|
deviceUsers = callGAPIpages(ci.devices().deviceUsers(), 'list', 'deviceUsers',
|
|
30032
30039
|
pageMessage=pageMessage,
|
|
30033
|
-
throwReasons=
|
|
30034
|
-
retryReasons=
|
|
30040
|
+
throwReasons=throwReasons,
|
|
30041
|
+
retryReasons=retryReasons,
|
|
30035
30042
|
customer=customer, filter=query, parent=parent,
|
|
30036
30043
|
orderBy=OBY.orderBy, fields=userFields, pageSize=20)
|
|
30044
|
+
if getClientStates:
|
|
30045
|
+
printGettingAllAccountEntities(Ent.DEVICE_USER_CLIENT_STATE, None)
|
|
30046
|
+
states = callGAPIpages(ci.devices().deviceUsers().clientStates(), 'list', 'clientStates',
|
|
30047
|
+
pageMessage=pageMessage,
|
|
30048
|
+
throwReasons=throwReasons,
|
|
30049
|
+
retryReasons=retryReasons,
|
|
30050
|
+
customer=customer, filter=query, parent='devices/-/deviceUsers/-')
|
|
30051
|
+
for state in states:
|
|
30052
|
+
mg = DEVICE_USERNAME_CLIENT_STATE_PATTERN.match(state['name'])
|
|
30053
|
+
if mg:
|
|
30054
|
+
du = mg.group(1)
|
|
30055
|
+
state_name = mg.group(2)
|
|
30056
|
+
for i in range(len(deviceUsers)):
|
|
30057
|
+
if deviceUsers[i]['name'] == du:
|
|
30058
|
+
deviceUsers[i].setdefault('clientstates', {})
|
|
30059
|
+
deviceUsers[i]['clientstates'][state_name] = state
|
|
30060
|
+
break
|
|
30037
30061
|
for deviceUser in deviceUsers:
|
|
30038
30062
|
mg = DEVICE_USERNAME_PATTERN.match(deviceUser['name'])
|
|
30039
30063
|
if mg:
|
|
@@ -59527,7 +59551,8 @@ def _copyPermissions(drive, user, i, count, j, jcount,
|
|
|
59527
59551
|
entityActionPerformed(kvList, k, kcount)
|
|
59528
59552
|
except (GAPI.notFound, GAPI.permissionNotFound,
|
|
59529
59553
|
GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.insufficientFilePermissions, GAPI.unknownError,
|
|
59530
|
-
GAPI.fileNeverWritable, GAPI.badRequest, GAPI.cannotRemoveOwner,
|
|
59554
|
+
GAPI.fileNeverWritable, GAPI.badRequest, GAPI.cannotRemoveOwner,
|
|
59555
|
+
GAPI.cannotModifyInheritedTeamDrivePermission, GAPI.cannotModifyInheritedPermission,
|
|
59531
59556
|
GAPI.insufficientAdministratorPrivileges, GAPI.sharingRateLimitExceeded, GAPI.cannotDeletePermission) as e:
|
|
59532
59557
|
entityActionFailedWarning(kvList, str(e), k, kcount)
|
|
59533
59558
|
except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
|
|
@@ -59554,7 +59579,8 @@ def _copyPermissions(drive, user, i, count, j, jcount,
|
|
|
59554
59579
|
entityActionPerformed(kvList, k, kcount)
|
|
59555
59580
|
except (GAPI.notFound, GAPI.permissionNotFound,
|
|
59556
59581
|
GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.insufficientFilePermissions, GAPI.unknownError,
|
|
59557
|
-
GAPI.fileNeverWritable, GAPI.badRequest, GAPI.cannotRemoveOwner,
|
|
59582
|
+
GAPI.fileNeverWritable, GAPI.badRequest, GAPI.cannotRemoveOwner,
|
|
59583
|
+
GAPI.cannotModifyInheritedTeamDrivePermission, GAPI.cannotModifyInheritedPermission,
|
|
59558
59584
|
GAPI.insufficientAdministratorPrivileges, GAPI.sharingRateLimitExceeded) as e:
|
|
59559
59585
|
entityActionFailedWarning(kvList, str(e), k, kcount)
|
|
59560
59586
|
except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
|
|
@@ -60561,7 +60587,8 @@ def _updateMoveFilePermissions(drive, user, i, count,
|
|
|
60561
60587
|
entityActionPerformed(kvList, k, kcount)
|
|
60562
60588
|
except (GAPI.notFound, GAPI.permissionNotFound,
|
|
60563
60589
|
GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.insufficientFilePermissions, GAPI.unknownError,
|
|
60564
|
-
GAPI.fileNeverWritable, GAPI.badRequest, GAPI.cannotRemoveOwner,
|
|
60590
|
+
GAPI.fileNeverWritable, GAPI.badRequest, GAPI.cannotRemoveOwner,
|
|
60591
|
+
GAPI.cannotModifyInheritedTeamDrivePermission, GAPI.cannotModifyInheritedPermission,
|
|
60565
60592
|
GAPI.insufficientAdministratorPrivileges, GAPI.sharingRateLimitExceeded, GAPI.cannotDeletePermission) as e:
|
|
60566
60593
|
entityActionFailedWarning(kvList, str(e), k, kcount)
|
|
60567
60594
|
except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
|
|
@@ -63984,7 +64011,8 @@ def updateDriveFileACLs(users, useDomainAdminAccess=False):
|
|
|
63984
64011
|
GAPI.targetUserRoleLimitedByLicenseRestriction, GAPI.insufficientAdministratorPrivileges,
|
|
63985
64012
|
GAPI.publishOutNotPermitted, GAPI.shareInNotPermitted, GAPI.shareOutNotPermitted, GAPI.shareOutNotPermittedToUser,
|
|
63986
64013
|
GAPI.organizerOnNonTeamDriveItemNotSupported, GAPI.fileOrganizerOnNonTeamDriveNotSupported,
|
|
63987
|
-
GAPI.cannotUpdatePermission, GAPI.cannotModifyInheritedTeamDrivePermission, GAPI.
|
|
64014
|
+
GAPI.cannotUpdatePermission, GAPI.cannotModifyInheritedTeamDrivePermission, GAPI.cannotModifyInheritedPermission,
|
|
64015
|
+
GAPI.fieldNotWritable) as e:
|
|
63988
64016
|
entityActionFailedWarning([Ent.USER, user, entityType, fileName], str(e), j, jcount)
|
|
63989
64017
|
except (GAPI.notFound, GAPI.teamDriveDomainUsersOnlyRestriction, GAPI.teamDriveTeamMembersOnlyRestriction,
|
|
63990
64018
|
GAPI.cannotShareTeamDriveTopFolderWithAnyoneOrDomains, GAPI.ownerOnTeamDriveItemNotSupported,
|
|
@@ -64257,7 +64285,8 @@ def deleteDriveFileACLs(users, useDomainAdminAccess=False):
|
|
|
64257
64285
|
if updateSheetProtectedRanges and mimeType == MIMETYPE_GA_SPREADSHEET:
|
|
64258
64286
|
_updateSheetProtectedRangesACLchange(sheet, user, i, count, j, jcount, fileId, fileName, False, permission)
|
|
64259
64287
|
except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.insufficientFilePermissions, GAPI.unknownError,
|
|
64260
|
-
GAPI.fileNeverWritable, GAPI.badRequest, GAPI.cannotRemoveOwner,
|
|
64288
|
+
GAPI.fileNeverWritable, GAPI.badRequest, GAPI.cannotRemoveOwner,
|
|
64289
|
+
GAPI.cannotModifyInheritedTeamDrivePermission, GAPI.cannotModifyInheritedPermission,
|
|
64261
64290
|
GAPI.insufficientAdministratorPrivileges, GAPI.sharingRateLimitExceeded, GAPI.cannotDeletePermission) as e:
|
|
64262
64291
|
entityActionFailedWarning([Ent.USER, user, entityType, fileName], str(e), j, jcount)
|
|
64263
64292
|
except GAPI.notFound as e:
|
|
@@ -64313,7 +64342,8 @@ def deletePermissions(users, useDomainAdminAccess=False):
|
|
|
64313
64342
|
fileId=ri[RI_ENTITY], permissionId=ri[RI_ITEM], supportsAllDrives=True)
|
|
64314
64343
|
entityActionPerformed([Ent.DRIVE_FILE_OR_FOLDER_ID, ri[RI_ENTITY], Ent.PERMISSION_ID, ri[RI_ITEM]], int(ri[RI_J]), int(ri[RI_JCOUNT]))
|
|
64315
64344
|
except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.insufficientFilePermissions, GAPI.unknownError,
|
|
64316
|
-
GAPI.badRequest, GAPI.cannotRemoveOwner,
|
|
64345
|
+
GAPI.badRequest, GAPI.cannotRemoveOwner,
|
|
64346
|
+
GAPI.cannotModifyInheritedTeamDrivePermission, GAPI.cannotModifyInheritedPermission,
|
|
64317
64347
|
GAPI.insufficientAdministratorPrivileges, GAPI.sharingRateLimitExceeded, GAPI.permissionNotFound, GAPI.cannotDeletePermission,
|
|
64318
64348
|
GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
|
|
64319
64349
|
entityActionFailedWarning([Ent.DRIVE_FILE_OR_FOLDER_ID, ri[RI_ENTITY], Ent.PERMISSION_ID, ri[RI_ITEM]], str(e), int(ri[RI_J]), int(ri[RI_JCOUNT]))
|
gam/gamlib/glgapi.py
CHANGED
|
@@ -41,6 +41,7 @@ CANNOT_DELETE_PERMISSION = 'cannotDeletePermission'
|
|
|
41
41
|
CANNOT_DELETE_PRIMARY_CALENDAR = 'cannotDeletePrimaryCalendar'
|
|
42
42
|
CANNOT_DELETE_PRIMARY_SENDAS = 'cannotDeletePrimarySendAs'
|
|
43
43
|
CANNOT_DELETE_RESOURCE_WITH_CHILDREN = 'cannotDeleteResourceWithChildren'
|
|
44
|
+
CANNOT_MODIFY_INHERITED_PERMISSION = 'cannotModifyInheritedPermission'
|
|
44
45
|
CANNOT_MODIFY_INHERITED_TEAMDRIVE_PERMISSION = 'cannotModifyInheritedTeamDrivePermission'
|
|
45
46
|
CANNOT_MODIFY_RESTRICTED_LABEL = 'cannotModifyRestrictedLabel'
|
|
46
47
|
CANNOT_MODIFY_VIEWERS_CAN_COPY_CONTENT = 'cannotModifyViewersCanCopyContent'
|
|
@@ -248,10 +249,10 @@ DRIVE3_UPDATE_ACL_THROW_REASONS = [BAD_REQUEST, INVALID_OWNERSHIP_TRANSFER, CANN
|
|
|
248
249
|
FILE_ORGANIZER_ON_FOLDERS_IN_SHARED_DRIVE_ONLY,
|
|
249
250
|
FILE_ORGANIZER_ON_NON_TEAMDRIVE_NOT_SUPPORTED,
|
|
250
251
|
CANNOT_UPDATE_PERMISSION,
|
|
251
|
-
CANNOT_MODIFY_INHERITED_TEAMDRIVE_PERMISSION,
|
|
252
|
+
CANNOT_MODIFY_INHERITED_TEAMDRIVE_PERMISSION, CANNOT_MODIFY_INHERITED_PERMISSION,
|
|
252
253
|
FIELD_NOT_WRITABLE, PERMISSION_NOT_FOUND]
|
|
253
254
|
DRIVE3_DELETE_ACL_THROW_REASONS = [BAD_REQUEST, CANNOT_REMOVE_OWNER,
|
|
254
|
-
CANNOT_MODIFY_INHERITED_TEAMDRIVE_PERMISSION,
|
|
255
|
+
CANNOT_MODIFY_INHERITED_TEAMDRIVE_PERMISSION, CANNOT_MODIFY_INHERITED_PERMISSION,
|
|
255
256
|
INSUFFICIENT_ADMINISTRATOR_PRIVILEGES, SHARING_RATE_LIMIT_EXCEEDED,
|
|
256
257
|
NOT_FOUND, PERMISSION_NOT_FOUND, CANNOT_DELETE_PERMISSION]
|
|
257
258
|
DRIVE3_MODIFY_LABEL_THROW_REASONS = DRIVE_USER_THROW_REASONS+[FILE_NOT_FOUND, NOT_FOUND, FORBIDDEN, INTERNAL_ERROR,
|
|
@@ -398,6 +399,8 @@ class cannotDeletePrimarySendAs(Exception):
|
|
|
398
399
|
pass
|
|
399
400
|
class cannotDeleteResourceWithChildren(Exception):
|
|
400
401
|
pass
|
|
402
|
+
class cannotModifyInheritedPermission(Exception):
|
|
403
|
+
pass
|
|
401
404
|
class cannotModifyInheritedTeamDrivePermission(Exception):
|
|
402
405
|
pass
|
|
403
406
|
class cannotModifyRestrictedLabel(Exception):
|
|
@@ -698,6 +701,7 @@ REASON_EXCEPTION_MAP = {
|
|
|
698
701
|
CANNOT_DELETE_PRIMARY_CALENDAR: cannotDeletePrimaryCalendar,
|
|
699
702
|
CANNOT_DELETE_PRIMARY_SENDAS: cannotDeletePrimarySendAs,
|
|
700
703
|
CANNOT_DELETE_RESOURCE_WITH_CHILDREN: cannotDeleteResourceWithChildren,
|
|
704
|
+
CANNOT_MODIFY_INHERITED_PERMISSION: cannotModifyInheritedPermission,
|
|
701
705
|
CANNOT_MODIFY_INHERITED_TEAMDRIVE_PERMISSION: cannotModifyInheritedTeamDrivePermission,
|
|
702
706
|
CANNOT_MODIFY_RESTRICTED_LABEL: cannotModifyRestrictedLabel,
|
|
703
707
|
CANNOT_MODIFY_VIEWERS_CAN_COPY_CONTENT: cannotModifyViewersCanCopyContent,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
gam/__init__.py,sha256=
|
|
1
|
+
gam/__init__.py,sha256=yvibVAzILcATl-jk73JqR_QHSzQVd911lW-8937nM10,3533835
|
|
2
2
|
gam/__main__.py,sha256=amz0-959ph6zkZKqjaar4n60yho-T37w6qWI36qx0CA,1049
|
|
3
3
|
gam/cacerts.pem,sha256=82Ak7btW_2XvocLUvAwPmpx8Chi0oqtZUG1gseLK_t4,50235
|
|
4
4
|
gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
|
|
@@ -27,7 +27,7 @@ gam/gamlib/glapi.py,sha256=A6kdyCacc9tvTaxMUNvWj8jWbOrss8e8XdkqF1xbN70,34572
|
|
|
27
27
|
gam/gamlib/glcfg.py,sha256=bNTckxzIM_HruxO2DfYsDbEgqOIz1RX6CbU6XOQQQyg,28296
|
|
28
28
|
gam/gamlib/glclargs.py,sha256=Ohe746FOQqMlXlutH-XJ6E1unYNzf_EJhdubnPp3new,42472
|
|
29
29
|
gam/gamlib/glentity.py,sha256=c9-7MAp0HruXEUVq8Nwkllxc4KypFeZRUFkvVzPwrwk,33760
|
|
30
|
-
gam/gamlib/glgapi.py,sha256=
|
|
30
|
+
gam/gamlib/glgapi.py,sha256=648jvjKK5rT9Qdyz5Ybh6wAO6sxUwQu1L_ogRqj0zZ0,39762
|
|
31
31
|
gam/gamlib/glgdata.py,sha256=weRppttWm6uRyqtBoGPKoHiNZ2h28nhfUV4J_mbCszY,2707
|
|
32
32
|
gam/gamlib/glglobals.py,sha256=J0xcHggVrUBzHJ5GruenKV-qV1zPKcK2qWgAgN3i5Jw,9608
|
|
33
33
|
gam/gamlib/glindent.py,sha256=RfBa2LDfLIqPLL5vMfC689TCVmqn8xf-qulSzkiatrc,1228
|
|
@@ -65,8 +65,8 @@ gam/googleapiclient/discovery_cache/base.py,sha256=yCDPtxnbNN-p5_9fzBacC6P3wcUPl
|
|
|
65
65
|
gam/googleapiclient/discovery_cache/file_cache.py,sha256=sim3Mg4HgRYo3vX75jvcKy_aV568EvIrtBfvfbw-044,4774
|
|
66
66
|
gam/iso8601/__init__.py,sha256=Z2PsYbXgAH5a5xzUvgczCboPzqWpm65kRcIngCnhViU,1218
|
|
67
67
|
gam/iso8601/iso8601.py,sha256=Li2FHZ4sBTWuthuQhyCvmvj0j6At8JbGzkSv2fc2RHU,4384
|
|
68
|
-
gam7-7.10.
|
|
69
|
-
gam7-7.10.
|
|
70
|
-
gam7-7.10.
|
|
71
|
-
gam7-7.10.
|
|
72
|
-
gam7-7.10.
|
|
68
|
+
gam7-7.10.6.dist-info/METADATA,sha256=HOvXQLyeFroUAFznW21mso2g7EIQJBKU2n0hy-vBYfs,2978
|
|
69
|
+
gam7-7.10.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
70
|
+
gam7-7.10.6.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
|
|
71
|
+
gam7-7.10.6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
72
|
+
gam7-7.10.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|