def METHOD_NAME(cls, message_dict: Dict[str, Any]) -> "MessageDb":
    """
    Utility function to translate Aleph message dictionaries, such as those returned by the API,
    in the corresponding DB object.
    """
    item_hash = message_dict["item_hash"]
    return cls(
        item_hash=item_hash,
        type=message_dict["type"],
        chain=Chain(message_dict["chain"]),
        sender=message_dict["sender"],
        signature=message_dict["signature"],
        item_type=ItemType(message_dict.get("item_type", ItemType.inline)),
        item_content=message_dict.get("item_content"),
        content=message_dict["content"],
        time=timestamp_to_datetime(message_dict["time"]),
        channel=message_dict.get("channel"),
        size=message_dict.get("size", 0),
    )