This C# SDK is automatically generated by the OpenAPI Generator project:
- API version: v2
- SDK version: 1.0.0
- Generator version: 7.6.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit https://www.openhue.io
- RestSharp - 106.13.0 or later
- Json.NET - 13.0.2 or later
- JsonSubTypes - 1.8.0 or later
- System.ComponentModel.Annotations - 5.0.0 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.
Run the following command to generate the DLL
- [Mac/Linux]
/bin/sh build.sh
- [Windows]
build.bat
Then include the DLL (under the bin
folder) in the C# project, and use the namespaces:
using clipapisdk.Api;
using clipapisdk.Client;
using clipapisdk.Model;
A .nuspec
is included with the project. You can follow the Nuget quickstart to create and publish packages.
This .nuspec
uses placeholders from the .csproj
, so build the .csproj
directly:
nuget pack -Build -OutputDirectory out clipapisdk.csproj
Then, publish to a local feed or other host and consume the new package via Nuget as usual.
To use the API client with a HTTP proxy, setup a System.Net.WebProxy
Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;
using System.Collections.Generic;
using System.Diagnostics;
using clipapisdk.Api;
using clipapisdk.Client;
using clipapisdk.Model;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://192.168.1.0";
var apiInstance = new AuthApi(config);
var authenticateRequest = new AuthenticateRequest?(); // AuthenticateRequest? | (optional)
try
{
// Authenticate
List<ResponseInner> result = apiInstance.Authenticate(authenticateRequest);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AuthApi.Authenticate: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
All URIs are relative to https://192.168.1.0
Class | Method | HTTP request | Description |
---|---|---|---|
AuthApi | Authenticate | POST /api | Authenticate |
BridgeApi | GetBridge | GET /clip/v2/resource/bridge/{bridgeId} | Get bridge |
BridgeApi | GetBridges | GET /clip/v2/resource/bridge | List bridges |
BridgeApi | UpdateBridge | PUT /clip/v2/resource/bridge/{bridgeId} | Update bridge |
BridgeHomeApi | GetBridgeHome | GET /clip/v2/resource/bridge_home/{bridgeHomeId} | Get bridge home. |
BridgeHomeApi | GetBridgeHomes | GET /clip/v2/resource/bridge_home | List bridge homes. |
DeviceApi | DeleteDevice | DELETE /clip/v2/resource/device/{deviceId} | Delete Device |
DeviceApi | GetDevice | GET /clip/v2/resource/device/{deviceId} | Get device |
DeviceApi | GetDevices | GET /clip/v2/resource/device | List devices |
DeviceApi | UpdateDevice | PUT /clip/v2/resource/device/{deviceId} | Update device |
DevicePowerApi | GetDevicePower | GET /clip/v2/resource/device_power/{deviceId} | Get device power |
DevicePowerApi | GetDevicePowers | GET /clip/v2/resource/device_power | List device powers |
GroupedLightApi | GetGroupedLight | GET /clip/v2/resource/grouped_light/{groupedLightId} | Get grouped light |
GroupedLightApi | GetGroupedLights | GET /clip/v2/resource/grouped_light | List grouped lights |
GroupedLightApi | UpdateGroupedLight | PUT /clip/v2/resource/grouped_light/{groupedLightId} | Update grouped light |
LightApi | GetLight | GET /clip/v2/resource/light/{lightId} | Get light |
LightApi | GetLights | GET /clip/v2/resource/light | List lights. |
LightApi | UpdateLight | PUT /clip/v2/resource/light/{lightId} | Update light |
LightLevelApi | GetLightLevel | GET /clip/v2/resource/light_level/{lightId} | Get light |
LightLevelApi | GetLightLevels | GET /clip/v2/resource/light_level | List light levels. |
LightLevelApi | UpdateLightLevel | PUT /clip/v2/resource/light_level/{lightId} | Update light |
MotionApi | GetMotionSensor | GET /clip/v2/resource/motion/{motionId} | Get motion sensor. |
MotionApi | GetMotionSensors | GET /clip/v2/resource/motion | List motion sensors. |
MotionApi | UpdateMotionSensor | PUT /clip/v2/resource/motion/{motionId} | Update Motion Sensor |
ResourceApi | GetResources | GET /clip/v2/resource | List resources |
RoomApi | CreateRoom | POST /clip/v2/resource/room | Create room |
RoomApi | DeleteRoom | DELETE /clip/v2/resource/room/{roomId} | Delete room |
RoomApi | GetRoom | GET /clip/v2/resource/room/{roomId} | Get room. |
RoomApi | GetRooms | GET /clip/v2/resource/room | List rooms |
RoomApi | UpdateRoom | PUT /clip/v2/resource/room/{roomId} | Update room |
SceneApi | CreateScene | POST /clip/v2/resource/scene | Create a new scene |
SceneApi | DeleteScene | DELETE /clip/v2/resource/scene/{sceneId} | Delete a scene |
SceneApi | GetScene | GET /clip/v2/resource/scene/{sceneId} | Get a scene |
SceneApi | GetScenes | GET /clip/v2/resource/scene | List scenes |
SceneApi | UpdateScene | PUT /clip/v2/resource/scene/{sceneId} | Update a scene |
TemperatureApi | GetTemperature | GET /clip/v2/resource/temperature/{temperatureId} | Get temperature sensor information |
TemperatureApi | GetTemperatures | GET /clip/v2/resource/temperature | List temperatures |
TemperatureApi | UpdateTemperature | PUT /clip/v2/resource/temperature/{temperatureId} | Update temperature sensor |
ZoneApi | CreateZone | POST /clip/v2/resource/zone | Create zone |
ZoneApi | DeleteZone | DELETE /clip/v2/resource/zone/{zoneId} | Delete Zone |
ZoneApi | GetZone | GET /clip/v2/resource/zone/{zoneId} | Get Zone. |
ZoneApi | GetZones | GET /clip/v2/resource/zone | List zones |
ZoneApi | UpdateZone | PUT /clip/v2/resource/zone/{zoneId} | Update Zone |
- Model.ActionGet
- Model.ActionGetAllOfAction
- Model.ActionGetAllOfActionEffects
- Model.ActionPost
- Model.ActionPostAction
- Model.Alert
- Model.ApiResponse
- Model.AuthenticateRequest
- Model.BridgeGet
- Model.BridgeGetAllOfTimeZone
- Model.BridgeHomeGet
- Model.BridgePut
- Model.Color
- Model.ColorPaletteGet
- Model.ColorTemperature
- Model.ColorTemperatureDelta
- Model.ColorTemperaturePalettePost
- Model.ColorTemperaturePalettePostColorTemperature
- Model.DeviceGet
- Model.DeviceGetAllOfMetadata
- Model.DeviceGetAllOfUsertest
- Model.DevicePowerGet
- Model.DevicePowerGetAllOfPowerState
- Model.DevicePut
- Model.DevicePutIdentify
- Model.DevicePutUsertest
- Model.Dimming
- Model.DimmingDelta
- Model.Dynamics
- Model.Dynamics2
- Model.Effects
- Model.Error
- Model.ErrorResponse
- Model.GamutPosition
- Model.GetBridgeHomes200Response
- Model.GetBridges200Response
- Model.GetDevicePowers200Response
- Model.GetDevices200Response
- Model.GetGroupedLights200Response
- Model.GetLightLevels200Response
- Model.GetLights200Response
- Model.GetMotionSensors200Response
- Model.GetResources200Response
- Model.GetRooms200Response
- Model.GetScenes200Response
- Model.GetTemperatures200Response
- Model.Gradient
- Model.GroupedLightGet
- Model.GroupedLightGetAllOfAlert
- Model.GroupedLightGetAllOfSignaling
- Model.GroupedLightPut
- Model.LightArchetype
- Model.LightGet
- Model.LightGetAllOfColor
- Model.LightGetAllOfColorGamut
- Model.LightGetAllOfColorTemperature
- Model.LightGetAllOfColorTemperatureMirekSchema
- Model.LightGetAllOfDimming
- Model.LightGetAllOfDynamics
- Model.LightGetAllOfEffects
- Model.LightGetAllOfMetadata
- Model.LightGetAllOfPowerup
- Model.LightGetAllOfPowerupDimming
- Model.LightGetAllOfPowerupDimmingColor
- Model.LightGetAllOfPowerupDimmingColorColorTemperature
- Model.LightGetAllOfPowerupOn
- Model.LightGetAllOfSignaling
- Model.LightGetAllOfTimedEffects
- Model.LightLevelGet
- Model.LightLevelGetAllOfLight
- Model.LightLevelGetAllOfLightLightLevelReport
- Model.LightLevelPut
- Model.LightPut
- Model.LightPutTimedEffects
- Model.MotionGet
- Model.MotionGetAllOfMotion
- Model.MotionGetAllOfMotionMotionReport
- Model.MotionGetAllOfSensitivity
- Model.MotionPut
- Model.MotionPutSensitivity
- Model.On
- Model.Powerup
- Model.PowerupDimming
- Model.ProductArchetype
- Model.ProductData
- Model.Resource
- Model.ResourceGet
- Model.ResourceIdentifier
- Model.ResourceOwned
- Model.ResponseInner
- Model.ResponseInnerError
- Model.ResponseInnerSuccess
- Model.RoomArchetype
- Model.RoomGet
- Model.RoomGetAllOfMetadata
- Model.RoomPut
- Model.SceneGet
- Model.SceneGetAllOfStatus
- Model.SceneMetadata
- Model.ScenePalette
- Model.ScenePaletteEffectsInner
- Model.ScenePost
- Model.ScenePut
- Model.SceneRecall
- Model.Signaling
- Model.SupportedDynamicStatus
- Model.SupportedEffects
- Model.SupportedGradientMode
- Model.SupportedSignals
- Model.SupportedTimedEffects
- Model.TemperatureGet
- Model.TemperatureGetAllOfTemperature
- Model.TemperatureGetAllOfTemperatureTemperatureReport
- Model.TemperaturePut
- Model.UpdateDevice200Response
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: hue-application-key
- Location: HTTP header