/// <summary> /// Gets the list of hooks defined for a repository /// </summary> /// <param name="owner">The repository's owner</param> /// <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> public Task <IReadOnlyList <RepositoryHook> > GetAll(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNull(options, "options"); return(ApiConnection.GetAll <RepositoryHook>(ApiUrls.RepositoryHooks(owner, name), options)); }
/// <summary> /// Creates a hook for a repository /// </summary> /// <param name="owner">The repository's owner</param> /// <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> public Task <RepositoryHook> Create(string owner, string name, NewRepositoryHook hook) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNull(hook, "hook"); return(ApiConnection.Post <RepositoryHook>(ApiUrls.RepositoryHooks(owner, name), hook.ToRequest())); }
/// <summary> /// Gets the list of hooks defined for a repository /// </summary> /// <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> public Task <IReadOnlyList <RepositoryHook> > GetAll(long repositoryId, ApiOptions options) { Ensure.ArgumentNotNull(options, "options"); return(ApiConnection.GetAll <RepositoryHook>(ApiUrls.RepositoryHooks(repositoryId), options)); }
/// <summary> /// Creates a hook for a repository /// </summary> /// <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> public Task <RepositoryHook> Create(long repositoryId, NewRepositoryHook hook) { Ensure.ArgumentNotNull(hook, "hook"); return(ApiConnection.Post <RepositoryHook>(ApiUrls.RepositoryHooks(repositoryId), hook.ToRequest())); }