Add get_member_types() method for CORE API

This commit is contained in:
Lance Edgar 2023-06-06 13:13:51 -05:00
parent bb8278dcc8
commit 852a989bd5

View file

@ -132,6 +132,22 @@ class CoreWebAPI(object):
assert set(js['result'].keys()) == set(['result']) assert set(js['result'].keys()) == set(['result'])
return js['result']['result'] return js['result']['result']
def get_member_types(self):
"""
Fetch all Member Type records from CORE.
:returns: A (potentially empty) list of member type dict records.
"""
params = {
'entity': 'Memtype',
'submethod': 'get',
'columns': {},
}
response = self.post(params)
result = self.parse_response(response)
return [json.loads(rec) for rec in result]
def get_members(self): def get_members(self):
""" """
Fetch all Member records from CORE. Fetch all Member records from CORE.