get all groups for users with >200

This commit is contained in:
Jay Lee
2014-11-19 12:07:43 -05:00
parent 995f4db93b
commit 723e8c042a

8
gam.py
View File

@ -4831,10 +4831,10 @@ def doGetUserInfo(user_email=None):
for alias in user[u'nonEditableAliases']: for alias in user[u'nonEditableAliases']:
print u' %s' % alias print u' %s' % alias
if getGroups: if getGroups:
groups = callGAPI(service=cd.groups(), function=u'list', userKey=user_email) groups = callGAPIpages(service=cd.groups(), function=u'list', items=u'groups', userKey=user_email, fields=u'groups(name,email),nextPageToken')
if u'groups' in groups: if len(groups) > 0:
print u'Groups:' print u'Groups: (%s)' % len(groups)
for group in groups[u'groups']: for group in groups:
print u' %s <%s>' % (group[u'name'], group[u'email']) print u' %s <%s>' % (group[u'name'], group[u'email'])
if getLicenses: if getLicenses:
print u'Licenses:' print u'Licenses:'