mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-17 04:31:37 +00:00
Compare commits
16 Commits
20250205.0
...
20250208.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d9f5689f3 | ||
|
|
8cd378ff8f | ||
|
|
c0e037dda5 | ||
|
|
b5730aadce | ||
|
|
4ec58bb844 | ||
|
|
3ba99582dc | ||
|
|
b61a4f5115 | ||
|
|
7ce83b4623 | ||
|
|
a58a998b49 | ||
|
|
4e04bd7c51 | ||
|
|
779ac0a6a0 | ||
|
|
f18b7258bb | ||
|
|
d4932c9d39 | ||
|
|
352845e482 | ||
|
|
ff49c67580 | ||
|
|
efee86cd33 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -17,7 +17,7 @@ defaults:
|
||||
working-directory: src
|
||||
|
||||
env:
|
||||
SCRATCH_COUNTER: 7
|
||||
SCRATCH_COUNTER: 9
|
||||
OPENSSL_CONFIG_OPTS: no-fips --api=3.0.0
|
||||
OPENSSL_INSTALL_PATH: ${{ github.workspace }}/bin/ssl
|
||||
OPENSSL_SOURCE_PATH: ${{ github.workspace }}/src/openssl
|
||||
|
||||
32
.github/workflows/pypi.yml
vendored
Normal file
32
.github/workflows/pypi.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: build and publish releases to PyPi
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||
|
||||
jobs:
|
||||
pypi:
|
||||
name: Upload release to PyPI
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: pypi
|
||||
url: https://pypi.org/p/gam7
|
||||
permissions:
|
||||
id-token: write
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install required packages to publish
|
||||
run: |
|
||||
python3 -m pip install --upgrade build
|
||||
|
||||
- name: Build packages
|
||||
run: |
|
||||
python -m build
|
||||
|
||||
- name: Publish package distributions to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
42
pyproject.toml
Normal file
42
pyproject.toml
Normal file
@@ -0,0 +1,42 @@
|
||||
[project]
|
||||
name = "gam7"
|
||||
dynamic = [
|
||||
"dependencies",
|
||||
"version",
|
||||
]
|
||||
authors = [
|
||||
{ name="Jay Lee", email="jay0lee@gmail.com" },
|
||||
{ name="Ross Scroggs", email="Ross.Scroggs@gmail.com" },
|
||||
]
|
||||
description = "CLI tool to manage Google Workspace"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.9"
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
"Operating System :: OS Independent",
|
||||
]
|
||||
license = {text = "Apache License (2.0)"}
|
||||
license-files = ["LICEN[CS]E*"]
|
||||
|
||||
[project.scripts]
|
||||
gam = "gam.__main__:main"
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/GAM-team/GAM"
|
||||
Issues = "https://github.com/GAM-team/GAM/issues"
|
||||
|
||||
[tool.hatch.version]
|
||||
path = "src/gam/__init__.py"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/gam"]
|
||||
|
||||
[tool.hatch.metadata.hooks.requirements_txt]
|
||||
files = ["src/requirements.txt"]
|
||||
|
||||
[build-system]
|
||||
requires = [
|
||||
"hatchling",
|
||||
"hatch-requirements_txt",
|
||||
]
|
||||
build-backend = "hatchling.build"
|
||||
@@ -2090,19 +2090,25 @@ gam move browsers ou|org|orgunit <OrgUnitPath>
|
||||
[batchsize <Integer>]
|
||||
|
||||
gam info browser <DeviceID>
|
||||
[basic|full|annotated] <BrowserFieldName>* [fields <BrowserFieldNameList>]
|
||||
(basic|full|annotated |
|
||||
(<BrowserFieldName>* [fields <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|allfields|annotated] <BrowserFieldName>* [fields <BrowserFieldNameList>]
|
||||
(basic|full|annotated |
|
||||
(<BrowserFieldName>* [fields <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|allfields|annotated] <BrowserFieldName>* [fields <BrowserFieldNameList>]
|
||||
(basic|full|annotated |
|
||||
(<BrowserFieldName>* [fields <BrowserFieldNameList>]) |
|
||||
(rawfields "<BrowserFieldNameList>"))
|
||||
[sortheaders]
|
||||
[formatjson [quotechar <Character>]]
|
||||
|
||||
@@ -5264,7 +5270,7 @@ 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]
|
||||
@@ -5272,10 +5278,12 @@ gam create vaultexport|export matter <MatterItem> [name <String>] corpus calenda
|
||||
[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>
|
||||
|
||||
@@ -1,9 +1,26 @@
|
||||
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
|
||||
specification of complex field lists with selected subfields.
|
||||
|
||||
* See: https://github.com/GAM-team/GAM/wiki/Chrome-Browser-Cloud-Management#raw-fields
|
||||
|
||||
7.03.05
|
||||
|
||||
Make GAM pip-installable: "pip install gam7"
|
||||
|
||||
7.03.04
|
||||
|
||||
Added option `security` to `gam create cigroup` that allows creation of a security group
|
||||
in a single command.
|
||||
|
||||
Updated to Python 3.13.2 where possible.
|
||||
Updated to Python 3.13.2.
|
||||
|
||||
7.03.03
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
||||
"""
|
||||
|
||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||
__version__ = '7.03.04'
|
||||
__version__ = '7.03.07'
|
||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||
|
||||
#pylint: disable=wrong-import-position
|
||||
@@ -7356,6 +7356,12 @@ def addFieldToFieldsList(fieldName, fieldsChoiceMap, fieldsList):
|
||||
def _getFieldsList():
|
||||
return getString(Cmd.OB_FIELD_NAME_LIST).lower().replace('_', '').replace(',', ' ').split()
|
||||
|
||||
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):
|
||||
fieldsList.extend(initialField)
|
||||
@@ -16568,7 +16574,7 @@ def doInfoAdminRole():
|
||||
fieldsList.append('rolePrivileges')
|
||||
else:
|
||||
unknownArgumentExit()
|
||||
fields = ','.join(set(fieldsList))
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
try:
|
||||
role = callGAPI(cd.roles(), 'get',
|
||||
throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.FAILED_PRECONDITION,
|
||||
@@ -17705,9 +17711,9 @@ def _getOrgUnits(cd, orgUnitPath, fieldsList, listType, showParent, batchSubOrgs
|
||||
if 'parentOrgUnitId' not in fieldsList:
|
||||
localFieldsList.append('parentOrgUnitId')
|
||||
deleteParentOrgUnitId = True
|
||||
fields = ','.join(set(localFieldsList))
|
||||
fields = getFieldsFromFieldsList(localFieldsList)
|
||||
else:
|
||||
fields = ','.join(set(fieldsList))
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
listfields = f'organizationUnits({fields})'
|
||||
if listType == 'all' and orgUnitPath == '/':
|
||||
printGettingAllAccountEntities(Ent.ORGANIZATIONAL_UNIT)
|
||||
@@ -22169,8 +22175,7 @@ def printShowUserPeopleContacts(users):
|
||||
if not fieldsList:
|
||||
ofields = _getPersonFields(PEOPLE_OTHER_CONTACTS_FIELDS_CHOICE_MAP, PEOPLE_CONTACTS_DEFAULT_FIELDS, fieldsList, parameters)
|
||||
else:
|
||||
fieldsList = [PEOPLE_OTHER_CONTACTS_FIELDS_CHOICE_MAP[field.lower()] for field in fieldsList if field.lower() in PEOPLE_OTHER_CONTACTS_FIELDS_CHOICE_MAP]
|
||||
ofields = ','.join(set(fieldsList))
|
||||
ofields = getFieldsFromFieldsList([PEOPLE_OTHER_CONTACTS_FIELDS_CHOICE_MAP[field.lower()] for field in fieldsList if field.lower() in PEOPLE_OTHER_CONTACTS_FIELDS_CHOICE_MAP])
|
||||
i, count, users = getEntityArgument(users)
|
||||
for user in users:
|
||||
i += 1
|
||||
@@ -24784,7 +24789,7 @@ def doPrintCrOSActivity(entityList=None):
|
||||
else:
|
||||
sortRows = True
|
||||
jcount = len(entityList)
|
||||
fields = ','.join(set(fieldsList))
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
svcargs = dict([('customerId', GC.Values[GC.CUSTOMER_ID]), ('deviceId', None), ('projection', projection), ('fields', fields)]+GM.Globals[GM.EXTRA_ARGS_LIST])
|
||||
method = getattr(cd.chromeosdevices(), 'get')
|
||||
dbatch = cd.new_batch_http_request(callback=_callbackPrintCrOS)
|
||||
@@ -25074,7 +25079,7 @@ def _showBrowser(browser, FJQC, i=0, count=0):
|
||||
return
|
||||
printEntity([Ent.CHROME_BROWSER, browser['deviceId']], i, count)
|
||||
Ind.Increment()
|
||||
showJSON(None, browser, timeObjects=BROWSER_TIME_OBJECTS)
|
||||
showJSON(None, browser, timeObjects=BROWSER_TIME_OBJECTS, dictObjectsKey={'machinePolicies': 'name'})
|
||||
Ind.Decrement()
|
||||
|
||||
BROWSER_FIELDS_CHOICE_MAP = {
|
||||
@@ -25114,11 +25119,13 @@ BROWSER_FIELDS_CHOICE_MAP = {
|
||||
'user': 'annotatedUser',
|
||||
'virtualdeviceid': 'virtualDeviceId',
|
||||
}
|
||||
BROWSER_ANNOTATED_FIELDS_LIST = ['annotatedAssetId', 'annotatedLocation', 'annotatedNotes', 'annotatedUser']
|
||||
BROWSER_ANNOTATED_FIELDS_LIST = ['annotatedAssetId', 'annotatedLocation', 'annotatedNotes', 'annotatedUser', 'deviceId']
|
||||
BROWSER_FULL_ACCESS_FIELDS = {'browsers', 'lastDeviceUsers', 'lastStatusReportTime', 'machinePolicies'}
|
||||
|
||||
# gam info browser <DeviceID>
|
||||
# [basic|full|annotated] <BrowserFieldName>* [fields <BrowserFieldNameList>]
|
||||
# (basic|full|annotated |
|
||||
# (<BrowserFieldName>* [fields <BrowserFieldNameList>]) |
|
||||
# (rawfields <BrowserFieldNameList>))
|
||||
# [formatjson]
|
||||
def doInfoBrowsers():
|
||||
cbcm = buildGAPIObject(API.CBCM)
|
||||
@@ -25126,6 +25133,7 @@ def doInfoBrowsers():
|
||||
deviceId = getString(Cmd.OB_DEVICE_ID)
|
||||
projection = 'BASIC'
|
||||
fieldsList = []
|
||||
rawFields = None
|
||||
FJQC = FormatJSONQuoteChar()
|
||||
while Cmd.ArgumentsRemaining():
|
||||
myarg = getArgument()
|
||||
@@ -25137,16 +25145,21 @@ def doInfoBrowsers():
|
||||
fieldsList = []
|
||||
elif getFieldsList(myarg, BROWSER_FIELDS_CHOICE_MAP, fieldsList, initialField='deviceId'):
|
||||
pass
|
||||
elif myarg == 'rawfields':
|
||||
projection = 'FULL'
|
||||
rawFields = _getRawFields('deviceId')
|
||||
else:
|
||||
FJQC.GetFormatJSON(myarg)
|
||||
if projection == 'BASIC' and set(fieldsList).intersection(BROWSER_FULL_ACCESS_FIELDS):
|
||||
projection = 'FULL'
|
||||
fields = ','.join(set(fieldsList))
|
||||
fields = getFieldsFromFieldsList(fieldsList) if not rawFields else rawFields
|
||||
try:
|
||||
browser = callGAPI(cbcm.chromebrowsers(), 'get',
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN],
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.FORBIDDEN],
|
||||
customer=customerId, deviceId=deviceId, projection=projection, fields=fields)
|
||||
_showBrowser(browser, FJQC)
|
||||
except GAPI.invalidArgument as e:
|
||||
entityActionFailedWarning([Ent.CHROME_BROWSER, deviceId], str(e))
|
||||
except (GAPI.badRequest, GAPI.resourceNotFound, GAPI.forbidden):
|
||||
checkEntityAFDNEorAccessErrorExit(None, Ent.CHROME_BROWSER, deviceId)
|
||||
|
||||
@@ -25347,7 +25360,7 @@ def doInfoChromeProfile():
|
||||
pass
|
||||
else:
|
||||
FJQC.GetFormatJSON(myarg)
|
||||
fields = ','.join(set(fieldsList))
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
try:
|
||||
profile = callGAPI(cm.customers().profiles(), 'get',
|
||||
throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED],
|
||||
@@ -25479,13 +25492,19 @@ BROWSER_ORDERBY_CHOICE_MAP = {
|
||||
# ([ou|org|orgunit|browserou <OrgUnitPath>] [(query <QueryBrowser)|(queries <QueryBrowserList>))|(select <BrowserEntity>))
|
||||
# [querytime<String> <Time>]
|
||||
# [orderby <BrowserOrderByFieldName> [ascending|descending]]
|
||||
# [basic|full|allfields|annotated] <BrowserFieldName>* [fields <BrowserFieldNameList>]
|
||||
# (basic|full|annotated |
|
||||
# (<BrowserFieldName>* [fields <BrowserFieldNameList>]) |
|
||||
# (rawfields <BrowserFieldNameList>))
|
||||
# (<BrowserFieldName>* [fields <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|allfields|annotated] <BrowserFieldName>* [fields <BrowserFieldNameList>]
|
||||
# (basic|full|annotated |
|
||||
# (<BrowserFieldName>* [fields <BrowserFieldNameList>]) |
|
||||
# (rawfields <BrowserFieldNameList>))
|
||||
# (<BrowserFieldName>* [fields <BrowserFieldNameList>]|(rawfields <BrowserFieldNameList>)
|
||||
# [sortheaders] [formatjson [quotechar <Character>]]
|
||||
def doPrintShowBrowsers():
|
||||
def _printBrowser(browser):
|
||||
@@ -25502,6 +25521,7 @@ def doPrintShowBrowsers():
|
||||
csvPF = CSVPrintFile(['deviceId']) if Act.csvFormat() else None
|
||||
FJQC = FormatJSONQuoteChar(csvPF)
|
||||
fieldsList = []
|
||||
rawFields = None
|
||||
projection = 'BASIC'
|
||||
orderBy = 'id'
|
||||
sortOrder = 'ASCENDING'
|
||||
@@ -25540,22 +25560,25 @@ def doPrintShowBrowsers():
|
||||
sortHeaders = True
|
||||
elif getFieldsList(myarg, BROWSER_FIELDS_CHOICE_MAP, fieldsList, initialField='deviceId'):
|
||||
pass
|
||||
elif myarg == 'rawfields':
|
||||
projection = 'FULL'
|
||||
rawFields = _getRawFields('deviceId')
|
||||
else:
|
||||
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
||||
if projection == 'BASIC' and set(fieldsList).intersection(BROWSER_FULL_ACCESS_FIELDS):
|
||||
projection = 'FULL'
|
||||
fields = getItemFieldsFromFieldsList('browsers', fieldsList)
|
||||
if FJQC.formatJSON:
|
||||
sortHeaders = False
|
||||
substituteQueryTimes(queries, queryTimes)
|
||||
if entityList is None:
|
||||
fields = getItemFieldsFromFieldsList('browsers', fieldsList) if not rawFields else f'nextPageToken,browsers({rawFields})'
|
||||
for query in queries:
|
||||
printGettingAllAccountEntities(Ent.CHROME_BROWSER, query)
|
||||
pageMessage = getPageMessage()
|
||||
try:
|
||||
feed = yieldGAPIpages(cbcm.chromebrowsers(), 'list', 'browsers',
|
||||
pageMessage=pageMessage, messageAttribute='deviceId',
|
||||
throwReasons=[GAPI.INVALID_INPUT, GAPI.BAD_REQUEST, GAPI.INVALID_ORGUNIT, GAPI.FORBIDDEN],
|
||||
throwReasons=[GAPI.INVALID_INPUT, GAPI.BAD_REQUEST, GAPI.INVALID_ARGUMENT, GAPI.INVALID_ORGUNIT, GAPI.FORBIDDEN],
|
||||
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS,
|
||||
customer=customerId, orgUnitPath=orgUnitPath, query=query, projection=projection,
|
||||
orderBy=orderBy, sortOrder=sortOrder, fields=fields)
|
||||
@@ -25579,7 +25602,7 @@ def doPrintShowBrowsers():
|
||||
else:
|
||||
entityActionFailedWarning([Ent.CHROME_BROWSER, None], str(e))
|
||||
return
|
||||
except (GAPI.invalidOrgunit, GAPI.forbidden) as e:
|
||||
except (GAPI.invalidArgument, GAPI.invalidOrgunit, GAPI.forbidden) as e:
|
||||
entityActionFailedWarning([Ent.CHROME_BROWSER, None], str(e))
|
||||
return
|
||||
except (GAPI.badRequest, GAPI.resourceNotFound):
|
||||
@@ -25587,15 +25610,17 @@ def doPrintShowBrowsers():
|
||||
else:
|
||||
sortRows = True
|
||||
jcount = len(entityList)
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
fields = getFieldsFromFieldsList(fieldsList) if not rawFields else rawFields
|
||||
j = 0
|
||||
for deviceId in entityList:
|
||||
j += 1
|
||||
try:
|
||||
browser = callGAPI(cbcm.chromebrowsers(), 'get',
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN],
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.FORBIDDEN],
|
||||
customer=customerId, deviceId=deviceId, projection=projection, fields=fields)
|
||||
_printBrowser(browser)
|
||||
except GAPI.invalidArgument as e:
|
||||
entityActionFailedWarning([Ent.CHROME_BROWSER, deviceId], str(e))
|
||||
except (GAPI.badRequest, GAPI.resourceNotFound, GAPI.forbidden):
|
||||
checkEntityAFDNEorAccessErrorExit(None, Ent.CHROME_BROWSER, deviceId)
|
||||
if csvPF:
|
||||
@@ -40430,9 +40455,10 @@ VAULT_SEARCH_METHODS_MAP = {
|
||||
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 = {
|
||||
@@ -40459,15 +40485,22 @@ VAULT_EXPORT_FORMAT_MAP = {
|
||||
'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',
|
||||
@@ -40476,16 +40509,18 @@ VAULT_EXPORT_REGION_MAP = {
|
||||
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',
|
||||
}
|
||||
@@ -40494,11 +40529,11 @@ VAULT_QUERY_ARGS = [
|
||||
# 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())
|
||||
@@ -40555,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)}
|
||||
@@ -40575,7 +40614,7 @@ 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>]
|
||||
@@ -40583,10 +40622,12 @@ def _validateVaultQuery(body, corpusArgumentMap):
|
||||
# [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)
|
||||
@@ -48246,7 +48287,7 @@ def doPrintCourseTopics():
|
||||
jcount = len(courseTopicIds)
|
||||
if jcount == 0:
|
||||
continue
|
||||
fields = f'{",".join(set(fieldsList))}'
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
j = 0
|
||||
for courseTopicId in courseTopicIds:
|
||||
j += 1
|
||||
@@ -48481,7 +48522,7 @@ def doPrintCourseWM(entityIDType, entityStateType):
|
||||
jcount = len(courseWMIds)
|
||||
if jcount == 0:
|
||||
continue
|
||||
fields = f'{",".join(set(fieldsList))}' if fieldsList else None
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
j = 0
|
||||
for courseWMId in courseWMIds:
|
||||
j += 1
|
||||
@@ -65501,7 +65542,7 @@ def infoSharedDrive(users, useDomainAdminAccess=False):
|
||||
guiRoles = getBoolean()
|
||||
else:
|
||||
FJQC.GetFormatJSON(myarg)
|
||||
fields = ','.join(set(fieldsList)) if fieldsList else '*'
|
||||
fields = getFieldsFromFieldsList(fieldsList) if fieldsList else '*'
|
||||
i, count, users = getEntityArgument(users)
|
||||
for user in users:
|
||||
i += 1
|
||||
|
||||
@@ -924,6 +924,7 @@ class GamCLArgs():
|
||||
OB_EXPORT_ITEM = 'ExportItem'
|
||||
OB_FIELD_NAME = 'FieldName'
|
||||
OB_FIELD_NAME_LIST = "FieldNameList"
|
||||
OB_FIELDS = 'Fields'
|
||||
OB_FILE_NAME = 'FileName'
|
||||
OB_FILE_NAME_FIELD_NAME = OB_FILE_NAME+'(:'+OB_FIELD_NAME+')+'
|
||||
OB_FILE_NAME_OR_URL = 'FileName|URL'
|
||||
|
||||
@@ -11,4 +11,4 @@ lxml
|
||||
passlib>=1.7.2
|
||||
pathvalidate
|
||||
python-dateutil
|
||||
yubikey-manager>=5.0
|
||||
yubikey-manager[yubikey]>=5.0
|
||||
|
||||
Reference in New Issue
Block a user