From 10f4d30960e8275bee1d06a8fa7ffb47584e4c54 Mon Sep 17 00:00:00 2001 From: Sura De Silva Date: Mon, 3 Jul 2023 12:57:52 +1000 Subject: [PATCH] feat: introduce setter for galaxies --- pymisp/mispevent.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index 4acc5c5..d08024c 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -1721,6 +1721,13 @@ class MISPEvent(AbstractMISP): def galaxies(self) -> List[MISPGalaxy]: return self.Galaxy + @galaxies.setter + def galaxies(self, galaxies: List[MISPGalaxy]): + if all(isinstance(x, MISPGalaxy) for x in galaxies): + self.Galaxy = galaxies + else: + raise PyMISPError('All the attributes have to be of type MISPGalaxy.') + @property def objects(self) -> List[MISPObject]: return self.Object