def call_hyas_protect_api():
    """
    Calls the HYAS Protect API to fetch logs based on specified filters and saves them to Sentinel.

    Returns:
        None
    """

    if (
        fetch_blocked_domains == "No"
        and fetch_suspicious_domains == "No"
        and fetch_malicious_domains == "No"
        and fetch_permitted_domains == "No"
    ):
        logging.info("All fetch domains variables are set to 'No'. Returning None.")
        return

    (
        from_datetime,
        to_datetime,
    ) = get_from_and_to_date()  # "2023-03-22 10:50:00", "2023-06-20 10:50:00"
    from_date = datetime.strptime(from_datetime, INPUT_DATE_FORMAT).strftime(
        OUTPUT_DATE_FORMAT
    )
    to_date = datetime.strptime(to_datetime, INPUT_DATE_FORMAT).strftime(
        OUTPUT_DATE_FORMAT
    )
    applied_filters = [
        {
            "id": "datetime",
            "isRange": True,
            "rangeValue": {
                "start": from_date,
                "end": to_date,
                "timeType": "range",
            },
        }
    ]
    if fetch_blocked_domains == "Yes":
        applied_filters.append({"id": "reputation", "value": "blocked"})

    if fetch_suspicious_domains == "Yes":
        applied_filters.append({"id": "reputation", "value": "suspicious"})

    if fetch_malicious_domains == "Yes":
        applied_filters.append({"id": "reputation", "value": "malicious"})

    if fetch_permitted_domains == "Yes":
        applied_filters.append({"id": "reputation", "value": "permitted"})

    data = {"applied_filters": applied_filters}
    total_count, page_size, page_number, records_fetched = 1, PAGE_SIZE, 0, 0
    while records_fetched < total_count:
        # Prepare the paging parameters
        data["paging"] = {
            "order": "desc",
            "page_number": page_number,
            "page_size": page_size,
            "page_type": "standard",
            "sort": "datetime",
        }

        # Make the API call
        response = requests.post(
            HYAS_URL,
            headers={"Content-Type": "application/json", "X-API-Key": hyas_api_key},
            data=dumps(data),
        )
        if response.status_code in range(200, 299):
            result = response.json()
            logs = result["logs"]
            records_fetched += len(logs)
            page_number += 1
            total_count = result["total_count"]
            sentinel_logs = [make_hyas_dict(log) for log in logs]
            sentinel_resp = save_to_sentinel(
                log_analytics_uri, customer_id, shared_key, dumps(sentinel_logs), table_name
            )
            if sentinel_resp in range(200, 299):
                logging.info(
                    f"HYAS Protect logs from {from_date} to {to_date} with filter {str(data)} saved in sentinel successfully."
                )
            state.post(to_datetime)
        else:
            if response.status_code in [401, 403]:
                logging.error("Invalid HYAS API KEY.")
            logging.info(response.content)
            logging.info(
                f"Unable to fetch logs from Hyas Protect API. Response code: {response.status_code}"
            )
            break
        if records_fetched >= total_count:
            break

    Calls the HYAS Protect API to fetch logs based on specified filters and saves them to Sentinel.

    Returns:
        None
    
Solutions/HYAS Protect/Data Connectors/HyasProtect/__init__.py