1010 RelatedIncident , RelatedIndicator , RelatedPackageRefs , RelatedThreatActor ,
1111 RelatedTTP )
1212from stix .common import vocabs
13+ from stix .common .vocabs import VocabField
1314import stix .bindings .campaign as campaign_binding
1415from stix .common .structured_text import StructuredTextList
1516from stix .common .information_source import InformationSource
1617
18+
1719class AssociatedCampaigns (GenericRelationshipList ):
1820 _namespace = "http://stix.mitre.org/Campaign-1"
1921 _binding = campaign_binding
2022 _binding_class = campaign_binding .AssociatedCampaignsType
21- _binding_var = "Associated_Campaign"
22- _contained_type = RelatedCampaign
23- _inner_name = "campaigns"
23+
24+ campaign = fields .TypedField ("Associated_Campaign" , RelatedCampaign , multiple = True , key_name = "campaigns" )
25+
26+ @classmethod
27+ def _dict_as_list (cls ):
28+ return False
29+
2430
2531class Attribution (GenericRelationshipList ):
2632 _namespace = "http://stix.mitre.org/Campaign-1"
2733 _binding = campaign_binding
2834 _binding_class = campaign_binding .AttributionType
29- _binding_var = "Attributed_Threat_Actor"
30- _contained_type = RelatedThreatActor
31- _inner_name = "threat_actors"
35+
36+ threat_actor = fields .TypedField ("Attributed_Threat_Actor" , RelatedThreatActor , multiple = True , key_name = "threat_actors" )
37+
38+ @classmethod
39+ def _dict_as_list (cls ):
40+ return False
3241
3342
3443class RelatedIncidents (GenericRelationshipList ):
3544 _namespace = "http://stix.mitre.org/Campaign-1"
3645 _binding = campaign_binding
3746 _binding_class = campaign_binding .RelatedIncidentsType
38- _binding_var = "Related_Incident"
39- _contained_type = RelatedIncident
40- _inner_name = "incidents"
47+
48+ incident = fields .TypedField ("Related_Incident" , RelatedIncident , multiple = True , key_name = "incidents" )
49+
50+ @classmethod
51+ def _dict_as_list (cls ):
52+ return False
4153
4254
4355class RelatedIndicators (GenericRelationshipList ):
4456 _namespace = "http://stix.mitre.org/Campaign-1"
4557 _binding = campaign_binding
4658 _binding_class = campaign_binding .RelatedIndicatorsType
47- _binding_var = "Related_Indicator"
48- _contained_type = RelatedIndicator
49- _inner_name = "indicators"
59+
60+ indicator = fields . TypedField ( "Related_Indicator" , RelatedIndicator , multiple = True , key_name = "indicators" )
61+
5062
5163 def _is_valid (self , value ):
5264 deprecated .warn (value )
@@ -57,18 +69,24 @@ class RelatedTTPs(GenericRelationshipList):
5769 _namespace = "http://stix.mitre.org/Campaign-1"
5870 _binding = campaign_binding
5971 _binding_class = campaign_binding .RelatedTTPsType
60- _binding_var = "Related_TTP"
61- _contained_type = RelatedTTP
62- _inner_name = "ttps"
72+
73+ ttp = fields .TypedField ("Related_TTP" , RelatedTTP , multiple = True , key_name = "ttps" )
74+
75+ @classmethod
76+ def _dict_as_list (cls ):
77+ return False
6378
6479
6580class Names (stix .EntityList ):
6681 _namespace = "http://stix.mitre.org/Campaign-1"
6782 _binding = campaign_binding
6883 _binding_class = campaign_binding .NamesType
69- _binding_var = "Name"
70- _contained_type = VocabString
71- _inner_name = "names"
84+
85+ name = VocabField ("Name" , multiple = True , key_name = "names" )
86+
87+ @classmethod
88+ def _dict_as_list (cls ):
89+ return False
7290
7391
7492class Campaign (stix .BaseCoreComponent ):
0 commit comments