From 4230c958f8d042918c7f94b1bcca3cfdac1d5db9 Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Fri, 10 Jun 2016 14:52:29 +0700 Subject: [PATCH] modified XML docs --- .../IObservableRepositoryHooksClient.cs | 64 +++++++---- .../ObservableRepositoryHooksClient.cs | 100 +++++++++++------- Octokit/Clients/IRepositoryHooksClient.cs | 62 +++++++---- Octokit/Clients/RepositoryHooksClient.cs | 96 ++++++++++------- 4 files changed, 207 insertions(+), 115 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableRepositoryHooksClient.cs b/Octokit.Reactive/Clients/IObservableRepositoryHooksClient.cs index 53d2f592..e68ce767 100644 --- a/Octokit.Reactive/Clients/IObservableRepositoryHooksClient.cs +++ b/Octokit.Reactive/Clients/IObservableRepositoryHooksClient.cs @@ -4,73 +4,95 @@ 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 /// - /// See API documentation for more information. /// The repository's owner - /// The repository's name - /// - IObservable GetAll(string owner, string repositoryName); + /// The repository's name + /// See API documentation for more information. + /// A of s representing hooks for specified repository + IObservable GetAll(string owner, string name); /// /// Gets the list of hooks defined for a repository /// - /// See API documentation for more information. /// The repository's owner - /// The repository's name + /// The repository's name /// Options for changing the API response - /// - IObservable GetAll(string owner, string repositoryName, ApiOptions options); + /// See API documentation for more information. + /// A of s representing hooks for specified repository + IObservable GetAll(string owner, string name, ApiOptions options); /// - /// Gets a single hook defined for a repository by id + /// 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. - /// + /// A representing hook for specified hook id [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "This is ok; we're matching HTTP verbs not keyworks")] - IObservable Get(string owner, string repositoryName, int hookId); + IObservable Get(string owner, string name, 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 repositoryName, NewRepositoryHook hook); + /// A representing created hook for specified repository + IObservable Create(string owner, string name, 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 repositoryName, int hookId, EditRepositoryHook hook); + /// A representing modified hook for specified repository + IObservable Edit(string owner, string name, 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 repositoryName, int hookId); + IObservable Test(string owner, string name, 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 repositoryName, int hookId); + IObservable Ping(string owner, string name, 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 repositoryName, int hookId); + IObservable Delete(string owner, string name, int hookId); } } \ No newline at end of file diff --git a/Octokit.Reactive/Clients/ObservableRepositoryHooksClient.cs b/Octokit.Reactive/Clients/ObservableRepositoryHooksClient.cs index 24bca1f4..78585ce1 100644 --- a/Octokit.Reactive/Clients/ObservableRepositoryHooksClient.cs +++ b/Octokit.Reactive/Clients/ObservableRepositoryHooksClient.cs @@ -5,11 +5,21 @@ using Octokit.Reactive.Internal; namespace Octokit.Reactive { + /// + /// A client for GitHub's Repository Webhooks API. + /// + /// + /// See the Webhooks API documentation for more information. + /// public class ObservableRepositoryHooksClient : IObservableRepositoryHooksClient { readonly IRepositoryHooksClient _client; readonly IConnection _connection; + /// + /// Initializes a new GitHub Webhooks API client. + /// + /// public ObservableRepositoryHooksClient(IGitHubClient client) { Ensure.ArgumentNotNull(client, "client"); @@ -21,118 +31,134 @@ namespace Octokit.Reactive /// /// Gets the list of hooks defined for a repository /// - /// See API documentation for more information. /// The repository's owner - /// The repository's name - /// - public IObservable GetAll(string owner, string repositoryName) + /// The repository's name + /// See API documentation for more information. + /// A of s representing hooks for specified repository + public IObservable GetAll(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return GetAll(owner, repositoryName, ApiOptions.None); + return GetAll(owner, name, ApiOptions.None); } /// /// Gets the list of hooks defined for a repository /// - /// See API documentation for more information. /// The repository's owner - /// The repository's name + /// The repository's name /// Options for changing the API response - /// - public IObservable GetAll(string owner, string repositoryName, ApiOptions options) + /// See API documentation for more information. + /// A of s representing hooks for specified repository + public IObservable GetAll(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNull(options, "options"); - return _connection.GetAndFlattenAllPages(ApiUrls.RepositoryHooks(owner, repositoryName), options); + return _connection.GetAndFlattenAllPages(ApiUrls.RepositoryHooks(owner, name), options); } /// - /// Gets a single hook defined for a repository by id + /// 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. - /// - public IObservable Get(string owner, string repositoryName, int hookId) + /// A representing hook for specified hook id + public IObservable Get(string owner, string name, int hookId) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return _client.Get(owner, repositoryName, hookId).ToObservable(); + return _client.Get(owner, name, hookId).ToObservable(); } /// /// Creates a hook for a repository /// + /// The repository's owner + /// The repository's name + /// The hook's parameters /// See API documentation for more information. - /// - public IObservable Create(string owner, string repositoryName, NewRepositoryHook hook) + /// A representing created hook for specified repository + public IObservable Create(string owner, string name, NewRepositoryHook hook) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNull(hook, "hook"); - return _client.Create(owner, repositoryName, hook).ToObservable(); + return _client.Create(owner, name, hook).ToObservable(); } /// /// 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. - /// - public IObservable Edit(string owner, string repositoryName, int hookId, EditRepositoryHook hook) + /// A representing modified hook for specified repository + public IObservable Edit(string owner, string name, int hookId, EditRepositoryHook hook) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNull(hook, "hook"); - return _client.Edit(owner, repositoryName, hookId, hook).ToObservable(); + return _client.Edit(owner, name, hookId, hook).ToObservable(); } /// /// 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. /// - public IObservable Test(string owner, string repositoryName, int hookId) + public IObservable Test(string owner, string name, int hookId) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return _client.Test(owner, repositoryName, hookId).ToObservable(); + return _client.Test(owner, name, hookId).ToObservable(); } /// /// 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. /// - public IObservable Ping(string owner, string repositoryName, int hookId) + public IObservable Ping(string owner, string name, int hookId) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return _client.Ping(owner, repositoryName, hookId).ToObservable(); + return _client.Ping(owner, name, hookId).ToObservable(); } /// /// 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. /// - public IObservable Delete(string owner, string repositoryName, int hookId) + public IObservable Delete(string owner, string name, int hookId) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return _client.Delete(owner, repositoryName, hookId).ToObservable(); + return _client.Delete(owner, name, hookId).ToObservable(); } } } diff --git a/Octokit/Clients/IRepositoryHooksClient.cs b/Octokit/Clients/IRepositoryHooksClient.cs index 571306a4..039406f1 100644 --- a/Octokit/Clients/IRepositoryHooksClient.cs +++ b/Octokit/Clients/IRepositoryHooksClient.cs @@ -4,73 +4,95 @@ using System.Threading.Tasks; namespace Octokit { + /// + /// A client for GitHub's Repository Webhooks API. + /// + /// + /// See the Webhooks API documentation for more information. + /// public interface IRepositoryHooksClient { /// /// Gets the list of hooks defined for a repository /// - /// See API documentation for more information. /// The repository's owner - /// The repository's name - /// - Task> GetAll(string owner, string repositoryName); + /// The repository's name + /// See API documentation for more information. + /// A of s representing hooks for specified repository + Task> GetAll(string owner, string name); /// /// Gets the list of hooks defined for a repository /// - /// See API documentation for more information. /// The repository's owner - /// The repository's name + /// The repository's name /// Options for changing the API response - /// - Task> GetAll(string owner, string repositoryName, ApiOptions options); + /// See API documentation for more information. + /// A of s representing hooks for specified repository + Task> GetAll(string owner, string name, 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. + /// A representing hook for specified hook id [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "This is ok; we're matching HTTP verbs not keywords")] - Task Get(string owner, string repositoryName, int hookId); + Task Get(string owner, string name, 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. - /// - Task Create(string owner, string repositoryName, NewRepositoryHook hook); + /// A representing created hook for specified repository + Task Create(string owner, string name, 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. - /// - Task Edit(string owner, string repositoryName, int hookId, EditRepositoryHook hook); + /// A representing modified hook for specified repository + Task Edit(string owner, string name, 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. /// - Task Test(string owner, string repositoryName, int hookId); + Task Test(string owner, string name, 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. /// - Task Ping(string owner, string repositoryName, int hookId); + Task Ping(string owner, string name, 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. /// - Task Delete(string owner, string repositoryName, int hookId); + Task Delete(string owner, string name, int hookId); } } diff --git a/Octokit/Clients/RepositoryHooksClient.cs b/Octokit/Clients/RepositoryHooksClient.cs index f2e6e9df..87a52177 100644 --- a/Octokit/Clients/RepositoryHooksClient.cs +++ b/Octokit/Clients/RepositoryHooksClient.cs @@ -3,10 +3,16 @@ using System.Threading.Tasks; namespace Octokit { + /// + /// A client for GitHub's Repository Webhooks API. + /// + /// + /// See the Webhooks API documentation for more information. + /// public class RepositoryHooksClient : ApiClient, IRepositoryHooksClient { /// - /// Initializes a new GitHub Repos API client. + /// Initializes a new GitHub Webhooks API client. /// /// An API connection. public RepositoryHooksClient(IApiConnection apiConnection) @@ -17,118 +23,134 @@ namespace Octokit /// /// Gets the list of hooks defined for a repository /// - /// See API documentation for more information. /// The repository's owner - /// The repository's name - /// - public Task> GetAll(string owner, string repositoryName) + /// The repository's name + /// See API documentation for more information. + /// A of s representing hooks for specified repository + public Task> GetAll(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return GetAll(owner, repositoryName, ApiOptions.None); + return GetAll(owner, name, ApiOptions.None); } /// /// Gets the list of hooks defined for a repository /// - /// See API documentation for more information. /// The repository's owner - /// The repository's name + /// The repository's name /// Options for changing the API response - /// - public Task> GetAll(string owner, string repositoryName, ApiOptions options) + /// See API documentation for more information. + /// A of s representing hooks for specified repository + public Task> GetAll(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNull(options, "options"); - return ApiConnection.GetAll(ApiUrls.RepositoryHooks(owner, repositoryName), options); + return ApiConnection.GetAll(ApiUrls.RepositoryHooks(owner, name), 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. - public Task Get(string owner, string repositoryName, int hookId) + /// A representing hook for specified hook id + public Task Get(string owner, string name, int hookId) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return ApiConnection.Get(ApiUrls.RepositoryHookById(owner, repositoryName, hookId)); + return ApiConnection.Get(ApiUrls.RepositoryHookById(owner, name, 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. - /// - public Task Create(string owner, string repositoryName, NewRepositoryHook hook) + /// A representing created hook for specified repository + public Task Create(string owner, string name, NewRepositoryHook hook) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNull(hook, "hook"); - return ApiConnection.Post(ApiUrls.RepositoryHooks(owner, repositoryName), hook.ToRequest()); + return ApiConnection.Post(ApiUrls.RepositoryHooks(owner, name), hook.ToRequest()); } /// /// 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. - /// - public Task Edit(string owner, string repositoryName, int hookId, EditRepositoryHook hook) + /// A representing modified hook for specified repository + public Task Edit(string owner, string name, int hookId, EditRepositoryHook hook) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNull(hook, "hook"); - return ApiConnection.Patch(ApiUrls.RepositoryHookById(owner, repositoryName, hookId), hook); + return ApiConnection.Patch(ApiUrls.RepositoryHookById(owner, name, hookId), 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. /// - public Task Test(string owner, string repositoryName, int hookId) + public Task Test(string owner, string name, int hookId) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return ApiConnection.Post(ApiUrls.RepositoryHookTest(owner, repositoryName, hookId)); + return ApiConnection.Post(ApiUrls.RepositoryHookTest(owner, name, 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. /// - public Task Ping(string owner, string repositoryName, int hookId) + public Task Ping(string owner, string name, int hookId) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return ApiConnection.Post(ApiUrls.RepositoryHookPing(owner, repositoryName, hookId)); + return ApiConnection.Post(ApiUrls.RepositoryHookPing(owner, name, 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. /// - public Task Delete(string owner, string repositoryName, int hookId) + public Task Delete(string owner, string name, int hookId) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return ApiConnection.Delete(ApiUrls.RepositoryHookById(owner, repositoryName, hookId)); + return ApiConnection.Delete(ApiUrls.RepositoryHookById(owner, name, hookId)); } } } \ No newline at end of file