How to use the zenpy.lib.chat_api.ChatApiBase function in zenpy

To help you get started, we’ve selected a few zenpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facetoe / zenpy / zenpy / lib / chat_api.py View on Github external
def __init__(self, config, endpoint):
        super(ChatApi, self).__init__(config, endpoint=endpoint)

        self.accounts = ChatApiBase(config, endpoint.account, request_handler=AccountRequest)

        self.agents = AgentApi(config, endpoint.agents)

        self.visitors = ChatApiBase(config, endpoint.visitors, request_handler=VisitorRequest)

        self.shortcuts = ChatApiBase(config, endpoint.shortcuts)

        self.triggers = ChatApiBase(config, endpoint.triggers)

        self.bans = ChatApiBase(config, endpoint.bans)

        self.departments = ChatApiBase(config, endpoint.departments)

        self.goals = ChatApiBase(config, endpoint.goals)

        self.stream = ChatApiBase(config, endpoint.stream)
github facetoe / zenpy / zenpy / lib / chat_api.py View on Github external
def __init__(self, config, endpoint):
        super(ChatApi, self).__init__(config, endpoint=endpoint)

        self.accounts = ChatApiBase(config, endpoint.account, request_handler=AccountRequest)

        self.agents = AgentApi(config, endpoint.agents)

        self.visitors = ChatApiBase(config, endpoint.visitors, request_handler=VisitorRequest)

        self.shortcuts = ChatApiBase(config, endpoint.shortcuts)

        self.triggers = ChatApiBase(config, endpoint.triggers)

        self.bans = ChatApiBase(config, endpoint.bans)

        self.departments = ChatApiBase(config, endpoint.departments)

        self.goals = ChatApiBase(config, endpoint.goals)

        self.stream = ChatApiBase(config, endpoint.stream)
github facetoe / zenpy / zenpy / lib / chat_api.py View on Github external
def __init__(self, config, endpoint):
        super(ChatApi, self).__init__(config, endpoint=endpoint)

        self.accounts = ChatApiBase(config, endpoint.account, request_handler=AccountRequest)

        self.agents = AgentApi(config, endpoint.agents)

        self.visitors = ChatApiBase(config, endpoint.visitors, request_handler=VisitorRequest)

        self.shortcuts = ChatApiBase(config, endpoint.shortcuts)

        self.triggers = ChatApiBase(config, endpoint.triggers)

        self.bans = ChatApiBase(config, endpoint.bans)

        self.departments = ChatApiBase(config, endpoint.departments)

        self.goals = ChatApiBase(config, endpoint.goals)

        self.stream = ChatApiBase(config, endpoint.stream)
github facetoe / zenpy / zenpy / lib / chat_api.py View on Github external
def _get_ip_address(self, ips):
        for ip in ips:
            yield self._object_manager.object_from_json('ip_address', ip)


class AgentApi(ChatApiBase):
    def __init__(self, config, endpoint):
        super(AgentApi, self).__init__(config,
                                       endpoint=endpoint,
                                       request_handler=AgentRequest)

    def me(self):
        return self._get(self._build_url(self.endpoint.me()))


class ChatApi(ChatApiBase):
    def __init__(self, config, endpoint):
        super(ChatApi, self).__init__(config, endpoint=endpoint)

        self.accounts = ChatApiBase(config, endpoint.account, request_handler=AccountRequest)

        self.agents = AgentApi(config, endpoint.agents)

        self.visitors = ChatApiBase(config, endpoint.visitors, request_handler=VisitorRequest)

        self.shortcuts = ChatApiBase(config, endpoint.shortcuts)

        self.triggers = ChatApiBase(config, endpoint.triggers)

        self.bans = ChatApiBase(config, endpoint.bans)

        self.departments = ChatApiBase(config, endpoint.departments)
github facetoe / zenpy / zenpy / lib / chat_api.py View on Github external
def __init__(self, config, endpoint):
        super(ChatApi, self).__init__(config, endpoint=endpoint)

        self.accounts = ChatApiBase(config, endpoint.account, request_handler=AccountRequest)

        self.agents = AgentApi(config, endpoint.agents)

        self.visitors = ChatApiBase(config, endpoint.visitors, request_handler=VisitorRequest)

        self.shortcuts = ChatApiBase(config, endpoint.shortcuts)

        self.triggers = ChatApiBase(config, endpoint.triggers)

        self.bans = ChatApiBase(config, endpoint.bans)

        self.departments = ChatApiBase(config, endpoint.departments)

        self.goals = ChatApiBase(config, endpoint.goals)

        self.stream = ChatApiBase(config, endpoint.stream)
github facetoe / zenpy / zenpy / lib / chat_api.py View on Github external
self.accounts = ChatApiBase(config, endpoint.account, request_handler=AccountRequest)

        self.agents = AgentApi(config, endpoint.agents)

        self.visitors = ChatApiBase(config, endpoint.visitors, request_handler=VisitorRequest)

        self.shortcuts = ChatApiBase(config, endpoint.shortcuts)

        self.triggers = ChatApiBase(config, endpoint.triggers)

        self.bans = ChatApiBase(config, endpoint.bans)

        self.departments = ChatApiBase(config, endpoint.departments)

        self.goals = ChatApiBase(config, endpoint.goals)

        self.stream = ChatApiBase(config, endpoint.stream)
github facetoe / zenpy / zenpy / lib / chat_api.py View on Github external
def __init__(self, config, endpoint):
        super(ChatApi, self).__init__(config, endpoint=endpoint)

        self.accounts = ChatApiBase(config, endpoint.account, request_handler=AccountRequest)

        self.agents = AgentApi(config, endpoint.agents)

        self.visitors = ChatApiBase(config, endpoint.visitors, request_handler=VisitorRequest)

        self.shortcuts = ChatApiBase(config, endpoint.shortcuts)

        self.triggers = ChatApiBase(config, endpoint.triggers)

        self.bans = ChatApiBase(config, endpoint.bans)

        self.departments = ChatApiBase(config, endpoint.departments)

        self.goals = ChatApiBase(config, endpoint.goals)

        self.stream = ChatApiBase(config, endpoint.stream)
github facetoe / zenpy / zenpy / lib / chat_api.py View on Github external
def __init__(self, config, endpoint):
        super(ChatApi, self).__init__(config, endpoint=endpoint)

        self.accounts = ChatApiBase(config, endpoint.account, request_handler=AccountRequest)

        self.agents = AgentApi(config, endpoint.agents)

        self.visitors = ChatApiBase(config, endpoint.visitors, request_handler=VisitorRequest)

        self.shortcuts = ChatApiBase(config, endpoint.shortcuts)

        self.triggers = ChatApiBase(config, endpoint.triggers)

        self.bans = ChatApiBase(config, endpoint.bans)

        self.departments = ChatApiBase(config, endpoint.departments)

        self.goals = ChatApiBase(config, endpoint.goals)

        self.stream = ChatApiBase(config, endpoint.stream)
github facetoe / zenpy / zenpy / lib / chat_api.py View on Github external
self.agents = AgentApi(config, endpoint.agents)

        self.visitors = ChatApiBase(config, endpoint.visitors, request_handler=VisitorRequest)

        self.shortcuts = ChatApiBase(config, endpoint.shortcuts)

        self.triggers = ChatApiBase(config, endpoint.triggers)

        self.bans = ChatApiBase(config, endpoint.bans)

        self.departments = ChatApiBase(config, endpoint.departments)

        self.goals = ChatApiBase(config, endpoint.goals)

        self.stream = ChatApiBase(config, endpoint.stream)
github facetoe / zenpy / zenpy / lib / chat_api.py View on Github external
def __init__(self, config, endpoint, request_handler=None):
        super(ChatApiBase, self).__init__(config,
                                          object_type='chat',
                                          endpoint=endpoint)
        self._request_handler = request_handler or ChatApiRequest
        self._object_manager = ChatObjectManager(self)
        self._url_template = "%(protocol)s://www.zopim.com/%(api_prefix)s"
        self._response_handlers = (
            DeleteResponseHandler,
            ChatSearchResponseHandler,
            ChatResponseHandler,
            AccountResponseHandler,
            AgentResponseHandler,
            VisitorResponseHandler,
            ShortcutResponseHandler,
            TriggerResponseHandler,
            BanResponseHandler,
            DepartmentResponseHandler,