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

Method add_related_campaign

stix/indicator/indicator.py:494–523  ·  view source on GitHub ↗

Adds a Related Campaign to this Indicator. The `value` parameter must be an instance of :class:`.RelatedCampaignRef` or :class:`.CampaignRef`. If the `value` parameter is ``None``, no item wil be added to the ``related_campaigns`` collection. Calling this m

(self, value)

Source from the content-addressed store, hash-verified

492 self.related_indicators.append(indicator)
493
494 def add_related_campaign(self, value):
495 """Adds a Related Campaign to this Indicator.
496
497 The `value` parameter must be an instance of :class:`.RelatedCampaignRef`
498 or :class:`.CampaignRef`.
499
500 If the `value` parameter is ``None``, no item wil be added to the
501 ``related_campaigns`` collection.
502
503 Calling this method is the same as calling ``append()`` on the
504 ``related_campaigns`` property.
505
506 See Also:
507 The :class:`.RelatedCampaignRef` documentation.
508
509 Note:
510 If the `value` parameter is not an instance of
511 :class:`.RelatedCampaignRef` an attempt will be made to convert it
512 to one.
513
514 Args:
515 value: An instance of :class:`.RelatedCampaignRef` or
516 :class:`.Campaign`.
517
518 Raises:
519 ValueError: If the `value` parameter cannot be converted into
520 an instance of :class:`.RelatedCampaignRef`
521
522 """
523 self.related_campaigns.append(value)
524
525 @property
526 def observable_composition_operator(self):

Callers 1

mainFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected