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

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

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



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

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



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

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



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

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



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

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