Loading...
Searching...
No Matches
hueplusplus::CreateRule Class Reference

Parameters for creating a new Rule. More...

`#include <hueplusplus/Rule.h>`

## Public Member Functions

| CreateRule (const std::vector< Condition > &conditions, const std::vector< Action > &actions)
| Construct with necessary parameters.
CreateRule & | setName (const std::string &name)
| Set name.
CreateRule & | setStatus (bool enabled)
| Set status.
nlohmann::json | getRequest () const
| Get request to create the rule.

## Detailed Description

Parameters for creating a new Rule.

Can be used like a builder object with chained calls.

## Constructor & Destructor Documentation

## CreateRule()

hueplusplus::CreateRule::CreateRule | ( | const std::vector< Condition > & | conditions,
|  | const std::vector< Action > & | actions
| ) |  |

Construct with necessary parameters.

Parameters

  conditions | Conditions for the rule. Must not be empty
  actions | Actions for the rule. Must not be empty

## Member Function Documentation

## getRequest()

nlohmann::json hueplusplus::CreateRule::getRequest | ( |  | ) | const

Get request to create the rule.

Returns
  JSON request for a POST to create the new rule.

## setName()

CreateRule & hueplusplus::CreateRule::setName | ( | const std::string & | name | ) |

Set name.

See also
  Rule::setName

## setStatus()

CreateRule & hueplusplus::CreateRule::setStatus | ( | bool | enabled | ) |

Set status.

See also
  Rule::setEnabled

The documentation for this class was generated from the following files:

- include/hueplusplus/Rule.h
- src/Rule.cpp