feat: define abstract methods
Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com>
This commit is contained in:
parent
09062e35ff
commit
a96bd6cdde
|
@ -9,6 +9,7 @@ class CloudEvent(abc.ABC):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@abc.abstractmethod
|
||||||
def create(
|
def create(
|
||||||
cls,
|
cls,
|
||||||
attributes: typing.Dict[str, typing.Any],
|
attributes: typing.Dict[str, typing.Any],
|
||||||
|
@ -20,9 +21,10 @@ class CloudEvent(abc.ABC):
|
||||||
we MUST NOT assume how the __init__ function looks across different python
|
we MUST NOT assume how the __init__ function looks across different python
|
||||||
frameworks
|
frameworks
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError()
|
pass
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@abc.abstractmethod
|
||||||
def _attributes_read_model(self) -> typing.Dict[str, typing.Any]:
|
def _attributes_read_model(self) -> typing.Dict[str, typing.Any]:
|
||||||
"""
|
"""
|
||||||
:return: attributes of this event
|
:return: attributes of this event
|
||||||
|
@ -30,16 +32,17 @@ class CloudEvent(abc.ABC):
|
||||||
you MUST NOT mutate this dict
|
you MUST NOT mutate this dict
|
||||||
implementation MAY assume the dic will not be mutated
|
implementation MAY assume the dic will not be mutated
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError()
|
pass
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@abc.abstractmethod
|
||||||
def _data_read_model(self) -> typing.Optional[typing.Any]:
|
def _data_read_model(self) -> typing.Optional[typing.Any]:
|
||||||
"""
|
"""
|
||||||
:return: data value of the event
|
:return: data value of the event
|
||||||
you MUST NOT mutate this value
|
you MUST NOT mutate this value
|
||||||
implementation MAY assume the value will not be mutated
|
implementation MAY assume the value will not be mutated
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError()
|
pass
|
||||||
|
|
||||||
def __setitem__(self, key: str, value: typing.Any) -> None:
|
def __setitem__(self, key: str, value: typing.Any) -> None:
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
Loading…
Reference in New Issue