diff --git a/Octokit.Reactive/Clients/IObservableStatisticsClient.cs b/Octokit.Reactive/Clients/IObservableStatisticsClient.cs new file mode 100644 index 00000000..1f0974a1 --- /dev/null +++ b/Octokit.Reactive/Clients/IObservableStatisticsClient.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +namespace Octokit.Reactive +{ + public interface IObservableStatisticsClient + { + /// + /// Returns a list of for the given repository + /// + /// The owner of the repository + /// The name of the repository + /// A list of + IObservable> GetContributors(string owner, string repositoryName); + } +} \ No newline at end of file diff --git a/Octokit.Reactive/Clients/ObservableStatisticsClient.cs b/Octokit.Reactive/Clients/ObservableStatisticsClient.cs new file mode 100644 index 00000000..d285860d --- /dev/null +++ b/Octokit.Reactive/Clients/ObservableStatisticsClient.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Reactive.Threading.Tasks; + +namespace Octokit.Reactive +{ + public class ObservableStatisticsClient : IObservableStatisticsClient + { + readonly IGitHubClient _client; + + public ObservableStatisticsClient(IGitHubClient client) + { + Ensure.ArgumentNotNull(client, "client"); + _client = client; + } + + public IObservable> GetContributors(string owner, string repositoryName) + { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + + return _client.Statistics.GetContributors(owner, repositoryName).ToObservable(); + } + } +} \ No newline at end of file diff --git a/Octokit.Reactive/Octokit.Reactive.csproj b/Octokit.Reactive/Octokit.Reactive.csproj index 55eea4ee..0e10d10e 100644 --- a/Octokit.Reactive/Octokit.Reactive.csproj +++ b/Octokit.Reactive/Octokit.Reactive.csproj @@ -76,6 +76,7 @@ + @@ -120,6 +121,7 @@ +