gam7 7.13.0__py3-none-any.whl → 7.13.1__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.01'
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>]
@@ -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,12 +25740,11 @@ 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():
@@ -25707,13 +25755,20 @@ def doCreateChromeProfileCommand():
25707
25755
  body['payload']['clearCookies'] = getBoolean()
25708
25756
  else:
25709
25757
  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))
25758
+ _getChromeProfileNameEntityForCommand(cm, parameters)
25759
+ count = len(parameters['profileNameList'])
25760
+ i = 0
25761
+ for profileName in parameters['profileNameList']:
25762
+ i +=1
25763
+ try:
25764
+ profcmd = callGAPI(cm.customers().profiles().commands(), 'create',
25765
+ throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED],
25766
+ parent=profileName, body=body)
25767
+ _showChromeProfileCommand(profcmd, FJQC)
25768
+ except (GAPI.notFound) as e:
25769
+ entityActionFailedWarning([Ent.CHROME_PROFILE_COMMAND, profileName], str(e), i, count)
25770
+ except (GAPI.invalidArgument, GAPI.permissionDenied) as e:
25771
+ entityActionFailedExit([Ent.CHROME_PROFILE_COMMAND, profileName], str(e))
25717
25772
 
25718
25773
  # gam info chromeprofilecommand <ChromeProfileCommandName>
25719
25774
  # [formatjson]
@@ -25732,9 +25787,9 @@ def doInfoChromeProfileCommand():
25732
25787
  except (GAPI.invalidArgument, GAPI.notFound, GAPI.permissionDenied) as e:
25733
25788
  entityActionFailedExit([Ent.CHROME_PROFILE, profileCommandName], str(e))
25734
25789
 
25735
- # gam show chromeprofilecommands <ChromeProfileName>
25790
+ # gam show chromeprofilecommands <ChromeProfileNameEntity>
25736
25791
  # [formatjson]
25737
- # gam print chromeprofilecommands <ChromeProfileName> [todrive <ToDriveAttribute>*]
25792
+ # gam print chromeprofilecommands <ChromeProfilNameEntity> [todrive <ToDriveAttribute>*]
25738
25793
  # [formatjson [quotechar <Character>]]
25739
25794
  def doPrintShowChromeProfileCommands():
25740
25795
  def _printProfileCommand(profcmd):
@@ -25746,28 +25801,31 @@ def doPrintShowChromeProfileCommands():
25746
25801
  'JSON': json.dumps(cleanJSON(profcmd, timeObjects=CHROMEPROFILECOMMAND_TIME_OBJECTS),
25747
25802
  ensure_ascii=False, sort_keys=True)})
25748
25803
 
25749
- cm = buildGAPIObject(API.CHROMEMANAGEMENT)
25750
25804
  csvPF = CSVPrintFile(['name']) if Act.csvFormat() else None
25751
25805
  FJQC = FormatJSONQuoteChar(csvPF)
25752
- profileName = _getChromeProfileName()
25806
+ cm, parameters = _initChromeProfileNameParameters()
25753
25807
  while Cmd.ArgumentsRemaining():
25754
25808
  myarg = getArgument()
25755
25809
  if csvPF and myarg == 'todrive':
25756
25810
  csvPF.GetTodriveParameters()
25811
+ elif _getChromeProfileNameParameters(myarg, parameters):
25812
+ pass
25757
25813
  else:
25758
25814
  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:
25815
+ _getChromeProfileNameEntityForCommand(cm, parameters)
25816
+ count = len(parameters['profileNameList'])
25817
+ i = 0
25818
+ for profileName in parameters['profileNameList']:
25819
+ i +=1
25820
+ printGettingEntityItemForWhom(Ent.CHROME_PROFILE_COMMAND, profileName, i, count)
25821
+ pageMessage = getPageMessage()
25822
+ try:
25823
+ profcmds = callGAPIpages(cm.customers().profiles().commands(), 'list', 'chromeBrowserProfileCommands',
25824
+ pageMessage=pageMessage,
25825
+ throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
25826
+ parent=profileName, pageSize=100)
25767
25827
  if not csvPF:
25768
25828
  jcount = len(profcmds)
25769
- if not FJQC.formatJSON:
25770
- performActionNumItems(jcount, Ent.CHROME_PROFILE_COMMAND)
25771
25829
  Ind.Increment()
25772
25830
  j = 0
25773
25831
  for profcmd in profcmds:
@@ -25777,8 +25835,10 @@ def doPrintShowChromeProfileCommands():
25777
25835
  else:
25778
25836
  for profcmd in profcmds:
25779
25837
  _printProfileCommand(profcmd)
25780
- except (GAPI.notFound, GAPI.invalidArgument, GAPI.permissionDenied) as e:
25781
- entityActionFailedExit([Ent.CHROME_PROFILE, profileName], str(e))
25838
+ except (GAPI.notFound) as e:
25839
+ entityActionFailedWarning([Ent.CHROME_PROFILE, profileName], str(e), i, count)
25840
+ except (GAPI.invalidArgument, GAPI.permissionDenied) as e:
25841
+ entityActionFailedExit([Ent.CHROME_PROFILE, profileName], str(e))
25782
25842
  if csvPF:
25783
25843
  csvPF.writeCSVfile('Chrome Profile Commands')
25784
25844
 
@@ -73375,11 +73435,11 @@ def printShowForms(users):
73375
73435
  FORM_RESPONSE_TIME_OBJECTS = {'createTime', 'lastSubmittedTime'}
73376
73436
 
73377
73437
  # gam <UserTypeEntity> print formresponses <DriveFileEntity> [todrive <ToDriveAttribute>*]
73378
- # [filtertime.* <Time>] [filter <String>]
73438
+ # [filter <String> (filtertime<String> <Time>)*]
73379
73439
  # (addcsvdata <FieldName> <String>)*
73380
73440
  # [countsonly|(formatjson [quotechar <Character>])]
73381
73441
  # gam <UserTypeEntity> show formresponses <DriveFileEntity>
73382
- # [filtertime.* <Time>] [filter <String>]
73442
+ # [filter <String> (filtertime<String> <Time>)*]
73383
73443
  # [countsonly|formatjson]
73384
73444
  def printShowFormResponses(users):
73385
73445
  csvPF = CSVPrintFile(['User', 'formId', 'responseId', 'createTime', 'lastSubmittedTime', 'respondentEmail', 'totalScore'],
@@ -73405,7 +73465,7 @@ def printShowFormResponses(users):
73405
73465
  addCSVData[k] = getString(Cmd.OB_STRING, minLen=0)
73406
73466
  else:
73407
73467
  FJQC.GetFormatJSONQuoteChar(myarg, True)
73408
- if filterTimes and filter is not None:
73468
+ if filterTimes and frfilter is not None:
73409
73469
  for filterTimeName, filterTimeValue in iter(filterTimes.items()):
73410
73470
  frfilter = frfilter.replace(f'#{filterTimeName}#', filterTimeValue)
73411
73471
  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.1
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=r5Az9Y4d5SKaZbY6rgvDWjVBdjzJjWdGDBcaiK7BcMg,3561613
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.1.dist-info/METADATA,sha256=544u73Ic8iTC10G_Koa_wIzTSrgfyG-1aWbqBR981Yk,2978
69
+ gam7-7.13.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
70
+ gam7-7.13.1.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
71
+ gam7-7.13.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
72
+ gam7-7.13.1.dist-info/RECORD,,
File without changes