def METHOD_NAME(obj_dict: dict) -> ExportMessageTree | ExportMessageNode:
    # validate data
    if "message_id" in obj_dict:
        return pydantic.parse_obj_as(ExportMessageNode, obj_dict)
    elif "message_tree_id" in obj_dict:
        return pydantic.parse_obj_as(ExportMessageTree, obj_dict)
    raise RuntimeError("Unknown object in jsonl file")