ringcentral_sdk 2.0.2 → 2.0.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: ac6822f8b15cf8ab672b665042f9432d992224eb
4
- data.tar.gz: 76a3c932bea73201db8eb1d29a379abfe32245d5
3
+ metadata.gz: c23194e018c633da22f300e1946b31798aee7695
4
+ data.tar.gz: 38c033f1d88b89c6acd62c90174da19bc4744ceb
5
5
  SHA512:
6
- metadata.gz: 4113777a1e6ca436d8a014e371d112cb35d9ca2fa9847d488ec3092250cb212c30757612a87ab11a3eaec4579b7f41dd7e312e9852b586c983e88034099782ed
7
- data.tar.gz: aee6f1f01b21e973636575d4caa8da83d6501cacdf07657e43de2b91f847f479804ebe95fafd3bc4d6a4cc0cc9421ea66b176001c326be58752ef5c5c8b42631
6
+ metadata.gz: 3ace1d77ae6ab01725f2176afae51424979b0bc4d329a94890a0fb41b3174b035f37506dad8a05c38d66d6e88ba4b5ce6e2767d4e269363477e28c1f969052e0
7
+ data.tar.gz: 421025b7312c80738f1bfd4e6453b7e7a3bd62b1939231383045bb93af28398cff7aa01ee9a84183ffc8258453c68b9498f3cd617bf4faed6102de82434e87b0
data/README.md CHANGED
@@ -98,7 +98,8 @@ client = RingCentralSdk::REST::Client.new do |config|
98
98
  # Set a custom logger (optional)
99
99
  config.logger = Logger.new(STDOUT)
100
100
 
101
- # Enable HTTP retries for 429 and 503 errors
101
+ # Enable HTTP retries for 429, 503, and 504 errors
102
+ # Set custom codes and retry after using retry_options
102
103
  config.retry = true
103
104
  end
104
105
 
@@ -1,6 +1,6 @@
1
1
  # RingCentralSdk is a SDK for the RingCentral REST API
2
2
  module RingCentralSdk
3
- VERSION = '2.0.2'.freeze
3
+ VERSION = '2.0.3'.freeze
4
4
 
5
5
  RC_SERVER_PRODUCTION = 'https://platform.ringcentral.com'.freeze
6
6
  RC_SERVER_SANDBOX = 'https://platform.devtest.ringcentral.com'.freeze
@@ -28,6 +28,7 @@ module RingCentralSdk
28
28
  load_environment if load_env
29
29
  inflate_headers
30
30
  inflate_retry
31
+ inflate_retry_options
31
32
  inflate_token
32
33
  end
33
34
 
@@ -54,12 +55,20 @@ module RingCentralSdk
54
55
  end
55
56
 
56
57
  def inflate_retry
57
- if !defined?(@retry) || @retry.nil? || @retry.empty? || @retry.to_s.downcase == 'false'
58
+ if !defined?(@retry) || @retry.nil?
58
59
  @retry = false
60
+ elsif @retry.is_a? String
61
+ @retry = @retry.to_s.strip.downcase == 'true' ? true : false
62
+ elsif ![true, false].include? @retry
63
+ @retry = @retry ? true : false
64
+ end
65
+ end
66
+
67
+ def inflate_retry_options
68
+ if @retry == false
59
69
  @retry_options = {}
60
70
  return
61
71
  end
62
- @retry = true
63
72
  if !@retry_options.nil? && @retry_options.to_s =~ /^\s*{/
64
73
  @retry_options = MultiJson.decode @retry_options.to_s, symbolize_keys: true
65
74
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ringcentral_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Wang