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

Method _fix_value

stix/indicator/indicator.py:821–829  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

819 super(_RelatedCampaignRefList, self).__init__(type=RelatedCampaignRef, *args)
820
821 def _fix_value(self, value):
822 from stix.campaign import Campaign
823
824 if isinstance(value, Campaign) and value.id_:
825 return RelatedCampaignRef(CampaignRef(idref=value.id_))
826
827 msg = "Cannot insert object of type '%s' into '%s'"
828 msg = msg % (type(value), self.__class__.__name__)
829 raise TypeError(msg)
830
831
832class RelatedCampaignRefs(GenericRelationshipList):

Callers

nothing calls this directly

Calls 2

RelatedCampaignRefClass · 0.90
CampaignRefClass · 0.90

Tested by

no test coverage detected