plivo 4.61.2 → 4.61.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/lib/plivo/base_client.rb +10 -2
- data/lib/plivo/exceptions.rb +4 -0
- data/lib/plivo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1b7367bb7de50c9f64164935aaa3d97a86a8404
|
4
|
+
data.tar.gz: f2ee7b4d4a9944773e034b2cc72687eb45d952a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba805f6f9ee93306c5bfbf3c44a2261e41ff5119a0e8a71ada2ba062767d95cc7d54378a280ad55f6829c714d44db0cef30ba29c109ef3e31a1337fa8e6ffe21
|
7
|
+
data.tar.gz: 51bad1b27eb0b38e56fb90402ac44885e52bf3d31e554bcfb5588eb12a00c68ca4a214fddebd56d71bd55ea9f6924d6beffca2a02b06fb84b77d3c67cd9f40cf
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
# Change Log
|
2
|
+
## [4.61.3](https://github.com/plivo/plivo-ruby/tree/v4.61.3) (2025-02-18)
|
3
|
+
**Feature - Throw GeoPermissionsError Exception on synchronous geo permissions error**
|
4
|
+
|
2
5
|
## [4.61.2](https://github.com/plivo/plivo-ruby/tree/v4.61.2)(2024-10-23)
|
3
6
|
**Feature - FraudCheck param in Create, Get and List Session**
|
4
7
|
- Support for the `fraud_check` parameter in sms verify session request
|
data/README.md
CHANGED
data/lib/plivo/base_client.rb
CHANGED
@@ -13,6 +13,7 @@ module Plivo
|
|
13
13
|
# Base stuff
|
14
14
|
attr_reader :headers, :auth_credentials
|
15
15
|
@@voice_retry_count = 0
|
16
|
+
GEO_PERMISSION_ENDPOINTS = ['/Message/', '/Session/', '/Call/'].freeze
|
16
17
|
def initialize(auth_id = nil, auth_token = nil, proxy_options = nil, timeout=5)
|
17
18
|
configure_credentials(auth_id, auth_token)
|
18
19
|
configure_proxies(proxy_options)
|
@@ -26,7 +27,7 @@ module Plivo
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def process_response(method, response)
|
29
|
-
handle_response_exceptions(response)
|
30
|
+
handle_response_exceptions(response, method)
|
30
31
|
if method == 'DELETE'
|
31
32
|
if !([200, 204].include? response[:status])
|
32
33
|
raise Exceptions::PlivoRESTError, "Resource at #{response[:url]} "\
|
@@ -341,7 +342,7 @@ module Plivo
|
|
341
342
|
response
|
342
343
|
end
|
343
344
|
|
344
|
-
def handle_response_exceptions(response)
|
345
|
+
def handle_response_exceptions(response, method)
|
345
346
|
exception_mapping = {
|
346
347
|
400 => [
|
347
348
|
Exceptions::ValidationError,
|
@@ -373,6 +374,13 @@ module Plivo
|
|
373
374
|
]
|
374
375
|
}
|
375
376
|
|
377
|
+
if response[:status] == 403 && method == 'POST' && GEO_PERMISSION_ENDPOINTS.any? { |endpoint| response[:url].to_s.end_with?(endpoint) }
|
378
|
+
exception_mapping[403] = [
|
379
|
+
Exceptions::GeoPermissionsError,
|
380
|
+
'Geo-permission to the destination country is not enabled'
|
381
|
+
]
|
382
|
+
end
|
383
|
+
|
376
384
|
response_json = response[:body]
|
377
385
|
return unless exception_mapping.key?(response[:status])
|
378
386
|
|
data/lib/plivo/exceptions.rb
CHANGED
@@ -46,5 +46,9 @@ module Plivo
|
|
46
46
|
##
|
47
47
|
# This will be raised when there is an authentication error
|
48
48
|
ResourceNotFoundError = Class.new(PlivoRESTError)
|
49
|
+
|
50
|
+
##
|
51
|
+
# This will be raised when the destination country is not enabled for sms/voice
|
52
|
+
GeoPermissionsError = Class.new(PlivoRESTError)
|
49
53
|
end
|
50
54
|
end
|
data/lib/plivo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plivo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.61.
|
4
|
+
version: 4.61.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Plivo SDKs Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|