public virtual async Task<AppVeyorServiceResponse<Build>> StartBuild(string accountName, string projectSlug, string branchName)
{
var response = new AppVeyorServiceResponse<Build>();
try
{
Condition.Requires(accountName, "accountName").IsNotNullOrEmpty();
Condition.Requires(projectSlug, "projectSlug").IsNotNullOrEmpty();
Condition.Requires(branchName, "branchName").IsNotNullOrEmpty();
var request = new RestRequest("builds", Method.POST);
request.AddJsonBody(new
{
accountName,
projectSlug,
branch = branchName
});
var build = await ExecuteAsync<Build>(request);
response.Result = build;
}
catch (Exception exception)
{
response.Exception = exception;
response.HasError = true;
}
return response;
}