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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d294e80630afae4af42f280ea00df4e0058b5fa
4
- data.tar.gz: d612e7b7dd77e49abff26918acdadc2d6da7e59b
3
+ metadata.gz: b1b7367bb7de50c9f64164935aaa3d97a86a8404
4
+ data.tar.gz: f2ee7b4d4a9944773e034b2cc72687eb45d952a5
5
5
  SHA512:
6
- metadata.gz: 37243d6d07e62e1266c85acc67c92c6a9c945951bf39d8e75e9b7b2eb5d2f6b18eae9520babd3daf34601656c26ea998b4b76a71c5b9e2c37ebedbb77cf0e3f7
7
- data.tar.gz: '08c1e507d18f6025b9137035fa21171d73ba11d4a4dff0b5f2074475420a300eedfc97f450e87c12431f00cac4bc066e5ba77dfd75181392af09d35cd5db5e29'
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
@@ -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.61.2'
12
+ gem 'plivo', '>= 4.61.3'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Plivo
2
- VERSION = "4.61.2".freeze
2
+ VERSION = "4.61.3".freeze
3
3
  end
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.2
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: 2024-10-23 00:00:00.000000000 Z
11
+ date: 2025-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday