module BWAPI::Client::Projects::Categories

Categories module for projects/categories endpoints

Public Instance Methods

categories(project_id, opts = {}) click to toggle source

Get all categories in project

@param project_id [Integer] Id of project @param opts [Hash] options hash of parameters @option opts [Integer] page Page of projects to retrieve @option opts [Integer] pageSize Results per page of results @return [Hash] All categories in project

# File lib/bwapi/client/projects/categories.rb, line 15
def categories(project_id, opts = {})
  get "projects/#{project_id}/categories", opts
end
create_category(project_id, opts = {}) click to toggle source

Create a new category in project

@param project_id [Integer] Id of project @param opts [Hash] options hash of parameters @option opts [Integer] id Id of the category @option opts [String] name Name of the category @option opts [Array] children The children of the category @option opts [Boolean] multiple Whether multiple sub categories can be selected @return [Hash] New category

# File lib/bwapi/client/projects/categories.rb, line 28
def create_category(project_id, opts = {})
  post "projects/#{project_id}/categories", opts
end
delete_category(project_id, category_id) click to toggle source

Delete and existing category in project

@param project_id [Integer] Id of project @param category_id [Integer] Id of query group @return [Hash] Deleted category

# File lib/bwapi/client/projects/categories.rb, line 51
def delete_category(project_id, category_id)
  delete "projects/#{project_id}/categories/#{category_id}"
end
update_category(project_id, category_id, opts = {}) click to toggle source

Update an existing category in project

@param project_id [Integer] Id of project @param category_id [Integer] Id of category @param opts [Hash] options hash of parameters @option opts [Integer] id Id of the category @option opts [String] name Name of the category @option opts [Array] children The children of the category @option opts [Boolean] multiple Whether multiple sub categories can be selected @return [Hash] Updated category

# File lib/bwapi/client/projects/categories.rb, line 42
def update_category(project_id, category_id, opts = {})
  put "projects/#{project_id}/categories/#{category_id}", opts
end