# Path: groupy/api/bots.py
# class Bots(base.Manager):
# class Bot(base.ManagedResource):
#     def __init__(self, session):
#     def list(self):
#     def create(self, name, group_id, avatar_url=None, callback_url=None,
#                dm_notification=None, **kwargs):
#     def post(self, bot_id, text, attachments=None):
#     def destroy(self, bot_id):
#     def __repr__(self):
#     def __eq__(self, other):
#     def post(self, text, attachments=None):
#     def destroy(self):
# 
# Path: groupy/api/groups.py
# class Groups(base.Manager):
# class ChangeOwnersResult:
# class Group(base.ManagedResource):
#     def __init__(self, session):
#     def _raw_list(self, **params):
#     def list(self, page=1, per_page=10, omit=None):
#     def list_all(self, per_page=10, omit=None):
#     def list_former(self):
#     def get(self, id):
#     def create(self, name, description=None, image_url=None, share=None, **kwargs):
#     def update(self, id, name=None, description=None, image_url=None,
#                office_mode=None, share=None, **kwargs):
#     def destroy(self, id):
#     def join(self, group_id, share_token):
#     def rejoin(self, group_id):
#     def change_owners(self, group_id, owner_id):
#     def __init__(self, group_id, owner_id, status):
#     def is_success(self):
#     def __bool__(self):
#     def __init__(self, manager, **data):
#     def __repr__(self):
#     def __eq__(self, other):
#     def is_mine(self):
#     def post(self, text=None, attachments=None):
#     def update(self, name=None, description=None, image_url=None,
#                office_mode=None, share=None, **kwargs):
#     def destroy(self):
#     def rejoin(self):
#     def refresh_from_server(self):
#     def create_bot(self, name, avatar_url=None, callback_url=None, dm_notification=None,
#                    **kwargs):
#     def change_owners(self, user_id):
#     def get_membership(self):
#     def update_membership(self, nickname=None, **kwargs):
#     def leave(self):
# 
# Path: groupy/api/chats.py
# class Chats(base.Manager):
# class Chat(base.ManagedResource):
#     def __init__(self, session):
#     def _raw_list(self, **params):
#     def list(self, page=1, per_page=10):
#     def list_all(self, per_page=10):
#     def __init__(self, manager, **data):
#     def __repr__(self):
#     def post(self, text=None, attachments=None):
# 
# Path: groupy/api/user.py
# class User(base.Manager):
# class SmsMode(base.Manager):
#     def __init__(self, session):
#     def blocks(self):
#     def me(self):
#     def get_me(self):
#     def update(self, **params):
#     def __init__(self, session):
#     def enable(self, duration, registration_id=None):
#     def disable(self):
# 
# Path: groupy/api/attachments.py
# class AttachmentMeta(type):
# class Attachment(base.Resource, metaclass=AttachmentMeta):
# class Location(Attachment):
# class Split(Attachment):
# class Emoji(Attachment):
# class Mentions(Attachment):
# class Image(Attachment):
# class LinkedImage(Image):
# class Images(base.Manager):
#     def __init__(cls, name, bases, attrs):
#     def __init__(self, type, **data):
#     def to_json(self):
#     def from_data(cls, type, **data):
#     def from_bulk_data(cls, attachments):
#     def __init__(self, lat, lng, name, foursqure_venue_id=None):
#     def __init__(self, token):
#     def __init__(self, placeholder, charmap):
#     def __init__(self, loci=None, user_ids=None):
#     def __init__(self, url, source_url=None, file_id=None):
#     def from_file(self, fp):
#     def upload(self, fp):
#     def download(self, image, url_field='url', suffix=None):
#     def download_preview(self, image, url_field='url'):
#     def download_large(self, image, url_field='url'):
#     def download_avatar(self, image, url_field='url'):
# 
# Path: groupy/session.py
# class Session(requests.Session):
#     """An HTTP session for making API requests.
# 
#     This session sets the content type to JSON and injects the API token.
#     """
# 
#     def __init__(self, token):
#         super().__init__()
#         self.headers = {
#             'content-type': 'application/json',
#             'x-access-token': token,
#         }
# 
#     def request(self, *args, **kwargs):
#         # ensure we reraise exceptions as our own
#         try:
#             response = super().request(*args, **kwargs)
#             response.raise_for_status()
#             return Response(response)
#         except requests.HTTPError as e:
#             logger.exception('received a bad response')
#             raise exceptions.BadResponse(response) from e
#         except requests.RequestException as e:
#             logger.exception('could not receive a response')
#             raise exceptions.NoResponse(e.request) from e


from .api import bots
from .api import groups
from .api import chats
from .api import user
from .api import attachments
from .session import Session


class Client:
    """The API client.

    The client is the main point of interaction. It can directly list groups,
    chats, bots, and provide your user information. It can also download
    the image of a message attachment.

    :param session: the request session
    :type session: :class:`~groupy.session.Session`
    """

    def __init__(self, session):
        self.session = session
        self.groups = groups.Groups(self.session)

# Path: groupy/api/bots.py
# class Bots(base.Manager):
# class Bot(base.ManagedResource):
#     def __init__(self, session):
#     def list(self):
#     def create(self, name, group_id, avatar_url=None, callback_url=None,
#                dm_notification=None, **kwargs):
#     def post(self, bot_id, text, attachments=None):
#     def destroy(self, bot_id):
#     def __repr__(self):
#     def __eq__(self, other):
#     def post(self, text, attachments=None):
#     def destroy(self):
# 
# Path: groupy/api/groups.py
# class Groups(base.Manager):
# class ChangeOwnersResult:
# class Group(base.ManagedResource):
#     def __init__(self, session):
#     def _raw_list(self, **params):
#     def list(self, page=1, per_page=10, omit=None):
#     def list_all(self, per_page=10, omit=None):
#     def list_former(self):
#     def get(self, id):
#     def create(self, name, description=None, image_url=None, share=None, **kwargs):
#     def update(self, id, name=None, description=None, image_url=None,
#                office_mode=None, share=None, **kwargs):
#     def destroy(self, id):
#     def join(self, group_id, share_token):
#     def rejoin(self, group_id):
#     def change_owners(self, group_id, owner_id):
#     def __init__(self, group_id, owner_id, status):
#     def is_success(self):
#     def __bool__(self):
#     def __init__(self, manager, **data):
#     def __repr__(self):
#     def __eq__(self, other):
#     def is_mine(self):
#     def post(self, text=None, attachments=None):
#     def update(self, name=None, description=None, image_url=None,
#                office_mode=None, share=None, **kwargs):
#     def destroy(self):
#     def rejoin(self):
#     def refresh_from_server(self):
#     def create_bot(self, name, avatar_url=None, callback_url=None, dm_notification=None,
#                    **kwargs):
#     def change_owners(self, user_id):
#     def get_membership(self):
#     def update_membership(self, nickname=None, **kwargs):
#     def leave(self):
# 
# Path: groupy/api/chats.py
# class Chats(base.Manager):
# class Chat(base.ManagedResource):
#     def __init__(self, session):
#     def _raw_list(self, **params):
#     def list(self, page=1, per_page=10):
#     def list_all(self, per_page=10):
#     def __init__(self, manager, **data):
#     def __repr__(self):
#     def post(self, text=None, attachments=None):
# 
# Path: groupy/api/user.py
# class User(base.Manager):
# class SmsMode(base.Manager):
#     def __init__(self, session):
#     def blocks(self):
#     def me(self):
#     def get_me(self):
#     def update(self, **params):
#     def __init__(self, session):
#     def enable(self, duration, registration_id=None):
#     def disable(self):
# 
# Path: groupy/api/attachments.py
# class AttachmentMeta(type):
# class Attachment(base.Resource, metaclass=AttachmentMeta):
# class Location(Attachment):
# class Split(Attachment):
# class Emoji(Attachment):
# class Mentions(Attachment):
# class Image(Attachment):
# class LinkedImage(Image):
# class Images(base.Manager):
#     def __init__(cls, name, bases, attrs):
#     def __init__(self, type, **data):
#     def to_json(self):
#     def from_data(cls, type, **data):
#     def from_bulk_data(cls, attachments):
#     def __init__(self, lat, lng, name, foursqure_venue_id=None):
#     def __init__(self, token):
#     def __init__(self, placeholder, charmap):
#     def __init__(self, loci=None, user_ids=None):
#     def __init__(self, url, source_url=None, file_id=None):
#     def from_file(self, fp):
#     def upload(self, fp):
#     def download(self, image, url_field='url', suffix=None):
#     def download_preview(self, image, url_field='url'):
#     def download_large(self, image, url_field='url'):
#     def download_avatar(self, image, url_field='url'):
# 
# Path: groupy/session.py
# class Session(requests.Session):
#     """An HTTP session for making API requests.
# 
#     This session sets the content type to JSON and injects the API token.
#     """
# 
#     def __init__(self, token):
#         super().__init__()
#         self.headers = {
#             'content-type': 'application/json',
#             'x-access-token': token,
#         }
# 
#     def request(self, *args, **kwargs):
#         # ensure we reraise exceptions as our own
#         try:
#             response = super().request(*args, **kwargs)
#             response.raise_for_status()
#             return Response(response)
#         except requests.HTTPError as e:
#             logger.exception('received a bad response')
#             raise exceptions.BadResponse(response) from e
#         except requests.RequestException as e:
#             logger.exception('could not receive a response')
#             raise exceptions.NoResponse(e.request) from e


# Path: groupy/client.py
from .api import bots
from .api import groups
from .api import chats
from .api import user
from .api import attachments
from .session import Session



class Client:
    """The API client.

    The client is the main point of interaction. It can directly list groups,
    chats, bots, and provide your user information. It can also download
    the image of a message attachment.

    :param session: the request session
    :type session: :class:`~groupy.session.Session`
    """

    def __init__(self, session):
        self.session = session
        self.groups = groups.Groups(self.session)

        self.chats = chats.Chats(self.session)