diff --git a/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/lookup.rb b/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/lookup.rb index 732feac..2cfb1e7 100644 --- a/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/lookup.rb +++ b/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/lookup.rb @@ -2,13 +2,18 @@ module SmartyStreets module USEnrichment module GeoReference class Lookup - attr_reader :smarty_key, :data_set, :data_sub_set, :etag + attr_reader :smarty_key, :data_set, :data_sub_set, :etag, :custom_param_hash - def initialize(smarty_key, etag=nil) + def initialize(smarty_key, etag=nil, custom_param_hash=nil) @smarty_key = smarty_key @data_set = 'geo-reference' @data_sub_set = nil @etag = etag + @custom_param_hash = {} + end + + def add_custom_parameter(parameter, value) + @custom_param_hash[parameter] = value end end end diff --git a/lib/smartystreets_ruby_sdk/us_enrichment/property/financial/lookup.rb b/lib/smartystreets_ruby_sdk/us_enrichment/property/financial/lookup.rb index 3c2e728..a965c5d 100644 --- a/lib/smartystreets_ruby_sdk/us_enrichment/property/financial/lookup.rb +++ b/lib/smartystreets_ruby_sdk/us_enrichment/property/financial/lookup.rb @@ -3,13 +3,18 @@ module USEnrichment module Property module Financial class Lookup - attr_reader :smarty_key, :data_set, :data_sub_set, :etag + attr_reader :smarty_key, :data_set, :data_sub_set, :etag, :custom_param_hash - def initialize(smarty_key, etag=nil) + def initialize(smarty_key, etag=nil, custom_param_hash=nil) @smarty_key = smarty_key @data_set = "property" @data_sub_set = "financial" @etag = etag + @custom_param_hash = {} + end + + def add_custom_parameter(parameter, value) + @custom_param_hash[parameter] = value end end end diff --git a/lib/smartystreets_ruby_sdk/us_enrichment/property/principal/lookup.rb b/lib/smartystreets_ruby_sdk/us_enrichment/property/principal/lookup.rb index c851470..812ab7f 100644 --- a/lib/smartystreets_ruby_sdk/us_enrichment/property/principal/lookup.rb +++ b/lib/smartystreets_ruby_sdk/us_enrichment/property/principal/lookup.rb @@ -3,13 +3,18 @@ module USEnrichment module Property module Principal class Lookup - attr_reader :smarty_key, :data_set, :data_sub_set, :etag + attr_reader :smarty_key, :data_set, :data_sub_set, :etag, :custom_param_hash - def initialize(smarty_key, etag=nil) + def initialize(smarty_key, etag=nil, custom_param_hash=nil) @smarty_key = smarty_key @data_set = "property" @data_sub_set = "principal" @etag = etag + @custom_param_hash = {} + end + + def add_custom_parameter(parameter, value) + @custom_param_hash[parameter] = value end end end diff --git a/lib/smartystreets_ruby_sdk/us_enrichment/secondary/count/lookup.rb b/lib/smartystreets_ruby_sdk/us_enrichment/secondary/count/lookup.rb index 4fe88c8..e0d78da 100644 --- a/lib/smartystreets_ruby_sdk/us_enrichment/secondary/count/lookup.rb +++ b/lib/smartystreets_ruby_sdk/us_enrichment/secondary/count/lookup.rb @@ -3,13 +3,18 @@ module USEnrichment module Secondary module Count class Lookup - attr_reader :smarty_key, :data_set, :data_sub_set, :etag + attr_reader :smarty_key, :data_set, :data_sub_set, :etag, :custom_param_hash - def initialize(smarty_key, etag=nil) + def initialize(smarty_key, etag=nil, custom_param_hash=nil) @smarty_key = smarty_key @data_set = "secondary" @data_sub_set = "count" @etag = etag + @custom_param_hash = {} + end + + def add_custom_parameter(parameter, value) + @custom_param_hash[parameter] = value end end end diff --git a/lib/smartystreets_ruby_sdk/us_enrichment/secondary/lookup.rb b/lib/smartystreets_ruby_sdk/us_enrichment/secondary/lookup.rb index 48e8e1e..4829cb7 100644 --- a/lib/smartystreets_ruby_sdk/us_enrichment/secondary/lookup.rb +++ b/lib/smartystreets_ruby_sdk/us_enrichment/secondary/lookup.rb @@ -2,13 +2,18 @@ module SmartyStreets module USEnrichment module Secondary class Lookup - attr_reader :smarty_key, :data_set, :data_sub_set, :etag + attr_reader :smarty_key, :data_set, :data_sub_set, :etag, :custom_param_hash - def initialize(smarty_key, etag=nil) + def initialize(smarty_key, etag=nil, custom_param_hash=nil) @smarty_key = smarty_key @data_set = "secondary" @data_sub_set = nil @etag = etag + @custom_param_hash = {} + end + + def add_custom_parameter(parameter, value) + @custom_param_hash[parameter] = value end end end diff --git a/test/smartystreets_ruby_sdk/us_street/test_street_client.rb b/test/smartystreets_ruby_sdk/us_street/test_street_client.rb index f5f719d..105defd 100644 --- a/test/smartystreets_ruby_sdk/us_street/test_street_client.rb +++ b/test/smartystreets_ruby_sdk/us_street/test_street_client.rb @@ -40,6 +40,8 @@ def test_send_populated_lookup 'match' => SmartyStreets::USStreet::MatchType::ENHANCED, 'candidates' => 5, 'format' => SmartyStreets::USStreet::OutputFormat::PROJECT_USA, + 'county_source' => SmartyStreets::USStreet::CountySource::GEOGRAPHIC, + 'parameter' => 'value', } serializer = FakeSerializer.new(expected_parameters) client = Client.new(sender, serializer) @@ -56,6 +58,8 @@ def test_send_populated_lookup lookup.urbanization = '10' lookup.match = SmartyStreets::USStreet::MatchType::ENHANCED lookup.format = SmartyStreets::USStreet::OutputFormat::PROJECT_USA + lookup.county_source = SmartyStreets::USStreet::CountySource::GEOGRAPHIC + lookup.add_custom_parameter('parameter', 'value') client.send_lookup(lookup) assert_equal(expected_parameters, sender.request.parameters)