All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.precisely.apis.AddressAutocompleteEnterpriseServiceApi Maven / Gradle / Ivy

Go to download

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 AddressAutocompleteEnterpriseServiceApi {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;

    public AddressAutocompleteEnterpriseServiceApi() {
        this(Configuration.getDefaultApiClient());
    }

    public AddressAutocompleteEnterpriseServiceApi(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 listLocations
     * @param searchText The input to be searched. (required)
     * @param transactionId transactionId. (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 listLocationsCall(String searchText, String transactionId, 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/list/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 (transactionId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("transactionId", transactionId)); } 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 listLocationsValidateBeforeCall(String searchText, String transactionId, 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 listLocations(Async)"); } // verify the required parameter 'transactionId' is set if (transactionId == null) { throw new ApiException("Missing the required parameter 'transactionId' when calling listLocations(Async)"); } okhttp3.Call localVarCall = listLocationsCall(searchText, transactionId, latitude, longitude, searchRadius, searchRadiusUnit, maxCandidates, country, matchOnAddressNumber, autoDetectLocation, ipAddress, areaName1, areaName3, postCode, returnAdminAreasOnly, includeRangesDetails, searchType, searchOnAddressNumber, searchOnUnitInfo, searchOnPOBox, _callback); return localVarCall; } /** * * * @param searchText The input to be searched. (required) * @param transactionId transactionId. (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 listLocations(String searchText, String transactionId, 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 = listLocationsWithHttpInfo(searchText, transactionId, latitude, longitude, searchRadius, searchRadiusUnit, maxCandidates, country, matchOnAddressNumber, autoDetectLocation, ipAddress, areaName1, areaName3, postCode, returnAdminAreasOnly, includeRangesDetails, searchType, searchOnAddressNumber, searchOnUnitInfo, searchOnPOBox); return localVarResp.getData(); } /** * * * @param searchText The input to be searched. (required) * @param transactionId transactionId. (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 listLocationsWithHttpInfo(String searchText, String transactionId, 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 = listLocationsValidateBeforeCall(searchText, transactionId, 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); } /** * (asynchronously) * * @param searchText The input to be searched. (required) * @param transactionId transactionId. (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 listLocationsAsync(String searchText, String transactionId, 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 = listLocationsValidateBeforeCall(searchText, transactionId, 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; } /** * Build call for listSelect * @param selectedAddress Selected Address to be searched. (required) * @param transactionId transactionId. (required) * @param country Country ISO code. We need to make sure that either Lat/Lng or Country is provided to API (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 -
*/ public okhttp3.Call listSelectCall(String selectedAddress, String transactionId, String country, 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/list/select"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (selectedAddress != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("selectedAddress", selectedAddress)); } if (country != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("country", country)); } if (transactionId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("transactionId", transactionId)); } 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 listSelectValidateBeforeCall(String selectedAddress, String transactionId, String country, final ApiCallback _callback) throws ApiException { // verify the required parameter 'selectedAddress' is set if (selectedAddress == null) { throw new ApiException("Missing the required parameter 'selectedAddress' when calling listSelect(Async)"); } // verify the required parameter 'transactionId' is set if (transactionId == null) { throw new ApiException("Missing the required parameter 'transactionId' when calling listSelect(Async)"); } okhttp3.Call localVarCall = listSelectCall(selectedAddress, transactionId, country, _callback); return localVarCall; } /** * * * @param selectedAddress Selected Address to be searched. (required) * @param transactionId transactionId. (required) * @param country Country ISO code. We need to make sure that either Lat/Lng or Country is provided to API (optional) * @return Object * @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 -
*/ public Object listSelect(String selectedAddress, String transactionId, String country) throws ApiException { ApiResponse localVarResp = listSelectWithHttpInfo(selectedAddress, transactionId, country); return localVarResp.getData(); } /** * * * @param selectedAddress Selected Address to be searched. (required) * @param transactionId transactionId. (required) * @param country Country ISO code. We need to make sure that either Lat/Lng or Country is provided to API (optional) * @return ApiResponse<Object> * @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 -
*/ public ApiResponse listSelectWithHttpInfo(String selectedAddress, String transactionId, String country) throws ApiException { okhttp3.Call localVarCall = listSelectValidateBeforeCall(selectedAddress, transactionId, country, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * (asynchronously) * * @param selectedAddress Selected Address to be searched. (required) * @param transactionId transactionId. (required) * @param country Country ISO code. We need to make sure that either Lat/Lng or Country is provided to API (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 -
*/ public okhttp3.Call listSelectAsync(String selectedAddress, String transactionId, String country, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = listSelectValidateBeforeCall(selectedAddress, transactionId, country, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }