mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 04:41:35 +00:00
Added option showaccesssettings to gam [<UserTypeEntity>] print|show chatspaces
This commit is contained in:
@@ -2000,10 +2000,10 @@ gam info chatspace <ChatSpace>
|
|||||||
[fields <ChatSpaceFieldNameList>]
|
[fields <ChatSpaceFieldNameList>]
|
||||||
[formatjson]
|
[formatjson]
|
||||||
gam show chatspaces
|
gam show chatspaces
|
||||||
[fields <ChatSpaceFieldNameList>]
|
[fields <ChatSpaceFieldNameList>] [showaccessssettings]
|
||||||
[formatjson]
|
[formatjson]
|
||||||
gam print chatspaces [todrive <ToDriveAttribute>*]
|
gam print chatspaces [todrive <ToDriveAttribute>*]
|
||||||
[fields <ChatSpaceFieldNameList>]
|
[fields <ChatSpaceFieldNameList>] [showaccessssettings]
|
||||||
[formatjson [quotechar <Character>]]
|
[formatjson [quotechar <Character>]]
|
||||||
|
|
||||||
<ChatMemberFieldName> ::=
|
<ChatMemberFieldName> ::=
|
||||||
@@ -6409,11 +6409,11 @@ gam <UserTypeEntity> info chatspacedm <UserItem>
|
|||||||
[formatjson]
|
[formatjson]
|
||||||
gam <UserTypeEntity> show chatspaces
|
gam <UserTypeEntity> show chatspaces
|
||||||
[types <ChatSpaceTypeList>]
|
[types <ChatSpaceTypeList>]
|
||||||
[fields <ChatSpaceFieldNameList>]
|
[fields <ChatSpaceFieldNameList>] [showaccessssettings]
|
||||||
[formatjson]
|
[formatjson]
|
||||||
gam <UserTypeEntity> print chatspaces [todrive <ToDriveAttribute>*]
|
gam <UserTypeEntity> print chatspaces [todrive <ToDriveAttribute>*]
|
||||||
[types <ChatSpaceTypeList>]
|
[types <ChatSpaceTypeList>]
|
||||||
[fields <ChatSpaceFieldNameList>]
|
[fields <ChatSpaceFieldNameList>] [showaccessssettings]
|
||||||
[formatjson [quotechar <Character>]]
|
[formatjson [quotechar <Character>]]
|
||||||
|
|
||||||
gam <UserItem> info chatspace asadmin <ChatSpace>
|
gam <UserItem> info chatspace asadmin <ChatSpace>
|
||||||
@@ -6422,12 +6422,12 @@ gam <UserItem> info chatspace asadmin <ChatSpace>
|
|||||||
gam <UserItem> show chatspaces asadmin
|
gam <UserItem> show chatspaces asadmin
|
||||||
[query <String>] [querytime<String> <Time>]
|
[query <String>] [querytime<String> <Time>]
|
||||||
[orderby <ChatSpaceAdminOrderByFieldName> [ascending|descending]]
|
[orderby <ChatSpaceAdminOrderByFieldName> [ascending|descending]]
|
||||||
[fields <ChatSpaceFieldNameList>]
|
[fields <ChatSpaceFieldNameList>] [showaccessssettings]
|
||||||
[formatjson]
|
[formatjson]
|
||||||
gam <UserItem> print chatspaces asadmin [todrive <ToDriveAttribute>*]
|
gam <UserItem> print chatspaces asadmin [todrive <ToDriveAttribute>*]
|
||||||
[query <String>] [querytime<String> <Time>]
|
[query <String>] [querytime<String> <Time>]
|
||||||
[orderby <ChatSpaceAdminOrderByFieldName> [ascending|descending]]
|
[orderby <ChatSpaceAdminOrderByFieldName> [ascending|descending]]
|
||||||
[fields <ChatSpaceFieldNameList>]
|
[fields <ChatSpaceFieldNameList>] [showaccessssettings]
|
||||||
[formatjson [quotechar <Character>]]
|
[formatjson [quotechar <Character>]]
|
||||||
|
|
||||||
gam <UserTypeEntity> create chatmember <ChatSpace>
|
gam <UserTypeEntity> create chatmember <ChatSpace>
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
7.20.01
|
||||||
|
|
||||||
|
Added option `showaccesssettings` to `gam [<UserTypeEntity>] print|show chatspaces`. When listing
|
||||||
|
Chat Spaces, the Chat API does not return the `accessSettings` field; if you need to see this field,
|
||||||
|
add `showaccesssettings` to the command. This requires an additional Chat API call per chat space of type `SPACE`
|
||||||
|
to get the `accessSettings` field.
|
||||||
|
|
||||||
7.20.00
|
7.20.00
|
||||||
|
|
||||||
Added initial support for student groups in Google Classroom. This is a work in progress and requires Developer Preview membership.
|
Added initial support for student groups in Google Classroom. This is a work in progress and requires Developer Preview membership.
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||||
__version__ = '7.20.00'
|
__version__ = '7.20.01'
|
||||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||||
|
|
||||||
#pylint: disable=wrong-import-position
|
#pylint: disable=wrong-import-position
|
||||||
@@ -27004,31 +27004,33 @@ CHAT_SPACES_ADMIN_ORDERBY_CHOICE_MAP = {
|
|||||||
|
|
||||||
# gam [<UserTypeEntity>] show chatspaces
|
# gam [<UserTypeEntity>] show chatspaces
|
||||||
# [types <ChatSpaceTypeList>]
|
# [types <ChatSpaceTypeList>]
|
||||||
# [fields <ChatSpaceFieldNameList>]
|
# [fields <ChatSpaceFieldNameList>] [showaccesssettings]
|
||||||
# [formatjson]
|
# [formatjson]
|
||||||
# gam [<UserTypeEntity>] print chatspaces [todrive <ToDriveAttribute>*]
|
# gam [<UserTypeEntity>] print chatspaces [todrive <ToDriveAttribute>*]
|
||||||
# [types <ChatSpaceTypeList>]
|
# [types <ChatSpaceTypeList>]
|
||||||
# [fields <ChatSpaceFieldNameList>]
|
# [fields <ChatSpaceFieldNameList>] [showaccesssettings]
|
||||||
# [formatjson [quotechar <Character>]]
|
# [formatjson [quotechar <Character>]]
|
||||||
# gam <UserItem> show chatspaces asadmin
|
# gam <UserItem> show chatspaces asadmin
|
||||||
# [query <String>] [querytime<String> <Time>]
|
# [query <String>] [querytime<String> <Time>]
|
||||||
# [orderby <ChatSpaceAdminOrderByFieldName> [ascending|descending]]
|
# [orderby <ChatSpaceAdminOrderByFieldName> [ascending|descending]]
|
||||||
# [fields <ChatSpaceFieldNameList>]
|
# [fields <ChatSpaceFieldNameList>] [showaccesssettings]
|
||||||
# [formatjson]
|
# [formatjson]
|
||||||
# gam <UserItem> print chatspaces asadmin [todrive <ToDriveAttribute>*]
|
# gam <UserItem> print chatspaces asadmin [todrive <ToDriveAttribute>*]
|
||||||
# [query <String>] [querytime<String> <Time>]
|
# [query <String>] [querytime<String> <Time>]
|
||||||
# [orderby <ChatSpaceAdminOrderByFieldName> [ascending|descending]]
|
# [orderby <ChatSpaceAdminOrderByFieldName> [ascending|descending]]
|
||||||
# [fields <ChatSpaceFieldNameList>]
|
# [fields <ChatSpaceFieldNameList>] [showaccesssettings]
|
||||||
# [formatjson [quotechar <Character>]]
|
# [formatjson [quotechar <Character>]]
|
||||||
def printShowChatSpaces(users):
|
def printShowChatSpaces(users):
|
||||||
csvPF = CSVPrintFile(['User', 'name'] if not isinstance(users, list) else ['name']) if Act.csvFormat() else None
|
csvPF = CSVPrintFile(['User', 'name'] if not isinstance(users, list) else ['name']) if Act.csvFormat() else None
|
||||||
FJQC = FormatJSONQuoteChar(csvPF)
|
FJQC = FormatJSONQuoteChar(csvPF)
|
||||||
OBY = OrderBy(CHAT_SPACES_ADMIN_ORDERBY_CHOICE_MAP)
|
OBY = OrderBy(CHAT_SPACES_ADMIN_ORDERBY_CHOICE_MAP)
|
||||||
useAdminAccess, api, kwargsCS = _getChatAdminAccess(API.CHAT_SPACES_ADMIN, API.CHAT_SPACES)
|
useAdminAccess, api, kwargsCS = _getChatAdminAccess(API.CHAT_SPACES_ADMIN, API.CHAT_SPACES)
|
||||||
|
kwargsSAS = {'useAdminAccess': useAdminAccess}
|
||||||
fieldsList = []
|
fieldsList = []
|
||||||
queries = []
|
queries = []
|
||||||
queryTimes = {}
|
queryTimes = {}
|
||||||
pfilter = ''
|
pfilter = ''
|
||||||
|
showAccessSettings = False
|
||||||
if useAdminAccess:
|
if useAdminAccess:
|
||||||
function = 'search'
|
function = 'search'
|
||||||
queries = ['customer = "customers/my_customer" AND spaceType = "SPACE"']
|
queries = ['customer = "customers/my_customer" AND spaceType = "SPACE"']
|
||||||
@@ -27044,8 +27046,12 @@ def printShowChatSpaces(users):
|
|||||||
pass
|
pass
|
||||||
elif useAdminAccess and _getChatSpaceSearchParms(myarg, queries, queryTimes, OBY):
|
elif useAdminAccess and _getChatSpaceSearchParms(myarg, queries, queryTimes, OBY):
|
||||||
pass
|
pass
|
||||||
|
elif myarg == 'showaccesssettings':
|
||||||
|
showAccessSettings = True
|
||||||
else:
|
else:
|
||||||
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
||||||
|
if showAccessSettings and fieldsList:
|
||||||
|
fieldsList.extend(['name', 'spaceType'])
|
||||||
fields = getItemFieldsFromFieldsList('spaces', fieldsList)
|
fields = getItemFieldsFromFieldsList('spaces', fieldsList)
|
||||||
i, count, users = getEntityArgument(users)
|
i, count, users = getEntityArgument(users)
|
||||||
if useAdminAccess:
|
if useAdminAccess:
|
||||||
@@ -27070,6 +27076,17 @@ def printShowChatSpaces(users):
|
|||||||
GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION],
|
GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION],
|
||||||
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS,
|
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS,
|
||||||
fields=fields, pageSize=CHAT_PAGE_SIZE, **kwargsCS)
|
fields=fields, pageSize=CHAT_PAGE_SIZE, **kwargsCS)
|
||||||
|
if showAccessSettings:
|
||||||
|
for space in spaces:
|
||||||
|
if space['spaceType'] == 'SPACE':
|
||||||
|
try:
|
||||||
|
result = callGAPI(chat.spaces(), 'get',
|
||||||
|
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.INTERNAL_ERROR,
|
||||||
|
GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION],
|
||||||
|
name=space['name'], fields='accessSettings', **kwargsSAS)
|
||||||
|
space.update(result)
|
||||||
|
except (GAPI.notFound, GAPI.invalidArgument, GAPI.internalError, GAPI.permissionDenied, GAPI.failedPrecondition):
|
||||||
|
pass
|
||||||
except (GAPI.notFound, GAPI.invalidArgument, GAPI.internalError, GAPI.permissionDenied) as e:
|
except (GAPI.notFound, GAPI.invalidArgument, GAPI.internalError, GAPI.permissionDenied) as e:
|
||||||
exitIfChatNotConfigured(chat, kvList, str(e), i, count)
|
exitIfChatNotConfigured(chat, kvList, str(e), i, count)
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user