smartystreets_ruby_sdk 5.14.8 → 5.14.11
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 +4 -4
- data/{LICENSE.txt → LICENSE.md} +1 -1
- data/README.md +2 -0
- data/examples/international_example.rb +4 -4
- data/examples/us_extract_example.rb +4 -4
- data/examples/us_reverse_geo_example.rb +4 -4
- data/examples/us_street_multiple_address_example.rb +5 -5
- data/examples/us_street_single_address_example.rb +5 -5
- data/examples/us_zipcode_multiple_lookup_example.rb +4 -4
- data/examples/us_zipcode_single_lookup_example.rb +4 -4
- data/lib/smartystreets_ruby_sdk/retry_sender.rb +5 -0
- data/lib/smartystreets_ruby_sdk/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ff192ddb4a25231edbc50c5cf2a588c691273dc2ad493d7975c9f72c307eb2e
|
4
|
+
data.tar.gz: 66aa0fcd8d46e921fd5a02af354785456b95e29b7900f8b6e85888395d67af2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 843a42ebf7f9a5ee3ea5de275e214717c98fcb1ef66310ab83b62e43a6fbd6ece05f0808e74efe750251c6a53d84b9a2d8b2fc73cf4b612230c6818cd5ca24fe
|
7
|
+
data.tar.gz: d5581f41c90f0d4dbbb9f054f271050a8f58956c3d0c74dcd84f6cebf540a7d65089da1ef682f5bcc2a3c796d7d3652e21ac023131b6de762a18df3984e2184d
|
data/{LICENSE.txt → LICENSE.md}
RENAMED
@@ -187,7 +187,7 @@
|
|
187
187
|
same "printed page" as the copyright notice for easier
|
188
188
|
identification within third-party archives.
|
189
189
|
|
190
|
-
Copyright
|
190
|
+
Copyright Smarty
|
191
191
|
|
192
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
193
193
|
you may not use this file except in compliance with the License.
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# SMARTY DISCLAIMER: Subject to the terms of the associated license agreement, this software is freely available for your use. This software is FREE, AS IN PUPPIES, and is a gift. Enjoy your new responsibility. This means that while we may consider enhancement requests, we may or may not choose to entertain requests at our sole and absolute discretion.
|
2
|
+
|
1
3
|
# SmartyStreets Ruby SDK
|
2
4
|
|
3
5
|
The official client libraries for accessing SmartyStreets APIs from Ruby
|
@@ -6,12 +6,12 @@ class InternationalExample
|
|
6
6
|
Lookup = SmartyStreets::InternationalStreet::Lookup
|
7
7
|
|
8
8
|
def run
|
9
|
-
auth_id = 'Your SmartyStreets Auth ID here'
|
10
|
-
auth_token = 'Your SmartyStreets Auth Token here'
|
9
|
+
# auth_id = 'Your SmartyStreets Auth ID here'
|
10
|
+
# auth_token = 'Your SmartyStreets Auth Token here'
|
11
11
|
|
12
12
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
13
|
-
|
14
|
-
|
13
|
+
auth_id = ENV['SMARTY_AUTH_ID']
|
14
|
+
auth_token = ENV['SMARTY_AUTH_TOKEN']
|
15
15
|
|
16
16
|
credentials = SmartyStreets::StaticCredentials.new(auth_id, auth_token)
|
17
17
|
|
@@ -6,12 +6,12 @@ class USExtractExample
|
|
6
6
|
Lookup = SmartyStreets::USExtract::Lookup
|
7
7
|
|
8
8
|
def run
|
9
|
-
auth_id = 'Your SmartyStreets Auth ID here'
|
10
|
-
auth_token = 'Your SmartyStreets Auth Token here'
|
9
|
+
# auth_id = 'Your SmartyStreets Auth ID here'
|
10
|
+
# auth_token = 'Your SmartyStreets Auth Token here'
|
11
11
|
|
12
12
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
13
|
-
|
14
|
-
|
13
|
+
auth_id = ENV['SMARTY_AUTH_ID']
|
14
|
+
auth_token = ENV['SMARTY_AUTH_TOKEN']
|
15
15
|
|
16
16
|
credentials = SmartyStreets::StaticCredentials.new(auth_id, auth_token)
|
17
17
|
|
@@ -6,12 +6,12 @@ class USReverseGeoExample
|
|
6
6
|
Lookup = SmartyStreets::USReverseGeo::Lookup
|
7
7
|
|
8
8
|
def run
|
9
|
-
auth_id = 'Your SmartyStreets Auth ID here'
|
10
|
-
auth_token = 'Your SmartyStreets Auth Token here'
|
9
|
+
# auth_id = 'Your SmartyStreets Auth ID here'
|
10
|
+
# auth_token = 'Your SmartyStreets Auth Token here'
|
11
11
|
|
12
12
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
13
|
-
|
14
|
-
|
13
|
+
auth_id = ENV['SMARTY_AUTH_ID']
|
14
|
+
auth_token = ENV['SMARTY_AUTH_TOKEN']
|
15
15
|
|
16
16
|
credentials = SmartyStreets::StaticCredentials.new(auth_id, auth_token)
|
17
17
|
|
@@ -7,19 +7,19 @@ class USStreetMultipleAddressExample
|
|
7
7
|
Lookup = SmartyStreets::USStreet::Lookup
|
8
8
|
|
9
9
|
def run
|
10
|
-
auth_id = 'Your SmartyStreets Auth ID here'
|
11
|
-
auth_token = 'Your SmartyStreets Auth Token here'
|
10
|
+
# auth_id = 'Your SmartyStreets Auth ID here'
|
11
|
+
# auth_token = 'Your SmartyStreets Auth Token here'
|
12
12
|
|
13
13
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
14
|
-
|
15
|
-
|
14
|
+
auth_id = ENV['SMARTY_AUTH_ID']
|
15
|
+
auth_token = ENV['SMARTY_AUTH_TOKEN']
|
16
16
|
|
17
17
|
credentials = SmartyStreets::StaticCredentials.new(auth_id, auth_token)
|
18
18
|
|
19
19
|
# The appropriate license values to be used for your subscriptions
|
20
20
|
# can be found on the Subscriptions page of the account dashboard.
|
21
21
|
# https://www.smartystreets.com/docs/cloud/licensing
|
22
|
-
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(['us-
|
22
|
+
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(['us-core-cloud'])
|
23
23
|
.build_us_street_api_client
|
24
24
|
batch = SmartyStreets::Batch.new
|
25
25
|
|
@@ -4,19 +4,19 @@ require 'smartystreets_ruby_sdk/us_street/lookup'
|
|
4
4
|
|
5
5
|
class USStreetSingleAddressExample
|
6
6
|
def run
|
7
|
-
auth_id = 'Your SmartyStreets Auth ID here'
|
8
|
-
auth_token = 'Your SmartyStreets Auth Token here'
|
7
|
+
# auth_id = 'Your SmartyStreets Auth ID here'
|
8
|
+
# auth_token = 'Your SmartyStreets Auth Token here'
|
9
9
|
|
10
10
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
11
|
-
|
12
|
-
|
11
|
+
auth_id = ENV['SMARTY_AUTH_ID']
|
12
|
+
auth_token = ENV['SMARTY_AUTH_TOKEN']
|
13
13
|
|
14
14
|
credentials = SmartyStreets::StaticCredentials.new(auth_id, auth_token)
|
15
15
|
|
16
16
|
# The appropriate license values to be used for your subscriptions
|
17
17
|
# can be found on the Subscriptions page of the account dashboard.
|
18
18
|
# https://www.smartystreets.com/docs/cloud/licensing
|
19
|
-
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(['us-
|
19
|
+
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(['us-core-cloud'])
|
20
20
|
# with_proxy('localhost', 8080, 'proxyUser', 'proxyPassword'). # Uncomment this line to try it with a proxy
|
21
21
|
build_us_street_api_client
|
22
22
|
|
@@ -7,12 +7,12 @@ class USZipcodeMultipleLookupExample
|
|
7
7
|
Lookup = SmartyStreets::USZipcode::Lookup
|
8
8
|
|
9
9
|
def run
|
10
|
-
auth_id = 'Your SmartyStreets Auth ID here'
|
11
|
-
auth_token = 'Your SmartyStreets Auth Token here'
|
10
|
+
# auth_id = 'Your SmartyStreets Auth ID here'
|
11
|
+
# auth_token = 'Your SmartyStreets Auth Token here'
|
12
12
|
|
13
13
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
14
|
-
|
15
|
-
|
14
|
+
auth_id = ENV['SMARTY_AUTH_ID']
|
15
|
+
auth_token = ENV['SMARTY_AUTH_TOKEN']
|
16
16
|
|
17
17
|
credentials = SmartyStreets::StaticCredentials.new(auth_id, auth_token)
|
18
18
|
|
@@ -4,12 +4,12 @@ require 'smartystreets_ruby_sdk/us_zipcode/lookup'
|
|
4
4
|
|
5
5
|
class UsZipcodeSingleLookupExample
|
6
6
|
def run
|
7
|
-
auth_id = 'Your SmartyStreets Auth ID here'
|
8
|
-
auth_token = 'Your SmartyStreets Auth Token here'
|
7
|
+
# auth_id = 'Your SmartyStreets Auth ID here'
|
8
|
+
# auth_token = 'Your SmartyStreets Auth Token here'
|
9
9
|
|
10
10
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
11
|
-
|
12
|
-
|
11
|
+
auth_id = ENV['SMARTY_AUTH_ID']
|
12
|
+
auth_token = ENV['SMARTY_AUTH_TOKEN']
|
13
13
|
|
14
14
|
credentials = SmartyStreets::StaticCredentials.new(auth_id, auth_token)
|
15
15
|
|
@@ -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)
|
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.
|
4
|
+
version: 5.14.11
|
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-
|
11
|
+
date: 2022-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,7 +83,7 @@ files:
|
|
83
83
|
- CHANGELOG.md
|
84
84
|
- Dockerfile
|
85
85
|
- Gemfile
|
86
|
-
- LICENSE.
|
86
|
+
- LICENSE.md
|
87
87
|
- Makefile
|
88
88
|
- README.md
|
89
89
|
- Rakefile
|
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
195
|
requirements: []
|
196
|
-
rubygems_version: 3.
|
196
|
+
rubygems_version: 3.3.7
|
197
197
|
signing_key:
|
198
198
|
specification_version: 4
|
199
199
|
summary: An official library for the SmartyStreets APIs
|