import json

import requests


def main() -> None:
    # The URL of the API endpoint
    # url = "http://127.0.0.1:8000/predict"
    url = "http://fastapi:8000/predict"

    # Example data to send (two item)
    data = [
        {
            "Severity": "Critical",
            "Alarm Name": "NodeB Unavailable",
            "technical_ID": "22214",
            "site_ID": "12345",
            # Add other fields as required by your AlarmDataModel
        },
        {
            "severity": "Major",
            "alarm_name": "NodeB Unavailable",
            "technical_ID": "22214",
            "site_ID": "12345",
            # Add other fields as required by your AlarmDataModel
        },
    ]

    # Convert the dictionary to a JSON string
    data_json = json.dumps(data)

    # Send a POST request to the API
    response = requests.post(url, headers={"Content-Type": "application/json"}, data=data_json)

    # Print the response from the server
    print("Status Code:", response.status_code)
    print("Response Body:", response.json())


if __name__ == "__main__":
    main()
