-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
EnterpriseAdminStatsClient.cs
182 lines (159 loc) · 6.98 KB
/
EnterpriseAdminStatsClient.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
using System.Threading.Tasks;
namespace Octokit
{
/// <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 EnterpriseAdminStatsClient : ApiClient, IEnterpriseAdminStatsClient
{
public EnterpriseAdminStatsClient(IApiConnection apiConnection)
: base(apiConnection)
{ }
/// <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>
[ManualRoute("GET", "/enterprise/stats/issues")]
public Task<AdminStatsIssues> GetStatisticsIssues()
{
var endpoint = ApiUrls.EnterpriseAdminStatsIssues();
return ApiConnection.Get<AdminStatsIssues>(endpoint);
}
/// <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>
[ManualRoute("GET", "/enterprise/stats/hooks")]
public Task<AdminStatsHooks> GetStatisticsHooks()
{
var endpoint = ApiUrls.EnterpriseAdminStatsHooks();
return ApiConnection.Get<AdminStatsHooks>(endpoint);
}
/// <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>
[ManualRoute("GET", "/enterprise/stats/milestones")]
public Task<AdminStatsMilestones> GetStatisticsMilestones()
{
var endpoint = ApiUrls.EnterpriseAdminStatsMilestones();
return ApiConnection.Get<AdminStatsMilestones>(endpoint);
}
/// <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>
[ManualRoute("GET", "/enterprise/stats/orgs")]
public Task<AdminStatsOrgs> GetStatisticsOrgs()
{
var endpoint = ApiUrls.EnterpriseAdminStatsOrgs();
return ApiConnection.Get<AdminStatsOrgs>(endpoint);
}
/// <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>
[ManualRoute("GET", "/enterprise/stats/comments")]
public Task<AdminStatsComments> GetStatisticsComments()
{
var endpoint = ApiUrls.EnterpriseAdminStatsComments();
return ApiConnection.Get<AdminStatsComments>(endpoint);
}
/// <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>
[ManualRoute("GET", "/enterprise/stats/pages")]
public Task<AdminStatsPages> GetStatisticsPages()
{
var endpoint = ApiUrls.EnterpriseAdminStatsPages();
return ApiConnection.Get<AdminStatsPages>(endpoint);
}
/// <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>
[ManualRoute("GET", "/enterprise/stats/users")]
public Task<AdminStatsUsers> GetStatisticsUsers()
{
var endpoint = ApiUrls.EnterpriseAdminStatsUsers();
return ApiConnection.Get<AdminStatsUsers>(endpoint);
}
/// <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>
[ManualRoute("GET", "/enterprise/stats/comments")]
public Task<AdminStatsGists> GetStatisticsGists()
{
var endpoint = ApiUrls.EnterpriseAdminStatsGists();
return ApiConnection.Get<AdminStatsGists>(endpoint);
}
/// <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>
[ManualRoute("GET", "/enterprise/stats/pulls")]
public Task<AdminStatsPulls> GetStatisticsPulls()
{
var endpoint = ApiUrls.EnterpriseAdminStatsPulls();
return ApiConnection.Get<AdminStatsPulls>(endpoint);
}
/// <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>
[ManualRoute("GET", "/enterprise/stats/repos")]
public Task<AdminStatsRepos> GetStatisticsRepos()
{
var endpoint = ApiUrls.EnterpriseAdminStatsRepos();
return ApiConnection.Get<AdminStatsRepos>(endpoint);
}
/// <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>
[ManualRoute("GET", "/enterprise/stats/all")]
public Task<AdminStats> GetStatisticsAll()
{
var endpoint = ApiUrls.EnterpriseAdminStatsAll();
return ApiConnection.Get<AdminStats>(endpoint);
}
}
}