aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-12-19 14:52:54 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-12-19 14:52:54 +0200
commitc3ed01b6c75c44cfeca650b43deb058b1551a9bb (patch)
tree87f8c8391373c3fa50eb7248798ce8fd99fde8c6 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs
parentde762e7e5b346af5a12eff04cbaa0696eec15b8c (diff)
downloadTango-c3ed01b6c75c44cfeca650b43deb058b1551a9bb.tar.gz
Tango-c3ed01b6c75c44cfeca650b43deb058b1551a9bb.zip
Moved machine studio update azure !!!
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs
new file mode 100644
index 000000000..aae1fe70d
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Settings;
+using Tango.Transport.Web;
+
+namespace Tango.MachineStudio.Common.Update
+{
+ public class MachineStudioUpdateService : IMachineStudioUpdateService
+ {
+ private string address;
+ private WebTransportClient _client;
+
+ public MachineStudioUpdateService()
+ {
+ address = SettingsManager.Default.GetOrCreate<MachineStudioSettings>().MachineServiceAddress + "/api/MachineStudio/";
+ _client = new WebTransportClient();
+ }
+
+ public Task<CheckForUpdatesResponse> CheckForUpdates(CheckForUpdatesRequest request)
+ {
+ return _client.PostJson<CheckForUpdatesRequest, CheckForUpdatesResponse>(address + "CheckForUpdates", request);
+ }
+
+ public Task<UploadVersionResponse> UploadVersion(UploadVersionRequest request)
+ {
+ return _client.PostJson<UploadVersionRequest, UploadVersionResponse>(address + "UploadVersion", request);
+ }
+
+ public Task<UploadCompletedResponse> NotifyUploadCompleted(UploadCompletedRequest request)
+ {
+ return _client.PostJson<UploadCompletedRequest, UploadCompletedResponse>(address + "NotifyUploadCompleted", request);
+ }
+
+ public Task<LatestVersionResponse> GetLatestVersion(LatestVersionRequest request)
+ {
+ return _client.PostJson<LatestVersionRequest, LatestVersionResponse>(address + "GetLatestVersion", request);
+ }
+ }
+}