Compare commits

...

3 Commits

Author SHA1 Message Date
Jay Lee
8e3f30e901 display group email instead of unique name
Some checks failed
Build and test GAM / build (Win64, build, 10, VC-WIN64A, windows-2022) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 3, linux-aarch64, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 4, linux-aarch64, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 6, linux-aarch64, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 8, darwin64-arm64, macos-14) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 9, darwin64-arm64, macos-15) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 1, linux-x86_64, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 2, linux-x86_64, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 5, linux-x86_64, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 7, darwin64-x86_64, macos-13) (push) Has been cancelled
Build and test GAM / build (x86_64, test, 11, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (x86_64, test, 12, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (x86_64, test, 13, ubuntu-24.04, 3.12) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
2025-02-14 13:47:10 +00:00
Jay Lee
cccbddcf45 use larger ci.members.list() page sizes 2025-02-14 13:32:40 +00:00
Ross Scroggs
a70bbf08ed Improved output formatting for people objects
Some checks are pending
Build and test GAM / build (Win64, build, 10, VC-WIN64A, windows-2022) (push) Waiting to run
Build and test GAM / build (aarch64, build, 3, linux-aarch64, ubuntu-24.04-arm) (push) Waiting to run
Build and test GAM / build (aarch64, build, 4, linux-aarch64, ubuntu-22.04-arm) (push) Waiting to run
Build and test GAM / build (aarch64, build, 6, linux-aarch64, ubuntu-22.04-arm, yes) (push) Waiting to run
Build and test GAM / build (aarch64, build, 8, darwin64-arm64, macos-14) (push) Waiting to run
Build and test GAM / build (aarch64, build, 9, darwin64-arm64, macos-15) (push) Waiting to run
Build and test GAM / build (x86_64, build, 1, linux-x86_64, ubuntu-22.04) (push) Waiting to run
Build and test GAM / build (x86_64, build, 2, linux-x86_64, ubuntu-24.04) (push) Waiting to run
Build and test GAM / build (x86_64, build, 5, linux-x86_64, ubuntu-22.04, yes) (push) Waiting to run
Build and test GAM / build (x86_64, build, 7, darwin64-x86_64, macos-13) (push) Waiting to run
Build and test GAM / build (x86_64, test, 11, ubuntu-24.04, 3.10) (push) Waiting to run
Build and test GAM / build (x86_64, test, 12, ubuntu-24.04, 3.11) (push) Waiting to run
Build and test GAM / build (x86_64, test, 13, ubuntu-24.04, 3.12) (push) Waiting to run
Build and test GAM / merge (push) Blocked by required conditions
Build and test GAM / publish (push) Blocked by required conditions
CodeQL / Analyze (python) (push) Waiting to run
Check for Google Root CA Updates / check-apis (push) Waiting to run
2025-02-13 19:58:07 -08:00
3 changed files with 56 additions and 7 deletions

View File

@@ -1,3 +1,16 @@
7.04.02
Improved output formatting for the following commands:
```
gam info peoplecontact
gam show peoplecontacts
gam info peopleprofile
gam show peopleprofile
gam <UserTypeEntity> info contacts
gam <UserTypeEntity> show contacts
gam <UserTypeEntity> show peopleprofile
```
7.04.01
Fixed bug where multiple `querytime<String>` values in a query were not properly processed;

View File

@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
"""
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.04.01'
__version__ = '7.04.02'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
#pylint: disable=wrong-import-position
@@ -21864,12 +21864,29 @@ def _printPerson(entityTypeName, user, person, csvPF, FJQC, parameters):
'JSON': json.dumps(cleanJSON(person),
ensure_ascii=False, sort_keys=True)})
PEOPLE_CONTACT_OBJECT_KEYS = {
'addresses': 'type',
'calendarUrls': 'type',
'emailAddresses': 'type',
'events': 'type',
'externalIds': 'type',
'genders': 'value',
'imClients': 'type',
'locations': 'type',
'miscKeywords': 'type',
'nicknames': 'type',
'organizations': 'type',
'relations': 'type',
'urls': 'type',
'userDefined': 'key',
}
def _showPerson(userEntityType, user, entityType, person, i, count, FJQC, parameters):
_processPersonMetadata(person, parameters)
if not FJQC.formatJSON:
printEntity([userEntityType, user, entityType, person['resourceName']], i, count)
Ind.Increment()
showJSON(None, person)
showJSON(None, person, dictObjectsKey=PEOPLE_CONTACT_OBJECT_KEYS)
Ind.Decrement()
else:
printLine(json.dumps(cleanJSON(person), ensure_ascii=False, sort_keys=True))
@@ -36104,9 +36121,17 @@ def getCIGroupTransitiveMembers(ci, groupName, membersList, i, count):
return True
def getCIGroupMembers(ci, groupName, memberRoles, membersList, membersSet, i, count,
memberOptions, memberDisplayOptions, level, typesSet):
printGettingAllEntityItemsForWhom(memberRoles if memberRoles else Ent.ROLE_MANAGER_MEMBER_OWNER, groupName, i, count)
memberOptions, memberDisplayOptions, level, typesSet, listView='FULL', groupEmail=None):
if groupEmail:
nameToPrint = groupEmail
else:
nameToPrint = groupName
printGettingAllEntityItemsForWhom(memberRoles if memberRoles else Ent.ROLE_MANAGER_MEMBER_OWNER, nameToPrint, i, count)
validRoles = _getCIRoleVerification(memberRoles)
if listView == 'BASIC':
pageSize = GC.Values[GC.MEMBER_MAX_RESULTS_CI_BASIC]
else:
pageSize = GC.Values[GC.MEMBER_MAX_RESULTS_CI_FULL]
if memberOptions[MEMBEROPTION_INCLUDEDERIVEDMEMBERSHIP]:
groupMembers = []
if not getCIGroupTransitiveMembers(ci, groupName, groupMembers, i, count):
@@ -36120,8 +36145,8 @@ def getCIGroupMembers(ci, groupName, memberRoles, membersList, membersSet, i, co
groupMembers = callGAPIpages(ci.groups().memberships(), 'list', 'memberships',
pageMessage=getPageMessageForWhom(),
throwReasons=GAPI.CIGROUP_LIST_THROW_REASONS, retryReasons=GAPI.CIGROUP_RETRY_REASONS,
parent=groupName, view='FULL',
fields='nextPageToken,memberships(*)', pageSize=GC.Values[GC.MEMBER_MAX_RESULTS])
parent=groupName, view=listView,
fields='nextPageToken,memberships(*)', pageSize=pageSize)
except (GAPI.resourceNotFound, GAPI.domainNotFound, GAPI.domainCannotUseApis,
GAPI.forbidden, GAPI.badRequest, GAPI.invalid, GAPI.invalidArgument, GAPI.systemError,
GAPI.permissionDenied, GAPI.serviceNotAvailable):
@@ -36245,6 +36270,7 @@ def doPrintCIGroupMembers():
rolesSet = set()
typesSet = set()
matchPatterns = {}
listView = 'FULL'
while Cmd.ArgumentsRemaining():
myarg = getArgument()
if myarg == 'todrive':
@@ -36285,6 +36311,8 @@ def doPrintCIGroupMembers():
memberOptions[MEMBEROPTION_RECURSIVE] = False
elif myarg == 'nogroupemail':
groupColumn = False
elif myarg == 'basic':
listView = 'BASIC'
else:
FJQC.GetFormatJSONQuoteChar(myarg, False)
if not typesSet:
@@ -36339,7 +36367,7 @@ def doPrintCIGroupMembers():
membersList = []
membersSet = set()
getCIGroupMembers(ci, groupEntity['name'], getRoles, membersList, membersSet, i, count,
memberOptions, memberDisplayOptions, level, typesSet)
memberOptions, memberDisplayOptions, level, typesSet, listView, groupEmail)
if showOwnedBy and not checkCIGroupShowOwnedBy(showOwnedBy, membersList):
continue
for member in membersList:

View File

@@ -179,6 +179,10 @@ LICENSE_MAX_RESULTS = 'license_max_results'
LICENSE_SKUS = 'license_skus'
# When retrieving lists of Google Group members from API, how many should be retrieved in each chunk
MEMBER_MAX_RESULTS = 'member_max_results'
# CI API Group members max page size when view=BASIC
MEMBER_MAX_RESULTS_CI_BASIC = 'member.max_results_ci_basic'
# CI API Group members max page size when view=FULL
MEMBER_MAX_RESULTS_CI_FULL = 'member_max_results_ci_full'
# When deleting or modifying Gmail messages, how many should be processed in each batch
MESSAGE_BATCH_SIZE = 'message_batch_size'
# When retrieving lists of Gmail messages from API, how many should be retrieved in each chunk
@@ -385,6 +389,8 @@ Defaults = {
LICENSE_MAX_RESULTS: '100',
LICENSE_SKUS: '',
MEMBER_MAX_RESULTS: '200',
MEMBER_MAX_RESULTS_CI_BASIC: '1000',
MEMBER_MAX_RESULTS_CI_FULL: '500',
MESSAGE_BATCH_SIZE: '50',
MESSAGE_MAX_RESULTS: '500',
MOBILE_MAX_RESULTS: '100',
@@ -550,6 +556,8 @@ VAR_INFO = {
LICENSE_MAX_RESULTS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (10, 1000)},
LICENSE_SKUS: {VAR_TYPE: TYPE_STRING, VAR_LIMITS: (0, None)},
MEMBER_MAX_RESULTS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 200)},
MEMBER_MAX_RESULTS_CI_BASIC: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 1000)},
MEMBER_MAX_RESULTS_CI_FULL: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 500)},
MESSAGE_BATCH_SIZE: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 1000)},
MESSAGE_MAX_RESULTS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 10000)},
MOBILE_MAX_RESULTS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 100)},