import connexion
from swagger_server.models.link_provider_model import LinkProviderModel
from datetime import date, datetime
from typing import List, Dict
from six import iteritems
from ..util import deserialize_date, deserialize_datetime
from swagger_server.eu.dnetlib.v2.DLIESConnector import dli_index


def get_source_publisher_collection(name=None):
    """
    get_source_publisher_collection
    Return a List of all Publishers that provide source objects in Scholix links and the total number of links where the source object come from this publisher
    :param name: filter for link Provider Name
    :type name: str

    :rtype: List[LinkProviderModel]
    """
    return dli_index.list_publisher('source', name)


def get_target_publisher_collection(name=None):
    """
    get_target_publisher_collection
    Return a List of all Publishers that provide source objects in Scholix links and the total number of links where the target object come from this publisher
    :param name: filter for link Provider Name
    :type name: str

    :rtype: List[LinkProviderModel]
    """
    return dli_index.list_publisher('target', name)
