mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 12:21:35 +00:00
Added option returnidonly to gam create vaultexport|vaulthold|vaultmatter
This commit is contained in:
@@ -4785,7 +4785,7 @@ gam <UserTypeEntity> show teamdriveacls
|
||||
|
||||
gam create|add vaultmatter|matter [name <String>] [description <string>]
|
||||
[collaborator|collaborators <EmailItemList>] [sendemails <Boolean>] [ccme <Boolean>]
|
||||
[showdetails]
|
||||
[showdetails|returnidonly]
|
||||
gam update vaultmatter|matter <MatterItem> [name <String>] [description <string>]
|
||||
[addcollaborator|addcollaborators <EmailItemList>] [removecollaborator|removecollaborators <EmailItemList>]
|
||||
gam update vaultmatter|matter <MatterItem> action close|reopen|delete|undelete
|
||||
@@ -4834,7 +4834,7 @@ gam create vaultexport|export matter <MatterItem> [name <String>] corpus drive|m
|
||||
[showconfidentialmodecontent <Boolean>] [usenewexport <Boolean>]
|
||||
[includerooms <Boolean>] [covereddata calllogs|textmessages|voicemails]
|
||||
[includeshareddrives|includeteamdrives <Boolean>] [driveversiondate <Date>|<Time>] [includeaccessinfo <Boolean>]
|
||||
[region any|europe|us] [showdetails]
|
||||
[region any|europe|us] [showdetails|returnidonly]
|
||||
gam delete vaultexport|export <ExportItem> matter <MatterItem>
|
||||
gam delete vaultexport|export <MatterItem> <ExportItem>
|
||||
gam download vaultexport|export <ExportItem> matter <MatterItem>
|
||||
@@ -4894,7 +4894,7 @@ gam create vaulthold|hold matter <MatterItem> [name <String>] corpus drive|mail|
|
||||
[terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
|
||||
[includerooms <Boolean>] [covereddata calllogs|textmessages|voicemails]
|
||||
[includeshareddrives|includeteamdrives <Boolean>]
|
||||
[showdetails]
|
||||
[showdetails|returnidonly]
|
||||
gam update vaulthold|hold <HoldItem> matter <MatterItem>
|
||||
[([addaccounts|addgroups|addusers <EmailItemList>] [removeaccounts|removegroups|removeusers <EmailItemList>]) | (orgunit|org|ou <OrgUnit>)]
|
||||
[query <QueryVaultCorpus>]
|
||||
|
||||
@@ -2,6 +2,15 @@
|
||||
|
||||
Merged GAM-Team version
|
||||
|
||||
6.61.11
|
||||
|
||||
Added option `returnidonly` to `gam create vaultexport|vaulthold|vaultmatter`
|
||||
that causes GAM to return just the ID of the item created as output.
|
||||
|
||||
6.61.10
|
||||
|
||||
Fixed bug in `gam oauth create admin <EmailAddress>` which caused no scopes to be selected.
|
||||
|
||||
6.61.09
|
||||
|
||||
Updated `gam oauth create` to handle case where Google takes a very long time to respond
|
||||
|
||||
@@ -36895,14 +36895,14 @@ def _validateVaultQuery(query):
|
||||
# [includerooms <Boolean>]
|
||||
# [covereddata calllogs|textmessages|voicemails]
|
||||
# [includeshareddrives|includeteamdrives <Boolean>] [driveversiondate <Date>|<Time>] [includeaccessinfo <Boolean>]
|
||||
# [region any|europe|us] [showdetails]
|
||||
# [region any|europe|us] [showdetails|returnidonly]
|
||||
def doCreateVaultExport():
|
||||
v = buildGAPIObject(API.VAULT)
|
||||
matterId = None
|
||||
body = {'query': {'dataScope': 'ALL_DATA'}, 'exportOptions': {}}
|
||||
exportFormat = 'MBOX'
|
||||
showConfidentialModeContent = None
|
||||
showDetails = False
|
||||
returnIdOnly = showDetails = False
|
||||
useNewExport = None
|
||||
while Cmd.ArgumentsRemaining():
|
||||
myarg = getArgument()
|
||||
@@ -36927,6 +36927,10 @@ def doCreateVaultExport():
|
||||
body['exportOptions'].setdefault('voiceOptions', {})['coveredData'] = getChoice(VAULT_VOICE_COVERED_DATA_MAP, mapChoice=True)
|
||||
elif myarg == 'showdetails':
|
||||
showDetails = True
|
||||
returnIdOnly = False
|
||||
elif myarg == 'returnidonly':
|
||||
returnIdOnly = True
|
||||
showDetails = False
|
||||
else:
|
||||
unknownArgumentExit()
|
||||
if not matterId:
|
||||
@@ -36950,9 +36954,12 @@ def doCreateVaultExport():
|
||||
throwReasons=[GAPI.ALREADY_EXISTS, GAPI.BAD_REQUEST, GAPI.BACKEND_ERROR, GAPI.INVALID_ARGUMENT,
|
||||
GAPI.FAILED_PRECONDITION, GAPI.FORBIDDEN, GAPI.QUOTA_EXCEEDED],
|
||||
matterId=matterId, body=body)
|
||||
if not returnIdOnly:
|
||||
entityActionPerformed([Ent.VAULT_MATTER, matterNameId, Ent.VAULT_EXPORT, formatVaultNameId(export['name'], export['id'])])
|
||||
if showDetails:
|
||||
_showVaultExport(None, export, None, None)
|
||||
else:
|
||||
writeStdout(f'{export["id"]}\n')
|
||||
except (GAPI.alreadyExists, GAPI.badRequest, GAPI.backendError, GAPI.invalidArgument,
|
||||
GAPI.failedPrecondition, GAPI.forbidden, GAPI.quotaExceeded) as e:
|
||||
entityActionFailedWarning([Ent.VAULT_MATTER, matterNameId, Ent.VAULT_EXPORT, body.get('name')], str(e))
|
||||
@@ -37467,14 +37474,14 @@ def _setHoldQuery(body, queryParameters):
|
||||
# [includerooms <Boolean>]
|
||||
# [covereddata calllogs|textmessages|voicemails]
|
||||
# [includeshareddrives|includeteamdrives <Boolean>]
|
||||
# [showdetails]
|
||||
# [showdetails|returnidonly]
|
||||
def doCreateVaultHold():
|
||||
v = buildGAPIObject(API.VAULT)
|
||||
body = {}
|
||||
matterId = None
|
||||
accounts = []
|
||||
queryParameters = {}
|
||||
showDetails = False
|
||||
returnIdOnly = showDetails = False
|
||||
while Cmd.ArgumentsRemaining():
|
||||
myarg = getArgument()
|
||||
if myarg == 'matter':
|
||||
@@ -37492,6 +37499,10 @@ def doCreateVaultHold():
|
||||
pass
|
||||
elif myarg == 'showdetails':
|
||||
showDetails = True
|
||||
returnIdOnly = False
|
||||
elif myarg == 'returnidonly':
|
||||
returnIdOnly = True
|
||||
showDetails = False
|
||||
else:
|
||||
unknownArgumentExit()
|
||||
if matterId is None:
|
||||
@@ -37511,9 +37522,12 @@ def doCreateVaultHold():
|
||||
hold = callGAPI(v.matters().holds(), 'create',
|
||||
throwReasons=[GAPI.ALREADY_EXISTS, GAPI.BAD_REQUEST, GAPI.BACKEND_ERROR, GAPI.FAILED_PRECONDITION, GAPI.FORBIDDEN],
|
||||
matterId=matterId, body=body)
|
||||
if not returnIdOnly:
|
||||
entityActionPerformed([Ent.VAULT_MATTER, matterNameId, Ent.VAULT_HOLD, formatVaultNameId(hold['name'], hold['holdId'])])
|
||||
if showDetails:
|
||||
_showVaultHold(None, hold, None, None)
|
||||
else:
|
||||
writeStdout(f'{hold["holdId"]}\n')
|
||||
except (GAPI.alreadyExists, GAPI.badRequest, GAPI.backendError, GAPI.failedPrecondition, GAPI.forbidden) as e:
|
||||
entityActionFailedWarning([Ent.VAULT_MATTER, matterNameId, Ent.VAULT_HOLD, body.get('name')], str(e))
|
||||
|
||||
@@ -38092,14 +38106,14 @@ def _showVaultMatter(matter, cd, FJQC, j=0, jcount=0):
|
||||
|
||||
# gam create vaultmatter|matter [name <String>] [description <string>]
|
||||
# [collaborator|collaborators <CollaboratorItemList>] [sendemails <Boolean>] [ccme <Boolean>]
|
||||
# [showdetails]
|
||||
# [showdetails|returnidonly]
|
||||
def doCreateVaultMatter():
|
||||
v = buildGAPIObject(API.VAULT)
|
||||
body = {}
|
||||
cbody = {'matterPermission': {'role': 'COLLABORATOR', 'accountId': ''}, 'sendEmails': False, 'ccMe': False}
|
||||
collaborators = []
|
||||
cd = None
|
||||
showDetails = False
|
||||
returnIdOnly = showDetails = False
|
||||
while Cmd.ArgumentsRemaining():
|
||||
myarg = getArgument()
|
||||
if myarg == 'name':
|
||||
@@ -38116,6 +38130,10 @@ def doCreateVaultMatter():
|
||||
cbody['ccMe'] = getBoolean()
|
||||
elif myarg == 'showdetails':
|
||||
showDetails = True
|
||||
returnIdOnly = False
|
||||
elif myarg == 'returnidonly':
|
||||
returnIdOnly = True
|
||||
showDetails = False
|
||||
else:
|
||||
unknownArgumentExit()
|
||||
if 'name' not in body:
|
||||
@@ -38126,13 +38144,17 @@ def doCreateVaultMatter():
|
||||
body=body)
|
||||
matterId = matter['matterId']
|
||||
matterNameId = formatVaultNameId(matter['name'], matterId)
|
||||
if not returnIdOnly:
|
||||
entityActionPerformed([Ent.VAULT_MATTER, matterNameId])
|
||||
else:
|
||||
writeStdout(f'{matterId}\n')
|
||||
except (GAPI.alreadyExists, GAPI.forbidden) as e:
|
||||
entityActionFailedWarning([Ent.VAULT_MATTER, body['name']], str(e))
|
||||
return
|
||||
jcount = len(collaborators)
|
||||
if jcount > 0:
|
||||
Act.Set(Act.ADD)
|
||||
if not returnIdOnly:
|
||||
entityPerformActionNumItems([Ent.VAULT_MATTER, matterNameId], jcount, Ent.COLLABORATOR)
|
||||
Ind.Increment()
|
||||
j = 0
|
||||
@@ -38143,6 +38165,7 @@ def doCreateVaultMatter():
|
||||
callGAPI(v.matters(), 'addPermissions',
|
||||
throwReasons=[GAPI.FAILED_PRECONDITION, GAPI.FORBIDDEN],
|
||||
matterId=matterId, body=cbody)
|
||||
if not returnIdOnly:
|
||||
entityActionPerformed([Ent.VAULT_MATTER, matterNameId, Ent.COLLABORATOR, collaborator['email']], j, jcount)
|
||||
except (GAPI.failedPrecondition, GAPI.forbidden) as e:
|
||||
entityActionFailedWarning([Ent.VAULT_MATTER, matterNameId], str(e))
|
||||
|
||||
Reference in New Issue
Block a user