Action executed by the bridge, e.g. as a Schedule command.
More...
#include <hueplusplus/Action.h>
|
| | Action (const nlohmann::json &json) |
| | Create Action from json.
|
| |
| std::string | getAddress () const |
| | Get address the request is made to.
|
| |
| Method | getMethod () const |
| | Get request method.
|
| |
| const nlohmann::json & | getBody () const |
| | Get request body.
|
| |
| const nlohmann::json & | toJson () const |
| | Get json object of command.
|
| |
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: