# -*- coding: utf-8 -*-
"""auto generated by script at 2017-08-24 21:50:13.459796.

don't edit it.

"""
import attr

from aiobearychat.abc import Requester
from aiobearychat.openapi.meta_api import MetaAPI
from aiobearychat.openapi.team_api import TeamAPI
from aiobearychat.openapi.user_api import UserAPI
from aiobearychat.openapi.vchannel_api import VchannelAPI
from aiobearychat.openapi.channel_api import ChannelAPI
from aiobearychat.openapi.session_channel_api import SessionChannelAPI
from aiobearychat.openapi.p2p_api import P2pAPI
from aiobearychat.openapi.message_api import MessageAPI
from aiobearychat.openapi.emoji_api import EmojiAPI
from aiobearychat.openapi.sticker_api import StickerAPI
from aiobearychat.openapi.rtm_api import RtmAPI


class OpenAPI:
    """开放 API (OpenAPI) 服务.

    :param requester: 实际进行请求操作 requester
    :type requester: `aiobearychat.abc.Requester`
    :param token: RTM token, 目前可以通过创建 hubot 机器人获得
    :type token: str
    :param base_url: 开放 API 的基地址
    :type base_url: str

    """

    #: 开放 API 的基地址
    base_url = 'https://api.bearychat.com/v1'  # type: str

    def __init__(self, requester: Requester, token: str = attr.NOTHING, *,
                 base_url: str = ''):
        #: 开放 API 的基地址
        self.base_url = base_url or self.base_url  # type: str
        self._token = token    # type: str
        #: meta 相关 API
        self.meta = MetaAPI(
            requester, token=token, base_url=self.base_url
        )  # type: MetaAPI
        #: 团队相关 API
        self.team = TeamAPI(
            requester, token=token, base_url=self.base_url
        )  # type: TeamAPI
        #: 用户相关 API
        self.user = UserAPI(
            requester, token=token, base_url=self.base_url
        )  # type: UserAPI
        #: 聊天会话相关 API
        self.vchannel = VchannelAPI(
            requester, token=token, base_url=self.base_url
        )  # type: VchannelAPI
        #: 讨论组相关 API
        self.channel = ChannelAPI(
            requester, token=token, base_url=self.base_url
        )  # type: ChannelAPI
        #: 临时讨论组相关 API
        self.session_channel = SessionChannelAPI(
            requester, token=token, base_url=self.base_url
        )  # type: SessionChannelAPI
        #: P2P 会话相关 API
        self.p2p = P2pAPI(
            requester, token=token, base_url=self.base_url
        )  # type: P2pAPI
        #: 消息相关 API
        self.message = MessageAPI(
            requester, token=token, base_url=self.base_url
        )  # type: MessageAPI
        #: 团队自定义 emoji 相关 API
        self.emoji = EmojiAPI(
            requester, token=token, base_url=self.base_url
        )  # type: EmojiAPI
        #: 团队 sticker 相关 API
        self.sticker = StickerAPI(
            requester, token=token, base_url=self.base_url
        )  # type: StickerAPI
        #: RTM 相关 API
        self.rtm = RtmAPI(
            requester, token=token, base_url=self.base_url
        )  # type: RtmAPI
