fix: another call that cn be a list or a dict.

pull/1145/head
Raphaël Vinot 2024-02-02 13:06:49 +01:00
parent b00ae03655
commit e91a7922a7
1 changed files with 5 additions and 2 deletions

View File

@ -1333,12 +1333,15 @@ class PyMISP:
warninglist_id = get_uuid_or_id_from_abstract_misp(warninglist)
return self.toggle_warninglist(warninglist_id=warninglist_id, force_enable=False)
def values_in_warninglist(self, value: Iterable[str]) -> dict[str, Any]:
def values_in_warninglist(self, value: Iterable[str]) -> dict[str, Any] | list[dict[str, Any]]:
"""Check if IOC values are in warninglist
:param value: iterator with values to check
"""
response = self._prepare_request('POST', 'warninglists/checkValue', data=value)
try:
return self._check_json_response_list(response)
except PyMISPError:
return self._check_json_response(response)
def update_warninglists(self) -> dict[str, Any]: