blob: 3918ce92853c26c1d927cd62c06a4dcf51c86c00 (
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
@{
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)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="@(model.Name)"/> class.
/// </summary>
/// <param name="cloned">Other instance.</param>
public @(model.Name)(@(model.Name) cloned) : base(cloned)
{
}
@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>
}
}
}
|