def main() -> None:
    'main function, parses params and runs command functions\n\n    :return:\n    :rtype:\n    '
    api_key = demisto.params().get('apikey')
    base_url = urljoin(demisto.params()['url'], '/api/v1')
    verify_certificate = (not demisto.params().get('insecure', False))
    first_fetch_time = arg_to_datetime(arg=demisto.params().get('first_fetch', '3 days'), arg_name='First fetch time', required=True)
    first_fetch_timestamp = (int(first_fetch_time.timestamp()) if first_fetch_time else None)
    assert isinstance(first_fetch_timestamp, int)
    proxy = demisto.params().get('proxy', False)
    demisto.debug(f'Command being called is {demisto.command()}')
    try:
        headers = {'Authorization': f'Bearer {api_key}'}
        client = Client(base_url=base_url, verify=verify_certificate, headers=headers, proxy=proxy)
        if (demisto.command() == 'test-module'):
            result = test_module(client, first_fetch_timestamp)
            return_results(result)
        elif (demisto.command() == 'fetch-incidents'):
            alert_status = demisto.params().get('alert_status', None)
            alert_type = demisto.params().get('alert_type', None)
            min_severity = demisto.params().get('min_severity', None)
            max_results = arg_to_number(arg=demisto.params().get('max_fetch'), arg_name='max_fetch', required=False)
            if ((not max_results) or (max_results > MAX_INCIDENTS_TO_FETCH)):
                max_results = MAX_INCIDENTS_TO_FETCH
            (next_run, incidents) = fetch_incidents(client=client, max_results=max_results, last_run=demisto.getLastRun(), first_fetch_time=first_fetch_timestamp, alert_status=alert_status, min_severity=min_severity, alert_type=alert_type)
            demisto.setLastRun(next_run)
            demisto.incidents(incidents)
        elif (demisto.command() == 'ip'):
            default_threshold_ip = int(demisto.params().get('threshold_ip', '65'))
            return_results(ip_reputation_command(client, demisto.args(), default_threshold_ip))
        elif (demisto.command() == 'domain'):
            default_threshold_domain = int(demisto.params().get('threshold_domain', '65'))
            return_results(domain_reputation_command(client, demisto.args(), default_threshold_domain))
        elif (demisto.command() == 'helloworld-say-hello'):
            return_results(say_hello_command(client, demisto.args()))
        elif (demisto.command() == 'helloworld-search-alerts'):
            return_results(search_alerts_command(client, demisto.args()))
        elif (demisto.command() == 'helloworld-get-alert'):
            return_results(get_alert_command(client, demisto.args()))
        elif (demisto.command() == 'helloworld-update-alert-status'):
            return_results(update_alert_status_command(client, demisto.args()))
        elif (demisto.command() == 'helloworld-scan-start'):
            return_results(scan_start_command(client, demisto.args()))
        elif (demisto.command() == 'helloworld-scan-status'):
            return_results(scan_status_command(client, demisto.args()))
        elif (demisto.command() == 'helloworld-scan-results'):
            return_results(scan_results_command(client, demisto.args()))
    except Exception as e:
        demisto.error(traceback.format_exc())
        return_error(f'''Failed to execute {demisto.command()} command.
Error:
{str(e)}''')
main function, parses params and runs command functions

:return:
:rtype:
def main() -> None:
    'main function, parses params and runs command functions\n\n    :return:\n    :rtype:\n    '
    api_key = demisto.params().get('apikey')
    base_url = urljoin(demisto.params()['url'], '/api/v1')
    verify_certificate = (not demisto.params().get('insecure', False))
    first_fetch_time = arg_to_datetime(arg=demisto.params().get('first_fetch', '3 days'), arg_name='First fetch time', required=True)
    first_fetch_timestamp = (int(first_fetch_time.timestamp()) if first_fetch_time else None)
    assert isinstance(first_fetch_timestamp, int)
    proxy = demisto.params().get('proxy', False)
    demisto.debug(f'Command being called is {demisto.command()}')
    try:
        headers = {'Authorization': f'Bearer {api_key}'}
        client = Client(base_url=base_url, verify=verify_certificate, headers=headers, proxy=proxy)
        if (demisto.command() == 'test-module'):
            result = test_module(client, first_fetch_timestamp)
            return_results(result)
        elif (demisto.command() == 'fetch-incidents'):
            alert_status = demisto.params().get('alert_status', None)
            alert_type = demisto.params().get('alert_type', None)
            min_severity = demisto.params().get('min_severity', None)
            max_results = arg_to_number(arg=demisto.params().get('max_fetch'), arg_name='max_fetch', required=False)
            if ((not max_results) or (max_results > MAX_INCIDENTS_TO_FETCH)):
                max_results = MAX_INCIDENTS_TO_FETCH
            (next_run, incidents) = fetch_incidents(client=client, max_results=max_results, last_run=demisto.getLastRun(), first_fetch_time=first_fetch_timestamp, alert_status=alert_status, min_severity=min_severity, alert_type=alert_type)
            demisto.setLastRun(next_run)
            demisto.incidents(incidents)
        elif (demisto.command() == 'ip'):
            default_threshold_ip = int(demisto.params().get('threshold_ip', '65'))
            return_results(ip_reputation_command(client, demisto.args(), default_threshold_ip))
        elif (demisto.command() == 'domain'):
            default_threshold_domain = int(demisto.params().get('threshold_domain', '65'))
            return_results(domain_reputation_command(client, demisto.args(), default_threshold_domain))
        elif (demisto.command() == 'helloworld-say-hello'):
            return_results(say_hello_command(client, demisto.args()))
        elif (demisto.command() == 'helloworld-search-alerts'):
            return_results(search_alerts_command(client, demisto.args()))
        elif (demisto.command() == 'helloworld-get-alert'):
            return_results(get_alert_command(client, demisto.args()))
        elif (demisto.command() == 'helloworld-update-alert-status'):
            return_results(update_alert_status_command(client, demisto.args()))
        elif (demisto.command() == 'helloworld-scan-start'):
            return_results(scan_start_command(client, demisto.args()))
        elif (demisto.command() == 'helloworld-scan-status'):
            return_results(scan_status_command(client, demisto.args()))
        elif (demisto.command() == 'helloworld-scan-results'):
            return_results(scan_results_command(client, demisto.args()))
    except Exception as e:
        demisto.error(traceback.format_exc())
        return_error(f'Failed to execute {demisto.command()} command.
Error:
{str(e)}')