| 14 | |
| 15 | |
| 16 | class ToolInformation(stix.Entity, cybox.common.ToolInformation): |
| 17 | _namespace = 'http://docs.oasis-open.org/cti/ns/stix/common-1' |
| 18 | _binding = common_binding |
| 19 | _binding_class = common_binding.ToolInformationType |
| 20 | |
| 21 | title = fields.TypedField("Title") |
| 22 | short_descriptions = fields.TypedField("Short_Description", StructuredTextList) |
| 23 | |
| 24 | def __init__(self, title=None, short_description=None, tool_name=None, tool_vendor=None): |
| 25 | super(ToolInformation, self).__init__(tool_name=tool_name, tool_vendor=tool_vendor) |
| 26 | self.title = title |
| 27 | self.short_description = StructuredTextList(short_description) |
| 28 | |
| 29 | @property |
| 30 | def short_description(self): |
| 31 | """A single short description about the contents or purpose of this |
| 32 | object. |
| 33 | |
| 34 | Default Value: ``None`` |
| 35 | |
| 36 | Note: |
| 37 | If this object has more than one short description set, this will |
| 38 | return the short description with the lowest ordinality value. |
| 39 | |
| 40 | Returns: |
| 41 | An instance of |
| 42 | :class:`.StructuredText` |
| 43 | |
| 44 | """ |
| 45 | return next(iter(self.short_descriptions), None) |
| 46 | |
| 47 | @short_description.setter |
| 48 | def short_description(self, value): |
| 49 | self.short_descriptions = value |
| 50 | |
| 51 | def add_short_description(self, description): |
| 52 | """Adds a description to the ``short_descriptions`` collection. |
| 53 | |
| 54 | This is the same as calling "foo.short_descriptions.add(bar)". |
| 55 | |
| 56 | """ |
| 57 | self.short_descriptions.add(description) |