Skip to content

Commit b5d780a

Browse files
committed
(doc) Add all missing documentation
This was pointed out via the warnings produced by StyleCop.
1 parent 1de2f10 commit b5d780a

9 files changed

+202
-8
lines changed

src/Cake.AppVeyor/AppVeyorAliases.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ namespace Cake.AppVeyor
2222
public static class AppVeyorAliases
2323
{
2424
/// <summary>
25-
/// Clears the AppVeyor Cache.
25+
/// Clears the AppVeyor Cache using additional settings in <cref>AppVeyorSettings</cref>.
2626
/// </summary>
27-
/// <returns>The projects.</returns>
2827
/// <param name="context">The context.</param>
2928
/// <param name="settings">The settings.</param>
3029
/// <param name="accountName">The account name.</param>
@@ -37,9 +36,8 @@ public static void AppVeyorClearCache(this ICakeContext context, AppVeyorSetting
3736
}
3837

3938
/// <summary>
40-
/// Gets all projects.
39+
/// Clears the AppVeyor Cache.
4140
/// </summary>
42-
/// <returns>The projects.</returns>
4341
/// <param name="context">The context.</param>
4442
/// <param name="appVeyorApiToken">The API Token.</param>
4543
/// <param name="accountName">The account name.</param>
@@ -52,7 +50,7 @@ public static void AppVeyorClearCache(this ICakeContext context, string appVeyor
5250
}
5351

5452
/// <summary>
55-
/// Gets all projects.
53+
/// Gets all projects using additional settings in <cref>AppVeyorSettings</cref>.
5654
/// </summary>
5755
/// <returns>The projects.</returns>
5856
/// <param name="context">The context.</param>
@@ -78,7 +76,7 @@ public static List<AppVeyorProject> AppVeyorProjects(this ICakeContext context,
7876
}
7977

8078
/// <summary>
81-
/// Gets the project build history.
79+
/// Gets the project build history using additional settings in <cref>AppVeyorSettings</cref>.
8280
/// </summary>
8381
/// <returns>The project build history.</returns>
8482
/// <param name="context">The context.</param>
@@ -114,7 +112,7 @@ public static AppVeyorProjectHistory AppVeyorProjectHistory(this ICakeContext co
114112
}
115113

116114
/// <summary>
117-
/// Gets the last build of the project.
115+
/// Gets the last build of the project using additional settings in <cref>AppVeyorSettings</cref>.
118116
/// </summary>
119117
/// <returns>The project's last build.</returns>
120118
/// <param name="context">The context.</param>
@@ -144,7 +142,7 @@ public static AppVeyorProjectBuild AppVeyorProjectLastBuild(this ICakeContext co
144142
}
145143

146144
/// <summary>
147-
/// Gets the last successful build of the project.
145+
/// Gets the last successful build of the project using additional settings in <cref>AppVeyorSettings</cref>.
148146
/// </summary>
149147
/// <returns>The project's last successful build.</returns>
150148
/// <param name="context">The context.</param>

src/Cake.AppVeyor/AppVeyorClient.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@
88

99
namespace Cake.AppVeyor
1010
{
11+
/// <summary>
12+
/// Provides a class for sending HTTP requests to AppVeyor.
13+
/// </summary>
1114
public static class AppVeyorClient
1215
{
1316
private const string BaseUrl = "https://ci.appveyor.com";
1417

18+
/// <summary>
19+
/// Create a new instance of <cref>IAppVeyorApi</cref> for interacting with the available methods against AppVeyor REST API.
20+
/// </summary>
21+
/// <param name="authToken">The API Key to use.</param>
22+
/// <returns>An instance of <cref>IAppVeyorApi</cref> to allow communication to AppVeyor REST API.</returns>
1523
public static IAppVeyorApi Create(string authToken)
1624
{
1725
return RestService.For<IAppVeyorApi>(

src/Cake.AppVeyor/AuthenticatedHttpClientHandler.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,31 @@
55

66
namespace Cake.AppVeyor
77
{
8+
/// <summary>
9+
/// The default message handler used by <cref>AppVeyorClient</cref>.
10+
/// </summary>
811
public class AuthenticatedHttpClientHandler : HttpClientHandler
912
{
13+
/// <summary>
14+
/// Initializes a new instance of the <see cref="AuthenticatedHttpClientHandler"/> class.
15+
/// </summary>
16+
/// <param name="authToken">The API Key for accessing AppVeyor.</param>
1017
public AuthenticatedHttpClientHandler(string authToken)
1118
{
1219
AuthToken = authToken;
1320
}
1421

22+
/// <summary>
23+
/// Gets or sets the API Key used to communicate with AppVeyor.
24+
/// </summary>
1525
public string AuthToken { get; set; }
1626

27+
/// <summary>
28+
/// Sends a message, asynchronously, to AppVeyor.
29+
/// </summary>
30+
/// <param name="request">The <cref>HttpRequestMessage</cref> to send to AppVeyor.</param>
31+
/// <param name="cancellationToken">The <cref>CancellationToken</cref> for the operation.</param>
32+
/// <returns>A <see cref="Task"/> representing the asynchronous operation to send a request to AppVeyor.</returns>
1733
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
1834
{
1935
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", AuthToken);

src/Cake.AppVeyor/IAppVeyorApi.cs

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,147 @@
44

55
namespace Cake.AppVeyor
66
{
7+
/// <summary>
8+
/// Provides the API methods that can be called against AppVeyor via the <cref>AppVeyorClient</cref>.
9+
/// </summary>
710
public interface IAppVeyorApi
811
{
12+
/// <summary>
13+
/// Clear the cache for a given AppVeyor project.
14+
/// </summary>
15+
/// <param name="accountName">The AppVeyor account name.</param>
16+
/// <param name="projectSlug">The slug for the project.</param>
17+
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
918
[Delete("/api/projects/{accountName}/{projectSlug}/buildcache")]
1019
Task ClearCache(string accountName, string projectSlug);
1120

21+
/// <summary>
22+
/// Gets a list of projects from AppVeyor.
23+
/// </summary>
24+
/// <returns>A <see cref="Task"/> representing the asynchronous operation with a list of AppVeyor projects.</returns>
1225
[Get("/api/projects")]
1326
Task<List<AppVeyorProject>> GetProjects();
1427

28+
/// <summary>
29+
/// Gets the history for a given project from AppVeyor.
30+
/// </summary>
31+
/// <param name="accountName">The AppVeyor account name.</param>
32+
/// <param name="projectSlug">The slug for the project.</param>
33+
/// <param name="recordsPerPage">The numbers of records to return in a page of results.</param>
34+
/// <param name="startBuildId">The ID for the build to start with.</param>
35+
/// <param name="branch">The name of the branch to use for the request.</param>
36+
/// <returns>A <see cref="Task"/> representing the asynchronous operation with the project history.</returns>
1537
[Get("/api/projects/{accountName}/{projectSlug}/history")]
1638
Task<AppVeyorProjectHistory> GetProjectHistory(string accountName, string projectSlug, [AliasAs("recordsNumber")] int recordsPerPage, int? startBuildId = null, string branch = null);
1739

40+
/// <summary>
41+
/// Gets the latest build for a given project.
42+
/// </summary>
43+
/// <param name="accountName">The AppVeyor account name.</param>
44+
/// <param name="projectSlug">The slug for the project.</param>
45+
/// <returns>A <see cref="Task"/> representing the asynchronous operation with the last build for the project.</returns>
1846
[Get("/api/projects/{accountName}/{projectSlug}")]
1947
Task<AppVeyorProjectBuild> GetProjectLastBuild(string accountName, string projectSlug);
2048

49+
/// <summary>
50+
/// Gets the latest build for a given project based on branch name.
51+
/// </summary>
52+
/// <param name="accountName">The AppVeyor account name.</param>
53+
/// <param name="projectSlug">The slug for the project.</param>
54+
/// <param name="branchName">The name of the branch to use for the request.</param>
55+
/// <returns>A <see cref="Task"/> representing the asynchronous operation with the last build for a branch for the project.</returns>
2156
[Get("/api/projects/{accountName}/{projectSlug}/branch/{branchName}")]
2257
Task<AppVeyorProjectBuild> GetProjectLastBranchBuild(string accountName, string projectSlug, string branchName);
2358

59+
/// <summary>
60+
/// Gets a specific AppVeyor build based on buil version number.
61+
/// </summary>
62+
/// <param name="accountName">The AppVeyor account name.</param>
63+
/// <param name="projectSlug">The slug for the project.</param>
64+
/// <param name="buildVersion">The build version number.</param>
65+
/// <returns>A <see cref="Task"/> representing the asynchronous operation with the build for the specified version for the project.</returns>
2466
[Get("/api/projects/{accountName}/{projectSlug}/build/{buildVersion}")]
2567
Task<AppVeyorProjectBuild> GetProjectBuildByVersion(string accountName, string projectSlug, string buildVersion);
2668

69+
/// <summary>
70+
/// Get the deployments for a given project.
71+
/// </summary>
72+
/// <param name="accountName">The AppVeyor account name.</param>
73+
/// <param name="projectSlug">The slug for the project.</param>
74+
/// <returns>A <see cref="Task"/> representing the asynchronous operation with a lst of deployments for the project.</returns>
2775
[Get("/api/projects/{accountName}/{projectSlug}/deployments")]
2876
Task<AppVeyorProjectDeployments> GetProjectDeployments(string accountName, string projectSlug);
2977

78+
/// <summary>
79+
/// Starts a build.
80+
/// </summary>
81+
/// <param name="buildRequest">An instance of <cref>AppVeyorBuildRequestLatestCommit</cref> identifying which build to start.</param>
82+
/// <returns>A <see cref="Task"/> representing the asynchronous operation with the build.</returns>
3083
[Post("/api/builds")]
3184
Task<AppVeyorBuild> StartBuildLatestCommit([Body] AppVeyorBuildRequestLatestCommit buildRequest);
3285

86+
/// <summary>
87+
/// Starts a build for a given commit.
88+
/// </summary>
89+
/// <param name="buildRequest">An instance of <cref>AppVeyorBuildRequestSpecificCommit</cref> identifying which build to start.</param>
90+
/// <returns>A <see cref="Task"/> representing the asynchronous operation with the build.</returns>
3391
[Post("/api/builds")]
3492
Task<AppVeyorBuild> StartBuildSpecificCommit([Body] AppVeyorBuildRequestSpecificCommit buildRequest);
3593

94+
/// <summary>
95+
/// Starts a build from a pull request.
96+
/// </summary>
97+
/// <param name="buildRequest">An instance of <cref>AppVeyorBuildRequestPullRequest</cref> identifying which build to start.</param>
98+
/// <returns>A <see cref="Task"/> representing the asynchronous operation with the build.</returns>
3699
[Post("/api/builds")]
37100
Task<AppVeyorBuild> StartBuildPullRequest([Body] AppVeyorBuildRequestPullRequest buildRequest);
38101

102+
/// <summary>
103+
/// Cancels a build.
104+
/// </summary>
105+
/// <param name="accountName">The AppVeyor account name.</param>
106+
/// <param name="projectSlug">The slug for the project.</param>
107+
/// <param name="buildVersion">The build version number.</param>
108+
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
39109
[Delete("/api/builds/{accountName}/{projectSlug}/{buildVersion}")]
40110
Task CancelBuild(string accountName, string projectSlug, string buildVersion);
41111

112+
/// <summary>
113+
/// Gets a single deployment.
114+
/// </summary>
115+
/// <param name="deploymentId">ID for the deployment to fetch.</param>
116+
/// <returns>A <see cref="Task"/> representing the asynchronous operation with the specified deployment.</returns>
42117
[Get("/api/deployments/{deploymentId}")]
43118
Task<AppVeyorProjectDeployment> GetDeployment(int deploymentId);
44119

120+
/// <summary>
121+
/// Starts a deployment.
122+
/// </summary>
123+
/// <param name="startDeploymentRequest">An instance of <cref>AppVeyorStartDeploymentRequest</cref> identifying which deployment to start.</param>
124+
/// <returns>A <see cref="Task"/> representing the asynchronous operation with the deployment that was started.</returns>
45125
[Post("/api/deployments")]
46126
Task<AppVeyorDeployment> StartDeployment(AppVeyorStartDeploymentRequest startDeploymentRequest);
47127

128+
/// <summary>
129+
/// Cancels a deployment.
130+
/// </summary>
131+
/// <param name="cancelDeploymentRequest">An instance of <cref>AppVeyorCancelDeploymentRequest</cref> identifying which deployment to cancel.</param>
132+
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
48133
[Put("/api/deployments/stop")]
49134
Task CancelDeployment(AppVeyorCancelDeploymentRequest cancelDeploymentRequest);
50135

136+
/// <summary>
137+
/// Gets all environemnts.
138+
/// </summary>
139+
/// <returns>A <see cref="Task"/> representing the asynchronous operation with the list of environment.</returns>
51140
[Get("/api/environments")]
52141
Task<List<AppVeyorEnvironment>> GetEnvironments();
53142

143+
/// <summary>
144+
/// Gets all deployments for a given environment.
145+
/// </summary>
146+
/// <param name="deploymentEnvironmentId">The ID of the deployment.</param>
147+
/// <returns>A <see cref="Task"/> representing the asynchronous operation with the deployment for the environment.</returns>
54148
[Get("/api/environments/{deploymentEnvironmentId}/deployments")]
55149
Task<AppVeyorEnvironmentDeployments> GetEnvironmentDeployments(int deploymentEnvironmentId);
56150
}

src/Cake.AppVeyor/Models/AppVeyorBuildRequestLatestCommit.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,41 @@
33

44
namespace Cake.AppVeyor
55
{
6+
/// <summary>
7+
/// Provides a class to describe the properties of the latest commit of an AppVeyor build.
8+
/// </summary>
69
public class AppVeyorBuildRequestLatestCommit
710
{
11+
/// <summary>
12+
/// Initializes a new instance of the <see cref="AppVeyorBuildRequestLatestCommit"/> class.
13+
/// </summary>
814
public AppVeyorBuildRequestLatestCommit()
915
{
1016
Branch = "master";
1117
EnvironmentVariables = new Dictionary<string, string>();
1218
}
1319

20+
/// <summary>
21+
/// Gets or sets the AppVeyor Account Name.
22+
/// </summary>
1423
[JsonProperty("accountName")]
1524
public string AccountName { get; set; }
1625

26+
/// <summary>
27+
/// Gets or sets the AppVeyor Project Slug.
28+
/// </summary>
1729
[JsonProperty("projectSlug")]
1830
public string ProjectSlug { get; set; }
1931

32+
/// <summary>
33+
/// Gets or sets the branch name for the project.
34+
/// </summary>
2035
[JsonProperty("branch")]
2136
public string Branch { get; set; }
2237

38+
/// <summary>
39+
/// Gets or sets the environment variables.
40+
/// </summary>
2341
[JsonProperty("environmentVariables")]
2442
public Dictionary<string, string> EnvironmentVariables { get; set; }
2543
}

src/Cake.AppVeyor/Models/AppVeyorBuildRequestPullRequest.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,26 @@
22

33
namespace Cake.AppVeyor
44
{
5+
/// <summary>
6+
/// Provides a class to describe the properties of a pull request build.
7+
/// </summary>
58
public class AppVeyorBuildRequestPullRequest
69
{
10+
/// <summary>
11+
/// Gets or sets the AppVeyor Account Name.
12+
/// </summary>
713
[JsonProperty("accountName")]
814
public string AccountName { get; set; }
915

16+
/// <summary>
17+
/// Gets or sets the AppVeyor Project Slug.
18+
/// </summary>
1019
[JsonProperty("projectSlug")]
1120
public string ProjectSlug { get; set; }
1221

22+
/// <summary>
23+
/// Gets or sets the Pull Request ID.
24+
/// </summary>
1325
[JsonProperty("pullRequestId")]
1426
public int PullRequestId { get; set; }
1527
}

src/Cake.AppVeyor/Models/AppVeyorBuildRequestSpecificCommit.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,40 @@
22

33
namespace Cake.AppVeyor
44
{
5+
/// <summary>
6+
/// Provides a class to describe the properties of a specific commit of an AppVeyor build.
7+
/// </summary>
58
public class AppVeyorBuildRequestSpecificCommit
69
{
10+
/// <summary>
11+
/// Initializes a new instance of the <see cref="AppVeyorBuildRequestSpecificCommit"/> class.
12+
/// </summary>
713
public AppVeyorBuildRequestSpecificCommit()
814
{
915
Branch = "master";
1016
}
1117

18+
/// <summary>
19+
/// Gets or sets the AppVeyor Account Name.
20+
/// </summary>
1221
[JsonProperty("accountName")]
1322
public string AccountName { get; set; }
1423

24+
/// <summary>
25+
/// Gets or sets the AppVeyor Project Slug.
26+
/// </summary>
1527
[JsonProperty("projectSlug")]
1628
public string ProjectSlug { get; set; }
1729

30+
/// <summary>
31+
/// Gets or sets the branch name for the project.
32+
/// </summary>
1833
[JsonProperty("branch")]
1934
public string Branch { get; set; }
2035

36+
/// <summary>
37+
/// Gets or sets the SHA identifying a specific commit.
38+
/// </summary>
2139
[JsonProperty("commitId")]
2240
public string CommitId { get; set; }
2341
}

src/Cake.AppVeyor/Models/AppVeyorCancelDeploymentRequest.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
namespace Cake.AppVeyor
44
{
5+
/// <summary>
6+
/// Provides a class to describe the properties of a deployment to be cancelled.
7+
/// </summary>
58
public class AppVeyorCancelDeploymentRequest
69
{
10+
/// <summary>
11+
/// Gets or sets of the deployment ID.
12+
/// </summary>
713
[JsonProperty("deploymentId")]
814
public int DeploymentId { get; set; }
915
}

0 commit comments

Comments
 (0)