gam7 7.13.0__py3-none-any.whl → 7.13.2__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 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.13.00'
28
+ __version__ = '7.13.02'
29
29
  __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
30
30
 
31
31
  #pylint: disable=wrong-import-position
@@ -13641,7 +13641,7 @@ REPORT_ACTIVITIES_TIME_OBJECTS = {'time'}
13641
13641
  # [(user all|<UserItem>)|(orgunit|org|ou <OrgUnitPath> [showorgunit])|(select <UserTypeEntity>)]
13642
13642
  # [([start <Time>] [end <Time>])|(range <Time> <Time>)|
13643
13643
  # yesterday|today|thismonth|(previousmonths <Integer>)]
13644
- # [filtertime.* <Time>] [filter|filters <String>]
13644
+ # [filter <String> (filtertime<String> <Time>)*]
13645
13645
  # [event|events <EventNameList>] [ip <String>]
13646
13646
  # [groupidfilter <String>]
13647
13647
  # [maxactivities <Number>] [maxevents <Number>] [maxresults <Number>]
@@ -13653,7 +13653,7 @@ REPORT_ACTIVITIES_TIME_OBJECTS = {'time'}
13653
13653
  # [(date <Date>)|(range <Date> <Date>)|
13654
13654
  # yesterday|today|thismonth|(previousmonths <Integer>)]
13655
13655
  # [nodatechange | (fulldatarequired all|<UserServiceNameList>)]
13656
- # [filtertime.* <Time>] [filter|filters <String>]
13656
+ # [filter <String> (filtertime<String> <Time>)*]
13657
13657
  # [(fields|parameters <String>)|(services <UserServiceNameList>)]
13658
13658
  # [aggregatebydate|aggregatebyuser [Boolean]]
13659
13659
  # [maxresults <Number>]
@@ -17071,14 +17071,14 @@ def _convertTransferAppIDtoName(apps, appID):
17071
17071
  return f'applicationId: {appID}'
17072
17072
 
17073
17073
  DRIVE_AND_DOCS_APP_NAME = 'drive and docs'
17074
- GOOGLE_DATA_STUDIO_APP_NAME = 'google data studio'
17074
+ GOOGLE_LOOKER_STUDIO_APP_NAME = 'looker studio'
17075
17075
 
17076
17076
  SERVICE_NAME_CHOICE_MAP = {
17077
- 'datastudio': GOOGLE_DATA_STUDIO_APP_NAME,
17077
+ 'datastudio': GOOGLE_LOOKER_STUDIO_APP_NAME,
17078
17078
  'drive': DRIVE_AND_DOCS_APP_NAME,
17079
17079
  'googledrive': DRIVE_AND_DOCS_APP_NAME,
17080
17080
  'gdrive': DRIVE_AND_DOCS_APP_NAME,
17081
- 'lookerstudio': GOOGLE_DATA_STUDIO_APP_NAME,
17081
+ 'lookerstudio': GOOGLE_LOOKER_STUDIO_APP_NAME,
17082
17082
  }
17083
17083
 
17084
17084
  def _validateTransferAppName(apps, appName):
@@ -25491,7 +25491,7 @@ def doUpdateBrowsers():
25491
25491
  checkEntityAFDNEorAccessErrorExit(None, Ent.CHROME_BROWSER, deviceId, i, count)
25492
25492
 
25493
25493
  def _getChromeProfileName():
25494
- profileName = getString(Cmd.OB_CHROMEPROFILE_ID)
25494
+ profileName = getString(Cmd.OB_CHROMEPROFILE_NAME)
25495
25495
  if not profileName.startswith('customers'):
25496
25496
  customerId = _getCustomerId()
25497
25497
  profileName = f'customers/{customerId}/profiles/{profileName}'
@@ -25598,12 +25598,12 @@ CHROMEPROFILE_ORDERBY_CHOICE_MAP = {
25598
25598
  }
25599
25599
 
25600
25600
  # gam show chromeprofiles
25601
- # [filtertime.* <Time>] [filter <String>]
25601
+ # [filter <String> (filtertime<String> <Time>)*]
25602
25602
  # [orderby <ChromeProfileOrderByFieldName> [ascending|descending]]
25603
25603
  # <ChromeProfileFieldName>* [fields <ChromeProfileFieldNameList>]
25604
25604
  # [formatjson]
25605
25605
  # gam print chromeprofiles [todrive <ToDriveAttribute>*]
25606
- # [filtertime.* <Time>] [filter <String>]
25606
+ # [filter <String> (filtertime<String> <Time>)*]
25607
25607
  # [orderby <ChromeProfileOrderByFieldName> [ascending|descending]]
25608
25608
  # <ChromeProfileFieldName>* [fields <ChromeProfileFieldNameList>]
25609
25609
  # [formatjson [quotechar <Character>]]
@@ -25641,7 +25641,7 @@ def doPrintShowChromeProfiles():
25641
25641
  sortHeaders = True
25642
25642
  else:
25643
25643
  FJQC.GetFormatJSONQuoteChar(myarg, True)
25644
- if filterTimes and filter is not None:
25644
+ if filterTimes and cbfilter is not None:
25645
25645
  for filterTimeName, filterTimeValue in iter(filterTimes.items()):
25646
25646
  cbfilter = cbfilter.replace(f'#{filterTimeName}#', filterTimeValue)
25647
25647
  fields = getItemFieldsFromFieldsList('chromeBrowserProfiles', fieldsList)
@@ -25676,6 +25676,55 @@ def doPrintShowChromeProfiles():
25676
25676
  csvPF.SetSortTitles(['name', 'profileId'])
25677
25677
  csvPF.writeCSVfile('Chrome Profiles')
25678
25678
 
25679
+ def _getChromeProfileNameList():
25680
+ if not Cmd.PeekArgumentPresent(['select', 'filter', 'filters']):
25681
+ return getString(Cmd.OB_CHROMEPROFILE_NAME_LIST).replace(',', ' ').split()
25682
+ return []
25683
+
25684
+ def _initChromeProfileNameParameters():
25685
+ cm = buildGAPIObject(API.CHROMEMANAGEMENT)
25686
+ return (cm, {'profileNameList': _getChromeProfileNameList(), 'customerId': _getCustomerId(),
25687
+ 'cbfilter': None, 'filterTimes': {},
25688
+ 'OBY': OrderBy(CHROMEPROFILE_ORDERBY_CHOICE_MAP)})
25689
+
25690
+ def _getChromeProfileNameParameters(myarg, parameters):
25691
+ if not parameters['cbfilter'] and myarg == 'select':
25692
+ parameters['profileNameList'].extend(getEntityList(Cmd.OB_CHROMEPROFILE_NAME_LIST))
25693
+ elif not parameters['profileNameList'] and myarg == 'orderby':
25694
+ parameters['OBY'].GetChoice()
25695
+ elif not parameters['profileNameList'] and myarg.startswith('filtertime'):
25696
+ parameters['filterTimes'][myarg] = getTimeOrDeltaFromNow()
25697
+ elif not parameters['profileNameList'] and myarg in {'filter', 'filters'}:
25698
+ parameters['cbfilter'] = getString(Cmd.OB_STRING)
25699
+ else:
25700
+ return False
25701
+ return True
25702
+
25703
+ def _getChromeProfileNameEntityForCommand(cm, parameters):
25704
+ if parameters['cbfilter'] is None:
25705
+ customerId = parameters['customerId']
25706
+ for i, profileName in enumerate(parameters['profileNameList']):
25707
+ if not profileName.startswith('customers'):
25708
+ parameters['profileNameList'][i] = f'customers/{customerId}/profiles/{profileName}'
25709
+ return
25710
+ if parameters['filterTimes']:
25711
+ for filterTimeName, filterTimeValue in iter(parameters['filterTimes'].items()):
25712
+ parameters['cbfilter'] = parameters['cbfilter'].replace(f'#{filterTimeName}#', filterTimeValue)
25713
+ printGettingAllAccountEntities(Ent.CHROME_PROFILE, parameters['cbfilter'])
25714
+ pageMessage = getPageMessage()
25715
+ try:
25716
+ feed = yieldGAPIpages(cm.customers().profiles(), 'list', 'chromeBrowserProfiles',
25717
+ pageMessage=pageMessage,
25718
+ throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
25719
+ parent=f'customers/{parameters["customerId"]}', pageSize=200,
25720
+ filter=parameters['cbfilter'], orderBy=parameters['OBY'].orderBy,
25721
+ fields='nextPageToken,chromeBrowserProfiles(name)')
25722
+ for profiles in feed:
25723
+ for profile in profiles:
25724
+ parameters['profileNameList'].append(profile['name'])
25725
+ except (GAPI.invalidArgument, GAPI.permissionDenied) as e:
25726
+ entityActionFailedExit([Ent.CHROME_PROFILE, parameters['cbfilter']], str(e))
25727
+
25679
25728
  CHROMEPROFILECOMMAND_TIME_OBJECTS = {
25680
25729
  'clientExecutionTime',
25681
25730
  'issueTime',
@@ -25691,29 +25740,37 @@ def _showChromeProfileCommand(profcmd, FJQC, i=0, count=0):
25691
25740
  showJSON(None, profcmd, timeObjects=CHROMEPROFILECOMMAND_TIME_OBJECTS)
25692
25741
  Ind.Decrement()
25693
25742
 
25694
- # gam create chromeprofilecommand <ChromeProfileName>
25743
+ # gam create chromeprofilecommand <ChromeProfileNameEntity>
25695
25744
  # [clearcache [<Boolean>]] [clearcookies [<Boolean>]]
25696
25745
  # [formatjson]
25697
25746
  def doCreateChromeProfileCommand():
25698
- cm = buildGAPIObject(API.CHROMEMANAGEMENT)
25699
- profileName = _getChromeProfileName()
25747
+ cm, parameters = _initChromeProfileNameParameters()
25700
25748
  body = {'commandType': 'clearBrowsingData', 'payload': {}}
25701
25749
  FJQC = FormatJSONQuoteChar()
25702
25750
  while Cmd.ArgumentsRemaining():
25703
25751
  myarg = getArgument()
25704
- if myarg == 'clearcache':
25752
+ if _getChromeProfileNameParameters(myarg, parameters):
25753
+ pass
25754
+ elif myarg == 'clearcache':
25705
25755
  body['payload']['clearCache'] = getBoolean()
25706
25756
  elif myarg == 'clearcookies':
25707
25757
  body['payload']['clearCookies'] = getBoolean()
25708
25758
  else:
25709
25759
  FJQC.GetFormatJSON(myarg)
25710
- try:
25711
- profcmd = callGAPI(cm.customers().profiles().commands(), 'create',
25712
- throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED],
25713
- parent=profileName, body=body)
25714
- _showChromeProfileCommand(profcmd, FJQC)
25715
- except (GAPI.invalidArgument, GAPI.notFound, GAPI.permissionDenied) as e:
25716
- entityActionFailedExit([Ent.CHROME_PROFILE_COMMAND, profileName], str(e))
25760
+ _getChromeProfileNameEntityForCommand(cm, parameters)
25761
+ count = len(parameters['profileNameList'])
25762
+ i = 0
25763
+ for profileName in parameters['profileNameList']:
25764
+ i +=1
25765
+ try:
25766
+ profcmd = callGAPI(cm.customers().profiles().commands(), 'create',
25767
+ throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED],
25768
+ parent=profileName, body=body)
25769
+ _showChromeProfileCommand(profcmd, FJQC)
25770
+ except (GAPI.notFound) as e:
25771
+ entityActionFailedWarning([Ent.CHROME_PROFILE_COMMAND, profileName], str(e), i, count)
25772
+ except (GAPI.invalidArgument, GAPI.permissionDenied) as e:
25773
+ entityActionFailedExit([Ent.CHROME_PROFILE_COMMAND, profileName], str(e))
25717
25774
 
25718
25775
  # gam info chromeprofilecommand <ChromeProfileCommandName>
25719
25776
  # [formatjson]
@@ -25732,9 +25789,9 @@ def doInfoChromeProfileCommand():
25732
25789
  except (GAPI.invalidArgument, GAPI.notFound, GAPI.permissionDenied) as e:
25733
25790
  entityActionFailedExit([Ent.CHROME_PROFILE, profileCommandName], str(e))
25734
25791
 
25735
- # gam show chromeprofilecommands <ChromeProfileName>
25792
+ # gam show chromeprofilecommands <ChromeProfileNameEntity>
25736
25793
  # [formatjson]
25737
- # gam print chromeprofilecommands <ChromeProfileName> [todrive <ToDriveAttribute>*]
25794
+ # gam print chromeprofilecommands <ChromeProfilNameEntity> [todrive <ToDriveAttribute>*]
25738
25795
  # [formatjson [quotechar <Character>]]
25739
25796
  def doPrintShowChromeProfileCommands():
25740
25797
  def _printProfileCommand(profcmd):
@@ -25746,28 +25803,31 @@ def doPrintShowChromeProfileCommands():
25746
25803
  'JSON': json.dumps(cleanJSON(profcmd, timeObjects=CHROMEPROFILECOMMAND_TIME_OBJECTS),
25747
25804
  ensure_ascii=False, sort_keys=True)})
25748
25805
 
25749
- cm = buildGAPIObject(API.CHROMEMANAGEMENT)
25750
25806
  csvPF = CSVPrintFile(['name']) if Act.csvFormat() else None
25751
25807
  FJQC = FormatJSONQuoteChar(csvPF)
25752
- profileName = _getChromeProfileName()
25808
+ cm, parameters = _initChromeProfileNameParameters()
25753
25809
  while Cmd.ArgumentsRemaining():
25754
25810
  myarg = getArgument()
25755
25811
  if csvPF and myarg == 'todrive':
25756
25812
  csvPF.GetTodriveParameters()
25813
+ elif _getChromeProfileNameParameters(myarg, parameters):
25814
+ pass
25757
25815
  else:
25758
25816
  FJQC.GetFormatJSONQuoteChar(myarg, True)
25759
- printGettingEntityItemForWhom(Ent.CHROME_PROFILE_COMMAND, profileName)
25760
- pageMessage = getPageMessage()
25761
- try:
25762
- feed = yieldGAPIpages(cm.customers().profiles().commands(), 'list', 'chromeBrowserProfileCommands',
25763
- pageMessage=pageMessage,
25764
- throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
25765
- parent=profileName, pageSize=100)
25766
- for profcmds in feed:
25817
+ _getChromeProfileNameEntityForCommand(cm, parameters)
25818
+ count = len(parameters['profileNameList'])
25819
+ i = 0
25820
+ for profileName in parameters['profileNameList']:
25821
+ i +=1
25822
+ printGettingEntityItemForWhom(Ent.CHROME_PROFILE_COMMAND, profileName, i, count)
25823
+ pageMessage = getPageMessage()
25824
+ try:
25825
+ profcmds = callGAPIpages(cm.customers().profiles().commands(), 'list', 'chromeBrowserProfileCommands',
25826
+ pageMessage=pageMessage,
25827
+ throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
25828
+ parent=profileName, pageSize=100)
25767
25829
  if not csvPF:
25768
25830
  jcount = len(profcmds)
25769
- if not FJQC.formatJSON:
25770
- performActionNumItems(jcount, Ent.CHROME_PROFILE_COMMAND)
25771
25831
  Ind.Increment()
25772
25832
  j = 0
25773
25833
  for profcmd in profcmds:
@@ -25777,8 +25837,10 @@ def doPrintShowChromeProfileCommands():
25777
25837
  else:
25778
25838
  for profcmd in profcmds:
25779
25839
  _printProfileCommand(profcmd)
25780
- except (GAPI.notFound, GAPI.invalidArgument, GAPI.permissionDenied) as e:
25781
- entityActionFailedExit([Ent.CHROME_PROFILE, profileName], str(e))
25840
+ except (GAPI.notFound) as e:
25841
+ entityActionFailedWarning([Ent.CHROME_PROFILE, profileName], str(e), i, count)
25842
+ except (GAPI.invalidArgument, GAPI.permissionDenied) as e:
25843
+ entityActionFailedExit([Ent.CHROME_PROFILE, profileName], str(e))
25782
25844
  if csvPF:
25783
25845
  csvPF.writeCSVfile('Chrome Profile Commands')
25784
25846
 
@@ -73375,11 +73437,11 @@ def printShowForms(users):
73375
73437
  FORM_RESPONSE_TIME_OBJECTS = {'createTime', 'lastSubmittedTime'}
73376
73438
 
73377
73439
  # gam <UserTypeEntity> print formresponses <DriveFileEntity> [todrive <ToDriveAttribute>*]
73378
- # [filtertime.* <Time>] [filter <String>]
73440
+ # [filter <String> (filtertime<String> <Time>)*]
73379
73441
  # (addcsvdata <FieldName> <String>)*
73380
73442
  # [countsonly|(formatjson [quotechar <Character>])]
73381
73443
  # gam <UserTypeEntity> show formresponses <DriveFileEntity>
73382
- # [filtertime.* <Time>] [filter <String>]
73444
+ # [filter <String> (filtertime<String> <Time>)*]
73383
73445
  # [countsonly|formatjson]
73384
73446
  def printShowFormResponses(users):
73385
73447
  csvPF = CSVPrintFile(['User', 'formId', 'responseId', 'createTime', 'lastSubmittedTime', 'respondentEmail', 'totalScore'],
@@ -73405,7 +73467,7 @@ def printShowFormResponses(users):
73405
73467
  addCSVData[k] = getString(Cmd.OB_STRING, minLen=0)
73406
73468
  else:
73407
73469
  FJQC.GetFormatJSONQuoteChar(myarg, True)
73408
- if filterTimes and filter is not None:
73470
+ if filterTimes and frfilter is not None:
73409
73471
  for filterTimeName, filterTimeValue in iter(filterTimes.items()):
73410
73472
  frfilter = frfilter.replace(f'#{filterTimeName}#', filterTimeValue)
73411
73473
  if csvPF:
gam/gamlib/glclargs.py CHANGED
@@ -857,7 +857,8 @@ class GamCLArgs():
857
857
  OB_CHAT_SPACE = 'ChatSpace'
858
858
  OB_CHAT_SPACE_LIST = 'ChatSpaceList'
859
859
  OB_CHAT_THREAD = 'ChatThread'
860
- OB_CHROMEPROFILE_ID = 'ChromeProfileId'
860
+ OB_CHROMEPROFILE_NAME = 'ChromeProfileName'
861
+ OB_CHROMEPROFILE_NAME_LIST = 'ChromeProfileNameList'
861
862
  OB_CHROME_VERSION = 'ChromeVersion'
862
863
  OB_CIDR_NETMASK = 'CIDRnetmask'
863
864
  OB_CIGROUP_ALIAS_LIST = "CIGroupAliasList"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gam7
3
- Version: 7.13.0
3
+ Version: 7.13.2
4
4
  Summary: CLI tool to manage Google Workspace
5
5
  Project-URL: Homepage, https://github.com/GAM-team/GAM
6
6
  Project-URL: Issues, https://github.com/GAM-team/GAM/issues
@@ -1,4 +1,4 @@
1
- gam/__init__.py,sha256=j4MR3j0E4GnHkHRn-nuBoZMBfGY_t-doW7R7QS-mB1g,3558531
1
+ gam/__init__.py,sha256=IV4dLB-d_ujpKNkejbHaDHxTecVFKgdPR1FqvGvDes8,3561686
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
@@ -25,7 +25,7 @@ gam/gamlib/__init__.py,sha256=z5mF-y0j8pm-YNFBaiuxB4M_GAUPG-cXWwrhYwrVReM,679
25
25
  gam/gamlib/glaction.py,sha256=1Il_HrChVnPkzZwiZs5au4mFQVtq4K1Z42uIuR6qdnI,9419
26
26
  gam/gamlib/glapi.py,sha256=27NW2etvdNK4jfR699eqFzhV4gPotijXIQeX-wxCvHA,35319
27
27
  gam/gamlib/glcfg.py,sha256=bNTckxzIM_HruxO2DfYsDbEgqOIz1RX6CbU6XOQQQyg,28296
28
- gam/gamlib/glclargs.py,sha256=lp91zvalLQE-SCCbH9jipUMaeJMryGzeXPzpivQnoDs,42817
28
+ gam/gamlib/glclargs.py,sha256=cx3WfZSG42fGSFs_wdV6d4IlCmBMEfYo_Dyah7-BX7M,42876
29
29
  gam/gamlib/glentity.py,sha256=zQ64Q5MVDnJwgUTxNapO5s-KC8yfr1fS4GxXu7uGPT0,33877
30
30
  gam/gamlib/glgapi.py,sha256=sJMWCyVd_2MP3rF2z-zqFwWEdUu6kceRA7e42u4kVv8,40181
31
31
  gam/gamlib/glgdata.py,sha256=weRppttWm6uRyqtBoGPKoHiNZ2h28nhfUV4J_mbCszY,2707
@@ -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.13.0.dist-info/METADATA,sha256=JLzO0wMY7JZKQG8JaqFM0iMih-LGczIRTG7fZEEqqm4,2978
69
- gam7-7.13.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
70
- gam7-7.13.0.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
71
- gam7-7.13.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
72
- gam7-7.13.0.dist-info/RECORD,,
68
+ gam7-7.13.2.dist-info/METADATA,sha256=76mc2jCySBhYeSW2QWY5ytnsx6PbDsAwyOPfMlaPe9Y,2978
69
+ gam7-7.13.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
70
+ gam7-7.13.2.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
71
+ gam7-7.13.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
72
+ gam7-7.13.2.dist-info/RECORD,,
File without changes