fix: intengrate data read model
Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com>
This commit is contained in:
parent
56489682c5
commit
09062e35ff
|
@ -52,7 +52,7 @@ class CloudEvent(abstract.CloudEvent):
|
||||||
:type data: typing.Any
|
:type data: typing.Any
|
||||||
"""
|
"""
|
||||||
self._attributes = {k.lower(): v for k, v in attributes.items()}
|
self._attributes = {k.lower(): v for k, v in attributes.items()}
|
||||||
self._data = data
|
self.data = data
|
||||||
if "specversion" not in self._attributes:
|
if "specversion" not in self._attributes:
|
||||||
self._attributes["specversion"] = "1.0"
|
self._attributes["specversion"] = "1.0"
|
||||||
if "id" not in self._attributes:
|
if "id" not in self._attributes:
|
||||||
|
@ -79,12 +79,8 @@ class CloudEvent(abstract.CloudEvent):
|
||||||
return self._attributes
|
return self._attributes
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def data(self) -> typing.Optional[typing.Any]:
|
def _data_read_model(self) -> typing.Optional[typing.Any]:
|
||||||
return self._data
|
return self.data
|
||||||
|
|
||||||
@data.setter
|
|
||||||
def data(self, value) -> None:
|
|
||||||
self._data = value
|
|
||||||
|
|
||||||
def __setitem__(self, key: str, value: typing.Any) -> None:
|
def __setitem__(self, key: str, value: typing.Any) -> None:
|
||||||
self._attributes[key] = value
|
self._attributes[key] = value
|
||||||
|
|
Loading…
Reference in New Issue