aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClientBase.cs
blob: 665d25ccb5bc4320396350f7089433458b930c79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; back
using System;
using System.Threading.Tasks;
using Tango.Web;

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, String 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>
        /// Initializes a new instance of the <see cref="MachineStudioWebClientBase"/> class.
        /// </summary>
        /// <param name="address">The service address.</param>
        /// <param name="token">Existing token.</param>
        public MachineStudioWebClientBase(String address, String token) : base(address, "MachineStudio", token)
        {

        }

        /// <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 NotifyVersionUploadCompleted action and returns Tango.MachineStudio.Common.Web.UploadCompletedResponse.
        /// </summary>
        /// <returns></returns>
        public Task<Tango.MachineStudio.Common.Web.UploadCompletedResponse> NotifyVersionUploadCompleted(Tango.MachineStudio.Common.Web.UploadCompletedRequest request)
        {
            return Post<Tango.MachineStudio.Common.Web.UploadCompletedRequest, Tango.MachineStudio.Common.Web.UploadCompletedResponse>("NotifyVersionUploadCompleted", 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);
        }

    }
}