Skip to content

Commit

Permalink
Updated gam create vaultexport to include corpus gemini.
Browse files Browse the repository at this point in the history
  • Loading branch information
taers232c committed Feb 8, 2025
1 parent 6b3ddf7 commit c6ec83f
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/winget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: taers232c.GAMADV-XTD3
release-tag: v7.03.06
release-tag: v7.03.07
max-versions-to-keep: 1 # keep only latest versions
installers-regex: '\.msi$'
token: ${{ secrets.WINGET_TOKEN }}
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ script:
before_deploy:
# Comment out for Linux Xenial and Trusty
#- yes | gem update --system --force
#- gem install bundler
#- gem install faraday-net_http -v '3.3.0' # Fix faraday version
#- gem install uri
#- gem install logger
- gem install bundler
- gem install faraday-net_http -v '3.3.0' # Fix faraday version
- gem install uri
- gem install logger
- export TRAVIS_TAG="preview"
- unset LD_LIBRARY_PATH

Expand All @@ -115,8 +115,8 @@ deploy:
# Linux 64-Bit Bionic and Linux ARM64 Focal and Linux ARM64 Bionic and Linux ARM64 Xenial
# edge: true
# Linux Xenial and Trusty
edge:
branch: v2.0.3-beta.4
# edge:
# branch: v2.0.3-beta.4
# branch: v2.0.5-beta.1
on:
repo: taers232c/GAMADV-XTD3
Expand Down
12 changes: 7 additions & 5 deletions src/GamCommands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2092,23 +2092,23 @@ gam move browsers ou|org|orgunit <OrgUnitPath>
gam info browser <DeviceID>
(basic|full|annotated |
(<BrowserFieldName>* [fields <BrowserFieldNameList>]) |
(rawfields <BrowserFieldNameList>))
(rawfields "<BrowserFieldNameList>"))
[formatjson]
gam show browsers
([ou|org|orgunit|browserou <OrgUnitPath>] [(query <QueryBrowser>)|(queries <QueryBrowserList>))|(select <BrowserEntity>))
[querytime<String> <Time>]
[orderby <BrowserOrderByFieldName> [ascending|descending]]
(basic|full|annotated |
(<BrowserFieldName>* [fields <BrowserFieldNameList>]) |
(rawfields <BrowserFieldNameList>))
(rawfields "<BrowserFieldNameList>"))
[formatjson]
gam print browsers [todrive <ToDriveAttribute>*]
([ou|org|orgunit|browserou <OrgUnitPath>] [(query <QueryBrowser>)|(queries <QueryBrowserList>))|(select <BrowserEntity>))
[querytime<String> <Time>]
[orderby <BrowserOrderByFieldName> [ascending|descending]]
(basic|full|annotated |
(<BrowserFieldName>* [fields <BrowserFieldNameList>]) |
(rawfields <BrowserFieldNameList>))
(rawfields "<BrowserFieldNameList>"))
[sortheaders]
[formatjson [quotechar <Character>]]

Expand Down Expand Up @@ -5270,18 +5270,20 @@ gam print vaultcounts [todrive <ToDriveAttributes>*]
gam print vaultcounts [todrive <ToDriveAttributes>*]
matter <MatterItem> operation <String> [wait <Integer>]

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 <SharedDriveIDList>) | (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]
gam delete vaultexport|export <ExportItem> matter <MatterItem>
gam delete vaultexport|export <MatterItem> <ExportItem>
Expand Down
8 changes: 7 additions & 1 deletion src/GamUpdate.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
7.03.07

Updated `gam create vaultexport` to include `corpus gemini`.

* See: https://workspaceupdates.googleblog.com/2025/02/google-vault-now-supports-gemini.html

7.03.06

Added option `rawfields <BrowserFieldNameList>` to `gam info|print|show browsers` that allows
Added option `rawfields "<BrowserFieldNameList>"` to `gam info|print|show browsers` that allows
specification of complex field lists with selected subfields.

7.03.05
Expand Down
65 changes: 36 additions & 29 deletions src/gam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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()
Expand All @@ -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],
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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):
Expand All @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = {
Expand All @@ -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',
Expand All @@ -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',
}
Expand All @@ -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',
# mail
'excludedrafts',
'mailclientsideencryption', 'excludedrafts',
# voice
'covereddata',
] + list(VAULT_SEARCH_METHODS_MAP.keys())
Expand Down Expand Up @@ -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()}
# mail
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)}
Expand All @@ -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)
Expand Down

0 comments on commit c6ec83f

Please sign in to comment.