diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-12-20 15:07:43 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-12-20 15:07:43 +0200 |
| commit | 64367a944ebddc998b06eb2673928ef95ffc3627 (patch) | |
| tree | b30eff3671d388d23c10a91a82cc25a6d42d548f /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs | |
| parent | 4554080793bd46fcb8f55578d2f67917584dc332 (diff) | |
| parent | d204e56c57dcf52f31c9e64222f32a678150e721 (diff) | |
| download | Tango-64367a944ebddc998b06eb2673928ef95ffc3627.tar.gz Tango-64367a944ebddc998b06eb2673928ef95ffc3627.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
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.cs | 42 |
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); + } + } +} |
