mirror of
https://github.com/GAM-team/GAM.git
synced 2025-05-12 04:07:21 +00:00
Add gemini reports and support new reports dynamically. Fixes #1773
This commit is contained in:
parent
c3add48f2a
commit
f2206d02e4
@ -13491,6 +13491,8 @@ REPORT_CHOICE_MAP = {
|
|||||||
'drive': 'drive',
|
'drive': 'drive',
|
||||||
'enterprisegroups': 'groups_enterprise',
|
'enterprisegroups': 'groups_enterprise',
|
||||||
'gcp': 'gcp',
|
'gcp': 'gcp',
|
||||||
|
'gemini': 'gemini_for_workspace',
|
||||||
|
'geminiforworkspace': 'gemini_for_workspace',
|
||||||
'gplus': 'gplus',
|
'gplus': 'gplus',
|
||||||
'google+': 'gplus',
|
'google+': 'gplus',
|
||||||
'group': 'groups',
|
'group': 'groups',
|
||||||
@ -13788,6 +13790,20 @@ def doReport():
|
|||||||
csvPF.WriteRow(row)
|
csvPF.WriteRow(row)
|
||||||
return (True, lastDate)
|
return (True, lastDate)
|
||||||
|
|
||||||
|
# dynamically extend our choices with other reports Google dynamically adds
|
||||||
|
rep = buildGAPIObject(API.REPORTS)
|
||||||
|
dyn_choices = rep._rootDesc \
|
||||||
|
.get('resources', {}) \
|
||||||
|
.get('activities', {}) \
|
||||||
|
.get('methods', {}) \
|
||||||
|
.get('list', {}) \
|
||||||
|
.get('parameters', {}) \
|
||||||
|
.get('applicationName', {}) \
|
||||||
|
.get('enum', [])
|
||||||
|
for dyn_choice in dyn_choices:
|
||||||
|
if dyn_choice.replace('_', '') not in REPORT_CHOICE_MAP and \
|
||||||
|
dyn_choice not in REPORT_CHOICE_MAP.values():
|
||||||
|
REPORT_CHOICE_MAP[dyn_choice.replace('_', '')] = dyn_choice
|
||||||
report = getChoice(REPORT_CHOICE_MAP, mapChoice=True)
|
report = getChoice(REPORT_CHOICE_MAP, mapChoice=True)
|
||||||
if report == 'usage':
|
if report == 'usage':
|
||||||
doReportUsage()
|
doReportUsage()
|
||||||
@ -13795,7 +13811,6 @@ def doReport():
|
|||||||
if report == 'usageparameters':
|
if report == 'usageparameters':
|
||||||
doReportUsageParameters()
|
doReportUsageParameters()
|
||||||
return
|
return
|
||||||
rep = buildGAPIObject(API.REPORTS)
|
|
||||||
customerId = GC.Values[GC.CUSTOMER_ID]
|
customerId = GC.Values[GC.CUSTOMER_ID]
|
||||||
if customerId == GC.MY_CUSTOMER:
|
if customerId == GC.MY_CUSTOMER:
|
||||||
customerId = None
|
customerId = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user