From 8ee07dd355444569518aaa7cd713140428ccfc1f Mon Sep 17 00:00:00 2001 From: Alexander Efremov Date: Mon, 13 Jun 2016 19:37:47 +0700 Subject: [PATCH] added new overloads modified XML docs --- .../Clients/IObservableEventsClient.cs | 48 ++++++++++++++ .../Clients/ObservableEventsClient.cs | 64 +++++++++++++++++++ Octokit/Clients/EventsClient.cs | 61 +++++++++++++++++- Octokit/Clients/IEventsClient.cs | 46 ++++++++++++- 4 files changed, 215 insertions(+), 4 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableEventsClient.cs b/Octokit.Reactive/Clients/IObservableEventsClient.cs index 803a23fc..14b296e0 100644 --- a/Octokit.Reactive/Clients/IObservableEventsClient.cs +++ b/Octokit.Reactive/Clients/IObservableEventsClient.cs @@ -2,6 +2,12 @@ namespace Octokit.Reactive { + /// + /// A client for GitHub's Activity Events API. + /// + /// + /// See the Activity Events API documentation for more information + /// public interface IObservableEventsClient { /// @@ -35,6 +41,16 @@ namespace Octokit.Reactive /// All the s for the particular repository. IObservable GetAllForRepository(string owner, string name); + /// + /// Gets all the events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// All the s for the particular repository. + IObservable GetAllForRepository(int repositoryId); + /// /// Gets all the events for a given repository /// @@ -47,6 +63,17 @@ namespace Octokit.Reactive /// All the s for the particular repository. IObservable GetAllForRepository(string owner, string name, ApiOptions options); + /// + /// Gets all the events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// All the s for the particular repository. + IObservable GetAllForRepository(int repositoryId, ApiOptions options); + /// /// Gets all the issue events for a given repository /// @@ -58,6 +85,16 @@ namespace Octokit.Reactive /// All the s for the particular repository. IObservable GetAllIssuesForRepository(string owner, string name); + /// + /// Gets all the issue events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// All the s for the particular repository. + IObservable GetAllIssuesForRepository(int repositoryId); + /// /// Gets all the issue events for a given repository /// @@ -70,6 +107,17 @@ namespace Octokit.Reactive /// All the s for the particular repository. IObservable GetAllIssuesForRepository(string owner, string name, ApiOptions options); + /// + /// Gets all the issue events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// All the s for the particular repository. + IObservable GetAllIssuesForRepository(int repositoryId, ApiOptions options); + /// /// Gets all the events for a given repository network /// diff --git a/Octokit.Reactive/Clients/ObservableEventsClient.cs b/Octokit.Reactive/Clients/ObservableEventsClient.cs index 40eba047..318adce7 100644 --- a/Octokit.Reactive/Clients/ObservableEventsClient.cs +++ b/Octokit.Reactive/Clients/ObservableEventsClient.cs @@ -3,6 +3,12 @@ using Octokit.Reactive.Internal; namespace Octokit.Reactive { + /// + /// A client for GitHub's Activity Events API. + /// + /// + /// See the Activity Events API documentation for more information + /// public class ObservableEventsClient : IObservableEventsClient { readonly IConnection _connection; @@ -58,6 +64,19 @@ namespace Octokit.Reactive return GetAllForRepository(owner, name, ApiOptions.None); } + /// + /// Gets all the events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// All the s for the particular repository. + public IObservable GetAllForRepository(int repositoryId) + { + return GetAllForRepository(repositoryId, ApiOptions.None); + } + /// /// Gets all the events for a given repository /// @@ -77,6 +96,22 @@ namespace Octokit.Reactive return _connection.GetAndFlattenAllPages(ApiUrls.Events(owner, name), options); } + /// + /// Gets all the events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// All the s for the particular repository. + public IObservable GetAllForRepository(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return _connection.GetAndFlattenAllPages(ApiUrls.Events(repositoryId), options); + } + /// /// Gets all the events for a given repository /// @@ -94,6 +129,19 @@ namespace Octokit.Reactive return GetAllIssuesForRepository(owner, name, ApiOptions.None); } + /// + /// Gets all the issue events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// All the s for the particular repository. + public IObservable GetAllIssuesForRepository(int repositoryId) + { + return GetAllIssuesForRepository(repositoryId, ApiOptions.None); + } + /// /// Gets all the events for a given repository /// @@ -113,6 +161,22 @@ namespace Octokit.Reactive return _connection.GetAndFlattenAllPages(ApiUrls.IssuesEvents(owner, name), options); } + /// + /// Gets all the issue events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// All the s for the particular repository. + public IObservable GetAllIssuesForRepository(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return _connection.GetAndFlattenAllPages(ApiUrls.IssuesEvents(repositoryId), options); + } + /// /// Gets all the events for a given repository network /// diff --git a/Octokit/Clients/EventsClient.cs b/Octokit/Clients/EventsClient.cs index aecf303b..d6c91474 100644 --- a/Octokit/Clients/EventsClient.cs +++ b/Octokit/Clients/EventsClient.cs @@ -61,7 +61,20 @@ namespace Octokit Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return GetAllForRepository(owner,name,ApiOptions.None); + return GetAllForRepository(owner, name, ApiOptions.None); + } + + /// + /// Gets all the events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// All the s for the particular repository. + public Task> GetAllForRepository(int repositoryId) + { + return GetAllForRepository(repositoryId, ApiOptions.None); } /// @@ -83,6 +96,21 @@ namespace Octokit return ApiConnection.GetAll(ApiUrls.Events(owner, name), options); } + /// + /// Gets all the events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// All the s for the particular repository. + public Task> GetAllForRepository(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return ApiConnection.GetAll(ApiUrls.Events(repositoryId), options); + } /// /// Gets all the event issues for a given repository @@ -101,6 +129,19 @@ namespace Octokit return GetAllIssuesForRepository(owner, name, ApiOptions.None); } + /// + /// Gets all the issue events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// All the s for the particular repository. + public Task> GetAllIssuesForRepository(int repositoryId) + { + return GetAllIssuesForRepository(repositoryId, ApiOptions.None); + } + /// /// Gets all the event issues for a given repository /// @@ -120,6 +161,22 @@ namespace Octokit return ApiConnection.GetAll(ApiUrls.IssuesEvents(owner, name), options); } + /// + /// Gets all the issue events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// All the s for the particular repository. + public Task> GetAllIssuesForRepository(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return ApiConnection.GetAll(ApiUrls.IssuesEvents(repositoryId), options); + } + /// /// Gets all the events for a given repository network /// @@ -134,7 +191,7 @@ namespace Octokit Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return GetAllForRepositoryNetwork(owner,name,ApiOptions.None); + return GetAllForRepositoryNetwork(owner, name, ApiOptions.None); } /// diff --git a/Octokit/Clients/IEventsClient.cs b/Octokit/Clients/IEventsClient.cs index cd492245..679fb16d 100644 --- a/Octokit/Clients/IEventsClient.cs +++ b/Octokit/Clients/IEventsClient.cs @@ -42,6 +42,16 @@ namespace Octokit /// All the s for the particular repository. Task> GetAllForRepository(string owner, string name); + /// + /// Gets all the events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// All the s for the particular repository. + Task> GetAllForRepository(int repositoryId); + /// /// Gets all the events for a given repository /// @@ -54,6 +64,17 @@ namespace Octokit /// All the s for the particular repository. Task> GetAllForRepository(string owner, string name, ApiOptions options); + /// + /// Gets all the events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// All the s for the particular repository. + Task> GetAllForRepository(int repositoryId, ApiOptions options); + /// /// Gets all the issue events for a given repository /// @@ -65,6 +86,16 @@ namespace Octokit /// All the s for the particular repository. Task> GetAllIssuesForRepository(string owner, string name); + /// + /// Gets all the issue events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// All the s for the particular repository. + Task> GetAllIssuesForRepository(int repositoryId); + /// /// Gets all the issue events for a given repository /// @@ -77,6 +108,17 @@ namespace Octokit /// All the s for the particular repository. Task> GetAllIssuesForRepository(string owner, string name, ApiOptions options); + /// + /// Gets all the issue events for a given repository + /// + /// + /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// All the s for the particular repository. + Task> GetAllIssuesForRepository(int repositoryId, ApiOptions options); + /// /// Gets all the events for a given repository network /// @@ -98,8 +140,8 @@ namespace Octokit /// The name of the repository /// Options for changing the API response /// All the s for the particular repository network. - Task> GetAllForRepositoryNetwork(string owner, string name,ApiOptions options); - + Task> GetAllForRepositoryNetwork(string owner, string name, ApiOptions options); + /// /// Gets all the events for a given organization ///