diff --git a/Octokit.Reactive/Clients/IObservablePullRequestReviewCommentsClient.cs b/Octokit.Reactive/Clients/IObservablePullRequestReviewCommentsClient.cs index bc609f18..96b5a7eb 100644 --- a/Octokit.Reactive/Clients/IObservablePullRequestReviewCommentsClient.cs +++ b/Octokit.Reactive/Clients/IObservablePullRequestReviewCommentsClient.cs @@ -3,6 +3,12 @@ using System.Reactive; namespace Octokit.Reactive { + /// + /// A client for GitHub's Pull Request Review Comments API. + /// + /// + /// See the Review Comments API documentation for more information. + /// public interface IObservablePullRequestReviewCommentsClient { /// @@ -15,6 +21,15 @@ namespace Octokit.Reactive /// The list of s for the specified pull request IObservable GetAll(string owner, string name, int number); + /// + /// Gets review comments for a specified pull request. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request + /// The ID of the repository + /// The pull request number + /// The list of s for the specified pull request + IObservable GetAll(int repositoryId, int number); + /// /// Gets review comments for a specified pull request. /// @@ -26,6 +41,16 @@ namespace Octokit.Reactive /// The list of s for the specified pull request IObservable GetAll(string owner, string name, int number, ApiOptions options); + /// + /// Gets review comments for a specified pull request. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request + /// The ID of the repository + /// The pull request number + /// Options for changing the API response + /// The list of s for the specified pull request + IObservable GetAll(int repositoryId, int number, ApiOptions options); + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -35,6 +60,14 @@ namespace Octokit.Reactive /// The list of s for the specified repository IObservable GetAllForRepository(string owner, string name); + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// The list of s for the specified repository + IObservable GetAllForRepository(int repositoryId); + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -45,6 +78,15 @@ namespace Octokit.Reactive /// The list of s for the specified repository IObservable GetAllForRepository(string owner, string name, ApiOptions options); + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// Options for changing the API response + /// The list of s for the specified repository + IObservable GetAllForRepository(int repositoryId, ApiOptions options); + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -55,6 +97,15 @@ namespace Octokit.Reactive /// The list of s for the specified repository IObservable GetAllForRepository(string owner, string name, PullRequestReviewCommentRequest request); + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// The sorting parameters + /// The list of s for the specified repository + IObservable GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request); + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -66,6 +117,16 @@ namespace Octokit.Reactive /// The list of s for the specified repository IObservable GetAllForRepository(string owner, string name, PullRequestReviewCommentRequest request, ApiOptions options); + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// The sorting parameters + /// Options for changing the API response + /// The list of s for the specified repository + IObservable GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request, ApiOptions options); + /// /// Gets a single pull request review comment by number. /// @@ -76,6 +137,15 @@ namespace Octokit.Reactive /// The IObservable GetComment(string owner, string name, int number); + /// + /// Gets a single pull request review comment by number. + /// + /// http://developer.github.com/v3/pulls/comments/#get-a-single-comment + /// The ID of the repository + /// The pull request review comment number + /// The + IObservable GetComment(int repositoryId, int number); + /// /// Creates a comment on a pull request review. /// @@ -87,6 +157,16 @@ namespace Octokit.Reactive /// The created IObservable Create(string owner, string name, int number, PullRequestReviewCommentCreate comment); + /// + /// Creates a comment on a pull request review. + /// + /// http://developer.github.com/v3/pulls/comments/#create-a-comment + /// The ID of the repository + /// The Pull Request number + /// The comment + /// The created + IObservable Create(int repositoryId, int number, PullRequestReviewCommentCreate comment); + /// /// Creates a comment on a pull request review as a reply to another comment. /// @@ -98,6 +178,16 @@ namespace Octokit.Reactive /// The created IObservable CreateReply(string owner, string name, int number, PullRequestReviewCommentReplyCreate comment); + /// + /// Creates a comment on a pull request review as a reply to another comment. + /// + /// http://developer.github.com/v3/pulls/comments/#create-a-comment + /// The ID of the repository + /// The pull request number + /// The comment + /// The created + IObservable CreateReply(int repositoryId, int number, PullRequestReviewCommentReplyCreate comment); + /// /// Edits a comment on a pull request review. /// @@ -109,6 +199,16 @@ namespace Octokit.Reactive /// The edited IObservable Edit(string owner, string name, int number, PullRequestReviewCommentEdit comment); + /// + /// Edits a comment on a pull request review. + /// + /// http://developer.github.com/v3/pulls/comments/#edit-a-comment + /// The ID of the repository + /// The pull request review comment number + /// The edited comment + /// The edited + IObservable Edit(int repositoryId, int number, PullRequestReviewCommentEdit comment); + /// /// Deletes a comment on a pull request review. /// @@ -118,5 +218,14 @@ namespace Octokit.Reactive /// The pull request review comment number /// IObservable Delete(string owner, string name, int number); + + /// + /// Deletes a comment on a pull request review. + /// + /// http://developer.github.com/v3/pulls/comments/#delete-a-comment + /// The ID of the repository + /// The pull request review comment number + /// + IObservable Delete(int repositoryId, int number); } } diff --git a/Octokit.Reactive/Clients/ObservablePullRequestReviewCommentsClient.cs b/Octokit.Reactive/Clients/ObservablePullRequestReviewCommentsClient.cs index 5ae71eda..b2117774 100644 --- a/Octokit.Reactive/Clients/ObservablePullRequestReviewCommentsClient.cs +++ b/Octokit.Reactive/Clients/ObservablePullRequestReviewCommentsClient.cs @@ -5,6 +5,12 @@ using Octokit.Reactive.Internal; namespace Octokit.Reactive { + /// + /// A client for GitHub's Pull Request Review Comments API. + /// + /// + /// See the Review Comments API documentation for more information. + /// public class ObservablePullRequestReviewCommentsClient : IObservablePullRequestReviewCommentsClient { readonly IPullRequestReviewCommentsClient _client; @@ -34,6 +40,18 @@ namespace Octokit.Reactive return GetAll(owner, name, number, ApiOptions.None); } + /// + /// Gets review comments for a specified pull request. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request + /// The ID of the repository + /// The pull request number + /// The list of s for the specified pull request + public IObservable GetAll(int repositoryId, int number) + { + return GetAll(repositoryId, number, ApiOptions.None); + } + /// /// Gets review comments for a specified pull request. /// @@ -52,6 +70,21 @@ namespace Octokit.Reactive return _connection.GetAndFlattenAllPages(ApiUrls.PullRequestReviewComments(owner, name, number), options); } + /// + /// Gets review comments for a specified pull request. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request + /// The ID of the repository + /// The pull request number + /// Options for changing the API response + /// The list of s for the specified pull request + public IObservable GetAll(int repositoryId, int number, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return _connection.GetAndFlattenAllPages(ApiUrls.PullRequestReviewComments(repositoryId, number), options); + } + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -67,6 +100,17 @@ namespace Octokit.Reactive return GetAllForRepository(owner, name, new PullRequestReviewCommentRequest(), ApiOptions.None); } + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// The list of s for the specified repository + public IObservable GetAllForRepository(int repositoryId) + { + return GetAllForRepository(repositoryId, new PullRequestReviewCommentRequest(), ApiOptions.None); + } + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -84,6 +128,20 @@ namespace Octokit.Reactive return GetAllForRepository(owner, name, new PullRequestReviewCommentRequest(), options); } + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// Options for changing the API response + /// The list of s for the specified repository + public IObservable GetAllForRepository(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return GetAllForRepository(repositoryId, new PullRequestReviewCommentRequest(), options); + } + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -101,6 +159,20 @@ namespace Octokit.Reactive return GetAllForRepository(owner, name, request, ApiOptions.None); } + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// The sorting parameters + /// The list of s for the specified repository + public IObservable GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request) + { + Ensure.ArgumentNotNull(request, "request"); + + return GetAllForRepository(repositoryId, request, ApiOptions.None); + } + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -121,6 +193,23 @@ namespace Octokit.Reactive options); } + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// The sorting parameters + /// Options for changing the API response + /// The list of s for the specified repository + public IObservable GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request, ApiOptions options) + { + Ensure.ArgumentNotNull(request, "request"); + Ensure.ArgumentNotNull(options, "options"); + + return _connection.GetAndFlattenAllPages(ApiUrls.PullRequestReviewCommentsRepository(repositoryId), request.ToParametersDictionary(), + options); + } + /// /// Gets a single pull request review comment by number. /// @@ -137,6 +226,18 @@ namespace Octokit.Reactive return _client.GetComment(owner, name, number).ToObservable(); } + /// + /// Gets a single pull request review comment by number. + /// + /// http://developer.github.com/v3/pulls/comments/#get-a-single-comment + /// The ID of the repository + /// The pull request review comment number + /// The + public IObservable GetComment(int repositoryId, int number) + { + return _client.GetComment(repositoryId, number).ToObservable(); + } + /// /// Creates a comment on a pull request review. /// @@ -155,6 +256,21 @@ namespace Octokit.Reactive return _client.Create(owner, name, number, comment).ToObservable(); } + /// + /// Creates a comment on a pull request review. + /// + /// http://developer.github.com/v3/pulls/comments/#create-a-comment + /// The ID of the repository + /// The Pull Request number + /// The comment + /// The created + public IObservable Create(int repositoryId, int number, PullRequestReviewCommentCreate comment) + { + Ensure.ArgumentNotNull(comment, "comment"); + + return _client.Create(repositoryId, number, comment).ToObservable(); + } + /// /// Creates a comment on a pull request review as a reply to another comment. /// @@ -173,6 +289,21 @@ namespace Octokit.Reactive return _client.CreateReply(owner, name, number, comment).ToObservable(); } + /// + /// Creates a comment on a pull request review as a reply to another comment. + /// + /// http://developer.github.com/v3/pulls/comments/#create-a-comment + /// The ID of the repository + /// The pull request number + /// The comment + /// The created + public IObservable CreateReply(int repositoryId, int number, PullRequestReviewCommentReplyCreate comment) + { + Ensure.ArgumentNotNull(comment, "comment"); + + return _client.CreateReply(repositoryId, number, comment).ToObservable(); + } + /// /// Edits a comment on a pull request review. /// @@ -191,6 +322,21 @@ namespace Octokit.Reactive return _client.Edit(owner, name, number, comment).ToObservable(); } + /// + /// Edits a comment on a pull request review. + /// + /// http://developer.github.com/v3/pulls/comments/#edit-a-comment + /// The ID of the repository + /// The pull request review comment number + /// The edited comment + /// The edited + public IObservable Edit(int repositoryId, int number, PullRequestReviewCommentEdit comment) + { + Ensure.ArgumentNotNull(comment, "comment"); + + return _client.Edit(repositoryId, number, comment).ToObservable(); + } + /// /// Deletes a comment on a pull request review. /// @@ -206,5 +352,17 @@ namespace Octokit.Reactive return _client.Delete(owner, name, number).ToObservable(); } + + /// + /// Deletes a comment on a pull request review. + /// + /// http://developer.github.com/v3/pulls/comments/#delete-a-comment + /// The ID of the repository + /// The pull request review comment number + /// + public IObservable Delete(int repositoryId, int number) + { + return _client.Delete(repositoryId, number).ToObservable(); + } } } diff --git a/Octokit/Clients/IPullRequestReviewCommentsClient.cs b/Octokit/Clients/IPullRequestReviewCommentsClient.cs index 821bb595..b1b87199 100644 --- a/Octokit/Clients/IPullRequestReviewCommentsClient.cs +++ b/Octokit/Clients/IPullRequestReviewCommentsClient.cs @@ -21,6 +21,15 @@ namespace Octokit /// The list of s for the specified pull request Task> GetAll(string owner, string name, int number); + /// + /// Gets review comments for a specified pull request. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request + /// The ID of the repository + /// The pull request number + /// The list of s for the specified pull request + Task> GetAll(int repositoryId, int number); + /// /// Gets review comments for a specified pull request. /// @@ -32,6 +41,16 @@ namespace Octokit /// The list of s for the specified pull request Task> GetAll(string owner, string name, int number, ApiOptions options); + /// + /// Gets review comments for a specified pull request. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request + /// The ID of the repository + /// The pull request number + /// Options for changing the API response + /// The list of s for the specified pull request + Task> GetAll(int repositoryId, int number, ApiOptions options); + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -41,6 +60,14 @@ namespace Octokit /// The list of s for the specified repository Task> GetAllForRepository(string owner, string name); + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// The list of s for the specified repository + Task> GetAllForRepository(int repositoryId); + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -51,6 +78,15 @@ namespace Octokit /// The list of s for the specified repository Task> GetAllForRepository(string owner, string name, ApiOptions options); + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// Options for changing the API response + /// The list of s for the specified repository + Task> GetAllForRepository(int repositoryId, ApiOptions options); + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -61,6 +97,15 @@ namespace Octokit /// The list of s for the specified repository Task> GetAllForRepository(string owner, string name, PullRequestReviewCommentRequest request); + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// The sorting parameters + /// The list of s for the specified repository + Task> GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request); + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -72,6 +117,16 @@ namespace Octokit /// The list of s for the specified repository Task> GetAllForRepository(string owner, string name, PullRequestReviewCommentRequest request, ApiOptions options); + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// The sorting parameters + /// Options for changing the API response + /// The list of s for the specified repository + Task> GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request, ApiOptions options); + /// /// Gets a single pull request review comment by number. /// @@ -82,6 +137,15 @@ namespace Octokit /// The Task GetComment(string owner, string name, int number); + /// + /// Gets a single pull request review comment by number. + /// + /// http://developer.github.com/v3/pulls/comments/#get-a-single-comment + /// The ID of the repository + /// The pull request review comment number + /// The + Task GetComment(int repositoryId, int number); + /// /// Creates a comment on a pull request review. /// @@ -93,6 +157,16 @@ namespace Octokit /// The created Task Create(string owner, string name, int number, PullRequestReviewCommentCreate comment); + /// + /// Creates a comment on a pull request review. + /// + /// http://developer.github.com/v3/pulls/comments/#create-a-comment + /// The ID of the repository + /// The Pull Request number + /// The comment + /// The created + Task Create(int repositoryId, int number, PullRequestReviewCommentCreate comment); + /// /// Creates a comment on a pull request review as a reply to another comment. /// @@ -104,6 +178,16 @@ namespace Octokit /// The created Task CreateReply(string owner, string name, int number, PullRequestReviewCommentReplyCreate comment); + /// + /// Creates a comment on a pull request review as a reply to another comment. + /// + /// http://developer.github.com/v3/pulls/comments/#create-a-comment + /// The ID of the repository + /// The pull request number + /// The comment + /// The created + Task CreateReply(int repositoryId, int number, PullRequestReviewCommentReplyCreate comment); + /// /// Edits a comment on a pull request review. /// @@ -115,6 +199,16 @@ namespace Octokit /// The edited Task Edit(string owner, string name, int number, PullRequestReviewCommentEdit comment); + /// + /// Edits a comment on a pull request review. + /// + /// http://developer.github.com/v3/pulls/comments/#edit-a-comment + /// The ID of the repository + /// The pull request review comment number + /// The edited comment + /// The edited + Task Edit(int repositoryId, int number, PullRequestReviewCommentEdit comment); + /// /// Deletes a comment on a pull request review. /// @@ -124,5 +218,14 @@ namespace Octokit /// The pull request review comment number /// Task Delete(string owner, string name, int number); + + /// + /// Deletes a comment on a pull request review. + /// + /// http://developer.github.com/v3/pulls/comments/#delete-a-comment + /// The ID of the repository + /// The pull request review comment number + /// + Task Delete(int repositoryId, int number); } } diff --git a/Octokit/Clients/PullRequestReviewCommentsClient.cs b/Octokit/Clients/PullRequestReviewCommentsClient.cs index 439e70d8..1184b185 100644 --- a/Octokit/Clients/PullRequestReviewCommentsClient.cs +++ b/Octokit/Clients/PullRequestReviewCommentsClient.cs @@ -33,6 +33,18 @@ namespace Octokit return GetAll(owner, name, number, ApiOptions.None); } + /// + /// Gets review comments for a specified pull request. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request + /// The ID of the repository + /// The pull request number + /// The list of s for the specified pull request + public Task> GetAll(int repositoryId, int number) + { + return GetAll(repositoryId, number, ApiOptions.None); + } + /// /// Gets review comments for a specified pull request. /// @@ -51,6 +63,21 @@ namespace Octokit return ApiConnection.GetAll(ApiUrls.PullRequestReviewComments(owner, name, number), options); } + /// + /// Gets review comments for a specified pull request. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request + /// The ID of the repository + /// The pull request number + /// Options for changing the API response + /// The list of s for the specified pull request + public Task> GetAll(int repositoryId, int number, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return ApiConnection.GetAll(ApiUrls.PullRequestReviewComments(repositoryId, number), options); + } + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -66,6 +93,17 @@ namespace Octokit return GetAllForRepository(owner, name, new PullRequestReviewCommentRequest(), ApiOptions.None); } + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// The list of s for the specified repository + public Task> GetAllForRepository(int repositoryId) + { + return GetAllForRepository(repositoryId, new PullRequestReviewCommentRequest(), ApiOptions.None); + } + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -83,6 +121,20 @@ namespace Octokit return GetAllForRepository(owner, name, new PullRequestReviewCommentRequest(), options); } + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// Options for changing the API response + /// The list of s for the specified repository + public Task> GetAllForRepository(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return GetAllForRepository(repositoryId, new PullRequestReviewCommentRequest(), options); + } + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -100,6 +152,20 @@ namespace Octokit return GetAllForRepository(owner, name, request, ApiOptions.None); } + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// The sorting parameters + /// The list of s for the specified repository + public Task> GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request) + { + Ensure.ArgumentNotNull(request, "request"); + + return GetAllForRepository(repositoryId, request, ApiOptions.None); + } + /// /// Gets a list of the pull request review comments in a specified repository. /// @@ -119,6 +185,22 @@ namespace Octokit return ApiConnection.GetAll(ApiUrls.PullRequestReviewCommentsRepository(owner, name), request.ToParametersDictionary(), options); } + /// + /// Gets a list of the pull request review comments in a specified repository. + /// + /// http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + /// The ID of the repository + /// The sorting parameters + /// Options for changing the API response + /// The list of s for the specified repository + public Task> GetAllForRepository(int repositoryId, PullRequestReviewCommentRequest request, ApiOptions options) + { + Ensure.ArgumentNotNull(request, "request"); + Ensure.ArgumentNotNull(options, "options"); + + return ApiConnection.GetAll(ApiUrls.PullRequestReviewCommentsRepository(repositoryId), request.ToParametersDictionary(), options); + } + /// /// Gets a single pull request review comment by number. /// @@ -135,6 +217,18 @@ namespace Octokit return ApiConnection.Get(ApiUrls.PullRequestReviewComment(owner, name, number)); } + /// + /// Gets a single pull request review comment by number. + /// + /// http://developer.github.com/v3/pulls/comments/#get-a-single-comment + /// The ID of the repository + /// The pull request review comment number + /// The + public Task GetComment(int repositoryId, int number) + { + return ApiConnection.Get(ApiUrls.PullRequestReviewComment(repositoryId, number)); + } + /// /// Creates a comment on a pull request review. /// @@ -161,6 +255,29 @@ namespace Octokit return response.Body; } + /// + /// Creates a comment on a pull request review. + /// + /// http://developer.github.com/v3/pulls/comments/#create-a-comment + /// The ID of the repository + /// The Pull Request number + /// The comment + /// The created + public async Task Create(int repositoryId, int number, PullRequestReviewCommentCreate comment) + { + Ensure.ArgumentNotNull(comment, "comment"); + + var endpoint = ApiUrls.PullRequestReviewComments(repositoryId, number); + var response = await ApiConnection.Connection.Post(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; + } + /// /// Creates a comment on a pull request review as a reply to another comment. /// @@ -187,6 +304,29 @@ namespace Octokit return response.Body; } + /// + /// Creates a comment on a pull request review as a reply to another comment. + /// + /// http://developer.github.com/v3/pulls/comments/#create-a-comment + /// The ID of the repository + /// The pull request number + /// The comment + /// The created + public async Task CreateReply(int repositoryId, int number, PullRequestReviewCommentReplyCreate comment) + { + Ensure.ArgumentNotNull(comment, "comment"); + + var endpoint = ApiUrls.PullRequestReviewComments(repositoryId, number); + var response = await ApiConnection.Connection.Post(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; + } + /// /// Edits a comment on a pull request review. /// @@ -205,6 +345,21 @@ namespace Octokit return ApiConnection.Patch(ApiUrls.PullRequestReviewComment(owner, name, number), comment); } + /// + /// Edits a comment on a pull request review. + /// + /// http://developer.github.com/v3/pulls/comments/#edit-a-comment + /// The ID of the repository + /// The pull request review comment number + /// The edited comment + /// The edited + public Task Edit(int repositoryId, int number, PullRequestReviewCommentEdit comment) + { + Ensure.ArgumentNotNull(comment, "comment"); + + return ApiConnection.Patch(ApiUrls.PullRequestReviewComment(repositoryId, number), comment); + } + /// /// Deletes a comment on a pull request review. /// @@ -220,5 +375,17 @@ namespace Octokit return ApiConnection.Delete(ApiUrls.PullRequestReviewComment(owner, name, number)); } + + /// + /// Deletes a comment on a pull request review. + /// + /// http://developer.github.com/v3/pulls/comments/#delete-a-comment + /// The ID of the repository + /// The pull request review comment number + /// + public Task Delete(int repositoryId, int number) + { + return ApiConnection.Delete(ApiUrls.PullRequestReviewComment(repositoryId, number)); + } } }