Module Gitlab::Client::Users
In: lib/gitlab/client/users.rb

Methods

Public Instance methods

Creates a new email Will create a new email an authorized user if no user ID passed.

@example

  Gitlab.add_email('email@example.com')
  Gitlab.add_email('email@example.com', 2)

@param [String] email Email address @param [Integer] user_id The ID of a user. @return [Gitlab::ObjectifiedHash]

Blocks the specified user. Available only for admin.

@example

  Gitlab.block_user(15)

@param [Integer] user_id The Id of user @return [Boolean] success or not

Creates a new SSH key.

@example

  Gitlab.create_ssh_key('key title', 'key body')

@param [String] title The title of an SSH key. @param [String] key The SSH key body. @return [Gitlab::ObjectifiedHash] Information about created SSH key.

Creates a new user. Requires authentication from an admin account.

@example

  Gitlab.create_user('joe@foo.org', 'secret', 'joe', { name: 'Joe Smith' })
  or
  Gitlab.create_user('joe@foo.org', 'secret')

@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] options A customizable set of options. @option options [String] :name The name of a user. Defaults to email. @option options [String] :skype The skype of a user. @option options [String] :linkedin The linkedin of a user. @option options [String] :twitter The twitter of a user. @option options [Integer] :projects_limit The limit of projects for a user. @return [Gitlab::ObjectifiedHash] Information about created user.

Delete email Will delete a email an authorized user if no user ID passed.

@example

  Gitlab.delete_email(2)
  Gitlab.delete_email(3, 2)

@param [Integer] id Email address ID @param [Integer] user_id The ID of a user. @return [Boolean]

Deletes an SSH key.

@example

  Gitlab.delete_ssh_key(1)

@param [Integer] id The ID of a user‘s SSH key. @return [Gitlab::ObjectifiedHash] Information about deleted SSH key.

Deletes a user.

@example

  Gitlab.delete_user(1)

@param [Integer] id The ID of a user. @return [Gitlab::ObjectifiedHash] Information about deleted user.

Updates a user.

@example

  Gitlab.edit_user(15, { email: 'joe.smith@foo.org', projects_limit: 20 })

@param [Integer] id The ID of a user. @param [Hash] options A customizable set of options. @option options [String] :email The email of a user. @option options [String] :password The password of a user. @option options [String] :name The name of a user. Defaults to email. @option options [String] :skype The skype of a user. @option options [String] :linkedin The linkedin of a user. @option options [String] :twitter The twitter of a user. @option options [Integer] :projects_limit The limit of projects for a user. @return [Gitlab::ObjectifiedHash] Information about created user.

Get a single email.

@example

  Gitlab.email(3)

@param [Integer] id The ID of a email. @return [Gitlab::ObjectifiedHash]

Gets user emails. Will return emails an authorized user if no user ID passed.

@example

  Gitlab.emails
  Gitlab.emails(2)

@param [Integer] user_id The ID of a user. @return [Gitlab::ObjectifiedHash]

Creates a new user session.

@example

  Gitlab.session('jack@example.com', 'secret12345')

@param [String] email The email of a user. @param [String] password The password of a user. @return [Gitlab::ObjectifiedHash] @note This method doesn‘t require private_token to be set.

Gets information about SSH key.

@example

  Gitlab.ssh_key(1)

@param [Integer] id The ID of a user‘s SSH key. @return [Gitlab::ObjectifiedHash]

Gets a list of user‘s SSH keys.

@example

  Gitlab.ssh_keys

@param [Hash] options A customizable set of options. @option options [Integer] :page The page number. @option options [Integer] :per_page The number of results per page. @return [Array<Gitlab::ObjectifiedHash>]

Unblocks the specified user. Available only for admin.

@example

  Gitlab.unblock_user(15)

@param [Integer] user_id The Id of user @return [Boolean] success or not

Gets information about a user. Will return information about an authorized user if no ID passed.

@example

  Gitlab.user
  Gitlab.user(2)

@param [Integer] id The ID of a user. @return [Gitlab::ObjectifiedHash]

Search for groups by name

@example

  Gitlab.user_search('gitlab')

@param [String] search A string to search for in user names and paths. @param [Hash] options A customizable set of options. @option options [String] :per_page Number of user to return per page @option options [String] :page The page to retrieve @return [Array<Gitlab::ObjectifiedHash>]

Gets a list of users.

@example

  Gitlab.users

@param [Hash] options A customizable set of options. @option options [Integer] :page The page number. @option options [Integer] :per_page The number of results per page. @return [Array<Gitlab::ObjectifiedHash>]

[Validate]