cti-python-stix2/stix2/bundle.py

25 lines
579 B
Python
Raw Normal View History

2017-02-10 22:35:02 +01:00
"""STIX 2 Bundle object"""
from .base import _STIXBase
from .properties import IDProperty, TypeProperty
2017-02-10 22:35:02 +01:00
class Bundle(_STIXBase):
_type = 'bundle'
_properties = {
'type': TypeProperty(_type),
2017-02-24 17:20:24 +01:00
'id': IDProperty(_type),
2017-02-10 22:35:02 +01:00
'spec_version': {
'fixed': "2.0",
},
'objects': {},
}
def __init__(self, *args, **kwargs):
# Add any positional arguments to the 'objects' kwarg.
if args:
kwargs['objects'] = kwargs.get('objects', []) + list(args)
super(Bundle, self).__init__(**kwargs)