plivo 4.52.0 → 4.53.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +2 -2
- data/lib/plivo/base/resource_interface.rb +1 -1
- data/lib/plivo/resources/verify_session.rb +106 -0
- data/lib/plivo/resources.rb +1 -0
- data/lib/plivo/rest_client.rb +2 -0
- data/lib/plivo/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 165ab55e98fbfd73f9ea8e8f7cebc6016a76e703
|
4
|
+
data.tar.gz: e33c4b9315f62bee5102194d593bec08bff5df3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b7af2135d6c3107c4da88719a23c82134a304ec5c65c16dbe7983fe1ae9033098d99ee93f05a5e73021d4d4aa2b11336dec13f80dc40f625d597e6471d975ec
|
7
|
+
data.tar.gz: b11f266cecc2848ffda32719f9d4eb78583dc4d4aca26c58e7d16b9ab4fbf4ed5adfc3e0797fc6eb8c447b22593ce49a931951319390b820da0dc7681e95a724
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
|
4
|
+
## [4.53.0](https://github.com/plivo/plivo-ruby/tree/v4.53.0) (2023-11-08)
|
5
|
+
**Feature - Verify Service**
|
6
|
+
-Added Support for Verify Service Public API'S
|
7
|
+
-Create Session API(POST): To create a verify session (2FA). Allowed params recipient, method, channel, callback_url, app_uuid
|
8
|
+
-Get Session API(GET): To retrieve a particular session
|
9
|
+
-List Sessions : To retrieve all the sessions
|
10
|
+
-Validate Session : To validate OTP for a particular session
|
11
|
+
|
3
12
|
## [4.52.0](https://github.com/plivo/plivo-ruby/tree/v4.52.0) (2023-11-08)
|
4
13
|
**[BETA] Feature - TollFree Verification API Support**
|
5
14
|
- API support for Create, Update, Get, Delete, and List Tollfree Verification.
|
@@ -23,6 +32,7 @@
|
|
23
32
|
**Feature - Added New Param 'carrier_fees', 'carrier_fees_rate', 'destination_network' in Get Message and List Message APIs**
|
24
33
|
- Added new params on message get and list response
|
25
34
|
|
35
|
+
|
26
36
|
## [4.47.0](https://github.com/plivo/plivo-ruby/tree/v4.47.0) (2023-08-03)
|
27
37
|
**Feature - DLT parameters**
|
28
38
|
- Added new params `DLTEntityID`, `DLTTemplateID`, `DLTTemplateCategory` to the [send message API](https://www.plivo.com/docs/sms/api/message/send-a-message/)
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby a
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'plivo', '>= 4.
|
12
|
+
gem 'plivo', '>= 4.53.0'
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
@@ -197,4 +197,4 @@ export PLIVO_API_PROD_HOST=<plivoapi_public_endpoint>
|
|
197
197
|
(The docker container should be running)
|
198
198
|
|
199
199
|
> Test code and unit tests can also be run within the container using
|
200
|
-
`make run` and `make test` respectively. (`CONTAINER` argument should be omitted when running from the container)
|
200
|
+
`make run` and `make test` respectively. (`CONTAINER` argument should be omitted when running from the container)
|
@@ -97,7 +97,7 @@ module Plivo
|
|
97
97
|
objects: @_resource_list
|
98
98
|
}
|
99
99
|
end
|
100
|
-
|
100
|
+
|
101
101
|
def perform_action(action = nil, method = 'GET', params = nil, parse = false)
|
102
102
|
resource_path = action ? @_resource_uri + action + '/' : @_resource_uri
|
103
103
|
response = @_client.send_request(resource_path, method, params, nil, false, is_voice_request: @_is_voice_request)
|
@@ -0,0 +1,106 @@
|
|
1
|
+
module Plivo
|
2
|
+
module Resources
|
3
|
+
include Plivo::Utils
|
4
|
+
class Session < Base::Resource
|
5
|
+
def initialize(client, options = nil)
|
6
|
+
@_name = 'Session'
|
7
|
+
@_identifier_string = 'session_uuid'
|
8
|
+
super
|
9
|
+
end
|
10
|
+
def to_s
|
11
|
+
{
|
12
|
+
api_id: @api_id,
|
13
|
+
session_uuid: @session_uuid,
|
14
|
+
app_uuid: @app_uuid,
|
15
|
+
alias: @alias,
|
16
|
+
recipient: @recipient,
|
17
|
+
channel: @channel,
|
18
|
+
status: @status,
|
19
|
+
count: @count,
|
20
|
+
requestor_ip: @requestor_ip,
|
21
|
+
destination_country_iso2: @destination_country_iso2,
|
22
|
+
destination_network: @destination_network,
|
23
|
+
attempt_details: @attempt_details,
|
24
|
+
charges: @charges,
|
25
|
+
created_at: @created_at,
|
26
|
+
updated_at: @updated_at
|
27
|
+
}.to_s
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class SessionInterface < Base::ResourceInterface
|
32
|
+
def initialize(client, resource_list_json = nil)
|
33
|
+
@_name = 'Verify/Session'
|
34
|
+
@_resource_type = Session
|
35
|
+
@_identifier_string = 'session_uuid'
|
36
|
+
super
|
37
|
+
end
|
38
|
+
|
39
|
+
# @param [String] session_uuid
|
40
|
+
def get(session_uuid)
|
41
|
+
perform_get(session_uuid)
|
42
|
+
end
|
43
|
+
|
44
|
+
def create(app_uuid = nil, recipient = nil,channel = nil,url = nil, method = nil)
|
45
|
+
valid_param?(:app_uuid, app_uuid, [String, Symbol], false)
|
46
|
+
valid_param?(:recipient, recipient, [Integer, String, Symbol], true)
|
47
|
+
valid_param?(:channel, channel, [String, Symbol], false)
|
48
|
+
valid_param?(:url, url, [String], false)
|
49
|
+
valid_param?(:method, method, String, false, %w[POST GET])
|
50
|
+
|
51
|
+
params = {
|
52
|
+
app_uuid: app_uuid,
|
53
|
+
recipient: recipient,
|
54
|
+
channel: channel,
|
55
|
+
url: url,
|
56
|
+
method: method
|
57
|
+
}
|
58
|
+
perform_create(params)
|
59
|
+
end
|
60
|
+
|
61
|
+
def list(options = nil)
|
62
|
+
return perform_list if options.nil?
|
63
|
+
valid_param?(:options, options, Hash, true)
|
64
|
+
params = {}
|
65
|
+
params_expected = %i[
|
66
|
+
subaccount status session_time__gt session_time__gte
|
67
|
+
session_time__lt session_time__lte session_time country alias app_uuid recipient
|
68
|
+
]
|
69
|
+
|
70
|
+
params_expected.each do |param|
|
71
|
+
if options.key?(param) &&
|
72
|
+
valid_param?(param, options[param], [String, Symbol], true)
|
73
|
+
params[param] = options[param]
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
%i[offset limit].each do |param|
|
78
|
+
if options.key?(param) &&
|
79
|
+
valid_param?(param, options[param], [Integer, Integer], true)
|
80
|
+
params[param] = options[param]
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
if options.key?(:limit) &&
|
85
|
+
(options[:limit] > 20 || options[:limit] <= 0)
|
86
|
+
raise_invalid_request('The maximum number of results that can be '\
|
87
|
+
"fetched is 20. limit can't be more than 20 or less than 1")
|
88
|
+
end
|
89
|
+
|
90
|
+
raise_invalid_request("Offset can't be negative") if options.key?(:offset) && options[:offset] < 0
|
91
|
+
|
92
|
+
perform_list_without_object(params)
|
93
|
+
end
|
94
|
+
|
95
|
+
def validate(session_uuid = nil, otp = nil)
|
96
|
+
valid_param?(:session_uuid, session_uuid, [String, Symbol], true)
|
97
|
+
valid_param?(:otp, otp, [String], true)
|
98
|
+
id = session_uuid
|
99
|
+
params = {
|
100
|
+
otp: otp
|
101
|
+
}
|
102
|
+
perform_action_with_identifier(id, 'POST', params)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
data/lib/plivo/resources.rb
CHANGED
@@ -22,6 +22,7 @@ require_relative 'resources/profile'
|
|
22
22
|
require_relative 'resources/lookup'
|
23
23
|
require_relative 'resources/regulatory_compliance'
|
24
24
|
require_relative 'resources/multipartycalls'
|
25
|
+
require_relative 'resources/verify_session'
|
25
26
|
require_relative 'resources/tollfree_verification'
|
26
27
|
|
27
28
|
module Plivo
|
data/lib/plivo/rest_client.rb
CHANGED
@@ -18,6 +18,7 @@ module Plivo
|
|
18
18
|
attr_reader :brand, :campaign, :profile
|
19
19
|
attr_reader :end_users
|
20
20
|
attr_reader :compliance_document_types, :compliance_documents, :compliance_requirements, :compliance_applications
|
21
|
+
attr_reader :verify_session
|
21
22
|
attr_reader :tollfree_verifications
|
22
23
|
|
23
24
|
def initialize(auth_id = nil, auth_token = nil, proxy_options = nil, timeout = 5)
|
@@ -65,6 +66,7 @@ module Plivo
|
|
65
66
|
@compliance_documents = Resources::ComplianceDocumentsInterface.new(self)
|
66
67
|
@compliance_requirements = Resources::ComplianceRequirementsInterface.new(self)
|
67
68
|
@compliance_applications = Resources::ComplianceApplicationsInterface.new(self)
|
69
|
+
@verify_session = Resources::SessionInterface.new(self)
|
68
70
|
@tollfree_verifications = Resources::TollfreeVerificationsInterface.new(self)
|
69
71
|
end
|
70
72
|
end
|
data/lib/plivo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plivo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.53.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Plivo SDKs Team
|
@@ -194,6 +194,7 @@ files:
|
|
194
194
|
- lib/plivo/resources/regulatory_compliance.rb
|
195
195
|
- lib/plivo/resources/token.rb
|
196
196
|
- lib/plivo/resources/tollfree_verification.rb
|
197
|
+
- lib/plivo/resources/verify_session.rb
|
197
198
|
- lib/plivo/rest_client.rb
|
198
199
|
- lib/plivo/template.rb
|
199
200
|
- lib/plivo/utils.rb
|