mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 11:05:56 +00:00
add metadata to each client action (#2124)
This commit is contained in:
@@ -27,6 +27,7 @@ namespace Octokit
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="number">The comment id</param>
|
||||
/// <remarks>http://developer.github.com/v3/repos/comments/#get-a-single-commit-comment</remarks>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/comments/{number}")]
|
||||
public Task<CommitComment> Get(string owner, string name, int number)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -41,6 +42,7 @@ namespace Octokit
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="number">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)
|
||||
{
|
||||
return ApiConnection.Get<CommitComment>(ApiUrls.CommitComment(repositoryId, number), null, AcceptHeaders.ReactionsPreview);
|
||||
@@ -52,6 +54,7 @@ namespace Octokit
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <remarks>http://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository</remarks>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/comments")]
|
||||
public Task<IReadOnlyList<CommitComment>> GetAllForRepository(string owner, string name)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -65,6 +68,7 @@ namespace Octokit
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <remarks>http://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository</remarks>
|
||||
[ManualRoute("GET", "/repositories/{id}/comments")]
|
||||
public Task<IReadOnlyList<CommitComment>> GetAllForRepository(long repositoryId)
|
||||
{
|
||||
return GetAllForRepository(repositoryId, ApiOptions.None);
|
||||
@@ -77,6 +81,7 @@ namespace Octokit
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="options">Options to change the API response</param>
|
||||
/// <remarks>http://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository</remarks>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/comments")]
|
||||
public Task<IReadOnlyList<CommitComment>> GetAllForRepository(string owner, string name, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -92,6 +97,7 @@ namespace Octokit
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="options">Options to change the API response</param>
|
||||
/// <remarks>http://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository</remarks>
|
||||
[ManualRoute("GET", "/repositories/{id}/comments")]
|
||||
public Task<IReadOnlyList<CommitComment>> GetAllForRepository(long repositoryId, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
@@ -106,6 +112,7 @@ namespace Octokit
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="sha">The sha of the commit</param>
|
||||
/// <remarks>http://developer.github.com/v3/repos/comments/#list-comments-for-a-single-commit</remarks>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/commits/{sha}/comments")]
|
||||
public Task<IReadOnlyList<CommitComment>> GetAllForCommit(string owner, string name, string sha)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -121,6 +128,7 @@ namespace Octokit
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="sha">The sha of the commit</param>
|
||||
/// <remarks>http://developer.github.com/v3/repos/comments/#list-comments-for-a-single-commit</remarks>
|
||||
[ManualRoute("GET", "/repositories/{id}/commits/{sha}/comments")]
|
||||
public Task<IReadOnlyList<CommitComment>> GetAllForCommit(long repositoryId, string sha)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(sha, nameof(sha));
|
||||
@@ -136,6 +144,7 @@ namespace Octokit
|
||||
/// <param name="sha">The sha of the commit</param>
|
||||
/// <param name="options">Options to change the API response</param>
|
||||
/// <remarks>http://developer.github.com/v3/repos/comments/#list-comments-for-a-single-commit</remarks>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/commits/{sha}/comments")]
|
||||
public Task<IReadOnlyList<CommitComment>> GetAllForCommit(string owner, string name, string sha, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -153,6 +162,7 @@ namespace Octokit
|
||||
/// <param name="sha">The sha of the commit</param>
|
||||
/// <param name="options">Options to change the API response</param>
|
||||
/// <remarks>http://developer.github.com/v3/repos/comments/#list-comments-for-a-single-commit</remarks>
|
||||
[ManualRoute("GET", "/repositories/{id}/commits/{sha}/comments")]
|
||||
public Task<IReadOnlyList<CommitComment>> GetAllForCommit(long repositoryId, string sha, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(sha, nameof(sha));
|
||||
@@ -169,6 +179,7 @@ namespace Octokit
|
||||
/// <param name="sha">The sha reference of commit</param>
|
||||
/// <param name="newCommitComment">The new comment to add to the commit</param>
|
||||
/// <remarks>http://developer.github.com/v3/repos/comments/#create-a-commit-comment</remarks>
|
||||
[ManualRoute("POST", "/repos/{owner}/{name}/commits/{sha}/comments")]
|
||||
public Task<CommitComment> Create(string owner, string name, string sha, NewCommitComment newCommitComment)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -186,6 +197,7 @@ namespace Octokit
|
||||
/// <param name="sha">The sha reference of commit</param>
|
||||
/// <param name="newCommitComment">The new comment to add to the commit</param>
|
||||
/// <remarks>http://developer.github.com/v3/repos/comments/#create-a-commit-comment</remarks>
|
||||
[ManualRoute("POST", "/repositories/{id}/commits/{sha}/comments")]
|
||||
public Task<CommitComment> Create(long repositoryId, string sha, NewCommitComment newCommitComment)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(sha, nameof(sha));
|
||||
@@ -202,6 +214,7 @@ namespace Octokit
|
||||
/// <param name="number">The comment number</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}/{name}/comments/{number}")]
|
||||
public Task<CommitComment> Update(string owner, string name, int number, string commentUpdate)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -218,6 +231,7 @@ namespace Octokit
|
||||
/// <param name="number">The comment number</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)
|
||||
{
|
||||
Ensure.ArgumentNotNull(commentUpdate, nameof(commentUpdate));
|
||||
@@ -232,6 +246,7 @@ namespace Octokit
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="number">The comment id</param>
|
||||
/// <remarks>http://developer.github.com/v3/repos/comments/#delete-a-commit-comment</remarks>
|
||||
[ManualRoute("DELETE", "/repos/{owner}/{name}/comments/{number}")]
|
||||
public Task Delete(string owner, string name, int number)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -246,6 +261,7 @@ namespace Octokit
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="number">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)
|
||||
{
|
||||
return ApiConnection.Delete(ApiUrls.CommitComment(repositoryId, number));
|
||||
|
||||
Reference in New Issue
Block a user