wireup the additional endpoints for IObservableStatisticsClient

This commit is contained in:
Brendan Forster
2014-02-18 22:08:10 +11:00
parent d62b59b175
commit 7f063a7451
2 changed files with 66 additions and 0 deletions
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using Octokit.Response;
namespace Octokit.Reactive
{
@@ -12,5 +13,37 @@ namespace Octokit.Reactive
/// <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);
/// <summary>
/// Returns the last year of commit activity grouped by week.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="repositoryName">The name of the repository</param>
/// <returns>The last year of <see cref="CommitActivity"/></returns>
IObservable<CommitActivity> GetCommitActivity(string owner, string repositoryName);
/// <summary>
/// Returns a weekly aggregate of the number of additions and deletions pushed to a repository.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="repositoryName">The name of the repository</param>
/// <returns>Returns a weekly aggregate of the number additions and deletion</returns>
IObservable<CodeFrequency> GetCodeFrequency(string owner, string repositoryName);
/// <summary>
/// Returns the total commit counts for the owner and total commit counts in total.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="repositoryName">The name of the repository</param>
/// <returns>Returns <see cref="Participation"/>from oldest week to now</returns>
IObservable<Participation> GetParticipation(string owner, string repositoryName);
/// <summary>
/// Returns a list of the number of commits per hour in each day
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="repositoryName">The name of the repository</param>
/// <returns>Returns commit counts per hour in each day</returns>
IObservable<PunchCard> GetPunchCard(string owner, string repositoryName);
}
}
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Reactive.Threading.Tasks;
using Octokit.Response;
namespace Octokit.Reactive
{
@@ -21,5 +22,37 @@ namespace Octokit.Reactive
return _client.Repository.Statistics.GetContributors(owner, repositoryName).ToObservable();
}
public IObservable<CommitActivity> GetCommitActivity(string owner, string repositoryName)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
return _client.Repository.Statistics.GetCommitActivity(owner, repositoryName).ToObservable();
}
public IObservable<CodeFrequency> GetCodeFrequency(string owner, string repositoryName)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
return _client.Repository.Statistics.GetCodeFrequency(owner, repositoryName).ToObservable();
}
public IObservable<Participation> GetParticipation(string owner, string repositoryName)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
return _client.Repository.Statistics.GetParticipation(owner, repositoryName).ToObservable();
}
public IObservable<PunchCard> GetPunchCard(string owner, string repositoryName)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
return _client.Repository.Statistics.GetPunchCard(owner, repositoryName).ToObservable();
}
}
}