Refactor to a RepositoryHooksClient

This commit is contained in:
Andy Cross
2014-01-20 14:36:36 +00:00
parent 8223bade57
commit a13c9fa3cc
12 changed files with 195 additions and 20 deletions
+33
View File
@@ -0,0 +1,33 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Octokit
{
public interface IRepositoryHooksClient
{
/// <summary>
/// Gets the list of hooks defined for a repository
/// </summary>
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#json-http">API documentation</a> for more information.</remarks>
/// <returns></returns>
Task<IReadOnlyList<RepositoryHook>> GetHooks(string owner, string repositoryName);
/// <summary>
/// Gets a single hook by Id
/// </summary>
/// <param name="owner"></param>
/// <param name="repositoryName"></param>
/// <param name="hookId"></param>
/// <returns></returns>
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#get-single-hook">API documentation</a> for more information.</remarks>
Task<RepositoryHook> GetHookById(string owner, string repositoryName, int hookId);
Task<RepositoryHook> CreateHook(string owner, string repositoryName, NewRepositoryHook hook);
Task<RepositoryHook> EditHook(string owner, string repositoryName, string hookId, EditRepositoryHook hook);
Task TestHook(string owner, string repositoryName, string hookId);
Task DeleteHook(string owner, string repositoryName, string hookId);
}
}