mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-18 13:15:15 +00:00
173 lines
10 KiB
C#
173 lines
10 KiB
C#
using System;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using System.Reactive;
|
|
|
|
namespace Octokit.Reactive
|
|
{
|
|
/// <summary>
|
|
/// A client for GitHub's Repository Webhooks API.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// See the <a href="https://developer.github.com/v3/repos/hooks/">Webhooks API documentation</a> for more information.
|
|
/// </remarks>
|
|
public interface IObservableRepositoryHooksClient
|
|
{
|
|
/// <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>
|
|
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#list">API documentation</a> for more information.</remarks>
|
|
/// <returns>A <see cref="IObservable{RepositoryHook}"/> of <see cref="RepositoryHook"/>s representing hooks for specified repository</returns>
|
|
IObservable<RepositoryHook> GetAll(string owner, string name);
|
|
|
|
/// <summary>
|
|
/// Gets the list of hooks defined for a repository
|
|
/// </summary>
|
|
/// <param name="repositoryId">The repository's ID</param>
|
|
/// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#list">API documentation</a> for more information.</remarks>
|
|
/// <returns>A <see cref="IObservable{RepositoryHook}"/> of <see cref="RepositoryHook"/>s representing hooks for specified repository</returns>
|
|
IObservable<RepositoryHook> GetAll(int repositoryId);
|
|
|
|
/// <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>
|
|
/// <returns>A <see cref="IObservable{RepositoryHook}"/> of <see cref="RepositoryHook"/>s representing hooks for specified repository</returns>
|
|
IObservable<RepositoryHook> GetAll(string owner, string name, ApiOptions options);
|
|
|
|
/// <summary>
|
|
/// Gets the list of hooks defined for a repository
|
|
/// </summary>
|
|
/// <param name="repositoryId">The repository's owner</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>
|
|
/// <returns>A <see cref="IObservable{RepositoryHook}"/> of <see cref="RepositoryHook"/>s representing hooks for specified repository</returns>
|
|
IObservable<RepositoryHook> GetAll(int repositoryId, ApiOptions options);
|
|
|
|
/// <summary>
|
|
/// Gets a single hook by Id
|
|
/// </summary>
|
|
/// <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/#get-single-hook">API documentation</a> for more information.</remarks>
|
|
/// <returns>A <see cref="RepositoryHook"/> representing hook for specified hook id</returns>
|
|
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "This is ok; we're matching HTTP verbs not keyworks")]
|
|
IObservable<RepositoryHook> Get(string owner, string name, int hookId);
|
|
|
|
/// <summary>
|
|
/// Gets a single hook by Id
|
|
/// </summary>
|
|
/// <param name="repositoryId">The repository's owner</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>
|
|
/// <returns>A <see cref="RepositoryHook"/> representing hook for specified hook id</returns>
|
|
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "This is ok; we're matching HTTP verbs not keyworks")]
|
|
IObservable<RepositoryHook> Get(int repositoryId, int hookId);
|
|
|
|
/// <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>
|
|
/// <returns>A <see cref="RepositoryHook"/> representing created hook for specified repository</returns>
|
|
IObservable<RepositoryHook> Create(string owner, string name, NewRepositoryHook hook);
|
|
|
|
/// <summary>
|
|
/// Creates a hook for a repository
|
|
/// </summary>
|
|
/// <param name="repositoryId">The repository's owner</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>
|
|
/// <returns>A <see cref="RepositoryHook"/> representing created hook for specified repository</returns>
|
|
IObservable<RepositoryHook> Create(int repositoryId, NewRepositoryHook hook);
|
|
|
|
/// <summary>
|
|
/// Edits a hook for a repository
|
|
/// </summary>
|
|
/// <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>
|
|
/// <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>
|
|
/// <returns>A <see cref="RepositoryHook"/> representing modified hook for specified repository</returns>
|
|
IObservable<RepositoryHook> Edit(string owner, string name, int hookId, EditRepositoryHook hook);
|
|
|
|
/// <summary>
|
|
/// Edits a hook for a repository
|
|
/// </summary>
|
|
/// <param name="repositoryId">The repository's owner</param>
|
|
/// <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>
|
|
/// <returns>A <see cref="RepositoryHook"/> representing modified hook for specified repository</returns>
|
|
IObservable<RepositoryHook> Edit(int repositoryId, int hookId, EditRepositoryHook hook);
|
|
|
|
/// <summary>
|
|
/// Tests a hook for a repository
|
|
/// </summary>
|
|
/// <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
|
|
/// is not subscribed to push events, the server will respond with 204 but no test POST will be generated.</remarks>
|
|
/// <returns></returns>
|
|
IObservable<Unit> Test(string owner, string name, int hookId);
|
|
|
|
/// <summary>
|
|
/// Tests a hook for a repository
|
|
/// </summary>
|
|
/// <param name="repositoryId">The repository's owner</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
|
|
/// is not subscribed to push events, the server will respond with 204 but no test POST will be generated.</remarks>
|
|
/// <returns></returns>
|
|
IObservable<Unit> Test(int repositoryId, int hookId);
|
|
|
|
/// <summary>
|
|
/// This will trigger a ping event to be sent to the hook.
|
|
/// </summary>
|
|
/// <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/#edit-a-hook">API documentation</a> for more information.</remarks>
|
|
/// <returns></returns>
|
|
IObservable<Unit> Ping(string owner, string name, int hookId);
|
|
|
|
/// <summary>
|
|
/// This will trigger a ping event to be sent to the hook.
|
|
/// </summary>
|
|
/// <param name="repositoryId">The repository's owner</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>
|
|
/// <returns></returns>
|
|
IObservable<Unit> Ping(int repositoryId, int hookId);
|
|
|
|
/// <summary>
|
|
/// Deletes a hook for a repository
|
|
/// </summary>
|
|
/// <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/#delete-a-hook">API documentation</a> for more information.</remarks>
|
|
/// <returns></returns>
|
|
IObservable<Unit> Delete(string owner, string name, int hookId);
|
|
|
|
/// <summary>
|
|
/// Deletes a hook for a repository
|
|
/// </summary>
|
|
/// <param name="repositoryId">The repository's owner</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>
|
|
/// <returns></returns>
|
|
IObservable<Unit> Delete(int repositoryId, int hookId);
|
|
}
|
|
} |