Skip to content

Commit

Permalink
new: Load Org and Orgc as MISPOrganisation
Browse files Browse the repository at this point in the history
Related to #239
  • Loading branch information
Rafiot committed Jun 15, 2018
1 parent bb9976a commit 2be9077
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pymisp/mispevent.py
Expand Up @@ -371,6 +371,21 @@ def __init__(self, describe_types=None, strict_validation=False):
def known_types(self):
return self._types

@property
def org(self):
return self.Org

@property
def orgc(self):
return self.Orgc

@orgc.setter
def orgc(self, orgc):
if isinstance(orgc, MISPOrganisation):
self.Orgc = orgc
else:
raise PyMISPError('Orgc must be of type MISPOrganisation.')

@property
def attributes(self):
return self.Attribute
Expand Down Expand Up @@ -516,6 +531,12 @@ def from_dict(self, **kwargs):
if kwargs.get('Object'):
for obj in kwargs.pop('Object'):
self.add_object(obj)
if kwargs.get('Org'):
self.Org = MISPOrganisation()
self.Org.from_dict(**kwargs.pop('Org'))
if kwargs.get('Orgc'):
self.Orgc = MISPOrganisation()
self.Orgc.from_dict(**kwargs.pop('Orgc'))

super(MISPEvent, self).from_dict(**kwargs)

Expand Down

0 comments on commit 2be9077

Please sign in to comment.