Loading...
Searching...
No Matches
HueRestClient::HueRestConnection Class Reference

Class for Hue REST connections; returns HueRestClient objects. More...

Inheritance diagram for HueRestClient::HueRestConnection:
[legend]

## Public Member Functions

| constructor (string name, string description, string url=HueRestClient::DefaultUrl, hash< auto > attributes={}, hash< auto > options={})
| creates the HueRestConnection object
DataProvider::AbstractDataProvider | getDataProvider ()
| returns a data provider object for this connection
string | getType ()
| returns `"hue"`
bool | hasDataProvider ()
| returns True as this connection returns a data provider with the getDataProvider() method

## Public Attributes

const | ConnectionScheme
| Connection entry info.

## Protected Member Functions

hash< ConnectionSchemeInfo > | getConnectionSchemeInfoImpl ()
| Returns the ConnectionSchemeInfo hash for this object.
HueRestClient | getImpl (bool connect=True, *hash< auto > rtopts)
| returns a HueRestClient object
| setChildCapabilities ()
| Sets child data provider capabilities.

## Detailed Description

Class for Hue REST connections; returns HueRestClient objects.

This class implements all options of RestClientConnection; in addition, this class provides the following default values for the following options:

- `oauth2_auth_args:` `access_type: offline`
- `oauth2_auth_url:` `https://accounts.hue.com/o/oauth2/v2/auth`
- `oauth2_grant_type:` `authorization_code`
- `oauth2_token_url:` `https://oauth2.hueapis.com/token`

See also
  HueRestClient::HueRestClient::constructor() for more information on the above options

## Member Function Documentation

## constructor()

HueRestClient::HueRestConnection::constructor | ( | string | name,
|  | string | description,
|  | string | url = `HueRestClient::DefaultUrl`,
|  | hash< auto > | attributes = `{}`,
|  | hash< auto > | options = `{}`
| ) |  |

creates the HueRestConnection object

Parameters

  name | the name of the connection
  description | connection description
  url | connection URL (potentially with password info)
  attributes | various attributes. See below
  options | connection options

See ConnectionProvider::AbstractConnection::constructor() for `attributes` and `options` reference.

Exceptions

  CONNECTION-OPTION-ERROR | missing or invalid connection option

## getDataProvider()

DataProvider::AbstractDataProvider HueRestClient::HueRestConnection::getDataProvider | ( |  | ) |

returns a data provider object for this connection

Returns
  a data provider object for this connection

## getImpl()

HueRestClient HueRestClient::HueRestConnection::getImpl | ( | bool | connect = `True`,
|  | *hash< auto > | rtopts
| ) |  |

protected

returns a HueRestClient object

Parameters

  connect | if True, then the connection is returned already connected
  rtopts | this connection type does not accept any runtime options, so this parameter is ignored

Returns
  a HueRestClient object

## hasDataProvider()

bool HueRestClient::HueRestConnection::hasDataProvider | ( |  | ) |

returns True as this connection returns a data provider with the getDataProvider() method

Returns
  True as this connection returns a data provider with the getDataProvider() method

See also
  getDataProvider()