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
|
# frozen_string_literal: true
module Octokit
class EnterpriseAdminClient
# Methods for the Enterprise Admin Stats API
#
# @see https://developer.github.com/v3/enterprise-admin/admin_stats/
module AdminStats
# Get all available stats
#
# @return [Sawyer::Resource] All available stats
# @example Get all available stats
# @client.admin_stats
def admin_stats
get_admin_stats 'all'
end
# Get only repository-related stats
#
# @return [Sawyer::Resource] Only repository-related stats
# @example Get only repository-related stats
# @client.admin_repository_stats
def admin_repository_stats
get_admin_stats 'repos'
end
# Get only hooks-related stats
#
# @return [Sawyer::Resource] Only hooks-related stats
# @example Get only hooks-related stats
# @client.admin_hooks_stats
def admin_hooks_stats
get_admin_stats 'hooks'
end
# Get only pages-related stats
#
# @return [Sawyer::Resource] Only pages-related stats
# @example Get only pages-related stats
# @client.admin_pages_stats
def admin_pages_stats
get_admin_stats 'pages'
end
# Get only organization-related stats
#
# @return [Sawyer::Resource] Only organization-related stats
# @example Get only organization-related stats
# @client.admin_organization_stats
def admin_organization_stats
get_admin_stats 'orgs'
end
# Get only user-related stats
#
# @return [Sawyer::Resource] Only user-related stats
# @example Get only user-related stats
# @client.admin_users_stats
def admin_users_stats
get_admin_stats 'users'
end
# Get only pull request-related stats
#
# @return [Sawyer::Resource] Only pull request-related stats
# @example Get only pull request-related stats
# @client.admin_pull_requests_stats
def admin_pull_requests_stats
get_admin_stats 'pulls'
end
# Get only issue-related stats
#
# @return [Sawyer::Resource] Only issue-related stats
# @example Get only issue-related stats
# @client.admin_issues_stats
def admin_issues_stats
get_admin_stats 'issues'
end
# Get only milestone-related stats
#
# @return [Sawyer::Resource] Only milestone-related stats
# @example Get only milestone-related stats
# @client.admin_milestones_stats
def admin_milestones_stats
get_admin_stats 'milestones'
end
# Get only gist-related stats
#
# @return [Sawyer::Resource] Only only gist-related stats
# @example Get only gist-related stats
# @client.admin_gits_stats
def admin_gists_stats
get_admin_stats 'gists'
end
# Get only comment-related stats
#
# @return [Sawyer::Resource] Only comment-related stats
# @example Get only comment-related stats
# @client.admin_comments_stats
def admin_comments_stats
get_admin_stats 'comments'
end
private
# @private Get enterprise stats
#
# @param metric [String] The metrics you are looking for
# @return [Sawyer::Resource] Magical unicorn stats
def get_admin_stats(metric)
get "enterprise/stats/#{metric}"
end
end
end
end
|