using System.Collections.Generic; using System.Threading.Tasks; namespace Octokit { /// /// A client for GitHub's Repository Hooks API /// public class RepositoryHooksClient : ApiClient, IRepositoryHooksClient { /// /// Initializes a new GitHub Repos API client. /// /// An API connection. public RepositoryHooksClient(IApiConnection apiConnection) : base(apiConnection) { } /// /// Gets the list of hooks defined for a repository /// /// See API documentation for more information. /// public Task> GetHooks(string owner, string repositoryName) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); return ApiConnection.GetAll(ApiUrls.RepositoryHooks(owner, repositoryName)); } /// /// Gets a single hook defined for a repository by id /// /// See API documentation for more information. /// public Task GetHookById(string owner, string repositoryName, int hookId) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); Ensure.ArgumentNotNull(hookId, "hookId"); return ApiConnection.Get(ApiUrls.RepositoryHooksById(owner, repositoryName, hookId)); } /// /// Creates a hook for a repository /// /// See API documentation for more information. /// public Task CreateHook(string owner, string repositoryName, NewRepositoryHook hook) { throw new System.NotImplementedException(); } public Task EditHook(string owner, string repositoryName, string hookId, EditRepositoryHook hook) { throw new System.NotImplementedException(); } public Task TestHook(string owner, string repositoryName, string hookId) { throw new System.NotImplementedException(); } public Task DeleteHook(string owner, string repositoryName, string hookId) { throw new System.NotImplementedException(); } } }