smartystreets_ruby_sdk 5.14.6 → 5.14.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 873e951c272fbdf965b4b20c4148b8412c20a212bd543d76deb3cabac1afe592
4
- data.tar.gz: 3173a1541ab695d9e879f5243f1965da4fbab48390c2e7a301deb2e58a7a1ab7
3
+ metadata.gz: 03704c636e2db25686c4f49d630002a4733ba44417b6850107caaa7dbcd5aa6c
4
+ data.tar.gz: f6fd6286b2ebcb5dc8450ebd03c7a164405568a7ba63403239ea5bf77c1714ab
5
5
  SHA512:
6
- metadata.gz: 3171793a696794132d862db26c41371746d6993d7642afde67bd2abedecfa179fd06f8b1641c629b69ddaa1fa2cc797df4615c7164c0e7bdcf68af1292d7ff81
7
- data.tar.gz: d7532f754ef0efd9aebf64a541ae8f77ea2962682dbca0221a0d9021fc398a54f01406e921fc4a8ac32e5a9e2f2a5d1eaff062207ebb4e7c5e5553cfd230f2f4
6
+ metadata.gz: aa4e1066288d30d8ef8732c6d78eba87c98c8585a9a6ccdc300ae5b991fffd62c2230a5c3b246188e2f054f2a1de6080da96c6e3da6e824e9c8ac0ae4fcd33e3
7
+ data.tar.gz: adc69302a0783ec4d27d3f320bf0ff8296d82aff84ceaac39c50efd43ba24a8852f167d8052e9fed8765f990f6f88a6dbf421e7f3bc748b04980480d042e42da
@@ -24,7 +24,7 @@ module SmartyStreets
24
24
  raise response.error if response.error
25
25
 
26
26
  result = @serializer.deserialize(response.payload)
27
- suggestions = convert_suggestions(result)
27
+ suggestions = convert_suggestions(result.fetch('candidates', []))
28
28
  lookup.result = suggestions
29
29
  end
30
30
 
@@ -2,6 +2,7 @@ module SmartyStreets
2
2
  class RetrySender
3
3
  MAX_BACKOFF_DURATION = 10
4
4
  STATUS_INTERNAL_SERVER_ERROR = 500
5
+ STATUS_TOO_MANY_REQUESTS = 429
5
6
 
6
7
  def initialize(max_retries, inner, sleeper, logger)
7
8
  @max_retries = max_retries
@@ -14,6 +15,10 @@ module SmartyStreets
14
15
  response = @inner.send(request)
15
16
 
16
17
  (0..@max_retries-1).each do |i|
18
+ if response.status_code.to_i == STATUS_TOO_MANY_REQUESTS
19
+ backoff(5)
20
+ end
21
+
17
22
  break if response.status_code.to_i < STATUS_INTERNAL_SERVER_ERROR
18
23
 
19
24
  backoff(i)
@@ -47,7 +47,7 @@ module SmartyStreets
47
47
  converted_obj = []
48
48
  obj.each do |lookup|
49
49
  converted_lookup = {}
50
- lookup.candidates = 5 if lookup.match == "enhanced" && lookup.candidates == 1
50
+ lookup.candidates = 5 if lookup.match == "enhanced" && lookup.candidates == 0
51
51
 
52
52
  converted_lookup['input_id'] = lookup.input_id
53
53
  converted_lookup['street'] = lookup.street
@@ -12,7 +12,7 @@ module SmartyStreets
12
12
  :match, :candidates, :result
13
13
 
14
14
  def initialize(street=nil, street2=nil, secondary=nil, city=nil, state=nil, zipcode=nil, lastline=nil,
15
- addressee=nil, urbanization=nil, match=nil, candidates=1, input_id=nil)
15
+ addressee=nil, urbanization=nil, match=nil, candidates=0, input_id=nil)
16
16
  @input_id = input_id
17
17
  @street = street
18
18
  @street2 = street2
@@ -1,3 +1,3 @@
1
1
  module SmartyStreets
2
- VERSION = '5.14.6' # DO NOT EDIT (this is updated by a build job when a new release is published)
2
+ VERSION = '5.14.9' # DO NOT EDIT (this is updated by a build job when a new release is published)
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartystreets_ruby_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.14.6
4
+ version: 5.14.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - SmartyStreets SDK Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-02 00:00:00.000000000 Z
11
+ date: 2022-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler