diff --git a/src/gam/cmd/alerts.py b/src/gam/cmd/alerts.py index 120e9535..d477e818 100644 --- a/src/gam/cmd/alerts.py +++ b/src/gam/cmd/alerts.py @@ -156,7 +156,7 @@ def doPrintShowAlerts(): if csvPF and myarg == 'todrive': csvPF.GetTodriveParameters() elif myarg == 'filter': - kwargs['filter'] = getString(Cmd.OB_STRING).replace("'", '"') + kwargs['filter'] = _getMain().getString(Cmd.OB_STRING).replace("'", '"') elif myarg == 'orderby': OBY.GetChoice() else: @@ -257,7 +257,7 @@ def doPrintShowAlertFeedback(): elif myarg == 'alertid': alertId = _getMain().getString(Cmd.OB_ALERT_ID) elif myarg == 'filter': - kwargs['filter'] = getString(Cmd.OB_STRING).replace("'", '"') + kwargs['filter'] = _getMain().getString(Cmd.OB_STRING).replace("'", '"') elif myarg == 'orderby': OBY.GetChoice() else: diff --git a/src/gam/cmd/caa.py b/src/gam/cmd/caa.py index ddd26110..d9273e8f 100644 --- a/src/gam/cmd/caa.py +++ b/src/gam/cmd/caa.py @@ -163,17 +163,17 @@ def CAABuildCondition(): while Cmd.ArgumentsRemaining(): myarg = _getMain().getArgument() if myarg == 'ipsubnetworks': - condition['ipSubnetworks'] = getString(Cmd.OB_STRING_LIST).split(',') + condition['ipSubnetworks'] = _getMain().getString(Cmd.OB_STRING_LIST).split(',') elif myarg == 'devicepolicy': condition['devicePolicy'] = CAABuildDevicePolicy() elif myarg == 'requiredaccesslevels': - condition['requiredAccessLevels'] = getString(Cmd.OB_STRING_LIST).split(',') + condition['requiredAccessLevels'] = _getMain().getString(Cmd.OB_STRING_LIST).split(',') elif myarg == 'negate': condition['negate'] = _getMain().getBoolean() elif myarg == 'members': - condition['members'] = getString(Cmd.OB_STRING_LIST).split(',') + condition['members'] = _getMain().getString(Cmd.OB_STRING_LIST).split(',') elif myarg == 'regions': - condition['regions'] = getString(Cmd.OB_STRING_LIST).upper().split(',') + condition['regions'] = _getMain().getString(Cmd.OB_STRING_LIST).upper().split(',') for region in condition['regions']: validateISO3166_1_alpha2_code(region) elif myarg == 'endcondition': @@ -200,7 +200,7 @@ def CAABuildLevel(body): if myarg == 'basic': body['basic'] = CAABuildBasicLevel() elif myarg == 'custom': - body['custom'] = {'expr': {'expression': getString(Cmd.OB_STRING), 'title': 'expr'}} + body['custom'] = {'expr': {'expression': _getMain().getString(Cmd.OB_STRING), 'title': 'expr'}} elif myarg == 'description': body['description'] = _getMain().getString(Cmd.OB_STRING, minLen=0) elif myarg == 'json': diff --git a/src/gam/cmd/calendar.py b/src/gam/cmd/calendar.py index 0827642a..3233bb74 100644 --- a/src/gam/cmd/calendar.py +++ b/src/gam/cmd/calendar.py @@ -587,7 +587,7 @@ def getCalendarEventEntity(): elif matchField[0] != 'attendees' or matchField[1] == 'match': calendarEventEntity['matches'].append((matchField, _getMain().getREPattern(re.IGNORECASE))) elif matchField[0] == 'attendees' and matchField[1] in {'onlydomainlist', 'domainlist', 'notdomainlist'}: - calendarEventEntity['matches'].append((matchField, set(getString(Cmd.OB_DOMAIN_NAME_LIST).replace(',', ' ').split()))) + calendarEventEntity['matches'].append((matchField, set(_getMain().getString(Cmd.OB_DOMAIN_NAME_LIST).replace(',', ' ').split()))) elif matchField[1] == 'email': calendarEventEntity['matches'].append((matchField, _getMain().getNormalizedEmailAddressEntity())) elif matchField[1] == 'organizer': @@ -610,7 +610,7 @@ CALENDAR_EVENT_SENDUPDATES_CHOICE_MAP = {'all': 'all', 'externalonly': 'external def _getCalendarSendUpdates(myarg, parameters): if myarg == 'sendnotifications': - parameters['sendUpdates'] = 'all' if getBoolean() else 'none' + parameters['sendUpdates'] = 'all' if _getMain().getBoolean() else 'none' elif myarg == 'notifyattendees': parameters['sendUpdates'] = 'all' elif myarg == 'sendupdates': @@ -694,7 +694,7 @@ def _getCalendarEventAttribute(myarg, body, parameters, function): elif myarg == 'location': body['location'] = _getMain().getString(Cmd.OB_STRING, minLen=0) elif myarg == 'source': - body['source'] = {'title': getString(Cmd.OB_STRING), 'url': _getMain().getString(Cmd.OB_URL)} + body['source'] = {'title': _getMain().getString(Cmd.OB_STRING), 'url': _getMain().getString(Cmd.OB_URL)} elif myarg == 'summary': body['summary'] = _getMain().getString(Cmd.OB_STRING, minLen=0) elif myarg in {'start', 'starttime'}: @@ -723,7 +723,7 @@ def _getCalendarEventAttribute(myarg, body, parameters, function): body['recurrence'] = ['RRULE:FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=-1'] elif myarg == 'attachment': body.setdefault('attachments', []) - body['attachments'].append({'title': getString(Cmd.OB_STRING), 'fileUrl': _getMain().getString(Cmd.OB_URL)}) + body['attachments'].append({'title': _getMain().getString(Cmd.OB_STRING), 'fileUrl': _getMain().getString(Cmd.OB_URL)}) elif function == 'update' and myarg == 'clearattachments': body['attachments'] = [] elif myarg in {'hangoutsmeet', 'googlemeet'}: @@ -757,7 +757,7 @@ def _getCalendarEventAttribute(myarg, body, parameters, function): elif myarg == 'attendee': parameters['attendees'].append({'email': _getMain().getEmailAddress(noUid=True)}) elif myarg == 'optionalattendee': - parameters['attendees'].append({'email': getEmailAddress(noUid=True), 'optional': True}) + parameters['attendees'].append({'email': _getMain().getEmailAddress(noUid=True), 'optional': True}) elif myarg in {'attendeestatus', 'selectattendees'}: optional = _getMain().getChoice(CALENDAR_ATTENDEE_OPTIONAL_CHOICE_MAP, defaultChoice=None, mapChoice=True) responseStatus = _getMain().getChoice(CALENDAR_ATTENDEE_STATUS_CHOICE_MAP, defaultChoice=None, mapChoice=True) diff --git a/src/gam/cmd/chat/spaces.py b/src/gam/cmd/chat/spaces.py index ee2f6bda..d7cc1287 100644 --- a/src/gam/cmd/chat/spaces.py +++ b/src/gam/cmd/chat/spaces.py @@ -63,7 +63,7 @@ def getChatSpaceParameters(myarg, body, typeChoicesMap, updateMask): body['spaceDetails']['guidelines'] = _getMain().getString(Cmd.OB_STRING, minLen=0, maxLen=5000) updateMask.add('spaceDetails') elif myarg == 'history': - body['spaceHistoryState'] = 'HISTORY_ON' if getBoolean() else 'HISTORY_OFF' + body['spaceHistoryState'] = 'HISTORY_ON' if _getMain().getBoolean() else 'HISTORY_OFF' updateMask.add('spaceHistoryState') elif myarg in {'audience', 'restricted'}: body['accessSettings']= {'audience': None} diff --git a/src/gam/cmd/cidevices.py b/src/gam/cmd/cidevices.py index 275b9255..0b5b5be6 100644 --- a/src/gam/cmd/cidevices.py +++ b/src/gam/cmd/cidevices.py @@ -64,7 +64,7 @@ def getCIDeviceEntity(): ci = buildGAPICIDeviceServiceObject() customer = _getMain()._getCustomersCustomerIdNoC() if _getMain().checkArgumentPresent('devicesn'): - query = f'serial:{getString(Cmd.OB_SERIAL_NUMBER)}' + query = f'serial:{_getMain().getString(Cmd.OB_SERIAL_NUMBER)}' elif _getMain().checkArgumentPresent('query'): query = _getMain().getString(Cmd.OB_QUERY) else: @@ -885,7 +885,7 @@ def doInfoCIDeviceUserState(): while Cmd.ArgumentsRemaining(): myarg = _getMain().getArgument() if myarg == 'clientid': - client_id = f'{customerID}-{getString(Cmd.OB_STRING)}' + client_id = f'{customerID}-{_getMain().getString(Cmd.OB_STRING)}' else: _getMain().unknownArgumentExit() count = len(entityList) @@ -924,7 +924,7 @@ def doUpdateCIDeviceUserState(): while Cmd.ArgumentsRemaining(): myarg = _getMain().getArgument() if myarg == 'clientid': - client_id = f'{customerID}-{getString(Cmd.OB_STRING)}' + client_id = f'{customerID}-{_getMain().getString(Cmd.OB_STRING)}' elif myarg in ['compliantstate', 'compliancestate']: body['complianceState'] = _getMain().getChoice(DEVICE_USER_COMPLIANCE_STATE_CHOICE_MAP, mapChoice=True) elif myarg == 'healthscore': diff --git a/src/gam/cmd/contacts.py b/src/gam/cmd/contacts.py index 33337ae6..e4d50745 100644 --- a/src/gam/cmd/contacts.py +++ b/src/gam/cmd/contacts.py @@ -679,7 +679,7 @@ class ContactsManager(): elif fieldName == CONTACT_USER_DEFINED_FIELDS: if CheckClearFieldsList(fieldName): continue - entry = {'rel': getString(Cmd.OB_STRING, minLen=0), 'value': _getMain().getString(Cmd.OB_STRING, minLen=0)} + entry = {'rel': _getMain().getString(Cmd.OB_STRING, minLen=0), 'value': _getMain().getString(Cmd.OB_STRING, minLen=0)} if not entry['rel'] or entry['rel'].lower() == 'none': entry['rel'] = None AppendItemToFieldsList(fieldName, entry, 'value') @@ -2119,7 +2119,7 @@ class PeopleManager(): # if CheckClearPersonField(fieldName): # continue # entry = InitArrayFieldEntry(None) -# entry['url'] = getString(Cmd.OB_STRING, minLen=0) +# entry['url'] = _getMain().getString(Cmd.OB_STRING, minLen=0) # entry['default'] = False # AppendArrayEntryToFields(fieldName, entry, 'url') elif fieldName == PEOPLE_GROUPS: diff --git a/src/gam/cmd/drive/activity.py b/src/gam/cmd/drive/activity.py index 2a8ca03c..a278ff62 100644 --- a/src/gam/cmd/drive/activity.py +++ b/src/gam/cmd/drive/activity.py @@ -119,9 +119,9 @@ def printDriveActivity(users): if myarg == 'todrive': csvPF.GetTodriveParameters() elif myarg == 'fileid': - baseFileList.append({'id': getString(Cmd.OB_DRIVE_FILE_ID), 'mimeType': MIMETYPE_GA_DOCUMENT}) + baseFileList.append({'id': _getMain().getString(Cmd.OB_DRIVE_FILE_ID), 'mimeType': MIMETYPE_GA_DOCUMENT}) elif myarg == 'folderid': - baseFileList.append({'id': getString(Cmd.OB_DRIVE_FOLDER_ID), 'mimeType': MIMETYPE_GA_FOLDER}) + baseFileList.append({'id': _getMain().getString(Cmd.OB_DRIVE_FOLDER_ID), 'mimeType': MIMETYPE_GA_FOLDER}) elif myarg == 'drivefilename': query = f"mimeType != '{MIMETYPE_GA_FOLDER}' and name = '{getEscapedDriveFileName()}'" elif myarg == 'drivefoldername': diff --git a/src/gam/cmd/drive/copymove/copymove_util.py b/src/gam/cmd/drive/copymove/copymove_util.py index be81b1f4..76ca7600 100644 --- a/src/gam/cmd/drive/copymove/copymove_util.py +++ b/src/gam/cmd/drive/copymove/copymove_util.py @@ -278,10 +278,10 @@ def getCopyMoveOptions(myarg, copyMoveOptions): elif myarg == 'copysubfoldernoninheritedpermissions': copyMoveOptions['copySubFolderNonInheritedPermissions'] = _getMain().getChoice(COPY_NONINHERITED_PERMISSIONS_CHOICES_MAP, mapChoice=True) elif myarg == 'excludepermissionsfromdomains': - copyMoveOptions['excludePermissionsFromDomains'] = set(getString(Cmd.OB_DOMAIN_NAME_LIST).lower().replace(',', ' ').split()) + copyMoveOptions['excludePermissionsFromDomains'] = set(_getMain().getString(Cmd.OB_DOMAIN_NAME_LIST).lower().replace(',', ' ').split()) copyMoveOptions['includePermissionsFromDomains'] = set() elif myarg == 'includepermissionsfromdomains': - copyMoveOptions['includePermissionsFromDomains'] = set(getString(Cmd.OB_DOMAIN_NAME_LIST).lower().replace(',', ' ').split()) + copyMoveOptions['includePermissionsFromDomains'] = set(_getMain().getString(Cmd.OB_DOMAIN_NAME_LIST).lower().replace(',', ' ').split()) copyMoveOptions['excludePermissionsFromDomains'] = set() elif myarg == 'mappermissionsemail': sourceEmail = _getMain().getEmailAddress(noUid=True).lower() @@ -366,7 +366,7 @@ def getCopyMoveOptions(myarg, copyMoveOptions): copyMoveOptions['copySubFilesOwnedBy'] = _getMain().getChoice(COPY_OWNED_BY_CHOICE_MAP, mapChoice=True) if copyMoveOptions['copySubFilesOwnedBy']: if copyMoveOptions['copySubFilesOwnedBy']['mode'] in {'users', 'notusers'}: - copyMoveOptions['copySubFilesOwnedBy']['value'] = set(getString(Cmd.OB_EMAIL_ADDRESS_LIST).replace(',', ' ').lower().split()) + copyMoveOptions['copySubFilesOwnedBy']['value'] = set(_getMain().getString(Cmd.OB_EMAIL_ADDRESS_LIST).replace(',', ' ').lower().split()) elif copyMoveOptions['copySubFilesOwnedBy']['mode'] in {'regex', 'notregex'}: copyMoveOptions['copySubFilesOwnedBy']['value'] = _getMain().getREPattern(re.IGNORECASE) elif myarg in {'start', 'starttime', 'end', 'endtime', 'range'}: diff --git a/src/gam/cmd/drive/core.py b/src/gam/cmd/drive/core.py index 4ba71b91..9c63ae7d 100644 --- a/src/gam/cmd/drive/core.py +++ b/src/gam/cmd/drive/core.py @@ -1081,7 +1081,7 @@ def getDriveFileAttribute(myarg, body, parameters, updateCmd): body.setdefault('contentHints', {}) body['contentHints']['indexableText'] = _getMain().getString(Cmd.OB_STRING) elif myarg == 'securityupdate': - body['linkShareMetadata'] = {'securityUpdateEnabled': getBoolean(), 'securityUpdateEligible': True} + body['linkShareMetadata'] = {'securityUpdateEnabled': _getMain().getBoolean(), 'securityUpdateEligible': True} elif myarg == 'timestamp': parameters[DFA_TIMESTAMP] = _getMain().getBoolean() elif myarg == 'timeformat': diff --git a/src/gam/cmd/drive/revisions.py b/src/gam/cmd/drive/revisions.py index 0338e107..c5c0d47a 100644 --- a/src/gam/cmd/drive/revisions.py +++ b/src/gam/cmd/drive/revisions.py @@ -81,7 +81,7 @@ def getRevisionsEntity(): elif mycmd[:3] == 'id:': revisionsEntity['list'] = [myarg[3:]] elif mycmd == 'ids': - revisionsEntity['list'] = getString(Cmd.OB_DRIVE_FILE_REVISION_ID).replace(',', ' ').split() + revisionsEntity['list'] = _getMain().getString(Cmd.OB_DRIVE_FILE_REVISION_ID).replace(',', ' ').split() elif mycmd[:4] == 'ids:': revisionsEntity['list'] = myarg[4:].replace(',', ' ').split() elif mycmd in {'first', 'last', 'allexceptfirst', 'allexceptlast'}: diff --git a/src/gam/cmd/gmail/filters.py b/src/gam/cmd/gmail/filters.py index 280765b4..53bc4684 100644 --- a/src/gam/cmd/gmail/filters.py +++ b/src/gam/cmd/gmail/filters.py @@ -172,7 +172,7 @@ def createFilter(users): elif myarg in {'hasAttachment', 'excludeChats'}: body['criteria'][myarg] = True elif myarg == 'size': - body['criteria']['sizeComparison'] = getChoice(['larger', 'smaller']) + body['criteria']['sizeComparison'] = _getMain().getChoice(['larger', 'smaller']) body['criteria'][myarg] = _getMain().getMaxMessageBytes(_getMain().ONE_KILO_10_BYTES, _getMain().ONE_MEGA_10_BYTES) elif jsonData is None and myarg in FILTER_ACTION_CHOICES: if myarg in FILTER_ADD_LABEL_ACTIONS: diff --git a/src/gam/cmd/gmail/messages.py b/src/gam/cmd/gmail/messages.py index 8639f899..3ac51240 100644 --- a/src/gam/cmd/gmail/messages.py +++ b/src/gam/cmd/gmail/messages.py @@ -74,7 +74,7 @@ def _getMessageSelectParameters(myarg, parameters): parameters['query'] += ')' parameters['labelGroupOpen'] = False parameters['query'] += ' ' - parameters['query'] += f'({getString(Cmd.OB_QUERY)})' + parameters['query'] += f'({_getMain().getString(Cmd.OB_QUERY)})' elif myarg.startswith('querytime'): parameters['queryTimes'][myarg] = getDateOrDeltaFromNow().replace('-', '/') elif myarg == 'matchlabel': diff --git a/src/gam/cmd/gmail/settings.py b/src/gam/cmd/gmail/settings.py index 8e913128..c641fe26 100644 --- a/src/gam/cmd/gmail/settings.py +++ b/src/gam/cmd/gmail/settings.py @@ -547,7 +547,7 @@ def getSendAsAttributes(myarg, body, tagReplacements): elif myarg == 'replyto': body['replyToAddress'] = _getMain().getString(Cmd.OB_EMAIL_ADDRESS, minLen=0) if len(body['replyToAddress']) > 0: - body['replyToAddress'] = normalizeEmailAddressOrUID(body['replyToAddress'], noUid=True, noLower=True) + body['replyToAddress'] = _getMain().normalizeEmailAddressOrUID(body['replyToAddress'], noUid=True, noLower=True) elif myarg == 'default': body['isDefault'] = True elif myarg == 'treatasalias': diff --git a/src/gam/cmd/groups/members.py b/src/gam/cmd/groups/members.py index 125b9b18..22d99b25 100644 --- a/src/gam/cmd/groups/members.py +++ b/src/gam/cmd/groups/members.py @@ -117,7 +117,7 @@ def getIPSGMGroupRolesMemberDisplayOptions(myarg, rolesSet, memberDisplayOptions elif myarg == 'external': memberDisplayOptions['external'] = memberDisplayOptions['checkCategory'] = memberDisplayOptions['showCategory'] = True elif myarg == 'internaldomains': - memberDisplayOptions['internalDomains'] = getString(Cmd.OB_DOMAIN_NAME_LIST).replace(',', ' ').lower() + memberDisplayOptions['internalDomains'] = _getMain().getString(Cmd.OB_DOMAIN_NAME_LIST).replace(',', ' ').lower() else: return False return True @@ -549,11 +549,11 @@ def checkGroupShowOwnedBy(showOwnedBy, members): def getGroupMatchPatterns(myarg, matchPatterns, ciGroupsAPI): if myarg == 'emailmatchpattern': - matchPatterns['email'] = {'not': checkArgumentPresent('not'), 'pattern': _getMain().getREPattern(re.IGNORECASE)} + matchPatterns['email'] = {'not': _getMain().checkArgumentPresent('not'), 'pattern': _getMain().getREPattern(re.IGNORECASE)} elif myarg == 'namematchpattern': - matchPatterns['name' if not ciGroupsAPI else 'displayName'] = {'not': checkArgumentPresent('not'), 'pattern': _getMain().getREPattern(re.IGNORECASE|re.UNICODE)} + matchPatterns['name' if not ciGroupsAPI else 'displayName'] = {'not': _getMain().checkArgumentPresent('not'), 'pattern': _getMain().getREPattern(re.IGNORECASE|re.UNICODE)} elif myarg == 'descriptionmatchpattern': - matchPatterns['description'] = {'not': checkArgumentPresent('not'), 'pattern': _getMain().getREPattern(re.IGNORECASE|re.UNICODE)} + matchPatterns['description'] = {'not': _getMain().checkArgumentPresent('not'), 'pattern': _getMain().getREPattern(re.IGNORECASE|re.UNICODE)} elif not ciGroupsAPI and myarg == 'admincreatedmatch': matchPatterns['adminCreated'] = _getMain().getBoolean(None) else: diff --git a/src/gam/cmd/meet.py b/src/gam/cmd/meet.py index 02840fb6..c113dacf 100644 --- a/src/gam/cmd/meet.py +++ b/src/gam/cmd/meet.py @@ -102,18 +102,18 @@ def _getMeetSpaceParameters(myarg, body): elif option == 'entryPointAccess': body['config'][option] = _getMain().getChoice(MEET_SPACE_ENTRYPOINTACCESS_CHOICES_MAP, mapChoice=True) elif option == 'moderation': - body['config'][option] = 'ON' if getBoolean() else 'OFF' + body['config'][option] = 'ON' if _getMain().getBoolean() else 'OFF' elif option in {'chatRestriction', 'reactionRestriction', 'presentRestriction'}: body['config'].setdefault('moderationRestrictions', {}) body['config']['moderationRestrictions'][option] = _getMain().getChoice(MEET_SPACE_RESTRICTIONS_CHOICES_MAP, mapChoice=True) elif option == 'defaultJoinAsViewerType': - body['config'][option] = 'ON' if getBoolean() else 'OFF' + body['config'][option] = 'ON' if _getMain().getBoolean() else 'OFF' # elif option == 'firstJoinerType': -# body['config'][option] = getChoice(MEET_SPACE_FIRSTJOINERTYPE_CHOICES_MAP, mapChoice=True) +# body['config'][option] = _getMain().getChoice(MEET_SPACE_FIRSTJOINERTYPE_CHOICES_MAP, mapChoice=True) 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' + body['config']['artifactConfig'][option][MEET_SPACE_ARTIFACT_SUB_OPTIONS[option]] = 'ON' if _getMain().getBoolean() else 'OFF' return True # gam create meetspace @@ -302,7 +302,7 @@ def printShowMeetConferences(users): elif (myarg == 'space' or myarg.startswith('spaces/') or myarg.startswith('space/')): _updateQuery('AND', f'space.name = "{getSpaceName(myarg)}"') elif myarg == 'code': - _updateQuery('AND', f'space.meeting_code = "{getString(Cmd.OB_STRING)}"') + _updateQuery('AND', f'space.meeting_code = "{_getMain().getString(Cmd.OB_STRING)}"') elif myarg == 'andquery': _updateQuery('AND', _getMain().getString(Cmd.OB_QUERY)) elif myarg == 'orquery': diff --git a/src/gam/cmd/resources.py b/src/gam/cmd/resources.py index b4812152..84466aa0 100644 --- a/src/gam/cmd/resources.py +++ b/src/gam/cmd/resources.py @@ -47,7 +47,7 @@ def _getBuildingAttributes(body): elif myarg == 'description': body['description'] = _getMain().getString(Cmd.OB_STRING) elif myarg == 'floors': - body['floorNames'] = getString(Cmd.OB_STRING).split(',') + body['floorNames'] = _getMain().getString(Cmd.OB_STRING).split(',') elif myarg in _getMain().BUILDING_ADDRESS_FIELD_MAP: myarg = _getMain().BUILDING_ADDRESS_FIELD_MAP[myarg] body.setdefault('address', {}) @@ -491,7 +491,7 @@ def updateAutoAcceptInvitations(cal, calId, autoAcceptInvitations, i=0, count=0) # gam create resource * def doCreateResourceCalendar(): cd = _getMain().buildGAPIObject(API.DIRECTORY) - body, autoAcceptInvitations, _ = _getResourceCalendarAttributes(cd, {'resourceId': getString(Cmd.OB_RESOURCE_ID), 'resourceName': _getMain().getString(Cmd.OB_NAME)}, False) + body, autoAcceptInvitations, _ = _getResourceCalendarAttributes(cd, {'resourceId': _getMain().getString(Cmd.OB_RESOURCE_ID), 'resourceName': _getMain().getString(Cmd.OB_NAME)}, False) if autoAcceptInvitations is not None: cal = _getMain().buildGAPIObject(API.CALENDAR) try: diff --git a/src/gam/cmd/send_email.py b/src/gam/cmd/send_email.py index 0efeb25e..2c10cdab 100644 --- a/src/gam/cmd/send_email.py +++ b/src/gam/cmd/send_email.py @@ -800,7 +800,7 @@ def doSendReply(users): selectLocation = Cmd.Location() if query: query += ' ' - query += f'({getString(Cmd.OB_QUERY)})' + query += f'({_getMain().getString(Cmd.OB_QUERY)})' elif myarg.startswith('querytime'): queryTimes[myarg] = _getMain().getDateOrDeltaFromNow().replace('-', '/') elif myarg in {'or', 'and'}: diff --git a/src/gam/cmd/sites.py b/src/gam/cmd/sites.py index faf8a048..d5db8e87 100644 --- a/src/gam/cmd/sites.py +++ b/src/gam/cmd/sites.py @@ -196,7 +196,7 @@ def printShowBusinessProfileAccounts(users): if csvPF and myarg == 'todrive': csvPF.GetTodriveParameters() elif myarg == 'type': - kwargs['filter'] = f'type={getChoice(PROFILE_ACCOUNT_TYPE_MAP, mapChoice=True)}' + kwargs['filter'] = f'type={_getMain().getChoice(PROFILE_ACCOUNT_TYPE_MAP, mapChoice=True)}' else: _getMain().unknownArgumentExit() i, count, users = _getMain().getEntityArgument(users) diff --git a/src/gam/cmd/userop/usergroups.py b/src/gam/cmd/userop/usergroups.py index af7e7237..78701d65 100644 --- a/src/gam/cmd/userop/usergroups.py +++ b/src/gam/cmd/userop/usergroups.py @@ -345,7 +345,7 @@ def deleteUserFromGroups(users): for group in groupKeys: deleteGroups[_getMain().normalizeEmailAddressOrUID(group)] = {'role': Ent.MEMBER} else: - matchPattern = {'not': checkArgumentPresent('not'), 'pattern': _getMain().getREPattern(re.IGNORECASE)} + matchPattern = {'not': _getMain().checkArgumentPresent('not'), 'pattern': _getMain().getREPattern(re.IGNORECASE)} _getMain().checkForExtraneousArguments() else: _getMain().checkForExtraneousArguments() diff --git a/src/gam/cmd/users/manage.py b/src/gam/cmd/users/manage.py index 785066e1..b4a634ee 100644 --- a/src/gam/cmd/users/manage.py +++ b/src/gam/cmd/users/manage.py @@ -523,7 +523,7 @@ def getUserAttributes(cd, updateCmd, noUid=False): updatePrimaryEmail = list(_getMain().getREPatternSubstitution(re.IGNORECASE)) updatePrimaryEmail.append(_getMain().checkArgumentPresent(['preview'])) # elif updateCmd and myarg == 'primaryguestemail': -# body['guestAccountInfo'] = {'primaryGuestEmail': getEmailAddress(noUid=True)} +# body['guestAccountInfo'] = {'primaryGuestEmail': _getMain().getEmailAddress(noUid=True)} elif myarg == 'json': body.update(_getMain().getJSON(USER_JSON_SKIP_FIELDS)) if 'name' in body and 'fullName' in body['name']: @@ -743,7 +743,7 @@ def getUserAttributes(cd, updateCmd, noUid=False): primary['location'] = Cmd.Location() entry['primary'] = _getMain().getBoolean() elif argument in {'os', 'operatingsystemtype'}: - entry['operatingSystemType'] = getChoice(['linux', 'unspecified', 'windows']) + entry['operatingSystemType'] = _getMain().getChoice(['linux', 'unspecified', 'windows']) elif argument == 'endposix': break else: diff --git a/src/gam/cmd/userservices.py b/src/gam/cmd/userservices.py index 77971490..ab605879 100644 --- a/src/gam/cmd/userservices.py +++ b/src/gam/cmd/userservices.py @@ -1257,7 +1257,7 @@ def updateCalendarAttendees(users): elif updOp == 'update': attendeeMap[updAddr] = {'op': updOp, 'status': updStatus, 'optional': updOptional, 'done': False} else: #replace - attendeeMap[updAddr] = {'op': 'replace', 'status': updStatus, 'optional': updOptional, 'email': normalizeEmailAddressOrUID(updOp, noUid=True), 'done': False} + attendeeMap[updAddr] = {'op': 'replace', 'status': updStatus, 'optional': updOptional, 'email': _getMain().normalizeEmailAddressOrUID(updOp, noUid=True), 'done': False} _getMain().closeFile(f) elif myarg == 'delete': updAddr = _getMain().getEmailAddress(noUid=True) diff --git a/src/gam/cmd/vault/matters.py b/src/gam/cmd/vault/matters.py index ec4f3a6c..8a399c92 100644 --- a/src/gam/cmd/vault/matters.py +++ b/src/gam/cmd/vault/matters.py @@ -367,7 +367,7 @@ def _buildVaultQuery(myarg, query, corpusArgumentMap): elif myarg == 'driveversiondate': query.setdefault('driveOptions', {})['versionDate'] = _getMain().getTimeOrDeltaFromNow() elif myarg in {'includeshareddrives', 'includeteamdrives'}: - query.setdefault('driveOptions', {})['sharedDrivesOption'] = 'INCLUDED' if getBoolean() else 'INCLUDED_IF_ACCOUNT_IS_NOT_A_MEMBER' + query.setdefault('driveOptions', {})['sharedDrivesOption'] = 'INCLUDED' if _getMain().getBoolean() else 'INCLUDED_IF_ACCOUNT_IS_NOT_A_MEMBER' elif myarg == 'shareddrivesoption': query.setdefault('driveOptions', {})['sharedDrivesOption'] = _getMain().getChoice(VAULT_SHARED_DRIVES_OPTION_MAP, mapChoice=True) elif myarg == 'driveclientsideencryption':