gam7 7.22.2__py3-none-any.whl → 7.22.5__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 +156 -92
- {gam7-7.22.2.dist-info → gam7-7.22.5.dist-info}/METADATA +1 -1
- {gam7-7.22.2.dist-info → gam7-7.22.5.dist-info}/RECORD +6 -6
- {gam7-7.22.2.dist-info → gam7-7.22.5.dist-info}/WHEEL +0 -0
- {gam7-7.22.2.dist-info → gam7-7.22.5.dist-info}/entry_points.txt +0 -0
- {gam7-7.22.2.dist-info → gam7-7.22.5.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.22.
|
|
28
|
+
__version__ = '7.22.05'
|
|
29
29
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
|
30
30
|
|
|
31
31
|
#pylint: disable=wrong-import-position
|
|
@@ -18989,10 +18989,10 @@ def doPrintAliases():
|
|
|
18989
18989
|
pass
|
|
18990
18990
|
elif myarg == 'select':
|
|
18991
18991
|
_, users = getEntityToModify(defaultEntityType=Cmd.ENTITY_USERS)
|
|
18992
|
-
elif myarg
|
|
18993
|
-
isSuspended =
|
|
18994
|
-
elif myarg
|
|
18995
|
-
isArchived =
|
|
18992
|
+
elif myarg == 'issuspended':
|
|
18993
|
+
isSuspended = getBoolean()
|
|
18994
|
+
elif myarg == 'isarchived':
|
|
18995
|
+
isArchived = getBoolean()
|
|
18996
18996
|
elif myarg in {'user','users'}:
|
|
18997
18997
|
users.extend(convertEntityToList(getString(Cmd.OB_EMAIL_ADDRESS_LIST, minLen=0)))
|
|
18998
18998
|
elif myarg in {'group', 'groups'}:
|
|
@@ -41654,7 +41654,7 @@ def convertQueryNameToID(v, nameOrId, matterId, matterNameId):
|
|
|
41654
41654
|
query = callGAPI(v.matters().savedQueries(), 'get',
|
|
41655
41655
|
throwReasons=[GAPI.NOT_FOUND, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.INVALID_ARGUMENT],
|
|
41656
41656
|
matterId=matterId, savedQueryId=cg.group(1))
|
|
41657
|
-
return (query['savedQueryId'], query['displayName'], formatVaultNameId(query['savedQueryId'], query['displayName']))
|
|
41657
|
+
return (query['savedQueryId'], query['displayName'], formatVaultNameId(query['savedQueryId'], query['displayName']), query['query'])
|
|
41658
41658
|
except (GAPI.notFound, GAPI.badRequest):
|
|
41659
41659
|
entityDoesNotHaveItemExit([Ent.VAULT_MATTER, matterNameId, Ent.VAULT_QUERY, nameOrId])
|
|
41660
41660
|
except (GAPI.forbidden, GAPI.invalidArgument) as e:
|
|
@@ -41663,12 +41663,12 @@ def convertQueryNameToID(v, nameOrId, matterId, matterNameId):
|
|
|
41663
41663
|
try:
|
|
41664
41664
|
queries = callGAPIpages(v.matters().savedQueries(), 'list', 'savedQueries',
|
|
41665
41665
|
throwReasons=[GAPI.FORBIDDEN, GAPI.INVALID_ARGUMENT],
|
|
41666
|
-
matterId=matterId, fields='savedQueries(savedQueryId,displayName),nextPageToken')
|
|
41666
|
+
matterId=matterId, fields='savedQueries(savedQueryId,displayName,query),nextPageToken')
|
|
41667
41667
|
except (GAPI.forbidden, GAPI.invalidArgument) as e:
|
|
41668
41668
|
ClientAPIAccessDeniedExit(str(e))
|
|
41669
41669
|
for query in queries:
|
|
41670
41670
|
if query['displayName'].lower() == nameOrIdlower:
|
|
41671
|
-
return (query['savedQueryId'], query['displayName'], formatVaultNameId(query['savedQueryId'], query['displayName']))
|
|
41671
|
+
return (query['savedQueryId'], query['displayName'], formatVaultNameId(query['savedQueryId'], query['displayName']), query['query'])
|
|
41672
41672
|
entityDoesNotHaveItemExit([Ent.VAULT_MATTER, matterNameId, Ent.VAULT_QUERY, nameOrId])
|
|
41673
41673
|
|
|
41674
41674
|
def getMatterItem(v, state=None):
|
|
@@ -41891,12 +41891,13 @@ def _buildVaultQuery(myarg, query, corpusArgumentMap):
|
|
|
41891
41891
|
query['hangoutsChatOptions'] = {'includeRooms': getBoolean()}
|
|
41892
41892
|
# mail
|
|
41893
41893
|
elif myarg == 'excludedrafts':
|
|
41894
|
-
query
|
|
41894
|
+
query.setdefault('mailOptions', {})['excludeDrafts'] = getBoolean()
|
|
41895
41895
|
elif myarg == 'mailclientsideencryption':
|
|
41896
41896
|
query.setdefault('mailOptions', {})['clientSideEncryptedOption'] = getChoice(VAULT_CSE_OPTION_MAP, mapChoice=True)
|
|
41897
41897
|
# voice
|
|
41898
41898
|
elif myarg == 'covereddata':
|
|
41899
|
-
query
|
|
41899
|
+
query.setdefault('voiceOptions', {'coveredData': []})
|
|
41900
|
+
query['voiceOptions']['coveredData'].append(getChoice(VAULT_VOICE_COVERED_DATA_MAP, mapChoice=True))
|
|
41900
41901
|
|
|
41901
41902
|
def _validateVaultQuery(body, corpusArgumentMap):
|
|
41902
41903
|
if 'corpus' not in body['query']:
|
|
@@ -41908,7 +41909,16 @@ def _validateVaultQuery(body, corpusArgumentMap):
|
|
|
41908
41909
|
if body['query']['corpus'] != corpus:
|
|
41909
41910
|
body['exportOptions'].pop(options, None)
|
|
41910
41911
|
|
|
41911
|
-
# gam create vaultexport|export matter <MatterItem> [name <String>]
|
|
41912
|
+
# gam create vaultexport|export matter <MatterItem> [name <String>]
|
|
41913
|
+
# vaultquery <QueryItem>
|
|
41914
|
+
# [driveclientsideencryption any|encrypted|unencrypted]
|
|
41915
|
+
# [includeaccessinfo <Boolean>]
|
|
41916
|
+
# [excludedrafts <Boolean>] [mailclientsideencryption any|encrypted|unencrypted]
|
|
41917
|
+
# [showconfidentialmodecontent <Boolean>] [usenewexport <Boolean>] [exportlinkeddrivefiles <Boolean>]
|
|
41918
|
+
# [format ics|mbox|pst|xml]
|
|
41919
|
+
# [region any|europe|us] [showdetails|returnidonly]
|
|
41920
|
+
# gam create vaultexport|export matter <MatterItem> [name <String>]
|
|
41921
|
+
# corpus calendar|drive|gemini|groups|hangouts_chat|mail|voice
|
|
41912
41922
|
# (accounts <EmailAddressEntity>) | (orgunit|org|ou <OrgUnitPath>) | everyone
|
|
41913
41923
|
# (shareddrives|teamdrives (<SharedDriveIDList>|(select <FileSelector>|<CSVFileSelector>))) |
|
|
41914
41924
|
# (rooms (<ChatSpaceList>|(select <FileSelector>|<CSVFileSelector>))) |
|
|
@@ -41918,23 +41928,25 @@ def _validateVaultQuery(body, corpusArgumentMap):
|
|
|
41918
41928
|
# [locationquery <StringList>] [peoplequery <StringList>] [minuswords <StringList>]
|
|
41919
41929
|
# [responsestatuses <AttendeeStatus>(,<AttendeeStatus>)*] [calendarversiondate <Date>|<Time>]
|
|
41920
41930
|
# [(includeshareddrives <Boolean>)|(shareddrivesoption included|included_if_account_is_not_a_member|not_included)]
|
|
41921
|
-
# [driveversiondate <Date>|<Time>]
|
|
41922
|
-
# [driveclientsideencryption any|encrypted|unencrypted]
|
|
41931
|
+
# [driveversiondate <Date>|<Time>]
|
|
41923
41932
|
# [includerooms <Boolean>]
|
|
41933
|
+
# (covereddata calllogs|textmessages|voicemails)*
|
|
41934
|
+
# [driveclientsideencryption any|encrypted|unencrypted]
|
|
41935
|
+
# [includeaccessinfo <Boolean>]
|
|
41924
41936
|
# [excludedrafts <Boolean>] [mailclientsideencryption any|encrypted|unencrypted]
|
|
41925
41937
|
# [showconfidentialmodecontent <Boolean>] [usenewexport <Boolean>] [exportlinkeddrivefiles <Boolean>]
|
|
41926
|
-
# [covereddata calllogs|textmessages|voicemails]
|
|
41927
41938
|
# [format ics|mbox|pst|xml]
|
|
41928
41939
|
# [region any|europe|us] [showdetails|returnidonly]
|
|
41929
41940
|
def doCreateVaultExport():
|
|
41930
41941
|
v = buildGAPIObject(API.VAULT)
|
|
41931
41942
|
matterId = None
|
|
41932
41943
|
body = {'query': {'dataScope': 'ALL_DATA'}, 'exportOptions': {}}
|
|
41944
|
+
includeAccessInfo = None
|
|
41933
41945
|
exportFormat = None
|
|
41946
|
+
useNewExport = None
|
|
41934
41947
|
showConfidentialModeContent = None
|
|
41935
41948
|
exportLinkedDriveFiles = None
|
|
41936
41949
|
returnIdOnly = showDetails = False
|
|
41937
|
-
useNewExport = None
|
|
41938
41950
|
while Cmd.ArgumentsRemaining():
|
|
41939
41951
|
myarg = getArgument()
|
|
41940
41952
|
if myarg == 'matter':
|
|
@@ -41942,22 +41954,22 @@ def doCreateVaultExport():
|
|
|
41942
41954
|
body['matterId'] = matterId
|
|
41943
41955
|
elif myarg == 'name':
|
|
41944
41956
|
body['name'] = getString(Cmd.OB_STRING)
|
|
41957
|
+
elif matterId is not None and myarg == 'vaultquery':
|
|
41958
|
+
_, _, _, body['query'] = convertQueryNameToID(v, getString(Cmd.OB_QUERY_ITEM), matterId, matterNameId)
|
|
41945
41959
|
elif myarg in VAULT_QUERY_ARGS:
|
|
41946
41960
|
_buildVaultQuery(myarg, body['query'], VAULT_CORPUS_ARGUMENT_MAP)
|
|
41947
|
-
elif myarg == '
|
|
41948
|
-
|
|
41961
|
+
elif myarg == 'includeaccessinfo':
|
|
41962
|
+
includeAccessInfo = getBoolean()
|
|
41949
41963
|
elif myarg == 'format':
|
|
41950
41964
|
exportFormat = getChoice(VAULT_EXPORT_FORMAT_MAP, mapChoice=True)
|
|
41965
|
+
elif myarg == 'usenewexport':
|
|
41966
|
+
useNewExport = getBoolean()
|
|
41951
41967
|
elif myarg == 'showconfidentialmodecontent':
|
|
41952
41968
|
showConfidentialModeContent = getBoolean()
|
|
41953
41969
|
elif myarg == 'exportlinkeddrivefiles':
|
|
41954
41970
|
exportLinkedDriveFiles = getBoolean()
|
|
41955
41971
|
elif myarg == 'region':
|
|
41956
41972
|
body['exportOptions']['region'] = getChoice(VAULT_EXPORT_REGION_MAP, mapChoice=True)
|
|
41957
|
-
elif myarg == 'includeaccessinfo':
|
|
41958
|
-
body['exportOptions'].setdefault('driveOptions', {})['includeAccessInfo'] = getBoolean()
|
|
41959
|
-
elif myarg == 'covereddata':
|
|
41960
|
-
body['exportOptions'].setdefault('voiceOptions', {})['coveredData'] = getChoice(VAULT_VOICE_COVERED_DATA_MAP, mapChoice=True)
|
|
41961
41973
|
elif myarg == 'showdetails':
|
|
41962
41974
|
showDetails = True
|
|
41963
41975
|
returnIdOnly = False
|
|
@@ -41977,7 +41989,10 @@ def doCreateVaultExport():
|
|
|
41977
41989
|
if 'name' not in body:
|
|
41978
41990
|
body['name'] = f'GAM {body["query"]["corpus"]} Export - {ISOformatTimeStamp(todaysTime())}'
|
|
41979
41991
|
optionsField = VAULT_CORPUS_OPTIONS_MAP[body['query']['corpus']]
|
|
41980
|
-
if body['query']['corpus']
|
|
41992
|
+
if body['query']['corpus'] == 'DRIVE':
|
|
41993
|
+
if includeAccessInfo is not None:
|
|
41994
|
+
body['exportOptions'][optionsField]['includeAccessInfo'] = includeAccessInfo
|
|
41995
|
+
else:
|
|
41981
41996
|
body['exportOptions'][optionsField] = {'exportFormat': exportFormat}
|
|
41982
41997
|
if body['query']['corpus'] == 'MAIL':
|
|
41983
41998
|
if showConfidentialModeContent is not None:
|
|
@@ -42459,6 +42474,34 @@ def _showVaultHold(matterNameId, hold, cd, FJQC, k=0, kcount=0):
|
|
|
42459
42474
|
showJSON(None, hold, timeObjects=VAULT_HOLD_TIME_OBJECTS)
|
|
42460
42475
|
Ind.Decrement()
|
|
42461
42476
|
|
|
42477
|
+
def _useVaultQuery(v, matterId, matterNameId, body):
|
|
42478
|
+
_, _, _, query = convertQueryNameToID(v, getString(Cmd.OB_QUERY_ITEM), matterId, matterNameId)
|
|
42479
|
+
body['corpus'] = query['corpus']
|
|
42480
|
+
method = query.get('method')
|
|
42481
|
+
if method == 'ACCOUNT':
|
|
42482
|
+
body['accounts'] = []
|
|
42483
|
+
for email in query['accountInfo']['emails']:
|
|
42484
|
+
body['accounts'].append({'email': email})
|
|
42485
|
+
elif method == 'ORG_UNIT':
|
|
42486
|
+
body['orgUnit'] = {'orgUnitId': query['orgUnitInfo']['orgUnitId']}
|
|
42487
|
+
queryType = VAULT_CORPUS_QUERY_MAP[query['corpus']]
|
|
42488
|
+
if queryType is None:
|
|
42489
|
+
return
|
|
42490
|
+
body['query'] = {queryType: {}}
|
|
42491
|
+
if query['corpus'] == 'DRIVE':
|
|
42492
|
+
body['query'][queryType]['includeSharedDriveFiles'] = query['driveOptions'].get('includeSharedDrives', False)
|
|
42493
|
+
elif query['corpus'] in {'GROUPS', 'MAIL'}:
|
|
42494
|
+
if query.get('terms'):
|
|
42495
|
+
body['query'][queryType]['terms'] = query['terms']
|
|
42496
|
+
if query.get('startTime'):
|
|
42497
|
+
body['query'][queryType]['startTime'] = query['startTime']
|
|
42498
|
+
if query.get('endTime'):
|
|
42499
|
+
body['query'][queryType]['endTime'] = query['endTime']
|
|
42500
|
+
elif query['corpus'] == 'HANGOUTS_CHAT':
|
|
42501
|
+
body['query'][queryType]['includeRooms'] = query['hangoutsChatOptions'].get('includeRooms', False)
|
|
42502
|
+
elif query['corpus'] == 'VOICE':
|
|
42503
|
+
body['query'][queryType]['coveredData'] = query['voiceOptions']['coveredData']
|
|
42504
|
+
|
|
42462
42505
|
def _getHoldQueryParameters(myarg, queryParameters):
|
|
42463
42506
|
if myarg == 'query':
|
|
42464
42507
|
queryParameters['queryLocation'] = Cmd.Location()
|
|
@@ -42474,7 +42517,8 @@ def _getHoldQueryParameters(myarg, queryParameters):
|
|
|
42474
42517
|
elif myarg in {'includeshareddrives', 'includeteamdrives'}:
|
|
42475
42518
|
queryParameters['includeSharedDriveFiles'] = getBoolean()
|
|
42476
42519
|
elif myarg == 'covereddata':
|
|
42477
|
-
queryParameters
|
|
42520
|
+
queryParameters.setdefault('coveredData', [])
|
|
42521
|
+
queryParameters['coveredData'].append(getChoice(VAULT_VOICE_COVERED_DATA_MAP, mapChoice=True))
|
|
42478
42522
|
else:
|
|
42479
42523
|
return False
|
|
42480
42524
|
return True
|
|
@@ -42509,7 +42553,11 @@ def _setHoldQuery(body, queryParameters):
|
|
|
42509
42553
|
if queryParameters.get('coveredData'):
|
|
42510
42554
|
body['query'][queryType]['coveredData'] = queryParameters['coveredData']
|
|
42511
42555
|
|
|
42512
|
-
# gam create vaulthold|hold matter <MatterItem> [name <String>]
|
|
42556
|
+
# gam create vaulthold|hold matter <MatterItem> [name <String>]
|
|
42557
|
+
# vaultquery <QueryItem>
|
|
42558
|
+
# [showdetails|returnidonly]
|
|
42559
|
+
# gam create vaulthold|hold matter <MatterItem> [name <String>]
|
|
42560
|
+
# corpus calendar|drive|mail|groups|hangouts_chat|voice
|
|
42513
42561
|
# [(accounts|groups|users <EmailItemList>) | (orgunit|org|ou <OrgUnit>)]
|
|
42514
42562
|
# [query <QueryVaultCorpus>]
|
|
42515
42563
|
# [terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
|
|
@@ -42523,13 +42571,16 @@ def doCreateVaultHold():
|
|
|
42523
42571
|
matterId = None
|
|
42524
42572
|
accounts = []
|
|
42525
42573
|
queryParameters = {}
|
|
42526
|
-
returnIdOnly = showDetails = False
|
|
42574
|
+
returnIdOnly = showDetails = usedVaultQuery = False
|
|
42527
42575
|
while Cmd.ArgumentsRemaining():
|
|
42528
42576
|
myarg = getArgument()
|
|
42529
42577
|
if myarg == 'matter':
|
|
42530
42578
|
matterId, matterNameId = getMatterItem(v)
|
|
42531
42579
|
elif myarg == 'name':
|
|
42532
42580
|
body['name'] = getString(Cmd.OB_STRING)
|
|
42581
|
+
elif matterId is not None and myarg == 'vaultquery':
|
|
42582
|
+
_useVaultQuery(v, matterId, matterNameId, body)
|
|
42583
|
+
usedVaultQuery = True
|
|
42533
42584
|
elif myarg == 'corpus':
|
|
42534
42585
|
body['corpus'] = getChoice(VAULT_CORPUS_ARGUMENT_MAP, mapChoice=True)
|
|
42535
42586
|
elif myarg in {'accounts', 'users', 'groups'}:
|
|
@@ -42553,7 +42604,8 @@ def doCreateVaultHold():
|
|
|
42553
42604
|
missingArgumentExit(f'corpus {"|".join(VAULT_CORPUS_ARGUMENT_MAP)}')
|
|
42554
42605
|
if 'name' not in body:
|
|
42555
42606
|
body['name'] = f'GAM {body["corpus"]} Hold - {ISOformatTimeStamp(todaysTime())}'
|
|
42556
|
-
|
|
42607
|
+
if not usedVaultQuery:
|
|
42608
|
+
_setHoldQuery(body, queryParameters)
|
|
42557
42609
|
if accounts:
|
|
42558
42610
|
body['accounts'] = []
|
|
42559
42611
|
cd = buildGAPIObject(API.DIRECTORY)
|
|
@@ -43006,7 +43058,7 @@ def doInfoVaultQuery():
|
|
|
43006
43058
|
v = buildGAPIObject(API.VAULT)
|
|
43007
43059
|
if not Cmd.ArgumentIsAhead('matter'):
|
|
43008
43060
|
matterId, matterNameId = getMatterItem(v)
|
|
43009
|
-
queryId, queryName, queryNameId = convertQueryNameToID(v, getString(Cmd.OB_QUERY_ITEM), matterId, matterNameId)
|
|
43061
|
+
queryId, queryName, queryNameId, _ = convertQueryNameToID(v, getString(Cmd.OB_QUERY_ITEM), matterId, matterNameId)
|
|
43010
43062
|
else:
|
|
43011
43063
|
queryName = getString(Cmd.OB_QUERY_ITEM)
|
|
43012
43064
|
cd = drive = None
|
|
@@ -43016,7 +43068,7 @@ def doInfoVaultQuery():
|
|
|
43016
43068
|
myarg = getArgument()
|
|
43017
43069
|
if myarg == 'matter':
|
|
43018
43070
|
matterId, matterNameId = getMatterItem(v)
|
|
43019
|
-
queryId, queryName, queryNameId = convertQueryNameToID(v, queryName, matterId, matterNameId)
|
|
43071
|
+
queryId, queryName, queryNameId, _ = convertQueryNameToID(v, queryName, matterId, matterNameId)
|
|
43020
43072
|
elif myarg == 'shownames':
|
|
43021
43073
|
cd = buildGAPIObject(API.DIRECTORY)
|
|
43022
43074
|
_, drive = buildGAPIServiceObject(API.DRIVE3, _getAdminEmail())
|
|
@@ -45754,71 +45806,81 @@ def doPrintUsers(entityList=None):
|
|
|
45754
45806
|
csvPF.WriteRowNoFilter(row)
|
|
45755
45807
|
|
|
45756
45808
|
def _printUser(userEntity, i, count):
|
|
45757
|
-
if isSuspended is None
|
|
45758
|
-
|
|
45759
|
-
|
|
45760
|
-
|
|
45761
|
-
|
|
45762
|
-
|
|
45763
|
-
|
|
45764
|
-
|
|
45765
|
-
|
|
45766
|
-
|
|
45767
|
-
|
|
45768
|
-
|
|
45769
|
-
|
|
45770
|
-
|
|
45771
|
-
|
|
45772
|
-
|
|
45773
|
-
|
|
45774
|
-
|
|
45775
|
-
|
|
45776
|
-
|
|
45777
|
-
|
|
45778
|
-
|
|
45779
|
-
|
|
45780
|
-
|
|
45781
|
-
|
|
45782
|
-
|
|
45783
|
-
|
|
45784
|
-
|
|
45785
|
-
|
|
45786
|
-
|
|
45787
|
-
|
|
45788
|
-
|
|
45789
|
-
|
|
45790
|
-
|
|
45791
|
-
|
|
45792
|
-
|
|
45793
|
-
|
|
45794
|
-
|
|
45795
|
-
|
|
45796
|
-
|
|
45797
|
-
if aliasMatchPattern and 'aliases' in userEntity:
|
|
45798
|
-
userEntity['aliases'] = [alias for alias in userEntity['aliases'] if aliasMatchPattern.match(alias)]
|
|
45799
|
-
if printOptions['getLicenseFeed'] or printOptions['getLicenseFeedByUser']:
|
|
45800
|
-
if printOptions['getLicenseFeed']:
|
|
45801
|
-
u_licenses = licenses.get(userEmail.lower(), [])
|
|
45809
|
+
if (isSuspended is None and isArchived is None):
|
|
45810
|
+
showUser = True
|
|
45811
|
+
elif (isSuspended is not None and isArchived is None):
|
|
45812
|
+
showUser = isSuspended == userEntity.get('suspended', isSuspended)
|
|
45813
|
+
elif (isSuspended is None and isArchived is not None):
|
|
45814
|
+
showUser = isArchived == userEntity.get('archived', isArchived)
|
|
45815
|
+
else:
|
|
45816
|
+
showUser = ((isSuspended == userEntity.get('suspended', isSuspended)) or
|
|
45817
|
+
(isArchived == userEntity.get('archived', isArchived)))
|
|
45818
|
+
if not showUser:
|
|
45819
|
+
return
|
|
45820
|
+
if showValidColumn:
|
|
45821
|
+
userEntity[showValidColumn] = True
|
|
45822
|
+
userEmail = userEntity['primaryEmail']
|
|
45823
|
+
if printOptions['emailParts']:
|
|
45824
|
+
if userEmail.find('@') != -1:
|
|
45825
|
+
userEntity['primaryEmailLocal'], userEntity['primaryEmailDomain'] = splitEmailAddress(userEmail)
|
|
45826
|
+
if 'languages' in userEntity and not FJQC.formatJSON:
|
|
45827
|
+
userEntity['languages'] = _formatLanguagesList(userEntity.pop('languages'), delimiter)
|
|
45828
|
+
for location in userEntity.get('locations', []):
|
|
45829
|
+
location['buildingName'] = _getBuildingNameById(cd, location.get('buildingId', ''))
|
|
45830
|
+
if quotePlusPhoneNumbers:
|
|
45831
|
+
for phone in userEntity.get('phones', []):
|
|
45832
|
+
phoneNumber = phone.get('value', '')
|
|
45833
|
+
if phoneNumber.startswith('+'):
|
|
45834
|
+
phone['value'] = "'"+phoneNumber
|
|
45835
|
+
if schemaParms['selectedSchemaFields']:
|
|
45836
|
+
_filterSchemaFields(userEntity, schemaParms)
|
|
45837
|
+
if printOptions['getGroupFeed']:
|
|
45838
|
+
printGettingAllEntityItemsForWhom(Ent.GROUP_MEMBERSHIP, userEmail, i, count)
|
|
45839
|
+
try:
|
|
45840
|
+
groups = callGAPIpages(cd.groups(), 'list', 'groups',
|
|
45841
|
+
pageMessage=getPageMessageForWhom(),
|
|
45842
|
+
throwReasons=GAPI.GROUP_LIST_USERKEY_THROW_REASONS,
|
|
45843
|
+
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS,
|
|
45844
|
+
userKey=userEmail, orderBy='email', fields='nextPageToken,groups(email)')
|
|
45845
|
+
numGroups = len(groups)
|
|
45846
|
+
if not printOptions['groupsInColumns']:
|
|
45847
|
+
userEntity['GroupsCount'] = numGroups
|
|
45848
|
+
userEntity['Groups'] = delimiter.join([groupname['email'] for groupname in groups])
|
|
45802
45849
|
else:
|
|
45803
|
-
|
|
45804
|
-
|
|
45805
|
-
userEntity['
|
|
45806
|
-
|
|
45807
|
-
userEntity['
|
|
45808
|
-
|
|
45850
|
+
if numGroups > printOptions['maxGroups']:
|
|
45851
|
+
printOptions['maxGroups'] = numGroups
|
|
45852
|
+
userEntity['Groups'] = numGroups
|
|
45853
|
+
for j, group in enumerate(groups):
|
|
45854
|
+
userEntity[f'Groups{GC.Values[GC.CSV_OUTPUT_SUBFIELD_DELIMITER]}{j}'] = group['email']
|
|
45855
|
+
except (GAPI.invalidMember, GAPI.invalidInput):
|
|
45856
|
+
badRequestWarning(Ent.GROUP, Ent.MEMBER, userEmail)
|
|
45857
|
+
except (GAPI.resourceNotFound, GAPI.domainNotFound, GAPI.forbidden, GAPI.badRequest):
|
|
45858
|
+
accessErrorExit(cd)
|
|
45859
|
+
if aliasMatchPattern and 'aliases' in userEntity:
|
|
45860
|
+
userEntity['aliases'] = [alias for alias in userEntity['aliases'] if aliasMatchPattern.match(alias)]
|
|
45861
|
+
if printOptions['getLicenseFeed'] or printOptions['getLicenseFeedByUser']:
|
|
45862
|
+
if printOptions['getLicenseFeed']:
|
|
45863
|
+
u_licenses = licenses.get(userEmail.lower(), [])
|
|
45809
45864
|
else:
|
|
45810
|
-
u_licenses =
|
|
45865
|
+
u_licenses = getUserLicenses(lic, userEntity, skus)
|
|
45811
45866
|
if not oneLicensePerRow:
|
|
45812
|
-
|
|
45813
|
-
else:
|
|
45867
|
+
userEntity['LicensesCount'] = len(u_licenses)
|
|
45814
45868
|
if u_licenses:
|
|
45815
|
-
|
|
45816
|
-
|
|
45817
|
-
|
|
45818
|
-
|
|
45819
|
-
|
|
45820
|
-
|
|
45869
|
+
userEntity['Licenses'] = delimiter.join(u_licenses)
|
|
45870
|
+
userEntity['LicensesDisplay'] = delimiter.join([SKU.skuIdToDisplayName(skuId) for skuId in u_licenses])
|
|
45871
|
+
else:
|
|
45872
|
+
u_licenses = []
|
|
45873
|
+
if not oneLicensePerRow:
|
|
45874
|
+
_writeUserEntity(userEntity)
|
|
45875
|
+
else:
|
|
45876
|
+
if u_licenses:
|
|
45877
|
+
for skuId in u_licenses:
|
|
45878
|
+
userEntity['License'] = skuId
|
|
45879
|
+
userEntity['LicenseDisplay'] = SKU.skuIdToDisplayName(skuId)
|
|
45821
45880
|
_writeUserEntity(userEntity)
|
|
45881
|
+
else:
|
|
45882
|
+
userEntity['License'] = userEntity['LicenseDisplay'] = ''
|
|
45883
|
+
_writeUserEntity(userEntity)
|
|
45822
45884
|
|
|
45823
45885
|
def _updateDomainCounts(emailAddress):
|
|
45824
45886
|
nonlocal domainCounts
|
|
@@ -45911,10 +45973,10 @@ def doPrintUsers(entityList=None):
|
|
|
45911
45973
|
showDeleted = True
|
|
45912
45974
|
elif entityList is None and myarg == 'select':
|
|
45913
45975
|
_, entityList = getEntityToModify(defaultEntityType=Cmd.ENTITY_USERS)
|
|
45914
|
-
elif myarg
|
|
45915
|
-
isSuspended =
|
|
45916
|
-
elif myarg
|
|
45917
|
-
isArchived =
|
|
45976
|
+
elif myarg == 'issuspended':
|
|
45977
|
+
isSuspended = getBoolean()
|
|
45978
|
+
elif myarg == 'isarchived':
|
|
45979
|
+
isArchived = getBoolean()
|
|
45918
45980
|
elif myarg == 'orderby':
|
|
45919
45981
|
orderBy, sortOrder = getOrderBySortOrder(USERS_ORDERBY_CHOICE_MAP)
|
|
45920
45982
|
elif myarg == 'userview':
|
|
@@ -46092,6 +46154,8 @@ def doPrintUsers(entityList=None):
|
|
|
46092
46154
|
# If no individual fields were specified (allfields, basic, full) or individual fields other than primaryEmail were specified, look up each user
|
|
46093
46155
|
if isSuspended is not None and fieldsList:
|
|
46094
46156
|
fieldsList.append('suspended')
|
|
46157
|
+
if isArchived is not None and fieldsList:
|
|
46158
|
+
fieldsList.append('archived')
|
|
46095
46159
|
if projectionSet or len(set(fieldsList)) > 1 or showValidColumn:
|
|
46096
46160
|
jcount = len(entityList)
|
|
46097
46161
|
fields = getFieldsFromFieldsList(fieldsList)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
gam/__init__.py,sha256=
|
|
1
|
+
gam/__init__.py,sha256=ltpucQqtsz71YaDsryzmj1nc-Ls0DsKpQvDjUr04rKY,3612652
|
|
2
2
|
gam/__main__.py,sha256=amz0-959ph6zkZKqjaar4n60yho-T37w6qWI36qx0CA,1049
|
|
3
3
|
gam/cacerts.pem,sha256=DUsVo2XlFYwfkhe3gnxa-Km4Z4noz74hSApXwTT-nQE,44344
|
|
4
4
|
gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
|
|
@@ -47,8 +47,8 @@ gam/gdata/apps/audit/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrK
|
|
|
47
47
|
gam/gdata/apps/audit/service.py,sha256=Z1eueThcNeVUMWP1DRWc_DGHrJCiJI8W_xj6L-cqu-Q,9658
|
|
48
48
|
gam/gdata/apps/contacts/__init__.py,sha256=Um6zgIkiahZns7yAEuC3pxHSMD8iciZ_EoynSLoYPfU,30463
|
|
49
49
|
gam/gdata/apps/contacts/service.py,sha256=5lNb-Ii1Gyek6ePFji3kyoYtCBc8CuJTwagx2BL2o14,15684
|
|
50
|
-
gam7-7.22.
|
|
51
|
-
gam7-7.22.
|
|
52
|
-
gam7-7.22.
|
|
53
|
-
gam7-7.22.
|
|
54
|
-
gam7-7.22.
|
|
50
|
+
gam7-7.22.5.dist-info/METADATA,sha256=iHzqp50Z_9xbSdfj98MmEr8pKLfSC4oXwcW0jaM31cw,3092
|
|
51
|
+
gam7-7.22.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
52
|
+
gam7-7.22.5.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
|
|
53
|
+
gam7-7.22.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
54
|
+
gam7-7.22.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|