smartystreets_ruby_sdk 5.11.0 → 5.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/international_example.rb +1 -1
- data/examples/us_autocomplete_pro_example.rb +1 -1
- data/examples/us_reverse_geo_example.rb +1 -1
- data/examples/us_street_multiple_address_example.rb +2 -2
- data/examples/us_street_single_address_example.rb +2 -2
- data/lib/smartystreets_ruby_sdk/client_builder.rb +1 -1
- data/lib/smartystreets_ruby_sdk/us_street/analysis.rb +2 -3
- data/lib/smartystreets_ruby_sdk/us_street/match_type.rb +2 -1
- data/lib/smartystreets_ruby_sdk/version.rb +1 -1
- metadata +7 -8
- data/examples/us_autocomplete_example.rb +0 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9b875a25fbdd31a426fa6fdfb61dfc62d2fce2c8a1e5b9baebf6933076bf77b
|
4
|
+
data.tar.gz: 9aab93b22abe5671ed4a63e0482f44a995e1871e3ad02459d10e53f40eb2107c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ad7fd90449fcea0eb99a810366f4f428295b0e14e54e30af98cd3935206bd9dfdad4e8e31667f434a7ccefb4422a5299133189822ee4c8bee264d5a1a147e4f
|
7
|
+
data.tar.gz: 2ccab08012c1ce1c88100353e908d5c83c3a6d4831fc9705e6b5ce035553ec05652cc6fc3973166897dc221b7c5ad3fb411d689d529eff11caa37e38876959fa
|
@@ -18,7 +18,7 @@ class InternationalExample
|
|
18
18
|
# The appropriate license values to be used for your subscriptions
|
19
19
|
# can be found on the Subscriptions page of the account dashboard.
|
20
20
|
# https://www.smartystreets.com/docs/cloud/licensing
|
21
|
-
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(
|
21
|
+
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(['international-global-plus-cloud'])
|
22
22
|
.build_international_street_api_client
|
23
23
|
|
24
24
|
# Documentation for input fields can be found at:
|
@@ -18,7 +18,7 @@ class USAutocompleteProExample
|
|
18
18
|
# The appropriate license values to be used for your subscriptions
|
19
19
|
# can be found on the Subscriptions page of the account dashboard.
|
20
20
|
# https://www.smartystreets.com/docs/cloud/licensing
|
21
|
-
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(
|
21
|
+
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(['us-autocomplete-pro-cloud'])
|
22
22
|
.build_us_autocomplete_pro_api_client
|
23
23
|
|
24
24
|
# Documentation for input fields can be found at:
|
@@ -18,7 +18,7 @@ class USReverseGeoExample
|
|
18
18
|
# The appropriate license values to be used for your subscriptions
|
19
19
|
# can be found on the Subscriptions page of the account dashboard.
|
20
20
|
# https://www.smartystreets.com/docs/cloud/licensing
|
21
|
-
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(
|
21
|
+
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(['us-reverse-geocoding-cloud'])
|
22
22
|
.build_us_reverse_geo_api_client
|
23
23
|
|
24
24
|
# Documentation for input fields can be found at:
|
@@ -19,7 +19,7 @@ class USStreetMultipleAddressExample
|
|
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(
|
22
|
+
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(['us-rooftop-geocoding-cloud'])
|
23
23
|
.build_us_street_api_client
|
24
24
|
batch = SmartyStreets::Batch.new
|
25
25
|
|
@@ -36,7 +36,7 @@ class USStreetMultipleAddressExample
|
|
36
36
|
batch[0].lastline = 'Mountain view, California'
|
37
37
|
batch[0].zipcode = '21229'
|
38
38
|
batch[0].candidates = 3
|
39
|
-
batch[0].match =
|
39
|
+
batch[0].match = Lookup.INVALID # "invalid" is the most permissive match,
|
40
40
|
# this will always return at least one result even if the address is invalid.
|
41
41
|
# Refer to the documentation for additional Match Strategy options.
|
42
42
|
|
@@ -16,7 +16,7 @@ class USStreetSingleAddressExample
|
|
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(
|
19
|
+
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(['us-rooftop-geocoding-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
|
|
@@ -34,7 +34,7 @@ class USStreetSingleAddressExample
|
|
34
34
|
lookup.state = 'CA'
|
35
35
|
lookup.zipcode = '21229'
|
36
36
|
lookup.candidates = 3
|
37
|
-
lookup.match =
|
37
|
+
lookup.match = Lookup.INVALID # "invalid" is the most permissive match,
|
38
38
|
# this will always return at least one result even if the address is invalid.
|
39
39
|
# Refer to the documentation for additional Match Strategy options.
|
40
40
|
|
@@ -125,7 +125,7 @@ module SmartyStreets
|
|
125
125
|
InternationalStreet::Client.new(build_sender, @serializer)
|
126
126
|
end
|
127
127
|
|
128
|
-
def build_us_autocomplete_api_client
|
128
|
+
def build_us_autocomplete_api_client # Deprecated
|
129
129
|
ensure_url_prefix_not_null(US_AUTOCOMPLETE_API_URL)
|
130
130
|
USAutocomplete::Client.new(build_sender, @serializer)
|
131
131
|
end
|
@@ -3,7 +3,7 @@ module SmartyStreets
|
|
3
3
|
# See "https://smartystreets.com/docs/cloud/us-street-api#analysis"
|
4
4
|
class Analysis
|
5
5
|
attr_reader :lacs_link_code, :active, :footnotes, :lacs_link_indicator, :dpv_match_code, :is_suite_link_match,
|
6
|
-
:is_ews_match, :dpv_footnotes, :cmra, :vacant, :no_stat, :
|
6
|
+
:is_ews_match, :dpv_footnotes, :cmra, :vacant, :no_stat, :enhanced_match
|
7
7
|
|
8
8
|
def initialize(obj)
|
9
9
|
@dpv_match_code = obj['dpv_match_code']
|
@@ -17,8 +17,7 @@ module SmartyStreets
|
|
17
17
|
@lacs_link_code = obj['lacslink_code']
|
18
18
|
@lacs_link_indicator = obj['lacslink_indicator']
|
19
19
|
@is_suite_link_match = obj['suitelink_match']
|
20
|
-
@
|
21
|
-
@match_details = obj['match_details']
|
20
|
+
@enhanced_match = obj['enhanced_match']
|
22
21
|
end
|
23
22
|
end
|
24
23
|
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.
|
4
|
+
version: 5.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SmartyStreets SDK Team
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,7 +72,7 @@ dependencies:
|
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: 0.12.0
|
75
|
-
description:
|
75
|
+
description:
|
76
76
|
email:
|
77
77
|
- support@smartystreets.com
|
78
78
|
executables: []
|
@@ -91,7 +91,6 @@ files:
|
|
91
91
|
- bin/setup
|
92
92
|
- docker-compose.yml
|
93
93
|
- examples/international_example.rb
|
94
|
-
- examples/us_autocomplete_example.rb
|
95
94
|
- examples/us_autocomplete_pro_example.rb
|
96
95
|
- examples/us_extract_example.rb
|
97
96
|
- examples/us_reverse_geo_example.rb
|
@@ -175,7 +174,7 @@ homepage: https://github.com/smartystreets/smartystreets-ruby-sdk
|
|
175
174
|
licenses:
|
176
175
|
- Apache-2.0
|
177
176
|
metadata: {}
|
178
|
-
post_install_message:
|
177
|
+
post_install_message:
|
179
178
|
rdoc_options: []
|
180
179
|
require_paths:
|
181
180
|
- lib
|
@@ -190,8 +189,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
189
|
- !ruby/object:Gem::Version
|
191
190
|
version: '0'
|
192
191
|
requirements: []
|
193
|
-
rubygems_version: 3.
|
194
|
-
signing_key:
|
192
|
+
rubygems_version: 3.2.22
|
193
|
+
signing_key:
|
195
194
|
specification_version: 4
|
196
195
|
summary: An official library for the SmartyStreets APIs
|
197
196
|
test_files: []
|
@@ -1,52 +0,0 @@
|
|
1
|
-
require 'smartystreets_ruby_sdk/static_credentials'
|
2
|
-
require 'smartystreets_ruby_sdk/client_builder'
|
3
|
-
require 'smartystreets_ruby_sdk/us_autocomplete/lookup'
|
4
|
-
|
5
|
-
class USAutocompleteExample
|
6
|
-
Lookup = SmartyStreets::USAutocomplete::Lookup
|
7
|
-
|
8
|
-
def run
|
9
|
-
auth_id = 'Your SmartyStreets Auth ID here'
|
10
|
-
auth_token = 'Your SmartyStreets Auth Token here'
|
11
|
-
|
12
|
-
# We recommend storing your secret keys in environment variables instead---it's safer!
|
13
|
-
# auth_id = ENV['SMARTY_AUTH_ID']
|
14
|
-
# auth_token = ENV['SMARTY_AUTH_TOKEN']
|
15
|
-
|
16
|
-
credentials = SmartyStreets::StaticCredentials.new(auth_id, auth_token)
|
17
|
-
client = SmartyStreets::ClientBuilder.new(credentials).build_us_autocomplete_api_client
|
18
|
-
|
19
|
-
# Documentation for input fields can be found at:
|
20
|
-
# https://smartystreets.com/docs/cloud/us-autocomplete-api
|
21
|
-
|
22
|
-
lookup = Lookup.new('4770 Lincoln Ave O')
|
23
|
-
lookup.max_suggestions = 10
|
24
|
-
|
25
|
-
client.send(lookup)
|
26
|
-
|
27
|
-
puts '*** Result with no filter ***'
|
28
|
-
puts
|
29
|
-
lookup.result.each do |suggestion|
|
30
|
-
puts suggestion.text
|
31
|
-
end
|
32
|
-
|
33
|
-
lookup.add_city_filter('Ogden')
|
34
|
-
lookup.add_state_filter('IL')
|
35
|
-
lookup.add_prefer('Ogden, IL')
|
36
|
-
lookup.max_suggestions = 5
|
37
|
-
lookup.prefer_ratio = 0.333333
|
38
|
-
|
39
|
-
suggestions = client.send(lookup) # The client will also return the suggestions directly
|
40
|
-
|
41
|
-
puts
|
42
|
-
puts '*** Result with some filters ***'
|
43
|
-
puts
|
44
|
-
|
45
|
-
suggestions.each do |suggestion|
|
46
|
-
puts suggestion.text
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
USAutocompleteExample.new.run
|