portatext 1.1.10 → 1.1.11
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/portatext/client/base_client.rb +2 -2
- data/lib/portatext/command/api/campaign_lifecycle.rb +1 -1
- data/lib/portatext/command/api/cnam.rb +1 -1
- data/lib/portatext/command/api/did_settings.rb +1 -1
- data/lib/portatext/command/api/number_verify.rb +40 -0
- data/lib/portatext.rb +1 -0
- data/portatext.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa032c8325252fc350d2ca66eed71aa25f58443f
|
4
|
+
data.tar.gz: a50a4acf2ebf4b1350483e18fd1517115aa33129
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba1d33e0c63a794cabf5ade7db726724787b26cd53b78ee4b0f2bd6f30bc9f0eee9688102d5e5018320f2931ebf505a6f5dfa1244dc8042223bd51de6030bdd0
|
7
|
+
data.tar.gz: d8151d28ef5de37975c94400b70092d1258da4bbf9454db6dae81ee2778b9a48da5f987cd86de6183dd1cf0d93bfcc495b99e82da2c11f12a88aa406900dd907
|
@@ -81,7 +81,7 @@ module PortaText
|
|
81
81
|
def assert_result(descriptor, result)
|
82
82
|
error = error_for result.code
|
83
83
|
return result if error.nil?
|
84
|
-
|
84
|
+
raise error, [descriptor, result]
|
85
85
|
end
|
86
86
|
|
87
87
|
def auth_method(auth_suggested)
|
@@ -123,7 +123,7 @@ module PortaText
|
|
123
123
|
when :api_key
|
124
124
|
headers['X-Api-Key'] = @api_key
|
125
125
|
else
|
126
|
-
|
126
|
+
raise "Invalid auth type: #{auth}"
|
127
127
|
end
|
128
128
|
headers
|
129
129
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module PortaText
|
2
|
+
module Command
|
3
|
+
module Api
|
4
|
+
# The number verify endpoint.
|
5
|
+
# https://github.com/PortaText/docs/wiki/REST-API#api_number_verify
|
6
|
+
#
|
7
|
+
# Author:: Marcelo Gornstein (mailto:marcelog@portatext.com)
|
8
|
+
# Copyright:: Copyright (c) 2015 PortaText
|
9
|
+
# License:: Apache-2.0
|
10
|
+
class NumberVerify < Base
|
11
|
+
def for_number(number)
|
12
|
+
set :number, number
|
13
|
+
end
|
14
|
+
|
15
|
+
def from(from)
|
16
|
+
set :from, from
|
17
|
+
end
|
18
|
+
|
19
|
+
def verify_with(code)
|
20
|
+
set :code, code
|
21
|
+
end
|
22
|
+
|
23
|
+
def use_template(id, variables = {})
|
24
|
+
set :template_id, id
|
25
|
+
set :variables, variables
|
26
|
+
end
|
27
|
+
|
28
|
+
def endpoint(_method)
|
29
|
+
raise 'DID number cant be null' if @args[:number].nil?
|
30
|
+
number = @args[:number]
|
31
|
+
@args.delete :number
|
32
|
+
return "number_verify/#{number}" if @args[:code].nil?
|
33
|
+
code = @args[:code]
|
34
|
+
@args.delete :code
|
35
|
+
"number_verify/#{number}?code=#{code}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/portatext.rb
CHANGED
@@ -35,6 +35,7 @@ require_relative 'portatext/command/api/sms_campaign'
|
|
35
35
|
require_relative 'portatext/command/api/campaign_lifecycle'
|
36
36
|
require_relative 'portatext/command/api/my_password'
|
37
37
|
require_relative 'portatext/command/api/variables'
|
38
|
+
require_relative 'portatext/command/api/number_verify'
|
38
39
|
|
39
40
|
# The PortaText namespace.
|
40
41
|
#
|
data/portatext.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: portatext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PortaText
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- lib/portatext/command/api/jobs.rb
|
153
153
|
- lib/portatext/command/api/me.rb
|
154
154
|
- lib/portatext/command/api/my_password.rb
|
155
|
+
- lib/portatext/command/api/number_verify.rb
|
155
156
|
- lib/portatext/command/api/recharge.rb
|
156
157
|
- lib/portatext/command/api/settings.rb
|
157
158
|
- lib/portatext/command/api/sms.rb
|