added new overloads

This commit is contained in:
aedampir@gmail.com
2016-06-14 18:00:47 +07:00
parent a30008d1e9
commit 373e5ea6c0
4 changed files with 496 additions and 29 deletions

View File

@@ -53,6 +53,19 @@ namespace Octokit.Reactive
Justification = "Method makes a network request")]
IObservable<Issue> Get(string owner, string name, int number);
/// <summary>
/// Gets a single Issue by number.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#get-a-single-issue
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>A signal containing the requested <see cref="Issue"/>s.</returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
IObservable<Issue> Get(int repositoryId, int number);
/// <summary>
/// Gets all open issues assigned to the authenticated user across all the authenticated users visible
/// repositories including owned repositories, member repositories, and organization repositories.
@@ -198,6 +211,16 @@ namespace Octokit.Reactive
/// <returns>A signal containing one or more <see cref="Issue"/>s.</returns>
IObservable<Issue> GetAllForRepository(string owner, string name);
/// <summary>
/// Gets all open issues assigned to the authenticated user for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <returns>A signal containing one or more <see cref="Issue"/>s.</returns>
IObservable<Issue> GetAllForRepository(int repositoryId);
/// <summary>
/// Gets all open issues assigned to the authenticated user for the repository.
/// </summary>
@@ -210,6 +233,17 @@ namespace Octokit.Reactive
/// <returns>A signal containing one or more <see cref="Issue"/>s.</returns>
IObservable<Issue> GetAllForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// Gets all open issues assigned to the authenticated user for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A signal containing one or more <see cref="Issue"/>s.</returns>
IObservable<Issue> GetAllForRepository(int repositoryId, ApiOptions options);
/// <summary>
/// Gets issues for a repository.
/// </summary>
@@ -222,6 +256,17 @@ namespace Octokit.Reactive
/// <returns>A signal containing one or more <see cref="Issue"/>s.</returns>
IObservable<Issue> GetAllForRepository(string owner, string name, RepositoryIssueRequest request);
/// <summary>
/// Gets issues for a repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">Used to filter and sort the list of issues returned</param>
/// <returns>A signal containing one or more <see cref="Issue"/>s.</returns>
IObservable<Issue> GetAllForRepository(int repositoryId, RepositoryIssueRequest request);
/// <summary>
/// Gets issues for a repository.
/// </summary>
@@ -235,6 +280,18 @@ namespace Octokit.Reactive
/// <returns>A signal containing one or more <see cref="Issue"/>s.</returns>
IObservable<Issue> GetAllForRepository(string owner, string name, RepositoryIssueRequest request, ApiOptions options);
/// <summary>
/// Gets issues for a repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">Used to filter and sort the list of issues returned</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A signal containing one or more <see cref="Issue"/>s.</returns>
IObservable<Issue> GetAllForRepository(int repositoryId, RepositoryIssueRequest request, ApiOptions options);
/// <summary>
/// Creates an issue for the specified repository. Any user with pull access to a repository can create an
/// issue.
@@ -246,6 +303,16 @@ namespace Octokit.Reactive
/// <returns>A signal containing the new <see cref="Issue"/>.</returns>
IObservable<Issue> Create(string owner, string name, NewIssue newIssue);
/// <summary>
/// Creates an issue for the specified repository. Any user with pull access to a repository can create an
/// issue.
/// </summary>
/// <remarks>http://developer.github.com/v3/issues/#create-an-issue</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="newIssue">A <see cref="NewIssue"/> instance describing the new issue to create</param>
/// <returns>A signal containing the new <see cref="Issue"/>.</returns>
IObservable<Issue> Create(int repositoryId, NewIssue newIssue);
/// <summary>
/// Creates an issue for the specified repository. Any user with pull access to a repository can create an
/// issue.
@@ -259,6 +326,18 @@ namespace Octokit.Reactive
/// <returns>A signal containing the updated <see cref="Issue"/>.</returns>
IObservable<Issue> Update(string owner, string name, int number, IssueUpdate issueUpdate);
/// <summary>
/// Creates an issue for the specified repository. Any user with pull access to a repository can create an
/// issue.
/// </summary>
/// <remarks>http://developer.github.com/v3/issues/#create-an-issue</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <param name="issueUpdate">An <see cref="IssueUpdate"/> instance describing the changes to make to the issue
/// </param>
/// <returns>A signal containing the updated <see cref="Issue"/>.</returns>
IObservable<Issue> Update(int repositoryId, int number, IssueUpdate issueUpdate);
/// <summary>
/// Locks an issue for the specified repository. Issue owners and users with push access can lock an issue.
/// </summary>
@@ -269,6 +348,15 @@ namespace Octokit.Reactive
/// <returns>A signal indicating completion.</returns>
IObservable<Unit> Lock(string owner, string name, int number);
/// <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="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>A signal indicating completion.</returns>
IObservable<Unit> Lock(int repositoryId, int number);
/// <summary>
/// Unlocks an issue for the specified repository. Issue owners and users with push access can unlock an issue.
/// </summary>
@@ -278,5 +366,14 @@ namespace Octokit.Reactive
/// <param name="number">The issue number</param>
/// <returns>A signal indicating completion.</returns>
IObservable<Unit> Unlock(string owner, string name, int number);
/// <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="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>A signal indicating completion.</returns>
IObservable<Unit> Unlock(int repositoryId, int number);
}
}

View File

@@ -1,7 +1,7 @@
using System;
using System.Reactive;
using System.Reactive.Threading.Tasks;
using Octokit.Reactive.Internal;
using System.Reactive;
namespace Octokit.Reactive
{
@@ -74,6 +74,20 @@ namespace Octokit.Reactive
return _client.Get(owner, name, number).ToObservable();
}
/// <summary>
/// Gets a single Issue by number.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#get-a-single-issue
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>A signal containing the requested <see cref="Issue"/>s.</returns>
public IObservable<Issue> Get(int repositoryId, int number)
{
return _client.Get(repositoryId, number).ToObservable();
}
/// <summary>
/// Gets all open issues assigned to the authenticated user across all the authenticated users visible
/// repositories including owned repositories, member repositories, and organization repositories.
@@ -287,6 +301,19 @@ namespace Octokit.Reactive
return GetAllForRepository(owner, name, ApiOptions.None);
}
/// <summary>
/// Gets all open issues assigned to the authenticated user for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <returns>A signal containing one or more <see cref="Issue"/>s.</returns>
public IObservable<Issue> GetAllForRepository(int repositoryId)
{
return GetAllForRepository(repositoryId, ApiOptions.None);
}
/// <summary>
/// Gets all open issues assigned to the authenticated user for the repository.
/// </summary>
@@ -306,6 +333,22 @@ namespace Octokit.Reactive
return GetAllForRepository(owner, name, new RepositoryIssueRequest(), options);
}
/// <summary>
/// Gets all open issues assigned to the authenticated user for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A signal containing one or more <see cref="Issue"/>s.</returns>
public IObservable<Issue> GetAllForRepository(int repositoryId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, "options");
return GetAllForRepository(repositoryId, new RepositoryIssueRequest(), options);
}
/// <summary>
/// Gets issues for a repository.
/// </summary>
@@ -325,6 +368,22 @@ namespace Octokit.Reactive
return GetAllForRepository(owner, name, request, ApiOptions.None);
}
/// <summary>
/// Gets issues for a repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">Used to filter and sort the list of issues returned</param>
/// <returns>A signal containing one or more <see cref="Issue"/>s.</returns>
public IObservable<Issue> GetAllForRepository(int repositoryId, RepositoryIssueRequest request)
{
Ensure.ArgumentNotNull(request, "request");
return GetAllForRepository(repositoryId, request, ApiOptions.None);
}
/// <summary>
/// Gets issues for a repository.
/// </summary>
@@ -346,6 +405,24 @@ namespace Octokit.Reactive
return _connection.GetAndFlattenAllPages<Issue>(ApiUrls.Issues(owner, name), request.ToParametersDictionary(), options);
}
/// <summary>
/// Gets issues for a repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">Used to filter and sort the list of issues returned</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A signal containing one or more <see cref="Issue"/>s.</returns>
public IObservable<Issue> GetAllForRepository(int repositoryId, RepositoryIssueRequest request, ApiOptions options)
{
Ensure.ArgumentNotNull(request, "request");
Ensure.ArgumentNotNull(options, "options");
return _connection.GetAndFlattenAllPages<Issue>(ApiUrls.Issues(repositoryId), request.ToParametersDictionary(), options);
}
/// <summary>
/// Creates an issue for the specified repository. Any user with pull access to a repository can create an
/// issue.
@@ -364,6 +441,21 @@ namespace Octokit.Reactive
return _client.Create(owner, name, newIssue).ToObservable();
}
/// <summary>
/// Creates an issue for the specified repository. Any user with pull access to a repository can create an
/// issue.
/// </summary>
/// <remarks>http://developer.github.com/v3/issues/#create-an-issue</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="newIssue">A <see cref="NewIssue"/> instance describing the new issue to create</param>
/// <returns>A signal containing the new <see cref="Issue"/>.</returns>
public IObservable<Issue> Create(int repositoryId, NewIssue newIssue)
{
Ensure.ArgumentNotNull(newIssue, "newIssue");
return _client.Create(repositoryId, newIssue).ToObservable();
}
/// <summary>
/// Creates an issue for the specified repository. Any user with pull access to a repository can create an
/// issue.
@@ -384,6 +476,23 @@ namespace Octokit.Reactive
return _client.Update(owner, name, number, issueUpdate).ToObservable();
}
/// <summary>
/// Creates an issue for the specified repository. Any user with pull access to a repository can create an
/// issue.
/// </summary>
/// <remarks>http://developer.github.com/v3/issues/#create-an-issue</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <param name="issueUpdate">An <see cref="IssueUpdate"/> instance describing the changes to make to the issue
/// </param>
/// <returns>A signal containing the updated <see cref="Issue"/>.</returns>
public IObservable<Issue> Update(int repositoryId, int number, IssueUpdate issueUpdate)
{
Ensure.ArgumentNotNull(issueUpdate, "issueUpdate");
return _client.Update(repositoryId, number, issueUpdate).ToObservable();
}
/// <summary>
/// Locks an issue for the specified repository. Issue owners and users with push access can lock an issue.
/// </summary>
@@ -400,6 +509,18 @@ namespace Octokit.Reactive
return _client.Lock(owner, name, number).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="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>A signal indicating completion.</returns>
public IObservable<Unit> Lock(int repositoryId, int number)
{
return _client.Lock(repositoryId, number).ToObservable();
}
/// <summary>
/// Unlocks an issue for the specified repository. Issue owners and users with push access can unlock an issue.
/// </summary>
@@ -415,5 +536,17 @@ namespace Octokit.Reactive
return _client.Unlock(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="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>A signal indicating completion.</returns>
public IObservable<Unit> Unlock(int repositoryId, int number)
{
return _client.Unlock(repositoryId, number).ToObservable();
}
}
}

View File

@@ -53,6 +53,19 @@ namespace Octokit
Justification = "Method makes a network request")]
Task<Issue> Get(string owner, string name, int number);
/// <summary>
/// Gets a single Issue by number.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#get-a-single-issue
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>The created <see cref="Task"/> representing requesting the issue from the API.</returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
Task<Issue> Get(int repositoryId, int number);
/// <summary>
/// Gets all open issues assigned to the authenticated user across all the authenticated users visible
/// repositories including owned repositories, member repositories, and organization repositories.
@@ -198,6 +211,16 @@ namespace Octokit
/// <returns>The created <see cref="Task"/> representing requesting a list of issue from the API.</returns>
Task<IReadOnlyList<Issue>> GetAllForRepository(string owner, string name);
/// <summary>
/// Gets all open issues assigned to the authenticated user for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <returns>The created <see cref="Task"/> representing requesting a list of issue from the API.</returns>
Task<IReadOnlyList<Issue>> GetAllForRepository(int repositoryId);
/// <summary>
/// Gets all open issues assigned to the authenticated user for the repository.
/// </summary>
@@ -210,6 +233,17 @@ namespace Octokit
/// <returns>The created <see cref="Task"/> representing requesting a list of issue from the API.</returns>
Task<IReadOnlyList<Issue>> GetAllForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// Gets all open issues assigned to the authenticated user for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The created <see cref="Task"/> representing requesting a list of issue from the API.</returns>
Task<IReadOnlyList<Issue>> GetAllForRepository(int repositoryId, ApiOptions options);
/// <summary>
/// Gets issues for a repository.
/// </summary>
@@ -222,6 +256,17 @@ namespace Octokit
/// <returns>The created <see cref="Task"/> representing requesting a list of issue from the API.</returns>
Task<IReadOnlyList<Issue>> GetAllForRepository(string owner, string name, RepositoryIssueRequest request);
/// <summary>
/// Gets issues for a repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">Used to filter and sort the list of issues returned</param>
/// <returns>The created <see cref="Task"/> representing requesting a list of issue from the API.</returns>
Task<IReadOnlyList<Issue>> GetAllForRepository(int repositoryId, RepositoryIssueRequest request);
/// <summary>
/// Gets issues for a repository.
/// </summary>
@@ -235,6 +280,18 @@ namespace Octokit
/// <returns>The created <see cref="Task"/> representing requesting a list of issue from the API.</returns>
Task<IReadOnlyList<Issue>> GetAllForRepository(string owner, string name, RepositoryIssueRequest request, ApiOptions options);
/// <summary>
/// Gets issues for a repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">Used to filter and sort the list of issues returned</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The created <see cref="Task"/> representing requesting a list of issue from the API.</returns>
Task<IReadOnlyList<Issue>> GetAllForRepository(int repositoryId, RepositoryIssueRequest request, ApiOptions options);
/// <summary>
/// Creates an issue for the specified repository. Any user with pull access to a repository can create an
/// issue.
@@ -246,6 +303,16 @@ namespace Octokit
/// <returns>The created <see cref="Task"/> representing the new issue from the API.</returns>
Task<Issue> Create(string owner, string name, NewIssue newIssue);
/// <summary>
/// Creates an issue for the specified repository. Any user with pull access to a repository can create an
/// issue.
/// </summary>
/// <remarks>http://developer.github.com/v3/issues/#create-an-issue</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="newIssue">A <see cref="NewIssue"/> instance describing the new issue to create</param>
/// <returns>The created <see cref="Task"/> representing the new issue from the API.</returns>
Task<Issue> Create(int repositoryId, NewIssue newIssue);
/// <summary>
/// Updates an issue for the specified repository. Any user with pull access to a repository can update an
/// issue.
@@ -259,6 +326,18 @@ namespace Octokit
/// <returns>The created <see cref="Task"/> representing the updated issue from the API.</returns>
Task<Issue> Update(string owner, string name, int number, IssueUpdate issueUpdate);
/// <summary>
/// Updates an issue for the specified repository. Any user with pull access to a repository can update an
/// issue.
/// </summary>
/// <remarks>http://developer.github.com/v3/issues/#edit-an-issue</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <param name="issueUpdate">An <see cref="IssueUpdate"/> instance describing the changes to make to the issue
/// </param>
/// <returns>The created <see cref="Task"/> representing the updated issue from the API.</returns>
Task<Issue> Update(int repositoryId, int number, IssueUpdate issueUpdate);
/// <summary>
/// Locks an issue for the specified repository. Issue owners and users with push access can lock an issue.
/// </summary>
@@ -269,6 +348,15 @@ namespace Octokit
/// <returns>The created <see cref="Task"/> representing accessing the API.</returns>
Task Lock(string owner, string name, int number);
/// <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="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>The created <see cref="Task"/> representing accessing the API.</returns>
Task Lock(int repositoryId, int number);
/// <summary>
/// Unlocks an issue for the specified repository. Issue owners and users with push access can unlock an issue.
/// </summary>
@@ -278,5 +366,14 @@ namespace Octokit
/// <param name="number">The issue number</param>
/// <returns>The created <see cref="Task"/> representing accessing the API.</returns>
Task Unlock(string owner, string name, int number);
/// <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="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>The created <see cref="Task"/> representing accessing the API.</returns>
Task Unlock(int repositoryId, int number);
}
}

View File

@@ -69,6 +69,20 @@ namespace Octokit
return ApiConnection.Get<Issue>(ApiUrls.Issue(owner, name, number));
}
/// <summary>
/// Gets a single Issue by number.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#get-a-single-issue
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>The created <see cref="Task"/> representing requesting the issue from the API.</returns>
public Task<Issue> Get(int repositoryId, int number)
{
return ApiConnection.Get<Issue>(ApiUrls.Issue(repositoryId, number));
}
/// <summary>
/// Gets all open issues assigned to the authenticated user across all the authenticated users visible
/// repositories including owned repositories, member repositories, and organization repositories.
@@ -276,9 +290,25 @@ namespace Octokit
/// <returns>The created <see cref="Task"/> representing requesting a list of issue from the API.</returns>
public Task<IReadOnlyList<Issue>> GetAllForRepository(string owner, string name)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
return GetAllForRepository(owner, name, new RepositoryIssueRequest());
}
/// <summary>
/// Gets all open issues assigned to the authenticated user for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <returns>The created <see cref="Task"/> representing requesting a list of issue from the API.</returns>
public Task<IReadOnlyList<Issue>> GetAllForRepository(int repositoryId)
{
return GetAllForRepository(repositoryId, new RepositoryIssueRequest());
}
/// <summary>
/// Gets all open issues assigned to the authenticated user for the repository.
/// </summary>
@@ -291,9 +321,29 @@ namespace Octokit
/// <returns>The created <see cref="Task"/> representing requesting a list of issue from the API.</returns>
public Task<IReadOnlyList<Issue>> GetAllForRepository(string owner, string name, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(options, "options");
return GetAllForRepository(owner, name, new RepositoryIssueRequest(), options);
}
/// <summary>
/// Gets all open issues assigned to the authenticated user for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The created <see cref="Task"/> representing requesting a list of issue from the API.</returns>
public Task<IReadOnlyList<Issue>> GetAllForRepository(int repositoryId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, "options");
return GetAllForRepository(repositoryId, new RepositoryIssueRequest(), options);
}
/// <summary>
/// Gets issues for a repository.
/// </summary>
@@ -313,6 +363,22 @@ namespace Octokit
return GetAllForRepository(owner, name, request, ApiOptions.None);
}
/// <summary>
/// Gets issues for a repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">Used to filter and sort the list of issues returned</param>
/// <returns>The created <see cref="Task"/> representing requesting a list of issue from the API.</returns>
public Task<IReadOnlyList<Issue>> GetAllForRepository(int repositoryId, RepositoryIssueRequest request)
{
Ensure.ArgumentNotNull(request, "request");
return GetAllForRepository(repositoryId, request, ApiOptions.None);
}
/// <summary>
/// Gets issues for a repository.
/// </summary>
@@ -334,6 +400,24 @@ namespace Octokit
return ApiConnection.GetAll<Issue>(ApiUrls.Issues(owner, name), request.ToParametersDictionary(), options);
}
/// <summary>
/// Gets issues for a repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/#list-issues-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">Used to filter and sort the list of issues returned</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The created <see cref="Task"/> representing requesting a list of issue from the API.</returns>
public Task<IReadOnlyList<Issue>> GetAllForRepository(int repositoryId, RepositoryIssueRequest request, ApiOptions options)
{
Ensure.ArgumentNotNull(request, "request");
Ensure.ArgumentNotNull(options, "options");
return ApiConnection.GetAll<Issue>(ApiUrls.Issues(repositoryId), request.ToParametersDictionary(), options);
}
/// <summary>
/// Creates an issue for the specified repository. Any user with pull access to a repository can create an
/// issue.
@@ -352,6 +436,21 @@ namespace Octokit
return ApiConnection.Post<Issue>(ApiUrls.Issues(owner, name), newIssue);
}
/// <summary>
/// Creates an issue for the specified repository. Any user with pull access to a repository can create an
/// issue.
/// </summary>
/// <remarks>http://developer.github.com/v3/issues/#create-an-issue</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="newIssue">A <see cref="NewIssue"/> instance describing the new issue to create</param>
/// <returns>The created <see cref="Task"/> representing the new issue from the API.</returns>
public Task<Issue> Create(int repositoryId, NewIssue newIssue)
{
Ensure.ArgumentNotNull(newIssue, "newIssue");
return ApiConnection.Post<Issue>(ApiUrls.Issues(repositoryId), newIssue);
}
/// <summary>
/// Updates an issue for the specified repository. Issue owners and users with push access can edit an issue.
/// </summary>
@@ -371,6 +470,23 @@ namespace Octokit
return ApiConnection.Patch<Issue>(ApiUrls.Issue(owner, name, number), issueUpdate);
}
/// <summary>
/// Updates an issue for the specified repository. Any user with pull access to a repository can update an
/// issue.
/// </summary>
/// <remarks>http://developer.github.com/v3/issues/#edit-an-issue</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <param name="issueUpdate">An <see cref="IssueUpdate"/> instance describing the changes to make to the issue
/// </param>
/// <returns>The created <see cref="Task"/> representing the updated issue from the API.</returns>
public Task<Issue> Update(int repositoryId, int number, IssueUpdate issueUpdate)
{
Ensure.ArgumentNotNull(issueUpdate, "issueUpdate");
return ApiConnection.Patch<Issue>(ApiUrls.Issue(repositoryId, number), issueUpdate);
}
/// <summary>
/// Locks an issue for the specified repository. Issue owners and users with push access can lock an issue.
/// </summary>
@@ -387,6 +503,18 @@ namespace Octokit
return ApiConnection.Put<Issue>(ApiUrls.IssueLock(owner, name, number), new object(), null, AcceptHeaders.IssueLockingUnlockingApiPreview);
}
/// <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="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>The created <see cref="Task"/> representing accessing the API.</returns>
public Task Lock(int repositoryId, int number)
{
return ApiConnection.Put<Issue>(ApiUrls.IssueLock(repositoryId, number), new object(), null, AcceptHeaders.IssueLockingUnlockingApiPreview);
}
/// <summary>
/// Unlocks an issue for the specified repository. Issue owners and users with push access can unlock an issue.
/// </summary>
@@ -402,5 +530,17 @@ namespace Octokit
return ApiConnection.Delete(ApiUrls.IssueLock(owner, name, number), new object(), AcceptHeaders.IssueLockingUnlockingApiPreview);
}
/// <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="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>The created <see cref="Task"/> representing accessing the API.</returns>
public Task Unlock(int repositoryId, int number)
{
return ApiConnection.Delete(ApiUrls.IssueLock(repositoryId, number), new object(), AcceptHeaders.IssueLockingUnlockingApiPreview);
}
}
}