diff --git a/Octokit.Reactive/Clients/IObservableGistCommentsClient.cs b/Octokit.Reactive/Clients/IObservableGistCommentsClient.cs index 2d7372a5..11accd8c 100644 --- a/Octokit.Reactive/Clients/IObservableGistCommentsClient.cs +++ b/Octokit.Reactive/Clients/IObservableGistCommentsClient.cs @@ -15,7 +15,7 @@ namespace Octokit.Reactive /// IObservable{GistComment}. [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] - IObservable Get(int gistId, int commentId); + IObservable Get(string gistId, int commentId); /// /// Gets all comments for the gist with the specified id. @@ -23,7 +23,7 @@ namespace Octokit.Reactive /// http://developer.github.com/v3/gists/comments/#list-comments-on-a-gist /// The id of the gist /// IObservable{GistComment}. - IObservable GetForGist(int gistId); + IObservable GetForGist(string gistId); /// /// Creates a comment for the gist with the specified id. @@ -32,7 +32,7 @@ namespace Octokit.Reactive /// The id of the gist /// The body of the comment /// IObservable{GistComment}. - IObservable Create(int gistId, string comment); + IObservable Create(string gistId, string comment); /// /// Updates the comment with the specified gist- and comment id. @@ -42,7 +42,7 @@ namespace Octokit.Reactive /// The id of the comment /// The updated body of the comment /// IObservable{GistComment}. - IObservable Update(int gistId, int commentId, string comment); + IObservable Update(string gistId, int commentId, string comment); /// /// Deletes the comment with the specified gist- and comment id. @@ -51,6 +51,6 @@ namespace Octokit.Reactive /// The id of the gist /// The id of the comment /// IObservable{Unit}. - IObservable Delete(int gistId, int commentId); + IObservable Delete(string gistId, int commentId); } } \ No newline at end of file diff --git a/Octokit.Reactive/Clients/ObservableGistCommentsClient.cs b/Octokit.Reactive/Clients/ObservableGistCommentsClient.cs index 11bc9104..93a5df44 100644 --- a/Octokit.Reactive/Clients/ObservableGistCommentsClient.cs +++ b/Octokit.Reactive/Clients/ObservableGistCommentsClient.cs @@ -25,7 +25,7 @@ namespace Octokit.Reactive /// The id of the gist /// The id of the comment /// IObservable{GistComment}. - public IObservable Get(int gistId, int commentId) + public IObservable Get(string gistId, int commentId) { return _client.Get(gistId, commentId).ToObservable(); } @@ -36,7 +36,7 @@ namespace Octokit.Reactive /// http://developer.github.com/v3/gists/comments/#list-comments-on-a-gist /// The id of the gist /// IObservable{GistComment}. - public IObservable GetForGist(int gistId) + public IObservable GetForGist(string gistId) { return _connection.GetAndFlattenAllPages(ApiUrls.GistComments(gistId)); } @@ -48,7 +48,7 @@ namespace Octokit.Reactive /// The id of the gist /// The body of the comment /// IObservable{GistComment}. - public IObservable Create(int gistId, string comment) + public IObservable Create(string gistId, string comment) { Ensure.ArgumentNotNullOrEmptyString(comment, "comment"); @@ -63,7 +63,7 @@ namespace Octokit.Reactive /// The id of the comment /// The updated body of the comment /// IObservable{GistComment}. - public IObservable Update(int gistId, int commentId, string comment) + public IObservable Update(string gistId, int commentId, string comment) { Ensure.ArgumentNotNullOrEmptyString(comment, "comment"); @@ -77,7 +77,7 @@ namespace Octokit.Reactive /// The id of the gist /// The id of the comment /// IObservable{Unit}. - public IObservable Delete(int gistId, int commentId) + public IObservable Delete(string gistId, int commentId) { return _client.Delete(gistId, commentId).ToObservable(); } diff --git a/Octokit.Tests/Clients/GistCommentsClientTests.cs b/Octokit.Tests/Clients/GistCommentsClientTests.cs index 8ca77c6e..8f78d790 100644 --- a/Octokit.Tests/Clients/GistCommentsClientTests.cs +++ b/Octokit.Tests/Clients/GistCommentsClientTests.cs @@ -24,7 +24,7 @@ public class GistCommentsClientTests var connection = Substitute.For(); var client = new GistCommentsClient(connection); - await client.Get(24, 1337); + await client.Get("24", 1337); connection.Received().Get(Arg.Is(u => u.ToString() == "gists/24/comments/1337"), null); } @@ -38,7 +38,7 @@ public class GistCommentsClientTests var connection = Substitute.For(); var client = new GistCommentsClient(connection); - await client.GetForGist(24); + await client.GetForGist("24"); connection.Received().GetAll(Arg.Is(u => u.ToString() == "gists/24/comments")); } @@ -51,8 +51,8 @@ public class GistCommentsClientTests { var client = new GistCommentsClient(Substitute.For()); - await AssertEx.Throws(async () => await client.Create(24, null)); - await AssertEx.Throws(async () => await client.Create(24, "")); + await AssertEx.Throws(async () => await client.Create("24", null)); + await AssertEx.Throws(async () => await client.Create("24", "")); } [Fact] @@ -62,7 +62,7 @@ public class GistCommentsClientTests var connection = Substitute.For(); var client = new GistCommentsClient(connection); - await client.Create(24, comment); + await client.Create("24", comment); connection.Received().Post(Arg.Is(u => u.ToString() == "gists/24/comments"), Arg.Is(x => x.Body == comment)); } @@ -75,8 +75,8 @@ public class GistCommentsClientTests { var client = new GistCommentsClient(Substitute.For()); - await AssertEx.Throws(async () => await client.Update(24, 1337, null)); - await AssertEx.Throws(async () => await client.Update(24, 1337, "")); + await AssertEx.Throws(async () => await client.Update("24", 1337, null)); + await AssertEx.Throws(async () => await client.Update("24", 1337, "")); } [Fact] @@ -86,7 +86,7 @@ public class GistCommentsClientTests var connection = Substitute.For(); var client = new GistCommentsClient(connection); - await client.Update(24, 1337, comment); + await client.Update("24", 1337, comment); connection.Received().Patch(Arg.Is(u => u.ToString() == "gists/24/comments/1337"), Arg.Is(x => x.Body == comment)); } @@ -100,7 +100,7 @@ public class GistCommentsClientTests var connection = Substitute.For(); var client = new GistCommentsClient(connection); - await client.Delete(24, 1337); + await client.Delete("24", 1337); connection.Received().Delete(Arg.Is(u => u.ToString() == "gists/24/comments/1337")); } diff --git a/Octokit/Clients/GistCommentsClient.cs b/Octokit/Clients/GistCommentsClient.cs index 67b0cf1f..f32a055e 100644 --- a/Octokit/Clients/GistCommentsClient.cs +++ b/Octokit/Clients/GistCommentsClient.cs @@ -26,7 +26,7 @@ namespace Octokit /// The id of the gist /// The id of the comment /// Task{GistComment}. - public Task Get(int gistId, int commentId) + public Task Get(string gistId, int commentId) { return ApiConnection.Get(ApiUrls.GistComment(gistId, commentId)); } @@ -37,7 +37,7 @@ namespace Octokit /// http://developer.github.com/v3/gists/comments/#list-comments-on-a-gist /// The id of the gist /// Task{IReadOnlyList{GistComment}}. - public Task> GetForGist(int gistId) + public Task> GetForGist(string gistId) { return ApiConnection.GetAll(ApiUrls.GistComments(gistId)); } @@ -49,7 +49,7 @@ namespace Octokit /// The id of the gist /// The body of the comment /// Task{GistComment}. - public Task Create(int gistId, string comment) + public Task Create(string gistId, string comment) { Ensure.ArgumentNotNullOrEmptyString(comment, "comment"); @@ -64,7 +64,7 @@ namespace Octokit /// The id of the comment /// The updated body of the comment /// Task{GistComment}. - public Task Update(int gistId, int commentId, string comment) + public Task Update(string gistId, int commentId, string comment) { Ensure.ArgumentNotNullOrEmptyString(comment, "comment"); @@ -78,7 +78,7 @@ namespace Octokit /// The id of the gist /// The id of the comment /// Task. - public Task Delete(int gistId, int commentId) + public Task Delete(string gistId, int commentId) { return ApiConnection.Delete(ApiUrls.GistComment(gistId, commentId)); } diff --git a/Octokit/Clients/IGistCommentsClient.cs b/Octokit/Clients/IGistCommentsClient.cs index 3b60366f..af11e668 100644 --- a/Octokit/Clients/IGistCommentsClient.cs +++ b/Octokit/Clients/IGistCommentsClient.cs @@ -21,7 +21,7 @@ namespace Octokit /// Task{GistComment}. [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] - Task Get(int gistId, int commentId); + Task Get(string gistId, int commentId); /// /// Gets all comments for the gist with the specified id. @@ -29,7 +29,7 @@ namespace Octokit /// http://developer.github.com/v3/gists/comments/#list-comments-on-a-gist /// The id of the gist /// Task{IReadOnlyList{GistComment}}. - Task> GetForGist(int gistId); + Task> GetForGist(string gistId); /// /// Creates a comment for the gist with the specified id. @@ -38,7 +38,7 @@ namespace Octokit /// The id of the gist /// The body of the comment /// Task{GistComment}. - Task Create(int gistId, string comment); + Task Create(string gistId, string comment); /// /// Updates the comment with the specified gist- and comment id. @@ -48,7 +48,7 @@ namespace Octokit /// The id of the comment /// The updated body of the comment /// Task{GistComment}. - Task Update(int gistId, int commentId, string comment); + Task Update(string gistId, int commentId, string comment); /// /// Deletes the comment with the specified gist- and comment id. @@ -57,6 +57,6 @@ namespace Octokit /// The id of the gist /// The id of the comment /// Task. - Task Delete(int gistId, int commentId); + Task Delete(string gistId, int commentId); } } diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs index 0d58980f..a760f933 100644 --- a/Octokit/Helpers/ApiUrls.cs +++ b/Octokit/Helpers/ApiUrls.cs @@ -718,7 +718,7 @@ namespace Octokit /// Returns the for the comments for the specified gist. /// /// The id of the gist - public static Uri GistComments(int gistId) + public static Uri GistComments(string gistId) { return "gists/{0}/comments".FormatUri(gistId); } @@ -773,7 +773,7 @@ namespace Octokit /// /// The id of the gist /// The id of the comment - public static Uri GistComment(int gistId, int commentId) + public static Uri GistComment(string gistId, int commentId) { return "gists/{0}/comments/{1}".FormatUri(gistId, commentId); }