bwapi 10.0.0.pre.549 → 10.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.editorconfig +1 -1
- data/.gitignore +1 -1
- data/lib/bwapi/client.rb +3 -26
- data/lib/bwapi/client/admin.rb +0 -2
- data/lib/bwapi/client/brandwatch.rb +0 -6
- data/lib/bwapi/client/brandwatch/become.rb +2 -0
- data/lib/bwapi/client/brandwatch/clients.rb +8 -2
- data/lib/bwapi/client/brandwatch/clients/users.rb +2 -0
- data/lib/bwapi/client/command_center.rb +0 -12
- data/lib/bwapi/client/command_center/displays/scenes.rb +1 -1
- data/lib/bwapi/client/command_center/scene_types.rb +3 -3
- data/lib/bwapi/client/oauth.rb +1 -2
- data/lib/bwapi/client/projects.rb +11 -13
- data/lib/bwapi/client/projects/{bulk_actions.rb → bulkactions.rb} +2 -2
- data/lib/bwapi/client/projects/{bulk_actions → bulkactions}/author.rb +0 -0
- data/lib/bwapi/client/projects/{bulk_actions → bulkactions}/mentions.rb +0 -0
- data/lib/bwapi/client/projects/data.rb +0 -20
- data/lib/bwapi/client/projects/data/mentions.rb +2 -32
- data/lib/bwapi/client/projects/signals/groups.rb +5 -18
- data/lib/bwapi/client/user.rb +0 -2
- data/lib/bwapi/configuration.rb +2 -3
- data/lib/bwapi/default.rb +3 -7
- data/lib/bwapi/error.rb +2 -0
- data/spec/bwapi/client_spec.rb +167 -29
- metadata +30 -72
- data/lib/bwapi/client/admin/demographics.rb +0 -17
- data/lib/bwapi/client/aggregates.rb +0 -13
- data/lib/bwapi/client/author.rb +0 -56
- data/lib/bwapi/client/brandwatch/clients/command_center.rb +0 -20
- data/lib/bwapi/client/brandwatch/clients/command_center/limits.rb +0 -33
- data/lib/bwapi/client/brandwatch/clients/command_center/scene_types.rb +0 -26
- data/lib/bwapi/client/brandwatch/clients/command_center/themes.rb +0 -26
- data/lib/bwapi/client/brandwatch/clients/command_center/users.rb +0 -30
- data/lib/bwapi/client/brandwatch/clients/command_center/users/access.rb +0 -28
- data/lib/bwapi/client/brandwatch/command_center.rb +0 -14
- data/lib/bwapi/client/brandwatch/command_center/scene_types.rb +0 -31
- data/lib/bwapi/client/brandwatch/command_center/themes.rb +0 -17
- data/lib/bwapi/client/brandwatch/log_level.rb +0 -17
- data/lib/bwapi/client/brandwatch/price_structures.rb +0 -45
- data/lib/bwapi/client/brandwatch/usage_report.rb +0 -19
- data/lib/bwapi/client/command_center/category_colours.rb +0 -15
- data/lib/bwapi/client/command_center/colour_palette.rb +0 -22
- data/lib/bwapi/client/command_center/display_access.rb +0 -12
- data/lib/bwapi/client/command_center/display_access/users.rb +0 -14
- data/lib/bwapi/client/command_center/display_access/users/access.rb +0 -21
- data/lib/bwapi/client/command_center/projects.rb +0 -16
- data/lib/bwapi/client/command_center/projects/category_colours.rb +0 -45
- data/lib/bwapi/client/command_center/projects/data.rb +0 -21
- data/lib/bwapi/client/command_center/projects/tag_colours.rb +0 -45
- data/lib/bwapi/client/command_center/query_colours.rb +0 -36
- data/lib/bwapi/client/command_center/tag_colours.rb +0 -15
- data/lib/bwapi/client/dimensions.rb +0 -13
- data/lib/bwapi/client/projects/data/audience.rb +0 -21
- data/lib/bwapi/client/projects/data/audience_activity.rb +0 -21
- data/lib/bwapi/client/projects/data/channel_metrics.rb +0 -21
- data/lib/bwapi/client/projects/data/emoticons.rb +0 -23
- data/lib/bwapi/client/projects/data/hashtags.rb +0 -23
- data/lib/bwapi/client/projects/data/headlines.rb +0 -20
- data/lib/bwapi/client/projects/data/impressions.rb +0 -21
- data/lib/bwapi/client/projects/data/mentioned_authors.rb +0 -23
- data/lib/bwapi/client/projects/data/owner_activity.rb +0 -21
- data/lib/bwapi/client/projects/data/urls.rb +0 -23
- data/lib/bwapi/client/projects/query/mentionfind.rb +0 -21
- data/lib/bwapi/client/user/instagram_credentials.rb +0 -32
- data/spec/bwapi/configuration_spec.rb +0 -499
- data/spec/bwapi/default_spec.rb +0 -242
data/spec/bwapi/default_spec.rb
DELETED
@@ -1,242 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
|
-
describe BWAPI::Default do
|
4
|
-
describe 'constants' do
|
5
|
-
it 'should have an ADAPTER constant with a default value' do
|
6
|
-
expect(BWAPI::Default::ADAPTER).to eql(:net_http)
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'should have an API_ENDPOINT constant with a default value' do
|
10
|
-
expect(BWAPI::Default::API_ENDPOINT).to eql('https://newapi.brandwatch.com/')
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'should have an CLIENT_ID constant with a default value' do
|
14
|
-
expect(BWAPI::Default::CLIENT_ID).to eql('brandwatch-api-client')
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'should have an GRANT_TYPE constant with a default value' do
|
18
|
-
expect(BWAPI::Default::GRANT_TYPE).to eql('api-password')
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should have an USER_AGENT constant with a default value' do
|
22
|
-
expect(BWAPI::Default::USER_AGENT).to eql("BWAPI Ruby Gem #{BWAPI::VERSION}")
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe '.options' do
|
27
|
-
it 'should return the configuration keys' do
|
28
|
-
expect(BWAPI::Default.options).to eql(
|
29
|
-
access_token: nil,
|
30
|
-
access_token_expiry: nil,
|
31
|
-
adapter: :net_http,
|
32
|
-
api_endpoint: 'https://newapi.brandwatch.com/',
|
33
|
-
client_id: 'brandwatch-api-client',
|
34
|
-
client_secret: nil,
|
35
|
-
connection_options: {
|
36
|
-
headers: {
|
37
|
-
user_agent: 'BWAPI Ruby Gem 10.0.0'
|
38
|
-
},
|
39
|
-
request: {
|
40
|
-
params_encoder: Faraday::FlatParamsEncoder
|
41
|
-
}
|
42
|
-
},
|
43
|
-
debug: false,
|
44
|
-
grant_type: 'api-password',
|
45
|
-
logger: nil,
|
46
|
-
password: nil,
|
47
|
-
performance: {},
|
48
|
-
refresh_token: nil,
|
49
|
-
user_agent: 'BWAPI Ruby Gem 10.0.0',
|
50
|
-
username: nil,
|
51
|
-
verify_ssl: false
|
52
|
-
)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
describe '.access_token' do
|
57
|
-
after { ENV['BWAPI_ACCESS_TOKEN'] = nil }
|
58
|
-
|
59
|
-
it 'should return nil when no environmental variable is set' do
|
60
|
-
expect(BWAPI::Default.access_token).to eql(nil)
|
61
|
-
end
|
62
|
-
|
63
|
-
it 'should return the correct value when the environment variable is set' do
|
64
|
-
ENV['BWAPI_ACCESS_TOKEN'] = '1234-5678-9101-1234'
|
65
|
-
expect(BWAPI::Default.access_token).to eql('1234-5678-9101-1234')
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
describe '.access_token_expiry' do
|
70
|
-
it 'should return nil as default' do
|
71
|
-
expect(BWAPI::Default.access_token_expiry).to eql(nil)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
describe '.adapter' do
|
76
|
-
after { ENV['BWAPI_ADAPTER'] = nil }
|
77
|
-
|
78
|
-
it 'should return the default value when no environmental variable is set' do
|
79
|
-
expect(BWAPI::Default.adapter).to eql(:net_http)
|
80
|
-
end
|
81
|
-
|
82
|
-
it 'should return the correct value when the environment variable is set' do
|
83
|
-
ENV['BWAPI_ADAPTER'] = 'test'
|
84
|
-
expect(BWAPI::Default.adapter).to eql(:test)
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
describe '.api_endpoint' do
|
89
|
-
after { ENV['BWAPI_API_ENDPOINT'] = nil }
|
90
|
-
|
91
|
-
it 'should return the default value when no environmental variable is set' do
|
92
|
-
expect(BWAPI::Default.api_endpoint).to eql('https://newapi.brandwatch.com/')
|
93
|
-
end
|
94
|
-
|
95
|
-
it 'should return the correct value when the environment variable is set' do
|
96
|
-
ENV['BWAPI_API_ENDPOINT'] = 'https://newapi.test.brandwatch.com'
|
97
|
-
expect(BWAPI::Default.api_endpoint).to eql('https://newapi.test.brandwatch.com')
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
describe '.client_id' do
|
102
|
-
after { ENV['BWAPI_CLIENT_ID'] = nil }
|
103
|
-
|
104
|
-
it 'should return the default value when no environmental variable is set' do
|
105
|
-
expect(BWAPI::Default.client_id).to eql('brandwatch-api-client')
|
106
|
-
end
|
107
|
-
|
108
|
-
it 'should return the correct value when the environment variable is set' do
|
109
|
-
ENV['BWAPI_CLIENT_ID'] = 'brandwatch-test-client'
|
110
|
-
expect(BWAPI::Default.client_id).to eql('brandwatch-test-client')
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
describe '.client_secret' do
|
115
|
-
after { ENV['BWAPI_CLIENT_SECRET'] = nil }
|
116
|
-
|
117
|
-
it 'should return nil as default' do
|
118
|
-
expect(BWAPI::Default.client_secret).to eql(nil)
|
119
|
-
end
|
120
|
-
|
121
|
-
it 'should return the correct value when the environment variable is set' do
|
122
|
-
ENV['BWAPI_CLIENT_SECRET'] = 'secret'
|
123
|
-
expect(BWAPI::Default.client_secret).to eql('secret')
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
describe '.connection_options' do
|
128
|
-
it 'should return the default hash values' do
|
129
|
-
expect(BWAPI::Default.connection_options).to eql(
|
130
|
-
headers: {
|
131
|
-
user_agent: 'BWAPI Ruby Gem 10.0.0'
|
132
|
-
},
|
133
|
-
request: {
|
134
|
-
params_encoder: Faraday::FlatParamsEncoder
|
135
|
-
}
|
136
|
-
)
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
describe '.debug' do
|
141
|
-
after { ENV['BWAPI_DEBUG'] = nil }
|
142
|
-
|
143
|
-
it 'should return false as default' do
|
144
|
-
expect(BWAPI::Default.debug).to eql(false)
|
145
|
-
end
|
146
|
-
|
147
|
-
it 'should return the correct value when the environment variable is set' do
|
148
|
-
ENV['BWAPI_DEBUG'] = 'true'
|
149
|
-
expect(BWAPI::Default.debug).to eql(true)
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
|
-
describe '.grant_type' do
|
154
|
-
after { ENV['BWAPI_GRANT_TYPE'] = nil }
|
155
|
-
|
156
|
-
it 'should return the default value when no environmental variable is set' do
|
157
|
-
expect(BWAPI::Default.grant_type).to eql('api-password')
|
158
|
-
end
|
159
|
-
|
160
|
-
it 'should return the correct value when the environment variable is set' do
|
161
|
-
ENV['BWAPI_GRANT_TYPE'] = 'test-grant'
|
162
|
-
expect(BWAPI::Default.grant_type).to eql('test-grant')
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
describe '.logger' do
|
167
|
-
it 'should return nil as default' do
|
168
|
-
expect(BWAPI::Default.logger).to eql(nil)
|
169
|
-
end
|
170
|
-
end
|
171
|
-
|
172
|
-
describe '.password' do
|
173
|
-
after { ENV['BWAPI_PASSWORD'] = nil }
|
174
|
-
|
175
|
-
it 'should return nil as default' do
|
176
|
-
expect(BWAPI::Default.password).to eql(nil)
|
177
|
-
end
|
178
|
-
|
179
|
-
it 'should return the correct value when the environment variable is set' do
|
180
|
-
ENV['BWAPI_PASSWORD'] = 'p455word'
|
181
|
-
expect(BWAPI::Default.password).to eql('p455word')
|
182
|
-
end
|
183
|
-
end
|
184
|
-
|
185
|
-
describe '.performance' do
|
186
|
-
it 'should return an empty hash as default' do
|
187
|
-
expect(BWAPI::Default.performance).to eql({})
|
188
|
-
end
|
189
|
-
end
|
190
|
-
|
191
|
-
describe '.refresh_token' do
|
192
|
-
after { ENV['BWAPI_REFRESH_TOKEN'] = nil }
|
193
|
-
|
194
|
-
it 'should return nil as default' do
|
195
|
-
expect(BWAPI::Default.refresh_token).to eql(nil)
|
196
|
-
end
|
197
|
-
|
198
|
-
it 'should return the correct value when the environment variable is set' do
|
199
|
-
ENV['BWAPI_REFRESH_TOKEN'] = '1234-5678-9101-1234'
|
200
|
-
expect(BWAPI::Default.refresh_token).to eql('1234-5678-9101-1234')
|
201
|
-
end
|
202
|
-
end
|
203
|
-
|
204
|
-
describe '.user_agent' do
|
205
|
-
after { ENV['BWAPI_USER_AGENT'] = nil }
|
206
|
-
|
207
|
-
it 'should return the default value when no environmental variable is set' do
|
208
|
-
expect(BWAPI::Default.user_agent).to eql("BWAPI Ruby Gem #{BWAPI::VERSION}")
|
209
|
-
end
|
210
|
-
|
211
|
-
it 'should return the correct value when the environment variable is set' do
|
212
|
-
ENV['BWAPI_USER_AGENT'] = 'Test User Agent'
|
213
|
-
expect(BWAPI::Default.user_agent).to eql('Test User Agent')
|
214
|
-
end
|
215
|
-
end
|
216
|
-
|
217
|
-
describe '.username' do
|
218
|
-
after { ENV['BWAPI_USERNAME'] = nil }
|
219
|
-
|
220
|
-
it 'should return nil as default' do
|
221
|
-
expect(BWAPI::Default.username).to eql(nil)
|
222
|
-
end
|
223
|
-
|
224
|
-
it 'should return the correct value when the environment variable is set' do
|
225
|
-
ENV['BWAPI_USERNAME'] = 'test@brandwatch.com'
|
226
|
-
expect(BWAPI::Default.username).to eql('test@brandwatch.com')
|
227
|
-
end
|
228
|
-
end
|
229
|
-
|
230
|
-
describe '.verify_ssl' do
|
231
|
-
after { ENV['BWAPI_VERIFY_SSL'] = nil }
|
232
|
-
|
233
|
-
it 'should return false as default' do
|
234
|
-
expect(BWAPI::Default.verify_ssl).to eql(false)
|
235
|
-
end
|
236
|
-
|
237
|
-
it 'should return the correct value when the environment variable is set' do
|
238
|
-
ENV['BWAPI_VERIFY_SSL'] = 'true'
|
239
|
-
expect(BWAPI::Default.verify_ssl).to eql(true)
|
240
|
-
end
|
241
|
-
end
|
242
|
-
end
|