Loading...
Searching...
No Matches
hueplusplus::CreateableResourceList< BaseResourceList, CreateType > Class Template Reference

Handles a ResourceList where Resources can be added by the user. More...

`#include <hueplusplus/ResourceList.h>`

Inheritance diagram for hueplusplus::CreateableResourceList< BaseResourceList, CreateType >:
[legend]
Collaboration diagram for hueplusplus::CreateableResourceList< BaseResourceList, CreateType >:
[legend]

## Public Member Functions

BaseResourceList::IdType | create (const CreateType &params)
| Create a new resource.

## Protected Member Functions

| CreateableResourceList (CreateableResourceList &&)=default
| Protected defaulted move constructor.
CreateableResourceList & | operator= (CreateableResourceList &&)=default
| Protected defaulted move assignment.

## Detailed Description

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.

## Constructor & Destructor Documentation

## CreateableResourceList()

template<typename BaseResourceList, typename CreateType>

hueplusplus::CreateableResourceList< BaseResourceList, CreateType >::CreateableResourceList | ( | CreateableResourceList< BaseResourceList, CreateType > && |  | ) |

protected default

Protected defaulted move constructor.

## Member Function Documentation

## create()

template<typename BaseResourceList, typename CreateType>

BaseResourceList::IdType hueplusplus::CreateableResourceList< BaseResourceList, CreateType >::create | ( | const CreateType & | params | ) |

inline

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>

CreateableResourceList & hueplusplus::CreateableResourceList< BaseResourceList, CreateType >::operator= | ( | CreateableResourceList< BaseResourceList, CreateType > && |  | ) |

protected default

Protected defaulted move assignment.

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

- include/hueplusplus/ResourceList.h