using System.Threading.Tasks;
namespace Octokit
{
///
/// A client for GitHub's Git Merging API.
///
///
/// See the Git Merging API documentation for more information.
///
public class MergingClient : ApiClient, IMergingClient
{
///
/// Initializes a new instance of the class.
///
/// The client's connection
public MergingClient(IApiConnection apiConnection) : base(apiConnection)
{
}
///
/// Create a merge for a given repository
///
///
/// http://developer.github.com/v3/repos/merging/#perform-a-merge
///
/// The owner of the repository
/// The name of the repository
/// The merge to create
///
public Task Create(string owner, string name, NewMerge merge)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(merge, "merge");
return ApiConnection.Post(ApiUrls.CreateMerge(owner, name), merge);
}
///
/// Create a merge for a given repository
///
///
/// http://developer.github.com/v3/repos/merging/#perform-a-merge
///
/// The ID of the repository
/// The merge to create
///
public Task Create(int repositoryId, NewMerge merge)
{
Ensure.ArgumentNotNull(merge, "merge");
return ApiConnection.Post(ApiUrls.CreateMerge(repositoryId), merge);
}
}
}