def to_dict(self): d = utils.to_dict(self) if 'version' in d: d['version'] = STIXPackage._version # noqa 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
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
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
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
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
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
def to_dict(self): return utils.to_dict(self)
def to_dict(self): d = utils.to_dict(self) return d