smartystreets_ruby_sdk 5.20.2 → 5.20.4
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/examples/us_enrichment_example.rb +1 -0
- data/lib/smartystreets_ruby_sdk/errors.rb +2 -0
- data/lib/smartystreets_ruby_sdk/exceptions.rb +3 -0
- data/lib/smartystreets_ruby_sdk/international_street/components.rb +9 -1
- data/lib/smartystreets_ruby_sdk/status_code_sender.rb +2 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/client.rb +9 -5
- data/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/lookup.rb +3 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/response.rb +3 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/lookup.rb +3 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/property/financial/lookup.rb +3 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/property/financial/response.rb +3 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/property/principal/lookup.rb +3 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/property/principal/response.rb +3 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/secondary/count/lookup.rb +3 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/secondary/count/response.rb +3 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/secondary/lookup.rb +3 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/secondary/response.rb +3 -2
- data/lib/smartystreets_ruby_sdk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c554ac1a2e41bfab06caaf370cc2c3650cf8978d4a9124b9d264d2fb0e816a52
|
4
|
+
data.tar.gz: 3665b21cad59e010cc754c4f92a6c353857537e1634a4b119d5b56f7bb405e93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e9118f8e575962fc0e0381687baf92ed8fcb1bb004699dd90a38737a8064108577b63a29d57d2a93abae1df260e7af70599e0415fc9719f9bde185b8ec5f519
|
7
|
+
data.tar.gz: d7753e3c65e0a7a4c5c734c60caf3f03c725f952ecc411ab459e55cbbf90edc41cd10e649b3f31cfba80fa706c4f90a3977b81d0279127aafec2cfd055ead680
|
@@ -33,6 +33,7 @@ class USEnrichmentAddressExample
|
|
33
33
|
lookup.city = "Somerville"
|
34
34
|
lookup.state = "NJ"
|
35
35
|
lookup.zipcode = "08876"
|
36
|
+
#lookup.etag = "AUBAGDQDAIGQYCYC"
|
36
37
|
|
37
38
|
# Or, create a freeform lookup to search using a single line address
|
38
39
|
freeform_lookup = SmartyStreets::USEnrichment::Lookup.new
|
@@ -1,4 +1,6 @@
|
|
1
1
|
module SmartyStreets
|
2
|
+
NOT_MODIFIED = 'Not Modified: This data has not been modified since the last request. Please remove the etag header to fetch this data'.freeze
|
3
|
+
|
2
4
|
BAD_CREDENTIALS = 'Unauthorized: The credentials were provided incorrectly or did not match any existing,
|
3
5
|
active credentials.'.freeze
|
4
6
|
|
@@ -12,7 +12,8 @@ module SmartyStreets
|
|
12
12
|
:sub_building_name, :postal_code, :dependent_locality, :premise_type, :sub_building_number,
|
13
13
|
:super_administrative_area, :premise_extra, :dependent_thoroughfare_predirection,
|
14
14
|
:building_trailing_type, :thoroughfare_predirection, :building_name, :level_type, :level_number,
|
15
|
-
:country_iso_3, :sub_building_type
|
15
|
+
:country_iso_3, :sub_building_type, :additional_content, :delivery_installation, :delivery_installation_type,
|
16
|
+
:delivery_installation_qualifier_name, :route, :route_number, :route_type
|
16
17
|
|
17
18
|
def initialize(obj)
|
18
19
|
@country_iso_3 = obj.fetch('country_iso_3', nil)
|
@@ -58,6 +59,13 @@ module SmartyStreets
|
|
58
59
|
@post_box = obj.fetch('post_box', nil)
|
59
60
|
@post_box_type = obj.fetch('post_box_type', nil)
|
60
61
|
@post_box_number = obj.fetch('post_box_number', nil)
|
62
|
+
@additional_content = obj.fetch('additional_content', nil)
|
63
|
+
@delivery_installation = obj.fetch('delivery_installation', nil)
|
64
|
+
@delivery_installation_type = obj.fetch('delivery_installation_type', nil)
|
65
|
+
@delivery_installation_qualifier_name = obj.fetch('delivery_installation_qualifier_name', nil)
|
66
|
+
@route = obj.fetch('route', nil)
|
67
|
+
@route_number = obj.fetch('route_number', nil)
|
68
|
+
@route_type = obj.fetch('route_type', nil)
|
61
69
|
end
|
62
70
|
end
|
63
71
|
end
|
@@ -83,6 +83,10 @@ module SmartyStreets
|
|
83
83
|
smarty_request = Request.new
|
84
84
|
|
85
85
|
return if lookup.nil?
|
86
|
+
|
87
|
+
if (!lookup.etag.nil?)
|
88
|
+
smarty_request.header["ETAG"] = lookup.etag
|
89
|
+
end
|
86
90
|
if (lookup.smarty_key.nil?)
|
87
91
|
if (lookup.data_sub_set.nil?)
|
88
92
|
smarty_request.url_components = '/search/' + lookup.data_set
|
@@ -113,19 +117,19 @@ module SmartyStreets
|
|
113
117
|
results.each do |raw_result|
|
114
118
|
result = nil
|
115
119
|
if lookup.data_sub_set == "financial"
|
116
|
-
result = USEnrichment::Property::Financial::Response.new(raw_result)
|
120
|
+
result = USEnrichment::Property::Financial::Response.new(raw_result, response.header['etag'])
|
117
121
|
end
|
118
122
|
if lookup.data_sub_set == "principal"
|
119
|
-
result = USEnrichment::Property::Principal::Response.new(raw_result)
|
123
|
+
result = USEnrichment::Property::Principal::Response.new(raw_result, response.header['etag'])
|
120
124
|
end
|
121
125
|
if lookup.data_set == "geo-reference"
|
122
|
-
result = USEnrichment::GeoReference::Response.new(raw_result)
|
126
|
+
result = USEnrichment::GeoReference::Response.new(raw_result, response.header['etag'])
|
123
127
|
end
|
124
128
|
if lookup.data_set == "secondary"
|
125
129
|
if lookup.data_sub_set == "count"
|
126
|
-
result = USEnrichment::Secondary::Count::Response.new(raw_result)
|
130
|
+
result = USEnrichment::Secondary::Count::Response.new(raw_result, response.header['etag'])
|
127
131
|
elsif lookup.data_sub_set.nil?
|
128
|
-
result = USEnrichment::Secondary::Response.new(raw_result)
|
132
|
+
result = USEnrichment::Secondary::Response.new(raw_result, response.header['etag'])
|
129
133
|
end
|
130
134
|
end
|
131
135
|
output << result
|
@@ -2,12 +2,13 @@ module SmartyStreets
|
|
2
2
|
module USEnrichment
|
3
3
|
module GeoReference
|
4
4
|
class Lookup
|
5
|
-
attr_reader :smarty_key, :data_set, :data_sub_set
|
5
|
+
attr_reader :smarty_key, :data_set, :data_sub_set, :etag
|
6
6
|
|
7
|
-
def initialize(smarty_key)
|
7
|
+
def initialize(smarty_key, etag=nil)
|
8
8
|
@smarty_key = smarty_key
|
9
9
|
@data_set = 'geo-reference'
|
10
10
|
@data_sub_set = nil
|
11
|
+
@etag = etag
|
11
12
|
end
|
12
13
|
end
|
13
14
|
end
|
@@ -4,12 +4,13 @@ module SmartyStreets
|
|
4
4
|
module USEnrichment
|
5
5
|
module GeoReference
|
6
6
|
class Response
|
7
|
-
attr_reader :smarty_key, :data_set, :attributes
|
7
|
+
attr_reader :smarty_key, :data_set, :attributes, :etag
|
8
8
|
|
9
|
-
def initialize(obj)
|
9
|
+
def initialize(obj, etag=nil)
|
10
10
|
@smarty_key = obj['smarty_key']
|
11
11
|
@data_set = 'geo-reference'
|
12
12
|
@attributes = Attributes.new(obj['attributes'])
|
13
|
+
@etag = etag
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
@@ -2,9 +2,9 @@ require_relative '../json_able'
|
|
2
2
|
module SmartyStreets
|
3
3
|
module USEnrichment
|
4
4
|
class Lookup < JSONAble
|
5
|
-
attr_accessor :smarty_key, :data_set, :data_sub_set, :freeform, :street, :city, :state, :zipcode
|
5
|
+
attr_accessor :smarty_key, :data_set, :data_sub_set, :freeform, :street, :city, :state, :zipcode, :etag
|
6
6
|
|
7
|
-
def initialize(smarty_key=nil, data_set=nil, data_sub_set=nil, freeform=nil, street=nil, city=nil, state=nil, zipcode=nil)
|
7
|
+
def initialize(smarty_key=nil, data_set=nil, data_sub_set=nil, freeform=nil, street=nil, city=nil, state=nil, zipcode=nil, etag=nil)
|
8
8
|
@smarty_key = smarty_key
|
9
9
|
@data_set = data_set
|
10
10
|
@data_sub_set = data_sub_set
|
@@ -13,6 +13,7 @@ module SmartyStreets
|
|
13
13
|
@city = city
|
14
14
|
@state = state
|
15
15
|
@zipcode = zipcode
|
16
|
+
@etag = etag
|
16
17
|
end
|
17
18
|
end
|
18
19
|
end
|
@@ -3,12 +3,13 @@ module SmartyStreets
|
|
3
3
|
module Property
|
4
4
|
module Financial
|
5
5
|
class Lookup
|
6
|
-
attr_reader :smarty_key, :data_set, :data_sub_set
|
6
|
+
attr_reader :smarty_key, :data_set, :data_sub_set, :etag
|
7
7
|
|
8
|
-
def initialize(smarty_key)
|
8
|
+
def initialize(smarty_key, etag=nil)
|
9
9
|
@smarty_key = smarty_key
|
10
10
|
@data_set = "property"
|
11
11
|
@data_sub_set = "financial"
|
12
|
+
@etag = etag
|
12
13
|
end
|
13
14
|
end
|
14
15
|
end
|
@@ -5,13 +5,14 @@ module SmartyStreets
|
|
5
5
|
module Property
|
6
6
|
module Financial
|
7
7
|
class Response
|
8
|
-
attr_reader :smarty_key, :data_set, :data_sub_set, :attributes
|
8
|
+
attr_reader :smarty_key, :data_set, :data_sub_set, :attributes, :etag
|
9
9
|
|
10
|
-
def initialize(obj)
|
10
|
+
def initialize(obj, etag=nil)
|
11
11
|
@smarty_key = obj['smarty_key']
|
12
12
|
@data_set = obj['data_set']
|
13
13
|
@data_sub_set = obj['data_sub_set']
|
14
14
|
@attributes = Attributes.new(obj['attributes'])
|
15
|
+
@etag = etag
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -3,12 +3,13 @@ module SmartyStreets
|
|
3
3
|
module Property
|
4
4
|
module Principal
|
5
5
|
class Lookup
|
6
|
-
attr_reader :smarty_key, :data_set, :data_sub_set
|
6
|
+
attr_reader :smarty_key, :data_set, :data_sub_set, :etag
|
7
7
|
|
8
|
-
def initialize(smarty_key)
|
8
|
+
def initialize(smarty_key, etag=nil)
|
9
9
|
@smarty_key = smarty_key
|
10
10
|
@data_set = "property"
|
11
11
|
@data_sub_set = "principal"
|
12
|
+
@etag = etag
|
12
13
|
end
|
13
14
|
end
|
14
15
|
end
|
@@ -5,13 +5,14 @@ module SmartyStreets
|
|
5
5
|
module Property
|
6
6
|
module Principal
|
7
7
|
class Response
|
8
|
-
attr_reader :smarty_key, :data_set, :data_sub_set, :attributes
|
8
|
+
attr_reader :smarty_key, :data_set, :data_sub_set, :attributes, :etag
|
9
9
|
|
10
|
-
def initialize(obj)
|
10
|
+
def initialize(obj, etag=nil)
|
11
11
|
@smarty_key = obj['smarty_key']
|
12
12
|
@data_set = obj['data_set']
|
13
13
|
@data_sub_set = obj['data_sub_set']
|
14
14
|
@attributes = Attributes.new(obj['attributes'])
|
15
|
+
@etag = etag
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -3,12 +3,13 @@ module SmartyStreets
|
|
3
3
|
module Secondary
|
4
4
|
module Count
|
5
5
|
class Lookup
|
6
|
-
attr_reader :smarty_key, :data_set, :data_sub_set
|
6
|
+
attr_reader :smarty_key, :data_set, :data_sub_set, :etag
|
7
7
|
|
8
|
-
def initialize(smarty_key)
|
8
|
+
def initialize(smarty_key, etag=nil)
|
9
9
|
@smarty_key = smarty_key
|
10
10
|
@data_set = "secondary"
|
11
11
|
@data_sub_set = "count"
|
12
|
+
@etag = etag
|
12
13
|
end
|
13
14
|
end
|
14
15
|
end
|
@@ -3,11 +3,12 @@ module SmartyStreets
|
|
3
3
|
module Secondary
|
4
4
|
module Count
|
5
5
|
class Response
|
6
|
-
attr_reader :smarty_key, :count
|
6
|
+
attr_reader :smarty_key, :count, :etag
|
7
7
|
|
8
|
-
def initialize(obj)
|
8
|
+
def initialize(obj, etag=nil)
|
9
9
|
@smarty_key = obj['smarty_key']
|
10
10
|
@count = obj['count']
|
11
|
+
@etag = etag
|
11
12
|
end
|
12
13
|
end
|
13
14
|
end
|
@@ -2,12 +2,13 @@ module SmartyStreets
|
|
2
2
|
module USEnrichment
|
3
3
|
module Secondary
|
4
4
|
class Lookup
|
5
|
-
attr_reader :smarty_key, :data_set, :data_sub_set
|
5
|
+
attr_reader :smarty_key, :data_set, :data_sub_set, :etag
|
6
6
|
|
7
|
-
def initialize(smarty_key)
|
7
|
+
def initialize(smarty_key, etag=nil)
|
8
8
|
@smarty_key = smarty_key
|
9
9
|
@data_set = "secondary"
|
10
10
|
@data_sub_set = nil
|
11
|
+
@etag = etag
|
11
12
|
end
|
12
13
|
end
|
13
14
|
end
|
@@ -6,15 +6,16 @@ module SmartyStreets
|
|
6
6
|
module USEnrichment
|
7
7
|
module Secondary
|
8
8
|
class Response
|
9
|
-
attr_reader :smarty_key, :root_address, :aliases, :secondaries
|
9
|
+
attr_reader :smarty_key, :root_address, :aliases, :secondaries, :etag
|
10
10
|
|
11
|
-
def initialize(obj)
|
11
|
+
def initialize(obj, etag=nil)
|
12
12
|
@smarty_key = obj['smarty_key']
|
13
13
|
@root_address = Secondary::RootAddressEntry.new(obj['root_address'])
|
14
14
|
if !obj['aliases'].nil?
|
15
15
|
@aliases = createAliasesArray(obj['aliases'])
|
16
16
|
end
|
17
17
|
@secondaries = createSecondariesArray(obj['secondaries'])
|
18
|
+
@etag=etag
|
18
19
|
end
|
19
20
|
|
20
21
|
def createAliasesArray(obj)
|
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.20.
|
4
|
+
version: 5.20.4
|
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-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|