Updated gam info user ... locations formatjson to include the buildingName field in the locations entries.

This commit is contained in:
Ross Scroggs
2024-02-14 08:34:39 -08:00
parent 70640c1ddb
commit d1e87df2df
6 changed files with 33 additions and 16 deletions

View File

@@ -41128,6 +41128,8 @@ def getUserAttributes(cd, updateCmd, noUid=False):
body['name'].pop('fullName')
if 'sshPublicKeys' in body and 'fingerprint' in body['sshPublicKeys']:
body['sshPublicKeys'].pop('fingerprint')
for location in body.get('locations', []):
location.pop('buildingName', None)
elif myarg == 'employeeid':
entry = {'type': 'organization', 'value': getString(Cmd.OB_STRING, minLen=0)}
appendItemToBodyList(body, 'externalIds', entry, 'value')
@@ -42324,6 +42326,9 @@ def infoUsers(entityList):
addJsonGroupParents(groupParents, group, groupEmail)
if getLicenses:
user['licenses'] = [SKU.formatSKUIdDisplayName(u_license) for u_license in licenses]
if getBuildingNames:
for location in user.get('locations', []):
location['buildingName'] = _getBuildingNameById(cd, location.get('buildingId', ''))
if not getAliases:
user.pop('aliases', None)
user.pop('nonEditableAliases', None)