Module: BWAPI::Client::Admin::Clients::Users

Includes:
Sharing
Included in:
BWAPI::Client::Admin
Defined in:
lib/bwapi/client/admin/users.rb,
lib/bwapi/client/admin/users/sharing.rb

Defined Under Namespace

Modules: Sharing

Instance Method Summary collapse

Methods included from Sharing

#client_users_sharing, #update_client_users_sharing

Instance Method Details

#client_users(id, opts = {}) ⇒ Hashie::Mash

Get all users for client

Parameters:

  • id (Integer)

    Id of the client

  • opts (Hash) (defaults to: {})

    options hash of parameters

Options Hash (opts):

  • page (Integer)

    Page of projects to retrieve

  • pageSize (Integer)

    Results per page of results

Returns:

  • (Hashie::Mash)

    All client users



16
17
18
# File 'lib/bwapi/client/admin/users.rb', line 16

def client_users id, opts={}
  get "admin/clients/#{id}/users", opts
end

#create_client_user(id, opts) ⇒ Hashie::Mash Also known as: create_user

Create a new client user

Parameters:

  • id (Integer)

    Id of the client

  • opts (Hash)

    options Hash of parameters

Options Hash (opts):

  • id (Integer)

    Id of the user

  • tags (Hash)

    The users assigned tags

  • passwordConfirmation (String)

    The confirmed password

  • enabled (Boolean)

    The status of the user

  • lastName (String)

    The last name of the user

  • phone (String)

    The users phone number

  • department (String)

    The users department

  • job (String)

    The users job

  • messenger (String)

    The users IM details

  • password (String)

    The password of the user

  • clientId (Integer)

    The users client id

  • username (String)

    The users username

  • address (String)

    The users address

  • uiRole (String)

    The users ui role

  • apiRole (Array)

    The users api role

  • firstName (String)

    The users first name

  • mobile (String)

    The users mobile number

  • creationDate (Date)

    Date the user was created on

Returns:

  • (Hashie::Mash)

    New user



54
55
56
# File 'lib/bwapi/client/admin/users.rb', line 54

def create_client_user id, opts
  post "admin/clients/#{id}/users", opts
end

#get_client_user(client_id, user_id) ⇒ Hashie::Mash Also known as: get_user

Get a specific user in client

Parameters:

  • client_id (Integer)

    Id of the client

  • user_id (Integer)

    Id of the user

Returns:

  • (Hashie::Mash)

    Specific client user



25
26
27
# File 'lib/bwapi/client/admin/users.rb', line 25

def get_client_user client_id, user_id
  get "admin/clients/#{client_id}/users/#{user_id}"
end

#update_client_user(client_id, user_id, opts) ⇒ Hashie::Mash Also known as: update_user

Update an existing client user

Parameters:

  • client_id (Integer)

    Id of the client

  • user_id (Integer)

    Id of the user

  • opts (Hash)

    options Hash of parameters

Options Hash (opts):

  • id (Integer)

    Id of the user

  • tags (Hash)

    The users assigned tags

  • passwordConfirmation (String)

    The confirmed password

  • enabled (Boolean)

    The status of the user

  • lastName (String)

    The last name of the user

  • phone (String)

    The users phone number

  • department (String)

    The users department

  • job (String)

    The users job

  • messenger (String)

    The users IM details

  • password (String)

    The password of the user

  • clientId (Integer)

    The users client id

  • username (String)

    The users username

  • address (String)

    The users address

  • uiRole (String)

    The users ui role

  • apiRole (Array)

    The users api role

  • firstName (String)

    The users first name

  • mobile (String)

    The users mobile number

  • creationDate (Date)

    Date the user was created on

Returns:

  • (Hashie::Mash)

    New user



83
84
85
# File 'lib/bwapi/client/admin/users.rb', line 83

def update_client_user client_id, user_id, opts
  put "admin/clients/#{client_id}/users/#{user_id}", opts
end