Compare commits

..

8 Commits

Author SHA1 Message Date
Ross Scroggs
03148a6ae8 Added initial support for Meet API v2beta
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-18 14:25:35 -08:00
Ross Scroggs
96acd40692 Increment scratch_counter to flush out bug
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-18 12:23:11 -08:00
Ross Scroggs
3004da5ad7 Create meet-v2beta.json 2025-02-18 10:47:03 -08:00
Ross Scroggs
bd699e2b31 Added initial support for Meet API v2beta 2025-02-18 10:40:44 -08:00
Ross Scroggs
0d9e35d013 Updated gam print group-members|cigroup-members to include the email column when fields <MembersFieldNameList> did not include email.
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-16 10:35:35 -08:00
Ross Scroggs
af43db44ed Added option minimal|basic|full to gam print|show cigroup-members
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-15 11:11:42 -08:00
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
8 changed files with 1329 additions and 50 deletions

View File

@@ -18,7 +18,7 @@ defaults:
working-directory: src
env:
SCRATCH_COUNTER: 9
SCRATCH_COUNTER: 10
OPENSSL_CONFIG_OPTS: no-fips --api=3.0.0
OPENSSL_INSTALL_PATH: ${{ github.workspace }}/bin/ssl
OPENSSL_SOURCE_PATH: ${{ github.workspace }}/src/openssl

View File

@@ -3997,13 +3997,14 @@ gam print cigroups [todrive <ToDriveAttribute>*]
<CIGroupMembersFieldName> ::=
createtime
email|useremail|
expiretime|
memberkey|
name|
role|
type|
updatetime|
useremail
updatetime
<CIGroupMembersFieldNameList> ::= "<CIGroupMembersFieldName>(,<CIGroupMembersFieldName>)*"
gam <UserTypeEntity> info cimember <GroupEntity>
@@ -4017,16 +4018,19 @@ gam print cigroup-members [todrive <ToDriveAttribute>*]
[types <CIGroupMemberTypeList>]
[memberemaildisplaypattern|memberemailskippattern <RegularExpression>]
<CIGroupMembersFieldName>* [fields <CIGroupMembersFieldNameList>]
[(recursive [noduplicates])includederivedmembership] [nogroupeemail]
[minimal|basic|full]
[(recursive [noduplicates]) | includederivedmembership] [nogroupemail]
[formatjson [quotechar <Character>]]
gam show cigroup-members
[(cimember|ciowner <UserItem>)|(cigroup <GroupItem>)|(select <GroupEntity>)]
[showownedby <UserItem>]
[emailmatchpattern [not] <RegularExpression>] [namematchpattern [not] <RegularExpression>]
[descriptionmatchpattern [not] <RegularExpression>]
[roles <GroupRoleList>] [members] [managers] [owners] [depth <Number>]
[roles <GroupRoleList>] [members] [managers] [owners]
[types <CIGroupMemberTypeList>]
[memberemaildisplaypattern|memberemailskippattern <RegularExpression>]
[minimal|basic|full]
[(depth <Number>) | includederivedmembership]
# Cloud Identity Devices
@@ -7878,7 +7882,16 @@ gam <UserTypeEntity> show lookerstudiopermissions
<MeetSpaceName> ::= spaces/<String> | <String>
<MeetSpaceOptions> ::=
accesstype open|trusted|restricted |
entrypointaccess all|creatorapponly
entrypointaccess all|creatorapponly |
moderation <Boolean> |
chatrestriction hostsonly|norestriction |
reactionrestriction hostsonly|norestriction |
presentrestriction hostsonly|norestriction |
defaultjoinasviewer <Boolean> |
firstjoiner hostsonly|anyone |
recording <Boolean> |
transcription <Boolean> |
smartnotes <Boolean>
gam <UserTypeEntity> create meetspace
<MeetSpaceOptions>*

View File

@@ -1,3 +1,44 @@
7.04.05
Added initial support for Meet API v2beta; you must be in the Developer Preview program
for this to be effective.
* https://developers.google.com/meet/api/guides/beta/configuration-beta#auto-artifacts
Added `meet_v2_beta` Boolean variable to `gam.cfg`. When this variable is true,
the following options are added to `<MeetSpaceOptions>` used in `gam <UserTypeEntity> create|update meetspace`.
```
moderation <Boolean> |
chatrestriction hostsonly|norestriction |
reactionrestriction hostsonly|norestriction |
presentrestriction hostsonly|norestriction |
defaultjoinasviewer <Boolean> |
firstjoiner hostsonly|anyone |
recording <Boolean> |
transcription <Boolean> |
smartnotes <Boolean>
```
This isn't called beta for nothing, I have found problems and reported them.
7.04.04
Updated `gam print group-members|cigroup-members` to include the `email` column
when `fields <MembersFieldNameList>` did not include `email`.
7.04.03
Added option `minimal|basic|full` to `gam print cigroup-members`:
* `minimal` - Fields displayed: group, id, role, email
* `basic` - Fields displayed: group, type, id, role, email
* `full` - Fields displayed: group, type, id, role, email, createTime, updateTime; this is the default
Added option `minimal|basic|full` to `gam show cigroup-members`:
* `minimal` - Fields displayed: role, email
* `basic` - Fields displayed: type, role, email
* `full` - Fields displayed: type, role, email, createTime, updateTime; this is the default
Upgraded `gam print cigroup-members ... recursive` to display sub-group email addresses rather than IDs.
7.04.02
Improved output formatting for the following commands:

View File

@@ -31,6 +31,7 @@ for pkg in GAM_VER_LIBS:
datas += [('gam/cbcm-v1.1beta1.json', '.')]
datas += [('gam/contactdelegation-v1.json', '.')]
datas += [('gam/datastudio-v1.json', '.')]
datas += [('gam/meet-v2beta.json', '.')]
datas += [('gam/serviceaccountlookup-v1.json', '.')]
datas += [('cacerts.pem', '.')]
hiddenimports = [

View File

@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
"""
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.04.02'
__version__ = '7.04.05'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
#pylint: disable=wrong-import-position
@@ -5571,6 +5571,8 @@ def buildGAPIServiceObject(api, user, i=0, count=0, displayError=True):
userEmail = getSaUser(user)
httpObj = getHttpObj(cache=GM.Globals[GM.CACHE_DIR])
service = getService(api, httpObj)
if api == API.MEET_BETA:
api = API.MEET
credentials = getSvcAcctCredentials(api, userEmail)
request = transportCreateRequest(httpObj)
triesLimit = 3
@@ -5981,6 +5983,8 @@ def getCIGroupTransitiveMemberRoleFixType(groupName, tmember):
member['type'] = Ent.TYPE_USER if not tid.endswith('.iam.gserviceaccount.com') else Ent.TYPE_SERVICE_ACCOUNT
elif ttype == 'groups':
member['type'] = Ent.TYPE_GROUP
elif tid.startswith('cbcm-browser.'):
member['type'] = Ent.TYPE_CBCM_BROWSER
else:
member['type'] = Ent.TYPE_OTHER
else:
@@ -7322,12 +7326,6 @@ def _getRawFields(requiredField=None):
return rawFields
return f'{requiredField},{rawFields}'
def _addInitialField(fieldsList, initialField):
if isinstance(initialField, list):
fieldsList.extend(initialField)
else:
fieldsList.append(initialField)
def CheckInputRowFilterHeaders(titlesList, rowFilter, rowDropFilter):
status = True
for filterVal in rowFilter:
@@ -7742,6 +7740,12 @@ def RowFilterMatch(row, titlesList, rowFilter, rowFilterModeAll, rowDropFilter,
# }
# fieldsList is the list of API fields
def getFieldsList(myarg, fieldsChoiceMap, fieldsList, initialField=None, fieldsArg='fields', onlyFieldsArg=False):
def addInitialField():
if isinstance(initialField, list):
fieldsList.extend(initialField)
else:
fieldsList.append(initialField)
def addMappedFields(mappedFields):
if isinstance(mappedFields, list):
fieldsList.extend(mappedFields)
@@ -7750,11 +7754,11 @@ def getFieldsList(myarg, fieldsChoiceMap, fieldsList, initialField=None, fieldsA
if not onlyFieldsArg and myarg in fieldsChoiceMap:
if not fieldsList and initialField is not None:
_addInitialField(fieldsList, initialField)
addInitialField()
addMappedFields(fieldsChoiceMap[myarg])
elif myarg == fieldsArg:
if not fieldsList and initialField is not None:
_addInitialField(fieldsList, initialField)
addInitialField()
for field in _getFieldsList():
if field in fieldsChoiceMap:
addMappedFields(fieldsChoiceMap[field])
@@ -7931,14 +7935,21 @@ class CSVPrintFile():
fieldsList.append(fields)
self.AddTitles(fields.replace('.', GC.Values[GC.CSV_OUTPUT_SUBFIELD_DELIMITER]))
def addInitialField(self, initialField, fieldsChoiceMap, fieldsList):
if isinstance(initialField, list):
for field in initialField:
self.AddField(field, fieldsChoiceMap, fieldsList)
else:
self.AddField(initialField, fieldsChoiceMap, fieldsList)
def GetFieldsListTitles(self, fieldName, fieldsChoiceMap, fieldsList, initialField=None):
if fieldName in fieldsChoiceMap:
if not fieldsList and initialField is not None:
_addInitialField(fieldsList, initialField)
self.addInitialField(initialField, fieldsChoiceMap, fieldsList)
self.AddField(fieldName, fieldsChoiceMap, fieldsList)
elif fieldName == 'fields':
if not fieldsList and initialField is not None:
_addInitialField(fieldsList, initialField)
self.addInitialField(initialField, fieldsChoiceMap, fieldsList)
for field in _getFieldsList():
if field in fieldsChoiceMap:
self.AddField(field, fieldsChoiceMap, fieldsList)
@@ -27479,6 +27490,8 @@ def printShowChatEvents(users):
csvPF.writeCSVfile('Chat Events')
def buildMeetServiceObject(api=API.MEET, user=None, i=0, count=0, entityTypeList=None):
if GC.Values[GC.MEET_V2_BETA]:
api = API.MEET_BETA
user, meet = buildGAPIServiceObject(api, user, i, count)
kvList = [Ent.USER, user]
if entityTypeList is not None:
@@ -27502,7 +27515,10 @@ MEET_SPACE_OPTIONS_MAP = {
'reactionrestriction': 'reactionRestriction',
'presentrestriction': 'presentRestriction',
'defaultjoinasviewer': 'defaultJoinAsViewerType',
'firstjoiner': 'firstJoinerType'
'firstjoiner': 'firstJoinerType',
'autorecording': 'recordingConfig',
'autosmartnotes': 'smartNotesConfig',
'autotranscription': 'transcriptionConfig',
}
MEET_SPACE_ACCESSTYPE_CHOICES = {'open', 'trusted', 'restricted'}
@@ -27521,6 +27537,12 @@ MEET_SPACE_FIRSTJOINERTYPE_CHOICES_MAP = {
'anyone': 'ANYONE'
}
MEET_SPACE_ARTIFACT_SUB_OPTIONS = {
'recordingConfig': 'autoRecordingGeneration',
'smartNotesConfig': 'autoSmartNotesGeneration',
'transcriptionConfig': 'autoTranscriptionGeneration'
}
# [accesstype open|trusted|restricted]
# [entrypointaccess all|creatorapponly]
# [moderation <Boolean>]
@@ -27529,7 +27551,10 @@ MEET_SPACE_FIRSTJOINERTYPE_CHOICES_MAP = {
# [presentrestriction hostsonly|norestriction]
# [defaultjoinasviewer <Boolean>]
# [firstjoiner hostsonly|anyone]
def _getMeetSpaceParameters(myarg, body, updateMask):
# [autorecording <Boolean>]
# [autosmartnotes <Boolean>]
# [autotranscription <Boolean>]
def _getMeetSpaceParameters(myarg, body):
option = MEET_SPACE_OPTIONS_MAP.get(myarg, None)
if option is None:
return False
@@ -27539,15 +27564,17 @@ def _getMeetSpaceParameters(myarg, body, updateMask):
body['config'][option] = getChoice(MEET_SPACE_ENTRYPOINTACCESS_CHOICES_MAP, mapChoice=True)
elif option == 'moderation':
body['config'][option] = 'ON' if getBoolean() else 'OFF'
elif option in {'chatrestriction', 'reactionrestriction', 'presentrestriction'}:
body['config'].setdefault('moderationRestictions', {})
elif option in {'chatRestriction', 'reactionRestriction', 'presentRestriction'}:
body['config'].setdefault('moderationRestrictions', {})
body['config']['moderationRestrictions'][option] = getChoice(MEET_SPACE_RESTRICTIONS_CHOICES_MAP, mapChoice=True)
option = f'moderationRestrictions.{option}'
elif option == 'defaultJoinAsViewerType':
body['config'][option] = 'ON' if getBoolean() else 'OFF'
elif option == 'firstJoinerType':
body['config'][option] = getChoice(MEET_SPACE_FIRSTJOINERTYPE_CHOICES_MAP, mapChoice=True)
updateMask.append(f'config.{option}')
elif option in {'recordingConfig', 'transcriptionConfig', 'smartNotesConfig'}:
body['config'].setdefault('artifactConfig', {})
body['config']['artifactConfig'].setdefault(option, {})
body['config']['artifactConfig'][option][MEET_SPACE_ARTIFACT_SUB_OPTIONS[option]] = 'ON' if getBoolean() else 'OFF'
return True
# gam <UserTypeEntity> create meetspace
@@ -27562,10 +27589,9 @@ def createMeetSpace(users):
# 'firstJoinerType': 'ANYONE',
}}
returnIdOnly = False
updateMask = []
while Cmd.ArgumentsRemaining():
myarg = getArgument()
if _getMeetSpaceParameters(myarg, body, updateMask):
if _getMeetSpaceParameters(myarg, body):
pass
elif myarg == 'returnidonly':
returnIdOnly = True
@@ -27600,12 +27626,11 @@ def updateMeetSpace(users):
FJQC = FormatJSONQuoteChar()
name = None
body = {'config': {}}
updateMask = []
while Cmd.ArgumentsRemaining():
myarg = getArgument()
if (myarg == 'space' or myarg.startswith('spaces/') or myarg.startswith('space/')):
name = getSpaceName(myarg)
elif _getMeetSpaceParameters(myarg, body, updateMask):
elif _getMeetSpaceParameters(myarg, body):
pass
else:
FJQC.GetFormatJSON(myarg)
@@ -27620,7 +27645,7 @@ def updateMeetSpace(users):
try:
space = callGAPI(meet.spaces(), 'patch',
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
name=name, updateMask=','.join(updateMask), body=body)
name=name, updateMask='', body=body)
if not FJQC.formatJSON:
entityActionPerformed(kvList, i, count)
Ind.Increment()
@@ -33959,6 +33984,8 @@ def infoGroupMembers(entityList, ciGroupsAPI=False):
printKeyValueList(['type', result['type']])
for field in ['createTime', 'updateTime']:
printKeyValueList([field, formatLocalTime(result[field])])
if 'deliverySetting' in result:
printKeyValueList(['deliverySetting', result['deliverySetting']])
Ind.Decrement()
except (GAPI.groupNotFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.invalid, GAPI.forbidden) as e:
entityActionFailedWarning([entityType, groupKey], str(e), j, jcount)
@@ -34202,7 +34229,7 @@ def doPrintGroupMembers():
pass
elif getMemberMatchOptions(myarg, memberOptions):
pass
elif csvPF.GetFieldsListTitles(myarg, GROUPMEMBERS_FIELDS_CHOICE_MAP, fieldsList):
elif csvPF.GetFieldsListTitles(myarg, GROUPMEMBERS_FIELDS_CHOICE_MAP, fieldsList, initialField='email'):
pass
elif myarg == 'membernames':
memberOptions[MEMBEROPTION_MEMBERNAMES] = True
@@ -36121,8 +36148,9 @@ 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, groupEmail, kwargs):
nameToPrint = groupEmail if groupEmail else groupName
printGettingAllEntityItemsForWhom(memberRoles if memberRoles else Ent.ROLE_MANAGER_MEMBER_OWNER, nameToPrint, i, count)
validRoles = _getCIRoleVerification(memberRoles)
if memberOptions[MEMBEROPTION_INCLUDEDERIVEDMEMBERSHIP]:
groupMembers = []
@@ -36137,12 +36165,11 @@ 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, **kwargs)
except (GAPI.resourceNotFound, GAPI.domainNotFound, GAPI.domainCannotUseApis,
GAPI.forbidden, GAPI.badRequest, GAPI.invalid, GAPI.invalidArgument, GAPI.systemError,
GAPI.permissionDenied, GAPI.serviceNotAvailable):
entityUnknownWarning(Ent.CLOUD_IDENTITY_GROUP, groupName, i, count)
entityUnknownWarning(Ent.CLOUD_IDENTITY_GROUP, nameToPrint, i, count)
return
checkCategory = memberDisplayOptions['showCategory']
if not memberOptions[MEMBEROPTION_RECURSIVE]:
@@ -36176,7 +36203,7 @@ def getCIGroupMembers(ci, groupName, memberRoles, membersList, membersSet, i, co
memberName not in membersSet):
membersSet.add(memberName)
member['level'] = level
member['subgroup'] = groupName
member['subgroup'] = nameToPrint
membersList.append(member)
else:
if memberName not in membersSet:
@@ -36185,37 +36212,41 @@ def getCIGroupMembers(ci, groupName, memberRoles, membersList, membersSet, i, co
checkCIMemberMatch(member, memberOptions) and
(not checkCategory or _checkCIMemberCategory(member, memberDisplayOptions))):
member['level'] = level
member['subgroup'] = groupName
member['subgroup'] = nameToPrint
membersList.append(member)
_, gname = member['name'].rsplit('/', 1)
groupMemberList.append(f'groups/{gname}')
groupMemberList.append((f'groups/{gname}', memberName))
for member in groupMemberList:
getCIGroupMembers(ci, member, memberRoles, membersList, membersSet, i, count,
memberOptions, memberDisplayOptions, level+1, typesSet)
getCIGroupMembers(ci, member[0], memberRoles, membersList, membersSet, i, count,
memberOptions, memberDisplayOptions, level+1, typesSet, member[1], kwargs)
else:
for member in groupMembers:
getCIGroupMemberRoleFixType(member)
memberName = member.get('preferredMemberKey', {}).get('id', '')
if member['type'] != Ent.TYPE_GROUP:
if (member['type'] in typesSet and
checkCIMemberMatch(member, memberOptions) and
_checkMemberRole(member, validRoles) and
(not checkCategory or _checkCIMemberCategory(member, memberDisplayOptions))):
member['level'] = level
member['subgroup'] = groupName
member['subgroup'] = nameToPrint
membersList.append(member)
else:
if (member['type'] in typesSet and
checkCIMemberMatch(member, memberOptions) and
(not checkCategory or _checkCIMemberCategory(member, memberDisplayOptions))):
member['level'] = level
member['subgroup'] = groupName
member['subgroup'] = nameToPrint
membersList.append(member)
_, gname = member['name'].rsplit('/', 1)
getCIGroupMembers(ci, f'groups/{gname}', memberRoles, membersList, membersSet, i, count,
memberOptions, memberDisplayOptions, level+1, typesSet)
memberOptions, memberDisplayOptions, level+1, typesSet, memberName, kwargs)
CIGROUPMEMBERS_FIELDS_CHOICE_MAP = {
'createtime': 'createTime',
'delivery': 'deliverySetting',
'deliverysettings': 'deliverySetting',
'email': 'preferredMemberKey',
'expiretime': 'expireTime',
'id': 'name',
'memberkey': 'preferredMemberKey',
@@ -36236,6 +36267,16 @@ CIGROUPMEMBERS_SORT_FIELDS = [
]
CIGROUPMEMBERS_TIME_OBJECTS = {'createTime', 'updateTime', 'expireTime'}
def _getCIListGroupMembersArgs(listView):
if listView == 'full':
return {'view': 'FULL', 'pageSize': GC.Values[GC.MEMBER_MAX_RESULTS_CI_FULL],
'fields': 'nextPageToken,memberships(*)'}
if listView == 'basic':
return {'view': 'FULL', 'pageSize': GC.Values[GC.MEMBER_MAX_RESULTS_CI_FULL],
'fields': 'nextPageToken,memberships(name,preferredMemberKey,roles,type)'}
return {'view': 'BASIC', 'pageSize': GC.Values[GC.MEMBER_MAX_RESULTS_CI_BASIC],
'fields': 'nextPageToken,memberships(*)'}
# gam print cigroup-members [todrive <ToDriveAttribute>*]
# [(cimember|ciowner <UserItem>)|(cigroup <GroupItem>)|(select <GroupEntity>)]
# [showownedby <UserItem>]
@@ -36245,6 +36286,7 @@ CIGROUPMEMBERS_TIME_OBJECTS = {'createTime', 'updateTime', 'expireTime'}
# [types <CIGroupMemberTypeList>]
# [memberemaildisplaypattern|memberemailskippattern <RegularExpression>]
# <CIGroupMembersFieldName>* [fields <CIGroupMembersFieldNameList>]
# [minimal|basic|full]
# [(recursive [noduplicates])|includederivedmembership] [nogroupeemail]
# [formatjson [quotechar <Character>]]
def doPrintCIGroupMembers():
@@ -36262,6 +36304,7 @@ def doPrintCIGroupMembers():
rolesSet = set()
typesSet = set()
matchPatterns = {}
listView = 'full'
while Cmd.ArgumentsRemaining():
myarg = getArgument()
if myarg == 'todrive':
@@ -36290,7 +36333,7 @@ def doPrintCIGroupMembers():
pass
elif getMemberMatchOptions(myarg, memberOptions):
pass
elif getFieldsList(myarg, CIGROUPMEMBERS_FIELDS_CHOICE_MAP, fieldsList):
elif getFieldsList(myarg, CIGROUPMEMBERS_FIELDS_CHOICE_MAP, fieldsList, initialField='preferredMemberKey'):
pass
elif myarg == 'noduplicates':
memberOptions[MEMBEROPTION_NODUPLICATES] = True
@@ -36302,8 +36345,12 @@ def doPrintCIGroupMembers():
memberOptions[MEMBEROPTION_RECURSIVE] = False
elif myarg == 'nogroupemail':
groupColumn = False
elif myarg in {'minimal', 'basic', 'full'}:
listView = myarg
else:
FJQC.GetFormatJSONQuoteChar(myarg, False)
if listView == 'minimal' and memberOptions[MEMBEROPTION_RECURSIVE]:
usageErrorExit(Msg.ARE_MUTUALLY_EXCLUSIVE.format('minimal', 'recursive'))
if not typesSet:
typesSet = {Ent.TYPE_USER} if memberOptions[MEMBEROPTION_RECURSIVE] else ALL_CIGROUP_MEMBER_TYPES
fields = ','.join(set(groupFieldsLists['ci']))
@@ -36330,6 +36377,7 @@ def doPrintCIGroupMembers():
if showOwnedBy:
getRolesSet.add(Ent.ROLE_OWNER)
getRoles = ','.join(sorted(getRolesSet))
kwargs = _getCIListGroupMembersArgs(listView)
level = 0
i = 0
count = len(entityList)
@@ -36356,7 +36404,7 @@ def doPrintCIGroupMembers():
membersList = []
membersSet = set()
getCIGroupMembers(ci, groupEntity['name'], getRoles, membersList, membersSet, i, count,
memberOptions, memberDisplayOptions, level, typesSet)
memberOptions, memberDisplayOptions, level, typesSet, groupEmail, kwargs)
if showOwnedBy and not checkCIGroupShowOwnedBy(showOwnedBy, membersList):
continue
for member in membersList:
@@ -36374,6 +36422,8 @@ def doPrintCIGroupMembers():
row['subgroup'] = member['subgroup']
if memberDisplayOptions['showCategory']:
row['category'] = member['category']
if listView == 'minimal':
dmember.pop('type', None)
mapCIGroupMemberFieldNames(dmember)
if not FJQC.formatJSON:
csvPF.WriteRowTitles(flattenJSON(dmember, flattened=row, timeObjects=CIGROUPMEMBERS_TIME_OBJECTS))
@@ -36403,17 +36453,19 @@ def doPrintCIGroupMembers():
# [showownedby <UserItem>]
# [emailmatchpattern [not] <RegularExpression>] [namematchpattern [not] <RegularExpression>]
# [descriptionmatchpattern [not] <RegularExpression>]
# [roles <GroupRoleList>] [members] [managers] [owners] [depth <Number>]
# [roles <GroupRoleList>] [members] [managers] [owners]
# [internal] [internaldomains <DomainList>] [external]
# [types <CIGroupMemberTypeList>]
# [memberemaildisplaypattern|memberemailskippattern <RegularExpression>]
# [includederivedmembership]
# [minimal|basic|full]
# [(depth <Number>) | includederivedmembership]
def doShowCIGroupMembers():
def _roleOrder(key):
return {Ent.ROLE_OWNER: 0, Ent.ROLE_MANAGER: 1, Ent.ROLE_MEMBER: 2}.get(key, 3)
def _typeOrder(key):
return {Ent.TYPE_CUSTOMER: 0, Ent.TYPE_USER: 1, Ent.TYPE_GROUP: 2, Ent.TYPE_EXTERNAL: 3}.get(key, 4)
return {Ent.TYPE_CUSTOMER: 0, Ent.TYPE_USER: 1, Ent.TYPE_GROUP: 2,
Ent.TYPE_CBCM_BROWSER: 3, Ent.TYPE_OTHER: 4, Ent.TYPE_EXTERNAL: 5}.get(key, 6)
def _showGroup(groupName, groupEmail, depth):
if includeDerivedMembership:
@@ -36424,8 +36476,7 @@ def doShowCIGroupMembers():
try:
membersList = callGAPIpages(ci.groups().memberships(), 'list', 'memberships',
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, **kwargs)
for member in membersList:
getCIGroupMemberRoleFixType(member)
except (GAPI.resourceNotFound, GAPI.domainNotFound, GAPI.domainCannotUseApis,
@@ -36446,7 +36497,10 @@ def doShowCIGroupMembers():
if (_checkMemberRole(member, rolesSet) and
member['type'] in typesSet and
checkCIMemberMatch(member, memberOptions)):
memberDetails = f'{member.get("role", Ent.ROLE_MEMBER)}, {member["type"]}, {member["preferredMemberKey"]["id"]}'
if listView != 'minimal':
memberDetails = f'{member.get("role", Ent.ROLE_MEMBER)}, {member["type"]}, {member["preferredMemberKey"]["id"]}'
else:
memberDetails = f'{member.get("role", Ent.ROLE_MEMBER)}, {member["preferredMemberKey"]["id"]}'
if checkCategory:
memberDetails += f', {member["category"]}'
for field in ['createTime', 'updateTime', 'expireTime']:
@@ -36471,6 +36525,7 @@ def doShowCIGroupMembers():
matchPatterns = {}
maxdepth = -1
includeDerivedMembership = False
listView = 'full'
while Cmd.ArgumentsRemaining():
myarg = getArgument()
if myarg == 'showownedby':
@@ -36501,6 +36556,8 @@ def doShowCIGroupMembers():
maxdepth = getInteger(minVal=-1)
elif myarg == 'includederivedmembership':
includeDerivedMembership = True
elif myarg in {'minimal', 'basic', 'full'}:
listView = myarg
else:
unknownArgumentExit()
if not rolesSet:
@@ -36510,6 +36567,7 @@ def doShowCIGroupMembers():
checkCategory = memberDisplayOptions['showCategory']
fields = ','.join(set(groupFieldsLists['ci']))
entityList = getCIGroupMembersEntityList(ci, entityList, query, subTitle, matchPatterns, groupFieldsLists['ci'], None)
kwargs = _getCIListGroupMembersArgs(listView)
i = 0
count = len(entityList)
for group in entityList:

View File

@@ -75,6 +75,7 @@ KEEP = 'keep'
LICENSING = 'licensing'
LOOKERSTUDIO = 'datastudio'
MEET = 'meet'
MEET_BETA = 'meetbeta'
OAUTH2 = 'oauth2'
ORGPOLICY = 'orgpolicy'
PEOPLE = 'people'
@@ -251,6 +252,7 @@ _INFO = {
LICENSING: {'name': 'License Manager API', 'version': 'v1', 'v2discovery': True},
LOOKERSTUDIO: {'name': 'Looker Studio API', 'version': 'v1', 'v2discovery': True, 'localjson': True},
MEET: {'name': 'Meet API', 'version': 'v2', 'v2discovery': True},
MEET_BETA: {'name': 'Meet API', 'version': 'v2beta', 'v2discovery': True, 'localjson': True, 'mappedAPI': MEET},
OAUTH2: {'name': 'OAuth2 API', 'version': 'v2', 'v2discovery': False},
ORGPOLICY: {'name': 'Organization Policy API', 'version': 'v2', 'v2discovery': True},
PEOPLE: {'name': 'People API', 'version': 'v1', 'v2discovery': True},

View File

@@ -177,8 +177,14 @@ INTER_BATCH_WAIT = 'inter_batch_wait'
LICENSE_MAX_RESULTS = 'license_max_results'
# License SKUs to process
LICENSE_SKUS = 'license_skus'
# Use Meet V2 beta
MEET_V2_BETA = 'meet_v2_beta'
# 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
@@ -384,7 +390,10 @@ Defaults = {
INTER_BATCH_WAIT: '0',
LICENSE_MAX_RESULTS: '100',
LICENSE_SKUS: '',
MEET_V2_BETA: FALSE,
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',
@@ -549,7 +558,10 @@ VAR_INFO = {
INTER_BATCH_WAIT: {VAR_TYPE: TYPE_FLOAT, VAR_LIMITS: (0.0, 60.0)},
LICENSE_MAX_RESULTS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (10, 1000)},
LICENSE_SKUS: {VAR_TYPE: TYPE_STRING, VAR_LIMITS: (0, None)},
MEET_V2_BETA: {VAR_TYPE: TYPE_BOOLEAN},
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)},

1152
src/gam/meet-v2beta.json Normal file

File diff suppressed because it is too large Load Diff