44import cybox
55import cybox .utils as utils
66import cybox .bindings .cybox_core as core_binding
7- from cybox .common import StructuredText , MeasureSource
7+ from cybox .common import VocabString , StructuredText , MeasureSource
88from cybox .core .associated_object import AssociatedObject
99
1010class Action (cybox .Entity ):
@@ -31,8 +31,8 @@ def to_obj(self, action_obj = None):
3131 action_obj = core_binding .ActionType ()
3232 if self .id is not None : action_obj .set_id (self .id )
3333 if self .idref is not None : action_obj .set_idref (self .idref )
34- if self .type is not None : action_obj .set_Type (self .type )
35- if self .name is not None : action_obj .set_Name (self .name )
34+ if self .type is not None : action_obj .set_Type (self .type . to_obj () )
35+ if self .name is not None : action_obj .set_Name (self .name . to_obj () )
3636 if self .ordinal_position is not None : action_obj .set_ordinal_position (self .ordinal_position )
3737 if self .action_status is not None : action_obj .set_action_status (self .action_status )
3838 if self .context is not None : action_obj .set_context (self .context )
@@ -77,8 +77,8 @@ def from_dict(action_dict, action_cls = None):
7777 action_ = action_cls
7878 action_ .id = action_dict .get ('id' )
7979 action_ .idref = action_dict .get ('idref' )
80- action_ .type = action_dict .get ('type' )
81- action_ .name = action_dict .get ('name' )
80+ action_ .type = VocabString . from_dict ( action_dict .get ('type' ) )
81+ action_ .name = VocabString . from_dict ( action_dict .get ('name' ) )
8282 action_ .ordinal_position = action_dict .get ('ordinal_position' )
8383 action_ .action_status = action_dict .get ('action_status' )
8484 action_ .context = action_dict .get ('context' )
0 commit comments