new: returnMetaAttributes flag for freeTextImport API

Fix #188
pull/189/head
Raphaël Vinot 2018-02-13 10:50:51 +01:00
parent 45d5f44e24
commit 3e8e588846
1 changed files with 3 additions and 1 deletions

View File

@ -919,7 +919,7 @@ class PyMISP(object):
# ###### Attribute update ###### # ###### Attribute update ######
# ############################## # ##############################
def freetext(self, event_id, string, adhereToWarninglists=False, distribution=None): def freetext(self, event_id, string, adhereToWarninglists=False, distribution=None, returnMetaAttributes=False):
"""Pass a text to the freetext importer""" """Pass a text to the freetext importer"""
query = {"value": string} query = {"value": string}
wl_params = [False, True, 'soft'] wl_params = [False, True, 'soft']
@ -929,6 +929,8 @@ class PyMISP(object):
query['adhereToWarninglists'] = adhereToWarninglists query['adhereToWarninglists'] = adhereToWarninglists
if distribution is not None: if distribution is not None:
query['distribution'] = distribution query['distribution'] = distribution
if returnMetaAttributes:
query['returnMetaAttributes'] = returnMetaAttributes
return self.__query('freeTextImport/{}'.format(event_id), query, controller='events') return self.__query('freeTextImport/{}'.format(event_id), query, controller='events')
# ############################## # ##############################