From 0b1ee4b559c9e76df4192ef68324fe080192c2b5 Mon Sep 17 00:00:00 2001 From: Bryan Amundson Date: Wed, 19 Jun 2024 11:40:45 -0600 Subject: [PATCH] Added compatibility parameter to US Street and US Zipcode. --- src/sdk/USStreetApi/Client.cs | 3 ++- src/sdk/USStreetApi/Lookup.cs | 3 +++ src/sdk/USZipCodeApi/Client.cs | 1 + src/sdk/USZipCodeApi/Lookup.cs | 11 +++++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/sdk/USStreetApi/Client.cs b/src/sdk/USStreetApi/Client.cs index 09248a6..ea9fb3a 100644 --- a/src/sdk/USStreetApi/Client.cs +++ b/src/sdk/USStreetApi/Client.cs @@ -68,7 +68,8 @@ private static void PopulateQueryString(Lookup address, Request request) request.SetParameter("addressee", address.Addressee); request.SetParameter("urbanization", address.Urbanization); request.SetParameter("match", address.MatchStrategy); - + request.SetParameter("compatibility", address.Compatibility); + if (address.MaxCandidates != 1) request.SetParameter("candidates", address.MaxCandidates.ToString(CultureInfo.InvariantCulture)); diff --git a/src/sdk/USStreetApi/Lookup.cs b/src/sdk/USStreetApi/Lookup.cs index 0b27bb7..fc7c25f 100644 --- a/src/sdk/USStreetApi/Lookup.cs +++ b/src/sdk/USStreetApi/Lookup.cs @@ -59,6 +59,9 @@ public class Lookup : ILookup [DataMember(Name = "format")] public string OutputFormat { get; set; } + [DataMember(Name = "compatibility")] + public string Compatibility { get; set; } + public int MaxCandidates { get => this.maxCandidates; diff --git a/src/sdk/USZipCodeApi/Client.cs b/src/sdk/USZipCodeApi/Client.cs index e88d493..c5146d0 100644 --- a/src/sdk/USZipCodeApi/Client.cs +++ b/src/sdk/USZipCodeApi/Client.cs @@ -58,6 +58,7 @@ private static void PopulateQueryString(Lookup lookup, Request request) request.SetParameter("city", lookup.City); request.SetParameter("state", lookup.State); request.SetParameter("zipcode", lookup.ZipCode); + request.SetParameter("compatibility", lookup.Compatibility); } private static void AssignResultsToLookups(Batch batch, IList results) diff --git a/src/sdk/USZipCodeApi/Lookup.cs b/src/sdk/USZipCodeApi/Lookup.cs index 7d29a4f..0a48e3b 100644 --- a/src/sdk/USZipCodeApi/Lookup.cs +++ b/src/sdk/USZipCodeApi/Lookup.cs @@ -20,6 +20,9 @@ public class Lookup : ILookup [DataMember(Name = "zipcode")] public string ZipCode { get; set; } + [DataMember(Name = "compatibility")] + public string Compatibility { get; set; } + #endregion #region [ Constructors ] @@ -47,6 +50,14 @@ public Lookup(string city, string state, string zipcode) : this() this.ZipCode = zipcode; } + public Lookup(string city, string state, string zipcode, string compatibility) : this() + { + this.City = city; + this.State = state; + this.ZipCode = zipcode; + this.Compatibility = compatibility; + } + #endregion } } \ No newline at end of file