Update: Disco Online Services Update Checking

Migrates Disco Update checking to new services at
https://services.discoict.com.au.
This commit is contained in:
Gary Sharp
2014-07-23 19:14:08 +10:00
parent 4b3905b4fc
commit 6700d092b3
31 changed files with 621 additions and 523 deletions
@@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Disco.Models.BI.Interop.Community
{
public class UpdateRequestBase
{
public virtual int RequestVersion { get; set; }
}
}
@@ -1,42 +0,0 @@
using System;
using System.Collections.Generic;
namespace Disco.Models.BI.Interop.Community
{
public class UpdateRequestV1 : UpdateRequestBase
{
public UpdateRequestV1()
{
this.RequestVersion = 1;
}
public string DeploymentId { get; set; }
public string CurrentDiscoVersion { get; set; }
public bool BetaDeployment { get; set; }
public string OrganisationName { get; set; }
public string BroadbandDoeWanId { get; set; }
public List<Stat> Stat_JobCounts { get; set; }
public List<Stat> Stat_OpenJobCounts { get; set; }
public List<Stat> Stat_ActiveDeviceModelCounts { get; set; }
public List<Stat> Stat_DeviceModelCounts { get; set; }
public List<Stat> Stat_UserCounts { get; set; }
public List<PluginRef> InstalledPlugins { get; set; }
public List<Stat> Stat_JobWarrantyVendorCounts { get; set; }
public class Stat
{
public string Key { get; set; }
public int Count { get; set; }
}
public class PluginRef
{
public string Id { get; set; }
public string Version { get; set; }
}
}
}
@@ -1,24 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Models.BI.Interop.Community
{
public class UpdateResponse
{
public string Version { get; set; }
public DateTime VersionReleasedTimestamp { get; set; }
public string Blurb { get; set; }
public string UrlLink { get; set; }
public DateTime ResponseTimestamp { get; set; }
public bool BetaRelease { get; set; }
public bool IsUpdatable(Version TestVersion)
{
var updateVersion = System.Version.Parse(this.Version);
return (updateVersion > TestVersion);
}
}
}
+2 -3
View File
@@ -63,9 +63,6 @@
<Compile Include="BI\Interop\Community\PluginLibraryItem.cs" />
<Compile Include="BI\Interop\Community\PluginLibraryUpdateRequest.cs" />
<Compile Include="BI\Interop\Community\PluginLibraryUpdateResponse.cs" />
<Compile Include="BI\Interop\Community\UpdateRequestBase.cs" />
<Compile Include="BI\Interop\Community\UpdateRequestV1.cs" />
<Compile Include="BI\Interop\Community\UpdateResponse.cs" />
<Compile Include="BI\Job\Statistics\DailyOpenedClosedItem.cs" />
<Compile Include="ClientServices\EnrolResponse.cs" />
<Compile Include="ClientServices\MacEnrol.cs" />
@@ -112,6 +109,8 @@
<Compile Include="Services\Devices\Importing\IDeviceImportContext.cs" />
<Compile Include="Services\Devices\Importing\IDeviceImportField.cs" />
<Compile Include="Services\Interop\ActiveDirectory\ADManagedGroupConfiguration.cs" />
<Compile Include="Services\Interop\DiscoServices\UpdateRequestV2.cs" />
<Compile Include="Services\Interop\DiscoServices\UpdateResponseV2.cs" />
<Compile Include="Services\Jobs\JobLists\JobLocationReference.cs" />
<Compile Include="Services\Jobs\JobLists\JobTableItemModel.cs" />
<Compile Include="Services\Jobs\JobLists\JobTableModel.cs" />
@@ -0,0 +1,101 @@
using System;
using System.Collections.Generic;
namespace Disco.Models.Services.Interop.DiscoServices
{
public class UpdateRequestV2
{
public Guid DeploymentId { get; set; }
public DateTime RequestDate { get; set; }
public string VersionCurrent { get; set; }
public bool IsBetaDeployment { get; set; }
public string OrganisationName { get; set; }
public string BroadbandDoeWanId { get; set; }
public List<StatisticInt> Stat_JobCounts { get; set; }
public List<StatisticInt> Stat_OpenJobCounts { get; set; }
public List<StatisticInt> Stat_ActiveDeviceModelCounts { get; set; }
public List<StatisticInt> Stat_DeviceModelCounts { get; set; }
public List<StatisticInt> Stat_UserCounts { get; set; }
public List<StatisticString> InstalledPlugins { get; set; }
public List<StatisticJob> Stat_Jobs { get; set; }
public class StatisticInt
{
public string K;
public int V;
}
public class StatisticString
{
public string K;
public string V;
}
public class StatisticJob
{
/// <summary>
/// Job Identifier
/// </summary>
public int I { get; set; }
/// <summary>
/// Opened Date
/// </summary>
public DateTime OD { get; set; }
/// <summary>
/// Closed Date
/// </summary>
public DateTime? CD { get; set; }
/// <summary>
/// Job Type
/// </summary>
public string T { get; set; }
/// <summary>
/// Job Sub Types (Semicolon Separated)
/// </summary>
public string ST { get; set; }
/// <summary>
/// Deployment-Unique Device Serial Identifier (Device Serial Number anonymized via hashing salted with Deployment Secret)
/// </summary>
public string D { get; set; }
/// <summary>
/// Deployment-Unique Job User Identifier (Job User Id anonymized via hashing salted with Deployment Secret)
/// </summary>
public string U { get; set; }
/// <summary>
/// Deployment-Unique Job Technician Identifier (Job Technician Id anonymized via hashing salted with Deployment Secret)
/// </summary>
public string TI { get; set; }
/// <summary>
/// Device Model
/// </summary>
public string DM { get; set; }
/// <summary>
/// External Repairer
/// </summary>
public string R { get; set; }
/// <summary>
/// External Repairer Logged
/// </summary>
public DateTime? RL { get; set; }
/// <summary>
/// External Repairer Completed
/// </summary>
public DateTime? RC { get; set; }
}
}
}
@@ -0,0 +1,16 @@
using System;
namespace Disco.Models.Services.Interop.DiscoServices
{
public class UpdateResponseV2
{
public string LatestVersion { get; set; }
public DateTime ReleasedDate { get; set; }
public string Description { get; set; }
public bool IsBetaRelease { get; set; }
public string UrlLink { get; set; }
public DateTime UpdateResponseDate { get; set; }
}
}