"""
Interfaces for Mimic.
"""

from zope.interface import Attribute, Interface


class IAPIMock(Interface):
    """
    An :obj:`IAPIMock` provides an API.
    """

    def catalog_entries(tenant_id):  # pragma:nocover
        """
        Generate some :obj:`mimic.catalog.Entry` objects given the tenant ID.

        :param unicode tenant_id: the semi-internal tenant ID generated by
            Mimic.
        """

    def resource_for_region(region, uri_prefix,
                            session_store):  # pragma:nocover
        """
        Get a resource for the given region.
        """


class ICredential(Interface):
    """
    An :obj:`ICredential` provides identity authentication credentials.
    """
    type_key = Attribute("The type key to look for in a JSON dictionary "
                         "representing the credential.")

    def get_session(session_store):  # pragma:nocover
        """
        Get a session corresponding to the user and tenant from the given
        session store.

        :param session_store: The store of all sessions for all tenants for
            all plugins across all regions.
        :type session_store: :class:`mimic.session.SessionStore`

        :return: A session corresponding to the user and plugin data for a
            single tenant for all plugins across all regions.
        :rtype: :class:`mimic.session.SessionStore`
        """
