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 +4 -4
- data/README.md +2 -1
- data/lib/ringcentral_sdk.rb +1 -1
- data/lib/ringcentral_sdk/rest/configuration.rb +11 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c23194e018c633da22f300e1946b31798aee7695
|
4
|
+
data.tar.gz: 38c033f1d88b89c6acd62c90174da19bc4744ceb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
|
data/lib/ringcentral_sdk.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# RingCentralSdk is a SDK for the RingCentral REST API
|
2
2
|
module RingCentralSdk
|
3
|
-
VERSION = '2.0.
|
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?
|
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
|