namespace adas_core.module.ProxyDevices.Devices;

/// <summary>
/// Interface for a proxy device that can be used to process and stream data. This interface defines the methods that must be implemented by any class that wants to act as a proxy device. 
/// The Initialize method is used to set up the device with the necessary parameters, while the Process and Stream methods are used to handle data processing and streaming respectively.
/// </summary>
public interface IProxyDevice
{
    /// <summary>
    /// Initializes the proxy device with the given parameters. This method should be called before any processing or streaming is done. 
    /// The parameters can include any necessary configuration settings for the device, such as connection details, authentication information, or other relevant data.
    /// </summary>
    /// <param name="deviceParameters">A dictionary containing the parameters required to initialize the device.</param>
    void Initialize(Dictionary<string, object?> deviceParameters);

    /// <summary>
    /// Processes the data received by the proxy device. This method should contain the logic for handling incoming data, performing any necessary transformations or computations, and preparing the data for further use.
    /// </summary>
    /// <returns>A task that represents the asynchronous operation. The task result contains the HttpResponseMessage returned by the device's Process method.</returns>
    Task<HttpResponseMessage> Process();

    /// <summary>
    /// Streams data from the proxy device. This method should contain the logic for handling outgoing data, performing any necessary transformations or computations, and preparing the data for further use.
    /// </summary>
    /// <returns>A task that represents the asynchronous operation. The task result contains the HttpResponseMessage returned by the device's Stream method.</returns>
    Task<HttpResponseMessage> Stream();
}