Module: Octokit::EnterpriseAdminClient::Users
- Included in:
- Octokit::EnterpriseAdminClient
- Defined in:
- lib/octokit/enterprise_admin_client/users.rb
Overview
Methods for the Enterprise User Administration API
Instance Method Summary collapse
-
#create_impersonation_token(login, options = {}) ⇒ Object
Creates an impersonation OAuth token.
-
#create_user(login, email, options = {}) ⇒ Object
Create a new user.
-
#delete_impersonation_token(login, options = {}) ⇒ Object
Deletes an impersonation OAuth token.
-
#delete_key(id, options = {}) ⇒ Object
Deletes a public SSH keys.
-
#delete_user(username, options = {}) ⇒ Object
Deletes a user.
-
#demote(user, options = {}) ⇒ Boolean
Demote a site administrator to an ordinary user.
-
#list_all_keys(options = {}) ⇒ Object
Lists all the public SSH keys.
-
#promote(user, options = {}) ⇒ Boolean
Promote an ordinary user to a site administrator.
-
#rename_user(old_login, new_login, options = {}) ⇒ Object
Rename a user.
-
#suspend(user, options = {}) ⇒ Boolean
Suspend a user.
-
#unsuspend(user, options = {}) ⇒ Boolean
Unsuspend a user.
Instance Method Details
#create_impersonation_token(login, options = {}) ⇒ Object
Creates an impersonation OAuth token.
95 96 97 |
# File 'lib/octokit/enterprise_admin_client/users.rb', line 95 def create_impersonation_token(login, = {}) post "admin/users/#{login}/authorizations", end |
#create_user(login, email, options = {}) ⇒ Object
Create a new user.
16 17 18 19 20 |
# File 'lib/octokit/enterprise_admin_client/users.rb', line 16 def create_user(login, email, = {}) [:login] = login [:email] = email post 'admin/users', end |
#delete_impersonation_token(login, options = {}) ⇒ Object
Deletes an impersonation OAuth token.
105 106 107 |
# File 'lib/octokit/enterprise_admin_client/users.rb', line 105 def delete_impersonation_token(login, = {}) boolean_from_response :delete, "admin/users/#{login}/authorizations", end |
#delete_key(id, options = {}) ⇒ Object
Deletes a public SSH keys.
124 125 126 |
# File 'lib/octokit/enterprise_admin_client/users.rb', line 124 def delete_key(id, = {}) boolean_from_response :delete, "admin/keys/#{id}", end |
#delete_user(username, options = {}) ⇒ Object
Deletes a user.
62 63 64 |
# File 'lib/octokit/enterprise_admin_client/users.rb', line 62 def delete_user(username, = {}) boolean_from_response :delete, "admin/users/#{username}", end |
#demote(user, options = {}) ⇒ Boolean
Demote a site administrator to an ordinary user
40 41 42 |
# File 'lib/octokit/enterprise_admin_client/users.rb', line 40 def demote(user, = {}) boolean_from_response :delete, "users/#{user}/site_admin", end |
#list_all_keys(options = {}) ⇒ Object
Lists all the public SSH keys.
114 115 116 |
# File 'lib/octokit/enterprise_admin_client/users.rb', line 114 def list_all_keys( = {}) get 'admin/keys', end |
#promote(user, options = {}) ⇒ Boolean
Promote an ordinary user to a site administrator
29 30 31 |
# File 'lib/octokit/enterprise_admin_client/users.rb', line 29 def promote(user, = {}) boolean_from_response :put, "users/#{user}/site_admin", end |
#rename_user(old_login, new_login, options = {}) ⇒ Object
Rename a user.
51 52 53 54 |
# File 'lib/octokit/enterprise_admin_client/users.rb', line 51 def rename_user(old_login, new_login, = {}) [:login] = new_login patch "admin/users/#{old_login}", end |
#suspend(user, options = {}) ⇒ Boolean
Suspend a user.
73 74 75 |
# File 'lib/octokit/enterprise_admin_client/users.rb', line 73 def suspend(user, = {}) boolean_from_response :put, "users/#{user}/suspended", end |
#unsuspend(user, options = {}) ⇒ Boolean
Unsuspend a user.
84 85 86 |
# File 'lib/octokit/enterprise_admin_client/users.rb', line 84 def unsuspend(user, = {}) boolean_from_response :delete, "users/#{user}/suspended", end |