diff --git a/src/GamCommands.txt b/src/GamCommands.txt index 7b37f0ac..6ed926de 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -3072,6 +3072,10 @@ gam show orgtree [fromparent ] [batchsuborgs []] userdefined ::= "(,)*" +gam delete domaincontacts +gam info domaincontacts + [allfields|(fields )] + [formatjson] gam print domaincontacts [todrive *] [query ] [mergesources ] @@ -3083,7 +3087,6 @@ gam show domaincontacts [allfields|(fields )] [formatjson] -gam delete domainprofiles gam info domainprofiles [allfields|(fields )] [formatjson] diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 97212157..d7e292d7 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -1,8 +1,8 @@ 6.03.18 -Added commands to delete specific domain profiles and user's contacts using the People API. +Added commands to delete specific domain contacts and user's contacts using the People API. ``` -gam delete domainprofiles +gam delete domaincontacts gam delete peoplecontacts ``` * https://github.com/taers232c/GAMADV-XTD3/wiki/People diff --git a/src/gam/__init__.py b/src/gam/__init__.py index f1143660..e18d27c1 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -33047,11 +33047,11 @@ def _deletePeople(users, entityType): ClientAPIAccessDeniedExit() Ind.Decrement() -# gam delete domainprofiles | -def doDeletePeopleDomainProfiles(): +# gam delete domaincontacts +def doDeletePeopleDomainContacts(): _deletePeople([GC.Values[GC.DOMAIN]], Ent.DOMAIN) -# gam delete peoplecontacts | +# gam delete peoplecontacts def deletePeopleContacts(users): _deletePeople(users, Ent.USER) @@ -33181,6 +33181,8 @@ def printShowPeopleProfile(users): PEOPLE_READ_SOURCES_CHOICE_MAP = { 'contact': 'READ_SOURCE_TYPE_CONTACT', 'contacts': 'READ_SOURCE_TYPE_CONTACT', + 'domaincontact': 'READ_SOURCE_TYPE_DOMAIN_CONTACT', + 'domaincontacts': 'READ_SOURCE_TYPE_DOMAIN_CONTACT', 'profile': 'READ_SOURCE_TYPE_PROFILE', 'profiles': 'READ_SOURCE_TYPE_PROFILE' } @@ -33190,18 +33192,16 @@ def printShowPeopleProfile(users): 'contacts': 'DIRECTORY_MERGE_SOURCE_TYPE_CONTACT', } -def _infoPeople(users, entityType): +def _infoPeople(users, entityType, source): if entityType == Ent.DOMAIN: people = buildGAPIObject(API.PEOPLE_DIRECTORY) - source = 'profile' - peopleEntityType = Ent.DOMAIN_PROFILE + peopleEntityType = Ent.DOMAIN_PROFILE if source == 'profile' else Ent.DOMAIN_CONTACT else: - source = 'contact' peopleEntityType = Ent.PEOPLE_CONTACT + sources = [PEOPLE_READ_SOURCES_CHOICE_MAP[source]] entityList = getEntityList(Cmd.OB_CONTACT_ENTITY) resourceNameLists = entityList if isinstance(entityList, dict) else None FJQC = FormatJSONQuoteChar() - sources = [PEOPLE_READ_SOURCES_CHOICE_MAP[source]] fieldsList = [] while Cmd.ArgumentsRemaining(): myarg = getArgument() @@ -33245,15 +33245,20 @@ def _infoPeople(users, entityType): _showPerson(entityType, user, peopleEntityType, result, j, jcount, FJQC) Ind.Decrement() +# gam info domaincontacts +# [allfields|(fields )] [formatjson] +def doInfoPeopleDomainContacts(): + _infoPeople([GC.Values[GC.DOMAIN]], Ent.DOMAIN, 'domaincontact') + # gam info domainprofiles # [allfields|(fields )] [formatjson] def doInfoPeopleDomainProfiles(): - _infoPeople([GC.Values[GC.DOMAIN]], Ent.DOMAIN) + _infoPeople([GC.Values[GC.DOMAIN]], Ent.DOMAIN, 'profile') # gam info peoplecontacts # [allfields|(fields )] [formatjson] def infoPeopleContacts(users): - _infoPeople(users, Ent.USER) + _infoPeople(users, Ent.USER, 'contact') # gam print domaincontacts [todrive *] # [query ] @@ -53283,7 +53288,7 @@ def _printVacation(user, result, showDisabled): Cmd.ARG_DEVICEUSER: doDeleteCIDeviceUser, Cmd.ARG_DOMAIN: doDeleteDomain, Cmd.ARG_DOMAINALIAS: doDeleteDomainAlias, - Cmd.ARG_DOMAINPROFILE: doDeletePeopleDomainProfiles, + Cmd.ARG_DOMAINCONTACT: doDeletePeopleDomainContacts, Cmd.ARG_DRIVEFILEACL: doDeleteDriveFileACLs, Cmd.ARG_FEATURE: doDeleteFeature, Cmd.ARG_GROUP: doDeleteGroups, @@ -53351,6 +53356,7 @@ def _printVacation(user, result, showDisabled): Cmd.ARG_DEVICEUSERSTATE: doInfoCIDeviceUserState, Cmd.ARG_DOMAIN: doInfoDomain, Cmd.ARG_DOMAINALIAS: doInfoDomainAlias, + Cmd.ARG_DOMAINCONTACT: doInfoPeopleDomainContacts, Cmd.ARG_DOMAINPROFILE: doInfoPeopleDomainProfiles, Cmd.ARG_DRIVEFILEACL: doInfoDriveFileACLs, Cmd.ARG_INSTANCE: doInfoInstance,