gam7 7.4.0__tar.gz → 7.4.2__tar.gz

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.

Files changed (109) hide show
  1. {gam7-7.4.0 → gam7-7.4.2}/PKG-INFO +1 -1
  2. {gam7-7.4.0 → gam7-7.4.2}/src/GamUpdate.txt +22 -0
  3. {gam7-7.4.0 → gam7-7.4.2}/src/gam/__init__.py +60 -10
  4. gam7-7.4.0/src/gam/gdata/apps/sites/__init__.py +0 -283
  5. gam7-7.4.0/src/gam/gdata/apps/sites/service.py +0 -246
  6. {gam7-7.4.0 → gam7-7.4.2}/.github/ISSUE_TEMPLATE/aa-question.md +0 -0
  7. {gam7-7.4.0 → gam7-7.4.2}/.github/ISSUE_TEMPLATE/za-bug-report.md +0 -0
  8. {gam7-7.4.0 → gam7-7.4.2}/.github/ISSUE_TEMPLATE/zz-feature-request.md +0 -0
  9. {gam7-7.4.0 → gam7-7.4.2}/.github/ISSUE_TEMPLATE.txt +0 -0
  10. {gam7-7.4.0 → gam7-7.4.2}/.github/actions/creds.tar.xz.gpg +0 -0
  11. {gam7-7.4.0 → gam7-7.4.2}/.github/actions/decrypt.sh +0 -0
  12. {gam7-7.4.0 → gam7-7.4.2}/.github/actions/entitlements.plist +0 -0
  13. {gam7-7.4.0 → gam7-7.4.2}/.github/actions/package_exclusions.txt +0 -0
  14. {gam7-7.4.0 → gam7-7.4.2}/.github/stale.yml +0 -0
  15. {gam7-7.4.0 → gam7-7.4.2}/.github/workflows/build.yml +0 -0
  16. {gam7-7.4.0 → gam7-7.4.2}/.github/workflows/codeql-analysis.yml +0 -0
  17. {gam7-7.4.0 → gam7-7.4.2}/.github/workflows/get-cacerts.yml +0 -0
  18. {gam7-7.4.0 → gam7-7.4.2}/.github/workflows/pypi.yml +0 -0
  19. {gam7-7.4.0 → gam7-7.4.2}/.pre-commit-config.yaml +0 -0
  20. {gam7-7.4.0 → gam7-7.4.2}/LICENSE +0 -0
  21. {gam7-7.4.0 → gam7-7.4.2}/README.md +0 -0
  22. {gam7-7.4.0 → gam7-7.4.2}/pyproject.toml +0 -0
  23. {gam7-7.4.0 → gam7-7.4.2}/src/.gitignore +0 -0
  24. {gam7-7.4.0 → gam7-7.4.2}/src/GamCommands.txt +0 -0
  25. {gam7-7.4.0 → gam7-7.4.2}/src/LICENSE +0 -0
  26. {gam7-7.4.0 → gam7-7.4.2}/src/cacerts.pem +0 -0
  27. {gam7-7.4.0 → gam7-7.4.2}/src/callgam.py +0 -0
  28. {gam7-7.4.0 → gam7-7.4.2}/src/gam/__main__.py +0 -0
  29. {gam7-7.4.0 → gam7-7.4.2}/src/gam/atom/__init__.py +0 -0
  30. {gam7-7.4.0 → gam7-7.4.2}/src/gam/atom/auth.py +0 -0
  31. {gam7-7.4.0 → gam7-7.4.2}/src/gam/atom/client.py +0 -0
  32. {gam7-7.4.0 → gam7-7.4.2}/src/gam/atom/core.py +0 -0
  33. {gam7-7.4.0 → gam7-7.4.2}/src/gam/atom/data.py +0 -0
  34. {gam7-7.4.0 → gam7-7.4.2}/src/gam/atom/http.py +0 -0
  35. {gam7-7.4.0 → gam7-7.4.2}/src/gam/atom/http_core.py +0 -0
  36. {gam7-7.4.0 → gam7-7.4.2}/src/gam/atom/http_interface.py +0 -0
  37. {gam7-7.4.0 → gam7-7.4.2}/src/gam/atom/mock_http.py +0 -0
  38. {gam7-7.4.0 → gam7-7.4.2}/src/gam/atom/mock_http_core.py +0 -0
  39. {gam7-7.4.0 → gam7-7.4.2}/src/gam/atom/mock_service.py +0 -0
  40. {gam7-7.4.0 → gam7-7.4.2}/src/gam/atom/service.py +0 -0
  41. {gam7-7.4.0 → gam7-7.4.2}/src/gam/atom/token_store.py +0 -0
  42. {gam7-7.4.0 → gam7-7.4.2}/src/gam/atom/url.py +0 -0
  43. {gam7-7.4.0 → gam7-7.4.2}/src/gam/cacerts.pem +0 -0
  44. {gam7-7.4.0 → gam7-7.4.2}/src/gam/cbcm-v1.1beta1.json +0 -0
  45. {gam7-7.4.0 → gam7-7.4.2}/src/gam/contactdelegation-v1.json +0 -0
  46. {gam7-7.4.0 → gam7-7.4.2}/src/gam/datastudio-v1.json +0 -0
  47. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/__init__.py +0 -0
  48. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/glaction.py +0 -0
  49. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/glapi.py +0 -0
  50. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/glcfg.py +0 -0
  51. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/glclargs.py +0 -0
  52. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/glentity.py +0 -0
  53. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/glgapi.py +0 -0
  54. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/glgdata.py +0 -0
  55. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/glglobals.py +0 -0
  56. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/glindent.py +0 -0
  57. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/glmsgs.py +0 -0
  58. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/glskus.py +0 -0
  59. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/gluprop.py +0 -0
  60. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/glverlibs.py +0 -0
  61. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gamlib/yubikey.py +0 -0
  62. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gdata/__init__.py +0 -0
  63. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gdata/alt/__init__.py +0 -0
  64. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gdata/alt/app_engine.py +0 -0
  65. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gdata/alt/appengine.py +0 -0
  66. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gdata/apps/__init__.py +0 -0
  67. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gdata/apps/audit/__init__.py +0 -0
  68. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gdata/apps/audit/service.py +0 -0
  69. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gdata/apps/contacts/__init__.py +0 -0
  70. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gdata/apps/contacts/service.py +0 -0
  71. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gdata/apps/service.py +0 -0
  72. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gdata/service.py +0 -0
  73. {gam7-7.4.0 → gam7-7.4.2}/src/gam/gdata/urlfetch.py +0 -0
  74. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/__init__.py +0 -0
  75. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/_auth.py +0 -0
  76. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/_helpers.py +0 -0
  77. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/channel.py +0 -0
  78. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/discovery.py +0 -0
  79. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/discovery_cache/__init__.py +0 -0
  80. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/discovery_cache/appengine_memcache.py +0 -0
  81. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/discovery_cache/base.py +0 -0
  82. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/discovery_cache/file_cache.py +0 -0
  83. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/errors.py +0 -0
  84. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/http.py +0 -0
  85. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/mimeparse.py +0 -0
  86. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/model.py +0 -0
  87. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/schema.py +0 -0
  88. {gam7-7.4.0 → gam7-7.4.2}/src/gam/googleapiclient/version.py +0 -0
  89. {gam7-7.4.0 → gam7-7.4.2}/src/gam/iso8601/__init__.py +0 -0
  90. {gam7-7.4.0 → gam7-7.4.2}/src/gam/iso8601/iso8601.py +0 -0
  91. {gam7-7.4.0 → gam7-7.4.2}/src/gam/serviceaccountlookup-v1.json +0 -0
  92. {gam7-7.4.0 → gam7-7.4.2}/src/gam/six.py +0 -0
  93. {gam7-7.4.0 → gam7-7.4.2}/src/gam-install.sh +0 -0
  94. {gam7-7.4.0 → gam7-7.4.2}/src/gam-setup.bat +0 -0
  95. {gam7-7.4.0 → gam7-7.4.2}/src/gam.exe.manifest +0 -0
  96. {gam7-7.4.0 → gam7-7.4.2}/src/gam.py +0 -0
  97. {gam7-7.4.0 → gam7-7.4.2}/src/gam.spec +0 -0
  98. {gam7-7.4.0 → gam7-7.4.2}/src/gam.wxs +0 -0
  99. {gam7-7.4.0 → gam7-7.4.2}/src/license.rtf +0 -0
  100. {gam7-7.4.0 → gam7-7.4.2}/src/project-apis.txt +0 -0
  101. {gam7-7.4.0 → gam7-7.4.2}/src/requirements-dev.txt +0 -0
  102. {gam7-7.4.0 → gam7-7.4.2}/src/requirements.txt +0 -0
  103. {gam7-7.4.0 → gam7-7.4.2}/src/setup.cfg +0 -0
  104. {gam7-7.4.0 → gam7-7.4.2}/src/setup.py +0 -0
  105. {gam7-7.4.0 → gam7-7.4.2}/src/tools/a_atleast_b.py +0 -0
  106. {gam7-7.4.0 → gam7-7.4.2}/src/tools/gen-wix-xml-filelist.py +0 -0
  107. {gam7-7.4.0 → gam7-7.4.2}/src/tools/mkGamRef.py +0 -0
  108. {gam7-7.4.0 → gam7-7.4.2}/src/tools/openssl.props +0 -0
  109. {gam7-7.4.0 → gam7-7.4.2}/src/version_info.txt.in +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gam7
3
- Version: 7.4.0
3
+ Version: 7.4.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,3 +1,25 @@
1
+ 7.04.02
2
+
3
+ Improved output formatting for the following commands:
4
+ ```
5
+ gam info peoplecontact
6
+ gam show peoplecontacts
7
+ gam info peopleprofile
8
+ gam show peopleprofile
9
+ gam <UserTypeEntity> info contacts
10
+ gam <UserTypeEntity> show contacts
11
+ gam <UserTypeEntity> show peopleprofile
12
+ ```
13
+
14
+ 7.04.01
15
+
16
+ Fixed bug where multiple `querytime<String>` values in a query were not properly processed;
17
+ only the last `querytime<String>` was processed.
18
+ ```
19
+ Command line: query "sync:#querytime1#..#querytime2# status:provisioned" querytime1 -2y querytime2 -40w
20
+ Query: (sync:#querytime1#..2024-05-09T00:00:00 status:provisioned) Invalid
21
+ ```
22
+
1
23
  7.04.00
2
24
 
3
25
  The Classic Sites API no longer functions, the following commands are deprecated:
@@ -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.04.00'
28
+ __version__ = '7.04.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
@@ -667,8 +667,10 @@ def accessErrorExitNonDirectory(api, errMsg):
667
667
  Ent.API, api])+[errMsg],
668
668
  ''))
669
669
 
670
- def ClientAPIAccessDeniedExit():
670
+ def ClientAPIAccessDeniedExit(errMsg=None):
671
671
  stderrErrorMsg(Msg.API_ACCESS_DENIED)
672
+ if errMsg:
673
+ stderrErrorMsg(errMsg)
672
674
  missingScopes = API.getClientScopesSet(GM.Globals[GM.CURRENT_CLIENT_API])-GM.Globals[GM.CURRENT_CLIENT_API_SCOPES]
673
675
  if missingScopes:
674
676
  writeStderr(Msg.API_CHECK_CLIENT_AUTHORIZATION.format(GM.Globals[GM.OAUTH2_CLIENT_ID],
@@ -21225,6 +21227,8 @@ def _getPeopleOtherContacts(people, entityType, user, i=0, count=0):
21225
21227
  resourceName = contact.pop('resourceName')
21226
21228
  otherContacts[resourceName] = contact
21227
21229
  return otherContacts
21230
+ except GAPI.permissionDenied as e:
21231
+ ClientAPIAccessDeniedExit(str(e))
21228
21232
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
21229
21233
  entityUnknownWarning(entityType, user, i, count)
21230
21234
  return None
@@ -21281,6 +21285,8 @@ def queryPeopleContacts(people, contactQuery, fields, sortOrder, entityType, use
21281
21285
  showMessage = pageMessage.replace(TOTAL_ITEMS_MARKER, str(totalItems))
21282
21286
  writeGotMessage(showMessage.replace('{0}', str(Ent.Choose(Ent.PEOPLE_CONTACT, totalItems))))
21283
21287
  return entityList
21288
+ except GAPI.permissionDenied as e:
21289
+ ClientAPIAccessDeniedExit(str(e))
21284
21290
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
21285
21291
  entityUnknownWarning(entityType, user, i, count)
21286
21292
  return None
@@ -21307,6 +21313,8 @@ def queryPeopleOtherContacts(people, contactQuery, fields, entityType, user, i=0
21307
21313
  showMessage = pageMessage.replace(TOTAL_ITEMS_MARKER, str(totalItems))
21308
21314
  writeGotMessage(showMessage.replace('{0}', str(Ent.Choose(Ent.OTHER_CONTACT, totalItems))))
21309
21315
  return entityList
21316
+ except GAPI.permissionDenied as e:
21317
+ ClientAPIAccessDeniedExit(str(e))
21310
21318
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
21311
21319
  entityUnknownWarning(entityType, user, i, count)
21312
21320
  return None
@@ -21327,6 +21335,8 @@ def getPeopleContactGroupsInfo(people, entityType, entityName, i, count):
21327
21335
  if group['formattedName'] != group['name']:
21328
21336
  contactGroupNames.setdefault(group['name'], [])
21329
21337
  contactGroupNames[group['name']].append(group['resourceName'])
21338
+ except GAPI.permissionDenied as e:
21339
+ ClientAPIAccessDeniedExit(str(e))
21330
21340
  except GAPI.forbidden:
21331
21341
  userPeopleServiceNotEnabledWarning(entityName, i, count)
21332
21342
  return (contactGroupIDs, False)
@@ -21425,6 +21435,8 @@ def createUserPeopleContact(users):
21425
21435
  csvPF.WriteRow(row)
21426
21436
  except GAPI.invalidArgument as e:
21427
21437
  entityActionFailedWarning([entityType, user, peopleEntityType, None], str(e), i, count)
21438
+ except GAPI.permissionDenied as e:
21439
+ ClientAPIAccessDeniedExit(str(e))
21428
21440
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
21429
21441
  ClientAPIAccessDeniedExit()
21430
21442
  if csvPF:
@@ -21588,6 +21600,8 @@ def _clearUpdatePeopleContacts(users, updateContacts):
21588
21600
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], str(e), j, jcount)
21589
21601
  except (GAPI.notFound, GAPI.internalError):
21590
21602
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
21603
+ except GAPI.permissionDenied as e:
21604
+ ClientAPIAccessDeniedExit(str(e))
21591
21605
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
21592
21606
  ClientAPIAccessDeniedExit()
21593
21607
  Ind.Decrement()
@@ -21736,6 +21750,8 @@ def dedupReplaceDomainUserPeopleContacts(users):
21736
21750
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], str(e), j, jcount)
21737
21751
  except (GAPI.notFound, GAPI.internalError):
21738
21752
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
21753
+ except GAPI.permissionDenied as e:
21754
+ ClientAPIAccessDeniedExit(str(e))
21739
21755
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
21740
21756
  ClientAPIAccessDeniedExit()
21741
21757
  Ind.Decrement()
@@ -21789,6 +21805,8 @@ def deleteUserPeopleContacts(users):
21789
21805
  entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount)
21790
21806
  except (GAPI.notFound, GAPI.internalError):
21791
21807
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
21808
+ except GAPI.permissionDenied as e:
21809
+ ClientAPIAccessDeniedExit(str(e))
21792
21810
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
21793
21811
  ClientAPIAccessDeniedExit()
21794
21812
  Ind.Decrement()
@@ -21846,12 +21864,29 @@ def _printPerson(entityTypeName, user, person, csvPF, FJQC, parameters):
21846
21864
  'JSON': json.dumps(cleanJSON(person),
21847
21865
  ensure_ascii=False, sort_keys=True)})
21848
21866
 
21867
+ PEOPLE_CONTACT_OBJECT_KEYS = {
21868
+ 'addresses': 'type',
21869
+ 'calendarUrls': 'type',
21870
+ 'emailAddresses': 'type',
21871
+ 'events': 'type',
21872
+ 'externalIds': 'type',
21873
+ 'genders': 'value',
21874
+ 'imClients': 'type',
21875
+ 'locations': 'type',
21876
+ 'miscKeywords': 'type',
21877
+ 'nicknames': 'type',
21878
+ 'organizations': 'type',
21879
+ 'relations': 'type',
21880
+ 'urls': 'type',
21881
+ 'userDefined': 'key',
21882
+ }
21883
+
21849
21884
  def _showPerson(userEntityType, user, entityType, person, i, count, FJQC, parameters):
21850
21885
  _processPersonMetadata(person, parameters)
21851
21886
  if not FJQC.formatJSON:
21852
21887
  printEntity([userEntityType, user, entityType, person['resourceName']], i, count)
21853
21888
  Ind.Increment()
21854
- showJSON(None, person)
21889
+ showJSON(None, person, dictObjectsKey=PEOPLE_CONTACT_OBJECT_KEYS)
21855
21890
  Ind.Decrement()
21856
21891
  else:
21857
21892
  printLine(json.dumps(cleanJSON(person), ensure_ascii=False, sort_keys=True))
@@ -22067,6 +22102,8 @@ def _infoPeople(users, entityType, source):
22067
22102
  except GAPI.invalidArgument as e:
22068
22103
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], str(e), j, jcount)
22069
22104
  continue
22105
+ except GAPI.permissionDenied as e:
22106
+ ClientAPIAccessDeniedExit(str(e))
22070
22107
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
22071
22108
  ClientAPIAccessDeniedExit()
22072
22109
  if showContactGroups and contactGroupIDs:
@@ -22245,6 +22282,8 @@ def copyUserPeopleOtherContacts(users):
22245
22282
  except (GAPI.notFound, GAPI.internalError):
22246
22283
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
22247
22284
  continue
22285
+ except GAPI.permissionDenied as e:
22286
+ ClientAPIAccessDeniedExit(str(e))
22248
22287
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
22249
22288
  ClientAPIAccessDeniedExit()
22250
22289
  Ind.Decrement()
@@ -22359,7 +22398,9 @@ def processUserPeopleOtherContacts(users):
22359
22398
  except (GAPI.notFound, GAPI.internalError):
22360
22399
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
22361
22400
  continue
22362
- except (GAPI.serviceNotAvailable, GAPI.forbidden, GAPI.permissionDenied):
22401
+ except GAPI.permissionDenied as e:
22402
+ ClientAPIAccessDeniedExit(str(e))
22403
+ except (GAPI.serviceNotAvailable, GAPI.forbidden):
22363
22404
  ClientAPIAccessDeniedExit()
22364
22405
  Ind.Decrement()
22365
22406
 
@@ -22476,6 +22517,8 @@ def _printShowPeople(source):
22476
22517
  pageSize=GC.Values[GC.PEOPLE_MAX_RESULTS],
22477
22518
  sources=sources, mergeSources=mergeSources,
22478
22519
  readMask=fields, fields='nextPageToken,people', **kwargs)
22520
+ except GAPI.permissionDenied as e:
22521
+ ClientAPIAccessDeniedExit(str(e))
22479
22522
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
22480
22523
  ClientAPIAccessDeniedExit()
22481
22524
  if not countsOnly:
@@ -22596,6 +22639,8 @@ def printShowUserPeopleProfiles(users):
22596
22639
  except GAPI.notFound:
22597
22640
  entityUnknownWarning(Ent.PEOPLE_PROFILE, user, i, count)
22598
22641
  continue
22642
+ except GAPI.permissionDenied as e:
22643
+ ClientAPIAccessDeniedExit(str(e))
22599
22644
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
22600
22645
  ClientAPIAccessDeniedExit()
22601
22646
  if not csvPF:
@@ -22750,6 +22795,8 @@ def _processPeopleContactPhotos(users, function):
22750
22795
  entityDoesNotHaveItemWarning([entityType, user, peopleEntityType, resourceName, Ent.PHOTO, filename], j, jcount)
22751
22796
  except (GAPI.invalidArgument, OSError, IOError) as e:
22752
22797
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName, Ent.PHOTO, filename], str(e), j, jcount)
22798
+ except GAPI.permissionDenied as e:
22799
+ ClientAPIAccessDeniedExit(str(e))
22753
22800
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
22754
22801
  ClientAPIAccessDeniedExit()
22755
22802
  break
@@ -22824,7 +22871,7 @@ def createUserPeopleContactGroup(users):
22824
22871
  if addCSVData:
22825
22872
  row.update(addCSVData)
22826
22873
  csvPF.WriteRow(row)
22827
- except GAPI.forbidden:
22874
+ except (GAPI.forbidden, GAPI.permissionDenied):
22828
22875
  userPeopleServiceNotEnabledWarning(user, i, count)
22829
22876
  except GAPI.serviceNotAvailable:
22830
22877
  entityUnknownWarning(entityType, user, i, count)
@@ -22878,7 +22925,7 @@ def updateUserPeopleContactGroup(users):
22878
22925
  entityActionPerformed([entityType, user, Ent.CONTACT_GROUP, contactGroup], j, jcount)
22879
22926
  except (GAPI.notFound, GAPI.internalError) as e:
22880
22927
  entityActionFailedWarning([entityType, user, Ent.CONTACT_GROUP, contactGroup], str(e), j, jcount)
22881
- except GAPI.forbidden:
22928
+ except (GAPI.forbidden, GAPI.permissionDenied):
22882
22929
  userPeopleServiceNotEnabledWarning(user, i, count)
22883
22930
  break
22884
22931
  except GAPI.serviceNotAvailable:
@@ -22923,7 +22970,7 @@ def deleteUserPeopleContactGroups(users):
22923
22970
  entityActionPerformed([entityType, user, Ent.CONTACT_GROUP, contactGroup], j, jcount)
22924
22971
  except GAPI.notFound as e:
22925
22972
  entityActionFailedWarning([entityType, user, Ent.CONTACT_GROUP, contactGroup], str(e), j, jcount)
22926
- except GAPI.forbidden:
22973
+ except (GAPI.forbidden, GAPI.permissionDenied):
22927
22974
  userPeopleServiceNotEnabledWarning(user, i, count)
22928
22975
  break
22929
22976
  except GAPI.serviceNotAvailable:
@@ -23024,7 +23071,7 @@ def infoUserPeopleContactGroups(users):
23024
23071
  _showContactGroup(entityType, user, Ent.CONTACT_GROUP, group, j, jcount, FJQC)
23025
23072
  except GAPI.notFound as e:
23026
23073
  entityActionFailedWarning([entityType, user, Ent.CONTACT_GROUP, contactGroup], str(e), j, jcount)
23027
- except GAPI.forbidden:
23074
+ except (GAPI.forbidden, GAPI.permissionDenied):
23028
23075
  userPeopleServiceNotEnabledWarning(user, i, count)
23029
23076
  break
23030
23077
  except GAPI.serviceNotAvailable:
@@ -23073,6 +23120,8 @@ def printShowUserPeopleContactGroups(users):
23073
23120
  throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS,
23074
23121
  pageSize=GC.Values[GC.PEOPLE_MAX_RESULTS],
23075
23122
  groupFields=fields, fields='nextPageToken,contactGroups')
23123
+ except GAPI.permissionDenied as e:
23124
+ ClientAPIAccessDeniedExit(str(e))
23076
23125
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
23077
23126
  ClientAPIAccessDeniedExit()
23078
23127
  _printPersonEntityList(Ent.PEOPLE_CONTACT_GROUP, entityList, entityType, user, i, count, csvPF, FJQC, parameters, None)
@@ -24143,7 +24192,8 @@ def substituteQueryTimes(queries, queryTimes):
24143
24192
  for i, query in enumerate(queries):
24144
24193
  if query is not None:
24145
24194
  for queryTimeName, queryTimeValue in iter(queryTimes.items()):
24146
- queries[i] = query.replace(f'#{queryTimeName}#', queryTimeValue)
24195
+ query = query.replace(f'#{queryTimeName}#', queryTimeValue)
24196
+ queries[i] = query
24147
24197
 
24148
24198
  # Get CrOS devices from gam.cfg print_cros_ous and print_cros_ous_and_children
24149
24199
  def getCfgCrOSEntities():
@@ -34095,7 +34145,7 @@ def doPrintGroupMembers():
34095
34145
  for name in info['names']:
34096
34146
  if name['metadata']['source']['type'] == sourceType:
34097
34147
  return name['displayName']
34098
- except (GAPI.notFound, GAPI.serviceNotAvailable, GAPI.forbidden):
34148
+ except (GAPI.notFound, GAPI.serviceNotAvailable, GAPI.forbidden, GAPI.permissionDenied):
34099
34149
  pass
34100
34150
  return unknownName
34101
34151
 
@@ -1,283 +0,0 @@
1
- #!/usr/bin/env python
2
- #
3
- # Copyright 2009 Google Inc. All Rights Reserved.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- """Data model classes for parsing and generating XML for the Sites Data API."""
18
-
19
- import atom
20
- import gdata
21
-
22
- # XML Namespaces used in Google Sites entities.
23
- SITES_NAMESPACE = 'http://schemas.google.com/sites/2008'
24
- SITES_TEMPLATE = '{http://schemas.google.com/sites/2008}%s'
25
- SPREADSHEETS_NAMESPACE = 'http://schemas.google.com/spreadsheets/2006'
26
- SPREADSHEETS_TEMPLATE = '{http://schemas.google.com/spreadsheets/2006}%s'
27
- GACL_NAMESPACE = 'http://schemas.google.com/acl/2007'
28
- GACL_TEMPLATE = '{http://schemas.google.com/acl/2007}%s'
29
- DC_TERMS_TEMPLATE = '{http://purl.org/dc/terms}%s'
30
- THR_TERMS_TEMPLATE = '{http://purl.org/syndication/thread/1.0}%s'
31
- XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'
32
- XHTML_TEMPLATE = '{http://www.w3.org/1999/xhtml}%s'
33
-
34
- SITES_INVITE_LINK_REL = SITES_NAMESPACE + '#invite'
35
- SITES_PARENT_LINK_REL = SITES_NAMESPACE + '#parent'
36
- SITES_REVISION_LINK_REL = SITES_NAMESPACE + '#revision'
37
- SITES_SOURCE_LINK_REL = SITES_NAMESPACE + '#source'
38
- SITES_TEMPLATE_LINK_REL = SITES_NAMESPACE + '#template'
39
-
40
- ALTERNATE_REL = 'alternate'
41
- WEB_ADDRESS_MAPPING_REL = 'webAddressMapping'
42
-
43
- SITES_KIND_SCHEME = 'http://schemas.google.com/g/2005#kind'
44
- ANNOUNCEMENT_KIND_TERM = SITES_NAMESPACE + '#announcement'
45
- ANNOUNCEMENT_PAGE_KIND_TERM = SITES_NAMESPACE + '#announcementspage'
46
- ATTACHMENT_KIND_TERM = SITES_NAMESPACE + '#attachment'
47
- COMMENT_KIND_TERM = SITES_NAMESPACE + '#comment'
48
- FILECABINET_KIND_TERM = SITES_NAMESPACE + '#filecabinet'
49
- LISTITEM_KIND_TERM = SITES_NAMESPACE + '#listitem'
50
- LISTPAGE_KIND_TERM = SITES_NAMESPACE + '#listpage'
51
- WEBPAGE_KIND_TERM = SITES_NAMESPACE + '#webpage'
52
- WEBATTACHMENT_KIND_TERM = SITES_NAMESPACE + '#webattachment'
53
- FOLDER_KIND_TERM = SITES_NAMESPACE + '#folder'
54
- TAG_KIND_TERM = SITES_NAMESPACE + '#tag'
55
-
56
- SUPPORT_KINDS = [
57
- 'announcement', 'announcementspage', 'attachment', 'comment', 'filecabinet',
58
- 'listitem', 'listpage', 'webpage', 'webattachment', 'tag'
59
- ]
60
-
61
-
62
- class GDataBase(atom.AtomBase):
63
- """The Google Sites intermediate class from atom.AtomBase."""
64
- _namespace = gdata.GDATA_NAMESPACE
65
- _children = atom.AtomBase._children.copy()
66
- _attributes = atom.AtomBase._attributes.copy()
67
-
68
- def __init__(self, text=None):
69
- atom.AtomBase.__init__(self, text=text)
70
-
71
- class SitesBase(GDataBase):
72
- _namespace = SITES_NAMESPACE
73
-
74
- class SiteName(SitesBase):
75
- """Google Sites <sites:siteName>."""
76
- _tag = 'siteName'
77
-
78
- class Theme(SitesBase):
79
- """Google Sites <sites:theme>."""
80
- _tag = 'theme'
81
-
82
- class SiteEntry(gdata.BatchEntry):
83
- """Google Sites Site Feed Entry."""
84
- _tag = 'entry'
85
- _namespace = atom.ATOM_NAMESPACE
86
- _children = gdata.BatchEntry._children.copy()
87
-
88
- _children['{%s}siteName' % SITES_NAMESPACE] = ('siteName', SiteName)
89
- _children['{%s}theme' % SITES_NAMESPACE] = ('theme', Theme)
90
- _attributes = gdata.BatchEntry._attributes.copy()
91
- _attributes['{%s}etag' % gdata.GDATA_NAMESPACE] = 'etag'
92
-
93
- def __init__(self, siteName=None, title=None, summary=None, theme=None, sourceSite=None, category=None, etag=None):
94
- gdata.BatchEntry.__init__(self, category=category)
95
- self.siteName = siteName
96
- self.title = title
97
- self.summary = summary
98
- self.theme = theme
99
- if sourceSite is not None:
100
- sourceLink = atom.Link(href=sourceSite, rel=SITES_SOURCE_LINK_REL, link_type='application/atom+xml')
101
- self.link.append(sourceLink)
102
- self.etag = etag
103
-
104
- def find_alternate_link(self):
105
- for link in self.link:
106
- if link.rel == ALTERNATE_REL and link.href:
107
- return link.href
108
- return None
109
-
110
- FindAlternateLink = find_alternate_link
111
-
112
- def find_source_link(self):
113
- for link in self.link:
114
- if link.rel == SITES_SOURCE_LINK_REL and link.href:
115
- return link.href
116
- return None
117
-
118
- FindSourceLink = find_source_link
119
-
120
- def find_webaddress_mappings(self):
121
- mappingLinks = []
122
- for link in self.link:
123
- if link.rel == WEB_ADDRESS_MAPPING_REL and link.href:
124
- mappingLinks.append(link.href)
125
- return mappingLinks
126
-
127
- FindWebAddressMappings = find_webaddress_mappings
128
-
129
- def SiteEntryFromString(xml_string):
130
- return atom.CreateClassFromXMLString(SiteEntry, xml_string)
131
-
132
- class SiteFeed(gdata.BatchFeed, gdata.LinkFinder):
133
- """A Google Sites feed flavor of an Atom Feed."""
134
- _tag = 'feed'
135
- _namespace = atom.ATOM_NAMESPACE
136
- _children = gdata.BatchFeed._children.copy()
137
- _children['{%s}entry' % atom.ATOM_NAMESPACE] = ('entry', [SiteEntry])
138
-
139
- def __init__(self):
140
- gdata.BatchFeed.__init__(self)
141
-
142
- def SiteFeedFromString(xml_string):
143
- return atom.CreateClassFromXMLString(SiteFeed, xml_string)
144
-
145
- class AclBase(GDataBase):
146
- _namespace = GACL_NAMESPACE
147
-
148
- class AclRole(AclBase):
149
- """Describes the role of an entry in an access control list."""
150
- _tag = 'role'
151
- _children = AclBase._children.copy()
152
- _attributes = AclBase._attributes.copy()
153
- _attributes['value'] = 'value'
154
-
155
- def __init__(self, value=None):
156
- AclBase.__init__(self)
157
- self.value = value
158
-
159
- class AclAdditionalRole(AclBase):
160
- """Describes an additionalRole element."""
161
- _tag = 'additionalRole'
162
- _children = AclBase._children.copy()
163
- _attributes = AclBase._attributes.copy()
164
- _attributes['value'] = 'value'
165
-
166
- def __init__(self, value=None):
167
- AclBase.__init__(self)
168
- self.value = value
169
-
170
- class AclScope(AclBase):
171
- """Describes the scope of an entry in an access control list."""
172
- _tag = 'scope'
173
- _children = AclBase._children.copy()
174
- _attributes = AclBase._attributes.copy()
175
- _attributes['type'] = 'type'
176
- _attributes['value'] = 'value'
177
-
178
- def __init__(self, stype=None, value=None):
179
- AclBase.__init__(self)
180
- self.type = stype
181
- self.value = value
182
-
183
-
184
- class AclWithKey(AclBase):
185
- """Describes a key that can be used to access a document."""
186
- _tag = 'withKey'
187
- _children = AclBase._children.copy()
188
- _children['{%s}role' % GACL_NAMESPACE] = ('role', AclRole)
189
- _children['{%s}additionalRole' % GACL_NAMESPACE] = ('additionalRole', AclAdditionalRole)
190
- _attributes = AclBase._attributes.copy()
191
- _attributes['key'] = 'key'
192
-
193
- def __init__(self, key=None, role=None, additionalRole=None):
194
- AclBase.__init__(self)
195
- self.key = key
196
- self.role = role
197
- self.additionalRole = additionalRole
198
-
199
- class AclEntry(gdata.BatchEntry):
200
- """Describes an entry in a feed of an access control list (ACL)."""
201
- _tag = 'entry'
202
- _namespace = atom.ATOM_NAMESPACE
203
- _children = gdata.BatchEntry._children.copy()
204
-
205
- _children['{%s}role' % GACL_NAMESPACE] = ('role', AclRole)
206
- _children['{%s}additionalRole' % GACL_NAMESPACE] = ('additionalRole', AclAdditionalRole)
207
- _children['{%s}scope' % GACL_NAMESPACE] = ('scope', AclScope)
208
- _children['{%s}withKey' % GACL_NAMESPACE] = ('withKey', AclWithKey)
209
- _attributes = gdata.BatchEntry._attributes.copy()
210
- _attributes['{%s}etag' % gdata.GDATA_NAMESPACE] = 'etag'
211
-
212
- def __init__(self, role=None, additionalRole=None, scope=None, withKey=None, etag=None):
213
- gdata.BatchEntry.__init__(self)
214
- self.role = role
215
- self.additionalRole = additionalRole
216
- self.scope = scope
217
- self.withKey = withKey
218
- self.etag = etag
219
-
220
- def find_invite_link(self):
221
- for link in self.link:
222
- if link.rel == SITES_INVITE_LINK_REL and link.href:
223
- return link.href
224
- return None
225
-
226
- FindInviteLink = find_invite_link
227
-
228
- def AclEntryFromString(xml_string):
229
- return atom.CreateClassFromXMLString(AclEntry, xml_string)
230
-
231
- class AclFeed(gdata.BatchFeed, gdata.LinkFinder):
232
- """Describes a feed of an access control list (ACL)."""
233
- _tag = 'feed'
234
- _namespace = atom.ATOM_NAMESPACE
235
- _children = gdata.BatchFeed._children.copy()
236
- _children['{%s}entry' % atom.ATOM_NAMESPACE] = ('entry', [AclEntry])
237
-
238
- def __init__(self):
239
- gdata.BatchFeed.__init__(self)
240
-
241
- def AclFeedFromString(xml_string):
242
- return atom.CreateClassFromXMLString(AclFeed, xml_string)
243
-
244
- class ActivityEntry(gdata.BatchEntry):
245
- """Describes an entry in a feed of site activity (changes)."""
246
- _tag = 'entry'
247
- _namespace = atom.ATOM_NAMESPACE
248
- _children = gdata.BatchEntry._children.copy()
249
- _attributes = gdata.BatchEntry._attributes.copy()
250
-
251
- def __init__(self):
252
- gdata.BatchEntry.__init__(self)
253
-
254
- def __find_category_scheme(self, scheme):
255
- for category in self.category:
256
- if category.scheme == scheme:
257
- return category
258
- return None
259
-
260
- def kind(self):
261
- kind = self.__find_category_scheme(SITES_KIND_SCHEME)
262
- if kind is not None:
263
- return kind.term[len(SITES_NAMESPACE) + 1:]
264
- else:
265
- return None
266
-
267
- Kind = kind
268
-
269
- def ActivityEntryFromString(xml_string):
270
- return atom.CreateClassFromXMLString(ActivityEntry, xml_string)
271
-
272
- class ActivityFeed(gdata.BatchFeed, gdata.LinkFinder):
273
- """Describes a feed of site activity (changes)."""
274
- _tag = 'feed'
275
- _namespace = atom.ATOM_NAMESPACE
276
- _children = gdata.BatchFeed._children.copy()
277
- _children['{%s}entry' % atom.ATOM_NAMESPACE] = ('entry', [ActivityEntry])
278
-
279
- def __init__(self):
280
- gdata.BatchFeed.__init__(self)
281
-
282
- def ActivityFeedFromString(xml_string):
283
- return atom.CreateClassFromXMLString(ActivityFeed, xml_string)
@@ -1,246 +0,0 @@
1
- #!/usr/bin/python
2
- #
3
- # Copyright 2009 Google Inc. All Rights Reserved.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- """SitesService extends the GDataService for Google Sites API calls."""
18
-
19
- import gdata.apps
20
- import gdata.apps.service
21
- import gdata.service
22
-
23
-
24
- # Feed URI templates
25
- CONTENT_FEED_TEMPLATE = '/feeds/content/%s/%s/'
26
- REVISION_FEED_TEMPLATE = '/feeds/revision/%s/%s/'
27
- ACTIVITY_FEED_TEMPLATE = '/feeds/activity/%s/%s/'
28
- ACTIVITY_ENTRY_TEMPLATE = '/feeds/activity/%s/%s/%s'
29
- SITE_FEED_TEMPLATE = '/feeds/site/%s/'
30
- ACL_FEED_TEMPLATE = '/feeds/acl/site/%s/%s'
31
- ACL_ENTRY_TEMPLATE = '/feeds/acl/site/%s/%s/%s'
32
-
33
-
34
- class SitesService(gdata.service.GDataService):
35
- """Client extension for the Google Sites API service."""
36
-
37
- def __init__(self,
38
- source=None, server='sites.google.com', additional_headers=None,
39
- **kwargs):
40
- """Constructs a new client for the Sites API.
41
-
42
- Args:
43
- site: string (optional) Name (webspace) of the Google Site
44
- domain: string (optional) Domain of the (Google Apps hosted) Site.
45
- If no domain is given, the Site is assumed to be a consumer Google
46
- Site, in which case the value 'site' is used.
47
- source: string (optional) The name of the user's application.
48
- server: string (optional) The name of the server to which a connection
49
- will be opened. Default value: 'sites..google.com'.
50
- **kwargs: The other parameters to pass to gdata.service.GDataService
51
- constructor.
52
- """
53
- if additional_headers == None:
54
- additional_headers = {}
55
- additional_headers['GData-Version'] = '1.4'
56
- gdata.service.GDataService.__init__(self,
57
- source=source, server=server, additional_headers=additional_headers,
58
- **kwargs)
59
- self.ssl = True
60
- self.port = 443
61
-
62
- def make_site_feed_uri(self, domain=None, site=None):
63
- if not domain:
64
- domain = 'site'
65
- if not site:
66
- return SITE_FEED_TEMPLATE % domain
67
- return (SITE_FEED_TEMPLATE % domain) + site
68
-
69
- MakeSiteFeedUri = make_site_feed_uri
70
-
71
- def get_site_feed(self, uri=None, domain=None, site=None,
72
- extra_headers=None, url_params=None, escape_params=True):
73
-
74
- uri = uri or self.make_site_feed_uri(domain=domain, site=site)
75
- try:
76
- return self.Get(uri,
77
- url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
78
- converter=gdata.apps.sites.SiteFeedFromString)
79
- except gdata.service.RequestError as e:
80
- raise gdata.apps.service.AppsForYourDomainException(e.args[0])
81
-
82
- GetSiteFeed = get_site_feed
83
-
84
- def create_site(self, siteentry=None, uri=None, domain=None, site=None,
85
- extra_headers=None, url_params=None, escape_params=True):
86
-
87
- if uri is None:
88
- uri = self.make_site_feed_uri(domain=domain, site=site)
89
- try:
90
- return self.Post(siteentry, uri,
91
- url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
92
- converter=gdata.apps.sites.SiteEntryFromString)
93
- except gdata.service.RequestError as e:
94
- raise gdata.apps.service.AppsForYourDomainException(e.args[0])
95
-
96
- CreateSite = create_site
97
-
98
- def get_site(self, uri=None, domain=None, site=None,
99
- extra_headers=None, url_params=None, escape_params=True):
100
-
101
- uri = uri or self.make_site_feed_uri(domain=domain, site=site)
102
- try:
103
- return self.Get(uri,
104
- url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
105
- converter=gdata.apps.sites.SiteEntryFromString)
106
- except gdata.service.RequestError as e:
107
- raise gdata.apps.service.AppsForYourDomainException(e.args[0])
108
-
109
- GetSite = get_site
110
-
111
- def update_site(self, siteentry=None, uri=None, domain=None, site=None,
112
- extra_headers=None, url_params=None, escape_params=True):
113
-
114
- uri = uri or self.make_site_feed_uri(domain=domain, site=site)
115
- try:
116
- return self.Put(siteentry, uri,
117
- url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
118
- converter=gdata.apps.sites.SiteEntryFromString)
119
- except gdata.service.RequestError as e:
120
- raise gdata.apps.service.AppsForYourDomainException(e.args[0])
121
-
122
- UpdateSite = update_site
123
-
124
- def make_acl_feed_uri(self, domain=None, site=None):
125
- return ACL_FEED_TEMPLATE % (domain, site)
126
-
127
- MakeAclFeedUri = make_acl_feed_uri
128
-
129
- def get_acl_feed(self, uri=None, domain=None, site=None,
130
- extra_headers=None, url_params=None, escape_params=True):
131
-
132
- uri = uri or self.make_acl_feed_uri(domain=domain, site=site)
133
- try:
134
- return self.Get(uri,
135
- url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
136
- converter=gdata.apps.sites.AclFeedFromString)
137
- except gdata.service.RequestError as e:
138
- raise gdata.apps.service.AppsForYourDomainException(e.args[0])
139
-
140
- GetAclFeed = get_acl_feed
141
-
142
- def make_acl_entry_uri(self, domain=None, site=None, ruleId=None):
143
- return ACL_ENTRY_TEMPLATE % (domain, site, ruleId)
144
-
145
- MakeAclEntryUri = make_acl_entry_uri
146
-
147
- def create_acl_entry(self, aclentry=None, uri=None, domain=None, site=None,
148
- extra_headers=None, url_params=None, escape_params=True):
149
-
150
- uri = uri or self.make_acl_feed_uri(domain=domain, site=site)
151
- try:
152
- return self.Post(aclentry, uri,
153
- url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
154
- converter=gdata.apps.sites.AclEntryFromString)
155
- except gdata.service.RequestError as e:
156
- raise gdata.apps.service.AppsForYourDomainException(e.args[0])
157
-
158
- CreateAclEntry = create_acl_entry
159
-
160
- def get_acl_entry(self, uri=None, domain=None, site=None, ruleId=None,
161
- extra_headers=None, url_params=None, escape_params=True):
162
-
163
- uri = uri or self.make_acl_entry_uri(domain=domain, site=site, ruleId=ruleId)
164
- try:
165
- return self.Get(uri,
166
- url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
167
- converter=gdata.apps.sites.AclEntryFromString)
168
- except gdata.service.RequestError as e:
169
- raise gdata.apps.service.AppsForYourDomainException(e.args[0])
170
-
171
- GetAclEntry = get_acl_entry
172
-
173
- def update_acl_entry(self, aclentry=None, uri=None, domain=None, site=None, ruleId=None,
174
- extra_headers=None, url_params=None, escape_params=True):
175
-
176
- uri = uri or self.make_acl_entry_uri(domain=domain, site=site, ruleId=ruleId)
177
- try:
178
- return self.Put(aclentry, uri,
179
- url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
180
- converter=gdata.apps.sites.AclEntryFromString)
181
- except gdata.service.RequestError as e:
182
- raise gdata.apps.service.AppsForYourDomainException(e.args[0])
183
-
184
- UpdateAclEntry = update_acl_entry
185
-
186
- def delete_acl_entry(self, uri=None, domain=None, site=None, ruleId=None,
187
- extra_headers=None, url_params=None, escape_params=True):
188
-
189
- uri = uri or self.make_acl_entry_uri(domain=domain, site=site, ruleId=ruleId)
190
- try:
191
- return self.Delete(uri,
192
- url_params=url_params, escape_params=escape_params, extra_headers=extra_headers)
193
- except gdata.service.RequestError as e:
194
- raise gdata.apps.service.AppsForYourDomainException(e.args[0])
195
-
196
- DeleteAclEntry = delete_acl_entry
197
-
198
- def make_activity_feed_uri(self, domain=None, site=None):
199
- return ACTIVITY_FEED_TEMPLATE % (domain, site)
200
-
201
- MakeActivityFeedUri = make_activity_feed_uri
202
-
203
- def get_activity_feed(self, uri=None, domain=None, site=None,
204
- extra_headers=None, url_params=None, escape_params=True):
205
-
206
- uri = uri or self.make_activity_feed_uri(domain=domain, site=site)
207
- try:
208
- return self.Get(uri,
209
- url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
210
- converter=gdata.apps.sites.ActivityFeedFromString)
211
- except gdata.service.RequestError as e:
212
- raise gdata.apps.service.AppsForYourDomainException(e.args[0])
213
-
214
- GetActivityFeed = get_activity_feed
215
-
216
- def make_activity_entry_uri(self, domain=None, site=None, activityId=None):
217
- return ACTIVITY_ENTRY_TEMPLATE % (domain, site, activityId)
218
-
219
- MakeActivityEntryUri = make_activity_entry_uri
220
-
221
- def get_activity_entry(self, uri=None, domain=None, site=None, activityId=None,
222
- extra_headers=None, url_params=None, escape_params=True):
223
-
224
- uri = uri or self.make_activity_entry_uri(domain=domain, site=site, activityId=activityId)
225
- try:
226
- return self.Get(uri,
227
- url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
228
- converter=gdata.apps.sites.ActivityEntryFromString)
229
- except gdata.service.RequestError as e:
230
- raise gdata.apps.service.AppsForYourDomainException(e.args[0])
231
-
232
- GetActivityEntry = get_activity_entry
233
-
234
- class SitesQuery(gdata.service.Query):
235
-
236
- def make_site_feed_uri(self, domain=None, site=None):
237
- if not domain:
238
- domain = 'site'
239
- if not site:
240
- return SITE_FEED_TEMPLATE % domain
241
- return (SITE_FEED_TEMPLATE % domain) + site
242
-
243
- def __init__(self, feed=None, domain=None, site=None, params=None):
244
- self.feed = feed or self.make_site_feed_uri(domain=domain, site=site)
245
- gdata.service.Query.__init__(self, feed=self.feed, params=params)
246
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes