Skip to content

Commit

Permalink
#2927: code review fixes (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
arxange1 committed Jun 5, 2024
1 parent 4b2e677 commit fe329e7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions Octokit/Clients/IRepositoryCommentsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ public interface IRepositoryCommentsClient
/// <remarks>http://developer.github.com/v3/repos/comments/#get-a-single-commit-comment</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="commentId">The comment id</param>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
Task<CommitComment> Get(string owner, string name, int number);
Task<CommitComment> Get(string owner, string name, long commentId);

/// <summary>
/// Gets a single Repository Comment by number.
/// </summary>
/// <remarks>http://developer.github.com/v3/repos/comments/#get-a-single-commit-comment</remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="number">The comment number</param>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
Task<CommitComment> Get(long repositoryId, int number);
Expand Down Expand Up @@ -145,15 +145,15 @@ public interface IRepositoryCommentsClient
/// <remarks>http://developer.github.com/v3/repos/comments/#delete-a-commit-comment</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
Task Delete(string owner, string name, int number);
/// <param name="commentId">The comment id</param>
Task Delete(string owner, string name, long commentId);

/// <summary>
/// Deletes the specified Commit Comment
/// </summary>
/// <remarks>http://developer.github.com/v3/repos/comments/#delete-a-commit-comment</remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="number">The comment number</param>
Task Delete(long repositoryId, int number);
}
}
14 changes: 7 additions & 7 deletions Octokit/Clients/RepositoryCommentsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ public RepositoryCommentsClient(IApiConnection apiConnection)
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="commentId">The comment id</param>
/// <remarks>http://developer.github.com/v3/repos/comments/#get-a-single-commit-comment</remarks>
[ManualRoute("GET", "/repos/{owner}/{repo}/comments/{comment_id}")]
public Task<CommitComment> Get(string owner, string name, int number)
public Task<CommitComment> Get(string owner, string name, long commentId)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));

return ApiConnection.Get<CommitComment>(ApiUrls.CommitComment(owner, name, number), null);
return ApiConnection.Get<CommitComment>(ApiUrls.CommitComment(owner, name, commentId), null);
}

/// <summary>
/// Gets a single Repository Comment by number.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="number">The comment number</param>
/// <remarks>http://developer.github.com/v3/repos/comments/#get-a-single-commit-comment</remarks>
[ManualRoute("GET", "/repositories/{id}/comments/{number}")]
public Task<CommitComment> Get(long repositoryId, int number)
Expand Down Expand Up @@ -244,15 +244,15 @@ public Task<CommitComment> Update(long repositoryId, int number, string commentU
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="commentId">The comment id</param>
/// <remarks>http://developer.github.com/v3/repos/comments/#delete-a-commit-comment</remarks>
[ManualRoute("DELETE", "/repos/{owner}/{repo}/comments/{comment_id}")]
public Task Delete(string owner, string name, int number)
public Task Delete(string owner, string name, long commentId)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));

return ApiConnection.Delete(ApiUrls.CommitComment(owner, name, number));
return ApiConnection.Delete(ApiUrls.CommitComment(owner, name, commentId));
}

/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions Octokit/Helpers/ApiUrls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -693,11 +693,11 @@ public static Uri IssueCommentReaction(long repositoryId, long number, long reac
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment number</param>
/// <param name="commentId">The comment id</param>
/// <returns></returns>
public static Uri CommitComment(string owner, string name, int number)
public static Uri CommitComment(string owner, string name, long commentId)
{
return "repos/{0}/{1}/comments/{2}".FormatUri(owner, name, number);
return "repos/{0}/{1}/comments/{2}".FormatUri(owner, name, commentId);
}

/// <summary>
Expand Down

0 comments on commit fe329e7

Please sign in to comment.