def key_value_match(endpoint, filters):
    """Checks if endpoint matches all filters.

    Args:
        endpoint: Endpoint named tuple to check for filter match.
        filters: Dictionary of filters to check for.
    Returns:
        True if endpoints match filters.
    """
    for key, exp_value in filters.items():
        if not isinstance(exp_value, (int, str)) and exp_value is not None:
            raise TypeError('Illegal filter: {}={}'.format(key, exp_value))
        property_value = endpoint.__getattribute__(key)
        if property_value != exp_value:
            return False
    return True