Skip to content

Commit

Permalink
fix: [api] Notes, Opinions and Relationships are no longer AnalystDat…
Browse files Browse the repository at this point in the history
…aBehaviorMixin
  • Loading branch information
chrisr3d committed Dec 22, 2024
1 parent 201bf5a commit ea8fd62
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pymisp/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
MISPRole, MISPServer, MISPFeed, MISPEventDelegation, MISPCommunity, MISPUserSetting, \
MISPInbox, MISPEventBlocklist, MISPOrganisationBlocklist, MISPEventReport, \
MISPGalaxyCluster, MISPGalaxyClusterRelation, MISPCorrelationExclusion, MISPDecayingModel, \
MISPNote, MISPOpinion, MISPRelationship, AnalystDataBehaviorMixin
MISPNote, MISPOpinion, MISPRelationship, MISPAnalystData
from .abstract import pymisp_json_default, MISPTag, AbstractMISP, describe_types


Expand Down Expand Up @@ -621,14 +621,14 @@ def attach_galaxy_cluster(self, misp_entity: MISPEvent | MISPAttribute, galaxy_c
# ## END Galaxy Cluster ###

# ## BEGIN Analyst Data ###a
def get_analyst_data(self, analyst_data: AnalystDataBehaviorMixin | int | str | UUID,
def get_analyst_data(self, analyst_data: MISPAnalystData | int | str | UUID,
pythonify: bool = False) -> dict[str, Any] | MISPNote | MISPOpinion | MISPRelationship:
"""Get an analyst data from a MISP instance
:param analyst_data: analyst data to get
:param pythonify: Returns a list of PyMISP Objects instead of the plain json output. Warning: it might use a lot of RAM
"""
if isinstance(analyst_data, AnalystDataBehaviorMixin):
if isinstance(analyst_data, MISPAnalystData):
analyst_data_type = analyst_data.analyst_data_object_type
else:
analyst_data_type = 'all'
Expand Down Expand Up @@ -666,7 +666,7 @@ def update_analyst_data(self, analyst_data: MISPNote | MISPOpinion | MISPRelatio
:param analyst_data_id: analyst data ID to update
:param pythonify: Returns a PyMISP Object instead of the plain json output
"""
if isinstance(analyst_data, AnalystDataBehaviorMixin):
if isinstance(analyst_data, MISPAnalystData):
analyst_data_type = analyst_data.analyst_data_object_type
else:
analyst_data_type = 'all'
Expand All @@ -685,7 +685,7 @@ def delete_analyst_data(self, analyst_data: MISPNote | MISPOpinion | MISPRelatio
:param analyst_data: analyst data to delete
"""
if isinstance(analyst_data, AnalystDataBehaviorMixin):
if isinstance(analyst_data, MISPAnalystData):
analyst_data_type = analyst_data.analyst_data_object_type
else:
analyst_data_type = 'all'
Expand Down

0 comments on commit ea8fd62

Please sign in to comment.