Module: BWAPI::Client::Projects::QueryGroups

Included in:
BWAPI::Client::Projects
Defined in:
lib/bwapi/client/projects/query_groups.rb

Overview

QueryGroups module for projects/queryGroups endpoints

Instance Method Summary collapse

Instance Method Details

#create_query_group(project_id, opts = {}) ⇒ Hash

Create a new query group in project

Parameters:

  • project_id (Integer)

    Id of project

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

    options hash of parameters

Options Hash (opts):

  • id (Integer)

    Id of the query group

  • name (String)

    Name of the query group

  • shared (String)

    Shared mode of query group

  • users (Array)

    Users which this query group belongs to

  • queries (Array)

    Queries within the query group

  • sharedProjectIds (Hash)

    Projects which this query group belongs to

Returns:

  • (Hash)

    New query group



36
37
38
# File 'lib/bwapi/client/projects/query_groups.rb', line 36

def create_query_group(project_id, opts = {})
  post "projects/#{project_id}/querygroups", opts
end

#delete_query_group(project_id, query_group_id) ⇒ Hash

Delete an existing query group in project

Parameters:

  • project_id (Integer)

    Id of project

  • query_group_id (Integer)

    Id of query group

Returns:

  • (Hash)

    Deleted query group



61
62
63
# File 'lib/bwapi/client/projects/query_groups.rb', line 61

def delete_query_group(project_id, query_group_id)
  delete "projects/#{project_id}/querygroups/#{query_group_id}"
end

#get_query_group(project_id, query_group_id) ⇒ Hash

Get a specific query group in project

Parameters:

  • project_id (Integer)

    Id of project

  • query_group_id (Integer)

    Id of query group

Returns:

  • (Hash)

    Specific query group



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

def get_query_group(project_id, query_group_id)
  get "projects/#{project_id}/querygroups/#{query_group_id}"
end

#query_groups(project_id, opts = {}) ⇒ Hash

Get all query groups in project

Parameters:

  • project_id (Integer)

    Id of project

  • 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 query groups in project



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

def query_groups(project_id, opts = {})
  get "projects/#{project_id}/querygroups", opts
end

#update_query_group(project_id, query_group_id, opts = {}) ⇒ Hash

Update an existing query group in project

Parameters:

  • project_id (Integer)

    Id of project

  • query_group_id (Integer)

    Id of query group

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

    options hash of parameters

Options Hash (opts):

  • queryGroupId (Integer)

    of the query group

  • name (String)

    Name of the query group

  • shared (String)

    Shared mode of query group

  • users (Array)

    Users which this query group belongs to

  • queries (Array)

    Queries within the query group

  • sharedProjectIds (Hash)

    Projects which this query group belongs to

Returns:

  • (Hash)

    New query group



52
53
54
# File 'lib/bwapi/client/projects/query_groups.rb', line 52

def update_query_group(project_id, query_group_id, opts = {})
  put "projects/#{project_id}/querygroups/#{query_group_id}", opts
end