smartystreets_ruby_sdk 5.18.1 → 5.19.0
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/lib/smartystreets_ruby_sdk/us_enrichment/client.rb +38 -1
- data/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/attributes.rb +23 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/census_block_entry.rb +14 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/census_county_division_entry.rb +15 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/census_tract_entry.rb +13 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/core_based_stat_area_entry.rb +14 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/lookup.rb +15 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/place_entry.rb +16 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/response.rb +17 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/lookup.rb +13 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/secondary/aliases_entry.rb +23 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/secondary/count/lookup.rb +17 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/secondary/count/response.rb +16 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/secondary/lookup.rb +15 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/secondary/response.rb +38 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/secondary/root_address_entry.rb +24 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/secondary/secondaries_entry.rb +16 -0
- data/lib/smartystreets_ruby_sdk/version.rb +1 -1
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51cb2a009b7e285e29d6f6fb5e689a365105c69b1ee91988708a54277c646e36
|
4
|
+
data.tar.gz: 2125742bceda76772db7d941461247cc4a30d4bb09a70092d58b51f8857b5281
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c24e7dd98c9b13c60567a41f6b41e111cde5dfc65b730541eabca7eb68b9b24d1f67b81165205aa52db00fca1c58efcde3473fe74c2530b77d52ab8230da809
|
7
|
+
data.tar.gz: 9c5ca611177e645518e1dc4dffdc4762a8580dfc1a8a51c0fdd62c0b00a24962c2ef91b5d2e9e73e13760c6c0766c045f205f8bc00d5fa069ad3815dd71bb7b4
|
@@ -2,6 +2,13 @@ require_relative "property/financial/response"
|
|
2
2
|
require_relative "property/principal/response"
|
3
3
|
require_relative "property/financial/lookup"
|
4
4
|
require_relative "property/principal/lookup"
|
5
|
+
require_relative "geo_reference/response"
|
6
|
+
require_relative "geo_reference/lookup"
|
7
|
+
require_relative "secondary/response"
|
8
|
+
require_relative "secondary/lookup"
|
9
|
+
require_relative "secondary/count/response"
|
10
|
+
require_relative "secondary/count/lookup"
|
11
|
+
require_relative "lookup"
|
5
12
|
require_relative '../request'
|
6
13
|
|
7
14
|
module SmartyStreets
|
@@ -20,12 +27,32 @@ module SmartyStreets
|
|
20
27
|
__send(USEnrichment::Property::Principal::Lookup.new(smarty_key))
|
21
28
|
end
|
22
29
|
|
30
|
+
def send_geo_reference_lookup(smarty_key)
|
31
|
+
__send(USEnrichment::GeoReference::Lookup.new(smarty_key))
|
32
|
+
end
|
33
|
+
|
34
|
+
def send_secondary_lookup(smarty_key)
|
35
|
+
__send(USEnrichment::Secondary::Lookup.new(smarty_key))
|
36
|
+
end
|
37
|
+
|
38
|
+
def send_secondary_count_lookup(smarty_key)
|
39
|
+
__send(USEnrichment::Secondary::Count::Lookup.new(smarty_key))
|
40
|
+
end
|
41
|
+
|
42
|
+
def send_generic_lookup(smarty_key, data_set, data_sub_set = nil)
|
43
|
+
__send(USEnrichment::Lookup.new(smarty_key, data_set, data_sub_set))
|
44
|
+
end
|
45
|
+
|
23
46
|
def __send(lookup)
|
24
47
|
smarty_request = Request.new
|
25
48
|
|
26
49
|
return if lookup.nil?
|
27
50
|
|
28
|
-
|
51
|
+
if (lookup.data_sub_set.nil?)
|
52
|
+
smarty_request.url_components = '/' + lookup.smarty_key + '/' + lookup.data_set
|
53
|
+
else
|
54
|
+
smarty_request.url_components = '/' + lookup.smarty_key + '/' + lookup.data_set + '/' + lookup.data_sub_set
|
55
|
+
end
|
29
56
|
|
30
57
|
response = @sender.send(smarty_request)
|
31
58
|
results = @serializer.deserialize(response.payload)
|
@@ -42,6 +69,16 @@ module SmartyStreets
|
|
42
69
|
if lookup.data_sub_set == "principal"
|
43
70
|
result = USEnrichment::Property::Principal::Response.new(raw_result)
|
44
71
|
end
|
72
|
+
if lookup.data_set == "geo-reference"
|
73
|
+
result = USEnrichment::GeoReference::Response.new(raw_result)
|
74
|
+
end
|
75
|
+
if lookup.data_set == "secondary"
|
76
|
+
if lookup.data_sub_set == "count"
|
77
|
+
result = USEnrichment::Secondary::Count::Response.new(raw_result)
|
78
|
+
elsif lookup.data_sub_set.nil?
|
79
|
+
result = USEnrichment::Secondary::Response.new(raw_result)
|
80
|
+
end
|
81
|
+
end
|
45
82
|
output << result
|
46
83
|
end
|
47
84
|
output
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require_relative 'census_block_entry'
|
2
|
+
require_relative 'census_county_division_entry'
|
3
|
+
require_relative 'census_tract_entry'
|
4
|
+
require_relative 'core_based_stat_area_entry'
|
5
|
+
require_relative 'place_entry'
|
6
|
+
|
7
|
+
module SmartyStreets
|
8
|
+
module USEnrichment
|
9
|
+
module GeoReference
|
10
|
+
class Attributes
|
11
|
+
attr_reader :census_block, :census_county_division, :census_tract, :core_based_stat_area, :place
|
12
|
+
|
13
|
+
def initialize(obj)
|
14
|
+
@census_block = GeoReference::CensusBlockEntry.new(obj['census_block'])
|
15
|
+
@census_county_division = GeoReference::CensusCountyDivisionEntry.new(obj['census_county_division'])
|
16
|
+
@census_tract = GeoReference::CensusTractEntry.new(obj['census_tract'])
|
17
|
+
@core_based_stat_area = GeoReference::CoreBasedStatAreaEntry.new(obj['core_based_stat_area'])
|
18
|
+
@place = GeoReference::PlaceEntry.new(obj['place'])
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module SmartyStreets
|
2
|
+
module USEnrichment
|
3
|
+
module GeoReference
|
4
|
+
class CensusCountyDivisionEntry
|
5
|
+
attr_reader :accuracy, :code, :name
|
6
|
+
|
7
|
+
def initialize(obj)
|
8
|
+
@accuracy = obj['accuracy']
|
9
|
+
@code = obj['code']
|
10
|
+
@name = obj['name']
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module SmartyStreets
|
2
|
+
module USEnrichment
|
3
|
+
module GeoReference
|
4
|
+
class Lookup
|
5
|
+
attr_reader :smarty_key, :data_set, :data_sub_set
|
6
|
+
|
7
|
+
def initialize(smarty_key)
|
8
|
+
@smarty_key = smarty_key
|
9
|
+
@data_set = 'geo-reference'
|
10
|
+
@data_sub_set = nil
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module SmartyStreets
|
2
|
+
module USEnrichment
|
3
|
+
module GeoReference
|
4
|
+
class PlaceEntry
|
5
|
+
attr_reader :accuracy, :code, :name, :type
|
6
|
+
|
7
|
+
def initialize(obj)
|
8
|
+
@accuracy = obj['accuracy']
|
9
|
+
@code = obj['code']
|
10
|
+
@name = obj['name']
|
11
|
+
@type = obj['type']
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require_relative "attributes"
|
2
|
+
|
3
|
+
module SmartyStreets
|
4
|
+
module USEnrichment
|
5
|
+
module GeoReference
|
6
|
+
class Response
|
7
|
+
attr_reader :smarty_key, :data_set, :attributes
|
8
|
+
|
9
|
+
def initialize(obj)
|
10
|
+
@smarty_key = obj['smarty_key']
|
11
|
+
@data_set = 'geo-reference'
|
12
|
+
@attributes = Attributes.new(obj['attributes'])
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module SmartyStreets
|
2
|
+
module USEnrichment
|
3
|
+
class Lookup
|
4
|
+
attr_reader :smarty_key, :data_set, :data_sub_set
|
5
|
+
|
6
|
+
def initialize(smarty_key, data_set, data_sub_set)
|
7
|
+
@smarty_key = smarty_key
|
8
|
+
@data_set = data_set
|
9
|
+
@data_sub_set = data_sub_set
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module SmartyStreets
|
2
|
+
module USEnrichment
|
3
|
+
module Secondary
|
4
|
+
class AliasesEntry
|
5
|
+
attr_reader :smarty_key, :primary_number, :street_predirection, :street_name, :street_suffix, :street_postdirection, :city_name,
|
6
|
+
:state_abbreviation, :zipcode, :plus4_code
|
7
|
+
|
8
|
+
def initialize(obj)
|
9
|
+
@smarty_key = obj['smarty_key']
|
10
|
+
@primary_number = obj['primary_number']
|
11
|
+
@street_predirection = obj['street_predirection']
|
12
|
+
@street_name = obj['street_name']
|
13
|
+
@street_suffix = obj['street_suffix']
|
14
|
+
@street_postdirection = obj['street_postdirection']
|
15
|
+
@city_name = obj['city_name']
|
16
|
+
@state_abbreviation = obj['state_abbreviation']
|
17
|
+
@zipcode = obj['zipcode']
|
18
|
+
@plus4_code = obj['plus4_code']
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module SmartyStreets
|
2
|
+
module USEnrichment
|
3
|
+
module Secondary
|
4
|
+
module Count
|
5
|
+
class Lookup
|
6
|
+
attr_reader :smarty_key, :data_set, :data_sub_set
|
7
|
+
|
8
|
+
def initialize(smarty_key)
|
9
|
+
@smarty_key = smarty_key
|
10
|
+
@data_set = "secondary"
|
11
|
+
@data_sub_set = "count"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module SmartyStreets
|
2
|
+
module USEnrichment
|
3
|
+
module Secondary
|
4
|
+
module Count
|
5
|
+
class Response
|
6
|
+
attr_reader :smarty_key, :count
|
7
|
+
|
8
|
+
def initialize(obj)
|
9
|
+
@smarty_key = obj['smarty_key']
|
10
|
+
@count = obj['count']
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module SmartyStreets
|
2
|
+
module USEnrichment
|
3
|
+
module Secondary
|
4
|
+
class Lookup
|
5
|
+
attr_reader :smarty_key, :data_set, :data_sub_set
|
6
|
+
|
7
|
+
def initialize(smarty_key)
|
8
|
+
@smarty_key = smarty_key
|
9
|
+
@data_set = "secondary"
|
10
|
+
@data_sub_set = nil
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require_relative 'root_address_entry'
|
2
|
+
require_relative 'aliases_entry'
|
3
|
+
require_relative 'secondaries_entry'
|
4
|
+
|
5
|
+
module SmartyStreets
|
6
|
+
module USEnrichment
|
7
|
+
module Secondary
|
8
|
+
class Response
|
9
|
+
attr_reader :smarty_key, :root_address, :aliases, :secondaries
|
10
|
+
|
11
|
+
def initialize(obj)
|
12
|
+
@smarty_key = obj['smarty_key']
|
13
|
+
@root_address = Secondary::RootAddressEntry.new(obj['root_address'])
|
14
|
+
if !obj['aliases'].nil?
|
15
|
+
@aliases = createAliasesArray(obj['aliases'])
|
16
|
+
end
|
17
|
+
@secondaries = createSecondariesArray(obj['secondaries'])
|
18
|
+
end
|
19
|
+
|
20
|
+
def createAliasesArray(obj)
|
21
|
+
aliasesArray = []
|
22
|
+
for item in obj do
|
23
|
+
aliasesArray << Secondary::AliasesEntry.new(item)
|
24
|
+
end
|
25
|
+
return aliasesArray
|
26
|
+
end
|
27
|
+
|
28
|
+
def createSecondariesArray(obj)
|
29
|
+
secondariesArray = []
|
30
|
+
for item in obj do
|
31
|
+
secondariesArray << Secondary::SecondariesEntry.new(item)
|
32
|
+
end
|
33
|
+
return secondariesArray
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module SmartyStreets
|
2
|
+
module USEnrichment
|
3
|
+
module Secondary
|
4
|
+
class RootAddressEntry
|
5
|
+
attr_reader :secondary_count, :smarty_key, :primary_number, :street_predirection, :street_name, :street_suffix, :street_postdirection,
|
6
|
+
:city_name, :state_abbreviation, :zipcode, :plus4_code
|
7
|
+
|
8
|
+
def initialize(obj)
|
9
|
+
@secondary_count = obj['secondary_count']
|
10
|
+
@smarty_key = obj['smarty_key']
|
11
|
+
@primary_number = obj['primary_number']
|
12
|
+
@street_predirection = obj['street_predirection']
|
13
|
+
@street_name = obj['street_name']
|
14
|
+
@street_suffix = obj['street_suffix']
|
15
|
+
@street_postdirection = obj['street_postdirection']
|
16
|
+
@city_name = obj['city_name']
|
17
|
+
@state_abbreviation = obj['state_abbreviation']
|
18
|
+
@zipcode = obj['zipcode']
|
19
|
+
@plus4_code = obj['plus4_code']
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module SmartyStreets
|
2
|
+
module USEnrichment
|
3
|
+
module Secondary
|
4
|
+
class SecondariesEntry
|
5
|
+
attr_reader :smarty_key, :secondary_designator, :secondary_number, :plus4_code
|
6
|
+
|
7
|
+
def initialize(obj)
|
8
|
+
@smarty_key = obj['smarty_key']
|
9
|
+
@secondary_designator = obj['secondary_designator']
|
10
|
+
@secondary_number = obj['secondary_number']
|
11
|
+
@plus4_code = obj['plus4_code']
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
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.19.0
|
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: 2024-
|
11
|
+
date: 2024-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -143,6 +143,15 @@ files:
|
|
143
143
|
- lib/smartystreets_ruby_sdk/us_autocomplete_pro/suggestion.rb
|
144
144
|
- lib/smartystreets_ruby_sdk/us_enrichment.rb
|
145
145
|
- lib/smartystreets_ruby_sdk/us_enrichment/client.rb
|
146
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/attributes.rb
|
147
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/census_block_entry.rb
|
148
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/census_county_division_entry.rb
|
149
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/census_tract_entry.rb
|
150
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/core_based_stat_area_entry.rb
|
151
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/lookup.rb
|
152
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/place_entry.rb
|
153
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/response.rb
|
154
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/lookup.rb
|
146
155
|
- lib/smartystreets_ruby_sdk/us_enrichment/property/financial/attributes.rb
|
147
156
|
- lib/smartystreets_ruby_sdk/us_enrichment/property/financial/history_entry.rb
|
148
157
|
- lib/smartystreets_ruby_sdk/us_enrichment/property/financial/lookup.rb
|
@@ -150,6 +159,13 @@ files:
|
|
150
159
|
- lib/smartystreets_ruby_sdk/us_enrichment/property/principal/attributes.rb
|
151
160
|
- lib/smartystreets_ruby_sdk/us_enrichment/property/principal/lookup.rb
|
152
161
|
- lib/smartystreets_ruby_sdk/us_enrichment/property/principal/response.rb
|
162
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/secondary/aliases_entry.rb
|
163
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/secondary/count/lookup.rb
|
164
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/secondary/count/response.rb
|
165
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/secondary/lookup.rb
|
166
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/secondary/response.rb
|
167
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/secondary/root_address_entry.rb
|
168
|
+
- lib/smartystreets_ruby_sdk/us_enrichment/secondary/secondaries_entry.rb
|
153
169
|
- lib/smartystreets_ruby_sdk/us_extract.rb
|
154
170
|
- lib/smartystreets_ruby_sdk/us_extract/address.rb
|
155
171
|
- lib/smartystreets_ruby_sdk/us_extract/client.rb
|