nexmo 4.4.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/nexmo.rb +8 -24
- data/lib/nexmo/version.rb +1 -1
- data/nexmo.gemspec +1 -1
- data/spec/nexmo_spec.rb +16 -40
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 439a33a2772242ae8bd36c38485dba3e993c0e7e
|
4
|
+
data.tar.gz: da75c2646fc649aa480d5fbf1a22765e59e8bfe6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3d829a39cf396a2ce3186abae44ce8b1ebc4037fcf29c9a3fee212a1b17373d8970e2ab83002a000c23c146141c49b7244fc675cf6a6530f33f63c67a3bfaf7
|
7
|
+
data.tar.gz: 828c598a241f0a02e2ffe762dd2f20f575fc7ebb870a4ec58a1685d24220b41c72e0ea20ce71304bd337d3bb17bf96679a71f4ad9cfed17c5fea4e86c803710f
|
data/lib/nexmo.rb
CHANGED
@@ -41,6 +41,14 @@ module Nexmo
|
|
41
41
|
post(@host, '/sms/json', params)
|
42
42
|
end
|
43
43
|
|
44
|
+
def track_message_conversion(message_id, params = {})
|
45
|
+
post(@api_host, '/conversions/sms', {'message-id' => message_id}.merge(params))
|
46
|
+
end
|
47
|
+
|
48
|
+
def track_voice_conversion(message_id, params = {})
|
49
|
+
post(@api_host, '/conversions/voice', {'message-id' => message_id}.merge(params))
|
50
|
+
end
|
51
|
+
|
44
52
|
def get_balance
|
45
53
|
get(@host, '/account/get-balance')
|
46
54
|
end
|
@@ -159,32 +167,14 @@ module Nexmo
|
|
159
167
|
post(@api_host, '/verify/json', params)
|
160
168
|
end
|
161
169
|
|
162
|
-
def send_verification_request(params)
|
163
|
-
Kernel.warn "#{self.class}##{__method__} is deprecated (use #start_verification instead)."
|
164
|
-
|
165
|
-
post(@api_host, '/verify/json', params)
|
166
|
-
end
|
167
|
-
|
168
170
|
def check_verification(request_id, params)
|
169
171
|
post(@api_host, '/verify/check/json', params.merge(request_id: request_id))
|
170
172
|
end
|
171
173
|
|
172
|
-
def check_verification_request(params)
|
173
|
-
Kernel.warn "#{self.class}##{__method__} is deprecated (use #check_verification instead)."
|
174
|
-
|
175
|
-
post(@api_host, '/verify/check/json', params)
|
176
|
-
end
|
177
|
-
|
178
174
|
def get_verification(request_id)
|
179
175
|
get(@api_host, '/verify/search/json', request_id: request_id)
|
180
176
|
end
|
181
177
|
|
182
|
-
def get_verification_request(id)
|
183
|
-
Kernel.warn "#{self.class}##{__method__} is deprecated (use #get_verification instead)."
|
184
|
-
|
185
|
-
get(@api_host, '/verify/search/json', request_id: id)
|
186
|
-
end
|
187
|
-
|
188
178
|
def cancel_verification(request_id)
|
189
179
|
post(@api_host, '/verify/control/json', request_id: request_id, cmd: 'cancel')
|
190
180
|
end
|
@@ -193,12 +183,6 @@ module Nexmo
|
|
193
183
|
post(@api_host, '/verify/control/json', request_id: request_id, cmd: 'trigger_next_event')
|
194
184
|
end
|
195
185
|
|
196
|
-
def control_verification_request(params)
|
197
|
-
Kernel.warn "#{self.class}##{__method__} is deprecated."
|
198
|
-
|
199
|
-
post(@api_host, '/verify/control/json', params)
|
200
|
-
end
|
201
|
-
|
202
186
|
def get_basic_number_insight(params)
|
203
187
|
get(@api_host, '/ni/basic/json', params)
|
204
188
|
end
|
data/lib/nexmo/version.rb
CHANGED
data/nexmo.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.files = Dir.glob('{lib,spec}/**/*') + %w(LICENSE.txt README.md nexmo.gemspec)
|
14
14
|
s.required_ruby_version = '>= 1.9.3'
|
15
15
|
s.add_dependency('jwt')
|
16
|
-
s.add_development_dependency('rake'
|
16
|
+
s.add_development_dependency('rake')
|
17
17
|
s.add_development_dependency('minitest', '~> 5.0')
|
18
18
|
|
19
19
|
if RUBY_VERSION == '1.9.3'
|
data/spec/nexmo_spec.rb
CHANGED
@@ -33,6 +33,22 @@ describe 'Nexmo::Client' do
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
describe 'track_message_conversion method' do
|
37
|
+
it 'posts to the sms conversions resource and returns the response object' do
|
38
|
+
expect_post "#@api_base_url/conversions/sms", "message-id=12345&delivered=true&api_key=#@api_key&api_secret=#@api_secret"
|
39
|
+
|
40
|
+
@client.track_message_conversion('12345', delivered: true).must_equal(@response_object)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe 'track_voice_conversion method' do
|
45
|
+
it 'posts to the voice conversions resource and returns the response object' do
|
46
|
+
expect_post "#@api_base_url/conversions/voice", "message-id=12345&delivered=true&api_key=#@api_key&api_secret=#@api_secret"
|
47
|
+
|
48
|
+
@client.track_voice_conversion('12345', delivered: true).must_equal(@response_object)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
36
52
|
describe 'get_balance method' do
|
37
53
|
it 'fetches the account balance resource and returns the response object' do
|
38
54
|
expect_get "#@base_url/account/get-balance?api_key=#@api_key&api_secret=#@api_secret"
|
@@ -269,16 +285,6 @@ describe 'Nexmo::Client' do
|
|
269
285
|
end
|
270
286
|
end
|
271
287
|
|
272
|
-
describe 'send_verification_request method' do
|
273
|
-
it 'posts to the verify resource and returns the response object' do
|
274
|
-
expect_post "#@api_base_url/verify/json", "api_key=#@api_key&api_secret=#@api_secret&number=447525856424&brand=MyApp"
|
275
|
-
|
276
|
-
Kernel.stub :warn, proc { |message| message.must_match(/send_verification_request is deprecated/) } do
|
277
|
-
@client.send_verification_request(number: '447525856424', brand: 'MyApp').must_equal(@response_object)
|
278
|
-
end
|
279
|
-
end
|
280
|
-
end
|
281
|
-
|
282
288
|
describe 'check_verification method' do
|
283
289
|
it 'posts to the verify check resource and returns the response object' do
|
284
290
|
expect_post "#@api_base_url/verify/check/json", "api_key=#@api_key&api_secret=#@api_secret&request_id=8g88g88eg8g8gg9g90&code=123445"
|
@@ -287,16 +293,6 @@ describe 'Nexmo::Client' do
|
|
287
293
|
end
|
288
294
|
end
|
289
295
|
|
290
|
-
describe 'check_verification_request method' do
|
291
|
-
it 'posts to the verify check resource and returns the response object' do
|
292
|
-
expect_post "#@api_base_url/verify/check/json", "api_key=#@api_key&api_secret=#@api_secret&request_id=8g88g88eg8g8gg9g90&code=123445"
|
293
|
-
|
294
|
-
Kernel.stub :warn, proc { |message| message.must_match(/check_verification_request is deprecated/) } do
|
295
|
-
@client.check_verification_request(request_id: '8g88g88eg8g8gg9g90', code: '123445').must_equal(@response_object)
|
296
|
-
end
|
297
|
-
end
|
298
|
-
end
|
299
|
-
|
300
296
|
describe 'get_verification method' do
|
301
297
|
it 'fetches the verify search resource with the given request id and returns the response object' do
|
302
298
|
expect_get "#@api_base_url/verify/search/json?api_key=#@api_key&api_secret=#@api_secret&request_id=8g88g88eg8g8gg9g90"
|
@@ -305,16 +301,6 @@ describe 'Nexmo::Client' do
|
|
305
301
|
end
|
306
302
|
end
|
307
303
|
|
308
|
-
describe 'get_verification_request method' do
|
309
|
-
it 'fetches the verify search resource with the given request id and returns the response object' do
|
310
|
-
expect_get "#@api_base_url/verify/search/json?api_key=#@api_key&api_secret=#@api_secret&request_id=8g88g88eg8g8gg9g90"
|
311
|
-
|
312
|
-
Kernel.stub :warn, proc { |message| message.must_match(/get_verification_request is deprecated/) } do
|
313
|
-
@client.get_verification_request('8g88g88eg8g8gg9g90').must_equal(@response_object)
|
314
|
-
end
|
315
|
-
end
|
316
|
-
end
|
317
|
-
|
318
304
|
describe 'cancel_verification method' do
|
319
305
|
it 'posts to the verify control resource and returns the response object' do
|
320
306
|
expect_post "#@api_base_url/verify/control/json", "api_key=#@api_key&api_secret=#@api_secret&request_id=8g88g88eg8g8gg9g90&cmd=cancel"
|
@@ -331,16 +317,6 @@ describe 'Nexmo::Client' do
|
|
331
317
|
end
|
332
318
|
end
|
333
319
|
|
334
|
-
describe 'control_verification_request method' do
|
335
|
-
it 'posts to the verify control resource and returns the response object' do
|
336
|
-
expect_post "#@api_base_url/verify/control/json", "api_key=#@api_key&api_secret=#@api_secret&request_id=8g88g88eg8g8gg9g90&cmd=cancel"
|
337
|
-
|
338
|
-
Kernel.stub :warn, proc { |message| message.must_match(/control_verification_request is deprecated/) } do
|
339
|
-
@client.control_verification_request(request_id: '8g88g88eg8g8gg9g90', cmd: 'cancel').must_equal(@response_object)
|
340
|
-
end
|
341
|
-
end
|
342
|
-
end
|
343
|
-
|
344
320
|
describe 'get_basic_number_insight method' do
|
345
321
|
it 'fetches the number format resource and returns the response object' do
|
346
322
|
expect_get "#@api_base_url/ni/basic/json?api_key=#@api_key&api_secret=#@api_secret&number=447525856424"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexmo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Craft
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.5.
|
109
|
+
rubygems_version: 2.5.2
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: This is the Ruby client library for Nexmo's API. To use it you'll need a
|