com.wirefreethought.geodb.client.GeoApi Maven / Gradle / Ivy
/*
* GeoDB Cities API
* The GeoDB 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.
- Sort cities by name, country code, elevation, and population - or any combination of these.
- Get all country regions.
- Get all cities in a given region.
- Display results in multiple languages.
- RESTful API adheres to industry best-practices, including HATEOAS-style links to facilitate paging results.
- Backed by cloud-based load-balanced infrastructure for resiliency and performance!
- Data is periodically refreshed from GeoNames and WikiData.
Notes:
- 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.model.BadRequestResponse;
import com.wirefreethought.geodb.client.model.CountriesResponse;
import com.wirefreethought.geodb.client.model.CountryResponse;
import com.wirefreethought.geodb.client.model.DateTimeResponse;
import com.wirefreethought.geodb.client.model.DistanceResponse;
import com.wirefreethought.geodb.client.model.ForbiddenResponse;
import com.wirefreethought.geodb.client.model.NotFoundResponse;
import com.wirefreethought.geodb.client.model.PopulatedPlaceResponse;
import com.wirefreethought.geodb.client.model.PopulatedPlacesResponse;
import com.wirefreethought.geodb.client.model.RegionResponse;
import com.wirefreethought.geodb.client.model.RegionsResponse;
import com.wirefreethought.geodb.client.model.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 findAdminDivisionsUsingGET
* @param location Only places near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (optional)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 findAdminDivisionsUsingGETCall(String location, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/adminDivisions";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (location != null)
localVarQueryParams.addAll(apiClient.parameterToPair("location", location));
if (radius != null)
localVarQueryParams.addAll(apiClient.parameterToPair("radius", radius));
if (distanceUnit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("distanceUnit", distanceUnit));
if (countryIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("countryIds", countryIds));
if (excludedCountryIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("excludedCountryIds", excludedCountryIds));
if (minPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("minPopulation", minPopulation));
if (maxPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("maxPopulation", maxPopulation));
if (namePrefix != null)
localVarQueryParams.addAll(apiClient.parameterToPair("namePrefix", namePrefix));
if (timeZoneIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("timeZoneIds", timeZoneIds));
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (hateoasMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("hateoasMode", hateoasMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
if (offset != null)
localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
if (sort != null)
localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort));
if (includeDeleted != null)
localVarQueryParams.addAll(apiClient.parameterToPair("includeDeleted", includeDeleted));
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 findAdminDivisionsUsingGETValidateBeforeCall(String location, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = findAdminDivisionsUsingGETCall(location, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
return call;
}
/**
* Find administrative divisions
* Find administrative divisions, filtering by optional criteria. If no criteria are set, you will get back all known divisions.
* @param location Only places near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (optional)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return PopulatedPlacesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public PopulatedPlacesResponse findAdminDivisionsUsingGET(String location, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
ApiResponse resp = findAdminDivisionsUsingGETWithHttpInfo(location, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted);
return resp.getData();
}
/**
* Find administrative divisions
* Find administrative divisions, filtering by optional criteria. If no criteria are set, you will get back all known divisions.
* @param location Only places near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (optional)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return ApiResponse<PopulatedPlacesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse findAdminDivisionsUsingGETWithHttpInfo(String location, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
com.squareup.okhttp.Call call = findAdminDivisionsUsingGETValidateBeforeCall(location, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Find administrative divisions (asynchronously)
* Find administrative divisions, filtering by optional criteria. If no criteria are set, you will get back all known divisions.
* @param location Only places near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (optional)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 findAdminDivisionsUsingGETAsync(String location, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, 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 = findAdminDivisionsUsingGETValidateBeforeCall(location, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for findCitiesNearAdminDivisionUsingGET
* @param divisionId An admin-division id (either native 'id' or 'wikiDataId') (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 findCitiesNearAdminDivisionUsingGETCall(String divisionId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/adminDivisions/{divisionId}/nearbyCities"
.replaceAll("\\{" + "divisionId" + "\\}", apiClient.escapeString(divisionId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (radius != null)
localVarQueryParams.addAll(apiClient.parameterToPair("radius", radius));
if (distanceUnit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("distanceUnit", distanceUnit));
if (countryIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("countryIds", countryIds));
if (excludedCountryIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("excludedCountryIds", excludedCountryIds));
if (minPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("minPopulation", minPopulation));
if (maxPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("maxPopulation", maxPopulation));
if (namePrefix != null)
localVarQueryParams.addAll(apiClient.parameterToPair("namePrefix", namePrefix));
if (timeZoneIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("timeZoneIds", timeZoneIds));
if (types != null)
localVarQueryParams.addAll(apiClient.parameterToPair("types", types));
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (hateoasMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("hateoasMode", hateoasMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
if (offset != null)
localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
if (sort != null)
localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort));
if (includeDeleted != null)
localVarQueryParams.addAll(apiClient.parameterToPair("includeDeleted", includeDeleted));
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 findCitiesNearAdminDivisionUsingGETValidateBeforeCall(String divisionId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'divisionId' is set
if (divisionId == null) {
throw new ApiException("Missing the required parameter 'divisionId' when calling findCitiesNearAdminDivisionUsingGET(Async)");
}
com.squareup.okhttp.Call call = findCitiesNearAdminDivisionUsingGETCall(divisionId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
return call;
}
/**
* Find cities near division
* Find cities near the given administrative division, filtering by optional criteria. If no criteria are set, you will get back all known cities.
* @param divisionId An admin-division id (either native 'id' or 'wikiDataId') (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return PopulatedPlacesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public PopulatedPlacesResponse findCitiesNearAdminDivisionUsingGET(String divisionId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
ApiResponse resp = findCitiesNearAdminDivisionUsingGETWithHttpInfo(divisionId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted);
return resp.getData();
}
/**
* Find cities near division
* Find cities near the given administrative division, filtering by optional criteria. If no criteria are set, you will get back all known cities.
* @param divisionId An admin-division id (either native 'id' or 'wikiDataId') (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return ApiResponse<PopulatedPlacesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse findCitiesNearAdminDivisionUsingGETWithHttpInfo(String divisionId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
com.squareup.okhttp.Call call = findCitiesNearAdminDivisionUsingGETValidateBeforeCall(divisionId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Find cities near division (asynchronously)
* Find cities near the given administrative division, filtering by optional criteria. If no criteria are set, you will get back all known cities.
* @param divisionId An admin-division id (either native 'id' or 'wikiDataId') (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 findCitiesNearAdminDivisionUsingGETAsync(String divisionId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, 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 = findCitiesNearAdminDivisionUsingGETValidateBeforeCall(divisionId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for findCitiesNearCityUsingGET
* @param cityId A city id (either native 'id' or 'wikiDataId') (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 findCitiesNearCityUsingGETCall(String cityId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/cities/{cityId}/nearbyCities"
.replaceAll("\\{" + "cityId" + "\\}", apiClient.escapeString(cityId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (radius != null)
localVarQueryParams.addAll(apiClient.parameterToPair("radius", radius));
if (distanceUnit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("distanceUnit", distanceUnit));
if (countryIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("countryIds", countryIds));
if (excludedCountryIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("excludedCountryIds", excludedCountryIds));
if (minPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("minPopulation", minPopulation));
if (maxPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("maxPopulation", maxPopulation));
if (namePrefix != null)
localVarQueryParams.addAll(apiClient.parameterToPair("namePrefix", namePrefix));
if (timeZoneIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("timeZoneIds", timeZoneIds));
if (types != null)
localVarQueryParams.addAll(apiClient.parameterToPair("types", types));
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (hateoasMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("hateoasMode", hateoasMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
if (offset != null)
localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
if (sort != null)
localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort));
if (includeDeleted != null)
localVarQueryParams.addAll(apiClient.parameterToPair("includeDeleted", includeDeleted));
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 findCitiesNearCityUsingGETValidateBeforeCall(String cityId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, 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 findCitiesNearCityUsingGET(Async)");
}
com.squareup.okhttp.Call call = findCitiesNearCityUsingGETCall(cityId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
return call;
}
/**
* Find cities near city
* Find cities near the given origin city, filtering by optional criteria. If no criteria are set, you will get back all known cities.
* @param cityId A city id (either native 'id' or 'wikiDataId') (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return PopulatedPlacesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public PopulatedPlacesResponse findCitiesNearCityUsingGET(String cityId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
ApiResponse resp = findCitiesNearCityUsingGETWithHttpInfo(cityId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted);
return resp.getData();
}
/**
* Find cities near city
* Find cities near the given origin city, filtering by optional criteria. If no criteria are set, you will get back all known cities.
* @param cityId A city id (either native 'id' or 'wikiDataId') (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return ApiResponse<PopulatedPlacesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse findCitiesNearCityUsingGETWithHttpInfo(String cityId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
com.squareup.okhttp.Call call = findCitiesNearCityUsingGETValidateBeforeCall(cityId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Find cities near city (asynchronously)
* Find cities near the given origin city, filtering by optional criteria. If no criteria are set, you will get back all known cities.
* @param cityId A city id (either native 'id' or 'wikiDataId') (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 findCitiesNearCityUsingGETAsync(String cityId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, 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 = findCitiesNearCityUsingGETValidateBeforeCall(cityId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for findCitiesNearLocationUsingGET
* @param locationId A latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 findCitiesNearLocationUsingGETCall(String locationId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/locations/{locationId}/nearbyCities"
.replaceAll("\\{" + "locationId" + "\\}", apiClient.escapeString(locationId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (radius != null)
localVarQueryParams.addAll(apiClient.parameterToPair("radius", radius));
if (distanceUnit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("distanceUnit", distanceUnit));
if (countryIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("countryIds", countryIds));
if (excludedCountryIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("excludedCountryIds", excludedCountryIds));
if (minPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("minPopulation", minPopulation));
if (maxPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("maxPopulation", maxPopulation));
if (namePrefix != null)
localVarQueryParams.addAll(apiClient.parameterToPair("namePrefix", namePrefix));
if (timeZoneIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("timeZoneIds", timeZoneIds));
if (types != null)
localVarQueryParams.addAll(apiClient.parameterToPair("types", types));
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (hateoasMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("hateoasMode", hateoasMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
if (offset != null)
localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
if (sort != null)
localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort));
if (includeDeleted != null)
localVarQueryParams.addAll(apiClient.parameterToPair("includeDeleted", includeDeleted));
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 findCitiesNearLocationUsingGETValidateBeforeCall(String locationId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'locationId' is set
if (locationId == null) {
throw new ApiException("Missing the required parameter 'locationId' when calling findCitiesNearLocationUsingGET(Async)");
}
com.squareup.okhttp.Call call = findCitiesNearLocationUsingGETCall(locationId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
return call;
}
/**
* Find cities near location
* Find cities near the given location, filtering by optional criteria. If no criteria are set, you will get back all known cities.
* @param locationId A latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return PopulatedPlacesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public PopulatedPlacesResponse findCitiesNearLocationUsingGET(String locationId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
ApiResponse resp = findCitiesNearLocationUsingGETWithHttpInfo(locationId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted);
return resp.getData();
}
/**
* Find cities near location
* Find cities near the given location, filtering by optional criteria. If no criteria are set, you will get back all known cities.
* @param locationId A latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return ApiResponse<PopulatedPlacesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse findCitiesNearLocationUsingGETWithHttpInfo(String locationId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
com.squareup.okhttp.Call call = findCitiesNearLocationUsingGETValidateBeforeCall(locationId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Find cities near location (asynchronously)
* Find cities near the given location, filtering by optional criteria. If no criteria are set, you will get back all known cities.
* @param locationId A latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 findCitiesNearLocationUsingGETAsync(String locationId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, 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 = findCitiesNearLocationUsingGETValidateBeforeCall(locationId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for findCitiesUsingGET
* @param location Only places near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (optional)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 location, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/cities";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (location != null)
localVarQueryParams.addAll(apiClient.parameterToPair("location", location));
if (radius != null)
localVarQueryParams.addAll(apiClient.parameterToPair("radius", radius));
if (distanceUnit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("distanceUnit", distanceUnit));
if (countryIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("countryIds", countryIds));
if (excludedCountryIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("excludedCountryIds", excludedCountryIds));
if (minPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("minPopulation", minPopulation));
if (maxPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("maxPopulation", maxPopulation));
if (namePrefix != null)
localVarQueryParams.addAll(apiClient.parameterToPair("namePrefix", namePrefix));
if (timeZoneIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("timeZoneIds", timeZoneIds));
if (types != null)
localVarQueryParams.addAll(apiClient.parameterToPair("types", types));
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (hateoasMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("hateoasMode", hateoasMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
if (offset != null)
localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
if (sort != null)
localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort));
if (includeDeleted != null)
localVarQueryParams.addAll(apiClient.parameterToPair("includeDeleted", includeDeleted));
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 location, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = findCitiesUsingGETCall(location, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
return call;
}
/**
* Find cities
* Find cities, filtering by optional criteria. If no criteria are set, you will get back all known cities.
* @param location Only places near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (optional)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return PopulatedPlacesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public PopulatedPlacesResponse findCitiesUsingGET(String location, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
ApiResponse resp = findCitiesUsingGETWithHttpInfo(location, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted);
return resp.getData();
}
/**
* Find cities
* Find cities, filtering by optional criteria. If no criteria are set, you will get back all known cities.
* @param location Only places near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (optional)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return ApiResponse<PopulatedPlacesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse findCitiesUsingGETWithHttpInfo(String location, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
com.squareup.okhttp.Call call = findCitiesUsingGETValidateBeforeCall(location, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, 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.
* @param location Only places near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (optional)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 location, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, 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(location, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for findDivisionsNearAdminDivisionUsingGET
* @param divisionId An admin-division id (either native 'id' or 'wikiDataId') (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 findDivisionsNearAdminDivisionUsingGETCall(String divisionId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/adminDivisions/{divisionId}/nearbyDivisions"
.replaceAll("\\{" + "divisionId" + "\\}", apiClient.escapeString(divisionId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (radius != null)
localVarQueryParams.addAll(apiClient.parameterToPair("radius", radius));
if (distanceUnit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("distanceUnit", distanceUnit));
if (countryIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("countryIds", countryIds));
if (excludedCountryIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("excludedCountryIds", excludedCountryIds));
if (minPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("minPopulation", minPopulation));
if (maxPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("maxPopulation", maxPopulation));
if (namePrefix != null)
localVarQueryParams.addAll(apiClient.parameterToPair("namePrefix", namePrefix));
if (timeZoneIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("timeZoneIds", timeZoneIds));
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (hateoasMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("hateoasMode", hateoasMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
if (offset != null)
localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
if (sort != null)
localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort));
if (includeDeleted != null)
localVarQueryParams.addAll(apiClient.parameterToPair("includeDeleted", includeDeleted));
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 findDivisionsNearAdminDivisionUsingGETValidateBeforeCall(String divisionId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'divisionId' is set
if (divisionId == null) {
throw new ApiException("Missing the required parameter 'divisionId' when calling findDivisionsNearAdminDivisionUsingGET(Async)");
}
com.squareup.okhttp.Call call = findDivisionsNearAdminDivisionUsingGETCall(divisionId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
return call;
}
/**
* Find divisions near division
* Find administrative divisions near the given origin division, filtering by optional criteria. If no criteria are set, you will get back all known divisions.
* @param divisionId An admin-division id (either native 'id' or 'wikiDataId') (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return PopulatedPlacesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public PopulatedPlacesResponse findDivisionsNearAdminDivisionUsingGET(String divisionId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
ApiResponse resp = findDivisionsNearAdminDivisionUsingGETWithHttpInfo(divisionId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted);
return resp.getData();
}
/**
* Find divisions near division
* Find administrative divisions near the given origin division, filtering by optional criteria. If no criteria are set, you will get back all known divisions.
* @param divisionId An admin-division id (either native 'id' or 'wikiDataId') (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return ApiResponse<PopulatedPlacesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse findDivisionsNearAdminDivisionUsingGETWithHttpInfo(String divisionId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
com.squareup.okhttp.Call call = findDivisionsNearAdminDivisionUsingGETValidateBeforeCall(divisionId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Find divisions near division (asynchronously)
* Find administrative divisions near the given origin division, filtering by optional criteria. If no criteria are set, you will get back all known divisions.
* @param divisionId An admin-division id (either native 'id' or 'wikiDataId') (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 findDivisionsNearAdminDivisionUsingGETAsync(String divisionId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, 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 = findDivisionsNearAdminDivisionUsingGETValidateBeforeCall(divisionId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for findDivisionsNearLocationUsingGET
* @param locationId A latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 findDivisionsNearLocationUsingGETCall(String locationId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/locations/{locationId}/nearbyDivisions"
.replaceAll("\\{" + "locationId" + "\\}", apiClient.escapeString(locationId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (radius != null)
localVarQueryParams.addAll(apiClient.parameterToPair("radius", radius));
if (distanceUnit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("distanceUnit", distanceUnit));
if (countryIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("countryIds", countryIds));
if (excludedCountryIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("excludedCountryIds", excludedCountryIds));
if (minPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("minPopulation", minPopulation));
if (maxPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("maxPopulation", maxPopulation));
if (namePrefix != null)
localVarQueryParams.addAll(apiClient.parameterToPair("namePrefix", namePrefix));
if (timeZoneIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("timeZoneIds", timeZoneIds));
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (hateoasMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("hateoasMode", hateoasMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
if (offset != null)
localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
if (sort != null)
localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort));
if (includeDeleted != null)
localVarQueryParams.addAll(apiClient.parameterToPair("includeDeleted", includeDeleted));
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 findDivisionsNearLocationUsingGETValidateBeforeCall(String locationId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'locationId' is set
if (locationId == null) {
throw new ApiException("Missing the required parameter 'locationId' when calling findDivisionsNearLocationUsingGET(Async)");
}
com.squareup.okhttp.Call call = findDivisionsNearLocationUsingGETCall(locationId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
return call;
}
/**
* Find divisions near location
* Find administrative divisions near the given location, filtering by optional criteria. If no criteria are set, you will get back all known divisions.
* @param locationId A latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return PopulatedPlacesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public PopulatedPlacesResponse findDivisionsNearLocationUsingGET(String locationId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
ApiResponse resp = findDivisionsNearLocationUsingGETWithHttpInfo(locationId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted);
return resp.getData();
}
/**
* Find divisions near location
* Find administrative divisions near the given location, filtering by optional criteria. If no criteria are set, you will get back all known divisions.
* @param locationId A latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return ApiResponse<PopulatedPlacesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse findDivisionsNearLocationUsingGETWithHttpInfo(String locationId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
com.squareup.okhttp.Call call = findDivisionsNearLocationUsingGETValidateBeforeCall(locationId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Find divisions near location (asynchronously)
* Find administrative divisions near the given location, filtering by optional criteria. If no criteria are set, you will get back all known divisions.
* @param locationId A latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD (required)
* @param radius The location radius within which to find places (optional)
* @param distanceUnit The unit of distance: MI | KM (optional, default to MI)
* @param countryIds Only places in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param excludedCountryIds Only places NOT in these countries (comma-delimited country codes or WikiData ids) (optional)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = countryCode | elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 findDivisionsNearLocationUsingGETAsync(String locationId, Integer radius, String distanceUnit, String countryIds, String excludedCountryIds, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, 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 = findDivisionsNearLocationUsingGETValidateBeforeCall(locationId, radius, distanceUnit, countryIds, excludedCountryIds, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for findRegionCitiesUsingGET
* @param countryId An ISO-3166 country code or WikiData id (required)
* @param regionCode An ISO-3166 or FIPS region code (required)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 countryId, String regionCode, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/countries/{countryId}/regions/{regionCode}/cities"
.replaceAll("\\{" + "countryId" + "\\}", apiClient.escapeString(countryId.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 (maxPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("maxPopulation", maxPopulation));
if (namePrefix != null)
localVarQueryParams.addAll(apiClient.parameterToPair("namePrefix", namePrefix));
if (timeZoneIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("timeZoneIds", timeZoneIds));
if (types != null)
localVarQueryParams.addAll(apiClient.parameterToPair("types", types));
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (hateoasMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("hateoasMode", hateoasMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
if (offset != null)
localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
if (sort != null)
localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort));
if (includeDeleted != null)
localVarQueryParams.addAll(apiClient.parameterToPair("includeDeleted", includeDeleted));
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 countryId, String regionCode, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'countryId' is set
if (countryId == null) {
throw new ApiException("Missing the required parameter 'countryId' 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(countryId, regionCode, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, 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 countryId An ISO-3166 country code or WikiData id (required)
* @param regionCode An ISO-3166 or FIPS region code (required)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return PopulatedPlacesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public PopulatedPlacesResponse findRegionCitiesUsingGET(String countryId, String regionCode, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
ApiResponse resp = findRegionCitiesUsingGETWithHttpInfo(countryId, regionCode, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted);
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 countryId An ISO-3166 country code or WikiData id (required)
* @param regionCode An ISO-3166 or FIPS region code (required)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return ApiResponse<PopulatedPlacesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse findRegionCitiesUsingGETWithHttpInfo(String countryId, String regionCode, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
com.squareup.okhttp.Call call = findRegionCitiesUsingGETValidateBeforeCall(countryId, regionCode, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, 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 countryId An ISO-3166 country code or WikiData id (required)
* @param regionCode An ISO-3166 or FIPS region code (required)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param types Only places for these types (comma-delimited): CITY | ADM2 (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 countryId, String regionCode, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, String types, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, 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(countryId, regionCode, minPopulation, maxPopulation, namePrefix, timeZoneIds, types, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for findRegionDivisionsUsingGET
* @param countryId An ISO-3166 country code or WikiData id (required)
* @param regionCode An ISO-3166 or FIPS region code (required)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 findRegionDivisionsUsingGETCall(String countryId, String regionCode, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/countries/{countryId}/regions/{regionCode}/adminDivisions"
.replaceAll("\\{" + "countryId" + "\\}", apiClient.escapeString(countryId.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 (maxPopulation != null)
localVarQueryParams.addAll(apiClient.parameterToPair("maxPopulation", maxPopulation));
if (namePrefix != null)
localVarQueryParams.addAll(apiClient.parameterToPair("namePrefix", namePrefix));
if (timeZoneIds != null)
localVarQueryParams.addAll(apiClient.parameterToPair("timeZoneIds", timeZoneIds));
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (hateoasMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("hateoasMode", hateoasMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
if (offset != null)
localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
if (sort != null)
localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort));
if (includeDeleted != null)
localVarQueryParams.addAll(apiClient.parameterToPair("includeDeleted", includeDeleted));
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 findRegionDivisionsUsingGETValidateBeforeCall(String countryId, String regionCode, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'countryId' is set
if (countryId == null) {
throw new ApiException("Missing the required parameter 'countryId' when calling findRegionDivisionsUsingGET(Async)");
}
// verify the required parameter 'regionCode' is set
if (regionCode == null) {
throw new ApiException("Missing the required parameter 'regionCode' when calling findRegionDivisionsUsingGET(Async)");
}
com.squareup.okhttp.Call call = findRegionDivisionsUsingGETCall(countryId, regionCode, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
return call;
}
/**
* Find country region administrative divisions
* Get the administrative divisions in a specific country region. The country and region info is omitted in the response.
* @param countryId An ISO-3166 country code or WikiData id (required)
* @param regionCode An ISO-3166 or FIPS region code (required)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return PopulatedPlacesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public PopulatedPlacesResponse findRegionDivisionsUsingGET(String countryId, String regionCode, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
ApiResponse resp = findRegionDivisionsUsingGETWithHttpInfo(countryId, regionCode, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted);
return resp.getData();
}
/**
* Find country region administrative divisions
* Get the administrative divisions in a specific country region. The country and region info is omitted in the response.
* @param countryId An ISO-3166 country code or WikiData id (required)
* @param regionCode An ISO-3166 or FIPS region code (required)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @return ApiResponse<PopulatedPlacesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse findRegionDivisionsUsingGETWithHttpInfo(String countryId, String regionCode, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted) throws ApiException {
com.squareup.okhttp.Call call = findRegionDivisionsUsingGETValidateBeforeCall(countryId, regionCode, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Find country region administrative divisions (asynchronously)
* Get the administrative divisions in a specific country region. The country and region info is omitted in the response.
* @param countryId An ISO-3166 country code or WikiData id (required)
* @param regionCode An ISO-3166 or FIPS region code (required)
* @param minPopulation Only places having at least this population (optional)
* @param maxPopulation Only places having no more than this population (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param timeZoneIds Only places in these time-zones (comma-delimited) (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 sort How to sort place results. 'Format: ±SORT_FIELD,±SORT_FIELD' where SORT_FIELD = elevation | name | population (optional)
* @param includeDeleted Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE (optional, default to NONE)
* @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 findRegionDivisionsUsingGETAsync(String countryId, String regionCode, Integer minPopulation, Integer maxPopulation, String namePrefix, String timeZoneIds, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, String sort, String includeDeleted, 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 = findRegionDivisionsUsingGETValidateBeforeCall(countryId, regionCode, minPopulation, maxPopulation, namePrefix, timeZoneIds, asciiMode, hateoasMode, languageCode, limit, offset, sort, includeDeleted, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getAdminDivisionUsingGET
* @param divisionId An admin-division id (either native 'id' or 'wikiDataId') (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @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 getAdminDivisionUsingGETCall(String divisionId, Boolean asciiMode, String languageCode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/adminDivisions/{divisionId}"
.replaceAll("\\{" + "divisionId" + "\\}", apiClient.escapeString(divisionId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
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 getAdminDivisionUsingGETValidateBeforeCall(String divisionId, Boolean asciiMode, String languageCode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'divisionId' is set
if (divisionId == null) {
throw new ApiException("Missing the required parameter 'divisionId' when calling getAdminDivisionUsingGET(Async)");
}
com.squareup.okhttp.Call call = getAdminDivisionUsingGETCall(divisionId, asciiMode, languageCode, progressListener, progressRequestListener);
return call;
}
/**
* Get administrative division details
* Get the details for a specific administrative division, including location coordinates, population, and elevation above sea-level (if available).
* @param divisionId An admin-division id (either native 'id' or 'wikiDataId') (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @return PopulatedPlaceResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public PopulatedPlaceResponse getAdminDivisionUsingGET(String divisionId, Boolean asciiMode, String languageCode) throws ApiException {
ApiResponse resp = getAdminDivisionUsingGETWithHttpInfo(divisionId, asciiMode, languageCode);
return resp.getData();
}
/**
* Get administrative division details
* Get the details for a specific administrative division, including location coordinates, population, and elevation above sea-level (if available).
* @param divisionId An admin-division id (either native 'id' or 'wikiDataId') (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @return ApiResponse<PopulatedPlaceResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse getAdminDivisionUsingGETWithHttpInfo(String divisionId, Boolean asciiMode, String languageCode) throws ApiException {
com.squareup.okhttp.Call call = getAdminDivisionUsingGETValidateBeforeCall(divisionId, asciiMode, languageCode, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get administrative division details (asynchronously)
* Get the details for a specific administrative division, including location coordinates, population, and elevation above sea-level (if available).
* @param divisionId An admin-division id (either native 'id' or 'wikiDataId') (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (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
*/
public com.squareup.okhttp.Call getAdminDivisionUsingGETAsync(String divisionId, Boolean asciiMode, String languageCode, 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 = getAdminDivisionUsingGETValidateBeforeCall(divisionId, asciiMode, languageCode, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getCityDateTimeUsingGET
* @param cityId A city id (either native 'id' or 'wikiDataId') (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(String cityId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/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(String 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 A city id (either native 'id' or 'wikiDataId') (required)
* @return DateTimeResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public DateTimeResponse getCityDateTimeUsingGET(String cityId) throws ApiException {
ApiResponse resp = getCityDateTimeUsingGETWithHttpInfo(cityId);
return resp.getData();
}
/**
* Get city date-time
* Get city date-time
* @param cityId A city id (either native 'id' or 'wikiDataId') (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(String 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 A city id (either native 'id' or 'wikiDataId') (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(String 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 A city id (either native 'id' or 'wikiDataId') (required)
* @param toCityId Distance to 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(String cityId, String toCityId, String distanceUnit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/cities/{cityId}/distance"
.replaceAll("\\{" + "cityId" + "\\}", apiClient.escapeString(cityId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (toCityId != null)
localVarQueryParams.addAll(apiClient.parameterToPair("toCityId", toCityId));
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(String cityId, String toCityId, 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 'toCityId' is set
if (toCityId == null) {
throw new ApiException("Missing the required parameter 'toCityId' when calling getCityDistanceUsingGET(Async)");
}
com.squareup.okhttp.Call call = getCityDistanceUsingGETCall(cityId, toCityId, distanceUnit, progressListener, progressRequestListener);
return call;
}
/**
* Get city distance
* Get distance from the given city
* @param cityId A city id (either native 'id' or 'wikiDataId') (required)
* @param toCityId Distance to 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(String cityId, String toCityId, String distanceUnit) throws ApiException {
ApiResponse resp = getCityDistanceUsingGETWithHttpInfo(cityId, toCityId, distanceUnit);
return resp.getData();
}
/**
* Get city distance
* Get distance from the given city
* @param cityId A city id (either native 'id' or 'wikiDataId') (required)
* @param toCityId Distance to 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(String cityId, String toCityId, String distanceUnit) throws ApiException {
com.squareup.okhttp.Call call = getCityDistanceUsingGETValidateBeforeCall(cityId, toCityId, distanceUnit, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get city distance (asynchronously)
* Get distance from the given city
* @param cityId A city id (either native 'id' or 'wikiDataId') (required)
* @param toCityId Distance to 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(String cityId, String toCityId, 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, toCityId, distanceUnit, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getCityLocatedInUsingGET
* @param cityId A city id (either native 'id' or 'wikiDataId') (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @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 getCityLocatedInUsingGETCall(String cityId, Boolean asciiMode, String languageCode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/cities/{cityId}/locatedIn"
.replaceAll("\\{" + "cityId" + "\\}", apiClient.escapeString(cityId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
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 getCityLocatedInUsingGETValidateBeforeCall(String cityId, Boolean asciiMode, String languageCode, 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 getCityLocatedInUsingGET(Async)");
}
com.squareup.okhttp.Call call = getCityLocatedInUsingGETCall(cityId, asciiMode, languageCode, progressListener, progressRequestListener);
return call;
}
/**
* Get this city's containing populated place (e.g., its county or other administrative division)
* Get the details for the containing populated place, including location coordinates, population, and elevation above sea-level (if available).
* @param cityId A city id (either native 'id' or 'wikiDataId') (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @return PopulatedPlaceResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public PopulatedPlaceResponse getCityLocatedInUsingGET(String cityId, Boolean asciiMode, String languageCode) throws ApiException {
ApiResponse resp = getCityLocatedInUsingGETWithHttpInfo(cityId, asciiMode, languageCode);
return resp.getData();
}
/**
* Get this city's containing populated place (e.g., its county or other administrative division)
* Get the details for the containing populated place, including location coordinates, population, and elevation above sea-level (if available).
* @param cityId A city id (either native 'id' or 'wikiDataId') (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @return ApiResponse<PopulatedPlaceResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse getCityLocatedInUsingGETWithHttpInfo(String cityId, Boolean asciiMode, String languageCode) throws ApiException {
com.squareup.okhttp.Call call = getCityLocatedInUsingGETValidateBeforeCall(cityId, asciiMode, languageCode, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get this city's containing populated place (e.g., its county or other administrative division) (asynchronously)
* Get the details for the containing populated place, including location coordinates, population, and elevation above sea-level (if available).
* @param cityId A city id (either native 'id' or 'wikiDataId') (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (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
*/
public com.squareup.okhttp.Call getCityLocatedInUsingGETAsync(String cityId, Boolean asciiMode, String languageCode, 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 = getCityLocatedInUsingGETValidateBeforeCall(cityId, asciiMode, languageCode, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getCityTimeUsingGET
* @param cityId A city id (either native 'id' or 'wikiDataId') (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(String cityId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/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(String 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 A city id (either native 'id' or 'wikiDataId') (required)
* @return TimeResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public TimeResponse getCityTimeUsingGET(String cityId) throws ApiException {
ApiResponse resp = getCityTimeUsingGETWithHttpInfo(cityId);
return resp.getData();
}
/**
* Get city time
* Get city time
* @param cityId A city id (either native 'id' or 'wikiDataId') (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(String 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 A city id (either native 'id' or 'wikiDataId') (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(String 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 A city id (either native 'id' or 'wikiDataId') (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @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(String cityId, Boolean asciiMode, String languageCode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/cities/{cityId}"
.replaceAll("\\{" + "cityId" + "\\}", apiClient.escapeString(cityId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
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(String cityId, Boolean asciiMode, String languageCode, 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, asciiMode, languageCode, 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 A city id (either native 'id' or 'wikiDataId') (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @return PopulatedPlaceResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public PopulatedPlaceResponse getCityUsingGET(String cityId, Boolean asciiMode, String languageCode) throws ApiException {
ApiResponse resp = getCityUsingGETWithHttpInfo(cityId, asciiMode, languageCode);
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 A city id (either native 'id' or 'wikiDataId') (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @return ApiResponse<PopulatedPlaceResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse getCityUsingGETWithHttpInfo(String cityId, Boolean asciiMode, String languageCode) throws ApiException {
com.squareup.okhttp.Call call = getCityUsingGETValidateBeforeCall(cityId, asciiMode, languageCode, 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 A city id (either native 'id' or 'wikiDataId') (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (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
*/
public com.squareup.okhttp.Call getCityUsingGETAsync(String cityId, Boolean asciiMode, String languageCode, 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, asciiMode, languageCode, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getCountriesUsingGET
* @param currencyCode Only countries supporting this currency (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 currencyCode, String namePrefix, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/countries";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (currencyCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("currencyCode", currencyCode));
if (namePrefix != null)
localVarQueryParams.addAll(apiClient.parameterToPair("namePrefix", namePrefix));
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (hateoasMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("hateoasMode", hateoasMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
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 currencyCode, String namePrefix, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = getCountriesUsingGETCall(currencyCode, namePrefix, asciiMode, hateoasMode, languageCode, 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 currencyCode Only countries supporting this currency (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 currencyCode, String namePrefix, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset) throws ApiException {
ApiResponse resp = getCountriesUsingGETWithHttpInfo(currencyCode, namePrefix, asciiMode, hateoasMode, languageCode, 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 currencyCode Only countries supporting this currency (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 currencyCode, String namePrefix, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset) throws ApiException {
com.squareup.okhttp.Call call = getCountriesUsingGETValidateBeforeCall(currencyCode, namePrefix, asciiMode, hateoasMode, languageCode, 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 currencyCode Only countries supporting this currency (optional)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 currencyCode, String namePrefix, Boolean asciiMode, Boolean hateoasMode, String languageCode, 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(currencyCode, namePrefix, asciiMode, hateoasMode, languageCode, limit, offset, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getCountryUsingGET
* @param countryId An ISO-3166 country code or WikiData id (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @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 countryId, Boolean asciiMode, String languageCode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/countries/{countryId}"
.replaceAll("\\{" + "countryId" + "\\}", apiClient.escapeString(countryId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
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 countryId, Boolean asciiMode, String languageCode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'countryId' is set
if (countryId == null) {
throw new ApiException("Missing the required parameter 'countryId' when calling getCountryUsingGET(Async)");
}
com.squareup.okhttp.Call call = getCountryUsingGETCall(countryId, asciiMode, languageCode, progressListener, progressRequestListener);
return call;
}
/**
* Get country details
* Get the details for a specific country, including number of regions.
* @param countryId An ISO-3166 country code or WikiData id (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @return CountryResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public CountryResponse getCountryUsingGET(String countryId, Boolean asciiMode, String languageCode) throws ApiException {
ApiResponse resp = getCountryUsingGETWithHttpInfo(countryId, asciiMode, languageCode);
return resp.getData();
}
/**
* Get country details
* Get the details for a specific country, including number of regions.
* @param countryId An ISO-3166 country code or WikiData id (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @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 countryId, Boolean asciiMode, String languageCode) throws ApiException {
com.squareup.okhttp.Call call = getCountryUsingGETValidateBeforeCall(countryId, asciiMode, languageCode, 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 countryId An ISO-3166 country code or WikiData id (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (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
*/
public com.squareup.okhttp.Call getCountryUsingGETAsync(String countryId, Boolean asciiMode, String languageCode, 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(countryId, asciiMode, languageCode, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getRegionUsingGET
* @param countryId An ISO-3166 country code or WikiData id (required)
* @param regionCode An ISO-3166 or FIPS region code (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @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 countryId, String regionCode, Boolean asciiMode, String languageCode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/countries/{countryId}/regions/{regionCode}"
.replaceAll("\\{" + "countryId" + "\\}", apiClient.escapeString(countryId.toString()))
.replaceAll("\\{" + "regionCode" + "\\}", apiClient.escapeString(regionCode.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
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 countryId, String regionCode, Boolean asciiMode, String languageCode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'countryId' is set
if (countryId == null) {
throw new ApiException("Missing the required parameter 'countryId' 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(countryId, regionCode, asciiMode, languageCode, progressListener, progressRequestListener);
return call;
}
/**
* Get region details
* Get the details of a specific country region, including number of cities.
* @param countryId An ISO-3166 country code or WikiData id (required)
* @param regionCode An ISO-3166 or FIPS region code (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @return RegionResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public RegionResponse getRegionUsingGET(String countryId, String regionCode, Boolean asciiMode, String languageCode) throws ApiException {
ApiResponse resp = getRegionUsingGETWithHttpInfo(countryId, regionCode, asciiMode, languageCode);
return resp.getData();
}
/**
* Get region details
* Get the details of a specific country region, including number of cities.
* @param countryId An ISO-3166 country code or WikiData id (required)
* @param regionCode An ISO-3166 or FIPS region code (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (optional)
* @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 countryId, String regionCode, Boolean asciiMode, String languageCode) throws ApiException {
com.squareup.okhttp.Call call = getRegionUsingGETValidateBeforeCall(countryId, regionCode, asciiMode, languageCode, 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 countryId An ISO-3166 country code or WikiData id (required)
* @param regionCode An ISO-3166 or FIPS region code (required)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param languageCode Display results in this language (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
*/
public com.squareup.okhttp.Call getRegionUsingGETAsync(String countryId, String regionCode, Boolean asciiMode, String languageCode, 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(countryId, regionCode, asciiMode, languageCode, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for getRegionsUsingGET
* @param countryId An ISO-3166 country code or WikiData id (required)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 countryId, String namePrefix, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/geo/countries/{countryId}/regions"
.replaceAll("\\{" + "countryId" + "\\}", apiClient.escapeString(countryId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (namePrefix != null)
localVarQueryParams.addAll(apiClient.parameterToPair("namePrefix", namePrefix));
if (asciiMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("asciiMode", asciiMode));
if (hateoasMode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("hateoasMode", hateoasMode));
if (languageCode != null)
localVarQueryParams.addAll(apiClient.parameterToPair("languageCode", languageCode));
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 countryId, String namePrefix, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'countryId' is set
if (countryId == null) {
throw new ApiException("Missing the required parameter 'countryId' when calling getRegionsUsingGET(Async)");
}
com.squareup.okhttp.Call call = getRegionsUsingGETCall(countryId, namePrefix, asciiMode, hateoasMode, languageCode, 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 countryId An ISO-3166 country code or WikiData id (required)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 countryId, String namePrefix, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset) throws ApiException {
ApiResponse resp = getRegionsUsingGETWithHttpInfo(countryId, namePrefix, asciiMode, hateoasMode, languageCode, 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 countryId An ISO-3166 country code or WikiData id (required)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 countryId, String namePrefix, Boolean asciiMode, Boolean hateoasMode, String languageCode, Integer limit, Integer offset) throws ApiException {
com.squareup.okhttp.Call call = getRegionsUsingGETValidateBeforeCall(countryId, namePrefix, asciiMode, hateoasMode, languageCode, 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 countryId An ISO-3166 country code or WikiData id (required)
* @param namePrefix Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. (optional)
* @param asciiMode Display results using ASCII characters (optional, default to false)
* @param hateoasMode Include HATEOAS-style links in results (optional, default to true)
* @param languageCode Display results in this language (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 countryId, String namePrefix, Boolean asciiMode, Boolean hateoasMode, String languageCode, 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(countryId, namePrefix, asciiMode, hateoasMode, languageCode, limit, offset, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
}