-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1049 from TattsGroup/enterprise-adminstats
Implement Enterprise Admin Stats API
- Loading branch information
Showing
45 changed files
with
2,080 additions
and
1 deletion.
There are no files selected for viewing
124 changes: 124 additions & 0 deletions
124
Octokit.Reactive/Clients/Enterprise/IObservableEnterpriseAdminStatsClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace Octokit.Reactive | ||
{ | ||
/// <summary> | ||
/// A client for GitHub's Enterprise Admin Stats API | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="https://developer.github.com/v3/enterprise/admin_stats/">Enterprise Admin Stats API documentation</a> for more information. | ||
///</remarks> | ||
public interface IObservableEnterpriseAdminStatsClient | ||
{ | ||
/// <summary> | ||
/// Gets GitHub Enterprise Issue statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsIssues"/> statistics.</returns> | ||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] | ||
IObservable<AdminStatsIssues> GetStatisticsIssues(); | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Hook statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsHooks"/> statistics.</returns> | ||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] | ||
IObservable<AdminStatsHooks> GetStatisticsHooks(); | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Milestone statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsMilestones"/> statistics.</returns> | ||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] | ||
IObservable<AdminStatsMilestones> GetStatisticsMilestones(); | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Organization statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsOrgs"/> statistics.</returns> | ||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] | ||
IObservable<AdminStatsOrgs> GetStatisticsOrgs(); | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Comment statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsComments"/> statistics.</returns> | ||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] | ||
IObservable<AdminStatsComments> GetStatisticsComments(); | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Pages statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsPages"/> statistics.</returns> | ||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] | ||
IObservable<AdminStatsPages> GetStatisticsPages(); | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise User statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsUsers"/> statistics.</returns> | ||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] | ||
IObservable<AdminStatsUsers> GetStatisticsUsers(); | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Gist statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsGists"/> statistics.</returns> | ||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] | ||
IObservable<AdminStatsGists> GetStatisticsGists(); | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise PullRequest statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsPulls"/> statistics.</returns> | ||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] | ||
IObservable<AdminStatsPulls> GetStatisticsPulls(); | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Repository statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsRepos"/> statistics.</returns> | ||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] | ||
IObservable<AdminStatsRepos> GetStatisticsRepos(); | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStats"/> collection of statistics.</returns> | ||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] | ||
IObservable<AdminStats> GetStatisticsAll(); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
Octokit.Reactive/Clients/Enterprise/IObservableEnterpriseClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace Octokit.Reactive | ||
{ | ||
/// <summary> | ||
/// A client for GitHub's Enterprise API. | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="http://developer.github.com/v3/enterprise/">Enterprise API documentation</a> for more information. | ||
/// </remarks> | ||
public interface IObservableEnterpriseClient | ||
{ | ||
/// <summary> | ||
/// A client for GitHub's Enterprise Admin Stats API | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="http://developer.github.com/v3/enterprise/admin_stats/">Enterprise Admin Stats API documentation</a> for more information. | ||
///</remarks> | ||
IObservableEnterpriseAdminStatsClient AdminStats { get; } | ||
} | ||
} |
155 changes: 155 additions & 0 deletions
155
Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseAdminStatsClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
using System; | ||
using System.Reactive.Threading.Tasks; | ||
|
||
namespace Octokit.Reactive | ||
{ | ||
/// <summary> | ||
/// A client for GitHub's Enterprise Admin Stats API | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="https://developer.github.com/v3/enterprise/admin_stats/">Enterprise Admin Stats API documentation</a> for more information. | ||
///</remarks> | ||
public class ObservableEnterpriseAdminStatsClient : IObservableEnterpriseAdminStatsClient | ||
{ | ||
readonly IEnterpriseAdminStatsClient _client; | ||
|
||
public ObservableEnterpriseAdminStatsClient(IGitHubClient client) | ||
{ | ||
Ensure.ArgumentNotNull(client, "client"); | ||
|
||
_client = client.Enterprise.AdminStats; | ||
} | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Issue statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsIssues"/> statistics.</returns> | ||
public IObservable<AdminStatsIssues> GetStatisticsIssues() | ||
{ | ||
return _client.GetStatisticsIssues().ToObservable(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Hook statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsHooks"/> statistics.</returns> | ||
public IObservable<AdminStatsHooks> GetStatisticsHooks() | ||
{ | ||
return _client.GetStatisticsHooks().ToObservable(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Milestone statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsMilestones"/> statistics.</returns> | ||
public IObservable<AdminStatsMilestones> GetStatisticsMilestones() | ||
{ | ||
return _client.GetStatisticsMilestones().ToObservable(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Organization statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsOrgs"/> statistics.</returns> | ||
public IObservable<AdminStatsOrgs> GetStatisticsOrgs() | ||
{ | ||
return _client.GetStatisticsOrgs().ToObservable(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Comment statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsComments"/> statistics.</returns> | ||
public IObservable<AdminStatsComments> GetStatisticsComments() | ||
{ | ||
return _client.GetStatisticsComments().ToObservable(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Pages statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsPages"/> statistics.</returns> | ||
public IObservable<AdminStatsPages> GetStatisticsPages() | ||
{ | ||
return _client.GetStatisticsPages().ToObservable(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise User statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsUsers"/> statistics.</returns> | ||
public IObservable<AdminStatsUsers> GetStatisticsUsers() | ||
{ | ||
return _client.GetStatisticsUsers().ToObservable(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Gist statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsGists"/> statistics.</returns> | ||
public IObservable<AdminStatsGists> GetStatisticsGists() | ||
{ | ||
return _client.GetStatisticsGists().ToObservable(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise PullRequest statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsPulls"/> statistics.</returns> | ||
public IObservable<AdminStatsPulls> GetStatisticsPulls() | ||
{ | ||
return _client.GetStatisticsPulls().ToObservable(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise Repository statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStatsRepos"/> statistics.</returns> | ||
public IObservable<AdminStatsRepos> GetStatisticsRepos() | ||
{ | ||
return _client.GetStatisticsRepos().ToObservable(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets GitHub Enterprise statistics (must be Site Admin user). | ||
/// </summary> | ||
/// <remarks> | ||
/// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics | ||
/// </remarks> | ||
/// <returns>The <see cref="AdminStats"/> collection of statistics.</returns> | ||
public IObservable<AdminStats> GetStatisticsAll() | ||
{ | ||
return _client.GetStatisticsAll().ToObservable(); | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace Octokit.Reactive | ||
{ | ||
/// <summary> | ||
/// A client for GitHub's Enterprise API. | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="http://developer.github.com/v3/enterprise/">Enterprise API documentation</a> for more information. | ||
/// </remarks> | ||
public class ObservableEnterpriseClient : IObservableEnterpriseClient | ||
{ | ||
public ObservableEnterpriseClient(IGitHubClient client) | ||
{ | ||
Ensure.ArgumentNotNull(client, "client"); | ||
|
||
AdminStats = new ObservableEnterpriseAdminStatsClient(client); | ||
} | ||
|
||
/// <summary> | ||
/// A client for GitHub's Enterprise Admin Stats API | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="http://developer.github.com/v3/enterprise/admin_stats/">Enterprise Admin Stats API documentation</a> for more information. | ||
///</remarks> | ||
public IObservableEnterpriseAdminStatsClient AdminStats { get; private set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.