Skip to content

Commit

Permalink
Create JSON models for application-device mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
watfordjc committed Jul 16, 2020
1 parent f0c3773 commit 1d4f850
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
31 changes: 31 additions & 0 deletions SharedModels/ApplicationDefaultDevice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Json.Serialization;

namespace uk.JohnCook.dotnet.SharedModels
{
public class ApplicationDevicePreferences
{
[JsonPropertyName("applications")]
#pragma warning disable CA2227 // Collection properties should be read only
public IList<ApplicationDevicePreference> Applications { get; set; }
#pragma warning restore CA2227 // Collection properties should be read only
}

public class ApplicationDevicePreference
{
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("devices")]
public DefaultDevicePreference Devices { get; set; }
}

public class DefaultDevicePreference
{
[JsonPropertyName("render")]
public string RenderDeviceId { get; set; }
[JsonPropertyName("capture")]
public string CaptureDeviceId { get; set; }
}
}
25 changes: 25 additions & 0 deletions SharedModels/DeviceApplications.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Json.Serialization;

namespace uk.JohnCook.dotnet.SharedModels
{
public class DeviceApplicationPreferences
{
[JsonPropertyName("devices")]
#pragma warning disable CA2227 // Collection properties should be read only
public IList<DeviceApplicationPreference> Devices { get; set; }
#pragma warning restore CA2227 // Collection properties should be read only
}

public class DeviceApplicationPreference
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("applications")]
#pragma warning disable CA2227 // Collection properties should be read only
public IList<string> Applications { get; set; }
#pragma warning restore CA2227 // Collection properties should be read only
}
}

0 comments on commit 1d4f850

Please sign in to comment.