mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-06 12:03:19 +00:00
add metadata to each client action (#2124)
This commit is contained in:
@@ -26,6 +26,7 @@ namespace Octokit
|
||||
/// <param name="owner">The repository's owner</param>
|
||||
/// <param name="name">The repository's name</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#list">API documentation</a> for more information.</remarks>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/hooks")]
|
||||
public Task<IReadOnlyList<RepositoryHook>> GetAll(string owner, string name)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -39,6 +40,7 @@ namespace Octokit
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#list">API documentation</a> for more information.</remarks>
|
||||
[ManualRoute("GET", "/repositories/{id}/hooks")]
|
||||
public Task<IReadOnlyList<RepositoryHook>> GetAll(long repositoryId)
|
||||
{
|
||||
return GetAll(repositoryId, ApiOptions.None);
|
||||
@@ -51,6 +53,7 @@ namespace Octokit
|
||||
/// <param name="name">The repository's name</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#list">API documentation</a> for more information.</remarks>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/hooks")]
|
||||
public Task<IReadOnlyList<RepositoryHook>> GetAll(string owner, string name, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -66,6 +69,7 @@ namespace Octokit
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#list">API documentation</a> for more information.</remarks>
|
||||
[ManualRoute("GET", "/repositories/{id}/hooks")]
|
||||
public Task<IReadOnlyList<RepositoryHook>> GetAll(long repositoryId, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
@@ -80,6 +84,7 @@ namespace Octokit
|
||||
/// <param name="name">The repository's name</param>
|
||||
/// <param name="hookId">The repository's hook id</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#get-single-hook">API documentation</a> for more information.</remarks>
|
||||
[ManualRoute("GET", "/repos/{owner}/{name}/hooks/{id}")]
|
||||
public Task<RepositoryHook> Get(string owner, string name, int hookId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -94,6 +99,7 @@ namespace Octokit
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="hookId">The repository's hook id</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#get-single-hook">API documentation</a> for more information.</remarks>
|
||||
[ManualRoute("GET", "/repositories/{id}/hooks/{id}")]
|
||||
public Task<RepositoryHook> Get(long repositoryId, int hookId)
|
||||
{
|
||||
return ApiConnection.Get<RepositoryHook>(ApiUrls.RepositoryHookById(repositoryId, hookId));
|
||||
@@ -106,6 +112,7 @@ namespace Octokit
|
||||
/// <param name="name">The repository's name</param>
|
||||
/// <param name="hook">The hook's parameters</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#create-a-hook">API documentation</a> for more information.</remarks>
|
||||
[ManualRoute("POST", "/repos/{owner}/{name}/hooks")]
|
||||
public Task<RepositoryHook> Create(string owner, string name, NewRepositoryHook hook)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -121,6 +128,7 @@ namespace Octokit
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="hook">The hook's parameters</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#create-a-hook">API documentation</a> for more information.</remarks>
|
||||
[ManualRoute("POST", "/repositories/{id}/hooks")]
|
||||
public Task<RepositoryHook> Create(long repositoryId, NewRepositoryHook hook)
|
||||
{
|
||||
Ensure.ArgumentNotNull(hook, nameof(hook));
|
||||
@@ -136,6 +144,7 @@ namespace Octokit
|
||||
/// <param name="hookId">The repository's hook id</param>
|
||||
/// <param name="hook">The requested changes to an edit repository hook</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#edit-a-hook">API documentation</a> for more information.</remarks>
|
||||
[ManualRoute("PATCH", "/repos/{owner}/{name}/hooks/{id}")]
|
||||
public Task<RepositoryHook> Edit(string owner, string name, int hookId, EditRepositoryHook hook)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -152,6 +161,7 @@ namespace Octokit
|
||||
/// <param name="hookId">The repository's hook id</param>
|
||||
/// <param name="hook">The requested changes to an edit repository hook</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#edit-a-hook">API documentation</a> for more information.</remarks>
|
||||
[ManualRoute("POST", "/repositories/{id}/hooks/{hook_id}")]
|
||||
public Task<RepositoryHook> Edit(long repositoryId, int hookId, EditRepositoryHook hook)
|
||||
{
|
||||
Ensure.ArgumentNotNull(hook, nameof(hook));
|
||||
@@ -165,9 +175,10 @@ namespace Octokit
|
||||
/// <param name="owner">The repository's owner</param>
|
||||
/// <param name="name">The repository's name</param>
|
||||
/// <param name="hookId">The repository's hook id</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#test-a-hook">API documentation</a> for more information.
|
||||
/// This will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#test-a-hook">API documentation</a> for more information.
|
||||
/// This will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook
|
||||
/// is not subscribed to push events, the server will respond with 204 but no test POST will be generated.</remarks>
|
||||
[ManualRoute("POST", "/repos/{owner}/{name}/hooks/{id}/tests")]
|
||||
public Task Test(string owner, string name, int hookId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -181,9 +192,10 @@ namespace Octokit
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="hookId">The repository's hook id</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#test-a-hook">API documentation</a> for more information.
|
||||
/// This will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#test-a-hook">API documentation</a> for more information.
|
||||
/// This will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook
|
||||
/// is not subscribed to push events, the server will respond with 204 but no test POST will be generated.</remarks>
|
||||
[ManualRoute("POST", "/repositories/{id}/hooks/{hook_id}/tests")]
|
||||
public Task Test(long repositoryId, int hookId)
|
||||
{
|
||||
return ApiConnection.Post(ApiUrls.RepositoryHookTest(repositoryId, hookId));
|
||||
@@ -196,6 +208,7 @@ namespace Octokit
|
||||
/// <param name="name">The repository's name</param>
|
||||
/// <param name="hookId">The repository's hook id</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#edit-a-hook">API documentation</a> for more information.</remarks>
|
||||
[ManualRoute("POST", "/repos/{owner}/{name}/hooks/{id}/pings")]
|
||||
public Task Ping(string owner, string name, int hookId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -210,6 +223,7 @@ namespace Octokit
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="hookId">The repository's hook id</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#edit-a-hook">API documentation</a> for more information.</remarks>
|
||||
[ManualRoute("POST", "/repositories/{id}/hooks/{hook_id}/pings")]
|
||||
public Task Ping(long repositoryId, int hookId)
|
||||
{
|
||||
return ApiConnection.Post(ApiUrls.RepositoryHookPing(repositoryId, hookId));
|
||||
@@ -222,6 +236,7 @@ namespace Octokit
|
||||
/// <param name="name">The repository's name</param>
|
||||
/// <param name="hookId">The repository's hook id</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#delete-a-hook">API documentation</a> for more information.</remarks>
|
||||
[ManualRoute("DELETE", "/repos/{owner}/{name}/hooks/{id}")]
|
||||
public Task Delete(string owner, string name, int hookId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
@@ -236,9 +251,10 @@ namespace Octokit
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="hookId">The repository's hook id</param>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#delete-a-hook">API documentation</a> for more information.</remarks>
|
||||
[ManualRoute("DELETE", "/repositories/{id}/hooks/{hook_id}")]
|
||||
public Task Delete(long repositoryId, int hookId)
|
||||
{
|
||||
return ApiConnection.Delete(ApiUrls.RepositoryHookById(repositoryId, hookId));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user