# Path: alignak_app/backend/backend.py
# class BackendClient(object):
#     def __init__(self):
#     def login(self, username=None, password=None, proxies=None, check=False):
#     def get(self, endpoint, params=None, projection=None, all_items=False):
#     def post(self, endpoint, data, headers=None):  # pragma: no cover - Post already test by client
#     def patch(self, endpoint, data, headers):
#     def acknowledge(self, item, sticky, notify, comment):  # pragma: no cover
#     def downtime(self, item, fixed, duration, start_stamp, end_stamp, comment):  # pragma: no cover
#     def query_realms(self):
#     def query_timeperiods(self):
#     def query_user(self):
#     def query_hosts(self):
#     def query_services(self, host_id=None):
#     def query_services_problems(self, state):
#     def query_alignakdaemons(self):
#     def query_livesynthesis(self):
#     def query_history(self, hostname=None, host_id=None):
#     def query_notifications(self):  # pragma: no cover, notifications can be empty
#     def get_backend_status_icon(self):
#     def get_ws_status_icon(self):


from logging import getLogger
from PyQt5.Qt import QThread
from alignak_app.backend.backend import app_backend
        self.data = data

    def run(self):  # pragma: no cover
        """
        Run the QThread. Trigger actions depending on the selected name

        """

        if app_backend.connected:
            logger.debug('Launch a new thread request for backend: %s', self.name)
            if 'user' in self.name:
                app_backend.query_user()
            elif 'host' in self.name:
                app_backend.query_hosts()
            elif 'service' in self.name:
                app_backend.query_services(self.data)
            elif self.name in self.problem_states:
                app_backend.query_services_problems(self.name)
            elif 'alignakdaemon' in self.name:
                app_backend.query_alignakdaemons()
            elif 'livesynthesis' in self.name:
                app_backend.query_livesynthesis()
            elif 'realm' in self.name:
                app_backend.query_realms()
            elif 'timeperiod' in self.name:
                app_backend.query_timeperiods()
            elif self.name == 'history':
                if self.data:
                    app_backend.query_history(self.data['hostname'], self.data['host_id'])
                else:

# Path: alignak_app/backend/backend.py
# class BackendClient(object):
#     def __init__(self):
#     def login(self, username=None, password=None, proxies=None, check=False):
#     def get(self, endpoint, params=None, projection=None, all_items=False):
#     def post(self, endpoint, data, headers=None):  # pragma: no cover - Post already test by client
#     def patch(self, endpoint, data, headers):
#     def acknowledge(self, item, sticky, notify, comment):  # pragma: no cover
#     def downtime(self, item, fixed, duration, start_stamp, end_stamp, comment):  # pragma: no cover
#     def query_realms(self):
#     def query_timeperiods(self):
#     def query_user(self):
#     def query_hosts(self):
#     def query_services(self, host_id=None):
#     def query_services_problems(self, state):
#     def query_alignakdaemons(self):
#     def query_livesynthesis(self):
#     def query_history(self, hostname=None, host_id=None):
#     def query_notifications(self):  # pragma: no cover, notifications can be empty
#     def get_backend_status_icon(self):
#     def get_ws_status_icon(self):


# Path: alignak_app/qobjects/threads/thread.py
from logging import getLogger
from PyQt5.Qt import QThread
from alignak_app.backend.backend import app_backend

        self.data = data

    def run(self):  # pragma: no cover
        """
        Run the QThread. Trigger actions depending on the selected name

        """

        if app_backend.connected:
            logger.debug('Launch a new thread request for backend: %s', self.name)
            if 'user' in self.name:
                app_backend.query_user()
            elif 'host' in self.name:
                app_backend.query_hosts()
            elif 'service' in self.name:
                app_backend.query_services(self.data)
            elif self.name in self.problem_states:
                app_backend.query_services_problems(self.name)
            elif 'alignakdaemon' in self.name:
                app_backend.query_alignakdaemons()
            elif 'livesynthesis' in self.name:
                app_backend.query_livesynthesis()
            elif 'realm' in self.name:
                app_backend.query_realms()
            elif 'timeperiod' in self.name:
                app_backend.query_timeperiods()
            elif self.name == 'history':
                if self.data:
                    app_backend.query_history(self.data['hostname'], self.data['host_id'])
                else:

                    app_backend.query_history()