mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 14:15:12 +00:00
ObservableStats Client
This commit is contained in:
16
Octokit.Reactive/Clients/IObservableStatisticsClient.cs
Normal file
16
Octokit.Reactive/Clients/IObservableStatisticsClient.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Octokit.Reactive
|
||||||
|
{
|
||||||
|
public interface IObservableStatisticsClient
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of <see cref="Contributor"/> for the given repository
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="owner">The owner of the repository</param>
|
||||||
|
/// <param name="repositoryName">The name of the repository</param>
|
||||||
|
/// <returns>A list of <see cref="Contributor"/></returns>
|
||||||
|
IObservable<IEnumerable<Contributor>> GetContributors(string owner, string repositoryName);
|
||||||
|
}
|
||||||
|
}
|
||||||
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -76,6 +76,7 @@
|
|||||||
<Compile Include="Clients\IObservableUserEmailsClient.cs" />
|
<Compile Include="Clients\IObservableUserEmailsClient.cs" />
|
||||||
<Compile Include="Clients\IObservableWatchedClient.cs" />
|
<Compile Include="Clients\IObservableWatchedClient.cs" />
|
||||||
<Compile Include="Clients\IObservableFollowersClient.cs" />
|
<Compile Include="Clients\IObservableFollowersClient.cs" />
|
||||||
|
<Compile Include="Clients\IObservableStatisticsClient.cs" />
|
||||||
<Compile Include="Clients\ObservableSearchClient.cs" />
|
<Compile Include="Clients\ObservableSearchClient.cs" />
|
||||||
<Compile Include="Clients\IObservableBlobClient.cs" />
|
<Compile Include="Clients\IObservableBlobClient.cs" />
|
||||||
<Compile Include="Clients\IObservableGistCommentsClient.cs" />
|
<Compile Include="Clients\IObservableGistCommentsClient.cs" />
|
||||||
@@ -120,6 +121,7 @@
|
|||||||
<Compile Include="Clients\ObservableRepositoriesClient.cs" />
|
<Compile Include="Clients\ObservableRepositoriesClient.cs" />
|
||||||
<Compile Include="Clients\ObservableSshKeysClient.cs" />
|
<Compile Include="Clients\ObservableSshKeysClient.cs" />
|
||||||
<Compile Include="Clients\ObservableStarredClient.cs" />
|
<Compile Include="Clients\ObservableStarredClient.cs" />
|
||||||
|
<Compile Include="Clients\ObservableStatisticsClient.cs" />
|
||||||
<Compile Include="Clients\ObservableTagsClient.cs" />
|
<Compile Include="Clients\ObservableTagsClient.cs" />
|
||||||
<Compile Include="Clients\ObservableTreesClient.cs" />
|
<Compile Include="Clients\ObservableTreesClient.cs" />
|
||||||
<Compile Include="Clients\ObservableFollowersClient.cs" />
|
<Compile Include="Clients\ObservableFollowersClient.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user