diff --git a/OneBlink.SDK.Tests/KeysClientTests.cs b/OneBlink.SDK.Tests/KeysClientTests.cs index 17738c6..521ab2b 100644 --- a/OneBlink.SDK.Tests/KeysClientTests.cs +++ b/OneBlink.SDK.Tests/KeysClientTests.cs @@ -40,6 +40,15 @@ public async void can_get_developer_key() KeysClient keysClient = new KeysClient(ACCESS_KEY, SECRET_KEY, TenantName.ONEBLINK_TEST); DeveloperKey developerKey = await keysClient.GetDeveloperKey(ACCESS_KEY); Assert.NotNull(developerKey); + Assert.NotNull(developerKey.id); + Assert.NotNull(developerKey.links); + Assert.NotNull(developerKey.links.organisations); + Assert.NotNull(developerKey.name); + Assert.NotNull(developerKey.privilege); + Assert.Null(developerKey.privilege.API_HOSTING); + Assert.NotNull(developerKey.privilege.FORMS); + Assert.NotNull(developerKey.privilege.PDF); + Assert.Null(developerKey.privilege.WEB_APP_HOSTING); } [Fact] diff --git a/OneBlink.SDK.Tests/OneBlink.SDK.Tests.csproj b/OneBlink.SDK.Tests/OneBlink.SDK.Tests.csproj index 28d415c..1163369 100644 --- a/OneBlink.SDK.Tests/OneBlink.SDK.Tests.csproj +++ b/OneBlink.SDK.Tests/OneBlink.SDK.Tests.csproj @@ -2,7 +2,7 @@ Exe - net6.0;net7.0;net8.0 + net6.0;net8.0 unit_tests false diff --git a/OneBlink.SDK/models/DeveloperKey.cs b/OneBlink.SDK/models/DeveloperKey.cs index ec37453..4aea820 100644 --- a/OneBlink.SDK/models/DeveloperKey.cs +++ b/OneBlink.SDK/models/DeveloperKey.cs @@ -1,30 +1,84 @@ using System; +using Newtonsoft.Json; namespace OneBlink.SDK.Model { public class DeveloperKey { - public string id { get; internal set; } + [JsonProperty] + public string id + { + get; internal set; + } + + [JsonProperty] [Obsolete("secret is deprecated and will always be null.")] - public string secret { get; internal set; } - public long customerSecretId { get; internal set; } - public string name { get; internal set; } - public DeveloperKeyPrivilege privilege { get; internal set; } - public DeveloperKeyLinks links { get; internal set; } - public Boolean isSolutions { get; internal set; } + public string secret + { + get; internal set; + } + + [JsonProperty] + public long customerSecretId + { + get; internal set; + } + + [JsonProperty] + public string name + { + get; internal set; + } + + [JsonProperty] + public DeveloperKeyPrivilege privilege + { + get; internal set; + } + + [JsonProperty] + public DeveloperKeyLinks links + { + get; internal set; + } } public class DeveloperKeyPrivilege { - public string API_HOSTING { get; internal set; } - public string PDF { get; internal set; } - public string WEB_APP_HOSTING { get; internal set; } - public string FORMS { get; internal set; } + + [JsonProperty] + public string API_HOSTING + { + get; internal set; + } + + [JsonProperty] + public string PDF + { + get; internal set; + } + + [JsonProperty] + public string WEB_APP_HOSTING + { + get; internal set; + } + + [JsonProperty] + public string FORMS + { + get; internal set; + } } public class DeveloperKeyLinks { - public string organisations { get; internal set; } + + [JsonProperty] + public string organisations + { + get; internal set; + } } } \ No newline at end of file