aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/ViewModels/MainViewVM.cs
Commit message (Expand)AuthorAgeFilesLines
* Insights peek application/firmware logs.Roy Ben Shabat2020-08-191-1/+8
* FSE Firmware FileSystem.Roy Ben Shabat2020-04-151-0/+52
@{
    Tango.CodeGeneration.TangoWebClientCodeFile model = Model as Tango.CodeGeneration.TangoWebClientCodeFile;
}
using System;
using System.Threading.Tasks;
using Tango.Web;

namespace @(model.Namespace)
{
    /// <summary>
    /// Represents a machine service @(model.ControllerName) web client.
    /// </summary>
    /// <seealso cref="Tango.Web.TangoWebClient" />
    public abstract class @(model.Name) : TangoWebClient<@(model.LoginRequest), @(model.LoginResponse)>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="@(model.Name)"/> class.
        /// </summary>
        /// <param name="environment">The environment.</param>
        /// <param name="token">Existing token.</param>
        public @(model.Name)(DeploymentSlot environment, String token) : base(environment, "@(model.ControllerName)", token)
        {
            
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="@(model.Name)"/> class.
        /// </summary>
        /// <param name="environment">The environment.</param>
        public @(model.Name)(DeploymentSlot environment) : this(environment, null)
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="@(model.Name)"/> class.
        /// </summary>
        /// <param name="address">The service address.</param>
        /// <param name="token">Existing token.</param>
        public @(model.Name)(String address, String token) : base(address, "@(model.ControllerName)", token)
        {

        }

        @foreach (var action in model.Actions)
        {
          <div>
            /// <summary>
            /// Executes the @(action.Name) action and returns @(action.Response).
            /// </summary>
            /// <returns></returns>
            public Task<@(action.Response)> @(action.Name)(@(action.Request) request)
            {
                return Post<@(action.Request), @(action.Response)>("@(action.Name)", request);
            }

          </div>
        }
    }
}