@{ Tango.CodeGeneration.TangoWebClientCodeFile model = Model as Tango.CodeGeneration.TangoWebClientCodeFile; } using System; using System.Threading.Tasks; using Tango.Web; namespace @(model.Namespace) { /// /// Represents a machine service @(model.ControllerName) web client. /// /// public abstract class @(model.Name) : TangoWebClient<@(model.LoginRequest), @(model.LoginResponse)> { /// /// Initializes a new instance of the class. /// /// The environment. /// Existing token. public @(model.Name)(DeploymentSlot environment, String token) : base(environment, "@(model.ControllerName)", token) { } /// /// Initializes a new instance of the class. /// /// The environment. public @(model.Name)(DeploymentSlot environment) : this(environment, null) { } /// /// Initializes a new instance of the class. /// /// The service address. /// Existing token. public @(model.Name)(String address, String token) : base(address, "@(model.ControllerName)", token) { } @foreach (var action in model.Actions) {
/// /// Executes the @(action.Name) action and returns @(action.Response). /// /// public Task<@(action.Response)> @(action.Name)(@(action.Request) request) { return Post<@(action.Request), @(action.Response)>("@(action.Name)", request); }
} } }