def domaintools(self, data):
        """

        :param service:
        :return:
        """
        if (self.service == 'reverse-ip' and self.data_type == 'ip'):
            self.service = 'host-domains'

        api = API(self.get_param('config.username'), self.get_param('config.key'))

        if self.service == 'reverse-ip' and self.data_type in ['domain', 'ip', 'fqdn']:
            response = api.reverse_ip(data).response()

        elif self.service == 'host-domains' and self.data_type == 'ip':
            response = api.host_domains(data).response()

        elif self.service == 'name-server-domains' and self.data_type == 'domain':
            response = api.reverse_name_server(data).response()

        elif self.service == 'whois/history' and self.data_type == 'domain':
            response = api.whois_history(data).response()

        elif self.service == 'whois/parsed' and self.data_type == 'domain':
            response = api.parsed_whois(data).response()

        elif self.service == 'reverse-whois':
            response = api.reverse_whois(data, mode='purchase').response()

        elif self.service == 'whois' and self.data_type == 'ip':
            response = api.whois(data).response()

        return response
    def domaintools(self, data):
        """

        :param service:
        :return:
        """
        if (self.service == 'reverse-ip' and self.data_type == 'ip'):
            self.service = 'host-domains'

        api = API(self.get_param('config.username'),
                  self.get_param('config.key'))

        if self.service == 'reverse-ip' and self.data_type in [
                'domain', 'ip', 'fqdn'
        ]:
            response = api.reverse_ip(data).response()

        elif self.service == 'host-domains' and self.data_type == 'ip':
            response = api.host_domains(data).response()

        elif self.service == 'name-server-domains' and self.data_type == 'domain':
            response = api.reverse_name_server(data).response()

        elif self.service == 'whois/history' and self.data_type == 'domain':
            response = api.whois_history(data).response()

        elif self.service == 'whois/parsed' and self.data_type in [
                'domain', 'ip'
        ]:
            response = api.parsed_whois(data).response()

        elif self.service == 'hosting-history' and self.data_type == 'domain':
            response = api.hosting_history(data).response()

        elif self.service == 'risk_evidence' and self.data_type in [
                'domain', 'fqdn'
        ]:
            response = api.risk_evidence(data).response()

        elif self.service == 'reputation' and self.data_type in [
                'domain', 'fqdn'
        ]:
            response = api.reputation(data, include_reasons=True).response()

        elif self.service == 'reverse-whois':
            scope = self.getParam('parameters.scope', 'current', None)
            response = api.reverse_whois(data, mode='purchase',
                                         scope=scope).response()

        elif self.service == 'reverse-ip-whois':
            response = api.reverse_ip_whois(data).response()

        elif self.service == 'whois' and self.data_type in ['domain', 'ip']:
            response = api.whois(data).response()

        return response
    def domaintools(self, data):
        """

        :param service:
        :return:
        """
        if (self.service == 'reverse-ip' and self.data_type == 'ip'):
            self.service = 'host-domains'

        api = API(self.get_param('config.username'), self.get_param('config.key'))

        if self.service == 'reverse-ip' and self.data_type in ['domain', 'ip', 'fqdn']:
            response = api.reverse_ip(data).response()

        elif self.service == 'host-domains' and self.data_type == 'ip':
            response = api.host_domains(data).response()

        elif self.service == 'name-server-domains' and self.data_type == 'domain':
            response = api.reverse_name_server(data).response()

        elif self.service == 'whois/history' and self.data_type == 'domain':
            response = api.whois_history(data).response()

        elif self.service == 'whois/parsed' and self.data_type in ['domain','ip']:
            response = api.parsed_whois(data).response()

        elif self.service == 'hosting-history' and self.data_type == 'domain':
            response = api.hosting_history(data).response()
        
        elif self.service == 'risk_evidence' and self.data_type in ['domain', 'fqdn']:
            response = api.risk_evidence(data).response()

        elif self.service == 'reputation' and self.data_type in ['domain', 'fqdn']:
            response = api.reputation(data, include_reasons=True).response()

        elif self.service == 'reverse-whois':
            scope = self.getParam('parameters.scope', 'current', None)
            response = api.reverse_whois(data, mode='purchase', scope=scope).response()

        elif self.service == 'reverse-ip-whois':
            response = api.reverse_ip_whois(data).response()

        elif self.service == 'whois' and self.data_type in ['domain', 'ip']:
            response = api.whois(data).response()

        return response