mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 12:26:18 +00:00
add metadata to each client action (#2124)
This commit is contained in:
@@ -23,6 +23,7 @@ namespace Octokit
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="base">The reference to use as the base commit</param>
|
||||
/// <param name="head">The reference to use as the head commit</param>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/compare/{base}...{head}")]
|
||||
public Task<CompareResult> Compare(string owner, string name, string @base, string head)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -39,6 +40,7 @@ namespace Octokit
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="base">The reference to use as the base commit</param>
|
||||
/// <param name="head">The reference to use as the head commit</param>
|
||||
[ManualRoute("GET", "/repositories/{id}/compare/{base}...{head}")]
|
||||
public Task<CompareResult> Compare(long repositoryId, string @base, string head)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(@base, nameof(@base));
|
||||
@@ -53,6 +55,7 @@ namespace Octokit
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="reference">The reference for the commit (SHA)</param>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/commits/{sha}")]
|
||||
public Task<GitHubCommit> Get(string owner, string name, string reference)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -67,6 +70,7 @@ namespace Octokit
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="reference">The reference for the commit (SHA)</param>
|
||||
[ManualRoute("GET", "/repositories/{id}/commits/{sha}")]
|
||||
public Task<GitHubCommit> Get(long repositoryId, string reference)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference));
|
||||
@@ -79,6 +83,7 @@ namespace Octokit
|
||||
/// </summary>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/commits")]
|
||||
public Task<IReadOnlyList<GitHubCommit>> GetAll(string owner, string name)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -91,6 +96,7 @@ namespace Octokit
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
[ManualRoute("GET", "/repositories/{id}/commits")]
|
||||
public Task<IReadOnlyList<GitHubCommit>> GetAll(long repositoryId)
|
||||
{
|
||||
return GetAll(repositoryId, new CommitRequest(), ApiOptions.None);
|
||||
@@ -102,6 +108,7 @@ namespace Octokit
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/commits")]
|
||||
public Task<IReadOnlyList<GitHubCommit>> GetAll(string owner, string name, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -115,6 +122,7 @@ namespace Octokit
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
[ManualRoute("GET", "/repositories/{id}/commits")]
|
||||
public Task<IReadOnlyList<GitHubCommit>> GetAll(long repositoryId, ApiOptions options)
|
||||
{
|
||||
return GetAll(repositoryId, new CommitRequest(), options);
|
||||
@@ -126,6 +134,7 @@ namespace Octokit
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="request">Used to filter list of commits returned</param>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/commits")]
|
||||
public Task<IReadOnlyList<GitHubCommit>> GetAll(string owner, string name, CommitRequest request)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -140,6 +149,7 @@ namespace Octokit
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="request">Used to filter list of commits returned</param>
|
||||
[ManualRoute("GET", "/repositories/{id}/commits")]
|
||||
public Task<IReadOnlyList<GitHubCommit>> GetAll(long repositoryId, CommitRequest request)
|
||||
{
|
||||
Ensure.ArgumentNotNull(request, nameof(request));
|
||||
@@ -154,6 +164,7 @@ namespace Octokit
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="request">Used to filter list of commits returned</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/commits")]
|
||||
public Task<IReadOnlyList<GitHubCommit>> GetAll(string owner, string name, CommitRequest request, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -170,6 +181,7 @@ namespace Octokit
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="request">Used to filter list of commits returned</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
[ManualRoute("GET", "/repositories/{id}/commits")]
|
||||
public Task<IReadOnlyList<GitHubCommit>> GetAll(long repositoryId, CommitRequest request, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(request, nameof(request));
|
||||
@@ -184,6 +196,7 @@ namespace Octokit
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="reference">The repository reference</param>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/commits/{sha}")]
|
||||
public Task<string> GetSha1(string owner, string name, string reference)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -198,6 +211,7 @@ namespace Octokit
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="reference">The repository reference</param>
|
||||
[ManualRoute("GET", "/repositories/{id}/commits/{sha}")]
|
||||
public Task<string> GetSha1(long repositoryId, string reference)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference));
|
||||
@@ -205,4 +219,4 @@ namespace Octokit
|
||||
return ApiConnection.Get<string>(ApiUrls.RepositoryCommit(repositoryId, reference), null, AcceptHeaders.CommitReferenceSha1MediaType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user