Module: BWAPI::Client::Projects

Includes:
Categories, Data, DataDownload, FacebookQueries, Queries, QueryGroups, Sharing, Signals, Summary, Tags, Users, Workflow
Included in:
BWAPI::Client
Defined in:
lib/bwapi/client/projects.rb,
lib/bwapi/client/projects/data.rb,
lib/bwapi/client/projects/tags.rb,
lib/bwapi/client/projects/users.rb,
lib/bwapi/client/projects/queries.rb,
lib/bwapi/client/projects/sharing.rb,
lib/bwapi/client/projects/signals.rb,
lib/bwapi/client/projects/summary.rb,
lib/bwapi/client/projects/workflow.rb,
lib/bwapi/client/projects/categories.rb,
lib/bwapi/client/projects/query_groups.rb,
lib/bwapi/client/projects/data_download.rb,
lib/bwapi/client/projects/facebook_queries.rb,
lib/bwapi/client/projects/queries/backfill.rb,
lib/bwapi/client/projects/queries/mentions.rb,
lib/bwapi/client/projects/queries/date_range.rb

Defined Under Namespace

Modules: Categories, Data, DataDownload, FacebookQueries, Queries, QueryGroups, Sharing, Signals, Summary, Tags, Users, Workflow

Instance Method Summary collapse

Methods included from Workflow

#workflow

Methods included from Users

#project_users

Methods included from Tags

#create_tag, #delete_tag, #get_tag, #tags, #update_tag

Methods included from QueryGroups

#create_query_group, #delete_query_group, #get_query_group, #query_groups, #update_query_group

Methods included from Queries

#create_query, #delete_query, #get_query, #queries, #queries_summary, #update_query

Methods included from Queries::Mentions

#delete_query_mention, #get_query_mention_content, #update_query_mention

Methods included from Queries::DateRange

#create_date_range, #date_range, #date_ranges, #delete_date_range, #update_date_range

Methods included from Queries::Backfill

#backfills, #create_backfill, #delete_backfill, #get_backfill

Methods included from Sharing

#default_project_sharing, #project_sharing, #project_sharing_user, #update_project_sharing, #update_project_sharing_user

Methods included from Summary

#projects_summary

Methods included from Signals

#set_signal_vote, #signals

Methods included from FacebookQueries

#facebook_queries, #get_facebook_queries, #update_facebook_query

Methods included from DataDownload

#create_datadownload, #data_downloads, #get_data_download

Methods included from Data

#data, #data_date_ranges_days, #data_mentions, #update_data_mentions

Methods included from Categories

#categories, #create_category, #delete_category, #update_category

Instance Method Details

#create_project(opts) ⇒ Hashie::Mash

Create new project

Parameters:

  • opts (Hash)

    options hash of parameters

Options Hash (opts):

  • id (String)

    Id of the project

  • name (String)

    Name of the project

  • description (String)

    Description of the project

  • clientName (String)

    Client name of the project

  • clientId (String)

    Client id of the project

  • defaultIndustry (Array)

    Default industry of the project

  • defaultLangCodes (Array)

    Default languages of the project

  • creationDate (Date)

    Date the project was created on

  • creationUserId (Integer)

    User ID of the user who created the project

Returns:

  • (Hashie::Mash)

    New project



49
50
51
# File 'lib/bwapi/client/projects.rb', line 49

def create_project opts
  post "projects", opts
end

#delete_project(id) ⇒ Hashie::Mash

Delete an existing project

Parameters:

  • id (Integer)

    id Id of the existing project

Returns:

  • (Hashie::Mash)

    Deleted project



75
76
77
# File 'lib/bwapi/client/projects.rb', line 75

def delete_project id
  delete "projects/#{id}"
end

#project(id) ⇒ Hashie::Mash

Get a specific project

Parameters:

  • id (Integer)

    Id of the existing project

Returns:

  • (Hashie::Mash)

    Specific project



32
33
34
# File 'lib/bwapi/client/projects.rb', line 32

def project id
  get "projects/#{id}"
end

#projects(opts = {}) ⇒ Hashie::Mash

Get all projects

Parameters:

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

    options hash of parameters

Options Hash (opts):

  • page (Integer)

    Page of projects to retrieve

  • pageSize (Integer)

    Results per page of results

Returns:

  • (Hashie::Mash)

    All projects



24
25
26
# File 'lib/bwapi/client/projects.rb', line 24

def projects opts={}
  projects = get "projects", opts
end

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

Update an existing project

Parameters:

  • id (Integer)

    id Id of the existing project

  • opts (Hash)

    options Hash of parameters

Options Hash (opts):

  • id (String)

    Id of the project

  • name (String)

    Name of the project

  • description (String)

    Description of the project

  • clientName (String)

    Client name of the project

  • clientId (String)

    Client id of the project

  • defaultIndustry (Array)

    Default industry of the project

  • defaultLangCodes (Array)

    Default languages of the project

  • creationDate (Date)

    Date the project was created on

  • creationUserId (Integer)

    User ID of the user who created the project

Returns:

  • (Hashie::Mash)

    Updated project



67
68
69
# File 'lib/bwapi/client/projects.rb', line 67

def update_project id, opts
  put "projects/#{id}", opts
end