Message classes allow dynamic attribute access to message fields. Childs get exposed through a dedicated class by attributes too. Message type fields and childs have types that get enforces. None type is allowed too while transitioning.
17 lines
259 B
Python
17 lines
259 B
Python
#!/usr/bin/env python3
|
|
|
|
from . import Request, Response, request_type, response_type
|
|
|
|
|
|
@request_type
|
|
class Ping(Request):
|
|
FIELDS = {
|
|
"timeStamp": int,
|
|
}
|
|
|
|
|
|
@response_type
|
|
class PingResp(Response):
|
|
FIELDS = {
|
|
"timeStamp": int,
|
|
}
|