Beispiel #1
0
    def to_dict(self):
        d = utils.to_dict(self)

        if 'version' in d:
            d['version'] = STIXPackage._version  # noqa

        return d
Beispiel #2
0
    def to_dict(self):
        d = utils.to_dict(self, skip=('item', ))

        if self.item:
            d[self._inner_var.lower()] = self.item.to_dict()

        return d
Beispiel #3
0
    def to_dict(self):
        d = utils.to_dict(self, skip=('timestamp_precision',))

        if self.timestamp_precision != 'second':
            d['timestamp_precision'] = self.timestamp_precision

        return d
Beispiel #4
0
    def to_dict(self):
        d = utils.to_dict(self)

        if getattr(self, '_XSI_TYPE', None):
            d['xsi:type'] = self._XSI_TYPE

        return d
    def to_dict(self):
        d = utils.to_dict(self)

        if getattr(self, '_XSI_TYPE', None):
            d['xsi:type'] = self._XSI_TYPE

        return d
    def to_dict(self):
        d = utils.to_dict(self, skip=('item',))

        if self.item:
            d[self._inner_var.lower()] = self.item.to_dict()

        return d
Beispiel #7
0
    def to_dict(self):
        d = utils.to_dict(self, skip=('timestamp_precision',))

        if self.timestamp_precision != 'second':
            d['timestamp_precision'] = self.timestamp_precision

        return d
Beispiel #8
0
    def to_dict(self):
        d = utils.to_dict(self)

        if 'version' in d:
            d['version'] = STIXPackage._version  # noqa

        return d
Beispiel #9
0
    def to_dict(self):
        skip = ("timestamp_precision",)
        d = utils.to_dict(self, skip=skip)

        if self.timestamp_precision != "second":
            d["timestamp_precision"] = self.timestamp_precision

        return d
Beispiel #10
0
    def to_dict(self):
        keys = ('observables', 'observable_composition_operator', 'negate')
        d = utils.to_dict(self, skip=keys)

        if self.negate:
            d['negate'] = True

        if self.observables:
            if len(self.observables) == 1:
                d['observable'] = self.observables[0].to_dict()
            else:
                composite_observable = self._merge_observables(self.observables)
                d['observable'] = composite_observable.to_dict()

        return d
Beispiel #11
0
    def to_dict(self):
        keys = ('observables', 'observable_composition_operator', 'negate')
        d = utils.to_dict(self, skip=keys)

        if self.negate:
            d['negate'] = True

        if self.observables:
            if len(self.observables) == 1:
                d['observable'] = self.observables[0].to_dict()
            else:
                composite_observable = self._merge_observables(
                    self.observables)
                d['observable'] = composite_observable.to_dict()

        return d
Beispiel #12
0
 def to_dict(self):
     return utils.to_dict(self)
Beispiel #13
0
 def to_dict(self):
     d = utils.to_dict(self)
     return d
Beispiel #14
0
 def to_dict(self):
     d = utils.to_dict(self)
     return d
Beispiel #15
0
 def to_dict(self):
     return utils.to_dict(self)