hueplusplus  1.0.0
Public Member Functions | List of all members
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. More...
 
CreateRulesetName (const std::string &name)
 Set name. More...
 
CreateRulesetStatus (bool enabled)
 Set status. More...
 
nlohmann::json getRequest () const
 Get request to create the rule. More...
 

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
conditionsConditions for the rule. Must not be empty
actionsActions 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: