gam7 7.13.2__py3-none-any.whl → 7.14.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gam7 might be problematic. Click here for more details.
- gam/__init__.py +247 -50
- gam/gamlib/glapi.py +15 -0
- gam/gamlib/glclargs.py +13 -0
- gam/gamlib/glentity.py +11 -1
- gam/gamlib/glgapi.py +1 -0
- {gam7-7.13.2.dist-info → gam7-7.14.0.dist-info}/METADATA +1 -1
- {gam7-7.13.2.dist-info → gam7-7.14.0.dist-info}/RECORD +10 -10
- {gam7-7.13.2.dist-info → gam7-7.14.0.dist-info}/WHEEL +0 -0
- {gam7-7.13.2.dist-info → gam7-7.14.0.dist-info}/entry_points.txt +0 -0
- {gam7-7.13.2.dist-info → gam7-7.14.0.dist-info}/licenses/LICENSE +0 -0
gam/__init__.py
CHANGED
|
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
27
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
|
28
|
-
__version__ = '7.
|
|
28
|
+
__version__ = '7.14.00'
|
|
29
29
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
|
30
30
|
|
|
31
31
|
#pylint: disable=wrong-import-position
|
|
@@ -24113,7 +24113,10 @@ def infoCrOSDevices(entityList):
|
|
|
24113
24113
|
printKeyValueList([up, ''])
|
|
24114
24114
|
Ind.Increment()
|
|
24115
24115
|
for key, value in sorted(iter(cros[up].items())):
|
|
24116
|
-
|
|
24116
|
+
if key not in CROS_TIME_OBJECTS:
|
|
24117
|
+
printKeyValueList([key, value])
|
|
24118
|
+
else:
|
|
24119
|
+
printKeyValueList([key, formatLocalTime(value)])
|
|
24117
24120
|
Ind.Decrement()
|
|
24118
24121
|
if not noLists:
|
|
24119
24122
|
activeTimeRanges = _filterActiveTimeRanges(cros, True, listLimit, startDate, endDate, activeTimeRangesOrder)
|
|
@@ -25677,24 +25680,28 @@ def doPrintShowChromeProfiles():
|
|
|
25677
25680
|
csvPF.writeCSVfile('Chrome Profiles')
|
|
25678
25681
|
|
|
25679
25682
|
def _getChromeProfileNameList():
|
|
25680
|
-
if not Cmd.PeekArgumentPresent(['select', 'filter', 'filters']):
|
|
25683
|
+
if not Cmd.PeekArgumentPresent(['select', 'commands', 'filter', 'filters']):
|
|
25681
25684
|
return getString(Cmd.OB_CHROMEPROFILE_NAME_LIST).replace(',', ' ').split()
|
|
25682
25685
|
return []
|
|
25683
25686
|
|
|
25684
25687
|
def _initChromeProfileNameParameters():
|
|
25685
25688
|
cm = buildGAPIObject(API.CHROMEMANAGEMENT)
|
|
25686
|
-
return (cm, {'profileNameList': _getChromeProfileNameList(),
|
|
25689
|
+
return (cm, {'profileNameList': _getChromeProfileNameList(),
|
|
25690
|
+
'commandNameList': [],
|
|
25691
|
+
'customerId': _getCustomerId(),
|
|
25687
25692
|
'cbfilter': None, 'filterTimes': {},
|
|
25688
25693
|
'OBY': OrderBy(CHROMEPROFILE_ORDERBY_CHOICE_MAP)})
|
|
25689
25694
|
|
|
25690
25695
|
def _getChromeProfileNameParameters(myarg, parameters):
|
|
25691
|
-
if not parameters['cbfilter'] and myarg == 'select':
|
|
25696
|
+
if not parameters['cbfilter'] and not parameters['commandNameList'] and myarg == 'select':
|
|
25692
25697
|
parameters['profileNameList'].extend(getEntityList(Cmd.OB_CHROMEPROFILE_NAME_LIST))
|
|
25693
|
-
elif not parameters['profileNameList'] and myarg == '
|
|
25698
|
+
elif not parameters['cbfilter'] and not parameters['profileNameList'] and myarg == 'commands':
|
|
25699
|
+
parameters['commandNameList'].extend(getEntityList(Cmd.OB_CHROMEPROFILE_COMMAND_NAME_LIST))
|
|
25700
|
+
elif not parameters['profileNameList'] and not parameters['commandNameList'] and myarg == 'orderby':
|
|
25694
25701
|
parameters['OBY'].GetChoice()
|
|
25695
|
-
elif not parameters['profileNameList'] and myarg.startswith('filtertime'):
|
|
25702
|
+
elif not parameters['profileNameList'] and not parameters['commandNameList'] and myarg.startswith('filtertime'):
|
|
25696
25703
|
parameters['filterTimes'][myarg] = getTimeOrDeltaFromNow()
|
|
25697
|
-
elif not parameters['profileNameList'] and myarg in {'filter', 'filters'}:
|
|
25704
|
+
elif not parameters['profileNameList'] and not parameters['commandNameList'] and myarg in {'filter', 'filters'}:
|
|
25698
25705
|
parameters['cbfilter'] = getString(Cmd.OB_STRING)
|
|
25699
25706
|
else:
|
|
25700
25707
|
return False
|
|
@@ -25703,9 +25710,14 @@ def _getChromeProfileNameParameters(myarg, parameters):
|
|
|
25703
25710
|
def _getChromeProfileNameEntityForCommand(cm, parameters):
|
|
25704
25711
|
if parameters['cbfilter'] is None:
|
|
25705
25712
|
customerId = parameters['customerId']
|
|
25706
|
-
|
|
25707
|
-
|
|
25708
|
-
|
|
25713
|
+
if parameters['profileNameList']:
|
|
25714
|
+
for i, profileName in enumerate(parameters['profileNameList']):
|
|
25715
|
+
if not profileName.startswith('customers'):
|
|
25716
|
+
parameters['profileNameList'][i] = f'customers/{customerId}/profiles/{profileName}'
|
|
25717
|
+
elif parameters['commandNameList']:
|
|
25718
|
+
for i, commandName in enumerate(parameters['commandNameList']):
|
|
25719
|
+
if not commandName.startswith('customers'):
|
|
25720
|
+
parameters['commandNameList'][i] = f'customers/{customerId}/profiles/{commandName}'
|
|
25709
25721
|
return
|
|
25710
25722
|
if parameters['filterTimes']:
|
|
25711
25723
|
for filterTimeName, filterTimeValue in iter(parameters['filterTimes'].items()):
|
|
@@ -25740,13 +25752,23 @@ def _showChromeProfileCommand(profcmd, FJQC, i=0, count=0):
|
|
|
25740
25752
|
showJSON(None, profcmd, timeObjects=CHROMEPROFILECOMMAND_TIME_OBJECTS)
|
|
25741
25753
|
Ind.Decrement()
|
|
25742
25754
|
|
|
25755
|
+
def _printChromeProfileCommand(profcmd, csvPF, FJQC):
|
|
25756
|
+
row = flattenJSON(profcmd, timeObjects=CHROMEPROFILECOMMAND_TIME_OBJECTS)
|
|
25757
|
+
if not FJQC.formatJSON:
|
|
25758
|
+
csvPF.WriteRowTitles(row)
|
|
25759
|
+
elif csvPF.CheckRowTitles(row):
|
|
25760
|
+
csvPF.WriteRowNoFilter({'name': profcmd['name'],
|
|
25761
|
+
'JSON': json.dumps(cleanJSON(profcmd, timeObjects=CHROMEPROFILECOMMAND_TIME_OBJECTS),
|
|
25762
|
+
ensure_ascii=False, sort_keys=True)})
|
|
25763
|
+
|
|
25743
25764
|
# gam create chromeprofilecommand <ChromeProfileNameEntity>
|
|
25744
25765
|
# [clearcache [<Boolean>]] [clearcookies [<Boolean>]]
|
|
25745
|
-
# [formatjson]
|
|
25766
|
+
# [csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]]]
|
|
25746
25767
|
def doCreateChromeProfileCommand():
|
|
25747
25768
|
cm, parameters = _initChromeProfileNameParameters()
|
|
25748
25769
|
body = {'commandType': 'clearBrowsingData', 'payload': {}}
|
|
25749
|
-
|
|
25770
|
+
csvPF = None
|
|
25771
|
+
FJQC = FormatJSONQuoteChar(None)
|
|
25750
25772
|
while Cmd.ArgumentsRemaining():
|
|
25751
25773
|
myarg = getArgument()
|
|
25752
25774
|
if _getChromeProfileNameParameters(myarg, parameters):
|
|
@@ -25755,8 +25777,13 @@ def doCreateChromeProfileCommand():
|
|
|
25755
25777
|
body['payload']['clearCache'] = getBoolean()
|
|
25756
25778
|
elif myarg == 'clearcookies':
|
|
25757
25779
|
body['payload']['clearCookies'] = getBoolean()
|
|
25780
|
+
elif myarg == 'csv':
|
|
25781
|
+
csvPF = CSVPrintFile(['name'], 'sortall')
|
|
25782
|
+
FJQC.SetCsvPF(csvPF)
|
|
25783
|
+
elif csvPF and myarg == 'todrive':
|
|
25784
|
+
csvPF.GetTodriveParameters()
|
|
25758
25785
|
else:
|
|
25759
|
-
FJQC.
|
|
25786
|
+
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
|
25760
25787
|
_getChromeProfileNameEntityForCommand(cm, parameters)
|
|
25761
25788
|
count = len(parameters['profileNameList'])
|
|
25762
25789
|
i = 0
|
|
@@ -25766,11 +25793,16 @@ def doCreateChromeProfileCommand():
|
|
|
25766
25793
|
profcmd = callGAPI(cm.customers().profiles().commands(), 'create',
|
|
25767
25794
|
throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED],
|
|
25768
25795
|
parent=profileName, body=body)
|
|
25769
|
-
|
|
25796
|
+
if csvPF is None:
|
|
25797
|
+
_showChromeProfileCommand(profcmd, FJQC, i, count)
|
|
25798
|
+
else:
|
|
25799
|
+
_printChromeProfileCommand(profcmd, csvPF, FJQC)
|
|
25770
25800
|
except (GAPI.notFound) as e:
|
|
25771
25801
|
entityActionFailedWarning([Ent.CHROME_PROFILE_COMMAND, profileName], str(e), i, count)
|
|
25772
25802
|
except (GAPI.invalidArgument, GAPI.permissionDenied) as e:
|
|
25773
25803
|
entityActionFailedExit([Ent.CHROME_PROFILE_COMMAND, profileName], str(e))
|
|
25804
|
+
if csvPF:
|
|
25805
|
+
csvPF.writeCSVfile('Chrome Profile Commands')
|
|
25774
25806
|
|
|
25775
25807
|
# gam info chromeprofilecommand <ChromeProfileCommandName>
|
|
25776
25808
|
# [formatjson]
|
|
@@ -25794,15 +25826,6 @@ def doInfoChromeProfileCommand():
|
|
|
25794
25826
|
# gam print chromeprofilecommands <ChromeProfilNameEntity> [todrive <ToDriveAttribute>*]
|
|
25795
25827
|
# [formatjson [quotechar <Character>]]
|
|
25796
25828
|
def doPrintShowChromeProfileCommands():
|
|
25797
|
-
def _printProfileCommand(profcmd):
|
|
25798
|
-
row = flattenJSON(profcmd, timeObjects=CHROMEPROFILECOMMAND_TIME_OBJECTS)
|
|
25799
|
-
if not FJQC.formatJSON:
|
|
25800
|
-
csvPF.WriteRowTitles(row)
|
|
25801
|
-
elif csvPF.CheckRowTitles(row):
|
|
25802
|
-
csvPF.WriteRowNoFilter({'name': profcmd['name'],
|
|
25803
|
-
'JSON': json.dumps(cleanJSON(profcmd, timeObjects=CHROMEPROFILECOMMAND_TIME_OBJECTS),
|
|
25804
|
-
ensure_ascii=False, sort_keys=True)})
|
|
25805
|
-
|
|
25806
25829
|
csvPF = CSVPrintFile(['name']) if Act.csvFormat() else None
|
|
25807
25830
|
FJQC = FormatJSONQuoteChar(csvPF)
|
|
25808
25831
|
cm, parameters = _initChromeProfileNameParameters()
|
|
@@ -25815,32 +25838,50 @@ def doPrintShowChromeProfileCommands():
|
|
|
25815
25838
|
else:
|
|
25816
25839
|
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
|
25817
25840
|
_getChromeProfileNameEntityForCommand(cm, parameters)
|
|
25818
|
-
|
|
25819
|
-
|
|
25820
|
-
|
|
25821
|
-
|
|
25822
|
-
|
|
25823
|
-
|
|
25824
|
-
|
|
25825
|
-
|
|
25826
|
-
|
|
25827
|
-
|
|
25828
|
-
|
|
25829
|
-
|
|
25830
|
-
|
|
25831
|
-
|
|
25832
|
-
|
|
25833
|
-
|
|
25834
|
-
|
|
25835
|
-
|
|
25836
|
-
|
|
25837
|
-
|
|
25838
|
-
|
|
25839
|
-
|
|
25840
|
-
|
|
25841
|
-
|
|
25842
|
-
|
|
25843
|
-
|
|
25841
|
+
if parameters['profileNameList']:
|
|
25842
|
+
count = len(parameters['profileNameList'])
|
|
25843
|
+
i = 0
|
|
25844
|
+
for profileName in parameters['profileNameList']:
|
|
25845
|
+
i +=1
|
|
25846
|
+
printGettingEntityItemForWhom(Ent.CHROME_PROFILE_COMMAND, profileName, i, count)
|
|
25847
|
+
pageMessage = getPageMessage()
|
|
25848
|
+
try:
|
|
25849
|
+
profcmds = callGAPIpages(cm.customers().profiles().commands(), 'list', 'chromeBrowserProfileCommands',
|
|
25850
|
+
pageMessage=pageMessage,
|
|
25851
|
+
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
|
|
25852
|
+
parent=profileName, pageSize=100)
|
|
25853
|
+
if not csvPF:
|
|
25854
|
+
jcount = len(profcmds)
|
|
25855
|
+
Ind.Increment()
|
|
25856
|
+
j = 0
|
|
25857
|
+
for profcmd in profcmds:
|
|
25858
|
+
j += 1
|
|
25859
|
+
_showChromeProfileCommand(profcmd, FJQC, j, jcount)
|
|
25860
|
+
Ind.Decrement()
|
|
25861
|
+
else:
|
|
25862
|
+
for profcmd in profcmds:
|
|
25863
|
+
_printChromeProfileCommand(profcmd, csvPF, FJQC)
|
|
25864
|
+
except GAPI.notFound as e:
|
|
25865
|
+
entityActionFailedWarning([Ent.CHROME_PROFILE, profileName], str(e), i, count)
|
|
25866
|
+
except (GAPI.invalidArgument, GAPI.permissionDenied) as e:
|
|
25867
|
+
entityActionFailedExit([Ent.CHROME_PROFILE, profileName], str(e))
|
|
25868
|
+
elif parameters['commandNameList']:
|
|
25869
|
+
count = len(parameters['commandNameList'])
|
|
25870
|
+
i = 0
|
|
25871
|
+
for profileCommandName in parameters['commandNameList']:
|
|
25872
|
+
i +=1
|
|
25873
|
+
try:
|
|
25874
|
+
profcmd = callGAPI(cm.customers().profiles().commands(), 'get',
|
|
25875
|
+
throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED],
|
|
25876
|
+
name=profileCommandName)
|
|
25877
|
+
if not csvPF:
|
|
25878
|
+
_showChromeProfileCommand(profcmd, FJQC, i, count)
|
|
25879
|
+
else:
|
|
25880
|
+
_printChromeProfileCommand(profcmd, csvPF, FJQC)
|
|
25881
|
+
except GAPI.notFound as e:
|
|
25882
|
+
entityActionFailedWarning([Ent.CHROME_PROFILE_COMMAND, profileCommandName], str(e), i, count)
|
|
25883
|
+
except (GAPI.invalidArgument, GAPI.permissionDenied) as e:
|
|
25884
|
+
entityActionFailedExit([Ent.CHROME_PROFILE, profileCommandName], str(e))
|
|
25844
25885
|
if csvPF:
|
|
25845
25886
|
csvPF.writeCSVfile('Chrome Profile Commands')
|
|
25846
25887
|
|
|
@@ -76450,6 +76491,147 @@ def importTasklist(users):
|
|
|
76450
76491
|
tasklist=tasklistId, parent=parent, body=task)
|
|
76451
76492
|
parentIdMap[taskId] = result['id']
|
|
76452
76493
|
|
|
76494
|
+
TAGMANAGER_PARAMETERS = {
|
|
76495
|
+
Ent.TAGMANAGER_ACCOUNT: {'api': API.TAGMANAGER, 'respType': 'account', 'parentEntityType': None,
|
|
76496
|
+
'name': 'name', 'idList': ['accountId']},
|
|
76497
|
+
Ent.TAGMANAGER_CONTAINER: {'api': API.TAGMANAGER, 'respType': 'container', 'parentEntityType': Ent.TAGMANAGER_ACCOUNT,
|
|
76498
|
+
'name': 'name', 'idList': ['accountId', 'containerId']},
|
|
76499
|
+
Ent.TAGMANAGER_WORKSPACE: {'api': API.TAGMANAGER, 'respType': 'workspace', 'parentEntityType': Ent.TAGMANAGER_CONTAINER,
|
|
76500
|
+
'name': 'name', 'idList': ['accountId', 'containerId', 'workspaceId']},
|
|
76501
|
+
Ent.TAGMANAGER_TAG: {'api': API.TAGMANAGER, 'respType': 'tag', 'parentEntityType': Ent.TAGMANAGER_WORKSPACE,
|
|
76502
|
+
'name': 'name', 'idList': ['accountId', 'containerId', 'workspaceId', 'tagId']},
|
|
76503
|
+
Ent.TAGMANAGER_PERMISSION: {'api': API.TAGMANAGER_USERS, 'respType': 'userPermission', 'parentEntityType': Ent.TAGMANAGER_ACCOUNT,
|
|
76504
|
+
'name': 'emailAddress', 'idList': ['accountId']},
|
|
76505
|
+
}
|
|
76506
|
+
|
|
76507
|
+
def printShowTagManagerObjects(users, entityType):
|
|
76508
|
+
csvPF = CSVPrintFile(['User']) if Act.csvFormat() else None
|
|
76509
|
+
FJQC = FormatJSONQuoteChar(csvPF)
|
|
76510
|
+
if entityType == Ent.TAGMANAGER_ACCOUNT:
|
|
76511
|
+
kwargs = {'includeGoogleTags': False}
|
|
76512
|
+
parentList = [None]
|
|
76513
|
+
else:
|
|
76514
|
+
kwargs = {'parent': None}
|
|
76515
|
+
if not checkArgumentPresent('select'):
|
|
76516
|
+
parentList = getString(Cmd.OB_TAGMANAGER_PATH_LIST).replace(',', ' ').split()
|
|
76517
|
+
else:
|
|
76518
|
+
parentList = getEntityList(Cmd.OB_TAGMANAGER_PATH_LIST)
|
|
76519
|
+
parameters = TAGMANAGER_PARAMETERS[entityType]
|
|
76520
|
+
if csvPF:
|
|
76521
|
+
csvPF.AddTitles([parameters['name'], 'path'])
|
|
76522
|
+
while Cmd.ArgumentsRemaining():
|
|
76523
|
+
myarg = getArgument()
|
|
76524
|
+
if csvPF and myarg == 'todrive':
|
|
76525
|
+
csvPF.GetTodriveParameters()
|
|
76526
|
+
elif entityType == Ent.TAGMANAGER_ACCOUNT and myarg == 'includegoogletags':
|
|
76527
|
+
kwargs['includeGoogleTags'] = getBoolean()
|
|
76528
|
+
else:
|
|
76529
|
+
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
|
76530
|
+
i, count, users = getEntityArgument(users)
|
|
76531
|
+
for user in users:
|
|
76532
|
+
i += 1
|
|
76533
|
+
user, svc = buildGAPIServiceObject(parameters['api'], user, i, count)
|
|
76534
|
+
if not svc:
|
|
76535
|
+
continue
|
|
76536
|
+
if entityType == Ent.TAGMANAGER_ACCOUNT:
|
|
76537
|
+
svc = svc.accounts()
|
|
76538
|
+
elif entityType == Ent.TAGMANAGER_CONTAINER:
|
|
76539
|
+
svc = svc.accounts().containers()
|
|
76540
|
+
elif entityType == Ent.TAGMANAGER_WORKSPACE:
|
|
76541
|
+
svc = svc.accounts().containers().workspaces()
|
|
76542
|
+
elif entityType == Ent.TAGMANAGER_TAG:
|
|
76543
|
+
svc = svc.accounts().containers().workspaces().tags()
|
|
76544
|
+
else: #elif entityType == Ent.TAGMANAGER_PERMISSION:
|
|
76545
|
+
svc = svc.accounts().user_permissions()
|
|
76546
|
+
jcount = len(parentList)
|
|
76547
|
+
j = 0
|
|
76548
|
+
for parent in parentList:
|
|
76549
|
+
j += 1
|
|
76550
|
+
if entityType == Ent.TAGMANAGER_ACCOUNT:
|
|
76551
|
+
printGettingAllEntityItemsForWhom(entityType, user, i, count)
|
|
76552
|
+
else:
|
|
76553
|
+
kwargs['parent'] = parent
|
|
76554
|
+
qualifier = f' for {Ent.Singular(parameters["parentEntityType"])}: {parent}'
|
|
76555
|
+
printGettingAllEntityItemsForWhom(entityType, user, i, count, qualifier=qualifier)
|
|
76556
|
+
try:
|
|
76557
|
+
results = callGAPIpages(svc, 'list', parameters['respType'],
|
|
76558
|
+
pageMessage=getPageMessageForWhom(),
|
|
76559
|
+
throwReasons=GAPI.TAGMANAGER_THROW_REASONS,
|
|
76560
|
+
**kwargs)
|
|
76561
|
+
except (GAPI.badRequest, GAPI.invalid, GAPI.notFound) as e:
|
|
76562
|
+
entityActionFailedWarning([Ent.USER, user, entityType, kwargs['parent']], str(e), j, jcount)
|
|
76563
|
+
continue
|
|
76564
|
+
kcount = len(results)
|
|
76565
|
+
if not csvPF:
|
|
76566
|
+
if not FJQC.formatJSON:
|
|
76567
|
+
entityPerformActionNumItems([Ent.USER, user], kcount, entityType, j, jcount)
|
|
76568
|
+
Ind.Increment()
|
|
76569
|
+
k = 0
|
|
76570
|
+
for result in results:
|
|
76571
|
+
k += 1
|
|
76572
|
+
if not FJQC.formatJSON:
|
|
76573
|
+
printEntity([entityType, result['path']], k, kcount)
|
|
76574
|
+
Ind.Increment()
|
|
76575
|
+
printKeyValueList([parameters['name'], result.pop(parameters['name'])])
|
|
76576
|
+
for tmid in parameters['idList']:
|
|
76577
|
+
printKeyValueList([tmid, result.pop(tmid)])
|
|
76578
|
+
showJSON(None, result)
|
|
76579
|
+
Ind.Decrement()
|
|
76580
|
+
else:
|
|
76581
|
+
printLine(json.dumps(cleanJSON(result), ensure_ascii=False, sort_keys=True))
|
|
76582
|
+
Ind.Decrement()
|
|
76583
|
+
else:
|
|
76584
|
+
for result in results:
|
|
76585
|
+
baseRow = {'User': user}
|
|
76586
|
+
for tmid in parameters['idList']:
|
|
76587
|
+
baseRow[tmid] = result.pop(tmid)
|
|
76588
|
+
row = flattenJSON(result, flattened=baseRow)
|
|
76589
|
+
if not FJQC.formatJSON:
|
|
76590
|
+
csvPF.WriteRowTitles(row)
|
|
76591
|
+
elif csvPF.CheckRowTitles(row):
|
|
76592
|
+
row = {'User': user, parameters['name']: result[parameters['name']], 'path': result['path']}
|
|
76593
|
+
row['JSON'] = json.dumps(cleanJSON(result), ensure_ascii=False, sort_keys=True)
|
|
76594
|
+
csvPF.WriteRowNoFilter(row)
|
|
76595
|
+
if csvPF:
|
|
76596
|
+
csvPF.writeCSVfile(Ent.Plural(entityType))
|
|
76597
|
+
|
|
76598
|
+
# gam <UserTypeEntity> show tagmanageraccounts
|
|
76599
|
+
# [includegoogletags [<Boolean>]]
|
|
76600
|
+
# [formatjson]
|
|
76601
|
+
# gam <UserTypeEntity> print tagmanagerccounts [todrive <ToDriveAttribute>*]
|
|
76602
|
+
# [includegoogletags [<Boolean>]]
|
|
76603
|
+
# [formatjson [quotechar <Character>]]
|
|
76604
|
+
def printShowTagManagerAccounts(users):
|
|
76605
|
+
printShowTagManagerObjects(users, Ent.TAGMANAGER_ACCOUNT)
|
|
76606
|
+
|
|
76607
|
+
# gam <UserTypeEntity> show tagmanagercontainers <TagManagerAccountPathEntity>
|
|
76608
|
+
# [formatjson]
|
|
76609
|
+
# gam <UserTypeEntity> print tagmanagercontainers <TagManagerAccountPathEntity> [todrive <ToDriveAttribute>*]
|
|
76610
|
+
# [formatjson [quotechar <Character>]]
|
|
76611
|
+
def printShowTagManagerContainers(users):
|
|
76612
|
+
printShowTagManagerObjects(users, Ent.TAGMANAGER_CONTAINER)
|
|
76613
|
+
|
|
76614
|
+
# gam <UserTypeEntity> show tagmanagerworkspaces <TagManagerContainerPathEntity>
|
|
76615
|
+
# [formatjson]
|
|
76616
|
+
# gam <UserTypeEntity> print tagmanagerworkspaces <TagManagerContainerPathEntity>
|
|
76617
|
+
# [formatjson [quotechar <Character>]]
|
|
76618
|
+
def printShowTagManagerWorkspaces(users):
|
|
76619
|
+
printShowTagManagerObjects(users, Ent.TAGMANAGER_WORKSPACE)
|
|
76620
|
+
|
|
76621
|
+
# gam <UserTypeEntity> show tagmanagertags <TagManagerWorkspacePathEntity>
|
|
76622
|
+
# [formatjson]
|
|
76623
|
+
# gam <UserTypeEntity> print tagmanagertags <TagManagerWorkspacePathEntity> [todrive <ToDriveAttribute>*]
|
|
76624
|
+
# [formatjson [quotechar <Character>]]
|
|
76625
|
+
def printShowTagManagerTags(users):
|
|
76626
|
+
printShowTagManagerObjects(users, Ent.TAGMANAGER_TAG)
|
|
76627
|
+
|
|
76628
|
+
# gam <UserTypeEntity> show tagmanagerpermissions <TagManagerAccountPathEntity>
|
|
76629
|
+
# [formatjson]
|
|
76630
|
+
# gam <UserTypeEntity> print tagmanagerpermissions <TagManagerAccountPathEntity> [todrive <ToDriveAttribute>*]
|
|
76631
|
+
# [formatjson [quotechar <Character>]]
|
|
76632
|
+
def printShowTagManagerPermissions(users):
|
|
76633
|
+
printShowTagManagerObjects(users, Ent.TAGMANAGER_PERMISSION)
|
|
76634
|
+
|
|
76453
76635
|
def getCRMOrgId():
|
|
76454
76636
|
setTrueCustomerId()
|
|
76455
76637
|
_, crm = buildGAPIServiceObject(API.CLOUDRESOURCEMANAGER, None)
|
|
@@ -78178,6 +78360,11 @@ USER_COMMANDS_WITH_OBJECTS = {
|
|
|
78178
78360
|
Cmd.ARG_SITE: deprecatedUserSites,
|
|
78179
78361
|
Cmd.ARG_SITEACL: deprecatedUserSites,
|
|
78180
78362
|
Cmd.ARG_SITEACTIVITY: deprecatedUserSites,
|
|
78363
|
+
Cmd.ARG_TAGMANAGERACCOUNT: printShowTagManagerAccounts,
|
|
78364
|
+
Cmd.ARG_TAGMANAGERCONTAINER: printShowTagManagerContainers,
|
|
78365
|
+
Cmd.ARG_TAGMANAGERPERMISSION: printShowTagManagerPermissions,
|
|
78366
|
+
Cmd.ARG_TAGMANAGERTAG: printShowTagManagerTags,
|
|
78367
|
+
Cmd.ARG_TAGMANAGERWORKSPACE: printShowTagManagerWorkspaces,
|
|
78181
78368
|
Cmd.ARG_TASK: printShowTasks,
|
|
78182
78369
|
Cmd.ARG_TASKLIST: printShowTasklists,
|
|
78183
78370
|
Cmd.ARG_THREAD: printShowThreads,
|
|
@@ -78285,6 +78472,11 @@ USER_COMMANDS_WITH_OBJECTS = {
|
|
|
78285
78472
|
Cmd.ARG_SITE: deprecatedUserSites,
|
|
78286
78473
|
Cmd.ARG_SITEACL: deprecatedUserSites,
|
|
78287
78474
|
Cmd.ARG_SMIME: printShowSmimes,
|
|
78475
|
+
Cmd.ARG_TAGMANAGERACCOUNT: printShowTagManagerAccounts,
|
|
78476
|
+
Cmd.ARG_TAGMANAGERCONTAINER: printShowTagManagerContainers,
|
|
78477
|
+
Cmd.ARG_TAGMANAGERPERMISSION: printShowTagManagerPermissions,
|
|
78478
|
+
Cmd.ARG_TAGMANAGERTAG: printShowTagManagerTags,
|
|
78479
|
+
Cmd.ARG_TAGMANAGERWORKSPACE: printShowTagManagerWorkspaces,
|
|
78288
78480
|
Cmd.ARG_TASK: printShowTasks,
|
|
78289
78481
|
Cmd.ARG_TASKLIST: printShowTasklists,
|
|
78290
78482
|
Cmd.ARG_THREAD: printShowThreads,
|
|
@@ -78524,6 +78716,11 @@ USER_COMMANDS_OBJ_ALIASES = {
|
|
|
78524
78716
|
Cmd.ARG_SITES: Cmd.ARG_SITE,
|
|
78525
78717
|
Cmd.ARG_SITEACLS: Cmd.ARG_SITEACL,
|
|
78526
78718
|
Cmd.ARG_SMIMES: Cmd.ARG_SMIME,
|
|
78719
|
+
Cmd.ARG_TAGMANAGERACCOUNTS: Cmd.ARG_TAGMANAGERACCOUNT,
|
|
78720
|
+
Cmd.ARG_TAGMANAGERCONTAINERS: Cmd.ARG_TAGMANAGERCONTAINER,
|
|
78721
|
+
Cmd.ARG_TAGMANAGERPERMISSIONS: Cmd.ARG_TAGMANAGERPERMISSION,
|
|
78722
|
+
Cmd.ARG_TAGMANAGERTAGS: Cmd.ARG_TAGMANAGERTAG,
|
|
78723
|
+
Cmd.ARG_TAGMANAGERWORKSPACES: Cmd.ARG_TAGMANAGERWORKSPACE,
|
|
78527
78724
|
Cmd.ARG_TASKS: Cmd.ARG_TASK,
|
|
78528
78725
|
Cmd.ARG_TASKLISTS: Cmd.ARG_TASKLIST,
|
|
78529
78726
|
Cmd.ARG_TEAMDRIVE: Cmd.ARG_SHAREDDRIVE,
|
gam/gamlib/glapi.py
CHANGED
|
@@ -94,6 +94,8 @@ SITEVERIFICATION = 'siteVerification'
|
|
|
94
94
|
STORAGE = 'storage'
|
|
95
95
|
STORAGEREAD = 'storageread'
|
|
96
96
|
STORAGEWRITE = 'storagewrite'
|
|
97
|
+
TAGMANAGER = 'tagmanager'
|
|
98
|
+
TAGMANAGER_USERS = 'tagmanagerusers'
|
|
97
99
|
TASKS = 'tasks'
|
|
98
100
|
VAULT = 'vault'
|
|
99
101
|
YOUTUBE = 'youtube'
|
|
@@ -199,6 +201,7 @@ PROJECT_APIS = [
|
|
|
199
201
|
'sheets.googleapis.com',
|
|
200
202
|
'siteverification.googleapis.com',
|
|
201
203
|
'storage-api.googleapis.com',
|
|
204
|
+
'tagmanager.googleapis.com',
|
|
202
205
|
'tasks.googleapis.com',
|
|
203
206
|
'vault.googleapis.com',
|
|
204
207
|
'youtube.googleapis.com',
|
|
@@ -277,6 +280,8 @@ _INFO = {
|
|
|
277
280
|
STORAGE: {'name': 'Cloud Storage API', 'version': 'v1', 'v2discovery': True},
|
|
278
281
|
STORAGEREAD: {'name': 'Cloud Storage API - Read', 'version': 'v1', 'v2discovery': True, 'mappedAPI': STORAGE},
|
|
279
282
|
STORAGEWRITE: {'name': 'Cloud Storage API - Write', 'version': 'v1', 'v2discovery': True, 'mappedAPI': STORAGE},
|
|
283
|
+
TAGMANAGER: {'name': 'Tag Manager API', 'version': 'v2', 'v2discovery': True},
|
|
284
|
+
TAGMANAGER_USERS: {'name': 'Tag Manager API - Users', 'version': 'v2', 'v2discovery': True, 'mappedAPI': TAGMANAGER},
|
|
280
285
|
TASKS: {'name': 'Tasks API', 'version': 'v1', 'v2discovery': True},
|
|
281
286
|
VAULT: {'name': 'Vault API', 'version': 'v1', 'v2discovery': True},
|
|
282
287
|
YOUTUBE: {'name': 'Youtube API', 'version': 'v3', 'v2discovery': True},
|
|
@@ -696,6 +701,16 @@ _SVCACCT_SCOPES = [
|
|
|
696
701
|
'api': SHEETS,
|
|
697
702
|
'subscopes': READONLY,
|
|
698
703
|
'scope': 'https://www.googleapis.com/auth/spreadsheets'},
|
|
704
|
+
{'name': 'Tag Manager API - read only',
|
|
705
|
+
'api': TAGMANAGER,
|
|
706
|
+
'subscopes': [],
|
|
707
|
+
'offByDefault': True,
|
|
708
|
+
'scope': 'https://www.googleapis.com/auth/tagmanager.readonly'},
|
|
709
|
+
{'name': 'Tag Manager API - Users',
|
|
710
|
+
'api': TAGMANAGER_USERS,
|
|
711
|
+
'subscopes': [],
|
|
712
|
+
'offByDefault': True,
|
|
713
|
+
'scope': 'https://www.googleapis.com/auth/tagmanager.manage.users'},
|
|
699
714
|
{'name': 'Tasks API',
|
|
700
715
|
'api': TASKS,
|
|
701
716
|
'subscopes': READONLY,
|
gam/gamlib/glclargs.py
CHANGED
|
@@ -782,6 +782,16 @@ class GamCLArgs():
|
|
|
782
782
|
ARG_SUSPENDED = 'suspended'
|
|
783
783
|
ARG_SVCACCT = 'svcacct'
|
|
784
784
|
ARG_SVCACCTS = 'svcaccts'
|
|
785
|
+
ARG_TAGMANAGERACCOUNT = 'tagmanageraccount'
|
|
786
|
+
ARG_TAGMANAGERACCOUNTS = 'tagmanageraccounts'
|
|
787
|
+
ARG_TAGMANAGERCONTAINER = 'tagmanagercontainer'
|
|
788
|
+
ARG_TAGMANAGERCONTAINERS = 'tagmanagercontainers'
|
|
789
|
+
ARG_TAGMANAGERPERMISSION = 'tagmanagerpermission'
|
|
790
|
+
ARG_TAGMANAGERPERMISSIONS = 'tagmanagerpermissions'
|
|
791
|
+
ARG_TAGMANAGERTAG = 'tagmanagertag'
|
|
792
|
+
ARG_TAGMANAGERTAGS = 'tagmanagertags'
|
|
793
|
+
ARG_TAGMANAGERWORKSPACE = 'tagmanagerworkspace'
|
|
794
|
+
ARG_TAGMANAGERWORKSPACES = 'tagmanagerworkspaces'
|
|
785
795
|
ARG_TASK = 'task'
|
|
786
796
|
ARG_TASKS = 'tasks'
|
|
787
797
|
ARG_TASKLIST = 'tasklist'
|
|
@@ -859,6 +869,8 @@ class GamCLArgs():
|
|
|
859
869
|
OB_CHAT_THREAD = 'ChatThread'
|
|
860
870
|
OB_CHROMEPROFILE_NAME = 'ChromeProfileName'
|
|
861
871
|
OB_CHROMEPROFILE_NAME_LIST = 'ChromeProfileNameList'
|
|
872
|
+
OB_CHROMEPROFILE_COMMAND_NAME = 'ChromeProfileCommandName'
|
|
873
|
+
OB_CHROMEPROFILE_COMMAND_NAME_LIST = 'ChromeProfileNameCommandList'
|
|
862
874
|
OB_CHROME_VERSION = 'ChromeVersion'
|
|
863
875
|
OB_CIDR_NETMASK = 'CIDRnetmask'
|
|
864
876
|
OB_CIGROUP_ALIAS_LIST = "CIGroupAliasList"
|
|
@@ -1037,6 +1049,7 @@ class GamCLArgs():
|
|
|
1037
1049
|
OB_STRING_LIST = 'StringList'
|
|
1038
1050
|
OB_STUDENT_ITEM = 'StudentItem'
|
|
1039
1051
|
OB_TAG = 'Tag'
|
|
1052
|
+
OB_TAGMANAGER_PATH_LIST = 'TagManagerPathList'
|
|
1040
1053
|
OB_TASK_ID = 'TaskID'
|
|
1041
1054
|
OB_TASKLIST_ID = 'TaskListID'
|
|
1042
1055
|
OB_TASKLIST_ID_ENTITY = 'TaskListIDEntity'
|
gam/gamlib/glentity.py
CHANGED
|
@@ -358,7 +358,12 @@ class GamEntity():
|
|
|
358
358
|
SUBSCRIPTION = 'subs'
|
|
359
359
|
SVCACCT = 'svac'
|
|
360
360
|
SVCACCT_KEY = 'svky'
|
|
361
|
-
|
|
361
|
+
TAGMANAGER_ACCOUNT = 'tmac'
|
|
362
|
+
TAGMANAGER_CONTAINER = 'tmco'
|
|
363
|
+
TAGMANAGER_PERMISSION = 'tmpm'
|
|
364
|
+
TAGMANAGER_TAG = 'tmtg'
|
|
365
|
+
TAGMANAGER_WORKSPACE = 'tmws'
|
|
366
|
+
TARGET_USER = 'tgt '
|
|
362
367
|
TASK = 'task'
|
|
363
368
|
TASKLIST = 'tali'
|
|
364
369
|
TEACHER = 'teac'
|
|
@@ -710,6 +715,11 @@ class GamEntity():
|
|
|
710
715
|
SUBSCRIPTION: ['Subscriptions', 'Subscription'],
|
|
711
716
|
SVCACCT: ['Service Accounts', 'Service Account'],
|
|
712
717
|
SVCACCT_KEY: ['Service Account Keys', 'Service Account Key'],
|
|
718
|
+
TAGMANAGER_ACCOUNT: ['Tag Manager Accounts', 'Tag Manager Account'],
|
|
719
|
+
TAGMANAGER_CONTAINER: ['Tag Manager Containers', 'Tag Manager Container'],
|
|
720
|
+
TAGMANAGER_PERMISSION: ['Tag Manager Permissions', 'Tag Manager Permission'],
|
|
721
|
+
TAGMANAGER_TAG: ['Tag Manager Tags', 'Tag Manager Tag'],
|
|
722
|
+
TAGMANAGER_WORKSPACE: ['Tag Manager Workspaces', 'Tag Manager Workspace'],
|
|
713
723
|
TARGET_USER: ['Target Users', 'Target User'],
|
|
714
724
|
TASK: ['Tasks', 'Task'],
|
|
715
725
|
TASKLIST: ['Tasklists', 'Tasklist'],
|
gam/gamlib/glgapi.py
CHANGED
|
@@ -287,6 +287,7 @@ PEOPLE_ACCESS_THROW_REASONS = [SERVICE_NOT_AVAILABLE, FORBIDDEN, PERMISSION_DENI
|
|
|
287
287
|
RESELLER_THROW_REASONS = [BAD_REQUEST, RESOURCE_NOT_FOUND, FORBIDDEN, INVALID]
|
|
288
288
|
SHEETS_ACCESS_THROW_REASONS = DRIVE_USER_THROW_REASONS+[NOT_FOUND, PERMISSION_DENIED, FORBIDDEN, INTERNAL_ERROR, INSUFFICIENT_FILE_PERMISSIONS,
|
|
289
289
|
BAD_REQUEST, INVALID, INVALID_ARGUMENT, FAILED_PRECONDITION]
|
|
290
|
+
TAGMANAGER_THROW_REASONS = [BAD_REQUEST, PERMISSION_DENIED, INVALID, NOT_FOUND, ACCESS_NOT_CONFIGURED]
|
|
290
291
|
TASK_THROW_REASONS = [BAD_REQUEST, PERMISSION_DENIED, INVALID, NOT_FOUND, ACCESS_NOT_CONFIGURED]
|
|
291
292
|
TASKLIST_THROW_REASONS = [BAD_REQUEST, PERMISSION_DENIED, INVALID, NOT_FOUND, ACCESS_NOT_CONFIGURED]
|
|
292
293
|
USER_GET_THROW_REASONS = [USER_NOT_FOUND, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, FORBIDDEN, BAD_REQUEST, SYSTEM_ERROR]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
gam/__init__.py,sha256=
|
|
1
|
+
gam/__init__.py,sha256=7wIFDnx5OWTyTy0ROPMkP8x0WqmTGE_hHi7OkuPdIz4,3571428
|
|
2
2
|
gam/__main__.py,sha256=amz0-959ph6zkZKqjaar4n60yho-T37w6qWI36qx0CA,1049
|
|
3
3
|
gam/cacerts.pem,sha256=82Ak7btW_2XvocLUvAwPmpx8Chi0oqtZUG1gseLK_t4,50235
|
|
4
4
|
gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
|
|
@@ -23,11 +23,11 @@ gam/atom/token_store.py,sha256=7E6Ecvxa86WCvl1pJAhv78jg9OxQv8pMtIUcPhZCq04,3803
|
|
|
23
23
|
gam/atom/url.py,sha256=pxO1TlORxyKQTQ1bkBE1unFzjnv9c8LjJkm-UEORShY,4276
|
|
24
24
|
gam/gamlib/__init__.py,sha256=z5mF-y0j8pm-YNFBaiuxB4M_GAUPG-cXWwrhYwrVReM,679
|
|
25
25
|
gam/gamlib/glaction.py,sha256=1Il_HrChVnPkzZwiZs5au4mFQVtq4K1Z42uIuR6qdnI,9419
|
|
26
|
-
gam/gamlib/glapi.py,sha256=
|
|
26
|
+
gam/gamlib/glapi.py,sha256=EcZqYgRnPFKMKZPNG_VLwuD2hWELy-AquzgZjIh8UUc,35974
|
|
27
27
|
gam/gamlib/glcfg.py,sha256=bNTckxzIM_HruxO2DfYsDbEgqOIz1RX6CbU6XOQQQyg,28296
|
|
28
|
-
gam/gamlib/glclargs.py,sha256=
|
|
29
|
-
gam/gamlib/glentity.py,sha256=
|
|
30
|
-
gam/gamlib/glgapi.py,sha256=
|
|
28
|
+
gam/gamlib/glclargs.py,sha256=zCfq3-XRiaEF58o5lmQVnxgV3AqMWMIs4Ra42iHExPQ,43538
|
|
29
|
+
gam/gamlib/glentity.py,sha256=bFVeXqJ4VLIpFgc9y083oeBn8JzbwPYVJeuJF0yrnk8,34405
|
|
30
|
+
gam/gamlib/glgapi.py,sha256=99W9Ng6KlSjSgELO2pmVNnm1dGa7XLFGLX8kkeDYHU0,40284
|
|
31
31
|
gam/gamlib/glgdata.py,sha256=weRppttWm6uRyqtBoGPKoHiNZ2h28nhfUV4J_mbCszY,2707
|
|
32
32
|
gam/gamlib/glglobals.py,sha256=J0xcHggVrUBzHJ5GruenKV-qV1zPKcK2qWgAgN3i5Jw,9608
|
|
33
33
|
gam/gamlib/glindent.py,sha256=RfBa2LDfLIqPLL5vMfC689TCVmqn8xf-qulSzkiatrc,1228
|
|
@@ -65,8 +65,8 @@ gam/googleapiclient/discovery_cache/base.py,sha256=yCDPtxnbNN-p5_9fzBacC6P3wcUPl
|
|
|
65
65
|
gam/googleapiclient/discovery_cache/file_cache.py,sha256=sim3Mg4HgRYo3vX75jvcKy_aV568EvIrtBfvfbw-044,4774
|
|
66
66
|
gam/iso8601/__init__.py,sha256=Z2PsYbXgAH5a5xzUvgczCboPzqWpm65kRcIngCnhViU,1218
|
|
67
67
|
gam/iso8601/iso8601.py,sha256=Li2FHZ4sBTWuthuQhyCvmvj0j6At8JbGzkSv2fc2RHU,4384
|
|
68
|
-
gam7-7.
|
|
69
|
-
gam7-7.
|
|
70
|
-
gam7-7.
|
|
71
|
-
gam7-7.
|
|
72
|
-
gam7-7.
|
|
68
|
+
gam7-7.14.0.dist-info/METADATA,sha256=uXs-BKCR1HhvN9cop6pH5RRdtpYP5Od9-lI5rNXG-LA,2978
|
|
69
|
+
gam7-7.14.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
70
|
+
gam7-7.14.0.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
|
|
71
|
+
gam7-7.14.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
72
|
+
gam7-7.14.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|