Skip to content

Commit

Permalink
Merge pull request #293 from joewaltonPurple/organisation_info
Browse files Browse the repository at this point in the history
CIQ Identity 3.0 - update to_dict and from_dict to include organisation_info
  • Loading branch information
gtback committed Jul 6, 2016
2 parents e349d5f + feff79c commit 8ba60c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stix/extensions/identity/ciq_identity_3_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ def from_dict(cls, dict_repr, return_obj=None):
return_obj = cls()

return_obj.party_name = PartyName.from_dict(dict_repr.get('party_name'))
return_obj.organisation_info = OrganisationInfo.from_dict(dict_repr.get('organisation_info'))
return_obj.languages = [Language.from_dict(x) for x in dict_repr.get('languages', [])]
return_obj.addresses = [Address.from_dict(x) for x in dict_repr.get('addresses', [])]
return_obj.electronic_address_identifiers = [ElectronicAddressIdentifier.from_dict(x) for x in dict_repr.get('electronic_address_identifiers', [])]
Expand All @@ -420,6 +421,8 @@ def to_dict(self):

if self.party_name:
d['party_name'] = self.party_name.to_dict()
if self.organisation_info:
d['organisation_info'] = self.organisation_info.to_dict()
if self.languages:
d['languages'] = [x.to_dict() for x in self.languages]
if self.addresses:
Expand Down
3 changes: 3 additions & 0 deletions stix/test/extensions/identity/ciq_identity_3_0_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class CIQIdentity3_0InstanceTests(EntityTestCase, unittest.TestCase):
}
]
},
'organisation_info': {
'industry_type': 'test industry'
},
'languages': [
{'value': 'test language'}
],
Expand Down

0 comments on commit 8ba60c4

Please sign in to comment.