Action executed by the bridge, e.g. as a Schedule command.
More...
#include <hueplusplus/Action.h>
Action executed by the bridge, e.g. as a Schedule command.
The action makes either a POST, PUT or DELETE request with a given body to an address on the bridge.
The Action can also be created by StateTransaction::toAction().
◆ Method
Method used for the command.
Enumerator |
---|
post | POST request.
|
put | PUT request.
|
deleteMethod | DELETE request.
|
◆ Action()
hueplusplus::Action::Action |
( |
const nlohmann::json & |
json | ) |
|
|
explicit |
Create Action from json.
- Parameters
-
json | JSON object with address, method and body |
◆ getAddress()
std::string hueplusplus::Action::getAddress |
( |
| ) |
const |
Get address the request is made to.
◆ getBody()
const nlohmann::json & hueplusplus::Action::getBody |
( |
| ) |
const |
◆ getMethod()
◆ methodToString()
std::string hueplusplus::Action::methodToString |
( |
Method |
m | ) |
|
|
static |
Get string from Method.
- Returns
POST
, PUT
or DELETE
◆ parseMethod()
Action::Method hueplusplus::Action::parseMethod |
( |
const std::string & |
s | ) |
|
|
static |
Parse Method from string.
- Parameters
-
◆ toJson()
const nlohmann::json & hueplusplus::Action::toJson |
( |
| ) |
const |
Get json object of command.
The documentation for this class was generated from the following files: