com.wirefreethought.geodb.client.GeoApi Maven / Gradle / Ivy
/*
* Geo DB API
* This developer-centric REST API focuses on getting global city and region data. Easily obtain country, region, and city data for use in your apps! - Filter cities by name prefix, country, location, time-zone, and even minimum population.
- Get all country regions.
- Get all cities in a given region.
- Developer-friendly RESTful API adheres to industry best-practices, including HATEOS-style links to facilitate paging results.
- Backed by Amazon AWS load-balanced infrastructure for resiliency and performance!
- Data is periodically refreshed from GeoNames.org.
Notes:
- All endpoints implicitly support JSONP-style invocation via an optional callback param.
- Since the database is periodically updated, this may very rarely result in certain cities being marked deleted (e.g., duplicates removed). By default, endpoints returning city data will exclude cities marked deleted. However, in the unlikely event that this occurs while your app is paging through a set of affected results - and you care about the paged results suddenly changing underneath - specify includeDeleted=SINCE_YESTERDAY (or SINCE_LAST_WEEK if you're really paranoid!).
Useful Resources
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.wirefreethought.geodb.client;
import com.wirefreethought.geodb.client.net.ApiCallback;
import com.wirefreethought.geodb.client.net.ApiClient;
import com.wirefreethought.geodb.client.net.ApiException;
import com.wirefreethought.geodb.client.net.ApiResponse;
import com.wirefreethought.geodb.client.net.Configuration;
import com.wirefreethought.geodb.client.net.Pair;
import com.wirefreethought.geodb.client.net.ProgressRequestBody;
import com.wirefreethought.geodb.client.net.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.wirefreethought.geodb.client.vo.CitiesResponse;
import com.wirefreethought.geodb.client.vo.CityResponse;
import com.wirefreethought.geodb.client.vo.CountriesResponse;
import com.wirefreethought.geodb.client.vo.CountryResponse;
import com.wirefreethought.geodb.client.vo.DateTimeResponse;
import com.wirefreethought.geodb.client.vo.DistanceResponse;
import com.wirefreethought.geodb.client.vo.RegionResponse;
import com.wirefreethought.geodb.client.vo.RegionsResponse;
import com.wirefreethought.geodb.client.vo.TimeResponse;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class GeoApi {
private ApiClient apiClient;
public GeoApi() {
this(Configuration.getDefaultApiClient());
}
public GeoApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Build call for findCitiesUsingGET
* @param namePrefix Only cities whose names start with this prefix (optional)
* @param countryCodes Only cities in these countries (comma-delimited country codes) (optional)
* @param excludedCountryCodes Only cities NOT in these countries (comma-delimited country codes) (optional)
* @param minPopulation Only cities having at least this population (optional)
* @param nearLocation Only cities near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (optional)
* @param nearLocationRadius The location radius within which to find cities (optional)
* @param nearLocationRadiusUnit The location radius unit of distance: MI | KM (optional, default to MI)
* @param timeZoneIds Only cities in these time-zones (optional)
* @param includeDeleted Whether to include any cities marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call findCitiesUsingGETCall(String namePrefix, String countryCodes, String excludedCountryCodes, Integer minPopulation, String nearLocation, Integer nearLocationRadius, String nearLocationRadiusUnit, String timeZoneIds, String includeDeleted, Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/geo/cities";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (namePrefix != null)
localVarQueryParams.addAll(apiClient.parameterToPair("namePrefix", namePrefix));
if (countryCodes != null)
localVarQueryParams.addAll(apiClient.parameterToPair("countryCodes", countryCodes));
if (excludedCountryCodes != null)
localVarQueryParams.addAll(apiClient.parameterToPair("excludedCountryCodes", excludedCountryCodes));
if (minPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("minPopulation", minPopulation));
if (nearLocation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("nearLocation", nearLocation));
if (nearLocationRadius != null)
localVarQueryParams.addAll(apiClient.parameterToPair("nearLocationRadius", nearLocationRadius));
if (nearLocationRadiusUnit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("nearLocationRadiusUnit", nearLocationRadiusUnit));
if (timeZoneIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("timeZoneIds", timeZoneIds));
if (includeDeleted != null)
localVarQueryParams.addAll(apiClient.parameterToPair("includeDeleted", includeDeleted));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
if (offset != null)
localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "UserSecurity" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call findCitiesUsingGETValidateBeforeCall(String namePrefix, String countryCodes, String excludedCountryCodes, Integer minPopulation, String nearLocation, Integer nearLocationRadius, String nearLocationRadiusUnit, String timeZoneIds, String includeDeleted, Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = findCitiesUsingGETCall(namePrefix, countryCodes, excludedCountryCodes, minPopulation, nearLocation, nearLocationRadius, nearLocationRadiusUnit, timeZoneIds, includeDeleted, limit, offset, progressListener, progressRequestListener);
return call;
}
/**
* Find cities
* Find cities, filtering by optional criteria. If no criteria are set, you will get back all known cities with a population of at least 1000. (Currently over 115,000.) If countryCode is specified, the country info will be omitted in the response.
* @param namePrefix Only cities whose names start with this prefix (optional)
* @param countryCodes Only cities in these countries (comma-delimited country codes) (optional)
* @param excludedCountryCodes Only cities NOT in these countries (comma-delimited country codes) (optional)
* @param minPopulation Only cities having at least this population (optional)
* @param nearLocation Only cities near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (optional)
* @param nearLocationRadius The location radius within which to find cities (optional)
* @param nearLocationRadiusUnit The location radius unit of distance: MI | KM (optional, default to MI)
* @param timeZoneIds Only cities in these time-zones (optional)
* @param includeDeleted Whether to include any cities marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @return CitiesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public CitiesResponse findCitiesUsingGET(String namePrefix, String countryCodes, String excludedCountryCodes, Integer minPopulation, String nearLocation, Integer nearLocationRadius, String nearLocationRadiusUnit, String timeZoneIds, String includeDeleted, Integer limit, Integer offset) throws ApiException {
ApiResponse resp = findCitiesUsingGETWithHttpInfo(namePrefix, countryCodes, excludedCountryCodes, minPopulation, nearLocation, nearLocationRadius, nearLocationRadiusUnit, timeZoneIds, includeDeleted, limit, offset);
return resp.getData();
}
/**
* Find cities
* Find cities, filtering by optional criteria. If no criteria are set, you will get back all known cities with a population of at least 1000. (Currently over 115,000.) If countryCode is specified, the country info will be omitted in the response.
* @param namePrefix Only cities whose names start with this prefix (optional)
* @param countryCodes Only cities in these countries (comma-delimited country codes) (optional)
* @param excludedCountryCodes Only cities NOT in these countries (comma-delimited country codes) (optional)
* @param minPopulation Only cities having at least this population (optional)
* @param nearLocation Only cities near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (optional)
* @param nearLocationRadius The location radius within which to find cities (optional)
* @param nearLocationRadiusUnit The location radius unit of distance: MI | KM (optional, default to MI)
* @param timeZoneIds Only cities in these time-zones (optional)
* @param includeDeleted Whether to include any cities marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @return ApiResponse<CitiesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse findCitiesUsingGETWithHttpInfo(String namePrefix, String countryCodes, String excludedCountryCodes, Integer minPopulation, String nearLocation, Integer nearLocationRadius, String nearLocationRadiusUnit, String timeZoneIds, String includeDeleted, Integer limit, Integer offset) throws ApiException {
com.squareup.okhttp.Call call = findCitiesUsingGETValidateBeforeCall(namePrefix, countryCodes, excludedCountryCodes, minPopulation, nearLocation, nearLocationRadius, nearLocationRadiusUnit, timeZoneIds, includeDeleted, limit, offset, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Find cities (asynchronously)
* Find cities, filtering by optional criteria. If no criteria are set, you will get back all known cities with a population of at least 1000. (Currently over 115,000.) If countryCode is specified, the country info will be omitted in the response.
* @param namePrefix Only cities whose names start with this prefix (optional)
* @param countryCodes Only cities in these countries (comma-delimited country codes) (optional)
* @param excludedCountryCodes Only cities NOT in these countries (comma-delimited country codes) (optional)
* @param minPopulation Only cities having at least this population (optional)
* @param nearLocation Only cities near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (optional)
* @param nearLocationRadius The location radius within which to find cities (optional)
* @param nearLocationRadiusUnit The location radius unit of distance: MI | KM (optional, default to MI)
* @param timeZoneIds Only cities in these time-zones (optional)
* @param includeDeleted Whether to include any cities marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @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
*/
public com.squareup.okhttp.Call findCitiesUsingGETAsync(String namePrefix, String countryCodes, String excludedCountryCodes, Integer minPopulation, String nearLocation, Integer nearLocationRadius, String nearLocationRadiusUnit, String timeZoneIds, String includeDeleted, Integer limit, Integer offset, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = findCitiesUsingGETValidateBeforeCall(namePrefix, countryCodes, excludedCountryCodes, minPopulation, nearLocation, nearLocationRadius, nearLocationRadiusUnit, timeZoneIds, includeDeleted, limit, offset, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for findNearbyCitiesUsingGET
* @param cityId cityId (required)
* @param minPopulation Only cities having at least this population (optional)
* @param nearLocationRadius The location radius within which to find cities (optional)
* @param nearLocationRadiusUnit The location radius unit of distance: MI | KM (optional, default to MI)
* @param includeDeleted Whether to include any cities marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call findNearbyCitiesUsingGETCall(Integer cityId, Integer minPopulation, Integer nearLocationRadius, String nearLocationRadiusUnit, String includeDeleted, Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/geo/cities/{cityId}/nearbyCities"
.replaceAll("\\{" + "cityId" + "\\}", apiClient.escapeString(cityId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (minPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("minPopulation", minPopulation));
if (nearLocationRadius != null)
localVarQueryParams.addAll(apiClient.parameterToPair("nearLocationRadius", nearLocationRadius));
if (nearLocationRadiusUnit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("nearLocationRadiusUnit", nearLocationRadiusUnit));
if (includeDeleted != null)
localVarQueryParams.addAll(apiClient.parameterToPair("includeDeleted", includeDeleted));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
if (offset != null)
localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "UserSecurity" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call findNearbyCitiesUsingGETValidateBeforeCall(Integer cityId, Integer minPopulation, Integer nearLocationRadius, String nearLocationRadiusUnit, String includeDeleted, Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'cityId' is set
if (cityId == null) {
throw new ApiException("Missing the required parameter 'cityId' when calling findNearbyCitiesUsingGET(Async)");
}
com.squareup.okhttp.Call call = findNearbyCitiesUsingGETCall(cityId, minPopulation, nearLocationRadius, nearLocationRadiusUnit, includeDeleted, limit, offset, progressListener, progressRequestListener);
return call;
}
/**
* Find cities near the given city, filtering by optional criteria.
* Get nearby cities
* @param cityId cityId (required)
* @param minPopulation Only cities having at least this population (optional)
* @param nearLocationRadius The location radius within which to find cities (optional)
* @param nearLocationRadiusUnit The location radius unit of distance: MI | KM (optional, default to MI)
* @param includeDeleted Whether to include any cities marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @return CitiesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public CitiesResponse findNearbyCitiesUsingGET(Integer cityId, Integer minPopulation, Integer nearLocationRadius, String nearLocationRadiusUnit, String includeDeleted, Integer limit, Integer offset) throws ApiException {
ApiResponse resp = findNearbyCitiesUsingGETWithHttpInfo(cityId, minPopulation, nearLocationRadius, nearLocationRadiusUnit, includeDeleted, limit, offset);
return resp.getData();
}
/**
* Find cities near the given city, filtering by optional criteria.
* Get nearby cities
* @param cityId cityId (required)
* @param minPopulation Only cities having at least this population (optional)
* @param nearLocationRadius The location radius within which to find cities (optional)
* @param nearLocationRadiusUnit The location radius unit of distance: MI | KM (optional, default to MI)
* @param includeDeleted Whether to include any cities marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @return ApiResponse<CitiesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse findNearbyCitiesUsingGETWithHttpInfo(Integer cityId, Integer minPopulation, Integer nearLocationRadius, String nearLocationRadiusUnit, String includeDeleted, Integer limit, Integer offset) throws ApiException {
com.squareup.okhttp.Call call = findNearbyCitiesUsingGETValidateBeforeCall(cityId, minPopulation, nearLocationRadius, nearLocationRadiusUnit, includeDeleted, limit, offset, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Find cities near the given city, filtering by optional criteria. (asynchronously)
* Get nearby cities
* @param cityId cityId (required)
* @param minPopulation Only cities having at least this population (optional)
* @param nearLocationRadius The location radius within which to find cities (optional)
* @param nearLocationRadiusUnit The location radius unit of distance: MI | KM (optional, default to MI)
* @param includeDeleted Whether to include any cities marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @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
*/
public com.squareup.okhttp.Call findNearbyCitiesUsingGETAsync(Integer cityId, Integer minPopulation, Integer nearLocationRadius, String nearLocationRadiusUnit, String includeDeleted, Integer limit, Integer offset, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = findNearbyCitiesUsingGETValidateBeforeCall(cityId, minPopulation, nearLocationRadius, nearLocationRadiusUnit, includeDeleted, limit, offset, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for findRegionCitiesUsingGET
* @param countryCode An ISO-3166 country code (required)
* @param regionCode An HASC, ISO-3166, or FIPS region code (required)
* @param minPopulation Only cities having at least this population (optional)
* @param includeDeleted Whether to include any cities marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call findRegionCitiesUsingGETCall(String countryCode, String regionCode, Integer minPopulation, String includeDeleted, Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/geo/countries/{countryCode}/regions/{regionCode}/cities"
.replaceAll("\\{" + "countryCode" + "\\}", apiClient.escapeString(countryCode.toString()))
.replaceAll("\\{" + "regionCode" + "\\}", apiClient.escapeString(regionCode.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (minPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("minPopulation", minPopulation));
if (includeDeleted != null)
localVarQueryParams.addAll(apiClient.parameterToPair("includeDeleted", includeDeleted));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
if (offset != null)
localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "UserSecurity" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call findRegionCitiesUsingGETValidateBeforeCall(String countryCode, String regionCode, Integer minPopulation, String includeDeleted, Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'countryCode' is set
if (countryCode == null) {
throw new ApiException("Missing the required parameter 'countryCode' when calling findRegionCitiesUsingGET(Async)");
}
// verify the required parameter 'regionCode' is set
if (regionCode == null) {
throw new ApiException("Missing the required parameter 'regionCode' when calling findRegionCitiesUsingGET(Async)");
}
com.squareup.okhttp.Call call = findRegionCitiesUsingGETCall(countryCode, regionCode, minPopulation, includeDeleted, limit, offset, progressListener, progressRequestListener);
return call;
}
/**
* Find country region cities
* Get the cities in a specific country region. The country and region info is omitted in the response.
* @param countryCode An ISO-3166 country code (required)
* @param regionCode An HASC, ISO-3166, or FIPS region code (required)
* @param minPopulation Only cities having at least this population (optional)
* @param includeDeleted Whether to include any cities marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @return CitiesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public CitiesResponse findRegionCitiesUsingGET(String countryCode, String regionCode, Integer minPopulation, String includeDeleted, Integer limit, Integer offset) throws ApiException {
ApiResponse resp = findRegionCitiesUsingGETWithHttpInfo(countryCode, regionCode, minPopulation, includeDeleted, limit, offset);
return resp.getData();
}
/**
* Find country region cities
* Get the cities in a specific country region. The country and region info is omitted in the response.
* @param countryCode An ISO-3166 country code (required)
* @param regionCode An HASC, ISO-3166, or FIPS region code (required)
* @param minPopulation Only cities having at least this population (optional)
* @param includeDeleted Whether to include any cities marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @return ApiResponse<CitiesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse findRegionCitiesUsingGETWithHttpInfo(String countryCode, String regionCode, Integer minPopulation, String includeDeleted, Integer limit, Integer offset) throws ApiException {
com.squareup.okhttp.Call call = findRegionCitiesUsingGETValidateBeforeCall(countryCode, regionCode, minPopulation, includeDeleted, limit, offset, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Find country region cities (asynchronously)
* Get the cities in a specific country region. The country and region info is omitted in the response.
* @param countryCode An ISO-3166 country code (required)
* @param regionCode An HASC, ISO-3166, or FIPS region code (required)
* @param minPopulation Only cities having at least this population (optional)
* @param includeDeleted Whether to include any cities marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @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
*/
public com.squareup.okhttp.Call findRegionCitiesUsingGETAsync(String countryCode, String regionCode, Integer minPopulation, String includeDeleted, Integer limit, Integer offset, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = findRegionCitiesUsingGETValidateBeforeCall(countryCode, regionCode, minPopulation, includeDeleted, limit, offset, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getCityDateTimeUsingGET
* @param cityId cityId (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call getCityDateTimeUsingGETCall(Integer cityId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/geo/cities/{cityId}/dateTime"
.replaceAll("\\{" + "cityId" + "\\}", apiClient.escapeString(cityId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "UserSecurity" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call getCityDateTimeUsingGETValidateBeforeCall(Integer cityId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'cityId' is set
if (cityId == null) {
throw new ApiException("Missing the required parameter 'cityId' when calling getCityDateTimeUsingGET(Async)");
}
com.squareup.okhttp.Call call = getCityDateTimeUsingGETCall(cityId, progressListener, progressRequestListener);
return call;
}
/**
* Get city date-time
* Get city date-time
* @param cityId cityId (required)
* @return DateTimeResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public DateTimeResponse getCityDateTimeUsingGET(Integer cityId) throws ApiException {
ApiResponse resp = getCityDateTimeUsingGETWithHttpInfo(cityId);
return resp.getData();
}
/**
* Get city date-time
* Get city date-time
* @param cityId cityId (required)
* @return ApiResponse<DateTimeResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse getCityDateTimeUsingGETWithHttpInfo(Integer cityId) throws ApiException {
com.squareup.okhttp.Call call = getCityDateTimeUsingGETValidateBeforeCall(cityId, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get city date-time (asynchronously)
* Get city date-time
* @param cityId cityId (required)
* @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
*/
public com.squareup.okhttp.Call getCityDateTimeUsingGETAsync(Integer cityId, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = getCityDateTimeUsingGETValidateBeforeCall(cityId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getCityDistanceUsingGET
* @param cityId cityId (required)
* @param fromCityId Distance from this city (required)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call getCityDistanceUsingGETCall(Integer cityId, Integer fromCityId, String distanceUnit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/geo/cities/{cityId}/distance"
.replaceAll("\\{" + "cityId" + "\\}", apiClient.escapeString(cityId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (fromCityId != null)
localVarQueryParams.addAll(apiClient.parameterToPair("fromCityId", fromCityId));
if (distanceUnit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("distanceUnit", distanceUnit));
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "UserSecurity" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call getCityDistanceUsingGETValidateBeforeCall(Integer cityId, Integer fromCityId, String distanceUnit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'cityId' is set
if (cityId == null) {
throw new ApiException("Missing the required parameter 'cityId' when calling getCityDistanceUsingGET(Async)");
}
// verify the required parameter 'fromCityId' is set
if (fromCityId == null) {
throw new ApiException("Missing the required parameter 'fromCityId' when calling getCityDistanceUsingGET(Async)");
}
com.squareup.okhttp.Call call = getCityDistanceUsingGETCall(cityId, fromCityId, distanceUnit, progressListener, progressRequestListener);
return call;
}
/**
* Get city distance
* Get distance to the given city
* @param cityId cityId (required)
* @param fromCityId Distance from this city (required)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @return DistanceResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public DistanceResponse getCityDistanceUsingGET(Integer cityId, Integer fromCityId, String distanceUnit) throws ApiException {
ApiResponse resp = getCityDistanceUsingGETWithHttpInfo(cityId, fromCityId, distanceUnit);
return resp.getData();
}
/**
* Get city distance
* Get distance to the given city
* @param cityId cityId (required)
* @param fromCityId Distance from this city (required)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @return ApiResponse<DistanceResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse getCityDistanceUsingGETWithHttpInfo(Integer cityId, Integer fromCityId, String distanceUnit) throws ApiException {
com.squareup.okhttp.Call call = getCityDistanceUsingGETValidateBeforeCall(cityId, fromCityId, distanceUnit, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get city distance (asynchronously)
* Get distance to the given city
* @param cityId cityId (required)
* @param fromCityId Distance from this city (required)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @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
*/
public com.squareup.okhttp.Call getCityDistanceUsingGETAsync(Integer cityId, Integer fromCityId, String distanceUnit, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = getCityDistanceUsingGETValidateBeforeCall(cityId, fromCityId, distanceUnit, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getCityTimeUsingGET
* @param cityId cityId (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call getCityTimeUsingGETCall(Integer cityId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/geo/cities/{cityId}/time"
.replaceAll("\\{" + "cityId" + "\\}", apiClient.escapeString(cityId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "UserSecurity" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call getCityTimeUsingGETValidateBeforeCall(Integer cityId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'cityId' is set
if (cityId == null) {
throw new ApiException("Missing the required parameter 'cityId' when calling getCityTimeUsingGET(Async)");
}
com.squareup.okhttp.Call call = getCityTimeUsingGETCall(cityId, progressListener, progressRequestListener);
return call;
}
/**
* Get city time
* Get city time
* @param cityId cityId (required)
* @return TimeResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public TimeResponse getCityTimeUsingGET(Integer cityId) throws ApiException {
ApiResponse resp = getCityTimeUsingGETWithHttpInfo(cityId);
return resp.getData();
}
/**
* Get city time
* Get city time
* @param cityId cityId (required)
* @return ApiResponse<TimeResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse getCityTimeUsingGETWithHttpInfo(Integer cityId) throws ApiException {
com.squareup.okhttp.Call call = getCityTimeUsingGETValidateBeforeCall(cityId, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get city time (asynchronously)
* Get city time
* @param cityId cityId (required)
* @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
*/
public com.squareup.okhttp.Call getCityTimeUsingGETAsync(Integer cityId, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = getCityTimeUsingGETValidateBeforeCall(cityId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getCityUsingGET
* @param cityId The city id (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call getCityUsingGETCall(Integer cityId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/geo/cities/{cityId}"
.replaceAll("\\{" + "cityId" + "\\}", apiClient.escapeString(cityId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "UserSecurity" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call getCityUsingGETValidateBeforeCall(Integer cityId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'cityId' is set
if (cityId == null) {
throw new ApiException("Missing the required parameter 'cityId' when calling getCityUsingGET(Async)");
}
com.squareup.okhttp.Call call = getCityUsingGETCall(cityId, progressListener, progressRequestListener);
return call;
}
/**
* Get city details
* Get the details for a specific city, including location coordinates, population, and elevation above sea-level (if available).
* @param cityId The city id (required)
* @return CityResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public CityResponse getCityUsingGET(Integer cityId) throws ApiException {
ApiResponse resp = getCityUsingGETWithHttpInfo(cityId);
return resp.getData();
}
/**
* Get city details
* Get the details for a specific city, including location coordinates, population, and elevation above sea-level (if available).
* @param cityId The city id (required)
* @return ApiResponse<CityResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse getCityUsingGETWithHttpInfo(Integer cityId) throws ApiException {
com.squareup.okhttp.Call call = getCityUsingGETValidateBeforeCall(cityId, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get city details (asynchronously)
* Get the details for a specific city, including location coordinates, population, and elevation above sea-level (if available).
* @param cityId The city id (required)
* @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
*/
public com.squareup.okhttp.Call getCityUsingGETAsync(Integer cityId, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = getCityUsingGETValidateBeforeCall(cityId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getCountriesUsingGET
* @param namePrefix Only countries whose names start with this prefix (optional)
* @param currencyCode Only countries supporting this currency (optional)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call getCountriesUsingGETCall(String namePrefix, String currencyCode, Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/geo/countries";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (namePrefix != null)
localVarQueryParams.addAll(apiClient.parameterToPair("namePrefix", namePrefix));
if (currencyCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("currencyCode", currencyCode));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
if (offset != null)
localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "UserSecurity" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call getCountriesUsingGETValidateBeforeCall(String namePrefix, String currencyCode, Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = getCountriesUsingGETCall(namePrefix, currencyCode, limit, offset, progressListener, progressRequestListener);
return call;
}
/**
* Find countries
* Find countries, filtering by optional criteria. If no criteria are set, you will get back all known countries.
* @param namePrefix Only countries whose names start with this prefix (optional)
* @param currencyCode Only countries supporting this currency (optional)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @return CountriesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public CountriesResponse getCountriesUsingGET(String namePrefix, String currencyCode, Integer limit, Integer offset) throws ApiException {
ApiResponse resp = getCountriesUsingGETWithHttpInfo(namePrefix, currencyCode, limit, offset);
return resp.getData();
}
/**
* Find countries
* Find countries, filtering by optional criteria. If no criteria are set, you will get back all known countries.
* @param namePrefix Only countries whose names start with this prefix (optional)
* @param currencyCode Only countries supporting this currency (optional)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @return ApiResponse<CountriesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse getCountriesUsingGETWithHttpInfo(String namePrefix, String currencyCode, Integer limit, Integer offset) throws ApiException {
com.squareup.okhttp.Call call = getCountriesUsingGETValidateBeforeCall(namePrefix, currencyCode, limit, offset, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Find countries (asynchronously)
* Find countries, filtering by optional criteria. If no criteria are set, you will get back all known countries.
* @param namePrefix Only countries whose names start with this prefix (optional)
* @param currencyCode Only countries supporting this currency (optional)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @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
*/
public com.squareup.okhttp.Call getCountriesUsingGETAsync(String namePrefix, String currencyCode, Integer limit, Integer offset, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = getCountriesUsingGETValidateBeforeCall(namePrefix, currencyCode, limit, offset, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getCountryUsingGET
* @param countryCode An ISO-3166 country code (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call getCountryUsingGETCall(String countryCode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/geo/countries/{countryCode}"
.replaceAll("\\{" + "countryCode" + "\\}", apiClient.escapeString(countryCode.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "UserSecurity" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call getCountryUsingGETValidateBeforeCall(String countryCode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'countryCode' is set
if (countryCode == null) {
throw new ApiException("Missing the required parameter 'countryCode' when calling getCountryUsingGET(Async)");
}
com.squareup.okhttp.Call call = getCountryUsingGETCall(countryCode, progressListener, progressRequestListener);
return call;
}
/**
* Get country details
* Get the details for a specific country, including number of regions.
* @param countryCode An ISO-3166 country code (required)
* @return CountryResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public CountryResponse getCountryUsingGET(String countryCode) throws ApiException {
ApiResponse resp = getCountryUsingGETWithHttpInfo(countryCode);
return resp.getData();
}
/**
* Get country details
* Get the details for a specific country, including number of regions.
* @param countryCode An ISO-3166 country code (required)
* @return ApiResponse<CountryResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse getCountryUsingGETWithHttpInfo(String countryCode) throws ApiException {
com.squareup.okhttp.Call call = getCountryUsingGETValidateBeforeCall(countryCode, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get country details (asynchronously)
* Get the details for a specific country, including number of regions.
* @param countryCode An ISO-3166 country code (required)
* @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
*/
public com.squareup.okhttp.Call getCountryUsingGETAsync(String countryCode, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = getCountryUsingGETValidateBeforeCall(countryCode, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getRegionUsingGET
* @param countryCode An ISO-3166 country code (required)
* @param regionCode An HASC, ISO-3166, or FIPS region code (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call getRegionUsingGETCall(String countryCode, String regionCode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/geo/countries/{countryCode}/regions/{regionCode}"
.replaceAll("\\{" + "countryCode" + "\\}", apiClient.escapeString(countryCode.toString()))
.replaceAll("\\{" + "regionCode" + "\\}", apiClient.escapeString(regionCode.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "UserSecurity" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call getRegionUsingGETValidateBeforeCall(String countryCode, String regionCode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'countryCode' is set
if (countryCode == null) {
throw new ApiException("Missing the required parameter 'countryCode' when calling getRegionUsingGET(Async)");
}
// verify the required parameter 'regionCode' is set
if (regionCode == null) {
throw new ApiException("Missing the required parameter 'regionCode' when calling getRegionUsingGET(Async)");
}
com.squareup.okhttp.Call call = getRegionUsingGETCall(countryCode, regionCode, progressListener, progressRequestListener);
return call;
}
/**
* Get region details
* Get the details of a specific country region, including number of cities.
* @param countryCode An ISO-3166 country code (required)
* @param regionCode An HASC, ISO-3166, or FIPS region code (required)
* @return RegionResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public RegionResponse getRegionUsingGET(String countryCode, String regionCode) throws ApiException {
ApiResponse resp = getRegionUsingGETWithHttpInfo(countryCode, regionCode);
return resp.getData();
}
/**
* Get region details
* Get the details of a specific country region, including number of cities.
* @param countryCode An ISO-3166 country code (required)
* @param regionCode An HASC, ISO-3166, or FIPS region code (required)
* @return ApiResponse<RegionResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse getRegionUsingGETWithHttpInfo(String countryCode, String regionCode) throws ApiException {
com.squareup.okhttp.Call call = getRegionUsingGETValidateBeforeCall(countryCode, regionCode, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get region details (asynchronously)
* Get the details of a specific country region, including number of cities.
* @param countryCode An ISO-3166 country code (required)
* @param regionCode An HASC, ISO-3166, or FIPS region code (required)
* @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
*/
public com.squareup.okhttp.Call getRegionUsingGETAsync(String countryCode, String regionCode, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = getRegionUsingGETValidateBeforeCall(countryCode, regionCode, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getRegionsUsingGET
* @param countryCode An ISO-3166 country code (required)
* @param namePrefix Only regions whose names start with this prefix (optional)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call getRegionsUsingGETCall(String countryCode, String namePrefix, Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/geo/countries/{countryCode}/regions"
.replaceAll("\\{" + "countryCode" + "\\}", apiClient.escapeString(countryCode.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (namePrefix != null)
localVarQueryParams.addAll(apiClient.parameterToPair("namePrefix", namePrefix));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
if (offset != null)
localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "UserSecurity" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call getRegionsUsingGETValidateBeforeCall(String countryCode, String namePrefix, Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'countryCode' is set
if (countryCode == null) {
throw new ApiException("Missing the required parameter 'countryCode' when calling getRegionsUsingGET(Async)");
}
com.squareup.okhttp.Call call = getRegionsUsingGETCall(countryCode, namePrefix, limit, offset, progressListener, progressRequestListener);
return call;
}
/**
* Find country regions
* Get all regions in a specific country. These could be states, provinces, districts, or otherwise major political divisions.
* @param countryCode An ISO-3166 country code (required)
* @param namePrefix Only regions whose names start with this prefix (optional)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @return RegionsResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public RegionsResponse getRegionsUsingGET(String countryCode, String namePrefix, Integer limit, Integer offset) throws ApiException {
ApiResponse resp = getRegionsUsingGETWithHttpInfo(countryCode, namePrefix, limit, offset);
return resp.getData();
}
/**
* Find country regions
* Get all regions in a specific country. These could be states, provinces, districts, or otherwise major political divisions.
* @param countryCode An ISO-3166 country code (required)
* @param namePrefix Only regions whose names start with this prefix (optional)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @return ApiResponse<RegionsResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse getRegionsUsingGETWithHttpInfo(String countryCode, String namePrefix, Integer limit, Integer offset) throws ApiException {
com.squareup.okhttp.Call call = getRegionsUsingGETValidateBeforeCall(countryCode, namePrefix, limit, offset, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Find country regions (asynchronously)
* Get all regions in a specific country. These could be states, provinces, districts, or otherwise major political divisions.
* @param countryCode An ISO-3166 country code (required)
* @param namePrefix Only regions whose names start with this prefix (optional)
* @param limit The maximum number of results to retrieve (optional, default to 10)
* @param offset The zero-ary offset index into the results (optional, default to 0)
* @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
*/
public com.squareup.okhttp.Call getRegionsUsingGETAsync(String countryCode, String namePrefix, Integer limit, Integer offset, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = getRegionsUsingGETValidateBeforeCall(countryCode, namePrefix, limit, offset, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
}