gam7 7.4.1__tar.gz → 7.4.3__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.
- {gam7-7.4.1 → gam7-7.4.3}/PKG-INFO +1 -1
- {gam7-7.4.1 → gam7-7.4.3}/src/GamCommands.txt +5 -2
- {gam7-7.4.1 → gam7-7.4.3}/src/GamUpdate.txt +25 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/__init__.py +73 -22
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/glcfg.py +8 -0
- gam7-7.4.1/src/gam/gdata/apps/sites/__init__.py +0 -283
- gam7-7.4.1/src/gam/gdata/apps/sites/service.py +0 -246
- {gam7-7.4.1 → gam7-7.4.3}/.github/ISSUE_TEMPLATE/aa-question.md +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/.github/ISSUE_TEMPLATE/za-bug-report.md +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/.github/ISSUE_TEMPLATE/zz-feature-request.md +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/.github/ISSUE_TEMPLATE.txt +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/.github/actions/creds.tar.xz.gpg +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/.github/actions/decrypt.sh +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/.github/actions/entitlements.plist +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/.github/actions/package_exclusions.txt +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/.github/stale.yml +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/.github/workflows/build.yml +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/.github/workflows/codeql-analysis.yml +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/.github/workflows/get-cacerts.yml +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/.github/workflows/pypi.yml +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/.pre-commit-config.yaml +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/LICENSE +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/README.md +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/pyproject.toml +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/.gitignore +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/LICENSE +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/cacerts.pem +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/callgam.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/__main__.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/atom/__init__.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/atom/auth.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/atom/client.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/atom/core.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/atom/data.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/atom/http.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/atom/http_core.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/atom/http_interface.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/atom/mock_http.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/atom/mock_http_core.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/atom/mock_service.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/atom/service.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/atom/token_store.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/atom/url.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/cacerts.pem +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/cbcm-v1.1beta1.json +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/contactdelegation-v1.json +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/datastudio-v1.json +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/__init__.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/glaction.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/glapi.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/glclargs.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/glentity.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/glgapi.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/glgdata.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/glglobals.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/glindent.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/glmsgs.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/glskus.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/gluprop.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/glverlibs.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gamlib/yubikey.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gdata/__init__.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gdata/alt/__init__.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gdata/alt/app_engine.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gdata/alt/appengine.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gdata/apps/__init__.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gdata/apps/audit/__init__.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gdata/apps/audit/service.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gdata/apps/contacts/__init__.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gdata/apps/contacts/service.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gdata/apps/service.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gdata/service.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/gdata/urlfetch.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/__init__.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/_auth.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/_helpers.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/channel.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/discovery.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/discovery_cache/__init__.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/discovery_cache/appengine_memcache.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/discovery_cache/base.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/discovery_cache/file_cache.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/errors.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/http.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/mimeparse.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/model.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/schema.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/googleapiclient/version.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/iso8601/__init__.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/iso8601/iso8601.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/serviceaccountlookup-v1.json +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam/six.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam-install.sh +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam-setup.bat +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam.exe.manifest +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam.spec +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/gam.wxs +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/license.rtf +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/project-apis.txt +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/requirements-dev.txt +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/requirements.txt +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/setup.cfg +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/setup.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/tools/a_atleast_b.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/tools/gen-wix-xml-filelist.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/tools/mkGamRef.py +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/tools/openssl.props +0 -0
- {gam7-7.4.1 → gam7-7.4.3}/src/version_info.txt.in +0 -0
|
@@ -4017,16 +4017,19 @@ gam print cigroup-members [todrive <ToDriveAttribute>*]
|
|
|
4017
4017
|
[types <CIGroupMemberTypeList>]
|
|
4018
4018
|
[memberemaildisplaypattern|memberemailskippattern <RegularExpression>]
|
|
4019
4019
|
<CIGroupMembersFieldName>* [fields <CIGroupMembersFieldNameList>]
|
|
4020
|
-
[
|
|
4020
|
+
[minimal|basic|full]
|
|
4021
|
+
[(recursive [noduplicates]) | includederivedmembership] [nogroupemail]
|
|
4021
4022
|
[formatjson [quotechar <Character>]]
|
|
4022
4023
|
gam show cigroup-members
|
|
4023
4024
|
[(cimember|ciowner <UserItem>)|(cigroup <GroupItem>)|(select <GroupEntity>)]
|
|
4024
4025
|
[showownedby <UserItem>]
|
|
4025
4026
|
[emailmatchpattern [not] <RegularExpression>] [namematchpattern [not] <RegularExpression>]
|
|
4026
4027
|
[descriptionmatchpattern [not] <RegularExpression>]
|
|
4027
|
-
[roles <GroupRoleList>] [members] [managers] [owners]
|
|
4028
|
+
[roles <GroupRoleList>] [members] [managers] [owners]
|
|
4028
4029
|
[types <CIGroupMemberTypeList>]
|
|
4029
4030
|
[memberemaildisplaypattern|memberemailskippattern <RegularExpression>]
|
|
4031
|
+
[minimal|basic|full]
|
|
4032
|
+
[(depth <Number>) | includederivedmembership]
|
|
4030
4033
|
|
|
4031
4034
|
# Cloud Identity Devices
|
|
4032
4035
|
|
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
7.04.03
|
|
2
|
+
|
|
3
|
+
Added option `minimal|basic|full` to `gam print cigroup-members`:
|
|
4
|
+
* `minimal` - Fields displayed: group, id, role, email
|
|
5
|
+
* `basic` - Fields displayed: group, type, id, role, email
|
|
6
|
+
* `full` - Fields displayed: group, type, id, role, email, createTime, updateTime; this is the default
|
|
7
|
+
|
|
8
|
+
Added option `minimal|basic|full` to `gam show cigroup-members`:
|
|
9
|
+
* `minimal` - Fields displayed: role, email
|
|
10
|
+
* `basic` - Fields displayed: type, role, email
|
|
11
|
+
* `full` - Fields displayed: type, role, email, createTime, updateTime; this is the default
|
|
12
|
+
|
|
13
|
+
7.04.02
|
|
14
|
+
|
|
15
|
+
Improved output formatting for the following commands:
|
|
16
|
+
```
|
|
17
|
+
gam info peoplecontact
|
|
18
|
+
gam show peoplecontacts
|
|
19
|
+
gam info peopleprofile
|
|
20
|
+
gam show peopleprofile
|
|
21
|
+
gam <UserTypeEntity> info contacts
|
|
22
|
+
gam <UserTypeEntity> show contacts
|
|
23
|
+
gam <UserTypeEntity> show peopleprofile
|
|
24
|
+
```
|
|
25
|
+
|
|
1
26
|
7.04.01
|
|
2
27
|
|
|
3
28
|
Fixed bug where multiple `querytime<String>` values in a query were not properly processed;
|
|
@@ -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.
|
|
28
|
+
__version__ = '7.04.03'
|
|
29
29
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
|
30
30
|
|
|
31
31
|
#pylint: disable=wrong-import-position
|
|
@@ -5981,6 +5981,8 @@ def getCIGroupTransitiveMemberRoleFixType(groupName, tmember):
|
|
|
5981
5981
|
member['type'] = Ent.TYPE_USER if not tid.endswith('.iam.gserviceaccount.com') else Ent.TYPE_SERVICE_ACCOUNT
|
|
5982
5982
|
elif ttype == 'groups':
|
|
5983
5983
|
member['type'] = Ent.TYPE_GROUP
|
|
5984
|
+
elif tid.startswith('cbcm-browser.'):
|
|
5985
|
+
member['type'] = Ent.TYPE_CBCM_BROWSER
|
|
5984
5986
|
else:
|
|
5985
5987
|
member['type'] = Ent.TYPE_OTHER
|
|
5986
5988
|
else:
|
|
@@ -21864,12 +21866,29 @@ def _printPerson(entityTypeName, user, person, csvPF, FJQC, parameters):
|
|
|
21864
21866
|
'JSON': json.dumps(cleanJSON(person),
|
|
21865
21867
|
ensure_ascii=False, sort_keys=True)})
|
|
21866
21868
|
|
|
21869
|
+
PEOPLE_CONTACT_OBJECT_KEYS = {
|
|
21870
|
+
'addresses': 'type',
|
|
21871
|
+
'calendarUrls': 'type',
|
|
21872
|
+
'emailAddresses': 'type',
|
|
21873
|
+
'events': 'type',
|
|
21874
|
+
'externalIds': 'type',
|
|
21875
|
+
'genders': 'value',
|
|
21876
|
+
'imClients': 'type',
|
|
21877
|
+
'locations': 'type',
|
|
21878
|
+
'miscKeywords': 'type',
|
|
21879
|
+
'nicknames': 'type',
|
|
21880
|
+
'organizations': 'type',
|
|
21881
|
+
'relations': 'type',
|
|
21882
|
+
'urls': 'type',
|
|
21883
|
+
'userDefined': 'key',
|
|
21884
|
+
}
|
|
21885
|
+
|
|
21867
21886
|
def _showPerson(userEntityType, user, entityType, person, i, count, FJQC, parameters):
|
|
21868
21887
|
_processPersonMetadata(person, parameters)
|
|
21869
21888
|
if not FJQC.formatJSON:
|
|
21870
21889
|
printEntity([userEntityType, user, entityType, person['resourceName']], i, count)
|
|
21871
21890
|
Ind.Increment()
|
|
21872
|
-
showJSON(None, person)
|
|
21891
|
+
showJSON(None, person, dictObjectsKey=PEOPLE_CONTACT_OBJECT_KEYS)
|
|
21873
21892
|
Ind.Decrement()
|
|
21874
21893
|
else:
|
|
21875
21894
|
printLine(json.dumps(cleanJSON(person), ensure_ascii=False, sort_keys=True))
|
|
@@ -33942,6 +33961,8 @@ def infoGroupMembers(entityList, ciGroupsAPI=False):
|
|
|
33942
33961
|
printKeyValueList(['type', result['type']])
|
|
33943
33962
|
for field in ['createTime', 'updateTime']:
|
|
33944
33963
|
printKeyValueList([field, formatLocalTime(result[field])])
|
|
33964
|
+
if 'deliverySetting' in result:
|
|
33965
|
+
printKeyValueList(['deliverySetting', result['deliverySetting']])
|
|
33945
33966
|
Ind.Decrement()
|
|
33946
33967
|
except (GAPI.groupNotFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.invalid, GAPI.forbidden) as e:
|
|
33947
33968
|
entityActionFailedWarning([entityType, groupKey], str(e), j, jcount)
|
|
@@ -36104,8 +36125,9 @@ def getCIGroupTransitiveMembers(ci, groupName, membersList, i, count):
|
|
|
36104
36125
|
return True
|
|
36105
36126
|
|
|
36106
36127
|
def getCIGroupMembers(ci, groupName, memberRoles, membersList, membersSet, i, count,
|
|
36107
|
-
memberOptions, memberDisplayOptions, level, typesSet):
|
|
36108
|
-
|
|
36128
|
+
memberOptions, memberDisplayOptions, level, typesSet, groupEmail, kwargs):
|
|
36129
|
+
nameToPrint = groupEmail if groupEmail else groupName
|
|
36130
|
+
printGettingAllEntityItemsForWhom(memberRoles if memberRoles else Ent.ROLE_MANAGER_MEMBER_OWNER, nameToPrint, i, count)
|
|
36109
36131
|
validRoles = _getCIRoleVerification(memberRoles)
|
|
36110
36132
|
if memberOptions[MEMBEROPTION_INCLUDEDERIVEDMEMBERSHIP]:
|
|
36111
36133
|
groupMembers = []
|
|
@@ -36120,12 +36142,11 @@ def getCIGroupMembers(ci, groupName, memberRoles, membersList, membersSet, i, co
|
|
|
36120
36142
|
groupMembers = callGAPIpages(ci.groups().memberships(), 'list', 'memberships',
|
|
36121
36143
|
pageMessage=getPageMessageForWhom(),
|
|
36122
36144
|
throwReasons=GAPI.CIGROUP_LIST_THROW_REASONS, retryReasons=GAPI.CIGROUP_RETRY_REASONS,
|
|
36123
|
-
parent=groupName,
|
|
36124
|
-
fields='nextPageToken,memberships(*)', pageSize=GC.Values[GC.MEMBER_MAX_RESULTS])
|
|
36145
|
+
parent=groupName, **kwargs)
|
|
36125
36146
|
except (GAPI.resourceNotFound, GAPI.domainNotFound, GAPI.domainCannotUseApis,
|
|
36126
36147
|
GAPI.forbidden, GAPI.badRequest, GAPI.invalid, GAPI.invalidArgument, GAPI.systemError,
|
|
36127
36148
|
GAPI.permissionDenied, GAPI.serviceNotAvailable):
|
|
36128
|
-
entityUnknownWarning(Ent.CLOUD_IDENTITY_GROUP,
|
|
36149
|
+
entityUnknownWarning(Ent.CLOUD_IDENTITY_GROUP, nameToPrint, i, count)
|
|
36129
36150
|
return
|
|
36130
36151
|
checkCategory = memberDisplayOptions['showCategory']
|
|
36131
36152
|
if not memberOptions[MEMBEROPTION_RECURSIVE]:
|
|
@@ -36159,7 +36180,7 @@ def getCIGroupMembers(ci, groupName, memberRoles, membersList, membersSet, i, co
|
|
|
36159
36180
|
memberName not in membersSet):
|
|
36160
36181
|
membersSet.add(memberName)
|
|
36161
36182
|
member['level'] = level
|
|
36162
|
-
member['subgroup'] =
|
|
36183
|
+
member['subgroup'] = nameToPrint
|
|
36163
36184
|
membersList.append(member)
|
|
36164
36185
|
else:
|
|
36165
36186
|
if memberName not in membersSet:
|
|
@@ -36168,37 +36189,40 @@ def getCIGroupMembers(ci, groupName, memberRoles, membersList, membersSet, i, co
|
|
|
36168
36189
|
checkCIMemberMatch(member, memberOptions) and
|
|
36169
36190
|
(not checkCategory or _checkCIMemberCategory(member, memberDisplayOptions))):
|
|
36170
36191
|
member['level'] = level
|
|
36171
|
-
member['subgroup'] =
|
|
36192
|
+
member['subgroup'] = nameToPrint
|
|
36172
36193
|
membersList.append(member)
|
|
36173
36194
|
_, gname = member['name'].rsplit('/', 1)
|
|
36174
|
-
groupMemberList.append(f'groups/{gname}')
|
|
36195
|
+
groupMemberList.append((f'groups/{gname}', memberName))
|
|
36175
36196
|
for member in groupMemberList:
|
|
36176
|
-
getCIGroupMembers(ci, member, memberRoles, membersList, membersSet, i, count,
|
|
36177
|
-
memberOptions, memberDisplayOptions, level+1, typesSet)
|
|
36197
|
+
getCIGroupMembers(ci, member[0], memberRoles, membersList, membersSet, i, count,
|
|
36198
|
+
memberOptions, memberDisplayOptions, level+1, typesSet, member[1], kwargs)
|
|
36178
36199
|
else:
|
|
36179
36200
|
for member in groupMembers:
|
|
36180
36201
|
getCIGroupMemberRoleFixType(member)
|
|
36202
|
+
memberName = member.get('preferredMemberKey', {}).get('id', '')
|
|
36181
36203
|
if member['type'] != Ent.TYPE_GROUP:
|
|
36182
36204
|
if (member['type'] in typesSet and
|
|
36183
36205
|
checkCIMemberMatch(member, memberOptions) and
|
|
36184
36206
|
_checkMemberRole(member, validRoles) and
|
|
36185
36207
|
(not checkCategory or _checkCIMemberCategory(member, memberDisplayOptions))):
|
|
36186
36208
|
member['level'] = level
|
|
36187
|
-
member['subgroup'] =
|
|
36209
|
+
member['subgroup'] = nameToPrint
|
|
36188
36210
|
membersList.append(member)
|
|
36189
36211
|
else:
|
|
36190
36212
|
if (member['type'] in typesSet and
|
|
36191
36213
|
checkCIMemberMatch(member, memberOptions) and
|
|
36192
36214
|
(not checkCategory or _checkCIMemberCategory(member, memberDisplayOptions))):
|
|
36193
36215
|
member['level'] = level
|
|
36194
|
-
member['subgroup'] =
|
|
36216
|
+
member['subgroup'] = nameToPrint
|
|
36195
36217
|
membersList.append(member)
|
|
36196
36218
|
_, gname = member['name'].rsplit('/', 1)
|
|
36197
36219
|
getCIGroupMembers(ci, f'groups/{gname}', memberRoles, membersList, membersSet, i, count,
|
|
36198
|
-
memberOptions, memberDisplayOptions, level+1, typesSet)
|
|
36220
|
+
memberOptions, memberDisplayOptions, level+1, typesSet, memberName, kwargs)
|
|
36199
36221
|
|
|
36200
36222
|
CIGROUPMEMBERS_FIELDS_CHOICE_MAP = {
|
|
36201
36223
|
'createtime': 'createTime',
|
|
36224
|
+
'delivery': 'deliverySetting',
|
|
36225
|
+
'deliverysettings': 'deliverySetting',
|
|
36202
36226
|
'expiretime': 'expireTime',
|
|
36203
36227
|
'id': 'name',
|
|
36204
36228
|
'memberkey': 'preferredMemberKey',
|
|
@@ -36219,6 +36243,16 @@ CIGROUPMEMBERS_SORT_FIELDS = [
|
|
|
36219
36243
|
]
|
|
36220
36244
|
CIGROUPMEMBERS_TIME_OBJECTS = {'createTime', 'updateTime', 'expireTime'}
|
|
36221
36245
|
|
|
36246
|
+
def _getCIListGroupMembersArgs(listView):
|
|
36247
|
+
if listView == 'full':
|
|
36248
|
+
return {'view': 'FULL', 'pageSize': GC.Values[GC.MEMBER_MAX_RESULTS_CI_FULL],
|
|
36249
|
+
'fields': 'nextPageToken,memberships(*)'}
|
|
36250
|
+
if listView == 'basic':
|
|
36251
|
+
return {'view': 'FULL', 'pageSize': GC.Values[GC.MEMBER_MAX_RESULTS_CI_FULL],
|
|
36252
|
+
'fields': 'nextPageToken,memberships(name,preferredMemberKey,roles,type)'}
|
|
36253
|
+
return {'view': 'BASIC', 'pageSize': GC.Values[GC.MEMBER_MAX_RESULTS_CI_BASIC],
|
|
36254
|
+
'fields': 'nextPageToken,memberships(*)'}
|
|
36255
|
+
|
|
36222
36256
|
# gam print cigroup-members [todrive <ToDriveAttribute>*]
|
|
36223
36257
|
# [(cimember|ciowner <UserItem>)|(cigroup <GroupItem>)|(select <GroupEntity>)]
|
|
36224
36258
|
# [showownedby <UserItem>]
|
|
@@ -36228,6 +36262,7 @@ CIGROUPMEMBERS_TIME_OBJECTS = {'createTime', 'updateTime', 'expireTime'}
|
|
|
36228
36262
|
# [types <CIGroupMemberTypeList>]
|
|
36229
36263
|
# [memberemaildisplaypattern|memberemailskippattern <RegularExpression>]
|
|
36230
36264
|
# <CIGroupMembersFieldName>* [fields <CIGroupMembersFieldNameList>]
|
|
36265
|
+
# [minimal|basic|full]
|
|
36231
36266
|
# [(recursive [noduplicates])|includederivedmembership] [nogroupeemail]
|
|
36232
36267
|
# [formatjson [quotechar <Character>]]
|
|
36233
36268
|
def doPrintCIGroupMembers():
|
|
@@ -36245,6 +36280,7 @@ def doPrintCIGroupMembers():
|
|
|
36245
36280
|
rolesSet = set()
|
|
36246
36281
|
typesSet = set()
|
|
36247
36282
|
matchPatterns = {}
|
|
36283
|
+
listView = 'full'
|
|
36248
36284
|
while Cmd.ArgumentsRemaining():
|
|
36249
36285
|
myarg = getArgument()
|
|
36250
36286
|
if myarg == 'todrive':
|
|
@@ -36285,8 +36321,12 @@ def doPrintCIGroupMembers():
|
|
|
36285
36321
|
memberOptions[MEMBEROPTION_RECURSIVE] = False
|
|
36286
36322
|
elif myarg == 'nogroupemail':
|
|
36287
36323
|
groupColumn = False
|
|
36324
|
+
elif myarg in {'minimal', 'basic', 'full'}:
|
|
36325
|
+
listView = myarg
|
|
36288
36326
|
else:
|
|
36289
36327
|
FJQC.GetFormatJSONQuoteChar(myarg, False)
|
|
36328
|
+
if listView == 'minimal' and memberOptions[MEMBEROPTION_RECURSIVE]:
|
|
36329
|
+
usageErrorExit(Msg.ARE_MUTUALLY_EXCLUSIVE.format('minimal', 'recursive'))
|
|
36290
36330
|
if not typesSet:
|
|
36291
36331
|
typesSet = {Ent.TYPE_USER} if memberOptions[MEMBEROPTION_RECURSIVE] else ALL_CIGROUP_MEMBER_TYPES
|
|
36292
36332
|
fields = ','.join(set(groupFieldsLists['ci']))
|
|
@@ -36313,6 +36353,7 @@ def doPrintCIGroupMembers():
|
|
|
36313
36353
|
if showOwnedBy:
|
|
36314
36354
|
getRolesSet.add(Ent.ROLE_OWNER)
|
|
36315
36355
|
getRoles = ','.join(sorted(getRolesSet))
|
|
36356
|
+
kwargs = _getCIListGroupMembersArgs(listView)
|
|
36316
36357
|
level = 0
|
|
36317
36358
|
i = 0
|
|
36318
36359
|
count = len(entityList)
|
|
@@ -36339,7 +36380,7 @@ def doPrintCIGroupMembers():
|
|
|
36339
36380
|
membersList = []
|
|
36340
36381
|
membersSet = set()
|
|
36341
36382
|
getCIGroupMembers(ci, groupEntity['name'], getRoles, membersList, membersSet, i, count,
|
|
36342
|
-
memberOptions, memberDisplayOptions, level, typesSet)
|
|
36383
|
+
memberOptions, memberDisplayOptions, level, typesSet, groupEmail, kwargs)
|
|
36343
36384
|
if showOwnedBy and not checkCIGroupShowOwnedBy(showOwnedBy, membersList):
|
|
36344
36385
|
continue
|
|
36345
36386
|
for member in membersList:
|
|
@@ -36357,6 +36398,8 @@ def doPrintCIGroupMembers():
|
|
|
36357
36398
|
row['subgroup'] = member['subgroup']
|
|
36358
36399
|
if memberDisplayOptions['showCategory']:
|
|
36359
36400
|
row['category'] = member['category']
|
|
36401
|
+
if listView == 'minimal':
|
|
36402
|
+
dmember.pop('type', None)
|
|
36360
36403
|
mapCIGroupMemberFieldNames(dmember)
|
|
36361
36404
|
if not FJQC.formatJSON:
|
|
36362
36405
|
csvPF.WriteRowTitles(flattenJSON(dmember, flattened=row, timeObjects=CIGROUPMEMBERS_TIME_OBJECTS))
|
|
@@ -36386,17 +36429,19 @@ def doPrintCIGroupMembers():
|
|
|
36386
36429
|
# [showownedby <UserItem>]
|
|
36387
36430
|
# [emailmatchpattern [not] <RegularExpression>] [namematchpattern [not] <RegularExpression>]
|
|
36388
36431
|
# [descriptionmatchpattern [not] <RegularExpression>]
|
|
36389
|
-
# [roles <GroupRoleList>] [members] [managers] [owners]
|
|
36432
|
+
# [roles <GroupRoleList>] [members] [managers] [owners]
|
|
36390
36433
|
# [internal] [internaldomains <DomainList>] [external]
|
|
36391
36434
|
# [types <CIGroupMemberTypeList>]
|
|
36392
36435
|
# [memberemaildisplaypattern|memberemailskippattern <RegularExpression>]
|
|
36393
|
-
# [
|
|
36436
|
+
# [minimal|basic|full]
|
|
36437
|
+
# [(depth <Number>) | includederivedmembership]
|
|
36394
36438
|
def doShowCIGroupMembers():
|
|
36395
36439
|
def _roleOrder(key):
|
|
36396
36440
|
return {Ent.ROLE_OWNER: 0, Ent.ROLE_MANAGER: 1, Ent.ROLE_MEMBER: 2}.get(key, 3)
|
|
36397
36441
|
|
|
36398
36442
|
def _typeOrder(key):
|
|
36399
|
-
return {Ent.TYPE_CUSTOMER: 0, Ent.TYPE_USER: 1, Ent.TYPE_GROUP: 2,
|
|
36443
|
+
return {Ent.TYPE_CUSTOMER: 0, Ent.TYPE_USER: 1, Ent.TYPE_GROUP: 2,
|
|
36444
|
+
Ent.TYPE_CBCM_BROWSER: 3, Ent.TYPE_OTHER: 4, Ent.TYPE_EXTERNAL: 5}.get(key, 6)
|
|
36400
36445
|
|
|
36401
36446
|
def _showGroup(groupName, groupEmail, depth):
|
|
36402
36447
|
if includeDerivedMembership:
|
|
@@ -36407,8 +36452,7 @@ def doShowCIGroupMembers():
|
|
|
36407
36452
|
try:
|
|
36408
36453
|
membersList = callGAPIpages(ci.groups().memberships(), 'list', 'memberships',
|
|
36409
36454
|
throwReasons=GAPI.CIGROUP_LIST_THROW_REASONS, retryReasons=GAPI.CIGROUP_RETRY_REASONS,
|
|
36410
|
-
parent=groupName,
|
|
36411
|
-
fields='nextPageToken,memberships(*)', pageSize=GC.Values[GC.MEMBER_MAX_RESULTS])
|
|
36455
|
+
parent=groupName, **kwargs)
|
|
36412
36456
|
for member in membersList:
|
|
36413
36457
|
getCIGroupMemberRoleFixType(member)
|
|
36414
36458
|
except (GAPI.resourceNotFound, GAPI.domainNotFound, GAPI.domainCannotUseApis,
|
|
@@ -36429,7 +36473,10 @@ def doShowCIGroupMembers():
|
|
|
36429
36473
|
if (_checkMemberRole(member, rolesSet) and
|
|
36430
36474
|
member['type'] in typesSet and
|
|
36431
36475
|
checkCIMemberMatch(member, memberOptions)):
|
|
36432
|
-
|
|
36476
|
+
if listView != 'minimal':
|
|
36477
|
+
memberDetails = f'{member.get("role", Ent.ROLE_MEMBER)}, {member["type"]}, {member["preferredMemberKey"]["id"]}'
|
|
36478
|
+
else:
|
|
36479
|
+
memberDetails = f'{member.get("role", Ent.ROLE_MEMBER)}, {member["preferredMemberKey"]["id"]}'
|
|
36433
36480
|
if checkCategory:
|
|
36434
36481
|
memberDetails += f', {member["category"]}'
|
|
36435
36482
|
for field in ['createTime', 'updateTime', 'expireTime']:
|
|
@@ -36454,6 +36501,7 @@ def doShowCIGroupMembers():
|
|
|
36454
36501
|
matchPatterns = {}
|
|
36455
36502
|
maxdepth = -1
|
|
36456
36503
|
includeDerivedMembership = False
|
|
36504
|
+
listView = 'full'
|
|
36457
36505
|
while Cmd.ArgumentsRemaining():
|
|
36458
36506
|
myarg = getArgument()
|
|
36459
36507
|
if myarg == 'showownedby':
|
|
@@ -36484,6 +36532,8 @@ def doShowCIGroupMembers():
|
|
|
36484
36532
|
maxdepth = getInteger(minVal=-1)
|
|
36485
36533
|
elif myarg == 'includederivedmembership':
|
|
36486
36534
|
includeDerivedMembership = True
|
|
36535
|
+
elif myarg in {'minimal', 'basic', 'full'}:
|
|
36536
|
+
listView = myarg
|
|
36487
36537
|
else:
|
|
36488
36538
|
unknownArgumentExit()
|
|
36489
36539
|
if not rolesSet:
|
|
@@ -36493,6 +36543,7 @@ def doShowCIGroupMembers():
|
|
|
36493
36543
|
checkCategory = memberDisplayOptions['showCategory']
|
|
36494
36544
|
fields = ','.join(set(groupFieldsLists['ci']))
|
|
36495
36545
|
entityList = getCIGroupMembersEntityList(ci, entityList, query, subTitle, matchPatterns, groupFieldsLists['ci'], None)
|
|
36546
|
+
kwargs = _getCIListGroupMembersArgs(listView)
|
|
36496
36547
|
i = 0
|
|
36497
36548
|
count = len(entityList)
|
|
36498
36549
|
for group in entityList:
|
|
@@ -179,6 +179,10 @@ LICENSE_MAX_RESULTS = 'license_max_results'
|
|
|
179
179
|
LICENSE_SKUS = 'license_skus'
|
|
180
180
|
# When retrieving lists of Google Group members from API, how many should be retrieved in each chunk
|
|
181
181
|
MEMBER_MAX_RESULTS = 'member_max_results'
|
|
182
|
+
# CI API Group members max page size when view=BASIC
|
|
183
|
+
MEMBER_MAX_RESULTS_CI_BASIC = 'member_max_results_ci_basic'
|
|
184
|
+
# CI API Group members max page size when view=FULL
|
|
185
|
+
MEMBER_MAX_RESULTS_CI_FULL = 'member_max_results_ci_full'
|
|
182
186
|
# When deleting or modifying Gmail messages, how many should be processed in each batch
|
|
183
187
|
MESSAGE_BATCH_SIZE = 'message_batch_size'
|
|
184
188
|
# When retrieving lists of Gmail messages from API, how many should be retrieved in each chunk
|
|
@@ -385,6 +389,8 @@ Defaults = {
|
|
|
385
389
|
LICENSE_MAX_RESULTS: '100',
|
|
386
390
|
LICENSE_SKUS: '',
|
|
387
391
|
MEMBER_MAX_RESULTS: '200',
|
|
392
|
+
MEMBER_MAX_RESULTS_CI_BASIC: '1000',
|
|
393
|
+
MEMBER_MAX_RESULTS_CI_FULL: '500',
|
|
388
394
|
MESSAGE_BATCH_SIZE: '50',
|
|
389
395
|
MESSAGE_MAX_RESULTS: '500',
|
|
390
396
|
MOBILE_MAX_RESULTS: '100',
|
|
@@ -550,6 +556,8 @@ VAR_INFO = {
|
|
|
550
556
|
LICENSE_MAX_RESULTS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (10, 1000)},
|
|
551
557
|
LICENSE_SKUS: {VAR_TYPE: TYPE_STRING, VAR_LIMITS: (0, None)},
|
|
552
558
|
MEMBER_MAX_RESULTS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 200)},
|
|
559
|
+
MEMBER_MAX_RESULTS_CI_BASIC: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 1000)},
|
|
560
|
+
MEMBER_MAX_RESULTS_CI_FULL: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 500)},
|
|
553
561
|
MESSAGE_BATCH_SIZE: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 1000)},
|
|
554
562
|
MESSAGE_MAX_RESULTS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 10000)},
|
|
555
563
|
MOBILE_MAX_RESULTS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 100)},
|
|
@@ -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)
|