in greengrasssdk/stream_manager/data/__init__.py [0:0]
def from_dict(d):
v = {}
if "eventType" in d:
v["event_type"] = (
EventType.from_dict(d["eventType"])
if hasattr(EventType, "from_dict")
else d["eventType"]
)
if "statusLevel" in d:
v["status_level"] = (
StatusLevel.from_dict(d["statusLevel"])
if hasattr(StatusLevel, "from_dict")
else d["statusLevel"]
)
if "status" in d:
v["status"] = (
Status.from_dict(d["status"])
if hasattr(Status, "from_dict")
else d["status"]
)
if "statusContext" in d:
v["status_context"] = (
StatusContext.from_dict(d["statusContext"])
if hasattr(StatusContext, "from_dict")
else d["statusContext"]
)
if "message" in d:
v["message"] = (
str.from_dict(d["message"])
if hasattr(str, "from_dict")
else d["message"]
)
if "timestampEpochMs" in d:
v["timestamp_epoch_ms"] = (
int.from_dict(d["timestampEpochMs"])
if hasattr(int, "from_dict")
else d["timestampEpochMs"]
)
return StatusMessage(**v)