Implement Lock/Unlock Issue

This commit is contained in:
Prayank Mathur
2016-03-25 11:26:37 +05:30
parent f354d1bf00
commit 171b3c520a
9 changed files with 265 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Reactive.Threading.Tasks;
using Octokit.Reactive.Internal;
using System.Reactive;
namespace Octokit.Reactive
{
@@ -222,5 +223,37 @@ namespace Octokit.Reactive
return _client.Update(owner, name, number, issueUpdate).ToObservable();
}
/// <summary>
/// Locks an issue for the specified repository. Issue owners and users with push access can lock an issue.
/// </summary>
/// <remarks>https://developer.github.com/v3/issues/#lock-an-issue</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
/// <returns></returns>
public IObservable<Unit> LockIssue(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
return _client.LockIssue(owner, name, number).ToObservable();
}
/// <summary>
/// Unlocks an issue for the specified repository. Issue owners and users with push access can unlock an issue.
/// </summary>
/// <remarks>https://developer.github.com/v3/issues/#unlock-an-issue</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
/// <returns></returns>
public IObservable<Unit> UnlockIssue(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
return _client.UnlockIssue(owner, name, number).ToObservable();
}
}
}