#ifndef NXTHARDWAREDEVICEREST_H
#define NXTHARDWAREDEVICEREST_H

#include <memory>
#include <QObject>
#include <QJsonObject>

namespace Nxt {
namespace Internal {

class NxtHardwareDeviceREST : public QObject
{
    Q_OBJECT

public:
    NxtHardwareDeviceREST(QString host, QObject *parent = nullptr);
    NxtHardwareDeviceREST(QString host, QString username, QString password, QObject *parent = nullptr);
    ~NxtHardwareDeviceREST();

    void setHost(const QString &host);
    void setUsername(const QString &username);
    void setPassword(const QString &password);
    void setTimeout(int timeout_sec);

    bool available();
    int authenticate(); // returns HTTP status codes
    QJsonObject deviceInfo();
    bool startVApp(const QString& name);
    bool startVAppInGdbServer(const QString& name);

protected:
    class pimpl;
    std::unique_ptr<pimpl> m_pimpl;
};

} // namespace Internal
} // namespace Nxt

#endif // NXTHARDWAREDEVICEREST_H
