Module: BWAPI::Client::Projects::Group::SiteGroup

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

Overview

SiteGroup module for projects/group/site endpoints

Instance Method Summary collapse

Instance Method Details

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

Create a new site 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

  • sites (Array)

    The sites in the group

Returns:

  • (Hashie::Mash)

    New site group



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

def create_site_group(project_id, opts = {})
  post "projects/#{project_id}/group/site", opts
end

#delete_site_group(project_id, site_group_id) ⇒ Hashie::Mash

Delete an existing site group project

Parameters:

  • project_id (Integer)

    Id of project

  • site_group_id (Integer)

    Id of site group

Returns:

  • (Hashie::Mash)

    Deleted site group



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

def delete_site_group(project_id, site_group_id)
  delete "projects/#{project_id}/group/site/#{site_group_id}"
end

#get_site_group(project_id, site_group_id) ⇒ Hashie::Mash

Get a specific site group in project

Parameters:

  • project_id (Integer)

    Id of project

  • site_group_id (Integer)

    Id of site group

Returns:

  • (Hashie::Mash)

    Specific site group



21
22
23
# File 'lib/bwapi/client/projects/group/site_group.rb', line 21

def get_site_group(project_id, site_group_id)
  get "projects/#{project_id}/group/site/#{site_group_id}"
end

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

Get summary of all site groups in project

Parameters:

  • project_id (Integer)

    Id of project

Returns:

  • (Hashie::Mash)

    Summary of all site groups in project



12
13
14
# File 'lib/bwapi/client/projects/group/site_group.rb', line 12

def site_groups_summary(project_id, opts = {})
  get "projects/#{project_id}/group/site/summary", opts
end

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

Update an existing site group in project

Parameters:

  • project_id (Integer)

    Id of project

  • site_group_id (Integer)

    Id of site 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

  • sites (Array)

    The sites in the group

Returns:

  • (Hashie::Mash)

    Updated site group



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

def update_site_group(project_id, site_group_id, opts = {})
  put "projects/#{project_id}/group/site/#{site_group_id}", opts
end