Skip to content

Commit

Permalink
chore: rename payload from data to message
Browse files Browse the repository at this point in the history
  • Loading branch information
airkei committed Jan 7, 2025
1 parent 7992ad4 commit 0779418
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion proto/otaclient_iot_logging_server_v1.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ message PutLogRequest {
LogType log_type = 2;
uint64 timestamp = 3;
LogLevel level = 4;
string data = 5;
string message = 5;
}

message PutLogResponse {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,24 @@ SERVER_ERROR: ErrorCode
NOT_ALLOWED_ECU_ID: ErrorCode

class PutLogRequest(_message.Message):
__slots__ = ["ecu_id", "log_type", "timestamp", "level", "data"]
__slots__ = ["ecu_id", "log_type", "timestamp", "level", "message"]
ECU_ID_FIELD_NUMBER: _ClassVar[int]
LOG_TYPE_FIELD_NUMBER: _ClassVar[int]
TIMESTAMP_FIELD_NUMBER: _ClassVar[int]
LEVEL_FIELD_NUMBER: _ClassVar[int]
DATA_FIELD_NUMBER: _ClassVar[int]
MESSAGE_FIELD_NUMBER: _ClassVar[int]
ecu_id: str
log_type: LogType
timestamp: int
level: LogLevel
data: str
message: str
def __init__(
self,
ecu_id: _Optional[str] = ...,
log_type: _Optional[_Union[LogType, str]] = ...,
timestamp: _Optional[int] = ...,
level: _Optional[_Union[LogLevel, str]] = ...,
data: _Optional[str] = ...,
message: _Optional[str] = ...,
) -> None: ...

class PutLogResponse(_message.Message):
Expand Down
2 changes: 1 addition & 1 deletion src/otaclient_iot_logging_server/v1/servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def put_log(self, request: PutLogRequest) -> PutLogResponse:
"""
_ecu_id = request.ecu_id
_timestamp = request.timestamp
_message = request.data
_message = request.message
_allowed_ecus = self._allowed_ecus
# don't allow empty request or unknowned ECUs
# if ECU id is unknown(not listed in ecu_info.yaml), drop this log.
Expand Down
4 changes: 2 additions & 2 deletions src/otaclient_iot_logging_server/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class PutLogRequest(MessageWrapper[pb2.PutLogRequest]):
log_type: LogType
timestamp: int
level: LogLevel
data: str
message: str

def __init__(
self,
Expand All @@ -69,7 +69,7 @@ def __init__(
log_type: _Optional[LogType] = ...,
timestamp: _Optional[int] = ...,
level: _Optional[LogLevel] = ...,
data: _Optional[str] = ...,
message: _Optional[str] = ...,
) -> None: ...


Expand Down

0 comments on commit 0779418

Please sign in to comment.