Module: BWAPI::Client::Projects::Data

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

Overview

Data module for project/data endpoints

Instance Method Summary collapse

Instance Method Details

#data(id, aggregate, dimension_one, dimension_two, opts = {}) ⇒ Hashie::Mash

Get all chart data for the requested dimensions

Parameters:

  • id (Integer)

    Id of project

  • aggregate (String)

    Aggregate value

  • dimension_one (String)

    Dimension 1 value

  • dimension_two (String)

    Dimension 2 value

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

    options hash of parameters

Options Hash (opts):

  • projectId (Integer)

    Id of the project

  • filter (Hash)

    The filters to apply

Returns:

  • (Hashie::Mash)

    All Chart data mentions



17
18
19
# File 'lib/bwapi/client/projects/data.rb', line 17

def data id, aggregate, dimension_one, dimension_two, opts={}
  get "projects/#{id}/data/#{aggregate}/#{dimension_one}/#{dimension_two}", opts
end

#data_date_ranges_days(id, opts) ⇒ Hashie::Mash

Get all chart data for date ranges broken down by days

Parameters:

  • id (Integer)

    Id of project

  • opts (Hash)

    options hash of parameters

Options Hash (opts):

  • projectId (Integer)

    Id of the project

  • filter (Hash)

    The filters to apply

  • dateRanges (Array)

    Date range ids

Returns:

  • (Hashie::Mash)

    All Chart data mentions



29
30
31
# File 'lib/bwapi/client/projects/data.rb', line 29

def data_date_ranges_days id, opts
  get "projects/#{id}/data/volume/dataRanges/days", opts
end

#data_mentions(id, opts = {}) ⇒ Hashie::Mash

Get mentions that fall within the submitted filters

Parameters:

  • id (Integer)

    Id of project

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

    options hash of parameters

Options Hash (opts):

  • projectId (Integer)

    Id of the project

  • filter (Hash)

    The filters to apply

  • page (Integer)

    Page of projects to retrieve

  • pageSize (Integer)

    Results per page of results

  • :orderBy (String)

    Parameter to sort by

  • :orderDirection (String)

    Direction of sort

  • :orderByCategory (Integer)

    Category to sort by when orderBy category

Returns:

  • (Hashie::Mash)

    All Mentions



45
46
47
# File 'lib/bwapi/client/projects/data.rb', line 45

def data_mentions id, opts={}
  get "projects/#{id}/data/mentions", opts
end

#update_data_mentions(id, opts = {}) ⇒ Hashie::Mash

Update mentions for project

Parameters:

  • id (Integer)

    Id of project

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

    options hash of parameters

Options Hash (opts):

  • projectId (Integer)

    Id of the project

  • List (Hash)

    The patches to be applied

Returns:

  • (Hashie::Mash)

    Updated mentions



56
57
58
# File 'lib/bwapi/client/projects/data.rb', line 56

def update_data_mentions id, opts={}
  patch "projects/#{id}/data/mentions", opts
end