gam7 7.10.0__py3-none-any.whl → 7.10.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.10.00'
28
+ __version__ = '7.10.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
@@ -13556,7 +13556,10 @@ REPORT_CHOICE_MAP = {
13556
13556
  'calendars': 'calendar',
13557
13557
  'chat': 'chat',
13558
13558
  'chrome': 'chrome',
13559
+ 'classroom': 'classroom',
13560
+ 'cloud': 'gcp',
13559
13561
  'contextawareaccess': 'context_aware_access',
13562
+ 'currents': 'gplus',
13560
13563
  'customer': 'customer',
13561
13564
  'customers': 'customer',
13562
13565
  'datastudio': 'data_studio',
@@ -72603,8 +72606,23 @@ def updateFormRequestUpdateMasks(ubody):
72603
72606
  v['updateMask'] = ','.join(v['updateMask'])
72604
72607
  break
72605
72608
 
72609
+ def _initPublishSettings():
72610
+ return {'publishSettings': {'publishState': {'isPublished': False, 'isAcceptingResponses': False}},
72611
+ 'updateMask': ''}
72612
+
72613
+ def _getPublishSettings(myarg, pbody):
72614
+ if myarg == 'ispublished':
72615
+ pbody['publishSettings']['publishState']['isPublished'] = getBoolean()
72616
+ elif myarg == 'isacceptingresponses':
72617
+ pbody['publishSettings']['publishState']['isAcceptingResponses'] = getBoolean()
72618
+ else:
72619
+ return False
72620
+ pbody['updateMask'] = 'publishState'
72621
+ return True
72622
+
72606
72623
  # gam <UserTypeEntity> create form
72607
72624
  # title <String> [description <String>] [isquiz [<Boolean>]] [<JSONData>]
72625
+ # [ispublished [<Boolean>] isacceptingresponses [<Boolean>]]
72608
72626
  # [drivefilename <DriveFileName>] [<DriveFileParentAttribute>]
72609
72627
  # [(csv [todrive <ToDriveAttribute>*]) | returnidonly]
72610
72628
  def createForm(users):
@@ -72613,6 +72631,7 @@ def createForm(users):
72613
72631
  title = ''
72614
72632
  body = {'mimeType': MIMETYPE_GA_FORM}
72615
72633
  ubody = {'includeFormInResponse': True, 'requests': []}
72634
+ pbody = _initPublishSettings()
72616
72635
  parentParms = initDriveFileAttributes()
72617
72636
  while Cmd.ArgumentsRemaining():
72618
72637
  myarg = getArgument()
@@ -72626,6 +72645,8 @@ def createForm(users):
72626
72645
  elif myarg == 'json':
72627
72646
  jsonData = getJSON([])
72628
72647
  ubody['requests'].extend(jsonData.get('requests', []))
72648
+ elif _getPublishSettings(myarg, pbody):
72649
+ pass
72629
72650
  elif myarg == 'drivefilename':
72630
72651
  body['name'] = getString(Cmd.OB_DRIVE_FILE_NAME)
72631
72652
  elif getDriveFileParentAttribute(myarg, parentParms):
@@ -72666,6 +72687,10 @@ def createForm(users):
72666
72687
  form = callGAPI(gform.forms(), 'batchUpdate',
72667
72688
  throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
72668
72689
  formId=formId, body=ubody)
72690
+ if pbody['updateMask']:
72691
+ callGAPI(gform.forms(), 'setPublishSettings',
72692
+ throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
72693
+ formId=formId, body=pbody)
72669
72694
  if returnIdOnly:
72670
72695
  writeStdout(f'{formId}\n')
72671
72696
  elif not csvPF:
@@ -72690,8 +72715,10 @@ def createForm(users):
72690
72715
 
72691
72716
  # gam <UserTypeEntity> update form <DriveFileEntity>
72692
72717
  # [title <String>] [description <String>] [isquiz [Boolean>]] [<JSONData>]
72718
+ # [ispublished [<Boolean>] isacceptingresponses [<Boolean>]]
72693
72719
  def updateForm(users):
72694
72720
  ubody = {'includeFormInResponse': False, 'requests': []}
72721
+ pbody = _initPublishSettings()
72695
72722
  fileIdEntity = getDriveFileEntity()
72696
72723
  while Cmd.ArgumentsRemaining():
72697
72724
  myarg = getArgument()
@@ -72704,10 +72731,12 @@ def updateForm(users):
72704
72731
  elif myarg == 'json':
72705
72732
  jsonData = getJSON([])
72706
72733
  ubody['requests'].extend(jsonData.get('requests', []))
72734
+ elif _getPublishSettings(myarg, pbody):
72735
+ pass
72707
72736
  else:
72708
72737
  unknownArgumentExit()
72709
72738
  updateFormRequestUpdateMasks(ubody)
72710
- if not ubody['requests']:
72739
+ if not ubody['requests'] and not pbody['updateMask']:
72711
72740
  return
72712
72741
  i, count, users = getEntityArgument(users)
72713
72742
  for user in users:
@@ -72723,9 +72752,14 @@ def updateForm(users):
72723
72752
  for formId in fileIdEntity['list']:
72724
72753
  j += 1
72725
72754
  try:
72726
- callGAPI(gform.forms(), 'batchUpdate',
72727
- throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
72728
- formId=formId, body=ubody)
72755
+ if ubody['requests']:
72756
+ callGAPI(gform.forms(), 'batchUpdate',
72757
+ throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
72758
+ formId=formId, body=ubody)
72759
+ if pbody['updateMask']:
72760
+ callGAPI(gform.forms(), 'setPublishSettings',
72761
+ throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
72762
+ formId=formId, body=pbody)
72729
72763
  entityActionPerformed([Ent.USER, user, Ent.FORM, formId], j, jcount)
72730
72764
  except (GAPI.notFound, GAPI.invalidArgument) as e:
72731
72765
  entityActionFailedWarning([Ent.USER, user, Ent.FORM, formId], str(e), j, jcount)
gam/gamlib/glapi.py CHANGED
@@ -650,7 +650,7 @@ _SVCACCT_SCOPES = [
650
650
  'api': GMAIL,
651
651
  'subscopes': [],
652
652
  'scope': 'https://www.googleapis.com/auth/gmail.modify'},
653
- {'name': 'Gmail API - Basic Settings (Filters,IMAP, Language, POP, Vacation) - read/write, Sharing Settings (Delegates, Forwarding, SendAs) - read',
653
+ {'name': 'Gmail API - Basic Settings (Filters, IMAP, Language, POP, Vacation) - read/write, Sharing Settings (Delegates, Forwarding, SendAs) - read',
654
654
  'api': GMAIL,
655
655
  'subscopes': [],
656
656
  'scope': 'https://www.googleapis.com/auth/gmail.settings.basic'},
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gam7
3
- Version: 7.10.0
3
+ Version: 7.10.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=xABU_mlCIWoZhcS_Us3pYFdimJAoGjM80Ac7LWbRWHk,3530030
1
+ gam/__init__.py,sha256=ejWiKhprah_kxm4KbtjLxPaSLTdyknQRiMiethG60dE,3531420
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,7 +23,7 @@ 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=ZBoidjXurTtQAi9aSKpQ6UsJgPF7XVv9xJja-s1djfs,34571
26
+ gam/gamlib/glapi.py,sha256=A6kdyCacc9tvTaxMUNvWj8jWbOrss8e8XdkqF1xbN70,34572
27
27
  gam/gamlib/glcfg.py,sha256=bNTckxzIM_HruxO2DfYsDbEgqOIz1RX6CbU6XOQQQyg,28296
28
28
  gam/gamlib/glclargs.py,sha256=Ohe746FOQqMlXlutH-XJ6E1unYNzf_EJhdubnPp3new,42472
29
29
  gam/gamlib/glentity.py,sha256=c9-7MAp0HruXEUVq8Nwkllxc4KypFeZRUFkvVzPwrwk,33760
@@ -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.10.0.dist-info/METADATA,sha256=PnmZonJYaIBlkz-1eXpMQxptu1HczzPGp0Axpv2_uGM,2978
69
- gam7-7.10.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
70
- gam7-7.10.0.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
71
- gam7-7.10.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
72
- gam7-7.10.0.dist-info/RECORD,,
68
+ gam7-7.10.1.dist-info/METADATA,sha256=SpdJAI-N7RK9Myvwyb_EIIW80pwaLDKWaugdHlU6Pis,2978
69
+ gam7-7.10.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
70
+ gam7-7.10.1.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
71
+ gam7-7.10.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
72
+ gam7-7.10.1.dist-info/RECORD,,
File without changes