bwapi 6.5.0.pre.256 → 7.0.0.pre.271
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.editorconfig +11 -0
- data/.rubocop.yml +17 -0
- data/.travis.yml +7 -3
- data/bin/bwapi +2 -1
- data/bwapi.gemspec +13 -10
- data/lib/bwapi.rb +6 -6
- data/lib/bwapi/authentication.rb +9 -17
- data/lib/bwapi/client.rb +5 -4
- data/lib/bwapi/client/admin.rb +6 -6
- data/lib/bwapi/client/admin/become.rb +4 -4
- data/lib/bwapi/client/admin/search.rb +9 -12
- data/lib/bwapi/client/admin/sub_clients.rb +8 -13
- data/lib/bwapi/client/admin/users.rb +7 -7
- data/lib/bwapi/client/admin/users/sharing.rb +5 -7
- data/lib/bwapi/client/brandwatch.rb +4 -4
- data/lib/bwapi/client/brandwatch/become.rb +4 -4
- data/lib/bwapi/client/brandwatch/client_modules.rb +5 -6
- data/lib/bwapi/client/client.rb +5 -6
- data/lib/bwapi/client/command_center.rb +3 -3
- data/lib/bwapi/client/command_center/client.rb +4 -4
- data/lib/bwapi/client/command_center/displays.rb +9 -9
- data/lib/bwapi/client/command_center/displays/events.rb +8 -8
- data/lib/bwapi/client/command_center/displays/messages.rb +7 -8
- data/lib/bwapi/client/command_center/displays/scenes.rb +9 -9
- data/lib/bwapi/client/command_center/displays/screens.rb +9 -9
- data/lib/bwapi/client/command_center/displays/users.rb +7 -8
- data/lib/bwapi/client/command_center/displays/users/access.rb +4 -5
- data/lib/bwapi/client/command_center/scene_types.rb +6 -6
- data/lib/bwapi/client/command_center/themes.rb +4 -4
- data/lib/bwapi/client/command_center/users.rb +6 -6
- data/lib/bwapi/client/command_center/users/access.rb +5 -5
- data/lib/bwapi/client/error_codes.rb +4 -4
- data/lib/bwapi/client/filters.rb +4 -4
- data/lib/bwapi/client/languages.rb +3 -3
- data/lib/bwapi/client/location.rb +5 -5
- data/lib/bwapi/client/logout.rb +12 -14
- data/lib/bwapi/client/me.rb +3 -3
- data/lib/bwapi/client/metrics.rb +3 -3
- data/lib/bwapi/client/oauth.rb +8 -8
- data/lib/bwapi/client/ping.rb +8 -8
- data/lib/bwapi/client/projects.rb +10 -10
- data/lib/bwapi/client/projects/bulkactions.rb +4 -4
- data/lib/bwapi/client/projects/bulkactions/author.rb +4 -3
- data/lib/bwapi/client/projects/bulkactions/mentions.rb +4 -3
- data/lib/bwapi/client/projects/categories.rb +6 -20
- data/lib/bwapi/client/projects/data.rb +4 -5
- data/lib/bwapi/client/projects/data/mentions.rb +7 -7
- data/lib/bwapi/client/projects/data/volume.rb +11 -11
- data/lib/bwapi/client/projects/data_download.rb +6 -7
- data/lib/bwapi/client/projects/demographics.rb +3 -4
- data/lib/bwapi/client/projects/facebook_queries.rb +8 -9
- data/lib/bwapi/client/projects/group.rb +2 -2
- data/lib/bwapi/client/projects/group/author_group.rb +8 -7
- data/lib/bwapi/client/projects/group/location_group.rb +7 -7
- data/lib/bwapi/client/projects/group/site_group.rb +7 -7
- data/lib/bwapi/client/projects/queries.rb +9 -10
- data/lib/bwapi/client/projects/queries/backfill.rb +6 -8
- data/lib/bwapi/client/projects/queries/date_range.rb +9 -9
- data/lib/bwapi/client/projects/queries/mentions.rb +5 -8
- data/lib/bwapi/client/projects/query_groups.rb +7 -9
- data/lib/bwapi/client/projects/rules.rb +7 -9
- data/lib/bwapi/client/projects/rules/backfill.rb +4 -4
- data/lib/bwapi/client/projects/rules/copy.rb +4 -4
- data/lib/bwapi/client/projects/sharing.rb +8 -9
- data/lib/bwapi/client/projects/signals.rb +5 -5
- data/lib/bwapi/client/projects/stream_dashboards.rb +10 -10
- data/lib/bwapi/client/projects/stream_dashboards/streams.rb +6 -7
- data/lib/bwapi/client/projects/summary.rb +5 -6
- data/lib/bwapi/client/projects/tags.rb +8 -9
- data/lib/bwapi/client/projects/twitter_queries.rb +7 -8
- data/lib/bwapi/client/projects/users.rb +4 -4
- data/lib/bwapi/client/projects/workflow.rb +4 -4
- data/lib/bwapi/client/query_validation.rb +7 -7
- data/lib/bwapi/client/sso.rb +4 -4
- data/lib/bwapi/client/test_search.rb +9 -8
- data/lib/bwapi/client/user.rb +6 -6
- data/lib/bwapi/client/user/notifications.rb +8 -8
- data/lib/bwapi/configuration.rb +6 -6
- data/lib/bwapi/connection.rb +10 -19
- data/lib/bwapi/error.rb +43 -36
- data/lib/bwapi/request.rb +24 -27
- data/lib/bwapi/version.rb +5 -2
- data/lib/faraday/response/brandwatch_error.rb +21 -22
- data/spec/bwapi/authentication_spec.rb +7 -7
- data/spec/bwapi/client_spec.rb +17 -17
- data/spec/bwapi_spec.rb +3 -3
- data/spec/fixtures/.netrc +1 -1
- data/spec/helper.rb +4 -2
- metadata +61 -4
- data/lib/faraday/utils/utils.rb +0 -26
@@ -1,16 +1,17 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
module BWAPI
|
2
4
|
class Client
|
3
5
|
module Projects
|
4
6
|
# DataDownload module for projects/datadownload endpoints
|
5
7
|
module DataDownload
|
6
|
-
|
7
8
|
# Get all data downloads in project
|
8
9
|
#
|
9
10
|
# @param project_id [Integer] Id of project
|
10
11
|
# @option opts [Integer] page Page of projects to retrieve
|
11
12
|
# @option opts [Integer] pageSize Results per page of results
|
12
13
|
# @return [Hashie::Mash] All data downloads in project
|
13
|
-
def data_downloads
|
14
|
+
def data_downloads(project_id, opts = {})
|
14
15
|
get "projects/#{project_id}/datadownload", opts
|
15
16
|
end
|
16
17
|
|
@@ -19,10 +20,9 @@ module BWAPI
|
|
19
20
|
# @param project_id [Integer] Id of project
|
20
21
|
# @param data_download_id [Integer] Id of data download
|
21
22
|
# @return [Hashie::Mash] Specific data download
|
22
|
-
def get_data_download
|
23
|
+
def get_data_download(project_id, data_download_id)
|
23
24
|
get "projects/#{project_id}/datadownload/#{data_download_id}"
|
24
25
|
end
|
25
|
-
alias :data_download :get_data_download
|
26
26
|
|
27
27
|
# Create a new data download in project
|
28
28
|
#
|
@@ -40,11 +40,10 @@ module BWAPI
|
|
40
40
|
# @option opts [String] downloadLinkCSV The link to download the CSV format
|
41
41
|
# @option opts [Array] additionalColumns The additional columns for the data download
|
42
42
|
# @return [Hashie::Mash] New data download
|
43
|
-
def create_data_download
|
43
|
+
def create_data_download(project_id, opts = {})
|
44
44
|
post "projects/#{project_id}/datadownload", opts
|
45
45
|
end
|
46
|
-
|
47
46
|
end
|
48
47
|
end
|
49
48
|
end
|
50
|
-
end
|
49
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
module BWAPI
|
2
3
|
class Client
|
3
4
|
module Projects
|
4
5
|
# Demographics module for projects/demographics endpoints
|
5
6
|
module Demographics
|
6
|
-
|
7
7
|
# Get top values for given metric and query id
|
8
8
|
#
|
9
9
|
# @param project_id [Integer] Id of project
|
@@ -12,11 +12,10 @@ module BWAPI
|
|
12
12
|
# @option opts [Integer] limit The limit to return
|
13
13
|
# @option opts [Hash] filter The filters to apply
|
14
14
|
# @return [Hashie::Mash] All data downloads in project
|
15
|
-
def demographics
|
15
|
+
def demographics(project_id, metric, opts = {})
|
16
16
|
get "projects/#{project_id}/demographics/#{metric}", opts
|
17
17
|
end
|
18
|
-
|
19
18
|
end
|
20
19
|
end
|
21
20
|
end
|
22
|
-
end
|
21
|
+
end
|
@@ -1,14 +1,15 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
module BWAPI
|
2
4
|
class Client
|
3
5
|
module Projects
|
4
6
|
# FacebookQueries module for projects/facebookqueries endpoints
|
5
7
|
module FacebookQueries
|
6
|
-
|
7
8
|
# Get all facebook queries in a project
|
8
9
|
#
|
9
10
|
# @param project_id [Integer] Id of project
|
10
11
|
# @return [Hashie::Mash] All facebook queries in project
|
11
|
-
def facebook_queries
|
12
|
+
def facebook_queries(project_id)
|
12
13
|
get "projects/#{project_id}/facebookqueries"
|
13
14
|
end
|
14
15
|
|
@@ -17,10 +18,9 @@ module BWAPI
|
|
17
18
|
# @param project_id [Integer] Id of project
|
18
19
|
# @param query_id [Integer] Id of facebook query
|
19
20
|
# @return [Hashie::Mash] Specific facebook query
|
20
|
-
def get_facebook_query
|
21
|
+
def get_facebook_query(project_id, query_id)
|
21
22
|
get "projects/#{project_id}/facebookqueries/#{query_id}"
|
22
23
|
end
|
23
|
-
alias :facebook_query :get_facebook_query
|
24
24
|
|
25
25
|
# Create a facebook query in a project
|
26
26
|
#
|
@@ -46,7 +46,7 @@ module BWAPI
|
|
46
46
|
# @option opts [String] facebookConsumerKey Facebook consumer key
|
47
47
|
# @option opts [String] facebookAccessToken Facebook access token
|
48
48
|
# @return [Hashie::Mash] New facebook query
|
49
|
-
def create_facebook_query
|
49
|
+
def create_facebook_query(project_id, opts = {})
|
50
50
|
post "projects/#{project_id}/facebookqueries", opts
|
51
51
|
end
|
52
52
|
|
@@ -58,7 +58,7 @@ module BWAPI
|
|
58
58
|
# @option opts [String] consumerKey Facebook consumer key
|
59
59
|
# @option opts [Array] queryIds Array of query ids
|
60
60
|
# @return [Hashie::Mash] Authorised facebook queries
|
61
|
-
def authorise_facebook_queries
|
61
|
+
def authorise_facebook_queries(project_id, opts = {})
|
62
62
|
post "projects/#{project_id}/facebookqueries/authorise", opts
|
63
63
|
end
|
64
64
|
|
@@ -87,11 +87,10 @@ module BWAPI
|
|
87
87
|
# @option opts [String] facebookConsumerKey Facebook consumer key
|
88
88
|
# @option opts [String] facebookAccessToken Facebook access token
|
89
89
|
# @return [Hashie::Mash] Updated facebook query
|
90
|
-
def update_facebook_query
|
90
|
+
def update_facebook_query(project_id, query_id, opts = {})
|
91
91
|
put "projects/#{project_id}/facebookqueries/#{query_id}", opts
|
92
92
|
end
|
93
|
-
|
94
93
|
end
|
95
94
|
end
|
96
95
|
end
|
97
|
-
end
|
96
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require 'bwapi/client/projects/group/author_group'
|
2
3
|
require 'bwapi/client/projects/group/location_group'
|
3
4
|
require 'bwapi/client/projects/group/site_group'
|
@@ -7,11 +8,10 @@ module BWAPI
|
|
7
8
|
module Projects
|
8
9
|
# Group module for projects/group endpoint
|
9
10
|
module Group
|
10
|
-
|
11
11
|
include BWAPI::Client::Projects::Group::AuthorGroup
|
12
12
|
include BWAPI::Client::Projects::Group::LocationGroup
|
13
13
|
include BWAPI::Client::Projects::Group::SiteGroup
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
17
|
-
end
|
17
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
module BWAPI
|
2
4
|
class Client
|
3
5
|
module Projects
|
@@ -8,7 +10,7 @@ module BWAPI
|
|
8
10
|
#
|
9
11
|
# @param project_id [Integer] Id of project
|
10
12
|
# @return [Hashie::Mash] Summary of all author groups in project
|
11
|
-
def author_groups_summary
|
13
|
+
def author_groups_summary(project_id, opts = {})
|
12
14
|
get "projects/#{project_id}/group/author/summary", opts
|
13
15
|
end
|
14
16
|
|
@@ -17,10 +19,9 @@ module BWAPI
|
|
17
19
|
# @param project_id [Integer] Id of project
|
18
20
|
# @param author_group_id [Integer] Id of author group
|
19
21
|
# @return [Hashie::Mash] Specific author group
|
20
|
-
def get_author_group
|
22
|
+
def get_author_group(project_id, author_group_id)
|
21
23
|
get "projects/#{project_id}/group/author/#{author_group_id}"
|
22
24
|
end
|
23
|
-
alias :author_group :get_author_group
|
24
25
|
|
25
26
|
# Create a new author group in project
|
26
27
|
#
|
@@ -32,7 +33,7 @@ module BWAPI
|
|
32
33
|
# @option opts [String] shared The type of sharing for the group
|
33
34
|
# @option opts [Array] authors The authors in the group
|
34
35
|
# @return [Hashie::Mash] New author group
|
35
|
-
def create_author_group
|
36
|
+
def create_author_group(project_id, opts = {})
|
36
37
|
post "projects/#{project_id}/group/author", opts
|
37
38
|
end
|
38
39
|
|
@@ -48,7 +49,7 @@ module BWAPI
|
|
48
49
|
# @option opts [String] shared The type of sharing for the group
|
49
50
|
# @option opts [Array] authors The authors in the group
|
50
51
|
# @return [Hashie::Mash] Updated author group
|
51
|
-
def update_author_group
|
52
|
+
def update_author_group(project_id, author_group_id, opts = {})
|
52
53
|
put "projects/#{project_id}/group/author/#{author_group_id}", opts
|
53
54
|
end
|
54
55
|
|
@@ -57,11 +58,11 @@ module BWAPI
|
|
57
58
|
# @param project_id [Integer] Id of project
|
58
59
|
# @param author_group_id [Integer] Id of author group
|
59
60
|
# @return [Hashie::Mash] Deleted author group
|
60
|
-
def delete_author_group
|
61
|
+
def delete_author_group(project_id, author_group_id)
|
61
62
|
delete "projects/#{project_id}/group/author/#{author_group_id}"
|
62
63
|
end
|
63
64
|
end
|
64
65
|
end
|
65
66
|
end
|
66
67
|
end
|
67
|
-
end
|
68
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
module BWAPI
|
2
3
|
class Client
|
3
4
|
module Projects
|
@@ -8,7 +9,7 @@ module BWAPI
|
|
8
9
|
#
|
9
10
|
# @param project_id [Integer] Id of project
|
10
11
|
# @return [Hashie::Mash] Summary of all location groups in project
|
11
|
-
def location_groups_summary
|
12
|
+
def location_groups_summary(project_id, opts = {})
|
12
13
|
get "projects/#{project_id}/group/location/summary", opts
|
13
14
|
end
|
14
15
|
|
@@ -17,10 +18,9 @@ module BWAPI
|
|
17
18
|
# @param project_id [Integer] Id of project
|
18
19
|
# @param location_group_id [Integer] Id of location group
|
19
20
|
# @return [Hashie::Mash] Specific location group
|
20
|
-
def get_location_group
|
21
|
+
def get_location_group(project_id, location_group_id)
|
21
22
|
get "projects/#{project_id}/group/location/#{location_group_id}"
|
22
23
|
end
|
23
|
-
alias :location_group :get_location_group
|
24
24
|
|
25
25
|
# Create a new location group in project
|
26
26
|
#
|
@@ -32,7 +32,7 @@ module BWAPI
|
|
32
32
|
# @option opts [String] shared The type of sharing for the group
|
33
33
|
# @option opts [Array] location The location in the group
|
34
34
|
# @return [Hashie::Mash] New location group
|
35
|
-
def create_location_group
|
35
|
+
def create_location_group(project_id, opts = {})
|
36
36
|
post "projects/#{project_id}/group/location", opts
|
37
37
|
end
|
38
38
|
|
@@ -48,7 +48,7 @@ module BWAPI
|
|
48
48
|
# @option opts [String] shared The type of sharing for the group
|
49
49
|
# @option opts [Array] location The location in the group
|
50
50
|
# @return [Hashie::Mash] Updated location group
|
51
|
-
def update_location_group
|
51
|
+
def update_location_group(project_id, location_group_id, opts = {})
|
52
52
|
put "projects/#{project_id}/group/location/#{location_group_id}", opts
|
53
53
|
end
|
54
54
|
|
@@ -57,11 +57,11 @@ module BWAPI
|
|
57
57
|
# @param project_id [Integer] Id of project
|
58
58
|
# @param location_group_id [Integer] Id of location group
|
59
59
|
# @return [Hashie::Mash] Deleted location group
|
60
|
-
def delete_location_group
|
60
|
+
def delete_location_group(project_id, location_group_id)
|
61
61
|
delete "projects/#{project_id}/group/location/#{location_group_id}"
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
67
|
-
end
|
67
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
module BWAPI
|
2
3
|
class Client
|
3
4
|
module Projects
|
@@ -8,7 +9,7 @@ module BWAPI
|
|
8
9
|
#
|
9
10
|
# @param project_id [Integer] Id of project
|
10
11
|
# @return [Hashie::Mash] Summary of all site groups in project
|
11
|
-
def site_groups_summary
|
12
|
+
def site_groups_summary(project_id, opts = {})
|
12
13
|
get "projects/#{project_id}/group/site/summary", opts
|
13
14
|
end
|
14
15
|
|
@@ -17,10 +18,9 @@ module BWAPI
|
|
17
18
|
# @param project_id [Integer] Id of project
|
18
19
|
# @param site_group_id [Integer] Id of site group
|
19
20
|
# @return [Hashie::Mash] Specific site group
|
20
|
-
def get_site_group
|
21
|
+
def get_site_group(project_id, site_group_id)
|
21
22
|
get "projects/#{project_id}/group/site/#{site_group_id}"
|
22
23
|
end
|
23
|
-
alias :site_group :get_site_group
|
24
24
|
|
25
25
|
# Create a new site group in project
|
26
26
|
#
|
@@ -32,7 +32,7 @@ module BWAPI
|
|
32
32
|
# @option opts [String] shared The type of sharing for the group
|
33
33
|
# @option opts [Array] sites The sites in the group
|
34
34
|
# @return [Hashie::Mash] New site group
|
35
|
-
def create_site_group
|
35
|
+
def create_site_group(project_id, opts = {})
|
36
36
|
post "projects/#{project_id}/group/site", opts
|
37
37
|
end
|
38
38
|
|
@@ -48,7 +48,7 @@ module BWAPI
|
|
48
48
|
# @option opts [String] shared The type of sharing for the group
|
49
49
|
# @option opts [Array] sites The sites in the group
|
50
50
|
# @return [Hashie::Mash] Updated site group
|
51
|
-
def update_site_group
|
51
|
+
def update_site_group(project_id, site_group_id, opts = {})
|
52
52
|
put "projects/#{project_id}/group/site/#{site_group_id}", opts
|
53
53
|
end
|
54
54
|
|
@@ -57,11 +57,11 @@ module BWAPI
|
|
57
57
|
# @param project_id [Integer] Id of project
|
58
58
|
# @param site_group_id [Integer] Id of site group
|
59
59
|
# @return [Hashie::Mash] Deleted site group
|
60
|
-
def delete_site_group
|
60
|
+
def delete_site_group(project_id, site_group_id)
|
61
61
|
delete "projects/#{project_id}/group/site/#{site_group_id}"
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
67
|
-
end
|
67
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require 'bwapi/client/projects/queries/backfill'
|
2
4
|
require 'bwapi/client/projects/queries/date_range'
|
3
5
|
require 'bwapi/client/projects/queries/mentions'
|
@@ -7,7 +9,6 @@ module BWAPI
|
|
7
9
|
module Projects
|
8
10
|
# Queries module for projects/queries endpoints
|
9
11
|
module Queries
|
10
|
-
|
11
12
|
# Get all queries in project
|
12
13
|
#
|
13
14
|
# @param project_id [Integer] Id of project
|
@@ -17,7 +18,7 @@ module BWAPI
|
|
17
18
|
# @option opts [Integer] page Page of results to retrieve
|
18
19
|
# @option opts [Integer] pageSize Results per page of results
|
19
20
|
# @return [Hashie::Mash] All queries in project
|
20
|
-
def queries
|
21
|
+
def queries(project_id, opts = {})
|
21
22
|
get "projects/#{project_id}/queries", opts
|
22
23
|
end
|
23
24
|
|
@@ -25,7 +26,7 @@ module BWAPI
|
|
25
26
|
#
|
26
27
|
# @param project_id [Integer] Id of project
|
27
28
|
# @return [Hashie::Mash] Summary of all queries in project
|
28
|
-
def queries_summary
|
29
|
+
def queries_summary(project_id)
|
29
30
|
get "projects/#{project_id}/queries/summary"
|
30
31
|
end
|
31
32
|
|
@@ -34,10 +35,9 @@ module BWAPI
|
|
34
35
|
# @param project_id [Integer] Id of project
|
35
36
|
# @param query_id [Integer] Id of query
|
36
37
|
# @return [Hashie::Mash] Specific query
|
37
|
-
def get_query
|
38
|
+
def get_query(project_id, query_id)
|
38
39
|
get "projects/#{project_id}/queries/#{query_id}"
|
39
40
|
end
|
40
|
-
alias :query :get_query
|
41
41
|
|
42
42
|
# Create a new query in project
|
43
43
|
#
|
@@ -58,7 +58,7 @@ module BWAPI
|
|
58
58
|
# @option opts [Date] creationDate Date the query was created on
|
59
59
|
# @option opts [Date] lastModificationDate Modification date of the query
|
60
60
|
# @return [Hashie::Mash] New query
|
61
|
-
def create_query
|
61
|
+
def create_query(project_id, opts = {})
|
62
62
|
post "projects/#{project_id}/queries", opts
|
63
63
|
end
|
64
64
|
|
@@ -82,7 +82,7 @@ module BWAPI
|
|
82
82
|
# @option opts [Date] creationDate Date the query was created on
|
83
83
|
# @option opts [Date] lastModificationDate Modification date of the query
|
84
84
|
# @return [Hashie::Mash] Updated query
|
85
|
-
def update_query
|
85
|
+
def update_query(project_id, query_id, opts = {})
|
86
86
|
put "projects/#{project_id}/queries/#{query_id}", opts
|
87
87
|
end
|
88
88
|
|
@@ -91,15 +91,14 @@ module BWAPI
|
|
91
91
|
# @param project_id [Integer] Id of project
|
92
92
|
# @param query_id [Integer] Id of query
|
93
93
|
# @return [Hashie::Mash] Deleted query
|
94
|
-
def delete_query
|
94
|
+
def delete_query(project_id, query_id)
|
95
95
|
delete "projects/#{project_id}/queries/#{query_id}"
|
96
96
|
end
|
97
97
|
|
98
98
|
include BWAPI::Client::Projects::Queries::Backfill
|
99
99
|
include BWAPI::Client::Projects::Queries::DateRange
|
100
100
|
include BWAPI::Client::Projects::Queries::Mentions
|
101
|
-
|
102
101
|
end
|
103
102
|
end
|
104
103
|
end
|
105
|
-
end
|
104
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
module BWAPI
|
2
3
|
class Client
|
3
4
|
module Projects
|
4
5
|
module Queries
|
5
6
|
# Backfill module for projects/queries/backfill endpoints
|
6
7
|
module Backfill
|
7
|
-
|
8
8
|
# Get all backfills for query
|
9
9
|
#
|
10
10
|
# @param project_id [Integer] Id of project
|
@@ -13,7 +13,7 @@ module BWAPI
|
|
13
13
|
# @option opts [Integer] page Page of results to retrieve
|
14
14
|
# @option opts [Integer] pageSize Results per page
|
15
15
|
# @return [Hashie::Mash] All backfills for query
|
16
|
-
def backfills
|
16
|
+
def backfills(project_id, query_id, opts = {})
|
17
17
|
get "projects/#{project_id}/queries/#{query_id}/backfill", opts
|
18
18
|
end
|
19
19
|
|
@@ -23,10 +23,9 @@ module BWAPI
|
|
23
23
|
# @param query_id [Integer] Id of query
|
24
24
|
# @param backfill_id [Integer] Id of backfill
|
25
25
|
# @return [Hashie::Mash] Backfill for query
|
26
|
-
def get_backfill
|
26
|
+
def get_backfill(project_id, query_id, backfill_id)
|
27
27
|
get "projects/#{project_id}/queries/#{query_id}/backfill/#{backfill_id}"
|
28
28
|
end
|
29
|
-
alias :backfill :get_backfill
|
30
29
|
|
31
30
|
# Create new backfill for query
|
32
31
|
#
|
@@ -43,7 +42,7 @@ module BWAPI
|
|
43
42
|
# @option opts [Integer] queryId Query id of backfill
|
44
43
|
# @option opts [String] statusMessages Current status message of backfill
|
45
44
|
# @return [Hashie::Mash] New backfill for query
|
46
|
-
def create_backfill
|
45
|
+
def create_backfill(project_id, query_id, opts = {})
|
47
46
|
post "projects/#{project_id}/queries/#{query_id}/backfill", opts
|
48
47
|
end
|
49
48
|
|
@@ -53,12 +52,11 @@ module BWAPI
|
|
53
52
|
# @param query_id [Integer] Id of query
|
54
53
|
# @param backfill_id [Integer] Id of backfill
|
55
54
|
# @return [Hashie::Mash] Deleted backfill for query
|
56
|
-
def delete_backfill
|
55
|
+
def delete_backfill(project_id, query_id, backfill_id)
|
57
56
|
delete "projects/#{project_id}/queries/#{query_id}/backfill/#{backfill_id}"
|
58
57
|
end
|
59
|
-
|
60
58
|
end
|
61
59
|
end
|
62
60
|
end
|
63
61
|
end
|
64
|
-
end
|
62
|
+
end
|