123456789_123456789_123456789_123456789_123456789_

Class: Octokit::EnterpriseAdminClient

Overview

EnterpriseAdminClient is only meant to be used by GitHub Enterprise Admins and provides access the Admin only API endpoints including Admin Stats, Management Console, and the Search Indexing API.

Constant Summary

Authentication - Included

FARADAY_BASIC_AUTH_KEYS

Connection - Included

CONVENIENCE_HEADERS

Class Method Summary

Instance Attribute Summary

Authentication - Included

#application_authenticated?

Indicates if the client has OAuth Application client_id and secret credentials to make anonymous requests at a higher rate limit.

#basic_authenticated?

Indicates if the client was supplied Basic Auth username and password.

#bearer_authenticated?

Indicates if the client was supplied a bearer token.

#token_authenticated?

Indicates if the client was supplied an OAuth access token.

#user_authenticated?

Indicates if the client was supplied an OAuth access token or Basic Auth username and password.

Configurable - Included

Instance Method Summary

Users - Included

#create_impersonation_token

Creates an impersonation OAuth token.

#create_user

Create a new user.

#delete_impersonation_token

Deletes an impersonation OAuth token.

#delete_key

Deletes a public SSH keys.

#delete_user

Deletes a user.

#demote

Demote a site administrator to an ordinary user.

#list_all_keys

Lists all the public SSH keys.

#promote

Promote an ordinary user to a site administrator.

#rename_user

Rename a user.

#suspend

Suspend a user.

#unsuspend

Unsuspend a user.

SearchIndexing - Included

#index_organization
#index_organizations_repositories
#index_organizations_repositories_code
#index_organizations_repositories_issues
#index_repository

Queue a Repository to be indexed.

#index_repository_code

Queue a repository's code to be indexed.

#index_repository_issues

Queue a repository's Issues to be indexed.

#index_user

Queue a User or Organization to be indexed.

#index_users_repositories

Queue a user's or organization's repositories to be indexed.

#index_users_repositories_code

Queue an index of all the code contained in all of a user's or organization's repositories.

#index_users_repositories_issues

Queue an index of all the issues across all of a user's or organization's repositories.

#queue_index

Orgs - Included

#create_organization

Create a new organization on the instance.

License - Included

#license_info

Get information about the Enterprise license.

AdminStats - Included

#admin_comments_stats

Get only comment-related stats.

#admin_gists_stats

Get only gist-related stats.

#admin_hooks_stats

Get only hooks-related stats.

#admin_issues_stats

Get only issue-related stats.

#admin_milestones_stats

Get only milestone-related stats.

#admin_organization_stats

Get only organization-related stats.

#admin_pages_stats

Get only pages-related stats.

#admin_pull_requests_stats

Get only pull request-related stats.

#admin_repository_stats

Get only repository-related stats.

#admin_stats

Get all available stats.

#admin_users_stats

Get only user-related stats.

#get_admin_stats

Warnable - Included

#octokit_warn

Wrapper around Kernel#warn to print warnings unless OCTOKIT_SILENT is set to true.

Connection - Included

#agent

Hypermedia agent for the GitHub API.

#delete

Make a HTTP DELETE request.

#get

Make a HTTP GET request.

#head

Make a HTTP HEAD request.

#last_response

Response for last HTTP request.

#paginate

Make one or more HTTP GET requests, optionally fetching the next page of results from URL in Link response header based on value in #auto_paginate.

#patch

Make a HTTP PATCH request.

#post

Make a HTTP POST request.

#put

Make a HTTP PUT request.

#root

Fetch the root resource for the API.

#boolean_from_response

Executes the request, checking if it was successful.

#parse_query_and_convenience_headers, #request, #reset_agent, #response_data_correctly_encoded, #sawyer_options

Authentication - Included

Configurable - Included

#configure

Set configuration options using a block.

#reset!

Reset configuration options to default values.

#same_options?

Compares client options to a Hash of requested options.

#setup
#fetch_client_id_and_secret, #options

Constructor Details

.new(options = {}) ⇒ EnterpriseAdminClient

[ GitHub ]

  
# File 'lib/octokit/enterprise_admin_client.rb', line 30

def initialize(options = {})
  # Use options passed in, but fall back to module defaults
  #
  # rubocop:disable Style/HashEachMethods
  #
  # This may look like a `.keys.each` which should be replaced with `#each_key`, but
  # this doesn't actually work, since `#keys` is just a method we've defined ourselves.
  # The class doesn't fulfill the whole `Enumerable` contract.
  Octokit::Configurable.keys.each do |key|
    # rubocop:enable Style/HashEachMethods
    instance_variable_set(:"@#{key}", options[key] || Octokit.instance_variable_get(:"@#{key}"))
  end

   unless user_authenticated? || application_authenticated?
end