module BWAPI::Client::Projects::Queries

Queries module for projects/queries endpoints

Public Instance Methods

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

Create a new query in project

@param project_id [Integer] Id of project @param opts [Hash] options hash of parameters @option opts [Integer] id Id of the query @option opts [String] name Name of the project @option opts [Integer] dailyLimit Daily limit of the query @option opts [Integer] twitterLimit Twitter limit of the query @option opts [Integer] averageMonthlyMentions Average monthly mentions @option opts [String] type Query type @option opts [Array] includedTerms Included terms of terms query @option opts [Array] contextTerms Content terms of the query @option opts [Array] excludedTerms Excluded terms of thequery @option opts [Array] languages Query languages @option opts [String] twitterScreenName Tracked twitter screen name @option opts [String] industry Industry of the query @option opts [Date] creationDate Date the query was created on @option opts [Date] lastModificationDate Modification date of the query @return [Hash] New query

# File lib/bwapi/client/projects/queries.rb, line 69
def create_query(project_id, opts = {})
  post "projects/#{project_id}/queries", opts
end
create_wizard_query(project_id, opts = {}) click to toggle source

Create a wizard query in project

@param project_id [Integer] Id of project @param opts [Hash] options hash of parameters @option opts [Integer] id Id of the query @option opts [String] name Name of the project @option opts [Integer] dailyLimit Daily limit of the query @option opts [Integer] twitterLimit Twitter limit of the query @option opts [Integer] averageMonthlyMentions Average monthly mentions @option opts [String] type Query type @option opts [Array] includedTerms Included terms of terms query @option opts [Array] contextTerms Content terms of the query @option opts [Array] excludedTerms Excluded terms of thequery @option opts [Array] languages Query languages @option opts [String] twitterScreenName Tracked twitter screen name @option opts [String] industry Industry of the query @option opts [String] usecase The Usecase the Query was created for @option opts [String] type Type of query @option opts [Object] queryWizardConfiguration JSON object containing configuration for Query Wizard @option opts [Date] creationDate Date the query was created on @option opts [Date] lastModificationDate Modification date of the query @return [Hash] New query wizard

# File lib/bwapi/client/projects/queries.rb, line 95
def create_wizard_query(project_id, opts = {})
  post "projects/#{project_id}/querywizard", opts
end
delete_query(project_id, query_id) click to toggle source

Delete an existing query project

@param project_id [Integer] Id of project @param query_id [Integer] Id of query @return [Hash] Deleted query

# File lib/bwapi/client/projects/queries.rb, line 154
def delete_query(project_id, query_id)
  delete "projects/#{project_id}/queries/#{query_id}"
end
get_query(project_id, query_id) click to toggle source

Get a specific query in project

@param project_id [Integer] Id of project @param query_id [Integer] Id of query @return [Hash] Specific query

# File lib/bwapi/client/projects/queries.rb, line 46
def get_query(project_id, query_id)
  get "projects/#{project_id}/queries/#{query_id}"
end
get_wizard_query(project_id, query_id) click to toggle source

Get a specific wizard query in project

@param project_id [Integer] Id of project @param query_id [Integer] Id of query @return [Hash] Specific wizard query

# File lib/bwapi/client/projects/queries.rb, line 37
def get_wizard_query(project_id, query_id)
  get "projects/#{project_id}/querywizard/#{query_id}"
end
queries(project_id, opts = {}) click to toggle source

Get all queries in project

@param project_id [Integer] Id of project @param opts [Hash] options hash of parameters @option opts [String] nameContains partial name to filter by @option opts [Array] type types of query to filter by @option opts [Integer] page Page of results to retrieve @option opts [Integer] pageSize Results per page of results @return [Hash] All queries in project

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

Get summary of all queries in project

@param project_id [Integer] Id of project @return [Hash] Summary of all queries in project

# File lib/bwapi/client/projects/queries.rb, line 28
def queries_summary(project_id)
  get "projects/#{project_id}/queries/summary"
end
update_query(project_id, query_id, opts = {}) click to toggle source

Update an existing query in project

@param project_id [Integer] Id of project @param query_id [Integer] Id of query @param opts [Hash] options hash of parameters @option opts [Integer] id Id of the query @option opts [String] name Name of the project @option opts [Integer] dailyLimit Daily limit of the query @option opts [Integer] twitterLimit Twitter limit of the query @option opts [Integer] averageMonthlyMentions Average monthly mentions @option opts [String] type Query type @option opts [Array] includedTerms Included terms of terms query @option opts [Array] contextTerms Content terms of the query @option opts [Array] excludedTerms Excluded terms of thequery @option opts [Array] languages Query languages @option opts [String] twitterScreenName Tracked twitter screen name @option opts [String] industry Industry of the query @option opts [Date] creationDate Date the query was created on @option opts [Date] lastModificationDate Modification date of the query @return [Hash] Updated query

# File lib/bwapi/client/projects/queries.rb, line 119
def update_query(project_id, query_id, opts = {})
  put "projects/#{project_id}/queries/#{query_id}", opts
end
update_wizard_query(project_id, query_id, opts = {}) click to toggle source

Update an existing wizard query in project

@param project_id [Integer] Id of project @param opts [Hash] options hash of parameters @option opts [Integer] id Id of the query @option opts [String] name Name of the project @option opts [Integer] dailyLimit Daily limit of the query @option opts [Integer] twitterLimit Twitter limit of the query @option opts [Integer] averageMonthlyMentions Average monthly mentions @option opts [String] type Query type @option opts [Array] includedTerms Included terms of terms query @option opts [Array] contextTerms Content terms of the query @option opts [Array] excludedTerms Excluded terms of thequery @option opts [Array] languages Query languages @option opts [String] twitterScreenName Tracked twitter screen name @option opts [String] industry Industry of the query @option opts [String] usecase The Usecase the Query was created for @option opts [String] type Type of query @option opts [Object] queryWizardConfiguration JSON object containing configuration for Query Wizard @option opts [Date] creationDate Date the query was created on @option opts [Date] lastModificationDate Modification date of the query @return [Hash] Update query wizard

# File lib/bwapi/client/projects/queries.rb, line 145
def update_wizard_query(project_id, query_id, opts = {})
  put "projects/#{project_id}/querywizard/#{query_id}", opts
end