# Path: groupy/pagers.py
# class Pager:
# class GroupList(Pager):
# class ChatList(GroupList):
# class MessageList(Pager):
# class GalleryList(MessageList):
#     def __init__(self, manager, endpoint, **params):
#     def __getitem__(self, index):
#     def __iter__(self):
#     def set_next_page_params(self):
#     def fetch(self):
#     def fetch_next(self):
#     def autopage(self):
#     def set_next_page_params(self):
#     def __init__(self, manager, endpoint, **params):
#     def detect_mode(cls, **params):
#     def set_next_page_params(self):
#     def get_last_item_index(self):
#     def get_next_page_param(self, item):
#     def fetch_next(self):
#     def get_next_page_param(self, item):
# 
# Path: groupy/utils.py
# def urljoin(base, path=None):
# def parse_share_url(share_url):
# def get_rfc3339(when):
# def get_datetime(timestamp):
#     def __init__(self, key, value):
#     def __repr__(self):
#     def __call__(self, obj):
#     def __init__(self, tests):
#     def __call__(self, objects):
#     def find(self, objects):
#     def passes(self, obj):
# def make_filter(**tests):
# class AttrTest:
# class Filter:


from . import base
from . import messages
from groupy import pagers
from groupy import utils


class Chats(base.Manager):
    """A chat manager."""

    def __init__(self, session):
        super().__init__(session, 'chats')

    def _raw_list(self, **params):
        response = self.session.get(self.url, params=params)
        return [Chat(self, **chat) for chat in response.data]

    def list(self, page=1, per_page=10):
        """List a page of chats.

        :param int page: which page
        :param int per_page: how many chats per page
        :return: chats with other users
        :rtype: :class:`~groupy.pagers.ChatList`
        """

# Path: groupy/pagers.py
# class Pager:
# class GroupList(Pager):
# class ChatList(GroupList):
# class MessageList(Pager):
# class GalleryList(MessageList):
#     def __init__(self, manager, endpoint, **params):
#     def __getitem__(self, index):
#     def __iter__(self):
#     def set_next_page_params(self):
#     def fetch(self):
#     def fetch_next(self):
#     def autopage(self):
#     def set_next_page_params(self):
#     def __init__(self, manager, endpoint, **params):
#     def detect_mode(cls, **params):
#     def set_next_page_params(self):
#     def get_last_item_index(self):
#     def get_next_page_param(self, item):
#     def fetch_next(self):
#     def get_next_page_param(self, item):
# 
# Path: groupy/utils.py
# def urljoin(base, path=None):
# def parse_share_url(share_url):
# def get_rfc3339(when):
# def get_datetime(timestamp):
#     def __init__(self, key, value):
#     def __repr__(self):
#     def __call__(self, obj):
#     def __init__(self, tests):
#     def __call__(self, objects):
#     def find(self, objects):
#     def passes(self, obj):
# def make_filter(**tests):
# class AttrTest:
# class Filter:


# Path: groupy/api/chats.py
from . import base
from . import messages
from groupy import pagers
from groupy import utils



class Chats(base.Manager):
    """A chat manager."""

    def __init__(self, session):
        super().__init__(session, 'chats')

    def _raw_list(self, **params):
        response = self.session.get(self.url, params=params)
        return [Chat(self, **chat) for chat in response.data]

    def list(self, page=1, per_page=10):
        """List a page of chats.

        :param int page: which page
        :param int per_page: how many chats per page
        :return: chats with other users
        :rtype: :class:`~groupy.pagers.ChatList`
        """

        return pagers.ChatList(self, self._raw_list, per_page=per_page,