From 7f063a745168fe12003de88c34965b3e8eb5bc56 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Tue, 18 Feb 2014 22:08:10 +1100 Subject: [PATCH] wireup the additional endpoints for IObservableStatisticsClient --- .../Clients/IObservableStatisticsClient.cs | 33 +++++++++++++++++++ .../Clients/ObservableStatisticsClient.cs | 33 +++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/Octokit.Reactive/Clients/IObservableStatisticsClient.cs b/Octokit.Reactive/Clients/IObservableStatisticsClient.cs index 1f0974a1..551189a2 100644 --- a/Octokit.Reactive/Clients/IObservableStatisticsClient.cs +++ b/Octokit.Reactive/Clients/IObservableStatisticsClient.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Octokit.Response; namespace Octokit.Reactive { @@ -12,5 +13,37 @@ namespace Octokit.Reactive /// The name of the repository /// A list of IObservable> GetContributors(string owner, string repositoryName); + + /// + /// Returns the last year of commit activity grouped by week. + /// + /// The owner of the repository + /// The name of the repository + /// The last year of + IObservable GetCommitActivity(string owner, string repositoryName); + + /// + /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. + /// + /// The owner of the repository + /// The name of the repository + /// Returns a weekly aggregate of the number additions and deletion + IObservable GetCodeFrequency(string owner, string repositoryName); + + /// + /// Returns the total commit counts for the owner and total commit counts in total. + /// + /// The owner of the repository + /// The name of the repository + /// Returns from oldest week to now + IObservable GetParticipation(string owner, string repositoryName); + + /// + /// Returns a list of the number of commits per hour in each day + /// + /// The owner of the repository + /// The name of the repository + /// Returns commit counts per hour in each day + IObservable GetPunchCard(string owner, string repositoryName); } } \ No newline at end of file diff --git a/Octokit.Reactive/Clients/ObservableStatisticsClient.cs b/Octokit.Reactive/Clients/ObservableStatisticsClient.cs index 3d09367b..eea9d5dd 100644 --- a/Octokit.Reactive/Clients/ObservableStatisticsClient.cs +++ b/Octokit.Reactive/Clients/ObservableStatisticsClient.cs @@ -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 GetCommitActivity(string owner, string repositoryName) + { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + + return _client.Repository.Statistics.GetCommitActivity(owner, repositoryName).ToObservable(); + } + + public IObservable GetCodeFrequency(string owner, string repositoryName) + { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + + return _client.Repository.Statistics.GetCodeFrequency(owner, repositoryName).ToObservable(); + } + + public IObservable GetParticipation(string owner, string repositoryName) + { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + + return _client.Repository.Statistics.GetParticipation(owner, repositoryName).ToObservable(); + } + + public IObservable GetPunchCard(string owner, string repositoryName) + { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + + return _client.Repository.Statistics.GetPunchCard(owner, repositoryName).ToObservable(); + } } } \ No newline at end of file