Handles a ResourceList where Resources can be added by the user.
More...
#include <hueplusplus/ResourceList.h>
|
BaseResourceList::IdType | create (const CreateType ¶ms) |
| Create a new resource. More...
|
|
template<typename BaseResourceList, typename CreateType>
class hueplusplus::CreateableResourceList< BaseResourceList, CreateType >
Handles a ResourceList where Resources can be added by the user.
- Template Parameters
-
BaseResourceList | Base resource list type (ResourceList or SearchableResourceList). |
CreateType | Type that provides parameters for creation. Must have a const getRequest() function returning the JSON for the POST request. |
◆ CreateableResourceList()
template<typename BaseResourceList, typename CreateType>
Protected defaulted move constructor.
◆ create()
template<typename BaseResourceList, typename CreateType>
Create a new resource.
- Parameters
-
params | Parameters for the new resource |
- Returns
- The id of the created resource or 0/an empty string if failed.
- Exceptions
-
std::system_error | when system or socket operations fail |
HueException | when response contains no body |
HueAPIResponseException | when response contains an error |
nlohmann::json::parse_error | when response could not be parsed |
std::invalid_argument | when IdType is int and std::stoi fails |
◆ operator=()
template<typename BaseResourceList, typename CreateType>
Protected defaulted move assignment.
The documentation for this class was generated from the following file: