<s> from cybox . core import Observables <EOL> import stix <EOL> from stix . common import vocabs , related , VocabString , Statement <EOL> import stix . bindings . course_of_action as coa_binding <EOL> from . objective import Objective <EOL> from . structured_coa import _BaseStructuredCOA <EOL> Stage = vocabs . COAStage <EOL> COAType = vocabs . CourseOfActionType <EOL> class RelatedCOAs ( related . GenericRelationshipList ) : <EOL> _namespace = "<STR_LIT>" <EOL> _binding = coa_binding <EOL> _binding_class = coa_binding . RelatedCOAsType <EOL> _binding_var = "<STR_LIT>" <EOL> _contained_type = related . RelatedCOA <EOL> _inner_name = "<STR_LIT>" <EOL> class CourseOfAction ( stix . BaseCoreComponent ) : <EOL> """<STR_LIT>""" <EOL> _binding = coa_binding <EOL> _binding_class = coa_binding . CourseOfActionType <EOL> _namespace = "<STR_LIT>" <EOL> _version = "<STR_LIT>" <EOL> _ALL_VERSIONS = ( "<STR_LIT:1.0>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> _ID_PREFIX = '<STR_LIT>' <EOL> def __init__ ( self , id_ = None , idref = None , timestamp = None , title = None , <EOL> description = None , short_description = None ) : <EOL> super ( CourseOfAction , self ) . __init__ ( <EOL> id_ = id_ , <EOL> idref = idref , <EOL> timestamp = timestamp , <EOL> title = title , <EOL> description = description , <EOL> short_description = short_description <EOL> ) <EOL> self . stage = None <EOL> self . type_ = None <EOL> self . objective = None <EOL> self . parameter_observables = None <EOL> self . structured_coa = None <EOL> self . impact = None <EOL> self . cost = None <EOL> self . efficacy = None <EOL> self . related_coas = RelatedCOAs ( ) <EOL> self . related_packages = related . RelatedPackageRefs ( ) <EOL> @ property <EOL> def stage ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _stage <EOL> @ stage . setter <EOL> def stage ( self , value ) : <EOL> self . _set_vocab ( Stage , stage = value ) <EOL> @ property <EOL> def type_ ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _type <EOL> @ type_ . setter <EOL> def type_ ( self , value ) : <EOL> self . _set_vocab ( COAType , type = value ) <EOL> @ property <EOL> def objective ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _objective <EOL> @ objective . setter <EOL> def objective ( self , value ) : <EOL> self . _set_var ( Objective , try_cast = False , objective = value ) <EOL> @ property <EOL> def impact ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _impact <EOL> @ impact . setter <EOL> def impact ( self , value ) : <EOL> self . _set_var ( Statement , impact = value ) <EOL> @ property <EOL> def cost ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _cost <EOL> @ cost . setter <EOL> def cost ( self , value ) : <EOL> self . _set_var ( Statement , cost = value ) <EOL> @ property <EOL> def efficacy ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _efficacy <EOL> @ efficacy . setter <EOL> def efficacy ( self , value ) : <EOL> self . _set_var ( Statement , efficacy = value ) <EOL> @ property <EOL> def structured_coa ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _structured_coa <EOL> @ structured_coa . setter <EOL> def structured_coa ( self , value ) : <EOL> self . _set_var ( _BaseStructuredCOA , try_cast = False , structured_coa = value ) <EOL> def to_obj ( self , return_obj = None , ns_info = None ) : <EOL> if not return_obj : <EOL> return_obj = self . _binding_class ( ) <EOL> super ( CourseOfAction , self ) . to_obj ( return_obj = return_obj , ns_info = ns_info ) <EOL> if self . stage : <EOL> return_obj . Stage = self . stage . to_obj ( ns_info = ns_info ) <EOL> if self . type_ : <EOL> return_obj . Type = self . type_ . to_obj ( ns_info = ns_info ) <EOL> if self . objective : <EOL> return_obj . Objective = self . objective . to_obj ( ns_info = ns_info ) <EOL> if self . parameter_observables : <EOL> return_obj . Parameter_Observables = self . parameter_observables . to_obj ( ns_info = ns_info ) <EOL> if self . impact : <EOL> return_obj . Impact = self . impact . to_obj ( ns_info = ns_info ) <EOL> if self . cost : <EOL> return_obj . Cost = self . cost . to_obj ( ns_info = ns_info ) <EOL> if self . efficacy : <EOL> return_obj . Efficacy = self . efficacy . to_obj ( ns_info = ns_info ) <EOL> if self . related_coas : <EOL> return_obj . Related_COAs = self . related_coas . to_obj ( ns_info = ns_info ) <EOL> if self . related_packages : <EOL> return_obj . Related_Packages = self . related_packages . to_obj ( ns_info = ns_info ) <EOL> if self . structured_coa : <EOL> return_obj . Structured_COA = self . structured_coa . to_obj ( ns_info = ns_info ) <EOL> return return_obj <EOL> @ classmethod <EOL> def from_obj ( cls , obj , return_obj = None ) : <EOL> if not obj : <EOL> return None <EOL> if not return_obj : <EOL> return_obj = cls ( ) <EOL> super ( CourseOfAction , cls ) . from_obj ( obj , return_obj = return_obj ) <EOL> if isinstance ( obj , cls . _binding_class ) : <EOL> return_obj . title = obj . Title <EOL> return_obj . stage = VocabString . from_obj ( obj . Stage ) <EOL> return_obj . type_ = VocabString . from_obj ( obj . Type ) <EOL> return_obj . objective = Objective . from_obj ( obj . Objective ) <EOL> return_obj . parameter_observables = Observables . from_obj ( obj . Parameter_Observables ) <EOL> return_obj . impact = Statement . from_obj ( obj . Impact ) <EOL> return_obj . cost = Statement . from_obj ( obj . Cost ) <EOL> return_obj . efficacy = Statement . from_obj ( obj . Efficacy ) <EOL> return_obj . related_coas = RelatedCOAs . from_obj ( obj . Related_COAs ) <EOL> return_obj . related_packages = related . RelatedPackageRefs . from_obj ( obj . Related_Packages ) <EOL> return_obj . structured_coa = _BaseStructuredCOA . from_obj ( obj . Structured_COA ) <EOL> return return_obj <EOL> def to_dict ( self ) : <EOL> return super ( CourseOfAction , self ) . to_dict ( ) <EOL> @ classmethod <EOL> def from_dict ( cls , dict_repr , return_obj = None ) : <EOL> if not dict_repr : <EOL> return None <EOL> if not return_obj : <EOL> return_obj = cls ( ) <EOL> super ( CourseOfAction , cls ) . from_dict ( dict_repr , return_obj = return_obj ) <EOL> get = dict_repr . get <EOL> return_obj . stage = VocabString . from_dict ( get ( '<STR_LIT>' ) ) <EOL> return_obj . type_ = VocabString . from_dict ( get ( '<STR_LIT:type>' ) ) <EOL> return_obj . objective = Objective . from_dict ( get ( '<STR_LIT>' ) ) <EOL> return_obj . parameter_observables = Observables . from_dict ( get ( '<STR_LIT>' ) ) <EOL> return_obj . impact = Statement . from_dict ( get ( '<STR_LIT>' ) ) <EOL> return_obj . cost = Statement . from_dict ( get ( '<STR_LIT>' ) ) <EOL> return_obj . efficacy = Statement . from_dict ( get ( '<STR_LIT>' ) ) <EOL> return_obj . related_coas = RelatedCOAs . from_dict ( get ( '<STR_LIT>' ) ) <EOL> return_obj . related_packages = related . RelatedPackageRefs . from_dict ( get ( '<STR_LIT>' ) ) <EOL> return_obj . structured_coa = _BaseStructuredCOA . from_dict ( get ( '<STR_LIT>' ) ) <EOL> return return_obj <EOL> COA = CourseOfAction </s>
