MCPcopy Create free account
hub / github.com/STIXProject/python-stix / Identity

Class Identity

stix/common/identity.py:21–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21class Identity(stix.Entity):
22 _binding = common_binding
23 _binding_class = IdentityType
24 _namespace = 'http://docs.oasis-open.org/cti/ns/stix/common-1'
25
26 id_ = fields.IdField("id")
27 idref = fields.IdrefField("idref")
28 name = fields.TypedField("Name")
29 related_identities = fields.TypedField("Related_Identities", type_="stix.common.identity.RelatedIdentities")
30
31 def __init__(self, id_=None, idref=None, name=None, related_identities=None):
32 super(Identity, self).__init__()
33
34 self.id_ = id_
35 self.idref = idref
36 self.name = name
37 self.related_identities = related_identities
38
39 def to_dict(self):
40 d = super(Identity, self).to_dict()
41
42 if self._XSI_TYPE:
43 d['xsi:type'] = self._XSI_TYPE
44
45 return d
46
47 @staticmethod
48 def lookup_class(xsi_type):
49 return stix.lookup_extension(xsi_type, default=Identity)
50
51# We can't import RelatedIdentity until we have defined the Identity class.
52from stix.common.related import RelatedIdentity

Callers 2

_fix_valueMethod · 0.90
set_producer_identityMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected