mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 22:25:12 +00:00
ObservableStats Client
This commit is contained in:
25
Octokit.Reactive/Clients/ObservableStatisticsClient.cs
Normal file
25
Octokit.Reactive/Clients/ObservableStatisticsClient.cs
Normal file
@@ -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<IEnumerable<Contributor>> GetContributors(string owner, string repositoryName)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
|
||||
|
||||
return _client.Statistics.GetContributors(owner, repositoryName).ToObservable();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user