You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lookup1.inputId="24601";// Optional ID from your system
29
+
lookup1.inputId="24601";// Optional ID from your system
28
30
lookup1.addressee="John Doe";
29
31
lookup1.street="330 N 100 W";
30
32
lookup1.street2="closet under the stairs";
31
33
lookup1.secondary="APT 2";
32
-
lookup1.urbanization="";// Only applies to Puerto Rico addresses
34
+
lookup1.urbanization="";// Only applies to Puerto Rico addresses
33
35
lookup1.city="Provo";
34
36
lookup1.state="Utah";
35
37
lookup1.zipCode="84601";
36
38
lookup1.maxCandidates=3;
37
-
lookup1.match="invalid";// "invalid" is the most permissive match,
38
-
// this will always return at least one result even if the address is invalid.
39
-
// Refer to the documentation for additional MatchStrategy options.
39
+
lookup1.match="enhanced";// The API will return detailed output based on a more aggressive matching mechanism. It also includes a more comprehensive address dataset beyond just the postal address data. Requires a US Core license or a US Rooftop Geocoding license.
40
+
// Refer to the documentation for additional MatchStrategy options.
* @param retries The maximum number of times to retry sending the request to the API. (Default is 5)
61
-
* @returnReturns <b>this</b> to accommodate method chaining.
63
+
* @returnClientBuilder <b>this</b> to accommodate method chaining.
62
64
*/
63
65
withMaxRetries(retries){
64
66
this.maxRetries=retries;
@@ -68,7 +70,7 @@ class ClientBuilder {
68
70
/**
69
71
* @param timeout The maximum time (in milliseconds) to wait for a connection, and also to wait for <br>
70
72
* the response to be read. (Default is 10000)
71
-
* @returnReturns <b>this</b> to accommodate method chaining.
73
+
* @returnClientBuilder <b>this</b> to accommodate method chaining.
72
74
*/
73
75
withMaxTimeout(timeout){
74
76
this.maxTimeout=timeout;
@@ -77,7 +79,7 @@ class ClientBuilder {
77
79
78
80
/**
79
81
* @param sender Default is a series of nested senders. See <b>buildSender()</b>.
80
-
* @returnReturns <b>this</b> to accommodate method chaining.
82
+
* @returnClientBuilder <b>this</b> to accommodate method chaining.
81
83
*/
82
84
withSender(sender){
83
85
this.httpSender=sender;
@@ -87,7 +89,7 @@ class ClientBuilder {
87
89
/**
88
90
* This may be useful when using a local installation of the Smarty APIs.
89
91
* @param url Defaults to the URL for the API corresponding to the <b>Client</b> object being built.
90
-
* @returnReturns <b>this</b> to accommodate method chaining.
92
+
* @returnClientBuilder <b>this</b> to accommodate method chaining.
91
93
*/
92
94
withBaseUrl(url){
93
95
this.baseUrl=url;
@@ -101,7 +103,7 @@ class ClientBuilder {
101
103
* @param protocol The protocol on the proxy server to which you wish to connect. If the proxy server uses HTTPS, then you must set the protocol to 'https'.
102
104
* @param username The username to login to the proxy.
103
105
* @param password The password to login to the proxy.
104
-
* @returnReturns <b>this</b> to accommodate method chaining.
106
+
* @returnClientBuilder <b>this</b> to accommodate method chaining.
105
107
*/
106
108
withProxy(host,port,protocol,username,password){
107
109
this.proxy={
@@ -123,35 +125,68 @@ class ClientBuilder {
123
125
/**
124
126
* Use this to add any additional headers you need.
125
127
* @param customHeaders A String to Object <b>Map</b> of header name/value pairs.
126
-
* @returnReturns <b>this</b> to accommodate method chaining.
128
+
* @returnClientBuilder <b>this</b> to accommodate method chaining.
127
129
*/
128
130
withCustomHeaders(customHeaders){
129
131
this.customHeaders=customHeaders;
130
-
131
132
returnthis;
132
133
}
133
134
134
135
/**
135
136
* Enables debug mode, which will print information about the HTTP request and response to console.log
136
-
* @returnReturns <b>this</b> to accommodate method chaining.
137
+
* @returnClientBuilder <b>this</b> to accommodate method chaining.
137
138
*/
138
139
withDebug(){
139
140
this.debug=true;
140
-
141
141
returnthis;
142
142
}
143
143
144
144
/**
145
145
* Allows the caller to specify the subscription license (aka "track") they wish to use.
146
146
* @param licenses A String Array of licenses.
147
-
* @returnsReturns <b>this</b> to accommodate method chaining.
147
+
* @returnsClientBuilder <b>this</b> to accommodate method chaining.
148
148
*/
149
149
withLicenses(licenses){
150
150
this.licenses=licenses;
151
+
returnthis;
152
+
}
153
+
154
+
/**
155
+
* Allows the caller to specify key and value pair that is added to the request
156
+
* @param {string} key - The query parameter key
157
+
* @param {string} value - The query parameter value
158
+
* @return ClientBuilder <b>this</b> to accommodate method chaining.
159
+
*/
160
+
withCustomQuery(key,value){
161
+
this.customQueries.set(key,value);
162
+
returnthis;
163
+
}
151
164
165
+
/**
166
+
* Allows the caller to specify key and value pair and appends the value associated with the key, seperated by a comma.
167
+
* @param {string} key - The query parameter key
168
+
* @param {string} value - The query parameter value
169
+
* @return ClientBuilder <b>this</b> to accommodate method chaining.
170
+
*/
171
+
withCustomCommaSeperatedQuery(key,value){
172
+
letvalues=this.customQueries.get(key);
173
+
if(values===""){
174
+
values=value;
175
+
}else{
176
+
values+=","+value;
177
+
}
178
+
this.customQueries.set(key,values);
152
179
returnthis;
153
180
}
154
181
182
+
/**
183
+
* Adds to the request query to use the component analysis feature.
184
+
* @return ClientBuilder <b>this</b> to accommodate method chaining.
0 commit comments