mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 20:30:41 +00:00
fix: comment id model update to long instead of int
* #2927: comment id model update to long instead of int * #2927: code review fixes (1) * #2927: code review fixes (2) * #2927: comment id model update to long instead of int: unit tests fix * #2927: code review fixes * Fixed most names of parameters --------- Co-authored-by: Victor Vorobyev <victor@myrtle-sa.com> Co-authored-by: Brian C. Arnold <brian.arnold@spiderrock.net>
This commit is contained in:
@@ -25,27 +25,27 @@ namespace Octokit
|
||||
/// </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="commentId">The comment id</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)
|
||||
public Task<CommitComment> Get(long repositoryId, long commentId)
|
||||
{
|
||||
return ApiConnection.Get<CommitComment>(ApiUrls.CommitComment(repositoryId, number), null);
|
||||
return ApiConnection.Get<CommitComment>(ApiUrls.CommitComment(repositoryId, commentId), null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -211,32 +211,32 @@ namespace Octokit
|
||||
/// </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>
|
||||
/// <param name="commentUpdate">The modified comment</param>
|
||||
/// <remarks>http://developer.github.com/v3/repos/comments/#update-a-commit-comment</remarks>
|
||||
[ManualRoute("PATCH", "/repos/{owner}/{repo}/comments/{comment_id}")]
|
||||
public Task<CommitComment> Update(string owner, string name, int number, string commentUpdate)
|
||||
public Task<CommitComment> Update(string owner, string name, long commentId, string commentUpdate)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
Ensure.ArgumentNotNull(commentUpdate, nameof(commentUpdate));
|
||||
|
||||
return ApiConnection.Patch<CommitComment>(ApiUrls.CommitComment(owner, name, number), new BodyWrapper(commentUpdate));
|
||||
return ApiConnection.Patch<CommitComment>(ApiUrls.CommitComment(owner, name, commentId), new BodyWrapper(commentUpdate));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates a specified Commit Comment.
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="number">The comment number</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="commentUpdate">The modified comment</param>
|
||||
/// <remarks>http://developer.github.com/v3/repos/comments/#update-a-commit-comment</remarks>
|
||||
[ManualRoute("PATCH", "/repositories/{id}/comments/{number}")]
|
||||
public Task<CommitComment> Update(long repositoryId, int number, string commentUpdate)
|
||||
public Task<CommitComment> Update(long repositoryId, long commentId, string commentUpdate)
|
||||
{
|
||||
Ensure.ArgumentNotNull(commentUpdate, nameof(commentUpdate));
|
||||
|
||||
return ApiConnection.Patch<CommitComment>(ApiUrls.CommitComment(repositoryId, number), new BodyWrapper(commentUpdate));
|
||||
return ApiConnection.Patch<CommitComment>(ApiUrls.CommitComment(repositoryId, commentId), new BodyWrapper(commentUpdate));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -244,27 +244,27 @@ namespace Octokit
|
||||
/// </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>
|
||||
/// Deletes the specified Commit Comment
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The Id 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", "/repositories/{id}/comments/{number}")]
|
||||
public Task Delete(long repositoryId, int number)
|
||||
public Task Delete(long repositoryId, long commentId)
|
||||
{
|
||||
return ApiConnection.Delete(ApiUrls.CommitComment(repositoryId, number));
|
||||
return ApiConnection.Delete(ApiUrls.CommitComment(repositoryId, commentId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user