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;
141 std::shared_ptr<const IHttpHandler> httpHandler;
142 std::shared_ptr<TimeoutData> timeout;
const std::string username
Definition BridgeSetup.cpp:47
Definition HueCommandAPI.h:38
HueCommandAPI & operator=(const HueCommandAPI &)=default
Copy assign from other HueCommandAPI.
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
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
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
HueCommandAPI & operator=(HueCommandAPI &&)=default
Move assign from other HueCommandAPI.
std::string combinedPath(const std::string &path) const
Combines path with api prefix and username.
Definition HueCommandAPI.cpp:146
HueCommandAPI(const HueCommandAPI &)=default
Copy construct from other HueCommandAPI.
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(HueCommandAPI &&)=default
Move construct from other HueCommandAPI.
Namespace for the hueplusplus library.
Definition Action.h:28
Contains information about error location, use CURRENT_FILE_INFO to create.
Definition HueException.h:35