using System;
using System.Diagnostics.CodeAnalysis;
using System.Reactive;
namespace Octokit.Reactive
{
///
/// A client for GitHub's Repository Webhooks API.
///
///
/// See the Webhooks API documentation for more information.
///
public interface IObservableRepositoryHooksClient
{
///
/// Gets the list of hooks defined for a repository
///
/// The repository's owner
/// The repository's name
/// See API documentation for more information.
///
IObservable GetAll(string owner, string name);
///
/// Gets the list of hooks defined for a repository
///
/// The repository's ID
/// See API documentation for more information.
///
IObservable GetAll(int repositoryId);
///
/// Gets the list of hooks defined for a repository
///
/// The repository's owner
/// The repository's name
/// Options for changing the API response
/// See API documentation for more information.
///
IObservable GetAll(string owner, string name, ApiOptions options);
///
/// Gets the list of hooks defined for a repository
///
/// The repository's ID
/// Options for changing the API response
/// See API documentation for more information.
///
IObservable GetAll(int repositoryId, ApiOptions options);
///
/// Gets a single hook by Id
///
/// The repository's owner
/// The repository's name
/// The repository's hook id
/// See API documentation for more information.
///
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "This is ok; we're matching HTTP verbs not keyworks")]
IObservable Get(string owner, string name, int hookId);
///
/// Gets a single hook by Id
///
/// The repository's ID
/// The repository's hook id
/// See API documentation for more information.
///
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "This is ok; we're matching HTTP verbs not keyworks")]
IObservable Get(int repositoryId, int hookId);
///
/// Creates a hook for a repository
///
/// The repository's owner
/// The repository's name
/// The hook's parameters
/// See API documentation for more information.
///
IObservable Create(string owner, string name, NewRepositoryHook hook);
///
/// Creates a hook for a repository
///
/// The repository's ID
/// The hook's parameters
/// See API documentation for more information.
///
IObservable Create(int repositoryId, NewRepositoryHook hook);
///
/// Edits a hook for a repository
///
/// The repository's owner
/// The repository's name
/// The repository's hook id
/// The requested changes to an edit repository hook
/// See API documentation for more information.
///
IObservable Edit(string owner, string name, int hookId, EditRepositoryHook hook);
///
/// Edits a hook for a repository
///
/// The repository's ID
/// The repository's hook id
/// The requested changes to an edit repository hook
/// See API documentation for more information.
///
IObservable Edit(int repositoryId, int hookId, EditRepositoryHook hook);
///
/// Tests a hook for a repository
///
/// The repository's owner
/// The repository's name
/// The repository's hook id
/// See API documentation 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.
///
IObservable Test(string owner, string name, int hookId);
///
/// Tests a hook for a repository
///
/// The repository's ID
/// The repository's hook id
/// See API documentation 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.
///
IObservable Test(int repositoryId, int hookId);
///
/// This will trigger a ping event to be sent to the hook.
///
/// The repository's owner
/// The repository's name
/// The repository's hook id
/// See API documentation for more information.
///
IObservable Ping(string owner, string name, int hookId);
///
/// This will trigger a ping event to be sent to the hook.
///
/// The repository's ID
/// The repository's hook id
/// See API documentation for more information.
///
IObservable Ping(int repositoryId, int hookId);
///
/// Deletes a hook for a repository
///
/// The repository's owner
/// The repository's name
/// The repository's hook id
/// See API documentation for more information.
///
IObservable Delete(string owner, string name, int hookId);
///
/// Deletes a hook for a repository
///
/// The repository's ID
/// The repository's hook id
/// See API documentation for more information.
///
IObservable Delete(int repositoryId, int hookId);
}
}