Module: BWAPI::Client::Projects::Group::LocationGroup

Included in:
BWAPI::Client::Projects::Group
Defined in:
lib/bwapi/client/projects/group/location_group.rb

Overview

LocationGroup module for projects/group/location endpoints

Instance Method Summary collapse

Instance Method Details

#create_location_group(project_id, opts = {}) ⇒ Hashie::Mash

Create a new location group in project

Parameters:

  • project_id (Integer) —

    Id of project

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

    options hash of parameters

Options Hash (opts):

  • name (String) —

    The human readable name for the group

  • userId (Integer) —

    The id of the creating user

  • sharedProjectIds (Array) —

    The ids of the shared projects

  • shared (String) —

    The type of sharing for the group

  • location (Array) —

    The location in the group

Returns:

  • (Hashie::Mash) —

    New location group



35
36
37
# File 'lib/bwapi/client/projects/group/location_group.rb', line 35

def create_location_group project_id, opts={}
  post "projects/#{project_id}/group/location", opts
end

#delete_location_group(project_id, location_group_id) ⇒ Hashie::Mash

Delete an existing location group project

Parameters:

  • project_id (Integer) —

    Id of project

  • location_group_id (Integer) —

    Id of location group

Returns:

  • (Hashie::Mash) —

    Deleted location group



60
61
62
# File 'lib/bwapi/client/projects/group/location_group.rb', line 60

def delete_location_group project_id, location_group_id
  delete "projects/#{project_id}/group/location/#{location_group_id}"
end

#get_location_group(project_id, location_group_id) ⇒ Hashie::Mash Also known as: location_group

Get a specific location group in project

Parameters:

  • project_id (Integer) —

    Id of project

  • location_group_id (Integer) —

    Id of location group

Returns:

  • (Hashie::Mash) —

    Specific location group



20
21
22
# File 'lib/bwapi/client/projects/group/location_group.rb', line 20

def get_location_group project_id, location_group_id
  get "projects/#{project_id}/group/location/#{location_group_id}"
end

#location_groups_summary(project_id, opts = {}) ⇒ Hashie::Mash

Get summary of all location groups in project

Parameters:

  • project_id (Integer) —

    Id of project

Returns:

  • (Hashie::Mash) —

    Summary of all location groups in project



11
12
13
# File 'lib/bwapi/client/projects/group/location_group.rb', line 11

def location_groups_summary project_id, opts={}
  get "projects/#{project_id}/group/location/summary", opts
end

#update_location_group(project_id, location_group_id, opts = {}) ⇒ Hashie::Mash

Update an existing location group in project

Parameters:

  • project_id (Integer) —

    Id of project

  • location_group_id (Integer) —

    Id of location group

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

    options hash of parameter

Options Hash (opts):

  • id (Integer) —

    The id of the group

  • name (String) —

    The human readable name for the group

  • userId (Integer) —

    The id of the creating user

  • sharedProjectIds (Array) —

    The ids of the shared projects

  • shared (String) —

    The type of sharing for the group

  • location (Array) —

    The location in the group

Returns:

  • (Hashie::Mash) —

    Updated location group



51
52
53
# File 'lib/bwapi/client/projects/group/location_group.rb', line 51

def update_location_group project_id, location_group_id, opts={}
  put "projects/#{project_id}/group/location/#{location_group_id}", opts
end