com.precisely.apis.AddressAutocompleteServiceApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of PreciselyAPISJavaSDK Show documentation
Show all versions of PreciselyAPISJavaSDK Show documentation
Java SDK for accessing Precisely APIs which transform your business with new insights. Enrich and enhance your data, applications, business processes, and workflows with hundreds of Location and Identity datasets and APIs.
The newest version!
/*
* Precisely APIs
* Enhance & enrich your data, applications, business processes, and workflows with rich location, information, and identify APIs.
*
* The version of the OpenAPI document: 18.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.precisely.apis;
import com.precisely.ApiCallback;
import com.precisely.ApiClient;
import com.precisely.ApiException;
import com.precisely.ApiResponse;
import com.precisely.Configuration;
import com.precisely.Pair;
import com.precisely.ProgressRequestBody;
import com.precisely.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.precisely.apis.model.ErrorInfo;
import com.precisely.apis.model.TypeaheadLocations;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AddressAutocompleteServiceApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public AddressAutocompleteServiceApi() {
this(Configuration.getDefaultApiClient());
}
public AddressAutocompleteServiceApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for searchV2
* @param searchText The input to be searched. (required)
* @param latitude Latitude of the location. We need to make sure that either Lat/Lng or Country is provided to API (optional)
* @param longitude Longitude of the location. We need to make sure that either Lat/Lng or Country is provided to API (optional)
* @param searchRadius Radius range within which search is performed. (optional)
* @param searchRadiusUnit Radius unit such as Feet, Kilometers, Miles or Meters. (optional)
* @param maxCandidates Maximum number of POIs that can be retrieved. (optional)
* @param country Country ISO code. We need to make sure that either Lat/Lng or Country is provided to API (optional)
* @param matchOnAddressNumber Option so that we force api to match on address number (optional)
* @param autoDetectLocation Option to allow API to detect origin of API request automatically (optional)
* @param ipAddress (optional)
* @param areaName1 State province of the input to be searched (optional)
* @param areaName3 City of the input to be searched (optional)
* @param postCode Postal Code of the input to be searched (optional)
* @param returnAdminAreasOnly if value set 'Y' then it will only do a matching on postcode or areaName1, areaName2, areaName3 and areaName4 fields in the data (optional)
* @param includeRangesDetails if value set 'Y' then display all unit info of ranges, if value set 'N' then don't show ranges (optional)
* @param searchType Preference to control search type of interactive requests. (optional)
* @param searchOnAddressNumber Preference to search on address number. (optional)
* @param searchOnUnitInfo Preference to search on unit info. (optional)
* @param searchOnPOBox Specifies whether to enable search for matching on PO Box. (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code Description Response Headers
200 OK -
400 Bad Request -
500 Internal Server Error -
*/
public okhttp3.Call searchV2Call(String searchText, String latitude, String longitude, String searchRadius, String searchRadiusUnit, String maxCandidates, String country, String matchOnAddressNumber, String autoDetectLocation, String ipAddress, String areaName1, String areaName3, String postCode, String returnAdminAreasOnly, String includeRangesDetails, String searchType, String searchOnAddressNumber, String searchOnUnitInfo, String searchOnPOBox, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/typeahead/v1/locations";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (searchText != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchText", searchText));
}
if (latitude != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("latitude", latitude));
}
if (longitude != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("longitude", longitude));
}
if (searchRadius != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchRadius", searchRadius));
}
if (searchRadiusUnit != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchRadiusUnit", searchRadiusUnit));
}
if (maxCandidates != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("maxCandidates", maxCandidates));
}
if (country != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("country", country));
}
if (matchOnAddressNumber != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("matchOnAddressNumber", matchOnAddressNumber));
}
if (autoDetectLocation != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("autoDetectLocation", autoDetectLocation));
}
if (ipAddress != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("ipAddress", ipAddress));
}
if (areaName1 != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("areaName1", areaName1));
}
if (areaName3 != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("areaName3", areaName3));
}
if (postCode != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("postCode", postCode));
}
if (returnAdminAreasOnly != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("returnAdminAreasOnly", returnAdminAreasOnly));
}
if (includeRangesDetails != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("includeRangesDetails", includeRangesDetails));
}
if (searchType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchType", searchType));
}
if (searchOnAddressNumber != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchOnAddressNumber", searchOnAddressNumber));
}
if (searchOnUnitInfo != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchOnUnitInfo", searchOnUnitInfo));
}
if (searchOnPOBox != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchOnPOBox", searchOnPOBox));
}
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "oAuth2Password" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call searchV2ValidateBeforeCall(String searchText, String latitude, String longitude, String searchRadius, String searchRadiusUnit, String maxCandidates, String country, String matchOnAddressNumber, String autoDetectLocation, String ipAddress, String areaName1, String areaName3, String postCode, String returnAdminAreasOnly, String includeRangesDetails, String searchType, String searchOnAddressNumber, String searchOnUnitInfo, String searchOnPOBox, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'searchText' is set
if (searchText == null) {
throw new ApiException("Missing the required parameter 'searchText' when calling searchV2(Async)");
}
okhttp3.Call localVarCall = searchV2Call(searchText, latitude, longitude, searchRadius, searchRadiusUnit, maxCandidates, country, matchOnAddressNumber, autoDetectLocation, ipAddress, areaName1, areaName3, postCode, returnAdminAreasOnly, includeRangesDetails, searchType, searchOnAddressNumber, searchOnUnitInfo, searchOnPOBox, _callback);
return localVarCall;
}
/**
* Address Autocomplete Search
* Performs search to retrieve list of places by input text and location vicinity.
* @param searchText The input to be searched. (required)
* @param latitude Latitude of the location. We need to make sure that either Lat/Lng or Country is provided to API (optional)
* @param longitude Longitude of the location. We need to make sure that either Lat/Lng or Country is provided to API (optional)
* @param searchRadius Radius range within which search is performed. (optional)
* @param searchRadiusUnit Radius unit such as Feet, Kilometers, Miles or Meters. (optional)
* @param maxCandidates Maximum number of POIs that can be retrieved. (optional)
* @param country Country ISO code. We need to make sure that either Lat/Lng or Country is provided to API (optional)
* @param matchOnAddressNumber Option so that we force api to match on address number (optional)
* @param autoDetectLocation Option to allow API to detect origin of API request automatically (optional)
* @param ipAddress (optional)
* @param areaName1 State province of the input to be searched (optional)
* @param areaName3 City of the input to be searched (optional)
* @param postCode Postal Code of the input to be searched (optional)
* @param returnAdminAreasOnly if value set 'Y' then it will only do a matching on postcode or areaName1, areaName2, areaName3 and areaName4 fields in the data (optional)
* @param includeRangesDetails if value set 'Y' then display all unit info of ranges, if value set 'N' then don't show ranges (optional)
* @param searchType Preference to control search type of interactive requests. (optional)
* @param searchOnAddressNumber Preference to search on address number. (optional)
* @param searchOnUnitInfo Preference to search on unit info. (optional)
* @param searchOnPOBox Specifies whether to enable search for matching on PO Box. (optional)
* @return TypeaheadLocations
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code Description Response Headers
200 OK -
400 Bad Request -
500 Internal Server Error -
*/
public TypeaheadLocations searchV2(String searchText, String latitude, String longitude, String searchRadius, String searchRadiusUnit, String maxCandidates, String country, String matchOnAddressNumber, String autoDetectLocation, String ipAddress, String areaName1, String areaName3, String postCode, String returnAdminAreasOnly, String includeRangesDetails, String searchType, String searchOnAddressNumber, String searchOnUnitInfo, String searchOnPOBox) throws ApiException {
ApiResponse localVarResp = searchV2WithHttpInfo(searchText, latitude, longitude, searchRadius, searchRadiusUnit, maxCandidates, country, matchOnAddressNumber, autoDetectLocation, ipAddress, areaName1, areaName3, postCode, returnAdminAreasOnly, includeRangesDetails, searchType, searchOnAddressNumber, searchOnUnitInfo, searchOnPOBox);
return localVarResp.getData();
}
/**
* Address Autocomplete Search
* Performs search to retrieve list of places by input text and location vicinity.
* @param searchText The input to be searched. (required)
* @param latitude Latitude of the location. We need to make sure that either Lat/Lng or Country is provided to API (optional)
* @param longitude Longitude of the location. We need to make sure that either Lat/Lng or Country is provided to API (optional)
* @param searchRadius Radius range within which search is performed. (optional)
* @param searchRadiusUnit Radius unit such as Feet, Kilometers, Miles or Meters. (optional)
* @param maxCandidates Maximum number of POIs that can be retrieved. (optional)
* @param country Country ISO code. We need to make sure that either Lat/Lng or Country is provided to API (optional)
* @param matchOnAddressNumber Option so that we force api to match on address number (optional)
* @param autoDetectLocation Option to allow API to detect origin of API request automatically (optional)
* @param ipAddress (optional)
* @param areaName1 State province of the input to be searched (optional)
* @param areaName3 City of the input to be searched (optional)
* @param postCode Postal Code of the input to be searched (optional)
* @param returnAdminAreasOnly if value set 'Y' then it will only do a matching on postcode or areaName1, areaName2, areaName3 and areaName4 fields in the data (optional)
* @param includeRangesDetails if value set 'Y' then display all unit info of ranges, if value set 'N' then don't show ranges (optional)
* @param searchType Preference to control search type of interactive requests. (optional)
* @param searchOnAddressNumber Preference to search on address number. (optional)
* @param searchOnUnitInfo Preference to search on unit info. (optional)
* @param searchOnPOBox Specifies whether to enable search for matching on PO Box. (optional)
* @return ApiResponse<TypeaheadLocations>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code Description Response Headers
200 OK -
400 Bad Request -
500 Internal Server Error -
*/
public ApiResponse searchV2WithHttpInfo(String searchText, String latitude, String longitude, String searchRadius, String searchRadiusUnit, String maxCandidates, String country, String matchOnAddressNumber, String autoDetectLocation, String ipAddress, String areaName1, String areaName3, String postCode, String returnAdminAreasOnly, String includeRangesDetails, String searchType, String searchOnAddressNumber, String searchOnUnitInfo, String searchOnPOBox) throws ApiException {
okhttp3.Call localVarCall = searchV2ValidateBeforeCall(searchText, latitude, longitude, searchRadius, searchRadiusUnit, maxCandidates, country, matchOnAddressNumber, autoDetectLocation, ipAddress, areaName1, areaName3, postCode, returnAdminAreasOnly, includeRangesDetails, searchType, searchOnAddressNumber, searchOnUnitInfo, searchOnPOBox, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Address Autocomplete Search (asynchronously)
* Performs search to retrieve list of places by input text and location vicinity.
* @param searchText The input to be searched. (required)
* @param latitude Latitude of the location. We need to make sure that either Lat/Lng or Country is provided to API (optional)
* @param longitude Longitude of the location. We need to make sure that either Lat/Lng or Country is provided to API (optional)
* @param searchRadius Radius range within which search is performed. (optional)
* @param searchRadiusUnit Radius unit such as Feet, Kilometers, Miles or Meters. (optional)
* @param maxCandidates Maximum number of POIs that can be retrieved. (optional)
* @param country Country ISO code. We need to make sure that either Lat/Lng or Country is provided to API (optional)
* @param matchOnAddressNumber Option so that we force api to match on address number (optional)
* @param autoDetectLocation Option to allow API to detect origin of API request automatically (optional)
* @param ipAddress (optional)
* @param areaName1 State province of the input to be searched (optional)
* @param areaName3 City of the input to be searched (optional)
* @param postCode Postal Code of the input to be searched (optional)
* @param returnAdminAreasOnly if value set 'Y' then it will only do a matching on postcode or areaName1, areaName2, areaName3 and areaName4 fields in the data (optional)
* @param includeRangesDetails if value set 'Y' then display all unit info of ranges, if value set 'N' then don't show ranges (optional)
* @param searchType Preference to control search type of interactive requests. (optional)
* @param searchOnAddressNumber Preference to search on address number. (optional)
* @param searchOnUnitInfo Preference to search on unit info. (optional)
* @param searchOnPOBox Specifies whether to enable search for matching on PO Box. (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code Description Response Headers
200 OK -
400 Bad Request -
500 Internal Server Error -
*/
public okhttp3.Call searchV2Async(String searchText, String latitude, String longitude, String searchRadius, String searchRadiusUnit, String maxCandidates, String country, String matchOnAddressNumber, String autoDetectLocation, String ipAddress, String areaName1, String areaName3, String postCode, String returnAdminAreasOnly, String includeRangesDetails, String searchType, String searchOnAddressNumber, String searchOnUnitInfo, String searchOnPOBox, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = searchV2ValidateBeforeCall(searchText, latitude, longitude, searchRadius, searchRadiusUnit, maxCandidates, country, matchOnAddressNumber, autoDetectLocation, ipAddress, areaName1, areaName3, postCode, returnAdminAreasOnly, includeRangesDetails, searchType, searchOnAddressNumber, searchOnUnitInfo, searchOnPOBox, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}