23 #ifndef INCLUDE_HUEPLUSPLUS_HUECOMMANDAPI_H 24 #define INCLUDE_HUEPLUSPLUS_HUECOMMANDAPI_H 47 const std::string& ip,
int port,
const std::string& username, std::shared_ptr<const IHttpHandler> httpHandler);
73 nlohmann::json
PUTRequest(
const std::string& path,
const nlohmann::json& request,
FileInfo fileInfo)
const;
75 nlohmann::json
PUTRequest(
const std::string& path,
const nlohmann::json& request)
const;
88 nlohmann::json
GETRequest(
const std::string& path,
const nlohmann::json& request,
FileInfo fileInfo)
const;
90 nlohmann::json
GETRequest(
const std::string& path,
const nlohmann::json& request)
const;
103 nlohmann::json
DELETERequest(
const std::string& path,
const nlohmann::json& request,
FileInfo fileInfo)
const;
105 nlohmann::json
DELETERequest(
const std::string& path,
const nlohmann::json& request)
const;
118 nlohmann::json
POSTRequest(
const std::string& path,
const nlohmann::json& request,
FileInfo fileInfo)
const;
120 nlohmann::json
POSTRequest(
const std::string& path,
const nlohmann::json& request)
const;
124 std::string
combinedPath(
const std::string& path)
const;
128 std::chrono::steady_clock::time_point timeout;
135 nlohmann::json HandleError(
FileInfo fileInfo,
const nlohmann::json& response)
const;
140 std::string username;
141 std::shared_ptr<const IHttpHandler> httpHandler;
142 std::shared_ptr<TimeoutData> timeout;
Definition: HueCommandAPI.h:37
Namespace for the hueplusplus library.
Definition: Action.h:27
nlohmann::json PUTRequest(const std::string &path, const nlohmann::json &request, FileInfo fileInfo) const
Sends a HTTP PUT request to the bridge and returns the response.
Definition: HueCommandAPI.cpp:80
HueCommandAPI & operator=(const HueCommandAPI &)=default
Copy assign from other HueCommandAPI.
Contains information about error location, use CURRENT_FILE_INFO to create.
Definition: HueException.h:34
std::string combinedPath(const std::string &path) const
Combines path with api prefix and username.
Definition: HueCommandAPI.cpp:146
nlohmann::json POSTRequest(const std::string &path, const nlohmann::json &request, FileInfo fileInfo) const
Sends a HTTP POST request to the bridge and returns the response.
Definition: HueCommandAPI.cpp:119
HueCommandAPI(const std::string &ip, int port, const std::string &username, std::shared_ptr< const IHttpHandler > httpHandler)
Construct from ip, username and HttpHandler.
Definition: HueCommandAPI.cpp:66
nlohmann::json DELETERequest(const std::string &path, const nlohmann::json &request, FileInfo fileInfo) const
Sends a HTTP DELETE request to the bridge and returns the response.
Definition: HueCommandAPI.cpp:106
nlohmann::json GETRequest(const std::string &path, const nlohmann::json &request, FileInfo fileInfo) const
Sends a HTTP GET request to the bridge and returns the response.
Definition: HueCommandAPI.cpp:93