mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 04:41:35 +00:00
Added options restricted|(audience <String>) to gam <UserTypeEntity> create|update chatspace
This commit is contained in:
@@ -5895,6 +5895,7 @@ gam <UserTypeEntity> print focustime|outofoffice|workinglocation
|
|||||||
|
|
||||||
gam <UserTypeEntity> create chatspace
|
gam <UserTypeEntity> create chatspace
|
||||||
[type <ChatSpaceType>]
|
[type <ChatSpaceType>]
|
||||||
|
[restricted|(audience <String>)]
|
||||||
[externalusersrallowed <Boolean>]
|
[externalusersrallowed <Boolean>]
|
||||||
[members <UserTypeEntity>]
|
[members <UserTypeEntity>]
|
||||||
[displayname <String>]
|
[displayname <String>]
|
||||||
@@ -5903,10 +5904,11 @@ gam <UserTypeEntity> create chatspace
|
|||||||
[<ChatContent>]
|
[<ChatContent>]
|
||||||
[formatjson|returnidonly]
|
[formatjson|returnidonly]
|
||||||
gam <UserTypeEntity> update chatspace <ChatSpace>
|
gam <UserTypeEntity> update chatspace <ChatSpace>
|
||||||
|
[restricted|(audience <String>)]|
|
||||||
|
([displayname <String>]
|
||||||
[type space]
|
[type space]
|
||||||
[displayname <String>]
|
[description <String>] [guidelines|rules <String>]
|
||||||
[description <String>] [guidelines <String>]
|
[history <Boolean>])
|
||||||
[history <Boolean>]
|
|
||||||
[formatjson]
|
[formatjson]
|
||||||
gam <UserTypeEntity> delete chatspace <ChatSpace>
|
gam <UserTypeEntity> delete chatspace <ChatSpace>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
6.68.02
|
||||||
|
|
||||||
|
Added options `restricted|(audience <String>)` to `gam <UserTypeEntity> create|update chatspace` that
|
||||||
|
sets the access options for the chat space. These options are in Developer Preview and will not be generally available.
|
||||||
|
|
||||||
7.00.00
|
7.00.00
|
||||||
|
|
||||||
Merged GAM-Team version
|
Merged GAM-Team version
|
||||||
|
|||||||
@@ -24953,19 +24953,29 @@ def _showChatSpace(space, FJQC, i=0, count=0):
|
|||||||
showJSON(None, space, timeObjects=CHAT_SPACE_TIME_OBJECTS)
|
showJSON(None, space, timeObjects=CHAT_SPACE_TIME_OBJECTS)
|
||||||
Ind.Decrement()
|
Ind.Decrement()
|
||||||
|
|
||||||
def getChatSpaceParameters(myarg, body, typeChoicesMap):
|
def getChatSpaceParameters(myarg, body, typeChoicesMap, updateMask):
|
||||||
if myarg == 'displayname':
|
if myarg == 'displayname':
|
||||||
body['displayName'] = getString(Cmd.OB_STRING, minLen=0, maxLen=128)
|
body['displayName'] = getString(Cmd.OB_STRING, minLen=0, maxLen=128)
|
||||||
|
updateMask.add('displayName')
|
||||||
elif myarg == 'type':
|
elif myarg == 'type':
|
||||||
body['spaceType'] = getChoice(typeChoicesMap, mapChoice=True)
|
body['spaceType'] = getChoice(typeChoicesMap, mapChoice=True)
|
||||||
|
updateMask.add('spaceType')
|
||||||
elif myarg == 'description':
|
elif myarg == 'description':
|
||||||
body.setdefault('spaceDetails', {})
|
body.setdefault('spaceDetails', {})
|
||||||
body['spaceDetails']['description'] = getString(Cmd.OB_STRING, minLen=0, maxLen=150)
|
body['spaceDetails']['description'] = getString(Cmd.OB_STRING, minLen=0, maxLen=150)
|
||||||
|
updateMask.add('spaceDetails')
|
||||||
elif myarg in {'guidelines', 'rules'}:
|
elif myarg in {'guidelines', 'rules'}:
|
||||||
body.setdefault('spaceDetails', {})
|
body.setdefault('spaceDetails', {})
|
||||||
body['spaceDetails']['guidelines'] = getString(Cmd.OB_STRING, minLen=0, maxLen=5000)
|
body['spaceDetails']['guidelines'] = getString(Cmd.OB_STRING, minLen=0, maxLen=5000)
|
||||||
|
updateMask.add('spaceDetails')
|
||||||
elif myarg == 'history':
|
elif myarg == 'history':
|
||||||
body['spaceHistoryState'] = 'HISTORY_ON' if getBoolean() else 'HISTORY_OFF'
|
body['spaceHistoryState'] = 'HISTORY_ON' if getBoolean() else 'HISTORY_OFF'
|
||||||
|
updateMask.add('spaceHistoryState')
|
||||||
|
elif myarg in {'audience', 'restricted'}:
|
||||||
|
body['accessSettings']= {'audience': None}
|
||||||
|
if myarg == 'audience':
|
||||||
|
body['accessSettings']['audience'] = getString(Cmd.OB_STRING, minLen=1, maxLen=100)
|
||||||
|
updateMask.add('accessSettings.audience')
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
@@ -24993,6 +25003,7 @@ CHAT_SPACE_MIN_MAX_MEMBERS = {
|
|||||||
}
|
}
|
||||||
# gam <UserTypeEntity> create chatspace
|
# gam <UserTypeEntity> create chatspace
|
||||||
# [type <ChatSpaceType>]
|
# [type <ChatSpaceType>]
|
||||||
|
# [restricted|(audience <String>)]
|
||||||
# [externalusersallowed <Boolean>]
|
# [externalusersallowed <Boolean>]
|
||||||
# [members <UserTypeEntity>]
|
# [members <UserTypeEntity>]
|
||||||
# [displayname <String>]
|
# [displayname <String>]
|
||||||
@@ -25008,9 +25019,10 @@ def createChatSpace(users):
|
|||||||
members = []
|
members = []
|
||||||
tbody = {}
|
tbody = {}
|
||||||
returnIdOnly = False
|
returnIdOnly = False
|
||||||
|
updateMask = {}
|
||||||
while Cmd.ArgumentsRemaining():
|
while Cmd.ArgumentsRemaining():
|
||||||
myarg = getArgument()
|
myarg = getArgument()
|
||||||
if getChatSpaceParameters(myarg, body['space'], CHAT_SPACE_TYPE_MAP):
|
if getChatSpaceParameters(myarg, body['space'], CHAT_SPACE_TYPE_MAP, updateMask):
|
||||||
pass
|
pass
|
||||||
elif myarg == 'externalusersallowed':
|
elif myarg == 'externalusersallowed':
|
||||||
body['space']['externalUserAllowed'] = getBoolean()
|
body['space']['externalUserAllowed'] = getBoolean()
|
||||||
@@ -25092,25 +25104,31 @@ CHAT_UPDATE_SPACE_TYPE_MAP = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# gam <UserTypeEntity> update chatspace <ChatSpace>
|
# gam <UserTypeEntity> update chatspace <ChatSpace>
|
||||||
# [displayname <String>]
|
# [restricted|(audience <String>)]|
|
||||||
|
# ([displayname <String>]
|
||||||
# [type space]
|
# [type space]
|
||||||
# [description <String>] [guidelines|rules <String>]
|
# [description <String>] [guidelines|rules <String>]
|
||||||
# [history <Boolean>]
|
# [history <Boolean>])
|
||||||
# [formatjson]
|
# [formatjson]
|
||||||
def updateChatSpace(users):
|
def updateChatSpace(users):
|
||||||
FJQC = FormatJSONQuoteChar()
|
FJQC = FormatJSONQuoteChar()
|
||||||
name = None
|
name = None
|
||||||
body = {}
|
body = {}
|
||||||
|
updateMask = set()
|
||||||
while Cmd.ArgumentsRemaining():
|
while Cmd.ArgumentsRemaining():
|
||||||
myarg = getArgument()
|
myarg = getArgument()
|
||||||
if myarg == 'space' or myarg.startswith('spaces/') or myarg.startswith('space/'):
|
if myarg == 'space' or myarg.startswith('spaces/') or myarg.startswith('space/'):
|
||||||
name = getChatSpace(myarg)
|
name = getChatSpace(myarg)
|
||||||
elif getChatSpaceParameters(myarg, body, CHAT_UPDATE_SPACE_TYPE_MAP):
|
elif getChatSpaceParameters(myarg, body, CHAT_UPDATE_SPACE_TYPE_MAP, updateMask):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
FJQC.GetFormatJSON(myarg)
|
FJQC.GetFormatJSON(myarg)
|
||||||
if not name:
|
if not name:
|
||||||
missingArgumentExit('space')
|
missingArgumentExit('space')
|
||||||
|
if 'accessSettings.audience' in updateMask:
|
||||||
|
tempMask = updateMask-{'accessSettings.audience'}
|
||||||
|
if tempMask:
|
||||||
|
usageErrorExit(Msg.ARE_MUTUALLY_EXCLUSIVE.format('restricted/audience', 'displayname,type,description,guidelines,history'))
|
||||||
i, count, users = getEntityArgument(users)
|
i, count, users = getEntityArgument(users)
|
||||||
for user in users:
|
for user in users:
|
||||||
i += 1
|
i += 1
|
||||||
@@ -25120,8 +25138,7 @@ def updateChatSpace(users):
|
|||||||
try:
|
try:
|
||||||
space = callGAPI(chat.spaces(), 'patch',
|
space = callGAPI(chat.spaces(), 'patch',
|
||||||
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
|
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
|
||||||
name=name, updateMask=','.join(body.keys()),
|
name=name, updateMask=','.join(updateMask), body=body)
|
||||||
body=body)
|
|
||||||
if not FJQC.formatJSON:
|
if not FJQC.formatJSON:
|
||||||
entityActionPerformed(kvList, i, count)
|
entityActionPerformed(kvList, i, count)
|
||||||
Ind.Increment()
|
Ind.Increment()
|
||||||
@@ -25802,7 +25819,6 @@ CHAT_MESSAGE_REPLY_OPTION_MAP = {
|
|||||||
|
|
||||||
# gam [<UserTypeEntityu>] create chatmessage <ChatSpace>
|
# gam [<UserTypeEntityu>] create chatmessage <ChatSpace>
|
||||||
# <ChatContent>
|
# <ChatContent>
|
||||||
# (text <String>)|(textfile <FileName> [charset <CharSet>])
|
|
||||||
# [messageId <ChatMessageID>]
|
# [messageId <ChatMessageID>]
|
||||||
# [(thread <ChatThread>)|(threadkey <String>) [replyoption fail|fallbacktonew]]
|
# [(thread <ChatThread>)|(threadkey <String>) [replyoption fail|fallbacktonew]]
|
||||||
# [returnidonly]
|
# [returnidonly]
|
||||||
@@ -41081,7 +41097,7 @@ def getUserAttributes(cd, updateCmd, noUid=False):
|
|||||||
parameters['immutableOUs'] = set(getEntityList(Cmd.OB_ORGUNIT_ENTITY, shlexSplit=True))
|
parameters['immutableOUs'] = set(getEntityList(Cmd.OB_ORGUNIT_ENTITY, shlexSplit=True))
|
||||||
elif not updateCmd and myarg == 'addnumericsuffixonduplicate':
|
elif not updateCmd and myarg == 'addnumericsuffixonduplicate':
|
||||||
parameters['addNumericSuffixOnDuplicate'] = getInteger(minVal=0, default=0)
|
parameters['addNumericSuffixOnDuplicate'] = getInteger(minVal=0, default=0)
|
||||||
elif not updateCmd and myarg in {'license', 'licence'}:
|
elif not updateCmd and myarg in {'license', 'licence', 'licenses', 'licences'}:
|
||||||
if parameters['lic'] is None:
|
if parameters['lic'] is None:
|
||||||
parameters['lic'] = buildGAPIObject(API.LICENSING)
|
parameters['lic'] = buildGAPIObject(API.LICENSING)
|
||||||
parameters[LICENSE_PRODUCT_SKUIDS] = getGoogleSKUList(allowUnknownProduct=True)
|
parameters[LICENSE_PRODUCT_SKUIDS] = getGoogleSKUList(allowUnknownProduct=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user