mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 20:17:03 +00:00
feat: add classes for UDMApi state document
This commit is contained in:
parent
13e833b797
commit
260d92228c
4 changed files with 148 additions and 0 deletions
20
src/PepperDash.Essentials.Core/UDMApi/CustomProperties.cs
Normal file
20
src/PepperDash.Essentials.Core/UDMApi/CustomProperties.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.UDMApi
|
||||
{
|
||||
|
||||
internal class CustomProperties
|
||||
{
|
||||
[JsonProperty("label")]
|
||||
public string label { get; set; }
|
||||
|
||||
[JsonProperty("value")]
|
||||
public string value { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
34
src/PepperDash.Essentials.Core/UDMApi/DeviceStatus.cs
Normal file
34
src/PepperDash.Essentials.Core/UDMApi/DeviceStatus.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.UDMApi
|
||||
{
|
||||
internal class DeviceStatus
|
||||
{
|
||||
[JsonProperty("label")]
|
||||
public string label { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public string status { get; set; }
|
||||
|
||||
[JsonProperty("description")]
|
||||
public string description { get; set; }
|
||||
|
||||
[JsonProperty("videoSource")]
|
||||
public string videoSource { get; set; }
|
||||
|
||||
[JsonProperty("audioSource")]
|
||||
public string audioSource { get; set; }
|
||||
|
||||
[JsonProperty("usage")]
|
||||
public int usage { get; set; }
|
||||
|
||||
[JsonProperty("error")]
|
||||
public string error { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
63
src/PepperDash.Essentials.Core/UDMApi/RoomResponse.cs
Normal file
63
src/PepperDash.Essentials.Core/UDMApi/RoomResponse.cs
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.UDMApi
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the complete room response for UDM API
|
||||
/// </summary>
|
||||
internal class RoomResponse
|
||||
{
|
||||
public RoomResponse()
|
||||
{
|
||||
standard = new StandardProperties();
|
||||
status = new StatusProperties();
|
||||
custom = new Dictionary<string, CustomProperties>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// API version string
|
||||
/// </summary>
|
||||
[JsonProperty("apiVersion")]
|
||||
public string apiVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Standard room properties
|
||||
/// </summary>
|
||||
[JsonProperty("standard")]
|
||||
public StandardProperties standard { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Status information including devices
|
||||
/// </summary>
|
||||
[JsonProperty("status")]
|
||||
public StatusProperties status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Custom properties dictionary
|
||||
/// </summary>
|
||||
[JsonProperty("custom")]
|
||||
public Dictionary<string, CustomProperties> custom { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents status properties including devices
|
||||
/// </summary>
|
||||
internal class StatusProperties
|
||||
{
|
||||
/// <summary>
|
||||
/// Dictionary of device statuses keyed by device identifier
|
||||
/// </summary>
|
||||
[JsonProperty("devices")]
|
||||
public Dictionary<string, DeviceStatus> devices { get; set; }
|
||||
|
||||
public StatusProperties()
|
||||
{
|
||||
devices = new Dictionary<string, DeviceStatus>();
|
||||
}
|
||||
}
|
||||
}
|
||||
31
src/PepperDash.Essentials.Core/UDMApi/StandardProperties.cs
Normal file
31
src/PepperDash.Essentials.Core/UDMApi/StandardProperties.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.UDMApi
|
||||
{
|
||||
internal class StandardProperties
|
||||
{
|
||||
[JsonProperty("version")]
|
||||
public string version { get; set; }
|
||||
|
||||
[JsonProperty("state")]
|
||||
public string state { get; set; }
|
||||
|
||||
[JsonProperty("error")]
|
||||
public string error { get; set; }
|
||||
|
||||
[JsonProperty("occupancy")]
|
||||
public bool occupancy { get; set; }
|
||||
|
||||
[JsonProperty("helpRequest")]
|
||||
public string helpRequest { get; set; }
|
||||
|
||||
[JsonProperty("activity")]
|
||||
public string activity { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue