bwapi 1.0.10 → 2.0.0.pre.52

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7fa004888dff251bf656104bf2ddbfee3153c9e3
4
- data.tar.gz: ff3594b26b8e5325676423d08ac8f6a25a86bb45
5
- SHA512:
6
- metadata.gz: 48a8b9a19c40143ca47fcc9e87f73c3a4df4f2d951509b8b74f3505add7931d70f25a462491908073ebb90fac3b6fbc28fd47f1064ecd8f96fe894a5d720b24e
7
- data.tar.gz: 48acc4f05263eecfaaa12695fd043f2f99cffbc8ae4215635ad0f5b829713ef7cdbd5586fa93bf7977f66e936c311530e0a95847b7f9178b1094637bc3c6510d
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTQ0YzkwYmFjMmE0YTM0ZjQ2MGQ4ODBlZmRlOTZkMTE2ZTE0YTNlNQ==
5
+ data.tar.gz: !binary |-
6
+ Yjc0NWZmMTJiOTg1ZTE4MzBmMzUyYzMxYzY3MDgwMThiYjdlNDk4MQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZWNhMGQ4Yzk2ZjYxMWUzMWRhNGIxMDZiYTU3YjU4Mjc4M2QxNGQ5ZWVmMjA3
10
+ ZjVkNzJiM2QwM2RhNjU1NTg1Y2VmZjk0N2Y5NmUxYTI5MDhkYmM2ODUwNjAy
11
+ ZTQxNTgwNmZkOTRkMTQ3MTFjYTMzMmU2OGE5OTA1MmUwOTgxYTY=
12
+ data.tar.gz: !binary |-
13
+ NTM4MDUxMGVmY2NiZGNhMThhYzM3Mzc3NDdiMmIyNmI2NjcxYjhiZmM2MzVl
14
+ ZTMwYjI1ZmM3ZjVhM2EyMGRkYjE0OGU1ZTVlYTM5YzU0NGY2Yzk1YTE2MDQx
15
+ NWZlYWFmYmMzZTM5YjA3MWNhNDRjN2U5MTU3NWUzOTE5ZWUwZjQ=
data/bwapi.gemspec CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
4
4
  s.name = 'bwapi'
5
5
  s.version = BWAPI::VERSION
6
6
  s.version = BWAPI::VERSION + ".pre.#{ENV['TRAVIS_BUILD_NUMBER']}" if ENV['TRAVIS']
7
- s.date = '2013-10-31'
7
+ s.date = '2013-11-01'
8
8
  s.summary = 'Brandwatch v2 API Wrapper'
9
9
  s.description = 'A Ruby wrapper for the Brandwatch v2 API'
10
10
  s.author = 'Jonathan Chrisp'
@@ -9,10 +9,10 @@ module BWAPI
9
9
  #
10
10
  # @note must be a client admin user
11
11
  #
12
- # @param id [Integer] The user id
12
+ # @param user_id [Integer] The user id
13
13
  # @return [Hashie::Mash] User credentials
14
- def admin_become id
15
- get "admin/become/#{id}"
14
+ def admin_become user_id
15
+ get "admin/become/#{user_id}"
16
16
  end
17
17
 
18
18
  end
@@ -7,14 +7,13 @@ module BWAPI
7
7
 
8
8
  # Get all sub clients
9
9
  #
10
- # @param id [Integer] Id of the client
10
+ # @param client_id [Integer] Id of the client
11
11
  # @param opts [Hash] options hash of parameters
12
- # @option opts [Integer] id Id of the client
13
12
  # @option opts [Integer] page Page of projects to retrieve
14
13
  # @option opts [Integer] pageSize Results per page of results
15
14
  # @return [Hashie::Mash] All sub clients for client
16
- def client_sub_clients id
17
- get "admin/clients/#{id}/subclients"
15
+ def client_sub_clients client_id
16
+ get "admin/clients/#{client_id}/subclients"
18
17
  end
19
18
  alias :sub_clients :client_sub_clients
20
19
 
@@ -30,9 +29,8 @@ module BWAPI
30
29
 
31
30
  # Create new subclient
32
31
  #
33
- # @param id [Integer] Id of the client
32
+ # @param client_id [Integer] Id of the client
34
33
  # @param opts [Hash] options hash of parameters
35
- # @option opts [Integer] clientId Current client id
36
34
  # @option opts [Date] startDate Start date of the client
37
35
  # @option opts [String] contactTitle Contact title of the client
38
36
  # @option opts [String] address1 Address line one of the client
@@ -60,8 +58,8 @@ module BWAPI
60
58
  # @option opts [Integer] maximumSubscribedBrands The maximum subscribed brands for the client
61
59
  # @option opts [String] contactMobile The mobile number for the client
62
60
  # @return [Hashie::Mash] New sub client
63
- def create_client_sub_client id, opts
64
- post "admin/clients/#{id}/subclients", opts
61
+ def create_client_sub_client client_id, opts
62
+ post "admin/clients/#{client_id}/subclients", opts
65
63
  end
66
64
  alias :create_sub_client :create_client_sub_client
67
65
 
@@ -70,7 +68,6 @@ module BWAPI
70
68
  # @param client_id [Integer] Id of the client
71
69
  # @param sub_client_id [Integer] Id of the sub client
72
70
  # @param opts [Hash] options hash of parameters
73
- # @option opts [Integer] clientId Current client id
74
71
  # @option opts [Date] startDate Start date of the client
75
72
  # @option opts [String] contactTitle Contact title of the client
76
73
  # @option opts [String] address1 Address line one of the client
@@ -9,13 +9,13 @@ module BWAPI
9
9
 
10
10
  # Get all users for client
11
11
  #
12
- # @param id [Integer] Id of the client
12
+ # @param client_id [Integer] Id of the client
13
13
  # @param opts [Hash] options hash of parameters
14
14
  # @option opts [Integer] page Page of projects to retrieve
15
15
  # @option opts [Integer] pageSize Results per page of results
16
16
  # @return [Hashie::Mash] All client users
17
- def client_users id, opts={}
18
- get "admin/clients/#{id}/users", opts
17
+ def client_users client_id, opts={}
18
+ get "admin/clients/#{client_id}/users", opts
19
19
  end
20
20
 
21
21
  # Get a specific user in client
@@ -26,12 +26,10 @@ module BWAPI
26
26
  def get_client_user client_id, user_id
27
27
  get "admin/clients/#{client_id}/users/#{user_id}"
28
28
  end
29
- alias :get_user :get_client_user
30
-
31
29
 
32
30
  # Create a new client user
33
31
  #
34
- # @param id [Integer] Id of the client
32
+ # @param client_id [Integer] Id of the client
35
33
  # @param opts [Hash] options Hash of parameters
36
34
  # @option opts [Integer] id Id of the user
37
35
  # @option opts [Hash] tags The users assigned tags
@@ -52,10 +50,9 @@ module BWAPI
52
50
  # @option opts [String] mobile The users mobile number
53
51
  # @option opts [Date] creationDate Date the user was created on
54
52
  # @return [Hashie::Mash] New user
55
- def create_client_user id, opts
56
- post "admin/clients/#{id}/users", opts
53
+ def create_client_user client_id, opts
54
+ post "admin/clients/#{client_id}/users", opts
57
55
  end
58
- alias :create_user :create_client_user
59
56
 
60
57
  # Update an existing client user
61
58
  #
@@ -84,8 +81,6 @@ module BWAPI
84
81
  def update_client_user client_id, user_id, opts
85
82
  put "admin/clients/#{client_id}/users/#{user_id}", opts
86
83
  end
87
- alias :update_user :update_client_user
88
-
89
84
 
90
85
  include BWAPI::Client::Admin::Clients::Users::Sharing
91
86
 
@@ -8,9 +8,8 @@ module BWAPI
8
8
 
9
9
  # Create a new data download in project
10
10
  #
11
- # @param id [Integer] Id of project
11
+ # @param project_id [Integer] Id of project
12
12
  # @param opts [Hash] options hash of parameters
13
- # @option opts [Integer] projectId Id of the project
14
13
  # @option opts [Integer] id Id of the data download
15
14
  # @option opts [Integer] queryId Id of the query
16
15
  # @option opts [Int] percentComplete The percentage complete of data download
@@ -22,7 +21,7 @@ module BWAPI
22
21
  # @option opts [String] downloadLinkCSV The link to download the CSV format
23
22
  # @option opts [Array] additionalColumns The additional columns for the data download
24
23
  # @return [Hashie::Mash] New data download
25
- def brandwatch_data_download id, opts
24
+ def brandwatch_data_download project_id, opts
26
25
  post "brandwatch/#{project_id}/datadownload", opts
27
26
  end
28
27
 
@@ -8,10 +8,10 @@ module BWAPI
8
8
  #
9
9
  # @note must be a super admin user
10
10
  #
11
- # @param id [Integer] The user id
11
+ # @param user_id [Integer] The user id
12
12
  # @return [Hashie::Mash] User credentials
13
- def brandwatch_become id
14
- get "brandwatch/become/#{id}"
13
+ def brandwatch_become user_id
14
+ get "brandwatch/become/#{user_id}"
15
15
  end
16
16
 
17
17
  end
@@ -6,10 +6,10 @@ module BWAPI
6
6
 
7
7
  # Get a specific clients modules
8
8
  #
9
- # @param id [Integer] Id of the client
9
+ # @param client_id [Integer] Id of the client
10
10
  # @return [Hashie::Mash] Specific clients modules
11
- def brandwatch_client_modules id
12
- get "brandwatch/clientModules/#{id}"
11
+ def brandwatch_client_modules client_id
12
+ get "brandwatch/clientModules/#{client_id}"
13
13
  end
14
14
 
15
15
  # Update brandwatch client modules
@@ -5,6 +5,7 @@ require 'bwapi/client/projects/facebook_queries'
5
5
  require 'bwapi/client/projects/signals'
6
6
  require 'bwapi/client/projects/summary'
7
7
  require 'bwapi/client/projects/sharing'
8
+ require 'bwapi/client/projects/stream_dashboards'
8
9
  require 'bwapi/client/projects/queries'
9
10
  require 'bwapi/client/projects/query_groups'
10
11
  require 'bwapi/client/projects/tags'
@@ -19,7 +20,7 @@ module BWAPI
19
20
  # Get all projects
20
21
  #
21
22
  # @param opts [Hash] options hash of parameters
22
- # @option opts [Integer] pagePage of projects to retrieve
23
+ # @option opts [Integer] page Page of results to retrieve
23
24
  # @option opts [Integer] pageSize Results per page of results
24
25
  # @return [Hashie::Mash] All projects
25
26
  def projects opts={}
@@ -28,16 +29,15 @@ module BWAPI
28
29
 
29
30
  # Get a specific project
30
31
  #
31
- # @param id [Integer] Id of the existing project
32
+ # @param project_id [Integer] Id of the existing project
32
33
  # @return [Hashie::Mash] Specific project
33
- def project id
34
- get "projects/#{id}"
34
+ def get_project project_id
35
+ get "projects/#{project_id}"
35
36
  end
36
37
 
37
38
  # Create new project
38
39
  #
39
40
  # @param opts [Hash] options hash of parameters
40
- # @option opts [String] id Id of the project
41
41
  # @option opts [String] name Name of the project
42
42
  # @option opts [String] description Description of the project
43
43
  # @option opts [String] clientName Client name of the project
@@ -53,9 +53,8 @@ module BWAPI
53
53
 
54
54
  # Update an existing project
55
55
  #
56
- # @param id [Integer] id Id of the existing project
56
+ # @param project_id [Integer] id Id of the existing project
57
57
  # @param opts [Hash] options Hash of parameters
58
- # @option opts [String] id Id of the project
59
58
  # @option opts [String] name Name of the project
60
59
  # @option opts [String] description Description of the project
61
60
  # @option opts [String] clientName Client name of the project
@@ -65,16 +64,16 @@ module BWAPI
65
64
  # @option opts [Date] creationDate Date the project was created on
66
65
  # @option opts [Integer] creationUserId User ID of the user who created the project
67
66
  # @return [Hashie::Mash] Updated project
68
- def update_project id, opts
69
- put "projects/#{id}", opts
67
+ def update_project project_id, opts
68
+ put "projects/#{project_id}", opts
70
69
  end
71
70
 
72
71
  # Delete an existing project
73
72
  #
74
- # @param id [Integer] id Id of the existing project
73
+ # @param project_id [Integer] id Id of the existing project
75
74
  # @return [Hashie::Mash] Deleted project
76
- def delete_project id
77
- delete "projects/#{id}"
75
+ def delete_project project_id
76
+ delete "projects/#{project_id}"
78
77
  end
79
78
 
80
79
  include BWAPI::Client::Projects::Categories
@@ -84,6 +83,7 @@ module BWAPI
84
83
  include BWAPI::Client::Projects::Signals
85
84
  include BWAPI::Client::Projects::Summary
86
85
  include BWAPI::Client::Projects::Sharing
86
+ include BWAPI::Client::Projects::StreamDashboards
87
87
  include BWAPI::Client::Projects::Queries
88
88
  include BWAPI::Client::Projects::QueryGroups
89
89
  include BWAPI::Client::Projects::Tags
@@ -6,13 +6,13 @@ module BWAPI
6
6
 
7
7
  # Get all categories in project
8
8
  #
9
- # @param id [Integer] Id of project
9
+ # @param project_id [Integer] Id of project
10
10
  # @param opts [Hash] options hash of parameters
11
11
  # @option opts [Integer] page Page of projects to retrieve
12
12
  # @option opts [Integer] pageSize Results per page of results
13
13
  # @return [Hashie::Mash] All categories in project
14
- def categories id, opts={}
15
- get "projects/#{id}/categories", opts
14
+ def categories project_id, opts={}
15
+ get "projects/#{project_id}/categories", opts
16
16
  end
17
17
 
18
18
  # TODO: Uncomment this code when endpoint is created
@@ -29,15 +29,15 @@ module BWAPI
29
29
 
30
30
  # Create a new category in project
31
31
  #
32
- # @param id [Integer] Id of project
32
+ # @param project_id [Integer] Id of project
33
33
  # @param opts [Hash] options hash of parameters
34
34
  # @option opts [Integer] id Id of the category
35
35
  # @option opts [String] name Name of the category
36
36
  # @option opts [Array] children The children of the category
37
37
  # @option opts [Boolean] multiple Whether multiple sub categories can be selected
38
38
  # @return [Hashie::Mash] New category
39
- def create_category id, opts={}
40
- post "projects/#{id}/categories", opts
39
+ def create_category project_id, opts={}
40
+ post "projects/#{project_id}/categories", opts
41
41
  end
42
42
 
43
43
  # Update an existing category in project
@@ -45,7 +45,6 @@ module BWAPI
45
45
  # @param project_id [Integer] Id of project
46
46
  # @param category_id [Integer] Id of category
47
47
  # @param opts [Hash] options hash of parameters
48
- # @option opts [Integer] projectId Id of the project
49
48
  # @option opts [Integer] id Id of the category
50
49
  # @option opts [String] name Name of the category
51
50
  # @option opts [Array] children The children of the category
@@ -6,7 +6,7 @@ module BWAPI
6
6
 
7
7
  # Get all chart data for the requested dimensions
8
8
  #
9
- # @param id [Integer] Id of project
9
+ # @param project_id [Integer] Id of project
10
10
  # @param aggregate [String] Aggregate value
11
11
  # @param dimension_one [String] Dimension 1 value
12
12
  # @param dimension_two [String] Dimension 2 value
@@ -14,27 +14,25 @@ module BWAPI
14
14
  # @option opts [Integer] projectId Id of the project
15
15
  # @option opts [Hash] filter The filters to apply
16
16
  # @return [Hashie::Mash] All Chart data mentions
17
- def data id, aggregate, dimension_one, dimension_two, opts={}
18
- get "projects/#{id}/data/#{aggregate}/#{dimension_one}/#{dimension_two}", opts
17
+ def data project_id, aggregate, dimension_one, dimension_two, opts={}
18
+ get "projects/#{project_id}/data/#{aggregate}/#{dimension_one}/#{dimension_two}", opts
19
19
  end
20
20
 
21
21
  # Get all chart data for date ranges broken down by days
22
22
  #
23
- # @param id [Integer] Id of project
23
+ # @param project_id [Integer] Id of project
24
24
  # @param opts [Hash] options hash of parameters
25
- # @option opts [Integer] projectId Id of the project
26
25
  # @option opts [Hash] filter The filters to apply
27
26
  # @option opts [Array] dateRanges Date range ids
28
27
  # @return [Hashie::Mash] All Chart data mentions
29
- def data_date_ranges_days id, opts
30
- get "projects/#{id}/data/volume/dataRanges/days", opts
28
+ def data_date_ranges_days project_id, opts
29
+ get "projects/#{project_id}/data/volume/dataRanges/days", opts
31
30
  end
32
31
 
33
32
  # Get mentions that fall within the submitted filters
34
33
  #
35
- # @param id [Integer] Id of project
34
+ # @param project_id [Integer] Id of project
36
35
  # @param opts [Hash] options hash of parameters
37
- # @option opts [Integer] projectId Id of the project
38
36
  # @option opts [Hash] filter The filters to apply
39
37
  # @option opts [Integer] page Page of projects to retrieve
40
38
  # @option opts [Integer] pageSize Results per page of results
@@ -42,19 +40,18 @@ module BWAPI
42
40
  # @option opts [String] :orderDirection Direction of sort
43
41
  # @option opts [Integer] :orderByCategory Category to sort by when orderBy category
44
42
  # @return [Hashie::Mash] All Mentions
45
- def data_mentions id, opts={}
46
- get "projects/#{id}/data/mentions", opts
43
+ def data_mentions project_id, opts={}
44
+ get "projects/#{project_id}/data/mentions", opts
47
45
  end
48
46
 
49
47
  # Update mentions for project
50
48
  #
51
- # @param id [Integer] Id of project
49
+ # @param project_id [Integer] Id of project
52
50
  # @param opts [Hash] options hash of parameters
53
- # @option opts [Integer] projectId Id of the project
54
51
  # @option opts [Hash] List The patches to be applied
55
52
  # @return [Hashie::Mash] Updated mentions
56
- def update_data_mentions id, opts={}
57
- patch "projects/#{id}/data/mentions", opts
53
+ def update_data_mentions project_id, opts={}
54
+ patch "projects/#{project_id}/data/mentions", opts
58
55
  end
59
56
 
60
57
  end
@@ -6,12 +6,12 @@ module BWAPI
6
6
 
7
7
  # Get all data downloads in project
8
8
  #
9
- # @param id [Integer] Id of project
9
+ # @param project_id [Integer] Id of project
10
10
  # @option opts [Integer] page Page of projects to retrieve
11
11
  # @option opts [Integer] pageSize Results per page of results
12
12
  # @return [Hashie::Mash] All data downloads in project
13
- def data_downloads id, opts={}
14
- get "projects/#{id}/datadownload", opts
13
+ def data_downloads project_id, opts={}
14
+ get "projects/#{project_id}/datadownload", opts
15
15
  end
16
16
 
17
17
  # Get a specific data download in project
@@ -26,9 +26,8 @@ module BWAPI
26
26
 
27
27
  # Create a new data download in project
28
28
  #
29
- # @param id [Integer] Id of project
29
+ # @param project_id [Integer] Id of project
30
30
  # @param opts [Hash] options hash of parameters
31
- # @option opts [Integer] projectId Id of the project
32
31
  # @option opts [Integer] id Id of the data download
33
32
  # @option opts [Integer] queryId Id of the query
34
33
  # @option opts [Int] percentComplete The percentage complete of data download
@@ -40,8 +39,8 @@ module BWAPI
40
39
  # @option opts [String] downloadLinkCSV The link to download the CSV format
41
40
  # @option opts [Array] additionalColumns The additional columns for the data download
42
41
  # @return [Hashie::Mash] New data download
43
- def create_datadownload id, opts={}
44
- get "projects/#{id}/datadownload", opts
42
+ def create_datadownload project_id, opts={}
43
+ get "projects/#{project_id}/datadownload", opts
45
44
  end
46
45
 
47
46
  end
@@ -6,10 +6,10 @@ module BWAPI
6
6
 
7
7
  # Get all facebook queries in project
8
8
  #
9
- # @param id [Integer] Id of project
9
+ # @param project_id [Integer] Id of project
10
10
  # @return [Hashie::Mash] All facebook queries in project
11
- def facebook_queries id
12
- get "projects/#{id}/facebookqueries"
11
+ def facebook_queries project_id
12
+ get "projects/#{project_id}/facebookqueries"
13
13
  end
14
14
 
15
15
  # Get a specific facebook query in project
@@ -10,24 +10,23 @@ module BWAPI
10
10
 
11
11
  # Get all queries in project
12
12
  #
13
- # @param id [Integer] Id of project
13
+ # @param project_id [Integer] Id of project
14
14
  # @param opts [Hash] options hash of parameters
15
- # @option opts [Integer] projectId the id of the project
16
15
  # @option opts [String] nameContains partial name to filter by
17
16
  # @option opts [Array] type types of query to filter by
18
- # @option opts [Integer] pagePage of projects to retrieve
17
+ # @option opts [Integer] page Page of results to retrieve
19
18
  # @option opts [Integer] pageSize Results per page of results
20
19
  # @return [Hashie::Mash] All queries in project
21
- def queries id, opts={}
22
- get "projects/#{id}/queries", opts
20
+ def queries project_id, opts={}
21
+ get "projects/#{project_id}/queries", opts
23
22
  end
24
23
 
25
24
  # Get summary of all queries in project
26
25
  #
27
- # @param id [Integer] Id of project
26
+ # @param project_id [Integer] Id of project
28
27
  # @return [Hashie::Mash] Summary of all queries in project
29
- def queries_summary id
30
- get "projects/#{id}/queries/summary"
28
+ def queries_summary project_id
29
+ get "projects/#{project_id}/queries/summary"
31
30
  end
32
31
 
33
32
  # Get a specific query in project
@@ -42,7 +41,7 @@ module BWAPI
42
41
 
43
42
  # Create a new query in project
44
43
  #
45
- # @param id [Integer] Id of project
44
+ # @param project_id [Integer] Id of project
46
45
  # @param opts [Hash] options hash of parameters
47
46
  # @option opts [String] id Id of the query
48
47
  # @option opts [String] name Name of the project
@@ -59,8 +58,8 @@ module BWAPI
59
58
  # @option opts [Date] creationDate Date the query was created on
60
59
  # @option opts [Date] lastModificationDate Modification date of the query
61
60
  # @return [Hashie::Mash] New query
62
- def create_query id, opts={}
63
- post "projects/#{id}/queries", opts
61
+ def create_query project_id, opts={}
62
+ post "projects/#{project_id}/queries", opts
64
63
  end
65
64
 
66
65
  # Update an existing query in project
@@ -6,7 +6,7 @@ module BWAPI
6
6
 
7
7
  # Get all query groups in project
8
8
  #
9
- # @param id [Integer] Id of project
9
+ # @param project_id [Integer] Id of project
10
10
  # @option opts [Integer] page Page of projects to retrieve
11
11
  # @option opts [Integer] pageSize Results per page of results
12
12
  # @return [Hashie::Mash] All query groups in project
@@ -26,7 +26,7 @@ module BWAPI
26
26
 
27
27
  # Create a new query group in project
28
28
  #
29
- # @param id [Integer] Id of project
29
+ # @param project_id [Integer] Id of project
30
30
  # @param opts [Hash] options hash of parameters
31
31
  # @option opts [Integer] id Id of the query group
32
32
  # @option opts [String] name Name of the query group
@@ -44,7 +44,6 @@ module BWAPI
44
44
  # @param project_id [Integer] Id of project
45
45
  # @param query_group_id [Integer] Id of query group
46
46
  # @param opts [Hash] options hash of parameters
47
- # @option opts [Integer] projectId Id of the project
48
47
  # @option opts [Integer] queryGroupId of the query group
49
48
  # @option opts [String] name Name of the query group
50
49
  # @option opts [String] shared Shared mode of query group
@@ -14,24 +14,22 @@ module BWAPI
14
14
 
15
15
  # Shares of a project
16
16
  #
17
- # @param id [Integer] Id of project
17
+ # @param project_id [Integer] Id of project
18
18
  # @param opts [Hash] options hash of parameters
19
- # @options opt [Integer] id Id of the project
20
19
  # @options opt [Boolean] sharedOnly Boolean flag to return only shared shares (default: false)
21
20
  # @return [Hashie::Mash] Specific project shares
22
- def project_sharing id, opts={}
23
- get "projects/#{id}/sharing", opts
21
+ def project_sharing project_id, opts={}
22
+ get "projects/#{project_id}/sharing", opts
24
23
  end
25
24
 
26
25
  # Update shares of a project
27
26
  #
28
- # @param id [Integer] Id of project
27
+ # @param project_id [Integer] Id of project
29
28
  # @param opts [Hash] options hash of parameters
30
- # @options opt [Integer] id Id of the project
31
29
  # @options opt [Array] ProjectShareDTO Shares to be edited
32
30
  # @return [Hashie::Mash] Updated project shares
33
- def update_project_sharing id, opts={}
34
- put "projects/#{id}/sharing", opts
31
+ def update_project_sharing project_id, opts={}
32
+ put "projects/#{project_id}/sharing", opts
35
33
  end
36
34
 
37
35
  # User share of a project
@@ -6,31 +6,29 @@ module BWAPI
6
6
 
7
7
  # Get all signals belonging to user in project
8
8
  #
9
- # @param id [Integer] Id of project
9
+ # @param project_id [Integer] Id of project
10
10
  # @param opts [Hash] options hash of parameters
11
11
  # @option opts [Integer] id Id of the query
12
12
  # @option opts [Integer] page Page of projects to retrieve
13
13
  # @option opts [Integer] pageSize Results per page of results
14
14
  # @option opts [Integer] importance Importance of signal
15
15
  # @option opts [String] type Type of signal
16
- # @option opts [Integer] projectId Project id of the signal
17
16
  # @option opts [Hash] filter The filter(s) to apply
18
17
  # @return [Hashie::Mash] All signals for user in project
19
- def signals id, opts
20
- get "projects/#{id}/signals", opts
18
+ def signals project_id, opts
19
+ get "projects/#{project_id}/signals", opts
21
20
  end
22
21
 
23
22
  # Set the vote type and comment of a signal for a given user
24
23
  #
25
- # @param id [Integer] Id of project
24
+ # @param project_id [Integer] Id of project
26
25
  # @param opts [Hash] options hash of parameters
27
26
  # @option opts [Integer] userId Id of the user
28
27
  # @option opts [Integer] voteType Type of vote
29
28
  # @option opts [String] comment User comment
30
29
  # @option opts [Integer] signalId Id of signal
31
- # @option opts [Integer] projectId Project id of the signal
32
30
  # @return [Hashie::Mash] Update signal for given user
33
- def set_signal_vote id, opts
31
+ def set_signal_vote project_id, opts
34
32
  post "projects/#{project_id}/signals/vote", opts
35
33
  end
36
34
 
@@ -0,0 +1,89 @@
1
+ require 'bwapi/client/projects/stream_dashboards/streams'
2
+
3
+ module BWAPI
4
+ class Client
5
+ module Projects
6
+ # StreamDashboards module for projects/stream_dashboards endpoints
7
+ module StreamDashboards
8
+
9
+ # Get all stream dashboards in project
10
+ #
11
+ # @param project_id [Integer] Id of project
12
+ # @param opts [Hash] options hash of parameters
13
+ # @option opts [Integer] page Page of projects to retrieve
14
+ # @option opts [Integer] pageSize Results per page of results
15
+ # @return [Hashie::Mash] All stream dashboards for project
16
+ def stream_dashboards project_id, opts={}
17
+ get "projects/#{project_id}/streamDashboards", opts
18
+ end
19
+
20
+ # Get a stream dashboards summary
21
+ #
22
+ # @param project_id [Integer] Id of project
23
+ # @param opts [Hash] options hash of parameters
24
+ # @option opts [Integer] page Page of projects to retrieve
25
+ # @option opts [Integer] pageSize Results per page of results
26
+ # @return [Hashie::Mash] All stream dashboards summary for project
27
+ def get_stream_dashboards_summary project_id
28
+ get "projects/#{project_id}/streamDashboards/summary"
29
+ end
30
+
31
+ # Get a stream dashboard complete with streams
32
+ #
33
+ # @param project_id [Integer] Id of project
34
+ # @param stream_dashboard_id [Integer] Id of stream dashboard
35
+ # @return [Hashie::Mash] Stream dashboard complete with streams
36
+ def get_stream_dashboard_complete project_id, stream_dashboard_id
37
+ get "projects/#{project_id}/streamDashboards/#{stream_dashboard_id}/complete"
38
+ end
39
+
40
+ # Get a stream dashboard
41
+ #
42
+ # @param project_id [Integer] Id of project
43
+ # @param stream_dashboard_id [Integer] Id of stream dashboard
44
+ # @return [Hashie::Mash] Stream dashboard
45
+ def get_stream_dashboard project_id, stream_dashboard_id
46
+ get "projects/#{project_id}/streamDashboards/#{stream_dashboard_id}"
47
+ end
48
+
49
+ # Create a new stream dashboard
50
+ #
51
+ # @param project_id [Integer] Id of project
52
+ # @param opts [Hash] options hash of parameters
53
+ # @option opts [Integer] id Id of the stream
54
+ # @option opts [String] name Name of the stream
55
+ # @option opts [String] created The stream creation date
56
+ # @option opts [String] filter the stream filter
57
+ # @return [Hashie::Mash] New stream dashboard
58
+ def create_stream_dashboard project_id, opts={}
59
+ post "projects/#{project_id}/streamDashboards", opts
60
+ end
61
+
62
+ # Update a stream dashboard
63
+ #
64
+ # @param project_id [Integer] Id of project
65
+ # @param stream_dashboard_id [Integer] Id of stream dashboard
66
+ # @param opts [Hash] options hash of parameters
67
+ # @option opts [Integer] id Id of the stream
68
+ # @option opts [String] name Name of the stream
69
+ # @option opts [String] created The stream creation date
70
+ # @option opts [String] filter the stream filter
71
+ # @return [Hashie::Mash] Updated stream dashboard
72
+ def update_stream_dashboard project_id, stream_dashboard_id
73
+ put "projects/#{project_id}/streamDashboards/#{stream_dashboard_id}"
74
+ end
75
+
76
+ # Delete a stream dashboard
77
+ #
78
+ # @param project_id [Integer] Id of project
79
+ # @param stream_dashboard_id [Integer] Id of stream dashboard
80
+ def delete_stream_dashboard project_id, stream_dashboard_id
81
+ delete "projects/#{project_id}/streamDashboards/#{stream_dashboard_id}"
82
+ end
83
+
84
+ include BWAPI::Client::Projects::StreamDashboards::Streams
85
+
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,75 @@
1
+ module BWAPI
2
+ class Client
3
+ module Projects
4
+ module StreamDashboards
5
+ # Streams module for projects/stream_dashboards/streams endpoints
6
+ module Streams
7
+
8
+ # Get all streams in a stream dashboard
9
+ #
10
+ # @param project_id [Integer] Id of project
11
+ # @param opts [Hash] options hash of parameters
12
+ # @option opts [Integer] page Page of results to retrieve
13
+ # @option opts [Integer] pageSize Results per page of results
14
+ # @return [Hashie::Mash] All stream dashboards for project
15
+ def get_streams project_id, stream_dashboard_id
16
+ get "projects/#{project_id}/streamDashboards/#{stream_dashboard_id}/streams"
17
+ end
18
+
19
+ # Get a stream in a stream dashboard
20
+ #
21
+ # @param project_id [Integer] Id of project
22
+ # @param stream_dashboard_id [Integer] Id of stream dashboard
23
+ # @param stream_id [Integer] Id of the stream
24
+ # @return [Hashie::Mash] Specific stream
25
+ def get_stream project_id, stream_dashboard_id, stream_id
26
+ get "projects/#{project_id}/streamDashboards/#{stream_dashboard_id}/streams/#{stream_id}"
27
+ end
28
+
29
+ # Create a stream in a stream dashboard
30
+ #
31
+ # @param project_id [Integer] Id of project
32
+ # @param stream_dashboard_id [Integer] Id of stream dashboard
33
+ # @param stream_id [Integer] Id of the stream
34
+ # @param opts [Hash] options hash of parameters
35
+ # @option opts [Integer] id Id of the stream
36
+ # @option opts [String] name Name of the stream
37
+ # @option opts [String] created Creation date of stream
38
+ # @option opts [String] filter Filter of the stream
39
+ # @option opts [String] lastModified Last modification date of stream
40
+ # @return [Hashie::Mash] Specific stream
41
+ def create_stream project_id, stream_dashboard_id, stream_id
42
+ post "projects/#{project_id}/streamDashboards/#{stream_dashboard_id}/streams/#{stream_id}"
43
+ end
44
+
45
+ # Update a stream in a stream dashboard
46
+ #
47
+ # @param project_id [Integer] Id of project
48
+ # @param stream_dashboard_id [Integer] Id of stream dashboard
49
+ # @param stream_id [Integer] Id of the stream
50
+ # @param opts [Hash] options hash of parameters
51
+ # @option opts [Integer] id Id of the stream
52
+ # @option opts [String] name Name of the stream
53
+ # @option opts [String] created Creation date of stream
54
+ # @option opts [String] filter Filter of the stream
55
+ # @option opts [String] lastModified Last modification date of stream
56
+ # @return [Hashie::Mash] Updated stream
57
+ def update_stream project_id, stream_dashboard_id, stream_id
58
+ put "projects/#{project_id}/streamDashboards/#{stream_dashboard_id}/streams/#{stream_id}"
59
+ end
60
+
61
+ # Delete a stream in a stream dashboard
62
+ #
63
+ # @param project_id [Integer] Id of project
64
+ # @param stream_dashboard_id [Integer] Id of stream dashboard
65
+ # @param stream_id [Integer] Id of the stream
66
+ # @return [Hashie::Mash] Deleted stream
67
+ def delete_stream project_id, stream_dashboard_id, stream_id
68
+ delete "projects/#{project_id}/streamDashboards/#{stream_dashboard_id}/streams/#{stream_id}"
69
+ end
70
+
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -6,12 +6,12 @@ module BWAPI
6
6
 
7
7
  # Get all tags in project
8
8
  #
9
- # @param id [Integer] Id of project
9
+ # @param project_id [Integer] Id of project
10
10
  # @option opts [Integer] page Page of projects to retrieve
11
11
  # @option opts [Integer] pageSize Results per page of results
12
12
  # @return [Hashie::Mash] All tags in project
13
- def tags id, opts={}
14
- get "projects/#{id}/tags", opts
13
+ def tags project_id, opts={}
14
+ get "projects/#{project_id}/tags", opts
15
15
  end
16
16
 
17
17
  # Get a specific tag in project
@@ -26,13 +26,13 @@ module BWAPI
26
26
 
27
27
  # Create a new tag in project
28
28
  #
29
- # @param id [Integer] Id of project
29
+ # @param project_id [Integer] Id of project
30
30
  # @param opts [Hash] options hash of parameters
31
31
  # @option opts [Integer] id Id of the tag
32
32
  # @option opts [String] name Name of the tag
33
33
  # @return [Hashie::Mash] New tag
34
- def create_tag id, opts
35
- post "projects/#{id}/tags", opts
34
+ def create_tag project_id, opts
35
+ post "projects/#{project_id}/tags", opts
36
36
  end
37
37
 
38
38
  # Update an existing tag in project
@@ -6,10 +6,10 @@ module BWAPI
6
6
 
7
7
  # Get all users shared with project
8
8
  #
9
- # @param id [Integer] Id of project
9
+ # @param project_id [Integer] Id of project
10
10
  # @return [Hashie::Mash] All users shared to project
11
- def project_users id
12
- get "projects/#{id}/users"
11
+ def project_users project_id
12
+ get "projects/#{project_id}/users"
13
13
  end
14
14
 
15
15
  end
@@ -6,10 +6,10 @@ module BWAPI
6
6
 
7
7
  # Get all workflow categories for project
8
8
  #
9
- # @param id [Integer] Id of project
9
+ # @param project_id [Integer] Id of project
10
10
  # @return [Hashie::Mash] Workflow categories for project
11
- def workflow id
12
- get "projects/#{id}/workflow"
11
+ def workflow project_id
12
+ get "projects/#{project_id}/workflow"
13
13
  end
14
14
 
15
15
  end
@@ -10,8 +10,8 @@ module BWAPI
10
10
  #
11
11
  # @param user_id [Integer] The user id
12
12
  # @return [Hashie::Mash] User authorization
13
- def sso id
14
- get "sso/#{id}"
13
+ def sso user_id
14
+ get "sso/#{user_id}"
15
15
  end
16
16
 
17
17
  end
data/lib/bwapi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module BWAPI
2
- VERSION = "1.0.10"
2
+ VERSION = "2.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bwapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 2.0.0.pre.52
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Chrisp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-31 00:00:00.000000000 Z
11
+ date: 2013-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -139,6 +139,8 @@ files:
139
139
  - lib/bwapi/client/projects/query_groups.rb
140
140
  - lib/bwapi/client/projects/sharing.rb
141
141
  - lib/bwapi/client/projects/signals.rb
142
+ - lib/bwapi/client/projects/stream_dashboards.rb
143
+ - lib/bwapi/client/projects/stream_dashboards/streams.rb
142
144
  - lib/bwapi/client/projects/summary.rb
143
145
  - lib/bwapi/client/projects/tags.rb
144
146
  - lib/bwapi/client/projects/users.rb
@@ -170,17 +172,17 @@ require_paths:
170
172
  - lib
171
173
  required_ruby_version: !ruby/object:Gem::Requirement
172
174
  requirements:
173
- - - '>='
175
+ - - ! '>='
174
176
  - !ruby/object:Gem::Version
175
177
  version: 1.9.2
176
178
  required_rubygems_version: !ruby/object:Gem::Requirement
177
179
  requirements:
178
- - - '>='
180
+ - - ! '>'
179
181
  - !ruby/object:Gem::Version
180
- version: '0'
182
+ version: 1.3.1
181
183
  requirements: []
182
184
  rubyforge_project:
183
- rubygems_version: 2.1.2
185
+ rubygems_version: 2.0.3
184
186
  signing_key:
185
187
  specification_version: 4
186
188
  summary: Brandwatch v2 API Wrapper
@@ -190,4 +192,3 @@ test_files:
190
192
  - spec/bwapi_spec.rb
191
193
  - spec/fixtures/.netrc
192
194
  - spec/helper.rb
193
- has_rdoc: