-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated
gam create vaultexport
to include corpus gemini
.
- Loading branch information
Showing
5 changed files
with
57 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
""" | ||
|
||
__author__ = 'Ross Scroggs <[email protected]>' | ||
__version__ = '7.03.06' | ||
__version__ = '7.03.07' | ||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' | ||
|
||
#pylint: disable=wrong-import-position | ||
|
@@ -7356,11 +7356,11 @@ def addFieldToFieldsList(fieldName, fieldsChoiceMap, fieldsList): | |
def _getFieldsList(): | ||
return getString(Cmd.OB_FIELD_NAME_LIST).lower().replace('_', '').replace(',', ' ').split() | ||
|
||
def _getRawFieldsList(requiredField=None): | ||
rawFieldsList = getString(Cmd.OB_FIELDS) | ||
if requiredField is not None and requiredField not in rawFieldsList: | ||
rawFieldsList = f'{requiredField},{rawFieldsList}' | ||
return rawFieldsList | ||
def _getRawFields(requiredField=None): | ||
rawFields = getString(Cmd.OB_FIELDS) | ||
if requiredField is None or requiredField in rawFields: | ||
return rawFields | ||
return f'{requiredField},{rawFields}' | ||
|
||
def _addInitialField(fieldsList, initialField): | ||
if isinstance(initialField, list): | ||
|
@@ -25133,7 +25133,7 @@ def doInfoBrowsers(): | |
deviceId = getString(Cmd.OB_DEVICE_ID) | ||
projection = 'BASIC' | ||
fieldsList = [] | ||
rawFieldsList = None | ||
rawFields = None | ||
FJQC = FormatJSONQuoteChar() | ||
while Cmd.ArgumentsRemaining(): | ||
myarg = getArgument() | ||
|
@@ -25147,15 +25147,12 @@ def doInfoBrowsers(): | |
pass | ||
elif myarg == 'rawfields': | ||
projection = 'FULL' | ||
rawFieldsList = _getRawFieldsList('deviceId') | ||
rawFields = _getRawFields('deviceId') | ||
else: | ||
FJQC.GetFormatJSON(myarg) | ||
if projection == 'BASIC' and set(fieldsList).intersection(BROWSER_FULL_ACCESS_FIELDS): | ||
projection = 'FULL' | ||
if not rawFieldsList: | ||
fields = getFieldsFromFieldsList(fieldsList) | ||
else: | ||
fields = rawFieldsList | ||
fields = getFieldsFromFieldsList(fieldsList) if not rawFields else rawFields | ||
try: | ||
browser = callGAPI(cbcm.chromebrowsers(), 'get', | ||
throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.FORBIDDEN], | ||
|
@@ -25524,7 +25521,7 @@ def _printBrowser(browser): | |
csvPF = CSVPrintFile(['deviceId']) if Act.csvFormat() else None | ||
FJQC = FormatJSONQuoteChar(csvPF) | ||
fieldsList = [] | ||
rawFieldsList = None | ||
rawFields = None | ||
projection = 'BASIC' | ||
orderBy = 'id' | ||
sortOrder = 'ASCENDING' | ||
|
@@ -25565,7 +25562,7 @@ def _printBrowser(browser): | |
pass | ||
elif myarg == 'rawfields': | ||
projection = 'FULL' | ||
rawFieldsList = _getRawFieldsList('deviceId') | ||
rawFields = _getRawFields('deviceId') | ||
else: | ||
FJQC.GetFormatJSONQuoteChar(myarg, True) | ||
if projection == 'BASIC' and set(fieldsList).intersection(BROWSER_FULL_ACCESS_FIELDS): | ||
|
@@ -25574,10 +25571,7 @@ def _printBrowser(browser): | |
sortHeaders = False | ||
substituteQueryTimes(queries, queryTimes) | ||
if entityList is None: | ||
if not rawFieldsList: | ||
fields = getItemFieldsFromFieldsList('browsers', fieldsList) | ||
else: | ||
fields = f'nextPageToken,browsers({rawFieldsList})' | ||
fields = getItemFieldsFromFieldsList('browsers', fieldsList) if not rawFields else f'nextPageToken,browsers({rawFields})' | ||
for query in queries: | ||
printGettingAllAccountEntities(Ent.CHROME_BROWSER, query) | ||
pageMessage = getPageMessage() | ||
|
@@ -25616,10 +25610,7 @@ def _printBrowser(browser): | |
else: | ||
sortRows = True | ||
jcount = len(entityList) | ||
if not rawFieldsList: | ||
fields = getFieldsFromFieldsList(fieldsList) | ||
else: | ||
fields = rawFieldsList | ||
fields = getFieldsFromFieldsList(fieldsList) if not rawFields else rawFields | ||
j = 0 | ||
for deviceId in entityList: | ||
j += 1 | ||
|
@@ -40464,9 +40455,10 @@ def _showVaultExport(matterNameId, export, cd, FJQC, k=0, kcount=0): | |
VAULT_CORPUS_ARGUMENT_MAP = { | ||
'calendar': 'CALENDAR', | ||
'drive': 'DRIVE', | ||
'mail': 'MAIL', | ||
'gemini': 'GEMINI', | ||
'groups': 'GROUPS', | ||
'hangoutschat': 'HANGOUTS_CHAT', | ||
'mail': 'MAIL', | ||
'voice': 'VOICE', | ||
} | ||
VAULT_COUNTS_CORPUS_ARGUMENT_MAP = { | ||
|
@@ -40493,15 +40485,22 @@ def _showVaultExport(matterNameId, export, cd, FJQC, k=0, kcount=0): | |
'ics': 'ICS', | ||
'mbox': 'MBOX', | ||
'pst': 'PST', | ||
'xml': 'XML', | ||
} | ||
VAULT_CORPUS_EXPORT_FORMATS = { | ||
'CALENDAR': ['ICS', 'PST'], | ||
'DRIVE': [], | ||
'GEMINI': ['XML'], | ||
'GROUPS': ['MBOX', 'PST'], | ||
'HANGOUTS_CHAT': ['MBOX', 'PST'], | ||
'MAIL': ['MBOX', 'PST'], | ||
'VOICE' : ['MBOX', 'PST'], | ||
} | ||
VAULT_CSE_OPTION_MAP = { | ||
'any': 'CLIENT_SIDE_ENCRYPTED_OPTION_ANY', | ||
'encrypted': 'CLIENT_SIDE_ENCRYPTED_OPTION_ENCRYPTED', | ||
'unencrypted': 'CLIENT_SIDE_ENCRYPTED_OPTION_UNENCRYPTED', | ||
} | ||
VAULT_EXPORT_REGION_MAP = { | ||
'any': 'ANY', | ||
'europe': 'EUROPE', | ||
|
@@ -40510,16 +40509,18 @@ def _showVaultExport(matterNameId, export, cd, FJQC, k=0, kcount=0): | |
VAULT_CORPUS_OPTIONS_MAP = { | ||
'CALENDAR': 'calendarOptions', | ||
'DRIVE': 'driveOptions', | ||
'MAIL': 'mailOptions', | ||
'GEMINI': 'geminiOptions', | ||
'GROUPS': 'groupsOptions', | ||
'HANGOUTS_CHAT': 'hangoutsChatOptions', | ||
'MAIL': 'mailOptions', | ||
'VOICE': 'voiceOptions', | ||
} | ||
VAULT_CORPUS_QUERY_MAP = { | ||
'CALENDAR': None, | ||
'DRIVE': 'driveQuery', | ||
'MAIL': 'mailQuery', | ||
'GEMINI': None, | ||
'GROUPS': 'groupsQuery', | ||
'MAIL': 'mailQuery', | ||
'HANGOUTS_CHAT': 'hangoutsChatQuery', | ||
'VOICE': 'voiceQuery', | ||
} | ||
|
@@ -40528,11 +40529,11 @@ def _showVaultExport(matterNameId, export, cd, FJQC, k=0, kcount=0): | |
# calendar | ||
'locationquery', 'peoplequery', 'minuswords', 'responsestatuses', 'caldendarversiondate', | ||
# drive | ||
'driveversiondate', 'includeshareddrives', 'includeteamdrives', | ||
'driveclientsideencryption', 'driveversiondate', 'includeshareddrives', 'includeteamdrives', | ||
# hangoutsChat | ||
'includerooms', | ||
'excludedrafts', | ||
'mailclientsideencryption', 'excludedrafts', | ||
# voice | ||
'covereddata', | ||
] + list(VAULT_SEARCH_METHODS_MAP.keys()) | ||
|
@@ -40589,12 +40590,16 @@ def _buildVaultQuery(myarg, query, corpusArgumentMap): | |
query.setdefault('driveOptions', {})['versionDate'] = getTimeOrDeltaFromNow() | ||
elif myarg in {'includeshareddrives', 'includeteamdrives'}: | ||
query.setdefault('driveOptions', {})['includeSharedDrives'] = getBoolean() | ||
elif myarg == 'driveclientsideencryption': | ||
query.setdefault('driveOptions', {})['clientSideEncryptedOption'] = getChoice(VAULT_CSE_OPTION_MAP, mapChoice=True) | ||
# hangoutsChat | ||
elif myarg == 'includerooms': | ||
query['hangoutsChatOptions'] = {'includeRooms': getBoolean()} | ||
elif myarg == 'excludedrafts': | ||
query['mailOptions'] = {'excludeDrafts': getBoolean()} | ||
elif myarg == 'mailclientsideencryption': | ||
query.setdefault('mailOptions', {})['clientSideEncryptedOption'] = getChoice(VAULT_CSE_OPTION_MAP, mapChoice=True) | ||
# voice | ||
elif myarg == 'covereddata': | ||
query['voiceOptions'] = {'coveredData': getChoice(VAULT_VOICE_COVERED_DATA_MAP, mapChoice=True)} | ||
|
@@ -40609,18 +40614,20 @@ def _validateVaultQuery(body, corpusArgumentMap): | |
if body['query']['corpus'] != corpus: | ||
body['exportOptions'].pop(options, None) | ||
|
||
# gam create vaultexport|export matter <MatterItem> [name <String>] corpus calendar|drive|mail|groups|hangouts_chat|voice | ||
# gam create vaultexport|export matter <MatterItem> [name <String>] corpus calendar|drive|gemini|groups|hangouts_chat|mail|voice | ||
# (accounts <EmailAddressEntity>) | (orgunit|org|ou <OrgUnitPath>) | everyone | ||
# (shareddrives|teamdrives <TeamDriveIDList>) | (rooms <RoomList>) | (sitesurl <URLList>) | ||
# [scope <all_data|held_data|unprocessed_data>] | ||
# [terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>] [timezone <TimeZone>] | ||
# [locationquery <StringList>] [peoplequery <StringList>] [minuswords <StringList>] | ||
# [responsestatuses <AttendeeStatus>(,<AttendeeStatus>)*] [calendarversiondate <Date>|<Time>] | ||
# [includeshareddrives <Boolean>] [driveversiondate <Date>|<Time>] [includeaccessinfo <Boolean>] | ||
# [driveclientsideencryption any|encrypted|unencrypted] | ||
# [includerooms <Boolean>] | ||
# [excludedrafts <Boolean>] [format mbox|pst] | ||
# [excludedrafts <Boolean>] [mailclientsideencryption any|encrypted|unencrypted] | ||
# [showconfidentialmodecontent <Boolean>] [usenewexport <Boolean>] [exportlinkeddrivefiles <Boolean>] | ||
# [covereddata calllogs|textmessages|voicemails] | ||
# [format ics|mbox|pst|xml] | ||
# [region any|europe|us] [showdetails|returnidonly] | ||
def doCreateVaultExport(): | ||
v = buildGAPIObject(API.VAULT) | ||
|