Module: Sonarqube::Client::Users
- Included in:
- Sonarqube::Client
- Defined in:
- lib/sonarqube/client/users.rb
Overview
Defines methods related to users.
Instance Method Summary collapse
-
#change_password_user(login, password, old_password = nil, options = {}) ⇒ Object
(also: #user_change_password)
Change password the specified user.
-
#create_user(login, name, password = nil, options = {}) ⇒ Sonarqube::ObjectifiedHash
(also: #user_create)
Creates a new user.
-
#deactivate_user(login, options = {}) ⇒ Object
(also: #user_deactivate)
Blocks the specified user.
-
#groups_user(login, options = {}) ⇒ Array<Sonarqube::ObjectifiedHash>
(also: #user_groups)
Lists the groups a user belongs to.
-
#update_login_user(login, new_login, options = {}) ⇒ Sonarqube::ObjectifiedHash
(also: #user_update_login)
Update login user.
-
#update_user(login, options = {}) ⇒ Sonarqube::ObjectifiedHash
(also: #user_update)
Updates a user.
-
#users_search(options = {}) ⇒ Array<Sonarqube::ObjectifiedHash>
(also: #search_users)
Gets a list of users.
Instance Method Details
#change_password_user(login, password, old_password = nil, options = {}) ⇒ Object Also known as: user_change_password
Change password the specified user. Available only for admin.
87 88 89 90 91 |
# File 'lib/sonarqube/client/users.rb', line 87 def change_password_user(login, password, old_password = nil, = {}) body = { login: login, password: password } body = { old_password: old_password }.merge!(body) unless old_password.nil? post('/api/users/change_password', body: body.merge!()) end |
#create_user(login, name, password = nil, options = {}) ⇒ Sonarqube::ObjectifiedHash Also known as: user_create
Creates a new user. Requires authentication from an admin account.
41 42 43 44 45 |
# File 'lib/sonarqube/client/users.rb', line 41 def create_user(login, name, password = nil, = {}) body = { login: login, password: password, name: name } body.merge!() post('/api/users/create', body: body) end |
#deactivate_user(login, options = {}) ⇒ Object Also known as: user_deactivate
Blocks the specified user. Available only for admin.
72 73 74 |
# File 'lib/sonarqube/client/users.rb', line 72 def deactivate_user(login, = {}) post('/api/users/deactivate', body: { login: login }.merge!()) end |
#groups_user(login, options = {}) ⇒ Array<Sonarqube::ObjectifiedHash> Also known as: user_groups
Lists the groups a user belongs to.
119 120 121 |
# File 'lib/sonarqube/client/users.rb', line 119 def groups_user(login, = {}) get('/api/users/groups', query: { login: login }.merge!()) end |
#update_login_user(login, new_login, options = {}) ⇒ Sonarqube::ObjectifiedHash Also known as: user_update_login
Update login user.
103 104 105 |
# File 'lib/sonarqube/client/users.rb', line 103 def update_login_user(login, new_login, = {}) post('/api/users/update_login', body: { login: login, newLogin: new_login }.merge!()) end |
#update_user(login, options = {}) ⇒ Sonarqube::ObjectifiedHash Also known as: user_update
Updates a user.
60 61 62 |
# File 'lib/sonarqube/client/users.rb', line 60 def update_user(login, = {}) post('/api/users/update', body: { login: login }.merge!()) end |
#users_search(options = {}) ⇒ Array<Sonarqube::ObjectifiedHash> Also known as: search_users
Gets a list of users.
19 20 21 |
# File 'lib/sonarqube/client/users.rb', line 19 def users_search( = {}) get('/api/users/search', query: ) end |