aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-02-19 11:19:21 +0200
committerShlomo Hecht <shlomo@twine-s.com>2019-02-19 11:19:21 +0200
commit93e6a6bfa7238826dcdea989e279ec3450067f83 (patch)
tree212b5023935862346a7de311e37cf1ef727efcd5 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web
parente99efd9d9b7b67a76db82a9a40525f96bcf064c0 (diff)
parent3fcd0dbc6650749421f0390a60154c52254682e6 (diff)
downloadTango-93e6a6bfa7238826dcdea989e279ec3450067f83.tar.gz
Tango-93e6a6bfa7238826dcdea989e279ec3450067f83.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesRequest.cs15
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesResponse.cs21
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionRequest.cs14
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionResponse.cs16
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LatestVersionRequest.cs15
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LatestVersionResponse.cs15
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginRequest.cs16
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginResponse.cs18
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClient.cs33
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClientBase.cs79
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadCompletedRequest.cs15
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadCompletedResponse.cs14
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionRequest.cs17
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionResponse.cs17
14 files changed, 305 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesRequest.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesRequest.cs
new file mode 100644
index 000000000..4f9576f50
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesRequest.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.MachineStudio.Common.Web
+{
+ public class CheckForUpdatesRequest : WebRequestSecureMessage
+ {
+ public String Version { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesResponse.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesResponse.cs
new file mode 100644
index 000000000..51608e6c4
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesResponse.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.MachineStudio.Common.Web
+{
+ public class CheckForUpdatesResponse : WebResponseMessage
+ {
+ public bool IsUpdateAvailable { get; set; }
+
+ public String Version { get; set; }
+
+ public String Comments { get; set; }
+
+ public String BlobAddress { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionRequest.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionRequest.cs
new file mode 100644
index 000000000..d63654726
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionRequest.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.MachineStudio.Common.Web
+{
+ public class DownloadLatestVersionRequest : WebRequestSecureMessage
+ {
+
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionResponse.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionResponse.cs
new file mode 100644
index 000000000..3209b9a2f
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionResponse.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.MachineStudio.Common.Web
+{
+ public class DownloadLatestVersionResponse : WebResponseMessage
+ {
+ public String Version { get; set; }
+
+ public String BlobAddress { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LatestVersionRequest.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LatestVersionRequest.cs
new file mode 100644
index 000000000..59bb71db4
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LatestVersionRequest.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.MachineStudio.Common.Web
+{
+ public class LatestVersionRequest : WebRequestMessage
+ {
+
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LatestVersionResponse.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LatestVersionResponse.cs
new file mode 100644
index 000000000..7d43128f1
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LatestVersionResponse.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.MachineStudio.Common.Web
+{
+ public class LatestVersionResponse : WebResponseMessage
+ {
+ public String Version { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginRequest.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginRequest.cs
new file mode 100644
index 000000000..577f5e208
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginRequest.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.MachineStudio.Common.Web
+{
+ public class LoginRequest : WebRequestMessage
+ {
+ public String Version { get; set; }
+ public String Email { get; set; }
+ public String Password { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginResponse.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginResponse.cs
new file mode 100644
index 000000000..78c7bc560
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginResponse.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Core;
+using Tango.Transport.Web;
+using Tango.Web.Authentication;
+
+namespace Tango.MachineStudio.Common.Web
+{
+ public class LoginResponse : WebTokenResponse
+ {
+ public DataSource DataSource { get; set; }
+ public bool VersionChangeRequired { get; set; }
+ public String RequiredVersion { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClient.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClient.cs
new file mode 100644
index 000000000..02276d641
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClient.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Settings;
+using Tango.Web;
+using Tango.Web.Authentication;
+
+namespace Tango.MachineStudio.Common.Web
+{
+ public class MachineStudioWebClient : MachineStudioWebClientBase
+ {
+ public MachineStudioWebClient(DeploymentSlot environment) : base(environment)
+ {
+ }
+
+ public MachineStudioWebClient(DeploymentSlot environment, WebToken token) : base(environment, token)
+ {
+
+ }
+
+ public MachineStudioWebClient(WebToken token) : this(SettingsManager.Default.GetOrCreate<MachineStudioSettings>().DeploymentSlot, token)
+ {
+
+ }
+
+ public MachineStudioWebClient() : this(null)
+ {
+
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClientBase.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClientBase.cs
new file mode 100644
index 000000000..dc5a14856
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClientBase.cs
@@ -0,0 +1,79 @@
+
+using System.Threading.Tasks;
+using Tango.Web;
+using Tango.Web.Authentication;
+
+namespace Tango.MachineStudio.Common.Web
+{
+ /// <summary>
+ /// Represents a machine service MachineStudio web client.
+ /// </summary>
+ /// <seealso cref="Tango.Web.TangoWebClient" />
+ public abstract class MachineStudioWebClientBase : TangoWebClient<Tango.MachineStudio.Common.Web.LoginRequest, Tango.MachineStudio.Common.Web.LoginResponse>
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MachineStudioWebClientBase"/> class.
+ /// </summary>
+ /// <param name="environment">The environment.</param>
+ /// <param name="token">Existing token.</param>
+ public MachineStudioWebClientBase(DeploymentSlot environment, WebToken token) : base(environment, "MachineStudio", token)
+ {
+
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MachineStudioWebClientBase"/> class.
+ /// </summary>
+ /// <param name="environment">The environment.</param>
+ public MachineStudioWebClientBase(DeploymentSlot environment) : this(environment, null)
+ {
+
+ }
+
+ /// <summary>
+ /// Executes the CheckForUpdates action and returns Tango.MachineStudio.Common.Web.CheckForUpdatesResponse.
+ /// </summary>
+ /// <returns></returns>
+ public Task<Tango.MachineStudio.Common.Web.CheckForUpdatesResponse> CheckForUpdates(Tango.MachineStudio.Common.Web.CheckForUpdatesRequest request)
+ {
+ return Post<Tango.MachineStudio.Common.Web.CheckForUpdatesRequest, Tango.MachineStudio.Common.Web.CheckForUpdatesResponse>("CheckForUpdates", request);
+ }
+
+ /// <summary>
+ /// Executes the DownloadLatestVersion action and returns Tango.MachineStudio.Common.Web.DownloadLatestVersionResponse.
+ /// </summary>
+ /// <returns></returns>
+ public Task<Tango.MachineStudio.Common.Web.DownloadLatestVersionResponse> DownloadLatestVersion(Tango.MachineStudio.Common.Web.DownloadLatestVersionRequest request)
+ {
+ return Post<Tango.MachineStudio.Common.Web.DownloadLatestVersionRequest, Tango.MachineStudio.Common.Web.DownloadLatestVersionResponse>("DownloadLatestVersion", request);
+ }
+
+ /// <summary>
+ /// Executes the UploadVersion action and returns Tango.MachineStudio.Common.Web.UploadVersionResponse.
+ /// </summary>
+ /// <returns></returns>
+ public Task<Tango.MachineStudio.Common.Web.UploadVersionResponse> UploadVersion(Tango.MachineStudio.Common.Web.UploadVersionRequest request)
+ {
+ return Post<Tango.MachineStudio.Common.Web.UploadVersionRequest, Tango.MachineStudio.Common.Web.UploadVersionResponse>("UploadVersion", request);
+ }
+
+ /// <summary>
+ /// Executes the NotifyUploadCompleted action and returns Tango.MachineStudio.Common.Web.UploadCompletedResponse.
+ /// </summary>
+ /// <returns></returns>
+ public Task<Tango.MachineStudio.Common.Web.UploadCompletedResponse> NotifyUploadCompleted(Tango.MachineStudio.Common.Web.UploadCompletedRequest request)
+ {
+ return Post<Tango.MachineStudio.Common.Web.UploadCompletedRequest, Tango.MachineStudio.Common.Web.UploadCompletedResponse>("NotifyUploadCompleted", request);
+ }
+
+ /// <summary>
+ /// Executes the GetLatestVersion action and returns Tango.MachineStudio.Common.Web.LatestVersionResponse.
+ /// </summary>
+ /// <returns></returns>
+ public Task<Tango.MachineStudio.Common.Web.LatestVersionResponse> GetLatestVersion(Tango.MachineStudio.Common.Web.LatestVersionRequest request)
+ {
+ return Post<Tango.MachineStudio.Common.Web.LatestVersionRequest, Tango.MachineStudio.Common.Web.LatestVersionResponse>("GetLatestVersion", request);
+ }
+
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadCompletedRequest.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadCompletedRequest.cs
new file mode 100644
index 000000000..48f5b2a6e
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadCompletedRequest.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.MachineStudio.Common.Web
+{
+ public class UploadCompletedRequest : WebRequestSecureMessage
+ {
+ public String Token { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadCompletedResponse.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadCompletedResponse.cs
new file mode 100644
index 000000000..a290cf642
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadCompletedResponse.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.MachineStudio.Common.Web
+{
+ public class UploadCompletedResponse : WebResponseMessage
+ {
+
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionRequest.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionRequest.cs
new file mode 100644
index 000000000..33577deb2
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionRequest.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.MachineStudio.Common.Web
+{
+ public class UploadVersionRequest : WebRequestSecureMessage
+ {
+ public String Version { get; set; }
+
+ public String Comments { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionResponse.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionResponse.cs
new file mode 100644
index 000000000..9fb3ab94d
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionResponse.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.MachineStudio.Common.Web
+{
+ public class UploadVersionResponse : WebResponseMessage
+ {
+ public String Token { get; set; }
+
+ public String BlobAddress { get; set; }
+ }
+}