Module: BWAPI::Client::Admin::Clients::UserGroups

Included in:
BWAPI::Client::Admin
Defined in:
lib/bwapi/client/admin/clients/user_groups.rb

Overview

UserGroups module for admin/usergroups endpoints

Instance Method Summary collapse

Instance Method Details

#client_user_groups(client_id, opts = {}) ⇒ Hash

Get all user groups

Parameters:

  • client_id (Integer)

    Id of the client

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

    a customizable set of options

Options Hash (opts):

  • page (Integer)

    Page of projects to retrieve

  • pageSize (Integer)

    Results per page of results

Returns:

  • (Hash)

    All client user groups



13
14
15
# File 'lib/bwapi/client/admin/clients/user_groups.rb', line 13

def client_user_groups(client_id, opts = {})
  get "admin/clients/#{client_id}/usergroups", opts
end

#create_client_user_group(client_id, opts = {}) ⇒ Hash

Create new user group

Parameters:

  • client_id (Integer)

    Id of the client

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

    options hash of parameters

Options Hash (opts):

  • startDate (Date)

    Start date of the client

Returns:

  • (Hash)

    New client user group



23
24
25
# File 'lib/bwapi/client/admin/clients/user_groups.rb', line 23

def create_client_user_group(client_id, opts = {})
  post "admin/clients/#{client_id}/usergroups", opts
end

#delete_client_user_group(client_id, user_group_id) ⇒ Hash

Delete specific user group

Parameters:

  • client_id (Integer)

    Id of the client

  • user_group_id (Integer)

    Id of the user group

Returns:

  • (Hash)

    Deleted client user group



41
42
43
# File 'lib/bwapi/client/admin/clients/user_groups.rb', line 41

def delete_client_user_group(client_id, user_group_id)
  delete "admin/clients/#{client_id}/usergroups/#{user_group_id}"
end

#update_client_user_group(client_id, user_group_id, opts = {}) ⇒ Hash

Update existing user group

Parameters:

  • client_id (Integer)

    Id of the client

  • user_group_id (Integer)

    Id of the user group

Returns:

  • (Hash)

    Updated client user group



32
33
34
# File 'lib/bwapi/client/admin/clients/user_groups.rb', line 32

def update_client_user_group(client_id, user_group_id, opts = {})
  put "admin/clients/#{client_id}/usergroups/#{user_group_id}", opts
end