module Gitlab::Client::User
Overview
Defines methods related to users.
See http://docs.gitlab.com/ce/api/users.html
Direct including types
Defined in:
gitlab/client/user.crInstance Method Summary
-
#add_email(user_id : Int32, email) : JSON::Any
Creates a new email for a user.
-
#add_email(email) : JSON::Any
Creates a new email for current user.
-
#block_user(user_id : Int32) : JSON::Any
Blocks the specified user.
-
#create_ssh_key(user_id, title, key) : JSON::Any
Creates a new SSH key for a user.
-
#create_ssh_key(title, key) : JSON::Any
Creates a new SSH key for current user.
-
#create_user(email : String, password : String, username : String, form : Hash = {} of String => String) : JSON::Any
Creates a new user.
-
#delete_email(email_id : Int32, user_id : Int32) : JSON::Any
Delete email for current user
-
#delete_email(email_id : Int32) : JSON::Any
Delete email for current user
-
#delete_ssh_key(user_id : Int32, ssh_key_id : Int32) : JSON::Any
Deletes an SSH key for a user.
-
#delete_ssh_key(ssh_key_id : Int32) : JSON::Any
Deletes an SSH key for current user.
-
#delete_user(user_id : Int32) : JSON::Any
Deletes a user.
-
#edit_user(user_id : Int32, form : Hash = {} of String => String) : JSON::Any
Updates a user.
-
#email(email_id : Int32) : JSON::Any
Get a single email.
-
#emails(user_id : Int32) : JSON::Any
Gets a user emails.
-
#emails : JSON::Any
Gets current user emails.
-
#ssh_key(ssh_key_id : Int32) : JSON::Any
Gets information about SSH key.
-
#ssh_keys(user_id : Int32) : JSON::Any
Gets a list of a user"s SSH keys.
-
#ssh_keys : JSON::Any
Gets a list of current user"s SSH keys.
-
#unblock_user(user_id : Int32) : JSON::Any
Unblocks the specified user.
-
#user(user_id : Int32) : JSON::Any
Gets information about a user.
-
#user : JSON::Any
Gets information about current user.
-
#user_search(query, params : Hash = {} of String => String) : JSON::Any
Search for user by name
-
#users(params : Hash | Nil = nil) : JSON::Any
Gets a list of users.
Instance Method Detail
Creates a new email for a user.
- params [Int32] user_id The ID of a user.
- params [String] email Email address
- return [JSON::Any]
client.add_email('[email protected]', 2)
Creates a new email for current user.
- params [String] email Email address
- return [JSON::Any]
client.add_email('[email protected]')
Blocks the specified user.
Available only for admin.
- param [Int32] user_id The Id of user
- return [JSON::Any] success or not
client.block_user(4)
Creates a new SSH key for a user.
- param [Int32] user_id The Id of user.
- param [String] key The SSH key body.
- return [JSON::Any] Information about created SSH key.
client.create_ssh_key(2, "key title", "key body")
Creates a new SSH key for current user.
- param [String] title The title of an SSH key.
- param [String] key The SSH key body.
- return [JSON::Any] Information about created SSH key.
client.create_ssh_key("key title", "key body")
Creates a new user. Requires authentication from an admin account.
- param [String] email The email of a user.
- param [String] password The password of a user.
- param [String] username The username of a user.
- param [Hash] form A customizable set of form.
- option form [String] :name The name of a user. Defaults to email.
- option form [String] :skype The skype of a user.
- option form [String] :linkedin The linkedin of a user.
- option form [String] :twitter The twitter of a user.
- option form [Int32] :projects_limit The limit of projects for a user.
- return [JSON::Any] Information about created user.
Gitlab.create_user("[email protected]", "secret", "icyleaf", {"name" => "三火"})
Gitlab.create_user("[email protected]", "secret", "icyleaf")
Delete email for current user
- params [Int32] user_id The ID of a user.
- params [Int32] email_id Email address ID
- return [JSON::Any]
client.delete_email(1, 2)
Delete email for current user
- params [Int32] email_id Email address ID
- return [JSON::Any]
client.delete_email(2)
Deletes an SSH key for a user.
- param [Int32] user_id The Id of user.
- param [Int32] ssh_key_id The ID of a user"s SSH key.
- return [JSON::Any] Information about deleted SSH key.
client.delete_ssh_key(1, 1)
Deletes an SSH key for current user.
- param [Int32] ssh_key_id The ID of a user"s SSH key.
- return [JSON::Any] Information about deleted SSH key.
client.delete_ssh_key(1)
Deletes a user.
- param [Int32] user_id The ID of a user.
- return [JSON::Any] Information about deleted user.
client.delete_user(1)
Updates a user.
- param [Int32] id The ID of a user.
- param [Hash] params A customizable set of params.
- option params [String] :email The email of a user.
- option params [String] :password The password of a user.
- option params [String] :name The name of a user. Defaults to email.
- option params [String] :skype The skype of a user.
- option params [String] :linkedin The linkedin of a user.
- option params [String] :twitter The twitter of a user.
- option params [String] :projects_limit The limit of projects for a user.
- return [JSON::Any] Information about edit user.
client.edit_user(4, {"email" => "[email protected]", "projects_limit" => "100"})
Get a single email.
- param [Int32] email_id The ID of a email.
- return [JSON::Any]
client.email(3)
Gets a user emails.
- param [Int32] user_id The ID of a user.
- return [JSON::Any]
client.emails(2)
Gets information about SSH key.
- param [Int32] ssh_key_id The ID of a user"s SSH key.
- return [JSON::Any]
client.ssh_key(1)
Gets a list of a user"s SSH keys.
- param [Int32] user_id The Id of user.
- return [JSON::Any]
client.ssh_keys(4)
Gets a list of current user"s SSH keys.
- return [JSON::Any]
client.ssh_keys
Unblocks the specified user.
Available only for admin.
- param [Int32] user_id The Id of user
- return [JSON::Any] success or not
client.unblock_user(4)
Gets information about a user.
- param [Int32] user_id The ID of a user.
- return [JSON::Any]
client.user(2)
Search for user by name
- param [String] query A string to search for in group names and paths.
- param [Hash] params A customizable set of params.
- option params [String] :per_page Number of projects to return per page
- option params [String] :page The page to retrieve
- return [JSON::Any] List of projects under search qyery
client.group_search("icyleaf")
client.group_search("icyleaf", {"per_page" => 50})
Gets a list of users.
- param [Hash] params A customizable set of params.
- option params [String] :page The page number.
- option params [String] :per_page The number of results per page.
- return [JSON::Any]
client.users
client.users({"per_page" => "10", "page" => "2"})