feat: add classes for UDMApi state document

This commit is contained in:
Aviv Cohn
2025-12-09 16:44:21 -05:00
parent 13e833b797
commit 260d92228c
4 changed files with 148 additions and 0 deletions

View 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; }
}
}

View 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; }
}
}

View 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>();
}
}
}

View 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; }
}
}