def METHOD_NAME(item: "Output"):
    ret: Dict[str, Any] = {item.PARAM_PATH: item.def_path}
    if item.hash_name not in LEGACY_HASH_NAMES:
        ret[item.PARAM_HASH] = "md5"
    if item.hash_info.isdir and kwargs.get("with_files"):
        obj = item.obj or item.get_obj()
        if obj:
            assert isinstance(obj, Tree)
            ret[item.PARAM_FILES] = [
                split_file_meta_from_cloud(f)
                for f in _serialize_tree_obj_to_files(obj)
            ]
    else:
        meta_d = item.meta.to_dict()
        meta_d.pop("isdir", None)
        ret.update(_serialize_hi_to_dict(item.hash_info))
        ret.update(split_file_meta_from_cloud(meta_d))
    return ret