From cbd9e76cb2ecc5bee37d4b04152abc6b943ba5d3 Mon Sep 17 00:00:00 2001 From: Gabriel Weyer Date: Wed, 23 Dec 2015 12:17:04 +1100 Subject: [PATCH] Issue comments are identified by Id instead of Number --- .../Clients/IObservableIssueCommentsClient.cs | 14 ++++++------- .../Clients/ObservableIssueCommentsClient.cs | 20 +++++++++---------- Octokit/Clients/IIssueCommentsClient.cs | 14 ++++++------- Octokit/Clients/IssueCommentsClient.cs | 20 +++++++++---------- Octokit/Helpers/ApiUrls.cs | 6 +++--- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableIssueCommentsClient.cs b/Octokit.Reactive/Clients/IObservableIssueCommentsClient.cs index 256c2990..bc93a4e1 100644 --- a/Octokit.Reactive/Clients/IObservableIssueCommentsClient.cs +++ b/Octokit.Reactive/Clients/IObservableIssueCommentsClient.cs @@ -7,16 +7,16 @@ namespace Octokit.Reactive public interface IObservableIssueCommentsClient { /// - /// Gets a single Issue Comment by number. + /// Gets a single Issue Comment by id. /// /// http://developer.github.com/v3/issues/comments/#get-a-single-comment /// The owner of the repository /// The name of the repository - /// The issue comment number + /// The issue comment id /// The s for the specified Issue Comment. [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] - IObservable Get(string owner, string name, int number); + IObservable Get(string owner, string name, int id); /// /// Gets Issue Comments for a repository. @@ -54,10 +54,10 @@ namespace Octokit.Reactive /// http://developer.github.com/v3/issues/comments/#edit-a-comment /// The owner of the repository /// The name of the repository - /// The comment number + /// The comment id /// The modified comment /// The that was just updated. - IObservable Update(string owner, string name, int number, string commentUpdate); + IObservable Update(string owner, string name, int id, string commentUpdate); /// /// Deletes the specified Issue Comment @@ -65,8 +65,8 @@ namespace Octokit.Reactive /// http://developer.github.com/v3/issues/comments/#delete-a-comment /// The owner of the repository /// The name of the repository - /// The comment number + /// The comment id /// - IObservable Delete(string owner, string name, int number); + IObservable Delete(string owner, string name, int id); } } diff --git a/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs b/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs index 72709b44..2a8494a4 100644 --- a/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs @@ -19,19 +19,19 @@ namespace Octokit.Reactive } /// - /// Gets a single Issue Comment by number. + /// Gets a single Issue Comment by id. /// /// http://developer.github.com/v3/issues/comments/#get-a-single-comment /// The owner of the repository /// The name of the repository - /// The issue comment number + /// The issue comment id /// The s for the specified Issue Comment. - public IObservable Get(string owner, string name, int number) + public IObservable Get(string owner, string name, int id) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return _client.Get(owner, name, number).ToObservable(); + return _client.Get(owner, name, id).ToObservable(); } /// @@ -89,16 +89,16 @@ namespace Octokit.Reactive /// http://developer.github.com/v3/issues/comments/#edit-a-comment /// The owner of the repository /// The name of the repository - /// The comment number + /// The comment id /// The modified comment /// The that was just updated. - public IObservable Update(string owner, string name, int number, string commentUpdate) + public IObservable Update(string owner, string name, int id, string commentUpdate) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNull(commentUpdate, "commentUpdate"); - return _client.Update(owner, name, number, commentUpdate).ToObservable(); + return _client.Update(owner, name, id, commentUpdate).ToObservable(); } /// @@ -107,14 +107,14 @@ namespace Octokit.Reactive /// http://developer.github.com/v3/issues/comments/#delete-a-comment /// The owner of the repository /// The name of the repository - /// The comment number + /// The comment id /// - public IObservable Delete(string owner, string name, int number) + public IObservable Delete(string owner, string name, int id) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return _client.Delete(owner, name, number).ToObservable(); + return _client.Delete(owner, name, id).ToObservable(); } } } diff --git a/Octokit/Clients/IIssueCommentsClient.cs b/Octokit/Clients/IIssueCommentsClient.cs index fdfbc389..1e091d28 100644 --- a/Octokit/Clients/IIssueCommentsClient.cs +++ b/Octokit/Clients/IIssueCommentsClient.cs @@ -13,16 +13,16 @@ namespace Octokit public interface IIssueCommentsClient { /// - /// Gets a single Issue Comment by number. + /// Gets a single Issue Comment by id. /// /// http://developer.github.com/v3/issues/comments/#get-a-single-comment /// The owner of the repository /// The name of the repository - /// The issue number + /// The issue comment id /// [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] - Task Get(string owner, string name, int number); + Task Get(string owner, string name, int id); /// /// Gets Issue Comments for a repository. @@ -60,10 +60,10 @@ namespace Octokit /// http://developer.github.com/v3/issues/comments/#edit-a-comment /// The owner of the repository /// The name of the repository - /// The comment number + /// The comment id /// The modified comment /// - Task Update(string owner, string name, int number, string commentUpdate); + Task Update(string owner, string name, int id, string commentUpdate); /// /// Deletes the specified Issue Comment @@ -71,8 +71,8 @@ namespace Octokit /// http://developer.github.com/v3/issues/comments/#delete-a-comment /// The owner of the repository /// The name of the repository - /// The comment number + /// The comment id /// - Task Delete(string owner, string name, int number); + Task Delete(string owner, string name, int id); } } diff --git a/Octokit/Clients/IssueCommentsClient.cs b/Octokit/Clients/IssueCommentsClient.cs index 1b84f8b2..c2d24b7d 100644 --- a/Octokit/Clients/IssueCommentsClient.cs +++ b/Octokit/Clients/IssueCommentsClient.cs @@ -20,19 +20,19 @@ namespace Octokit } /// - /// Gets a single Issue Comment by number. + /// Gets a single Issue Comment by id. /// /// http://developer.github.com/v3/issues/comments/#get-a-single-comment /// The owner of the repository /// The name of the repository - /// The issue number + /// The issue id /// - public Task Get(string owner, string name, int number) + public Task Get(string owner, string name, int id) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return ApiConnection.Get(ApiUrls.IssueComment(owner, name, number)); + return ApiConnection.Get(ApiUrls.IssueComment(owner, name, id)); } /// @@ -90,16 +90,16 @@ namespace Octokit /// http://developer.github.com/v3/issues/comments/#edit-a-comment /// The owner of the repository /// The name of the repository - /// The comment number + /// The comment id /// The modified comment /// - public Task Update(string owner, string name, int number, string commentUpdate) + public Task Update(string owner, string name, int id, string commentUpdate) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNull(commentUpdate, "commentUpdate"); - return ApiConnection.Patch(ApiUrls.IssueComment(owner, name, number), new BodyWrapper(commentUpdate)); + return ApiConnection.Patch(ApiUrls.IssueComment(owner, name, id), new BodyWrapper(commentUpdate)); } /// @@ -108,14 +108,14 @@ namespace Octokit /// http://developer.github.com/v3/issues/comments/#delete-a-comment /// The owner of the repository /// The name of the repository - /// The comment number + /// The comment id /// - public Task Delete(string owner, string name, int number) + public Task Delete(string owner, string name, int id) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return ApiConnection.Delete(ApiUrls.IssueComment(owner, name, number)); + return ApiConnection.Delete(ApiUrls.IssueComment(owner, name, id)); } } } diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs index b1d628f0..f8f79d68 100644 --- a/Octokit/Helpers/ApiUrls.cs +++ b/Octokit/Helpers/ApiUrls.cs @@ -285,11 +285,11 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// The comment number + /// The comment id /// - public static Uri IssueComment(string owner, string name, int number) + public static Uri IssueComment(string owner, string name, int id) { - return "repos/{0}/{1}/issues/comments/{2}".FormatUri(owner, name, number); + return "repos/{0}/{1}/issues/comments/{2}".FormatUri(owner, name, id); } ///