import functools
import json

import lara_django_samples_grpc.v1.lara_django_samples_pb2 as lara_django_samp_pb2

def dict_filter(func):
    @functools.wraps(func)
    def wrapper_filter(filter_dict : dict={}, **kwargs):
        metadata = (("filters", (json.dumps(filter_dict))),)
        return func.List(lara_django_samp_pb2.SampleListRequest(), metadata=metadata, **kwargs)
    return wrapper_filter

