added new overloads

This commit is contained in:
Alexander Efremov
2016-06-16 23:33:11 +07:00
parent 27d0077aae
commit ffb3680d99
4 changed files with 537 additions and 0 deletions

View File

@@ -3,6 +3,12 @@ using System.Reactive;
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Pull Request Review Comments API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/pulls/comments/">Review Comments API documentation</a> for more information.
/// </remarks>
public interface IObservablePullRequestReviewCommentsClient
{
/// <summary>
@@ -15,6 +21,15 @@ namespace Octokit.Reactive
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
IObservable<PullRequestReviewComment> GetAll(string owner, string name, int number);
/// <summary>
/// Gets review comments for a specified pull request.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request number</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
IObservable<PullRequestReviewComment> GetAll(int repositoryId, int number);
/// <summary>
/// Gets review comments for a specified pull request.
/// </summary>
@@ -26,6 +41,16 @@ namespace Octokit.Reactive
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
IObservable<PullRequestReviewComment> GetAll(string owner, string name, int number, ApiOptions options);
/// <summary>
/// Gets review comments for a specified pull request.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request number</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
IObservable<PullRequestReviewComment> GetAll(int repositoryId, int number, ApiOptions options);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -35,6 +60,14 @@ namespace Octokit.Reactive
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
IObservable<PullRequestReviewComment> GetAllForRepository(string owner, string name);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
IObservable<PullRequestReviewComment> GetAllForRepository(int repositoryId);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -45,6 +78,15 @@ namespace Octokit.Reactive
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
IObservable<PullRequestReviewComment> GetAllForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
IObservable<PullRequestReviewComment> GetAllForRepository(int repositoryId, ApiOptions options);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -55,6 +97,15 @@ namespace Octokit.Reactive
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
IObservable<PullRequestReviewComment> GetAllForRepository(string owner, string name, PullRequestReviewCommentRequest request);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">The sorting <see cref="PullRequestReviewCommentRequest">parameters</see></param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
IObservable<PullRequestReviewComment> GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -66,6 +117,16 @@ namespace Octokit.Reactive
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
IObservable<PullRequestReviewComment> GetAllForRepository(string owner, string name, PullRequestReviewCommentRequest request, ApiOptions options);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">The sorting <see cref="PullRequestReviewCommentRequest">parameters</see></param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
IObservable<PullRequestReviewComment> GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request, ApiOptions options);
/// <summary>
/// Gets a single pull request review comment by number.
/// </summary>
@@ -76,6 +137,15 @@ namespace Octokit.Reactive
/// <returns>The <see cref="PullRequestReviewComment"/></returns>
IObservable<PullRequestReviewComment> GetComment(string owner, string name, int number);
/// <summary>
/// Gets a single pull request review comment by number.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#get-a-single-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request review comment number</param>
/// <returns>The <see cref="PullRequestReviewComment"/></returns>
IObservable<PullRequestReviewComment> GetComment(int repositoryId, int number);
/// <summary>
/// Creates a comment on a pull request review.
/// </summary>
@@ -87,6 +157,16 @@ namespace Octokit.Reactive
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
IObservable<PullRequestReviewComment> Create(string owner, string name, int number, PullRequestReviewCommentCreate comment);
/// <summary>
/// Creates a comment on a pull request review.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The Pull Request number</param>
/// <param name="comment">The comment</param>
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
IObservable<PullRequestReviewComment> Create(int repositoryId, int number, PullRequestReviewCommentCreate comment);
/// <summary>
/// Creates a comment on a pull request review as a reply to another comment.
/// </summary>
@@ -98,6 +178,16 @@ namespace Octokit.Reactive
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
IObservable<PullRequestReviewComment> CreateReply(string owner, string name, int number, PullRequestReviewCommentReplyCreate comment);
/// <summary>
/// Creates a comment on a pull request review as a reply to another comment.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request number</param>
/// <param name="comment">The comment</param>
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
IObservable<PullRequestReviewComment> CreateReply(int repositoryId, int number, PullRequestReviewCommentReplyCreate comment);
/// <summary>
/// Edits a comment on a pull request review.
/// </summary>
@@ -109,6 +199,16 @@ namespace Octokit.Reactive
/// <returns>The edited <see cref="PullRequestReviewComment"/></returns>
IObservable<PullRequestReviewComment> Edit(string owner, string name, int number, PullRequestReviewCommentEdit comment);
/// <summary>
/// Edits a comment on a pull request review.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#edit-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request review comment number</param>
/// <param name="comment">The edited comment</param>
/// <returns>The edited <see cref="PullRequestReviewComment"/></returns>
IObservable<PullRequestReviewComment> Edit(int repositoryId, int number, PullRequestReviewCommentEdit comment);
/// <summary>
/// Deletes a comment on a pull request review.
/// </summary>
@@ -118,5 +218,14 @@ namespace Octokit.Reactive
/// <param name="number">The pull request review comment number</param>
/// <returns></returns>
IObservable<Unit> Delete(string owner, string name, int number);
/// <summary>
/// Deletes a comment on a pull request review.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#delete-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request review comment number</param>
/// <returns></returns>
IObservable<Unit> Delete(int repositoryId, int number);
}
}

View File

@@ -5,6 +5,12 @@ using Octokit.Reactive.Internal;
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Pull Request Review Comments API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/pulls/comments/">Review Comments API documentation</a> for more information.
/// </remarks>
public class ObservablePullRequestReviewCommentsClient : IObservablePullRequestReviewCommentsClient
{
readonly IPullRequestReviewCommentsClient _client;
@@ -34,6 +40,18 @@ namespace Octokit.Reactive
return GetAll(owner, name, number, ApiOptions.None);
}
/// <summary>
/// Gets review comments for a specified pull request.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request number</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
public IObservable<PullRequestReviewComment> GetAll(int repositoryId, int number)
{
return GetAll(repositoryId, number, ApiOptions.None);
}
/// <summary>
/// Gets review comments for a specified pull request.
/// </summary>
@@ -52,6 +70,21 @@ namespace Octokit.Reactive
return _connection.GetAndFlattenAllPages<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(owner, name, number), options);
}
/// <summary>
/// Gets review comments for a specified pull request.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request number</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
public IObservable<PullRequestReviewComment> GetAll(int repositoryId, int number, ApiOptions options)
{
Ensure.ArgumentNotNull(options, "options");
return _connection.GetAndFlattenAllPages<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(repositoryId, number), options);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -67,6 +100,17 @@ namespace Octokit.Reactive
return GetAllForRepository(owner, name, new PullRequestReviewCommentRequest(), ApiOptions.None);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
public IObservable<PullRequestReviewComment> GetAllForRepository(int repositoryId)
{
return GetAllForRepository(repositoryId, new PullRequestReviewCommentRequest(), ApiOptions.None);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -84,6 +128,20 @@ namespace Octokit.Reactive
return GetAllForRepository(owner, name, new PullRequestReviewCommentRequest(), options);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
public IObservable<PullRequestReviewComment> GetAllForRepository(int repositoryId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, "options");
return GetAllForRepository(repositoryId, new PullRequestReviewCommentRequest(), options);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -101,6 +159,20 @@ namespace Octokit.Reactive
return GetAllForRepository(owner, name, request, ApiOptions.None);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">The sorting <see cref="PullRequestReviewCommentRequest">parameters</see></param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
public IObservable<PullRequestReviewComment> GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request)
{
Ensure.ArgumentNotNull(request, "request");
return GetAllForRepository(repositoryId, request, ApiOptions.None);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -121,6 +193,23 @@ namespace Octokit.Reactive
options);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">The sorting <see cref="PullRequestReviewCommentRequest">parameters</see></param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
public IObservable<PullRequestReviewComment> GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request, ApiOptions options)
{
Ensure.ArgumentNotNull(request, "request");
Ensure.ArgumentNotNull(options, "options");
return _connection.GetAndFlattenAllPages<PullRequestReviewComment>(ApiUrls.PullRequestReviewCommentsRepository(repositoryId), request.ToParametersDictionary(),
options);
}
/// <summary>
/// Gets a single pull request review comment by number.
/// </summary>
@@ -137,6 +226,18 @@ namespace Octokit.Reactive
return _client.GetComment(owner, name, number).ToObservable();
}
/// <summary>
/// Gets a single pull request review comment by number.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#get-a-single-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request review comment number</param>
/// <returns>The <see cref="PullRequestReviewComment"/></returns>
public IObservable<PullRequestReviewComment> GetComment(int repositoryId, int number)
{
return _client.GetComment(repositoryId, number).ToObservable();
}
/// <summary>
/// Creates a comment on a pull request review.
/// </summary>
@@ -155,6 +256,21 @@ namespace Octokit.Reactive
return _client.Create(owner, name, number, comment).ToObservable();
}
/// <summary>
/// Creates a comment on a pull request review.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The Pull Request number</param>
/// <param name="comment">The comment</param>
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
public IObservable<PullRequestReviewComment> Create(int repositoryId, int number, PullRequestReviewCommentCreate comment)
{
Ensure.ArgumentNotNull(comment, "comment");
return _client.Create(repositoryId, number, comment).ToObservable();
}
/// <summary>
/// Creates a comment on a pull request review as a reply to another comment.
/// </summary>
@@ -173,6 +289,21 @@ namespace Octokit.Reactive
return _client.CreateReply(owner, name, number, comment).ToObservable();
}
/// <summary>
/// Creates a comment on a pull request review as a reply to another comment.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request number</param>
/// <param name="comment">The comment</param>
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
public IObservable<PullRequestReviewComment> CreateReply(int repositoryId, int number, PullRequestReviewCommentReplyCreate comment)
{
Ensure.ArgumentNotNull(comment, "comment");
return _client.CreateReply(repositoryId, number, comment).ToObservable();
}
/// <summary>
/// Edits a comment on a pull request review.
/// </summary>
@@ -191,6 +322,21 @@ namespace Octokit.Reactive
return _client.Edit(owner, name, number, comment).ToObservable();
}
/// <summary>
/// Edits a comment on a pull request review.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#edit-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request review comment number</param>
/// <param name="comment">The edited comment</param>
/// <returns>The edited <see cref="PullRequestReviewComment"/></returns>
public IObservable<PullRequestReviewComment> Edit(int repositoryId, int number, PullRequestReviewCommentEdit comment)
{
Ensure.ArgumentNotNull(comment, "comment");
return _client.Edit(repositoryId, number, comment).ToObservable();
}
/// <summary>
/// Deletes a comment on a pull request review.
/// </summary>
@@ -206,5 +352,17 @@ namespace Octokit.Reactive
return _client.Delete(owner, name, number).ToObservable();
}
/// <summary>
/// Deletes a comment on a pull request review.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#delete-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request review comment number</param>
/// <returns></returns>
public IObservable<Unit> Delete(int repositoryId, int number)
{
return _client.Delete(repositoryId, number).ToObservable();
}
}
}

View File

@@ -21,6 +21,15 @@ namespace Octokit
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
Task<IReadOnlyList<PullRequestReviewComment>> GetAll(string owner, string name, int number);
/// <summary>
/// Gets review comments for a specified pull request.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request number</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
Task<IReadOnlyList<PullRequestReviewComment>> GetAll(int repositoryId, int number);
/// <summary>
/// Gets review comments for a specified pull request.
/// </summary>
@@ -32,6 +41,16 @@ namespace Octokit
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
Task<IReadOnlyList<PullRequestReviewComment>> GetAll(string owner, string name, int number, ApiOptions options);
/// <summary>
/// Gets review comments for a specified pull request.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request number</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
Task<IReadOnlyList<PullRequestReviewComment>> GetAll(int repositoryId, int number, ApiOptions options);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -41,6 +60,14 @@ namespace Octokit
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
Task<IReadOnlyList<PullRequestReviewComment>> GetAllForRepository(string owner, string name);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
Task<IReadOnlyList<PullRequestReviewComment>> GetAllForRepository(int repositoryId);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -51,6 +78,15 @@ namespace Octokit
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
Task<IReadOnlyList<PullRequestReviewComment>> GetAllForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
Task<IReadOnlyList<PullRequestReviewComment>> GetAllForRepository(int repositoryId, ApiOptions options);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -61,6 +97,15 @@ namespace Octokit
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
Task<IReadOnlyList<PullRequestReviewComment>> GetAllForRepository(string owner, string name, PullRequestReviewCommentRequest request);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">The sorting <see cref="PullRequestReviewCommentRequest">parameters</see></param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
Task<IReadOnlyList<PullRequestReviewComment>> GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -72,6 +117,16 @@ namespace Octokit
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
Task<IReadOnlyList<PullRequestReviewComment>> GetAllForRepository(string owner, string name, PullRequestReviewCommentRequest request, ApiOptions options);
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">The sorting <see cref="PullRequestReviewCommentRequest">parameters</see></param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
Task<IReadOnlyList<PullRequestReviewComment>> GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request, ApiOptions options);
/// <summary>
/// Gets a single pull request review comment by number.
/// </summary>
@@ -82,6 +137,15 @@ namespace Octokit
/// <returns>The <see cref="PullRequestReviewComment"/></returns>
Task<PullRequestReviewComment> GetComment(string owner, string name, int number);
/// <summary>
/// Gets a single pull request review comment by number.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#get-a-single-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request review comment number</param>
/// <returns>The <see cref="PullRequestReviewComment"/></returns>
Task<PullRequestReviewComment> GetComment(int repositoryId, int number);
/// <summary>
/// Creates a comment on a pull request review.
/// </summary>
@@ -93,6 +157,16 @@ namespace Octokit
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
Task<PullRequestReviewComment> Create(string owner, string name, int number, PullRequestReviewCommentCreate comment);
/// <summary>
/// Creates a comment on a pull request review.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The Pull Request number</param>
/// <param name="comment">The comment</param>
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
Task<PullRequestReviewComment> Create(int repositoryId, int number, PullRequestReviewCommentCreate comment);
/// <summary>
/// Creates a comment on a pull request review as a reply to another comment.
/// </summary>
@@ -104,6 +178,16 @@ namespace Octokit
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
Task<PullRequestReviewComment> CreateReply(string owner, string name, int number, PullRequestReviewCommentReplyCreate comment);
/// <summary>
/// Creates a comment on a pull request review as a reply to another comment.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request number</param>
/// <param name="comment">The comment</param>
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
Task<PullRequestReviewComment> CreateReply(int repositoryId, int number, PullRequestReviewCommentReplyCreate comment);
/// <summary>
/// Edits a comment on a pull request review.
/// </summary>
@@ -115,6 +199,16 @@ namespace Octokit
/// <returns>The edited <see cref="PullRequestReviewComment"/></returns>
Task<PullRequestReviewComment> Edit(string owner, string name, int number, PullRequestReviewCommentEdit comment);
/// <summary>
/// Edits a comment on a pull request review.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#edit-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request review comment number</param>
/// <param name="comment">The edited comment</param>
/// <returns>The edited <see cref="PullRequestReviewComment"/></returns>
Task<PullRequestReviewComment> Edit(int repositoryId, int number, PullRequestReviewCommentEdit comment);
/// <summary>
/// Deletes a comment on a pull request review.
/// </summary>
@@ -124,5 +218,14 @@ namespace Octokit
/// <param name="number">The pull request review comment number</param>
/// <returns></returns>
Task Delete(string owner, string name, int number);
/// <summary>
/// Deletes a comment on a pull request review.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#delete-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request review comment number</param>
/// <returns></returns>
Task Delete(int repositoryId, int number);
}
}

View File

@@ -33,6 +33,18 @@ namespace Octokit
return GetAll(owner, name, number, ApiOptions.None);
}
/// <summary>
/// Gets review comments for a specified pull request.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request number</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
public Task<IReadOnlyList<PullRequestReviewComment>> GetAll(int repositoryId, int number)
{
return GetAll(repositoryId, number, ApiOptions.None);
}
/// <summary>
/// Gets review comments for a specified pull request.
/// </summary>
@@ -51,6 +63,21 @@ namespace Octokit
return ApiConnection.GetAll<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(owner, name, number), options);
}
/// <summary>
/// Gets review comments for a specified pull request.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request number</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
public Task<IReadOnlyList<PullRequestReviewComment>> GetAll(int repositoryId, int number, ApiOptions options)
{
Ensure.ArgumentNotNull(options, "options");
return ApiConnection.GetAll<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(repositoryId, number), options);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -66,6 +93,17 @@ namespace Octokit
return GetAllForRepository(owner, name, new PullRequestReviewCommentRequest(), ApiOptions.None);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
public Task<IReadOnlyList<PullRequestReviewComment>> GetAllForRepository(int repositoryId)
{
return GetAllForRepository(repositoryId, new PullRequestReviewCommentRequest(), ApiOptions.None);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -83,6 +121,20 @@ namespace Octokit
return GetAllForRepository(owner, name, new PullRequestReviewCommentRequest(), options);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
public Task<IReadOnlyList<PullRequestReviewComment>> GetAllForRepository(int repositoryId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, "options");
return GetAllForRepository(repositoryId, new PullRequestReviewCommentRequest(), options);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -100,6 +152,20 @@ namespace Octokit
return GetAllForRepository(owner, name, request, ApiOptions.None);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">The sorting <see cref="PullRequestReviewCommentRequest">parameters</see></param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
public Task<IReadOnlyList<PullRequestReviewComment>> GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request)
{
Ensure.ArgumentNotNull(request, "request");
return GetAllForRepository(repositoryId, request, ApiOptions.None);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
@@ -119,6 +185,22 @@ namespace Octokit
return ApiConnection.GetAll<PullRequestReviewComment>(ApiUrls.PullRequestReviewCommentsRepository(owner, name), request.ToParametersDictionary(), options);
}
/// <summary>
/// Gets a list of the pull request review comments in a specified repository.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="request">The sorting <see cref="PullRequestReviewCommentRequest">parameters</see></param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
public Task<IReadOnlyList<PullRequestReviewComment>> GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request, ApiOptions options)
{
Ensure.ArgumentNotNull(request, "request");
Ensure.ArgumentNotNull(options, "options");
return ApiConnection.GetAll<PullRequestReviewComment>(ApiUrls.PullRequestReviewCommentsRepository(repositoryId), request.ToParametersDictionary(), options);
}
/// <summary>
/// Gets a single pull request review comment by number.
/// </summary>
@@ -135,6 +217,18 @@ namespace Octokit
return ApiConnection.Get<PullRequestReviewComment>(ApiUrls.PullRequestReviewComment(owner, name, number));
}
/// <summary>
/// Gets a single pull request review comment by number.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#get-a-single-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request review comment number</param>
/// <returns>The <see cref="PullRequestReviewComment"/></returns>
public Task<PullRequestReviewComment> GetComment(int repositoryId, int number)
{
return ApiConnection.Get<PullRequestReviewComment>(ApiUrls.PullRequestReviewComment(repositoryId, number));
}
/// <summary>
/// Creates a comment on a pull request review.
/// </summary>
@@ -161,6 +255,29 @@ namespace Octokit
return response.Body;
}
/// <summary>
/// Creates a comment on a pull request review.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The Pull Request number</param>
/// <param name="comment">The comment</param>
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
public async Task<PullRequestReviewComment> Create(int repositoryId, int number, PullRequestReviewCommentCreate comment)
{
Ensure.ArgumentNotNull(comment, "comment");
var endpoint = ApiUrls.PullRequestReviewComments(repositoryId, number);
var response = await ApiConnection.Connection.Post<PullRequestReviewComment>(endpoint, comment, null, null).ConfigureAwait(false);
if (response.HttpResponse.StatusCode != HttpStatusCode.Created)
{
throw new ApiException("Invalid Status Code returned. Expected a 201", response.HttpResponse.StatusCode);
}
return response.Body;
}
/// <summary>
/// Creates a comment on a pull request review as a reply to another comment.
/// </summary>
@@ -187,6 +304,29 @@ namespace Octokit
return response.Body;
}
/// <summary>
/// Creates a comment on a pull request review as a reply to another comment.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request number</param>
/// <param name="comment">The comment</param>
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
public async Task<PullRequestReviewComment> CreateReply(int repositoryId, int number, PullRequestReviewCommentReplyCreate comment)
{
Ensure.ArgumentNotNull(comment, "comment");
var endpoint = ApiUrls.PullRequestReviewComments(repositoryId, number);
var response = await ApiConnection.Connection.Post<PullRequestReviewComment>(endpoint, comment, null, null).ConfigureAwait(false);
if (response.HttpResponse.StatusCode != HttpStatusCode.Created)
{
throw new ApiException("Invalid Status Code returned. Expected a 201", response.HttpResponse.StatusCode);
}
return response.Body;
}
/// <summary>
/// Edits a comment on a pull request review.
/// </summary>
@@ -205,6 +345,21 @@ namespace Octokit
return ApiConnection.Patch<PullRequestReviewComment>(ApiUrls.PullRequestReviewComment(owner, name, number), comment);
}
/// <summary>
/// Edits a comment on a pull request review.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#edit-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request review comment number</param>
/// <param name="comment">The edited comment</param>
/// <returns>The edited <see cref="PullRequestReviewComment"/></returns>
public Task<PullRequestReviewComment> Edit(int repositoryId, int number, PullRequestReviewCommentEdit comment)
{
Ensure.ArgumentNotNull(comment, "comment");
return ApiConnection.Patch<PullRequestReviewComment>(ApiUrls.PullRequestReviewComment(repositoryId, number), comment);
}
/// <summary>
/// Deletes a comment on a pull request review.
/// </summary>
@@ -220,5 +375,17 @@ namespace Octokit
return ApiConnection.Delete(ApiUrls.PullRequestReviewComment(owner, name, number));
}
/// <summary>
/// Deletes a comment on a pull request review.
/// </summary>
/// <remarks>http://developer.github.com/v3/pulls/comments/#delete-a-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The pull request review comment number</param>
/// <returns></returns>
public Task Delete(int repositoryId, int number)
{
return ApiConnection.Delete(ApiUrls.PullRequestReviewComment(repositoryId, number));
}
}
}