diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION
index 06eda28..ec87108 100644
--- a/.openapi-generator/VERSION
+++ b/.openapi-generator/VERSION
@@ -1 +1 @@
-3.2.3
\ No newline at end of file
+4.2.3
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index 80a7f2f..e3bdf2a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,17 +1,22 @@
#
-# Generated by: https://openapi-generator.tech
+# Generated by OpenAPI Generator: https://openapi-generator.tech
+#
+# Ref: https://docs.travis-ci.com/user/languages/java/
#
language: java
jdk:
- - oraclejdk8
- - oraclejdk7
+ - openjdk12
+ - openjdk11
+ - openjdk10
+ - openjdk9
+ - openjdk8
before_install:
# ensure gradlew has proper permission
- chmod a+x ./gradlew
script:
# test using maven
- - mvn test
- # uncomment below to test using gradle
- # - gradle test
- # uncomment below to test using sbt
+ #- mvn test
+ # test using gradle
+ - gradle test
+ # test using sbt
# - sbt test
diff --git a/README.md b/README.md
index 877250f..5db3233 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,8 @@
# locationiq-java-client
LocationIQ
-- API version: 1.0.0
+- API version: 2.0.0
+ - Build date: 2020-02-14T16:06:31.759327+05:30[Asia/Kolkata]
LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
@@ -39,7 +40,7 @@ Add this dependency to your project's POM:
com.locationiqlocationiq-java-client
- 1.0.0
+ 2.0.0compile
```
@@ -49,7 +50,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:
```groovy
-compile "com.locationiq:locationiq-java-client:1.0.0"
+compile "com.locationiq:locationiq-java-client:2.0.0"
```
### Others
@@ -62,7 +63,7 @@ mvn clean package
Then manually install the following JARs:
-* `target/locationiq-java-client-1.0.0.jar`
+* `target/locationiq-java-client-2.0.0.jar`
* `target/lib/*.jar`
## Getting Started
@@ -71,34 +72,37 @@ Please follow the [installation](#installation) instruction and execute the foll
```java
-import LocationIq.*;
-import LocationIq.auth.*;
-import com.locationiq.client.model.*;
+// Import classes:
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.auth.*;
+import com.locationiq.client.models.*;
import com.locationiq.client.api.BalanceApi;
-import java.io.File;
-import java.util.*;
-
-public class BalanceApiExample {
-
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
-
- // Configure API key authorization: key
- ApiKeyAuth key = (ApiKeyAuth) defaultClient.getAuthentication("key");
- key.setApiKey("YOUR API KEY");
- // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
- //key.setApiKeyPrefix("Token");
-
- BalanceApi apiInstance = new BalanceApi();
- try {
- Balance result = apiInstance.balance();
- System.out.println(result);
- } catch (ApiException e) {
- System.err.println("Exception when calling BalanceApi#balance");
- e.printStackTrace();
- }
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://eu1.locationiq.com/v1");
+
+ // Configure API key authorization: key
+ ApiKeyAuth key = (ApiKeyAuth) defaultClient.getAuthentication("key");
+ key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //key.setApiKeyPrefix("Token");
+
+ BalanceApi apiInstance = new BalanceApi(defaultClient);
+ try {
+ Balance result = apiInstance.balance();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling BalanceApi#balance");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
}
+ }
}
```
@@ -110,6 +114,10 @@ All URIs are relative to *https://eu1.locationiq.com/v1*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*BalanceApi* | [**balance**](docs/BalanceApi.md#balance) | **GET** /balance.php |
+*DirectionsApi* | [**directions**](docs/DirectionsApi.md#directions) | **GET** /directions/driving/{coordinates} | Directions Service
+*MatchingApi* | [**matching**](docs/MatchingApi.md#matching) | **GET** /matching/driving/{coordinates} | Matching Service
+*MatrixApi* | [**matrix**](docs/MatrixApi.md#matrix) | **GET** /matrix/driving/{coordinates} | Matrix Service
+*NearestApi* | [**nearest**](docs/NearestApi.md#nearest) | **GET** /nearest/driving/{coordinates} | Nearest Service
*ReverseApi* | [**reverse**](docs/ReverseApi.md#reverse) | **GET** /reverse.php | Reverse Geocoding
*SearchApi* | [**search**](docs/SearchApi.md#search) | **GET** /search.php | Forward Geocoding
@@ -119,8 +127,16 @@ Class | Method | HTTP request | Description
- [Address](docs/Address.md)
- [Balance](docs/Balance.md)
- [Daybalance](docs/Daybalance.md)
+ - [DirectionsDirections](docs/DirectionsDirections.md)
+ - [DirectionsDirectionsRoutes](docs/DirectionsDirectionsRoutes.md)
+ - [DirectionsMatching](docs/DirectionsMatching.md)
+ - [DirectionsMatrix](docs/DirectionsMatrix.md)
+ - [DirectionsMatrixSources](docs/DirectionsMatrixSources.md)
+ - [DirectionsNearest](docs/DirectionsNearest.md)
+ - [DirectionsNearestWaypoints](docs/DirectionsNearestWaypoints.md)
- [Error](docs/Error.md)
- [Location](docs/Location.md)
+ - [Matchquality](docs/Matchquality.md)
- [Namedetails](docs/Namedetails.md)
diff --git a/build.gradle b/build.gradle
index c1b924c..756f002 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,11 +1,13 @@
apply plugin: 'idea'
apply plugin: 'eclipse'
+apply plugin: 'java'
group = 'com.locationiq'
-version = '1.0.0'
+version = '2.0.0'
buildscript {
repositories {
+ maven { url "https://repo1.maven.org/maven2" }
jcenter()
}
dependencies {
@@ -17,7 +19,9 @@ buildscript {
repositories {
jcenter()
}
-
+sourceSets {
+ main.java.srcDirs = ['src/main/java']
+}
if(hasProperty('target') && target == 'android') {
@@ -94,11 +98,17 @@ if(hasProperty('target') && target == 'android') {
}
dependencies {
- compile 'io.swagger:swagger-annotations:1.5.17'
- compile 'com.squareup.okhttp:okhttp:2.7.5'
- compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
- compile 'com.google.code.gson:gson:2.8.1'
- compile 'io.gsonfire:gson-fire:1.8.0'
- compile 'org.threeten:threetenbp:1.3.5'
- testCompile 'junit:junit:4.12'
+ compile 'io.swagger:swagger-annotations:1.5.22'
+ compile "com.google.code.findbugs:jsr305:3.0.2"
+ compile 'com.squareup.okhttp3:okhttp:3.14.2'
+ compile 'com.squareup.okhttp3:logging-interceptor:3.14.2'
+ compile 'com.google.code.gson:gson:2.8.5'
+ compile 'io.gsonfire:gson-fire:1.8.3'
+ compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
+ compile 'org.threeten:threetenbp:1.4.0'
+ testCompile 'junit:junit:4.13'
+}
+
+javadoc {
+ options.tags = [ "http.response.details:a:Http Response Details" ]
}
diff --git a/build.sbt b/build.sbt
index fa7325e..7e806e5 100644
--- a/build.sbt
+++ b/build.sbt
@@ -2,20 +2,22 @@ lazy val root = (project in file(".")).
settings(
organization := "com.locationiq",
name := "locationiq-java-client",
- version := "1.0.0",
+ version := "2.0.0",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
javacOptions in compile ++= Seq("-Xlint:deprecation"),
publishArtifact in (Compile, packageDoc) := false,
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
- "io.swagger" % "swagger-annotations" % "1.5.17",
- "com.squareup.okhttp" % "okhttp" % "2.7.5",
- "com.squareup.okhttp" % "logging-interceptor" % "2.7.5",
- "com.google.code.gson" % "gson" % "2.8.1",
- "org.threeten" % "threetenbp" % "1.3.5" % "compile",
- "io.gsonfire" % "gson-fire" % "1.8.0" % "compile",
- "junit" % "junit" % "4.12" % "test",
+ "io.swagger" % "swagger-annotations" % "1.5.22",
+ "com.squareup.okhttp3" % "okhttp" % "3.14.2",
+ "com.squareup.okhttp3" % "logging-interceptor" % "3.14.2",
+ "com.google.code.gson" % "gson" % "2.8.5",
+ "org.apache.commons" % "commons-lang3" % "3.9",
+ "org.threeten" % "threetenbp" % "1.4.0" % "compile",
+ "io.gsonfire" % "gson-fire" % "1.8.3" % "compile",
+ "javax.annotation" % "jsr250-api" % "1.0" % "compile",
+ "junit" % "junit" % "4.13" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)
)
diff --git a/docs/Address.md b/docs/Address.md
index 20b749a..4c9e18a 100644
--- a/docs/Address.md
+++ b/docs/Address.md
@@ -1,7 +1,9 @@
+
# Address
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**houseNumber** | **String** | | [optional]
diff --git a/docs/Balance.md b/docs/Balance.md
index 36710bd..6ae70bd 100644
--- a/docs/Balance.md
+++ b/docs/Balance.md
@@ -1,7 +1,9 @@
+
# Balance
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**status** | **String** | | [optional]
diff --git a/docs/BalanceApi.md b/docs/BalanceApi.md
index 591ae99..f61316d 100644
--- a/docs/BalanceApi.md
+++ b/docs/BalanceApi.md
@@ -18,27 +18,36 @@ The Balance API provides a count of request credits left in the user's accou
### Example
```java
// Import classes:
-//import LocationIq.ApiClient;
-//import LocationIq.ApiException;
-//import LocationIq.Configuration;
-//import LocationIq.auth.*;
-//import com.locationiq.client.api.BalanceApi;
-
-ApiClient defaultClient = Configuration.getDefaultApiClient();
-
-// Configure API key authorization: key
-ApiKeyAuth key = (ApiKeyAuth) defaultClient.getAuthentication("key");
-key.setApiKey("YOUR API KEY");
-// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
-//key.setApiKeyPrefix("Token");
-
-BalanceApi apiInstance = new BalanceApi();
-try {
- Balance result = apiInstance.balance();
- System.out.println(result);
-} catch (ApiException e) {
- System.err.println("Exception when calling BalanceApi#balance");
- e.printStackTrace();
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.auth.*;
+import com.locationiq.client.models.*;
+import com.locationiq.client.api.BalanceApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://eu1.locationiq.com/v1");
+
+ // Configure API key authorization: key
+ ApiKeyAuth key = (ApiKeyAuth) defaultClient.getAuthentication("key");
+ key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //key.setApiKeyPrefix("Token");
+
+ BalanceApi apiInstance = new BalanceApi(defaultClient);
+ try {
+ Balance result = apiInstance.balance();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling BalanceApi#balance");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
}
```
@@ -58,3 +67,14 @@ This endpoint does not need any parameter.
- **Content-Type**: Not defined
- **Accept**: application/json
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | The request has been made from an unauthorized domain. | - |
+**404** | No location or places were found for the given input | - |
+**429** | Request exceeded the rate-limits set on your account | - |
+**500** | Internal Server Error | - |
+
diff --git a/docs/Daybalance.md b/docs/Daybalance.md
index 87db6c5..3c2905a 100644
--- a/docs/Daybalance.md
+++ b/docs/Daybalance.md
@@ -1,7 +1,9 @@
+
# Daybalance
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**day** | **Integer** | | [optional]
diff --git a/docs/DirectionsApi.md b/docs/DirectionsApi.md
new file mode 100644
index 0000000..bd09dec
--- /dev/null
+++ b/docs/DirectionsApi.md
@@ -0,0 +1,106 @@
+# DirectionsApi
+
+All URIs are relative to *https://eu1.locationiq.com/v1*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**directions**](DirectionsApi.md#directions) | **GET** /directions/driving/{coordinates} | Directions Service
+
+
+
+# **directions**
+> DirectionsDirections directions(coordinates, bearings, radiuses, generateHints, approaches, exclude, alternatives, steps, annotations, geometries, overview, continueStraight)
+
+Directions Service
+
+Finds the fastest route between coordinates in the supplied order.
+
+### Example
+```java
+// Import classes:
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.auth.*;
+import com.locationiq.client.models.*;
+import com.locationiq.client.api.DirectionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://eu1.locationiq.com/v1");
+
+ // Configure API key authorization: key
+ ApiKeyAuth key = (ApiKeyAuth) defaultClient.getAuthentication("key");
+ key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //key.setApiKeyPrefix("Token");
+
+ DirectionsApi apiInstance = new DirectionsApi(defaultClient);
+ String coordinates = "-0.16102,51.523854;-0.15797,51.52326;-0.161593,51.522550"; // String | String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5
+ String bearings = "10,20;40,30;30,9"; // String | Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180
+ String radiuses = "500;200;300"; // String | Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default)
+ String generateHints = "false"; // String | Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String
+ String approaches = "curb;curb;curb"; // String | Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default)
+ String exclude = "toll"; // String | Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none.
+ BigDecimal alternatives = 0; // BigDecimal | Search for alternative routes. Passing a number alternatives=n searches for up to n alternative routes. [ true, false (default), or Number ]
+ String steps = "true"; // String | Returned route steps for each route leg [ true, false (default) ]
+ String annotations = "false"; // String | Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ]
+ String geometries = "polyline"; // String | Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ]
+ String overview = "simplified"; // String | Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ]
+ String continueStraight = "default"; // String | Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile [ default (default), true, false ]
+ try {
+ DirectionsDirections result = apiInstance.directions(coordinates, bearings, radiuses, generateHints, approaches, exclude, alternatives, steps, annotations, geometries, overview, continueStraight);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling DirectionsApi#directions");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **coordinates** | **String**| String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 |
+ **bearings** | **String**| Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 | [optional]
+ **radiuses** | **String**| Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) | [optional]
+ **generateHints** | **String**| Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String | [optional]
+ **approaches** | **String**| Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) | [optional]
+ **exclude** | **String**| Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. | [optional]
+ **alternatives** | **BigDecimal**| Search for alternative routes. Passing a number alternatives=n searches for up to n alternative routes. [ true, false (default), or Number ] | [optional]
+ **steps** | **String**| Returned route steps for each route leg [ true, false (default) ] | [optional]
+ **annotations** | **String**| Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] | [optional] [default to "\"false\""]
+ **geometries** | **String**| Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] | [optional] [default to "\"polyline\""]
+ **overview** | **String**| Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] | [optional] [default to "\"simplified\""]
+ **continueStraight** | **String**| Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile [ default (default), true, false ] | [optional] [default to "\"default\""]
+
+### Return type
+
+[**DirectionsDirections**](DirectionsDirections.md)
+
+### Authorization
+
+[key](../README.md#key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | The request has been made from an unauthorized domain. | - |
+**404** | No location or places were found for the given input | - |
+**429** | Request exceeded the rate-limits set on your account | - |
+**500** | Internal Server Error | - |
+
diff --git a/docs/DirectionsDirections.md b/docs/DirectionsDirections.md
new file mode 100644
index 0000000..50a5cd7
--- /dev/null
+++ b/docs/DirectionsDirections.md
@@ -0,0 +1,14 @@
+
+
+# DirectionsDirections
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **String** | | [optional]
+**waypoints** | **List<Object>** | | [optional]
+**routes** | [**List<DirectionsDirectionsRoutes>**](DirectionsDirectionsRoutes.md) | | [optional]
+
+
+
diff --git a/docs/DirectionsDirectionsRoutes.md b/docs/DirectionsDirectionsRoutes.md
new file mode 100644
index 0000000..ee056ea
--- /dev/null
+++ b/docs/DirectionsDirectionsRoutes.md
@@ -0,0 +1,17 @@
+
+
+# DirectionsDirectionsRoutes
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**legs** | **List<Object>** | | [optional]
+**weightName** | **String** | | [optional]
+**geometry** | **String** | | [optional]
+**weight** | [**BigDecimal**](BigDecimal.md) | | [optional]
+**distance** | [**BigDecimal**](BigDecimal.md) | | [optional]
+**duration** | [**BigDecimal**](BigDecimal.md) | | [optional]
+
+
+
diff --git a/docs/DirectionsMatching.md b/docs/DirectionsMatching.md
new file mode 100644
index 0000000..2cd7312
--- /dev/null
+++ b/docs/DirectionsMatching.md
@@ -0,0 +1,14 @@
+
+
+# DirectionsMatching
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **String** | | [optional]
+**tracepoints** | **List<Object>** | | [optional]
+**matchings** | **List<Object>** | | [optional]
+
+
+
diff --git a/docs/DirectionsMatrix.md b/docs/DirectionsMatrix.md
new file mode 100644
index 0000000..76de690
--- /dev/null
+++ b/docs/DirectionsMatrix.md
@@ -0,0 +1,16 @@
+
+
+# DirectionsMatrix
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **String** | | [optional]
+**distances** | [**List<BigDecimal>**](BigDecimal.md) | | [optional]
+**fallbackSpeedCells** | [**List<BigDecimal>**](BigDecimal.md) | | [optional]
+**sources** | [**List<DirectionsMatrixSources>**](DirectionsMatrixSources.md) | | [optional]
+**destinations** | [**List<DirectionsMatrixSources>**](DirectionsMatrixSources.md) | | [optional]
+
+
+
diff --git a/docs/DirectionsMatrixSources.md b/docs/DirectionsMatrixSources.md
new file mode 100644
index 0000000..190d793
--- /dev/null
+++ b/docs/DirectionsMatrixSources.md
@@ -0,0 +1,14 @@
+
+
+# DirectionsMatrixSources
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**distance** | [**BigDecimal**](BigDecimal.md) | | [optional]
+**location** | [**List<BigDecimal>**](BigDecimal.md) | | [optional]
+**name** | **String** | | [optional]
+
+
+
diff --git a/docs/DirectionsNearest.md b/docs/DirectionsNearest.md
new file mode 100644
index 0000000..bfe9d66
--- /dev/null
+++ b/docs/DirectionsNearest.md
@@ -0,0 +1,13 @@
+
+
+# DirectionsNearest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **String** | | [optional]
+**waypoints** | [**List<DirectionsNearestWaypoints>**](DirectionsNearestWaypoints.md) | | [optional]
+
+
+
diff --git a/docs/DirectionsNearestWaypoints.md b/docs/DirectionsNearestWaypoints.md
new file mode 100644
index 0000000..91f1aa4
--- /dev/null
+++ b/docs/DirectionsNearestWaypoints.md
@@ -0,0 +1,15 @@
+
+
+# DirectionsNearestWaypoints
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**nodes** | [**List<BigDecimal>**](BigDecimal.md) | | [optional]
+**distance** | [**BigDecimal**](BigDecimal.md) | | [optional]
+**location** | [**List<BigDecimal>**](BigDecimal.md) | | [optional]
+**name** | **String** | | [optional]
+
+
+
diff --git a/docs/Error.md b/docs/Error.md
index ca189bc..e4763d7 100644
--- a/docs/Error.md
+++ b/docs/Error.md
@@ -1,7 +1,9 @@
+
# Error
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | **String** | | [optional]
diff --git a/docs/Location.md b/docs/Location.md
index 810a0b6..02a8be1 100644
--- a/docs/Location.md
+++ b/docs/Location.md
@@ -1,9 +1,12 @@
+
# Location
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**distance** | [**BigDecimal**](BigDecimal.md) | | [optional]
**placeId** | **String** | | [optional]
**licence** | **String** | | [optional]
**osmType** | **String** | | [optional]
@@ -17,6 +20,7 @@ Name | Type | Description | Notes
**importance** | [**BigDecimal**](BigDecimal.md) | | [optional]
**address** | [**Address**](Address.md) | | [optional]
**namedetails** | [**Namedetails**](Namedetails.md) | | [optional]
+**matchquality** | [**Matchquality**](Matchquality.md) | | [optional]
diff --git a/docs/MatchingApi.md b/docs/MatchingApi.md
new file mode 100644
index 0000000..f77a9f6
--- /dev/null
+++ b/docs/MatchingApi.md
@@ -0,0 +1,110 @@
+# MatchingApi
+
+All URIs are relative to *https://eu1.locationiq.com/v1*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**matching**](MatchingApi.md#matching) | **GET** /matching/driving/{coordinates} | Matching Service
+
+
+
+# **matching**
+> DirectionsMatching matching(coordinates, generateHints, approaches, exclude, bearings, radiuses, steps, annotations, geometries, overview, timestamps, gaps, tidy, waypoints)
+
+Matching Service
+
+Matching API matches or snaps given GPS points to the road network in the most plausible way. Please note the request might result multiple sub-traces. Large jumps in the timestamps (> 60s) or improbable transitions lead to trace splits if a complete matching could not be found. The algorithm might not be able to match all points. Outliers are removed if they can not be matched successfully.
+
+### Example
+```java
+// Import classes:
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.auth.*;
+import com.locationiq.client.models.*;
+import com.locationiq.client.api.MatchingApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://eu1.locationiq.com/v1");
+
+ // Configure API key authorization: key
+ ApiKeyAuth key = (ApiKeyAuth) defaultClient.getAuthentication("key");
+ key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //key.setApiKeyPrefix("Token");
+
+ MatchingApi apiInstance = new MatchingApi(defaultClient);
+ String coordinates = "-0.16102,51.523854;-0.15797,51.52326;-0.161593,51.522550"; // String | String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5
+ String generateHints = "false"; // String | Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String
+ String approaches = "curb;curb;curb"; // String | Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default)
+ String exclude = "toll"; // String | Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none.
+ String bearings = "None"; // String | Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180
+ String radiuses = "None"; // String | Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default)
+ String steps = "true"; // String | Returned route steps for each route leg [ true, false (default) ]
+ String annotations = "false"; // String | Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ]
+ String geometries = "polyline"; // String | Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ]
+ String overview = "simplified"; // String | Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ]
+ String timestamps = "200;300;900"; // String | Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. [ {timestamp};{timestamp}[;{timestamp} ...] integer seconds since UNIX epoch
+ String gaps = "ignore"; // String | Allows the input track splitting based on huge timestamp gaps between points. [ split (default), ignore ]
+ String tidy = "false"; // String | Allows the input track modification to obtain better matching quality for noisy tracks. [ true, false (default) ]
+ String waypoints = "0;1;2"; // String | Treats input coordinates indicated by given indices as waypoints in returned Match object. Default is to treat all input coordinates as waypoints. [ {index};{index};{index}... ]
+ try {
+ DirectionsMatching result = apiInstance.matching(coordinates, generateHints, approaches, exclude, bearings, radiuses, steps, annotations, geometries, overview, timestamps, gaps, tidy, waypoints);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MatchingApi#matching");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **coordinates** | **String**| String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 |
+ **generateHints** | **String**| Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String | [optional]
+ **approaches** | **String**| Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) | [optional]
+ **exclude** | **String**| Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. | [optional]
+ **bearings** | **String**| Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 | [optional]
+ **radiuses** | **String**| Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) | [optional]
+ **steps** | **String**| Returned route steps for each route leg [ true, false (default) ] | [optional]
+ **annotations** | **String**| Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] | [optional] [default to "\"false\""]
+ **geometries** | **String**| Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] | [optional] [default to "\"polyline\""]
+ **overview** | **String**| Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] | [optional] [default to "\"simplified\""]
+ **timestamps** | **String**| Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. [ {timestamp};{timestamp}[;{timestamp} ...] integer seconds since UNIX epoch | [optional]
+ **gaps** | **String**| Allows the input track splitting based on huge timestamp gaps between points. [ split (default), ignore ] | [optional] [default to "\"split\""]
+ **tidy** | **String**| Allows the input track modification to obtain better matching quality for noisy tracks. [ true, false (default) ] | [optional] [default to "\"false\""]
+ **waypoints** | **String**| Treats input coordinates indicated by given indices as waypoints in returned Match object. Default is to treat all input coordinates as waypoints. [ {index};{index};{index}... ] | [optional]
+
+### Return type
+
+[**DirectionsMatching**](DirectionsMatching.md)
+
+### Authorization
+
+[key](../README.md#key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | The request has been made from an unauthorized domain. | - |
+**404** | No location or places were found for the given input | - |
+**429** | Request exceeded the rate-limits set on your account | - |
+**500** | Internal Server Error | - |
+
diff --git a/docs/Matchquality.md b/docs/Matchquality.md
new file mode 100644
index 0000000..19db208
--- /dev/null
+++ b/docs/Matchquality.md
@@ -0,0 +1,14 @@
+
+
+# Matchquality
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**matchcode** | **String** | | [optional]
+**matchtype** | **String** | | [optional]
+**matchlevel** | **String** | | [optional]
+
+
+
diff --git a/docs/MatrixApi.md b/docs/MatrixApi.md
new file mode 100644
index 0000000..52aa79a
--- /dev/null
+++ b/docs/MatrixApi.md
@@ -0,0 +1,104 @@
+# MatrixApi
+
+All URIs are relative to *https://eu1.locationiq.com/v1*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**matrix**](MatrixApi.md#matrix) | **GET** /matrix/driving/{coordinates} | Matrix Service
+
+
+
+# **matrix**
+> DirectionsMatrix matrix(coordinates, bearings, radiuses, generateHints, approaches, exclude, annotations, sources, destinations, fallbackSpeed, fallbackCoordinate)
+
+Matrix Service
+
+Computes duration of the fastest route between all pairs of supplied coordinates. Returns the durations or distances or both between the coordinate pairs. Note that the distances are not the shortest distance between two coordinates, but rather the distances of the fastest routes.
+
+### Example
+```java
+// Import classes:
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.auth.*;
+import com.locationiq.client.models.*;
+import com.locationiq.client.api.MatrixApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://eu1.locationiq.com/v1");
+
+ // Configure API key authorization: key
+ ApiKeyAuth key = (ApiKeyAuth) defaultClient.getAuthentication("key");
+ key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //key.setApiKeyPrefix("Token");
+
+ MatrixApi apiInstance = new MatrixApi(defaultClient);
+ String coordinates = "-0.16102,51.523854;-0.15797,51.52326;-0.161593,51.522550"; // String | String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5
+ String bearings = "10,20;40,30;30,9"; // String | Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180
+ String radiuses = "500;200;300"; // String | Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default)
+ String generateHints = "false"; // String | Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String
+ String approaches = "curb;curb;curb"; // String | Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default)
+ String exclude = "toll"; // String | Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none.
+ String annotations = "distance"; // String | Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ]
+ Integer sources = 0; // Integer | Use location with given index as source. [ {index};{index}[;{index} ...] or all (default) ] => index 0 <= integer < #locations
+ Integer destinations = 2; // Integer | Use location with given index as destination. [ {index};{index}[;{index} ...] or all (default) ]
+ BigDecimal fallbackSpeed = 25.65; // BigDecimal | If no route found between a source/destination pair, calculate the as-the-crow-flies distance, then use this speed to estimate duration. double > 0
+ String fallbackCoordinate = "snapped"; // String | When using a fallback_speed, use the user-supplied coordinate (input), or the snapped location (snapped) for calculating distances. [ input (default), or snapped ]
+ try {
+ DirectionsMatrix result = apiInstance.matrix(coordinates, bearings, radiuses, generateHints, approaches, exclude, annotations, sources, destinations, fallbackSpeed, fallbackCoordinate);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MatrixApi#matrix");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **coordinates** | **String**| String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 |
+ **bearings** | **String**| Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 | [optional]
+ **radiuses** | **String**| Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) | [optional]
+ **generateHints** | **String**| Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String | [optional]
+ **approaches** | **String**| Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) | [optional]
+ **exclude** | **String**| Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. | [optional]
+ **annotations** | **String**| Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] | [optional]
+ **sources** | **Integer**| Use location with given index as source. [ {index};{index}[;{index} ...] or all (default) ] => index 0 <= integer < #locations | [optional]
+ **destinations** | **Integer**| Use location with given index as destination. [ {index};{index}[;{index} ...] or all (default) ] | [optional]
+ **fallbackSpeed** | **BigDecimal**| If no route found between a source/destination pair, calculate the as-the-crow-flies distance, then use this speed to estimate duration. double > 0 | [optional]
+ **fallbackCoordinate** | **String**| When using a fallback_speed, use the user-supplied coordinate (input), or the snapped location (snapped) for calculating distances. [ input (default), or snapped ] | [optional] [default to "\"input\""]
+
+### Return type
+
+[**DirectionsMatrix**](DirectionsMatrix.md)
+
+### Authorization
+
+[key](../README.md#key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | The request has been made from an unauthorized domain. | - |
+**404** | No location or places were found for the given input | - |
+**429** | Request exceeded the rate-limits set on your account | - |
+**500** | Internal Server Error | - |
+
diff --git a/docs/Namedetails.md b/docs/Namedetails.md
index 1c4f289..8f9dbd4 100644
--- a/docs/Namedetails.md
+++ b/docs/Namedetails.md
@@ -1,7 +1,9 @@
+
# Namedetails
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]
diff --git a/docs/NearestApi.md b/docs/NearestApi.md
new file mode 100644
index 0000000..e71c600
--- /dev/null
+++ b/docs/NearestApi.md
@@ -0,0 +1,96 @@
+# NearestApi
+
+All URIs are relative to *https://eu1.locationiq.com/v1*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**nearest**](NearestApi.md#nearest) | **GET** /nearest/driving/{coordinates} | Nearest Service
+
+
+
+# **nearest**
+> DirectionsNearest nearest(coordinates, generateHints, exclude, bearings, radiuses, approaches, number)
+
+Nearest Service
+
+Snaps a coordinate to the street network and returns the nearest n matches. Where coordinates only supports a single {longitude},{latitude} entry.
+
+### Example
+```java
+// Import classes:
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.auth.*;
+import com.locationiq.client.models.*;
+import com.locationiq.client.api.NearestApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://eu1.locationiq.com/v1");
+
+ // Configure API key authorization: key
+ ApiKeyAuth key = (ApiKeyAuth) defaultClient.getAuthentication("key");
+ key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //key.setApiKeyPrefix("Token");
+
+ NearestApi apiInstance = new NearestApi(defaultClient);
+ String coordinates = "-0.16102,51.523854"; // String | String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5
+ String generateHints = "false"; // String | Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String
+ String exclude = "toll"; // String | Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none.
+ String bearings = "10,20"; // String | Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180
+ String radiuses = "1000"; // String | Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default)
+ String approaches = "curb"; // String | Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default)
+ Integer number = 3; // Integer | Number of nearest segments that should be returned. [ integer >= 1 (default 1) ]
+ try {
+ DirectionsNearest result = apiInstance.nearest(coordinates, generateHints, exclude, bearings, radiuses, approaches, number);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling NearestApi#nearest");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **coordinates** | **String**| String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 |
+ **generateHints** | **String**| Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String | [optional]
+ **exclude** | **String**| Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. | [optional]
+ **bearings** | **String**| Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 | [optional]
+ **radiuses** | **String**| Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) | [optional]
+ **approaches** | **String**| Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) | [optional]
+ **number** | **Integer**| Number of nearest segments that should be returned. [ integer >= 1 (default 1) ] | [optional]
+
+### Return type
+
+[**DirectionsNearest**](DirectionsNearest.md)
+
+### Authorization
+
+[key](../README.md#key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | The request has been made from an unauthorized domain. | - |
+**404** | No location or places were found for the given input | - |
+**429** | Request exceeded the rate-limits set on your account | - |
+**500** | Internal Server Error | - |
+
diff --git a/docs/ReverseApi.md b/docs/ReverseApi.md
index b6d1369..99202b9 100644
--- a/docs/ReverseApi.md
+++ b/docs/ReverseApi.md
@@ -9,7 +9,7 @@ Method | HTTP request | Description
# **reverse**
-> Location reverse(lat, lon, format, normalizecity, addressdetails, acceptLanguage, namedetails, extratags, statecode)
+> Location reverse(lat, lon, format, normalizecity, addressdetails, acceptLanguage, namedetails, extratags, statecode, showdistance, postaladdress)
Reverse Geocoding
@@ -18,36 +18,47 @@ Reverse geocoding is the process of converting a coordinate or location (latitud
### Example
```java
// Import classes:
-//import LocationIq.ApiClient;
-//import LocationIq.ApiException;
-//import LocationIq.Configuration;
-//import LocationIq.auth.*;
-//import com.locationiq.client.api.ReverseApi;
-
-ApiClient defaultClient = Configuration.getDefaultApiClient();
-
-// Configure API key authorization: key
-ApiKeyAuth key = (ApiKeyAuth) defaultClient.getAuthentication("key");
-key.setApiKey("YOUR API KEY");
-// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
-//key.setApiKeyPrefix("Token");
-
-ReverseApi apiInstance = new ReverseApi();
-BigDecimal lat = 17.24; // BigDecimal | Latitude of the location to generate an address for.
-BigDecimal lon = 74.25; // BigDecimal | Longitude of the location to generate an address for.
-String format = "json"; // String | Format to geocode. Only JSON supported for SDKs
-Integer normalizecity = 1; // Integer | Normalizes village to city level data to city
-Integer addressdetails = 1; // Integer | Include a breakdown of the address into elements. Defaults to 1.
-String acceptLanguage = "en"; // String | Preferred language order for showing search results, overrides the value specified in the Accept-Language HTTP header. Defaults to en. To use native language for the response when available, use accept-language=native
-Integer namedetails = 0; // Integer | Include a list of alternative names in the results. These may include language variants, references, operator and brand.
-Integer extratags = 0; // Integer | Include additional information in the result if available, e.g. wikipedia link, opening hours.
-Integer statecode = 0; // Integer | Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0
-try {
- Location result = apiInstance.reverse(lat, lon, format, normalizecity, addressdetails, acceptLanguage, namedetails, extratags, statecode);
- System.out.println(result);
-} catch (ApiException e) {
- System.err.println("Exception when calling ReverseApi#reverse");
- e.printStackTrace();
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.auth.*;
+import com.locationiq.client.models.*;
+import com.locationiq.client.api.ReverseApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://eu1.locationiq.com/v1");
+
+ // Configure API key authorization: key
+ ApiKeyAuth key = (ApiKeyAuth) defaultClient.getAuthentication("key");
+ key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //key.setApiKeyPrefix("Token");
+
+ ReverseApi apiInstance = new ReverseApi(defaultClient);
+ BigDecimal lat = 40.7487727; // BigDecimal | Latitude of the location to generate an address for.
+ BigDecimal lon = -73.9849336; // BigDecimal | Longitude of the location to generate an address for.
+ String format = "json"; // String | Format to geocode. Only JSON supported for SDKs
+ Integer normalizecity = 1; // Integer | Normalizes village to city level data to city
+ Integer addressdetails = 1; // Integer | Include a breakdown of the address into elements. Defaults to 1.
+ String acceptLanguage = "en"; // String | Preferred language order for showing search results, overrides the value specified in the Accept-Language HTTP header. Defaults to en. To use native language for the response when available, use accept-language=native
+ Integer namedetails = 0; // Integer | Include a list of alternative names in the results. These may include language variants, references, operator and brand.
+ Integer extratags = 0; // Integer | Include additional information in the result if available, e.g. wikipedia link, opening hours.
+ Integer statecode = 0; // Integer | Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0
+ Integer showdistance = 0; // Integer | Returns the straight line distance (meters) between the input location and the result's location. Value is set in the distance key of the response. Defaults to 0 [0,1]
+ Integer postaladdress = 0; // Integer | Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1]
+ try {
+ Location result = apiInstance.reverse(lat, lon, format, normalizecity, addressdetails, acceptLanguage, namedetails, extratags, statecode, showdistance, postaladdress);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ReverseApi#reverse");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
}
```
@@ -64,6 +75,8 @@ Name | Type | Description | Notes
**namedetails** | **Integer**| Include a list of alternative names in the results. These may include language variants, references, operator and brand. | [optional] [enum: 0, 1]
**extratags** | **Integer**| Include additional information in the result if available, e.g. wikipedia link, opening hours. | [optional] [enum: 0, 1]
**statecode** | **Integer**| Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 | [optional] [enum: 0, 1]
+ **showdistance** | **Integer**| Returns the straight line distance (meters) between the input location and the result's location. Value is set in the distance key of the response. Defaults to 0 [0,1] | [optional]
+ **postaladdress** | **Integer**| Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] | [optional]
### Return type
@@ -78,3 +91,14 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | The request has been made from an unauthorized domain. | - |
+**404** | No location or places were found for the given input | - |
+**429** | Request exceeded the rate-limits set on your account | - |
+**500** | Internal Server Error | - |
+
diff --git a/docs/SearchApi.md b/docs/SearchApi.md
index 328e584..3f921b2 100644
--- a/docs/SearchApi.md
+++ b/docs/SearchApi.md
@@ -9,7 +9,7 @@ Method | HTTP request | Description
# **search**
-> List<Location> search(q, format, normalizecity, addressdetails, viewbox, bounded, limit, acceptLanguage, countrycodes, namedetails, dedupe, extratags, statecode)
+> List<Location> search(q, format, normalizecity, addressdetails, viewbox, bounded, limit, acceptLanguage, countrycodes, namedetails, dedupe, extratags, statecode, matchquality, postaladdress)
Forward Geocoding
@@ -18,40 +18,51 @@ The Search API allows converting addresses, such as a street address, into geogr
### Example
```java
// Import classes:
-//import LocationIq.ApiClient;
-//import LocationIq.ApiException;
-//import LocationIq.Configuration;
-//import LocationIq.auth.*;
-//import com.locationiq.client.api.SearchApi;
-
-ApiClient defaultClient = Configuration.getDefaultApiClient();
-
-// Configure API key authorization: key
-ApiKeyAuth key = (ApiKeyAuth) defaultClient.getAuthentication("key");
-key.setApiKey("YOUR API KEY");
-// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
-//key.setApiKeyPrefix("Token");
-
-SearchApi apiInstance = new SearchApi();
-String q = "Empire state building"; // String | Address to geocode
-String format = "json"; // String | Format to geocode. Only JSON supported for SDKs
-Integer normalizecity = 1; // Integer | For responses with no city value in the address section, the next available element in this order - city_district, locality, town, borough, municipality, village, hamlet, quarter, neighbourhood - from the address section will be normalized to city. Defaults to 1 for SDKs.
-Integer addressdetails = 1; // Integer | Include a breakdown of the address into elements. Defaults to 0.
-String viewbox = "-132.84908,47.69382,-70.44674,30.82531"; // String | The preferred area to find search results. To restrict results to those within the viewbox, use along with the bounded option. Tuple of 4 floats. Any two corner points of the box - `max_lon,max_lat,min_lon,min_lat` or `min_lon,min_lat,max_lon,max_lat` - are accepted in any order as long as they span a real box.
-Integer bounded = 1; // Integer | Restrict the results to only items contained with the viewbox
-Integer limit = 10; // Integer | Limit the number of returned results. Default is 10.
-String acceptLanguage = "en"; // String | Preferred language order for showing search results, overrides the value specified in the Accept-Language HTTP header. Defaults to en. To use native language for the response when available, use accept-language=native
-String countrycodes = "us"; // String | Limit search to a list of countries.
-Integer namedetails = 1; // Integer | Include a list of alternative names in the results. These may include language variants, references, operator and brand.
-Integer dedupe = 1; // Integer | Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split in many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match; this is controlled by the dedupe parameter which defaults to 1. Since the limit is, for reasons of efficiency, enforced before and not after de-duplicating, it is possible that de-duplicating leaves you with less results than requested.
-Integer extratags = 0; // Integer | Include additional information in the result if available, e.g. wikipedia link, opening hours.
-Integer statecode = 0; // Integer | Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0
-try {
- List result = apiInstance.search(q, format, normalizecity, addressdetails, viewbox, bounded, limit, acceptLanguage, countrycodes, namedetails, dedupe, extratags, statecode);
- System.out.println(result);
-} catch (ApiException e) {
- System.err.println("Exception when calling SearchApi#search");
- e.printStackTrace();
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.auth.*;
+import com.locationiq.client.models.*;
+import com.locationiq.client.api.SearchApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://eu1.locationiq.com/v1");
+
+ // Configure API key authorization: key
+ ApiKeyAuth key = (ApiKeyAuth) defaultClient.getAuthentication("key");
+ key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //key.setApiKeyPrefix("Token");
+
+ SearchApi apiInstance = new SearchApi(defaultClient);
+ String q = "Empire state building"; // String | Address to geocode
+ String format = "json"; // String | Format to geocode. Only JSON supported for SDKs
+ Integer normalizecity = 1; // Integer | For responses with no city value in the address section, the next available element in this order - city_district, locality, town, borough, municipality, village, hamlet, quarter, neighbourhood - from the address section will be normalized to city. Defaults to 1 for SDKs.
+ Integer addressdetails = 1; // Integer | Include a breakdown of the address into elements. Defaults to 0.
+ String viewbox = "-132.84908,47.69382,-70.44674,30.82531"; // String | The preferred area to find search results. To restrict results to those within the viewbox, use along with the bounded option. Tuple of 4 floats. Any two corner points of the box - `max_lon,max_lat,min_lon,min_lat` or `min_lon,min_lat,max_lon,max_lat` - are accepted in any order as long as they span a real box.
+ Integer bounded = 1; // Integer | Restrict the results to only items contained with the viewbox
+ Integer limit = 10; // Integer | Limit the number of returned results. Default is 10.
+ String acceptLanguage = "en"; // String | Preferred language order for showing search results, overrides the value specified in the Accept-Language HTTP header. Defaults to en. To use native language for the response when available, use accept-language=native
+ String countrycodes = "us"; // String | Limit search to a list of countries.
+ Integer namedetails = 1; // Integer | Include a list of alternative names in the results. These may include language variants, references, operator and brand.
+ Integer dedupe = 1; // Integer | Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split in many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match; this is controlled by the dedupe parameter which defaults to 1. Since the limit is, for reasons of efficiency, enforced before and not after de-duplicating, it is possible that de-duplicating leaves you with less results than requested.
+ Integer extratags = 0; // Integer | Include additional information in the result if available, e.g. wikipedia link, opening hours.
+ Integer statecode = 0; // Integer | Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0
+ Integer matchquality = 0; // Integer | Returns additional information about quality of the result in a matchquality object. Read more Defaults to 0 [0,1]
+ Integer postaladdress = 0; // Integer | Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1]
+ try {
+ List result = apiInstance.search(q, format, normalizecity, addressdetails, viewbox, bounded, limit, acceptLanguage, countrycodes, namedetails, dedupe, extratags, statecode, matchquality, postaladdress);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SearchApi#search");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
}
```
@@ -72,6 +83,8 @@ Name | Type | Description | Notes
**dedupe** | **Integer**| Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split in many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match; this is controlled by the dedupe parameter which defaults to 1. Since the limit is, for reasons of efficiency, enforced before and not after de-duplicating, it is possible that de-duplicating leaves you with less results than requested. | [optional] [enum: 0, 1]
**extratags** | **Integer**| Include additional information in the result if available, e.g. wikipedia link, opening hours. | [optional] [enum: 0, 1]
**statecode** | **Integer**| Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 | [optional] [enum: 0, 1]
+ **matchquality** | **Integer**| Returns additional information about quality of the result in a matchquality object. Read more Defaults to 0 [0,1] | [optional]
+ **postaladdress** | **Integer**| Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] | [optional]
### Return type
@@ -86,3 +99,14 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | The request has been made from an unauthorized domain. | - |
+**404** | No location or places were found for the given input | - |
+**429** | Request exceeded the rate-limits set on your account | - |
+**500** | Internal Server Error | - |
+
diff --git a/git_push.sh b/git_push.sh
index ba19ca2..7d55883 100644
--- a/git_push.sh
+++ b/git_push.sh
@@ -1,14 +1,20 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
-# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
+git_host=$4
+
+if [ "$git_host" = "" ]; then
+ git_host="github.com"
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
+fi
if [ "$git_user_id" = "" ]; then
- git_user_id="location-iq"
+ git_user_id="crystHopeunwired"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
@@ -28,7 +34,7 @@ git init
# Adds the files in the local repository and stages them for commit.
git add .
-# Commits the tracked changes and prepares them to be pushed to a remote repository.
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
@@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
- git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
- git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
@@ -47,6 +53,6 @@ fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
-echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
+echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 2c6137b..cc4fdc2 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index b7a3647..9492014 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
-#Tue May 17 23:08:05 CST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
diff --git a/gradlew b/gradlew
index 9d82f78..2fe81a7 100644
--- a/gradlew
+++ b/gradlew
@@ -1,4 +1,20 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
##############################################################################
##
@@ -6,20 +22,38 @@
##
##############################################################################
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
-warn ( ) {
+warn () {
echo "$*"
}
-die ( ) {
+die () {
echo
echo "$*"
echo
@@ -30,6 +64,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
+nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
@@ -40,26 +75,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
+ NONSTOP* )
+ nonstop=true
+ ;;
esac
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -85,7 +105,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -105,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
@@ -134,27 +154,30 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
- i=$((i+1))
+ i=`expr $i + 1`
done
case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
index 5f19212..9618d8d 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,3 +1,19 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@@ -8,14 +24,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
@@ -49,7 +65,6 @@ goto fail
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
@@ -60,11 +75,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
diff --git a/pom.xml b/pom.xml
index cf5c786..c5da65b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
locationiq-java-clientjarlocationiq-java-client
- 1.0.0
+ 2.0.0https://github.com/openapitools/openapi-generatorOpenAPI Java
@@ -24,9 +24,9 @@
- OpenAPI
+ OpenAPI-Generator Contributorsteam@openapitools.org
- OpenAPI
+ OpenAPITools.orghttp://openapitools.org
@@ -114,8 +114,7 @@
-
- src/main/java
+ src/main/java
@@ -127,8 +126,7 @@
-
- src/test/java
+ src/test/java
@@ -146,6 +144,15 @@
+
+
+
+ http.response.details
+ a
+ Http Response Details:
+
+
+ org.apache.maven.plugins
@@ -193,13 +200,19 @@
swagger-annotations${swagger-core-version}
+
- com.squareup.okhttp
+ com.google.code.findbugs
+ jsr305
+ 3.0.2
+
+
+ com.squareup.okhttp3okhttp${okhttp-version}
- com.squareup.okhttp
+ com.squareup.okhttp3logging-interceptor${okhttp-version}
@@ -213,11 +226,21 @@
gson-fire${gson-fire-version}
-
- org.threeten
- threetenbp
- ${threetenbp-version}
-
+
+ org.apache.commons
+ commons-lang3
+ ${commons-lang3-version}
+
+
+ org.threeten
+ threetenbp
+ ${threetenbp-version}
+
+
+ javax.annotation
+ jsr250-api
+ ${javax-annotation-version}
+ junit
@@ -230,13 +253,15 @@
1.7${java.version}${java.version}
- 1.8.0
- 1.5.18
- 2.7.5
- 2.8.1
- 1.3.5
+ 1.8.3
+ 1.5.22
+ 3.14.2
+ 2.8.5
+ 3.9
+ 1.4.01.0.0
- 4.12
+ 1.0
+ 4.13UTF-8
diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml
index 551d009..b2863db 100644
--- a/src/main/AndroidManifest.xml
+++ b/src/main/AndroidManifest.xml
@@ -1,3 +1,3 @@
-
+
diff --git a/src/main/java/LocationIq/auth/OAuth.java b/src/main/java/LocationIq/auth/OAuth.java
deleted file mode 100644
index a9367e1..0000000
--- a/src/main/java/LocationIq/auth/OAuth.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * LocationIQ
- * LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
- *
- * OpenAPI spec version: 1.0.1
- *
- *
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-
-
-package LocationIq.auth;
-
-import LocationIq.Pair;
-
-import java.util.Map;
-import java.util.List;
-
-
-public class OAuth implements Authentication {
- private String accessToken;
-
- public String getAccessToken() {
- return accessToken;
- }
-
- public void setAccessToken(String accessToken) {
- this.accessToken = accessToken;
- }
-
- @Override
- public void applyToParams(List queryParams, Map headerParams) {
- if (accessToken != null) {
- headerParams.put("Authorization", "Bearer " + accessToken);
- }
- }
-}
diff --git a/src/main/java/LocationIq/auth/OAuthFlow.java b/src/main/java/LocationIq/auth/OAuthFlow.java
deleted file mode 100644
index 01e5b8e..0000000
--- a/src/main/java/LocationIq/auth/OAuthFlow.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * LocationIQ
- * LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
- *
- * OpenAPI spec version: 1.0.1
- *
- *
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-
-
-package LocationIq.auth;
-
-public enum OAuthFlow {
- accessCode, implicit, password, application
-}
diff --git a/src/main/java/LocationIq/ApiCallback.java b/src/main/java/com/locationiq/client/ApiCallback.java
similarity index 96%
rename from src/main/java/LocationIq/ApiCallback.java
rename to src/main/java/com/locationiq/client/ApiCallback.java
index 8fd78a6..c449d6c 100644
--- a/src/main/java/LocationIq/ApiCallback.java
+++ b/src/main/java/com/locationiq/client/ApiCallback.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -11,7 +11,7 @@
*/
-package LocationIq;
+package com.locationiq.client;
import java.io.IOException;
diff --git a/src/main/java/LocationIq/ApiClient.java b/src/main/java/com/locationiq/client/ApiClient.java
similarity index 79%
rename from src/main/java/LocationIq/ApiClient.java
rename to src/main/java/com/locationiq/client/ApiClient.java
index 361793b..d0cd7aa 100644
--- a/src/main/java/LocationIq/ApiClient.java
+++ b/src/main/java/com/locationiq/client/ApiClient.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -11,12 +11,13 @@
*/
-package LocationIq;
+package com.locationiq.client;
-import com.squareup.okhttp.*;
-import com.squareup.okhttp.internal.http.HttpMethod;
-import com.squareup.okhttp.logging.HttpLoggingInterceptor;
-import com.squareup.okhttp.logging.HttpLoggingInterceptor.Level;
+import okhttp3.*;
+import okhttp3.internal.http.HttpMethod;
+import okhttp3.internal.tls.OkHostnameVerifier;
+import okhttp3.logging.HttpLoggingInterceptor;
+import okhttp3.logging.HttpLoggingInterceptor.Level;
import okio.BufferedSink;
import okio.Okio;
import org.threeten.bp.LocalDate;
@@ -45,16 +46,17 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import LocationIq.auth.Authentication;
-import LocationIq.auth.HttpBasicAuth;
-import LocationIq.auth.ApiKeyAuth;
-import LocationIq.auth.OAuth;
+import com.locationiq.client.auth.Authentication;
+import com.locationiq.client.auth.HttpBasicAuth;
+import com.locationiq.client.auth.HttpBearerAuth;
+import com.locationiq.client.auth.ApiKeyAuth;
public class ApiClient {
private String basePath = "https://eu1.locationiq.com/v1";
private boolean debugging = false;
private Map defaultHeaderMap = new HashMap();
+ private Map defaultCookieMap = new HashMap();
private String tempFolderPath = null;
private Map authentications;
@@ -74,10 +76,21 @@ public class ApiClient {
private HttpLoggingInterceptor loggingInterceptor;
/*
- * Constructor for ApiClient
+ * Basic constructor for ApiClient
*/
public ApiClient() {
- httpClient = new OkHttpClient();
+ init();
+
+ // Setup authentications (key: authentication name, value: authentication).
+ authentications.put("key", new ApiKeyAuth("query", "key"));
+ // Prevent the authentications from being modified.
+ authentications = Collections.unmodifiableMap(authentications);
+ }
+
+ private void init() {
+ OkHttpClient.Builder builder = new OkHttpClient.Builder();
+ builder.addNetworkInterceptor(getProgressInterceptor());
+ httpClient = builder.build();
verifyingSsl = true;
@@ -85,19 +98,15 @@ public ApiClient() {
json = new JSON();
// Set default User-Agent.
- setUserAgent("OpenAPI-Generator/1.0.1/java");
+ setUserAgent("OpenAPI-Generator/2.0.0/java");
- // Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap();
- authentications.put("key", new ApiKeyAuth("query", "key"));
- // Prevent the authentications from being modified.
- authentications = Collections.unmodifiableMap(authentications);
}
/**
* Get base path
*
- * @return Baes path
+ * @return Base path
*/
public String getBasePath() {
return basePath;
@@ -124,13 +133,14 @@ public OkHttpClient getHttpClient() {
}
/**
- * Set HTTP client
+ * Set HTTP client, which must never be null.
*
- * @param httpClient An instance of OkHttpClient
+ * @param newHttpClient An instance of OkHttpClient
* @return Api Client
+ * @throws NullPointerException when newHttpClient is null
*/
- public ApiClient setHttpClient(OkHttpClient httpClient) {
- this.httpClient = httpClient;
+ public ApiClient setHttpClient(OkHttpClient newHttpClient) {
+ this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!");
return this;
}
@@ -330,12 +340,6 @@ public void setApiKeyPrefix(String apiKeyPrefix) {
* @param accessToken Access token
*/
public void setAccessToken(String accessToken) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof OAuth) {
- ((OAuth) auth).setAccessToken(accessToken);
- return;
- }
- }
throw new RuntimeException("No OAuth2 authentication configured!");
}
@@ -362,6 +366,18 @@ public ApiClient addDefaultHeader(String key, String value) {
return this;
}
+ /**
+ * Add a default cookie.
+ *
+ * @param key The cookie's key
+ * @param value The cookie's value
+ * @return ApiClient
+ */
+ public ApiClient addDefaultCookie(String key, String value) {
+ defaultCookieMap.put(key, value);
+ return this;
+ }
+
/**
* Check that whether debugging is enabled for this API client.
*
@@ -382,7 +398,7 @@ public ApiClient setDebugging(boolean debugging) {
if (debugging) {
loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel(Level.BODY);
- httpClient.interceptors().add(loggingInterceptor);
+ httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build();
} else {
httpClient.interceptors().remove(loggingInterceptor);
loggingInterceptor = null;
@@ -421,7 +437,7 @@ public ApiClient setTempFolderPath(String tempFolderPath) {
* @return Timeout in milliseconds
*/
public int getConnectTimeout() {
- return httpClient.getConnectTimeout();
+ return httpClient.connectTimeoutMillis();
}
/**
@@ -433,7 +449,7 @@ public int getConnectTimeout() {
* @return Api client
*/
public ApiClient setConnectTimeout(int connectionTimeout) {
- httpClient.setConnectTimeout(connectionTimeout, TimeUnit.MILLISECONDS);
+ httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build();
return this;
}
@@ -443,7 +459,7 @@ public ApiClient setConnectTimeout(int connectionTimeout) {
* @return Timeout in milliseconds
*/
public int getReadTimeout() {
- return httpClient.getReadTimeout();
+ return httpClient.readTimeoutMillis();
}
/**
@@ -455,7 +471,7 @@ public int getReadTimeout() {
* @return Api client
*/
public ApiClient setReadTimeout(int readTimeout) {
- httpClient.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS);
+ httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build();
return this;
}
@@ -465,7 +481,7 @@ public ApiClient setReadTimeout(int readTimeout) {
* @return Timeout in milliseconds
*/
public int getWriteTimeout() {
- return httpClient.getWriteTimeout();
+ return httpClient.writeTimeoutMillis();
}
/**
@@ -477,10 +493,11 @@ public int getWriteTimeout() {
* @return Api client
*/
public ApiClient setWriteTimeout(int writeTimeout) {
- httpClient.setWriteTimeout(writeTimeout, TimeUnit.MILLISECONDS);
+ httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build();
return this;
}
+
/**
* Format the given parameter object into string.
*
@@ -496,7 +513,7 @@ public String parameterToString(Object param) {
return jsonStr.substring(1, jsonStr.length() - 1);
} else if (param instanceof Collection) {
StringBuilder b = new StringBuilder();
- for (Object o : (Collection)param) {
+ for (Object o : (Collection) param) {
if (b.length() > 0) {
b.append(",");
}
@@ -521,7 +538,9 @@ public List parameterToPair(String name, Object value) {
List params = new ArrayList();
// preconditions
- if (name == null || name.isEmpty() || value == null || value instanceof Collection) return params;
+ if (name == null || name.isEmpty() || value == null || value instanceof Collection) {
+ return params;
+ }
params.add(new Pair(name, parameterToString(value)));
return params;
@@ -566,7 +585,7 @@ public List parameterToPairs(String collectionFormat, String name, Collect
delimiter = escapeString("|");
}
- StringBuilder sb = new StringBuilder() ;
+ StringBuilder sb = new StringBuilder();
for (Object item : value) {
sb.append(delimiter);
sb.append(escapeString(parameterToString(item)));
@@ -577,6 +596,40 @@ public List parameterToPairs(String collectionFormat, String name, Collect
return params;
}
+ /**
+ * Formats the specified collection path parameter to a string value.
+ *
+ * @param collectionFormat The collection format of the parameter.
+ * @param value The value of the parameter.
+ * @return String representation of the parameter
+ */
+ public String collectionPathParameterToString(String collectionFormat, Collection value) {
+ // create the value based on the collection format
+ if ("multi".equals(collectionFormat)) {
+ // not valid for path params
+ return parameterToString(value);
+ }
+
+ // collectionFormat is assumed to be "csv" by default
+ String delimiter = ",";
+
+ if ("ssv".equals(collectionFormat)) {
+ delimiter = " ";
+ } else if ("tsv".equals(collectionFormat)) {
+ delimiter = "\t";
+ } else if ("pipes".equals(collectionFormat)) {
+ delimiter = "|";
+ }
+
+ StringBuilder sb = new StringBuilder() ;
+ for (Object item : value) {
+ sb.append(delimiter);
+ sb.append(parameterToString(item));
+ }
+
+ return sb.substring(delimiter.length());
+ }
+
/**
* Sanitize filename by removing path.
* e.g. ../../sun.gif becomes sun.gif
@@ -600,8 +653,8 @@ public String sanitizeFilename(String filename) {
* @return True if the given MIME is JSON, false otherwise.
*/
public boolean isJsonMime(String mime) {
- String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
- return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
+ String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
+ return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
}
/**
@@ -636,7 +689,7 @@ public String selectHeaderAccept(String[] accepts) {
*/
public String selectHeaderContentType(String[] contentTypes) {
if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) {
- return "application/json";
+ return "application/json";
}
for (String contentType : contentTypes) {
if (isJsonMime(contentType)) {
@@ -774,8 +827,8 @@ public File downloadFileFromResponse(Response response) throws ApiException {
* Prepare file for download
*
* @param response An instance of the Response object
- * @throws IOException If fail to prepare file for download
* @return Prepared file for the download
+ * @throws IOException If fail to prepare file for download
*/
public File prepareDownloadFile(Response response) throws IOException {
String filename = null;
@@ -818,8 +871,8 @@ public File prepareDownloadFile(Response response) throws IOException {
*
* @param Type
* @param call An instance of the Call object
- * @throws ApiException If fail to execute the call
* @return ApiResponse<T>
+ * @throws ApiException If fail to execute the call
*/
public ApiResponse execute(Call call) throws ApiException {
return execute(call, null);
@@ -860,22 +913,22 @@ public void executeAsync(Call call, ApiCallback callback) {
/**
* Execute HTTP call asynchronously.
*
- * @see #execute(Call, Type)
* @param Type
* @param call The callback to be executed when the API call finishes
* @param returnType Return type
* @param callback ApiCallback
+ * @see #execute(Call, Type)
*/
@SuppressWarnings("unchecked")
public void executeAsync(Call call, final Type returnType, final ApiCallback callback) {
call.enqueue(new Callback() {
@Override
- public void onFailure(Request request, IOException e) {
+ public void onFailure(Call call, IOException e) {
callback.onFailure(new ApiException(e), 0, null);
}
@Override
- public void onResponse(Response response) throws IOException {
+ public void onResponse(Call call, Response response) throws IOException {
T result;
try {
result = (T) handleResponse(response, returnType);
@@ -894,9 +947,9 @@ public void onResponse(Response response) throws IOException {
* @param Type
* @param response Response
* @param returnType Return type
- * @throws ApiException If the response has an unsuccessful status code or
- * fail to deserialize the response body
* @return Type
+ * @throws ApiException If the response has an unsuccessful status code or
+ * fail to deserialize the response body
*/
public T handleResponse(Response response, Type returnType) throws ApiException {
if (response.isSuccessful()) {
@@ -906,7 +959,7 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept
if (response.body() != null) {
try {
response.body().close();
- } catch (IOException e) {
+ } catch (Exception e) {
throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap());
}
}
@@ -936,14 +989,15 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept
* @param collectionQueryParams The collection query parameters
* @param body The request body object
* @param headerParams The header parameters
+ * @param cookieParams The cookie parameters
* @param formParams The form parameters
* @param authNames The authentications to apply
- * @param progressRequestListener Progress request listener
+ * @param callback Callback for upload/download progress
* @return The HTTP call
* @throws ApiException If fail to serialize the request body object
*/
- public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, formParams, authNames, progressRequestListener);
+ public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException {
+ Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback);
return httpClient.newCall(request);
}
@@ -957,18 +1011,20 @@ public Call buildCall(String path, String method, List queryParams, List
queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- updateParamsForAuth(authNames, queryParams, headerParams);
+ public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException {
+ updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
final String url = buildUrl(path, queryParams, collectionQueryParams);
final Request.Builder reqBuilder = new Request.Builder().url(url);
processHeaderParams(headerParams, reqBuilder);
+ processCookieParams(cookieParams, reqBuilder);
String contentType = (String) headerParams.get("Content-Type");
// ensuring a default content type
@@ -995,10 +1051,14 @@ public Request buildRequest(String path, String method, List queryParams,
reqBody = serialize(body, contentType);
}
+ // Associate callback with request (if not null) so interceptor can
+ // access it when creating ProgressResponseBody
+ reqBuilder.tag(callback);
+
Request request = null;
- if(progressRequestListener != null && reqBody != null) {
- ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, progressRequestListener);
+ if (callback != null && reqBody != null) {
+ ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback);
request = reqBuilder.method(method, progressRequestBody).build();
} else {
request = reqBuilder.method(method, reqBody).build();
@@ -1059,8 +1119,8 @@ public String buildUrl(String path, List queryParams, List collectio
/**
* Set header parameters to the request builder, including default headers.
*
- * @param headerParams Header parameters in the ofrm of Map
- * @param reqBuilder Reqeust.Builder
+ * @param headerParams Header parameters in the form of Map
+ * @param reqBuilder Request.Builder
*/
public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) {
for (Entry param : headerParams.entrySet()) {
@@ -1073,18 +1133,38 @@ public void processHeaderParams(Map headerParams, Request.Builde
}
}
+ /**
+ * Set cookie parameters to the request builder, including default cookies.
+ *
+ * @param cookieParams Cookie parameters in the form of Map
+ * @param reqBuilder Request.Builder
+ */
+ public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) {
+ for (Entry param : cookieParams.entrySet()) {
+ reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue()));
+ }
+ for (Entry param : defaultCookieMap.entrySet()) {
+ if (!cookieParams.containsKey(param.getKey())) {
+ reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue()));
+ }
+ }
+ }
+
/**
* Update query and header parameters based on authentication settings.
*
* @param authNames The authentications to apply
- * @param queryParams List of query parameters
- * @param headerParams Map of header parameters
+ * @param queryParams List of query parameters
+ * @param headerParams Map of header parameters
+ * @param cookieParams Map of cookie parameters
*/
- public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams) {
+ public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) {
for (String authName : authNames) {
Authentication auth = authentications.get(authName);
- if (auth == null) throw new RuntimeException("Authentication undefined: " + authName);
- auth.applyToParams(queryParams, headerParams);
+ if (auth == null) {
+ throw new RuntimeException("Authentication undefined: " + authName);
+ }
+ auth.applyToParams(queryParams, headerParams, cookieParams);
}
}
@@ -1095,7 +1175,7 @@ public void updateParamsForAuth(String[] authNames, List queryParams, Map<
* @return RequestBody
*/
public RequestBody buildRequestBodyFormEncoding(Map formParams) {
- FormEncodingBuilder formBuilder = new FormEncodingBuilder();
+ okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder();
for (Entry param : formParams.entrySet()) {
formBuilder.add(param.getKey(), parameterToString(param.getValue()));
}
@@ -1110,7 +1190,7 @@ public RequestBody buildRequestBodyFormEncoding(Map formParams)
* @return RequestBody
*/
public RequestBody buildRequestBodyMultipart(Map formParams) {
- MultipartBuilder mpBuilder = new MultipartBuilder().type(MultipartBuilder.FORM);
+ MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM);
for (Entry param : formParams.entrySet()) {
if (param.getValue() instanceof File) {
File file = (File) param.getValue();
@@ -1140,55 +1220,88 @@ public String guessContentTypeFromFile(File file) {
}
}
+ /**
+ * Get network interceptor to add it to the httpClient to track download progress for
+ * async requests.
+ */
+ private Interceptor getProgressInterceptor() {
+ return new Interceptor() {
+ @Override
+ public Response intercept(Interceptor.Chain chain) throws IOException {
+ final Request request = chain.request();
+ final Response originalResponse = chain.proceed(request);
+ if (request.tag() instanceof ApiCallback) {
+ final ApiCallback callback = (ApiCallback) request.tag();
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), callback))
+ .build();
+ }
+ return originalResponse;
+ }
+ };
+ }
+
/**
* Apply SSL related settings to httpClient according to the current values of
* verifyingSsl and sslCaCert.
*/
private void applySslSettings() {
try {
- TrustManager[] trustManagers = null;
- HostnameVerifier hostnameVerifier = null;
+ TrustManager[] trustManagers;
+ HostnameVerifier hostnameVerifier;
if (!verifyingSsl) {
- TrustManager trustAll = new X509TrustManager() {
- @Override
- public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {}
- @Override
- public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {}
- @Override
- public X509Certificate[] getAcceptedIssuers() { return null; }
+ trustManagers = new TrustManager[]{
+ new X509TrustManager() {
+ @Override
+ public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
+ }
+
+ @Override
+ public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
+ }
+
+ @Override
+ public java.security.cert.X509Certificate[] getAcceptedIssuers() {
+ return new java.security.cert.X509Certificate[]{};
+ }
+ }
};
- SSLContext sslContext = SSLContext.getInstance("TLS");
- trustManagers = new TrustManager[]{ trustAll };
hostnameVerifier = new HostnameVerifier() {
@Override
- public boolean verify(String hostname, SSLSession session) { return true; }
+ public boolean verify(String hostname, SSLSession session) {
+ return true;
+ }
};
- } else if (sslCaCert != null) {
- char[] password = null; // Any password will work.
- CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
- Collection extends Certificate> certificates = certificateFactory.generateCertificates(sslCaCert);
- if (certificates.isEmpty()) {
- throw new IllegalArgumentException("expected non-empty set of trusted certificates");
- }
- KeyStore caKeyStore = newEmptyKeyStore(password);
- int index = 0;
- for (Certificate certificate : certificates) {
- String certificateAlias = "ca" + Integer.toString(index++);
- caKeyStore.setCertificateEntry(certificateAlias, certificate);
- }
+ } else {
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
- trustManagerFactory.init(caKeyStore);
+
+ if (sslCaCert == null) {
+ trustManagerFactory.init((KeyStore) null);
+ } else {
+ char[] password = null; // Any password will work.
+ CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
+ Collection extends Certificate> certificates = certificateFactory.generateCertificates(sslCaCert);
+ if (certificates.isEmpty()) {
+ throw new IllegalArgumentException("expected non-empty set of trusted certificates");
+ }
+ KeyStore caKeyStore = newEmptyKeyStore(password);
+ int index = 0;
+ for (Certificate certificate : certificates) {
+ String certificateAlias = "ca" + Integer.toString(index++);
+ caKeyStore.setCertificateEntry(certificateAlias, certificate);
+ }
+ trustManagerFactory.init(caKeyStore);
+ }
trustManagers = trustManagerFactory.getTrustManagers();
+ hostnameVerifier = OkHostnameVerifier.INSTANCE;
}
- if (keyManagers != null || trustManagers != null) {
- SSLContext sslContext = SSLContext.getInstance("TLS");
- sslContext.init(keyManagers, trustManagers, new SecureRandom());
- httpClient.setSslSocketFactory(sslContext.getSocketFactory());
- } else {
- httpClient.setSslSocketFactory(null);
- }
- httpClient.setHostnameVerifier(hostnameVerifier);
+ SSLContext sslContext = SSLContext.getInstance("TLS");
+ sslContext.init(keyManagers, trustManagers, new SecureRandom());
+ httpClient = httpClient.newBuilder()
+ .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0])
+ .hostnameVerifier(hostnameVerifier)
+ .build();
} catch (GeneralSecurityException e) {
throw new RuntimeException(e);
}
diff --git a/src/main/java/LocationIq/ApiException.java b/src/main/java/com/locationiq/client/ApiException.java
similarity index 92%
rename from src/main/java/LocationIq/ApiException.java
rename to src/main/java/com/locationiq/client/ApiException.java
index 62259b2..782985a 100644
--- a/src/main/java/LocationIq/ApiException.java
+++ b/src/main/java/com/locationiq/client/ApiException.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -11,12 +11,12 @@
*/
-package LocationIq;
+package com.locationiq.client;
import java.util.Map;
import java.util.List;
-
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-02-14T16:06:31.759327+05:30[Asia/Kolkata]")
public class ApiException extends Exception {
private int code = 0;
private Map> responseHeaders = null;
diff --git a/src/main/java/LocationIq/ApiResponse.java b/src/main/java/com/locationiq/client/ApiResponse.java
similarity index 95%
rename from src/main/java/LocationIq/ApiResponse.java
rename to src/main/java/com/locationiq/client/ApiResponse.java
index eca961a..9c757ff 100644
--- a/src/main/java/LocationIq/ApiResponse.java
+++ b/src/main/java/com/locationiq/client/ApiResponse.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -11,7 +11,7 @@
*/
-package LocationIq;
+package com.locationiq.client;
import java.util.List;
import java.util.Map;
diff --git a/src/main/java/LocationIq/Configuration.java b/src/main/java/com/locationiq/client/Configuration.java
similarity index 83%
rename from src/main/java/LocationIq/Configuration.java
rename to src/main/java/com/locationiq/client/Configuration.java
index 7d26f69..f600dca 100644
--- a/src/main/java/LocationIq/Configuration.java
+++ b/src/main/java/com/locationiq/client/Configuration.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -11,9 +11,9 @@
*/
-package LocationIq;
-
+package com.locationiq.client;
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-02-14T16:06:31.759327+05:30[Asia/Kolkata]")
public class Configuration {
private static ApiClient defaultApiClient = new ApiClient();
diff --git a/src/main/java/LocationIq/GzipRequestInterceptor.java b/src/main/java/com/locationiq/client/GzipRequestInterceptor.java
similarity index 85%
rename from src/main/java/LocationIq/GzipRequestInterceptor.java
rename to src/main/java/com/locationiq/client/GzipRequestInterceptor.java
index 0a507cb..e2ed1f2 100644
--- a/src/main/java/LocationIq/GzipRequestInterceptor.java
+++ b/src/main/java/com/locationiq/client/GzipRequestInterceptor.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -11,9 +11,9 @@
*/
-package LocationIq;
+package com.locationiq.client;
-import com.squareup.okhttp.*;
+import okhttp3.*;
import okio.Buffer;
import okio.BufferedSink;
import okio.GzipSink;
@@ -27,7 +27,8 @@
* Taken from https://github.com/square/okhttp/issues/350
*/
class GzipRequestInterceptor implements Interceptor {
- @Override public Response intercept(Chain chain) throws IOException {
+ @Override
+ public Response intercept(Chain chain) throws IOException {
Request originalRequest = chain.request();
if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) {
return chain.proceed(originalRequest);
@@ -63,19 +64,22 @@ public void writeTo(BufferedSink sink) throws IOException {
private RequestBody gzip(final RequestBody body) {
return new RequestBody() {
- @Override public MediaType contentType() {
+ @Override
+ public MediaType contentType() {
return body.contentType();
}
- @Override public long contentLength() {
+ @Override
+ public long contentLength() {
return -1; // We don't know the compressed length in advance!
}
- @Override public void writeTo(BufferedSink sink) throws IOException {
+ @Override
+ public void writeTo(BufferedSink sink) throws IOException {
BufferedSink gzipSink = Okio.buffer(new GzipSink(sink));
body.writeTo(gzipSink);
gzipSink.close();
}
};
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/LocationIq/JSON.java b/src/main/java/com/locationiq/client/JSON.java
similarity index 97%
rename from src/main/java/LocationIq/JSON.java
rename to src/main/java/com/locationiq/client/JSON.java
index 74b3a12..41decd4 100644
--- a/src/main/java/LocationIq/JSON.java
+++ b/src/main/java/com/locationiq/client/JSON.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -11,7 +11,7 @@
*/
-package LocationIq;
+package com.locationiq.client;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -52,7 +52,6 @@ public class JSON {
public static GsonBuilder createGson() {
GsonFireBuilder fireBuilder = new GsonFireBuilder()
-
;
GsonBuilder builder = fireBuilder.createGsonBuilder();
return builder;
@@ -60,7 +59,7 @@ public static GsonBuilder createGson() {
private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) {
JsonElement element = readElement.getAsJsonObject().get(discriminatorField);
- if(null == element) {
+ if (null == element) {
throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">");
}
return element.getAsString();
@@ -68,7 +67,7 @@ private static String getDiscriminatorValue(JsonElement readElement, String disc
private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase(Locale.ROOT));
- if(null == clazz) {
+ if (null == clazz) {
throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
}
return clazz;
@@ -141,9 +140,11 @@ public T deserialize(String body, Type returnType) {
} catch (JsonParseException e) {
// Fallback processing when failed to parse JSON form response body:
// return the response body string directly for the String return type;
- if (returnType.equals(String.class))
+ if (returnType.equals(String.class)) {
return (T) body;
- else throw (e);
+ } else {
+ throw (e);
+ }
}
}
@@ -279,8 +280,7 @@ public static class SqlDateTypeAdapter extends TypeAdapter {
private DateFormat dateFormat;
- public SqlDateTypeAdapter() {
- }
+ public SqlDateTypeAdapter() {}
public SqlDateTypeAdapter(DateFormat dateFormat) {
this.dateFormat = dateFormat;
@@ -333,8 +333,7 @@ public static class DateTypeAdapter extends TypeAdapter {
private DateFormat dateFormat;
- public DateTypeAdapter() {
- }
+ public DateTypeAdapter() {}
public DateTypeAdapter(DateFormat dateFormat) {
this.dateFormat = dateFormat;
diff --git a/src/main/java/LocationIq/Pair.java b/src/main/java/com/locationiq/client/Pair.java
similarity index 67%
rename from src/main/java/LocationIq/Pair.java
rename to src/main/java/com/locationiq/client/Pair.java
index 8b87ef1..667c62d 100644
--- a/src/main/java/LocationIq/Pair.java
+++ b/src/main/java/com/locationiq/client/Pair.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -11,9 +11,9 @@
*/
-package LocationIq;
-
+package com.locationiq.client;
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-02-14T16:06:31.759327+05:30[Asia/Kolkata]")
public class Pair {
private String name = "";
private String value = "";
@@ -24,13 +24,17 @@ public Pair (String name, String value) {
}
private void setName(String name) {
- if (!isValidString(name)) return;
+ if (!isValidString(name)) {
+ return;
+ }
this.name = name;
}
private void setValue(String value) {
- if (!isValidString(value)) return;
+ if (!isValidString(value)) {
+ return;
+ }
this.value = value;
}
@@ -44,8 +48,13 @@ public String getValue() {
}
private boolean isValidString(String arg) {
- if (arg == null) return false;
- if (arg.trim().isEmpty()) return false;
+ if (arg == null) {
+ return false;
+ }
+
+ if (arg.trim().isEmpty()) {
+ return false;
+ }
return true;
}
diff --git a/src/main/java/LocationIq/ProgressRequestBody.java b/src/main/java/com/locationiq/client/ProgressRequestBody.java
similarity index 74%
rename from src/main/java/LocationIq/ProgressRequestBody.java
rename to src/main/java/com/locationiq/client/ProgressRequestBody.java
index 7e77f2f..c4900fc 100644
--- a/src/main/java/LocationIq/ProgressRequestBody.java
+++ b/src/main/java/com/locationiq/client/ProgressRequestBody.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -11,10 +11,10 @@
*/
-package LocationIq;
+package com.locationiq.client;
-import com.squareup.okhttp.MediaType;
-import com.squareup.okhttp.RequestBody;
+import okhttp3.MediaType;
+import okhttp3.RequestBody;
import java.io.IOException;
@@ -26,17 +26,13 @@
public class ProgressRequestBody extends RequestBody {
- public interface ProgressRequestListener {
- void onRequestProgress(long bytesWritten, long contentLength, boolean done);
- }
-
private final RequestBody requestBody;
- private final ProgressRequestListener progressListener;
+ private final ApiCallback callback;
- public ProgressRequestBody(RequestBody requestBody, ProgressRequestListener progressListener) {
+ public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) {
this.requestBody = requestBody;
- this.progressListener = progressListener;
+ this.callback = callback;
}
@Override
@@ -70,7 +66,7 @@ public void write(Buffer source, long byteCount) throws IOException {
}
bytesWritten += byteCount;
- progressListener.onRequestProgress(bytesWritten, contentLength, bytesWritten == contentLength);
+ callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength);
}
};
}
diff --git a/src/main/java/LocationIq/ProgressResponseBody.java b/src/main/java/com/locationiq/client/ProgressResponseBody.java
similarity index 71%
rename from src/main/java/LocationIq/ProgressResponseBody.java
rename to src/main/java/com/locationiq/client/ProgressResponseBody.java
index d82f719..a362d44 100644
--- a/src/main/java/LocationIq/ProgressResponseBody.java
+++ b/src/main/java/com/locationiq/client/ProgressResponseBody.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -11,10 +11,10 @@
*/
-package LocationIq;
+package com.locationiq.client;
-import com.squareup.okhttp.MediaType;
-import com.squareup.okhttp.ResponseBody;
+import okhttp3.MediaType;
+import okhttp3.ResponseBody;
import java.io.IOException;
@@ -26,17 +26,13 @@
public class ProgressResponseBody extends ResponseBody {
- public interface ProgressListener {
- void update(long bytesRead, long contentLength, boolean done);
- }
-
private final ResponseBody responseBody;
- private final ProgressListener progressListener;
+ private final ApiCallback callback;
private BufferedSource bufferedSource;
- public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) {
+ public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) {
this.responseBody = responseBody;
- this.progressListener = progressListener;
+ this.callback = callback;
}
@Override
@@ -45,12 +41,12 @@ public MediaType contentType() {
}
@Override
- public long contentLength() throws IOException {
+ public long contentLength() {
return responseBody.contentLength();
}
@Override
- public BufferedSource source() throws IOException {
+ public BufferedSource source() {
if (bufferedSource == null) {
bufferedSource = Okio.buffer(source(responseBody.source()));
}
@@ -66,7 +62,7 @@ public long read(Buffer sink, long byteCount) throws IOException {
long bytesRead = super.read(sink, byteCount);
// read() returns the number of bytes read, or -1 if this source is exhausted.
totalBytesRead += bytesRead != -1 ? bytesRead : 0;
- progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
+ callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
return bytesRead;
}
};
diff --git a/src/main/java/LocationIq/StringUtil.java b/src/main/java/com/locationiq/client/StringUtil.java
similarity index 77%
rename from src/main/java/LocationIq/StringUtil.java
rename to src/main/java/com/locationiq/client/StringUtil.java
index 718d597..df78744 100644
--- a/src/main/java/LocationIq/StringUtil.java
+++ b/src/main/java/com/locationiq/client/StringUtil.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -11,9 +11,9 @@
*/
-package LocationIq;
-
+package com.locationiq.client;
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-02-14T16:06:31.759327+05:30[Asia/Kolkata]")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
@@ -24,8 +24,12 @@ public class StringUtil {
*/
public static boolean containsIgnoreCase(String[] array, String value) {
for (String str : array) {
- if (value == null && str == null) return true;
- if (value != null && value.equalsIgnoreCase(str)) return true;
+ if (value == null && str == null) {
+ return true;
+ }
+ if (value != null && value.equalsIgnoreCase(str)) {
+ return true;
+ }
}
return false;
}
@@ -43,7 +47,9 @@ public static boolean containsIgnoreCase(String[] array, String value) {
*/
public static String join(String[] array, String separator) {
int len = array.length;
- if (len == 0) return "";
+ if (len == 0) {
+ return "";
+ }
StringBuilder out = new StringBuilder();
out.append(array[0]);
diff --git a/src/main/java/com/locationiq/client/api/BalanceApi.java b/src/main/java/com/locationiq/client/api/BalanceApi.java
index fe8823d..9f2e988 100644
--- a/src/main/java/com/locationiq/client/api/BalanceApi.java
+++ b/src/main/java/com/locationiq/client/api/BalanceApi.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -13,14 +13,14 @@
package com.locationiq.client.api;
-import LocationIq.ApiCallback;
-import LocationIq.ApiClient;
-import LocationIq.ApiException;
-import LocationIq.ApiResponse;
-import LocationIq.Configuration;
-import LocationIq.Pair;
-import LocationIq.ProgressRequestBody;
-import LocationIq.ProgressResponseBody;
+import com.locationiq.client.ApiCallback;
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.ApiResponse;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.Pair;
+import com.locationiq.client.ProgressRequestBody;
+import com.locationiq.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
@@ -37,78 +37,76 @@
import java.util.Map;
public class BalanceApi {
- private ApiClient apiClient;
+ private ApiClient localVarApiClient;
public BalanceApi() {
this(Configuration.getDefaultApiClient());
}
public BalanceApi(ApiClient apiClient) {
- this.apiClient = apiClient;
+ this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
- return apiClient;
+ return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
- this.apiClient = apiClient;
+ this.localVarApiClient = apiClient;
}
/**
* Build call for balance
- * @param progressListener Progress listener
- * @param progressRequestListener Progress request listener
+ * @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
*/
- public com.squareup.okhttp.Call balanceCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = new Object();
+ public okhttp3.Call balanceCall(final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/balance.php";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
-
Map localVarHeaderParams = new HashMap();
-
+ Map localVarCookieParams = 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 localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
final String[] localVarContentTypes = {
};
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ final String localVarContentType = localVarApiClient.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[] { "key" };
- return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
- private com.squareup.okhttp.Call balanceValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ private okhttp3.Call balanceValidateBeforeCall(final ApiCallback _callback) throws ApiException {
- com.squareup.okhttp.Call call = balanceCall(progressListener, progressRequestListener);
- return call;
+ okhttp3.Call localVarCall = balanceCall(_callback);
+ return localVarCall;
}
@@ -117,10 +115,21 @@ private com.squareup.okhttp.Call balanceValidateBeforeCall(final ProgressRespons
* The Balance API provides a count of request credits left in the user's account for the day. Balance is reset at midnight UTC everyday (00:00 UTC).
* @return Balance
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
*/
public Balance balance() throws ApiException {
- ApiResponse resp = balanceWithHttpInfo();
- return resp.getData();
+ ApiResponse localVarResp = balanceWithHttpInfo();
+ return localVarResp.getData();
}
/**
@@ -128,44 +137,47 @@ public Balance balance() throws ApiException {
* The Balance API provides a count of request credits left in the user's account for the day. Balance is reset at midnight UTC everyday (00:00 UTC).
* @return ApiResponse<Balance>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
*/
public ApiResponse balanceWithHttpInfo() throws ApiException {
- com.squareup.okhttp.Call call = balanceValidateBeforeCall(null, null);
+ okhttp3.Call localVarCall = balanceValidateBeforeCall(null);
Type localVarReturnType = new TypeToken(){}.getType();
- return apiClient.execute(call, localVarReturnType);
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* The Balance API provides a count of request credits left in the user's account for the day. Balance is reset at midnight UTC everyday (00:00 UTC).
- * @param callback The callback to be executed when the API call finishes
+ * @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
*/
- public com.squareup.okhttp.Call balanceAsync(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);
- }
- };
- }
+ public okhttp3.Call balanceAsync(final ApiCallback _callback) throws ApiException {
- com.squareup.okhttp.Call call = balanceValidateBeforeCall(progressListener, progressRequestListener);
+ okhttp3.Call localVarCall = balanceValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken(){}.getType();
- apiClient.executeAsync(call, localVarReturnType, callback);
- return call;
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
}
}
diff --git a/src/main/java/com/locationiq/client/api/DirectionsApi.java b/src/main/java/com/locationiq/client/api/DirectionsApi.java
new file mode 100644
index 0000000..50930cb
--- /dev/null
+++ b/src/main/java/com/locationiq/client/api/DirectionsApi.java
@@ -0,0 +1,282 @@
+/*
+ * LocationIQ
+ * LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
+ *
+ * The version of the OpenAPI document: 2.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.locationiq.client.api;
+
+import com.locationiq.client.ApiCallback;
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.ApiResponse;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.Pair;
+import com.locationiq.client.ProgressRequestBody;
+import com.locationiq.client.ProgressResponseBody;
+
+import com.google.gson.reflect.TypeToken;
+
+import java.io.IOException;
+
+
+import java.math.BigDecimal;
+import com.locationiq.client.model.DirectionsDirections;
+import com.locationiq.client.model.Error;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class DirectionsApi {
+ private ApiClient localVarApiClient;
+
+ public DirectionsApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public DirectionsApi(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return localVarApiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ /**
+ * Build call for directions
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param alternatives Search for alternative routes. Passing a number alternatives=n searches for up to n alternative routes. [ true, false (default), or Number ] (optional)
+ * @param steps Returned route steps for each route leg [ true, false (default) ] (optional)
+ * @param annotations Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional, default to "\"false\"")
+ * @param geometries Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] (optional, default to "\"polyline\"")
+ * @param overview Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] (optional, default to "\"simplified\"")
+ * @param continueStraight Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile [ default (default), true, false ] (optional, default to "\"default\"")
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public okhttp3.Call directionsCall(String coordinates, String bearings, String radiuses, String generateHints, String approaches, String exclude, BigDecimal alternatives, String steps, String annotations, String geometries, String overview, String continueStraight, final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/directions/driving/{coordinates}"
+ .replaceAll("\\{" + "coordinates" + "\\}", localVarApiClient.escapeString(coordinates.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ if (bearings != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("bearings", bearings));
+ }
+
+ if (radiuses != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("radiuses", radiuses));
+ }
+
+ if (generateHints != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("generate_hints", generateHints));
+ }
+
+ if (approaches != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("approaches", approaches));
+ }
+
+ if (exclude != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("exclude", exclude));
+ }
+
+ if (alternatives != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("alternatives", alternatives));
+ }
+
+ if (steps != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("steps", steps));
+ }
+
+ if (annotations != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("annotations", annotations));
+ }
+
+ if (geometries != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("geometries", geometries));
+ }
+
+ if (overview != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("overview", overview));
+ }
+
+ if (continueStraight != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("continue_straight", continueStraight));
+ }
+
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String[] localVarAuthNames = new String[] { "key" };
+ return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call directionsValidateBeforeCall(String coordinates, String bearings, String radiuses, String generateHints, String approaches, String exclude, BigDecimal alternatives, String steps, String annotations, String geometries, String overview, String continueStraight, final ApiCallback _callback) throws ApiException {
+
+ // verify the required parameter 'coordinates' is set
+ if (coordinates == null) {
+ throw new ApiException("Missing the required parameter 'coordinates' when calling directions(Async)");
+ }
+
+
+ okhttp3.Call localVarCall = directionsCall(coordinates, bearings, radiuses, generateHints, approaches, exclude, alternatives, steps, annotations, geometries, overview, continueStraight, _callback);
+ return localVarCall;
+
+ }
+
+ /**
+ * Directions Service
+ * Finds the fastest route between coordinates in the supplied order.
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param alternatives Search for alternative routes. Passing a number alternatives=n searches for up to n alternative routes. [ true, false (default), or Number ] (optional)
+ * @param steps Returned route steps for each route leg [ true, false (default) ] (optional)
+ * @param annotations Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional, default to "\"false\"")
+ * @param geometries Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] (optional, default to "\"polyline\"")
+ * @param overview Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] (optional, default to "\"simplified\"")
+ * @param continueStraight Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile [ default (default), true, false ] (optional, default to "\"default\"")
+ * @return DirectionsDirections
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public DirectionsDirections directions(String coordinates, String bearings, String radiuses, String generateHints, String approaches, String exclude, BigDecimal alternatives, String steps, String annotations, String geometries, String overview, String continueStraight) throws ApiException {
+ ApiResponse localVarResp = directionsWithHttpInfo(coordinates, bearings, radiuses, generateHints, approaches, exclude, alternatives, steps, annotations, geometries, overview, continueStraight);
+ return localVarResp.getData();
+ }
+
+ /**
+ * Directions Service
+ * Finds the fastest route between coordinates in the supplied order.
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param alternatives Search for alternative routes. Passing a number alternatives=n searches for up to n alternative routes. [ true, false (default), or Number ] (optional)
+ * @param steps Returned route steps for each route leg [ true, false (default) ] (optional)
+ * @param annotations Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional, default to "\"false\"")
+ * @param geometries Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] (optional, default to "\"polyline\"")
+ * @param overview Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] (optional, default to "\"simplified\"")
+ * @param continueStraight Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile [ default (default), true, false ] (optional, default to "\"default\"")
+ * @return ApiResponse<DirectionsDirections>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public ApiResponse directionsWithHttpInfo(String coordinates, String bearings, String radiuses, String generateHints, String approaches, String exclude, BigDecimal alternatives, String steps, String annotations, String geometries, String overview, String continueStraight) throws ApiException {
+ okhttp3.Call localVarCall = directionsValidateBeforeCall(coordinates, bearings, radiuses, generateHints, approaches, exclude, alternatives, steps, annotations, geometries, overview, continueStraight, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * Directions Service (asynchronously)
+ * Finds the fastest route between coordinates in the supplied order.
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param alternatives Search for alternative routes. Passing a number alternatives=n searches for up to n alternative routes. [ true, false (default), or Number ] (optional)
+ * @param steps Returned route steps for each route leg [ true, false (default) ] (optional)
+ * @param annotations Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional, default to "\"false\"")
+ * @param geometries Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] (optional, default to "\"polyline\"")
+ * @param overview Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] (optional, default to "\"simplified\"")
+ * @param continueStraight Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile [ default (default), true, false ] (optional, default to "\"default\"")
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public okhttp3.Call directionsAsync(String coordinates, String bearings, String radiuses, String generateHints, String approaches, String exclude, BigDecimal alternatives, String steps, String annotations, String geometries, String overview, String continueStraight, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = directionsValidateBeforeCall(coordinates, bearings, radiuses, generateHints, approaches, exclude, alternatives, steps, annotations, geometries, overview, continueStraight, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+}
diff --git a/src/main/java/com/locationiq/client/api/MatchingApi.java b/src/main/java/com/locationiq/client/api/MatchingApi.java
new file mode 100644
index 0000000..df50ae5
--- /dev/null
+++ b/src/main/java/com/locationiq/client/api/MatchingApi.java
@@ -0,0 +1,297 @@
+/*
+ * LocationIQ
+ * LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
+ *
+ * The version of the OpenAPI document: 2.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.locationiq.client.api;
+
+import com.locationiq.client.ApiCallback;
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.ApiResponse;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.Pair;
+import com.locationiq.client.ProgressRequestBody;
+import com.locationiq.client.ProgressResponseBody;
+
+import com.google.gson.reflect.TypeToken;
+
+import java.io.IOException;
+
+
+import com.locationiq.client.model.DirectionsMatching;
+import com.locationiq.client.model.Error;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class MatchingApi {
+ private ApiClient localVarApiClient;
+
+ public MatchingApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public MatchingApi(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return localVarApiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ /**
+ * Build call for matching
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param steps Returned route steps for each route leg [ true, false (default) ] (optional)
+ * @param annotations Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional, default to "\"false\"")
+ * @param geometries Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] (optional, default to "\"polyline\"")
+ * @param overview Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] (optional, default to "\"simplified\"")
+ * @param timestamps Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. [ {timestamp};{timestamp}[;{timestamp} ...] integer seconds since UNIX epoch (optional)
+ * @param gaps Allows the input track splitting based on huge timestamp gaps between points. [ split (default), ignore ] (optional, default to "\"split\"")
+ * @param tidy Allows the input track modification to obtain better matching quality for noisy tracks. [ true, false (default) ] (optional, default to "\"false\"")
+ * @param waypoints Treats input coordinates indicated by given indices as waypoints in returned Match object. Default is to treat all input coordinates as waypoints. [ {index};{index};{index}... ] (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public okhttp3.Call matchingCall(String coordinates, String generateHints, String approaches, String exclude, String bearings, String radiuses, String steps, String annotations, String geometries, String overview, String timestamps, String gaps, String tidy, String waypoints, final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/matching/driving/{coordinates}"
+ .replaceAll("\\{" + "coordinates" + "\\}", localVarApiClient.escapeString(coordinates.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ if (generateHints != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("generate_hints", generateHints));
+ }
+
+ if (approaches != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("approaches", approaches));
+ }
+
+ if (exclude != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("exclude", exclude));
+ }
+
+ if (bearings != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("bearings", bearings));
+ }
+
+ if (radiuses != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("radiuses", radiuses));
+ }
+
+ if (steps != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("steps", steps));
+ }
+
+ if (annotations != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("annotations", annotations));
+ }
+
+ if (geometries != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("geometries", geometries));
+ }
+
+ if (overview != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("overview", overview));
+ }
+
+ if (timestamps != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("timestamps", timestamps));
+ }
+
+ if (gaps != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("gaps", gaps));
+ }
+
+ if (tidy != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("tidy", tidy));
+ }
+
+ if (waypoints != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("waypoints", waypoints));
+ }
+
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String[] localVarAuthNames = new String[] { "key" };
+ return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call matchingValidateBeforeCall(String coordinates, String generateHints, String approaches, String exclude, String bearings, String radiuses, String steps, String annotations, String geometries, String overview, String timestamps, String gaps, String tidy, String waypoints, final ApiCallback _callback) throws ApiException {
+
+ // verify the required parameter 'coordinates' is set
+ if (coordinates == null) {
+ throw new ApiException("Missing the required parameter 'coordinates' when calling matching(Async)");
+ }
+
+
+ okhttp3.Call localVarCall = matchingCall(coordinates, generateHints, approaches, exclude, bearings, radiuses, steps, annotations, geometries, overview, timestamps, gaps, tidy, waypoints, _callback);
+ return localVarCall;
+
+ }
+
+ /**
+ * Matching Service
+ * Matching API matches or snaps given GPS points to the road network in the most plausible way. Please note the request might result multiple sub-traces. Large jumps in the timestamps (> 60s) or improbable transitions lead to trace splits if a complete matching could not be found. The algorithm might not be able to match all points. Outliers are removed if they can not be matched successfully.
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param steps Returned route steps for each route leg [ true, false (default) ] (optional)
+ * @param annotations Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional, default to "\"false\"")
+ * @param geometries Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] (optional, default to "\"polyline\"")
+ * @param overview Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] (optional, default to "\"simplified\"")
+ * @param timestamps Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. [ {timestamp};{timestamp}[;{timestamp} ...] integer seconds since UNIX epoch (optional)
+ * @param gaps Allows the input track splitting based on huge timestamp gaps between points. [ split (default), ignore ] (optional, default to "\"split\"")
+ * @param tidy Allows the input track modification to obtain better matching quality for noisy tracks. [ true, false (default) ] (optional, default to "\"false\"")
+ * @param waypoints Treats input coordinates indicated by given indices as waypoints in returned Match object. Default is to treat all input coordinates as waypoints. [ {index};{index};{index}... ] (optional)
+ * @return DirectionsMatching
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public DirectionsMatching matching(String coordinates, String generateHints, String approaches, String exclude, String bearings, String radiuses, String steps, String annotations, String geometries, String overview, String timestamps, String gaps, String tidy, String waypoints) throws ApiException {
+ ApiResponse localVarResp = matchingWithHttpInfo(coordinates, generateHints, approaches, exclude, bearings, radiuses, steps, annotations, geometries, overview, timestamps, gaps, tidy, waypoints);
+ return localVarResp.getData();
+ }
+
+ /**
+ * Matching Service
+ * Matching API matches or snaps given GPS points to the road network in the most plausible way. Please note the request might result multiple sub-traces. Large jumps in the timestamps (> 60s) or improbable transitions lead to trace splits if a complete matching could not be found. The algorithm might not be able to match all points. Outliers are removed if they can not be matched successfully.
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param steps Returned route steps for each route leg [ true, false (default) ] (optional)
+ * @param annotations Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional, default to "\"false\"")
+ * @param geometries Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] (optional, default to "\"polyline\"")
+ * @param overview Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] (optional, default to "\"simplified\"")
+ * @param timestamps Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. [ {timestamp};{timestamp}[;{timestamp} ...] integer seconds since UNIX epoch (optional)
+ * @param gaps Allows the input track splitting based on huge timestamp gaps between points. [ split (default), ignore ] (optional, default to "\"split\"")
+ * @param tidy Allows the input track modification to obtain better matching quality for noisy tracks. [ true, false (default) ] (optional, default to "\"false\"")
+ * @param waypoints Treats input coordinates indicated by given indices as waypoints in returned Match object. Default is to treat all input coordinates as waypoints. [ {index};{index};{index}... ] (optional)
+ * @return ApiResponse<DirectionsMatching>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public ApiResponse matchingWithHttpInfo(String coordinates, String generateHints, String approaches, String exclude, String bearings, String radiuses, String steps, String annotations, String geometries, String overview, String timestamps, String gaps, String tidy, String waypoints) throws ApiException {
+ okhttp3.Call localVarCall = matchingValidateBeforeCall(coordinates, generateHints, approaches, exclude, bearings, radiuses, steps, annotations, geometries, overview, timestamps, gaps, tidy, waypoints, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * Matching Service (asynchronously)
+ * Matching API matches or snaps given GPS points to the road network in the most plausible way. Please note the request might result multiple sub-traces. Large jumps in the timestamps (> 60s) or improbable transitions lead to trace splits if a complete matching could not be found. The algorithm might not be able to match all points. Outliers are removed if they can not be matched successfully.
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param steps Returned route steps for each route leg [ true, false (default) ] (optional)
+ * @param annotations Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional, default to "\"false\"")
+ * @param geometries Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] (optional, default to "\"polyline\"")
+ * @param overview Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] (optional, default to "\"simplified\"")
+ * @param timestamps Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. [ {timestamp};{timestamp}[;{timestamp} ...] integer seconds since UNIX epoch (optional)
+ * @param gaps Allows the input track splitting based on huge timestamp gaps between points. [ split (default), ignore ] (optional, default to "\"split\"")
+ * @param tidy Allows the input track modification to obtain better matching quality for noisy tracks. [ true, false (default) ] (optional, default to "\"false\"")
+ * @param waypoints Treats input coordinates indicated by given indices as waypoints in returned Match object. Default is to treat all input coordinates as waypoints. [ {index};{index};{index}... ] (optional)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public okhttp3.Call matchingAsync(String coordinates, String generateHints, String approaches, String exclude, String bearings, String radiuses, String steps, String annotations, String geometries, String overview, String timestamps, String gaps, String tidy, String waypoints, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = matchingValidateBeforeCall(coordinates, generateHints, approaches, exclude, bearings, radiuses, steps, annotations, geometries, overview, timestamps, gaps, tidy, waypoints, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+}
diff --git a/src/main/java/com/locationiq/client/api/MatrixApi.java b/src/main/java/com/locationiq/client/api/MatrixApi.java
new file mode 100644
index 0000000..b6ac49f
--- /dev/null
+++ b/src/main/java/com/locationiq/client/api/MatrixApi.java
@@ -0,0 +1,274 @@
+/*
+ * LocationIQ
+ * LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
+ *
+ * The version of the OpenAPI document: 2.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.locationiq.client.api;
+
+import com.locationiq.client.ApiCallback;
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.ApiResponse;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.Pair;
+import com.locationiq.client.ProgressRequestBody;
+import com.locationiq.client.ProgressResponseBody;
+
+import com.google.gson.reflect.TypeToken;
+
+import java.io.IOException;
+
+
+import java.math.BigDecimal;
+import com.locationiq.client.model.DirectionsMatrix;
+import com.locationiq.client.model.Error;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class MatrixApi {
+ private ApiClient localVarApiClient;
+
+ public MatrixApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public MatrixApi(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return localVarApiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ /**
+ * Build call for matrix
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param annotations Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional)
+ * @param sources Use location with given index as source. [ {index};{index}[;{index} ...] or all (default) ] => index 0 <= integer < #locations (optional)
+ * @param destinations Use location with given index as destination. [ {index};{index}[;{index} ...] or all (default) ] (optional)
+ * @param fallbackSpeed If no route found between a source/destination pair, calculate the as-the-crow-flies distance, then use this speed to estimate duration. double > 0 (optional)
+ * @param fallbackCoordinate When using a fallback_speed, use the user-supplied coordinate (input), or the snapped location (snapped) for calculating distances. [ input (default), or snapped ] (optional, default to "\"input\"")
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public okhttp3.Call matrixCall(String coordinates, String bearings, String radiuses, String generateHints, String approaches, String exclude, String annotations, Integer sources, Integer destinations, BigDecimal fallbackSpeed, String fallbackCoordinate, final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/matrix/driving/{coordinates}"
+ .replaceAll("\\{" + "coordinates" + "\\}", localVarApiClient.escapeString(coordinates.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ if (bearings != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("bearings", bearings));
+ }
+
+ if (radiuses != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("radiuses", radiuses));
+ }
+
+ if (generateHints != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("generate_hints", generateHints));
+ }
+
+ if (approaches != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("approaches", approaches));
+ }
+
+ if (exclude != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("exclude", exclude));
+ }
+
+ if (annotations != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("annotations", annotations));
+ }
+
+ if (sources != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("sources", sources));
+ }
+
+ if (destinations != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("destinations", destinations));
+ }
+
+ if (fallbackSpeed != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("fallback_speed", fallbackSpeed));
+ }
+
+ if (fallbackCoordinate != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("fallback_coordinate", fallbackCoordinate));
+ }
+
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String[] localVarAuthNames = new String[] { "key" };
+ return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call matrixValidateBeforeCall(String coordinates, String bearings, String radiuses, String generateHints, String approaches, String exclude, String annotations, Integer sources, Integer destinations, BigDecimal fallbackSpeed, String fallbackCoordinate, final ApiCallback _callback) throws ApiException {
+
+ // verify the required parameter 'coordinates' is set
+ if (coordinates == null) {
+ throw new ApiException("Missing the required parameter 'coordinates' when calling matrix(Async)");
+ }
+
+
+ okhttp3.Call localVarCall = matrixCall(coordinates, bearings, radiuses, generateHints, approaches, exclude, annotations, sources, destinations, fallbackSpeed, fallbackCoordinate, _callback);
+ return localVarCall;
+
+ }
+
+ /**
+ * Matrix Service
+ * Computes duration of the fastest route between all pairs of supplied coordinates. Returns the durations or distances or both between the coordinate pairs. Note that the distances are not the shortest distance between two coordinates, but rather the distances of the fastest routes.
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param annotations Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional)
+ * @param sources Use location with given index as source. [ {index};{index}[;{index} ...] or all (default) ] => index 0 <= integer < #locations (optional)
+ * @param destinations Use location with given index as destination. [ {index};{index}[;{index} ...] or all (default) ] (optional)
+ * @param fallbackSpeed If no route found between a source/destination pair, calculate the as-the-crow-flies distance, then use this speed to estimate duration. double > 0 (optional)
+ * @param fallbackCoordinate When using a fallback_speed, use the user-supplied coordinate (input), or the snapped location (snapped) for calculating distances. [ input (default), or snapped ] (optional, default to "\"input\"")
+ * @return DirectionsMatrix
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public DirectionsMatrix matrix(String coordinates, String bearings, String radiuses, String generateHints, String approaches, String exclude, String annotations, Integer sources, Integer destinations, BigDecimal fallbackSpeed, String fallbackCoordinate) throws ApiException {
+ ApiResponse localVarResp = matrixWithHttpInfo(coordinates, bearings, radiuses, generateHints, approaches, exclude, annotations, sources, destinations, fallbackSpeed, fallbackCoordinate);
+ return localVarResp.getData();
+ }
+
+ /**
+ * Matrix Service
+ * Computes duration of the fastest route between all pairs of supplied coordinates. Returns the durations or distances or both between the coordinate pairs. Note that the distances are not the shortest distance between two coordinates, but rather the distances of the fastest routes.
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param annotations Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional)
+ * @param sources Use location with given index as source. [ {index};{index}[;{index} ...] or all (default) ] => index 0 <= integer < #locations (optional)
+ * @param destinations Use location with given index as destination. [ {index};{index}[;{index} ...] or all (default) ] (optional)
+ * @param fallbackSpeed If no route found between a source/destination pair, calculate the as-the-crow-flies distance, then use this speed to estimate duration. double > 0 (optional)
+ * @param fallbackCoordinate When using a fallback_speed, use the user-supplied coordinate (input), or the snapped location (snapped) for calculating distances. [ input (default), or snapped ] (optional, default to "\"input\"")
+ * @return ApiResponse<DirectionsMatrix>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public ApiResponse matrixWithHttpInfo(String coordinates, String bearings, String radiuses, String generateHints, String approaches, String exclude, String annotations, Integer sources, Integer destinations, BigDecimal fallbackSpeed, String fallbackCoordinate) throws ApiException {
+ okhttp3.Call localVarCall = matrixValidateBeforeCall(coordinates, bearings, radiuses, generateHints, approaches, exclude, annotations, sources, destinations, fallbackSpeed, fallbackCoordinate, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * Matrix Service (asynchronously)
+ * Computes duration of the fastest route between all pairs of supplied coordinates. Returns the durations or distances or both between the coordinate pairs. Note that the distances are not the shortest distance between two coordinates, but rather the distances of the fastest routes.
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param annotations Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional)
+ * @param sources Use location with given index as source. [ {index};{index}[;{index} ...] or all (default) ] => index 0 <= integer < #locations (optional)
+ * @param destinations Use location with given index as destination. [ {index};{index}[;{index} ...] or all (default) ] (optional)
+ * @param fallbackSpeed If no route found between a source/destination pair, calculate the as-the-crow-flies distance, then use this speed to estimate duration. double > 0 (optional)
+ * @param fallbackCoordinate When using a fallback_speed, use the user-supplied coordinate (input), or the snapped location (snapped) for calculating distances. [ input (default), or snapped ] (optional, default to "\"input\"")
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public okhttp3.Call matrixAsync(String coordinates, String bearings, String radiuses, String generateHints, String approaches, String exclude, String annotations, Integer sources, Integer destinations, BigDecimal fallbackSpeed, String fallbackCoordinate, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = matrixValidateBeforeCall(coordinates, bearings, radiuses, generateHints, approaches, exclude, annotations, sources, destinations, fallbackSpeed, fallbackCoordinate, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+}
diff --git a/src/main/java/com/locationiq/client/api/NearestApi.java b/src/main/java/com/locationiq/client/api/NearestApi.java
new file mode 100644
index 0000000..58d2469
--- /dev/null
+++ b/src/main/java/com/locationiq/client/api/NearestApi.java
@@ -0,0 +1,241 @@
+/*
+ * LocationIQ
+ * LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
+ *
+ * The version of the OpenAPI document: 2.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.locationiq.client.api;
+
+import com.locationiq.client.ApiCallback;
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.ApiResponse;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.Pair;
+import com.locationiq.client.ProgressRequestBody;
+import com.locationiq.client.ProgressResponseBody;
+
+import com.google.gson.reflect.TypeToken;
+
+import java.io.IOException;
+
+
+import com.locationiq.client.model.DirectionsNearest;
+import com.locationiq.client.model.Error;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class NearestApi {
+ private ApiClient localVarApiClient;
+
+ public NearestApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public NearestApi(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return localVarApiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ /**
+ * Build call for nearest
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param number Number of nearest segments that should be returned. [ integer >= 1 (default 1) ] (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public okhttp3.Call nearestCall(String coordinates, String generateHints, String exclude, String bearings, String radiuses, String approaches, Integer number, final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/nearest/driving/{coordinates}"
+ .replaceAll("\\{" + "coordinates" + "\\}", localVarApiClient.escapeString(coordinates.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ if (generateHints != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("generate_hints", generateHints));
+ }
+
+ if (exclude != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("exclude", exclude));
+ }
+
+ if (bearings != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("bearings", bearings));
+ }
+
+ if (radiuses != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("radiuses", radiuses));
+ }
+
+ if (approaches != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("approaches", approaches));
+ }
+
+ if (number != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("number", number));
+ }
+
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String[] localVarAuthNames = new String[] { "key" };
+ return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call nearestValidateBeforeCall(String coordinates, String generateHints, String exclude, String bearings, String radiuses, String approaches, Integer number, final ApiCallback _callback) throws ApiException {
+
+ // verify the required parameter 'coordinates' is set
+ if (coordinates == null) {
+ throw new ApiException("Missing the required parameter 'coordinates' when calling nearest(Async)");
+ }
+
+
+ okhttp3.Call localVarCall = nearestCall(coordinates, generateHints, exclude, bearings, radiuses, approaches, number, _callback);
+ return localVarCall;
+
+ }
+
+ /**
+ * Nearest Service
+ * Snaps a coordinate to the street network and returns the nearest n matches. Where coordinates only supports a single {longitude},{latitude} entry.
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param number Number of nearest segments that should be returned. [ integer >= 1 (default 1) ] (optional)
+ * @return DirectionsNearest
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public DirectionsNearest nearest(String coordinates, String generateHints, String exclude, String bearings, String radiuses, String approaches, Integer number) throws ApiException {
+ ApiResponse localVarResp = nearestWithHttpInfo(coordinates, generateHints, exclude, bearings, radiuses, approaches, number);
+ return localVarResp.getData();
+ }
+
+ /**
+ * Nearest Service
+ * Snaps a coordinate to the street network and returns the nearest n matches. Where coordinates only supports a single {longitude},{latitude} entry.
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param number Number of nearest segments that should be returned. [ integer >= 1 (default 1) ] (optional)
+ * @return ApiResponse<DirectionsNearest>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public ApiResponse nearestWithHttpInfo(String coordinates, String generateHints, String exclude, String bearings, String radiuses, String approaches, Integer number) throws ApiException {
+ okhttp3.Call localVarCall = nearestValidateBeforeCall(coordinates, generateHints, exclude, bearings, radiuses, approaches, number, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * Nearest Service (asynchronously)
+ * Snaps a coordinate to the street network and returns the nearest n matches. Where coordinates only supports a single {longitude},{latitude} entry.
+ * @param coordinates String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required)
+ * @param generateHints Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
+ * @param exclude Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
+ * @param bearings Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
+ * @param radiuses Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
+ * @param approaches Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
+ * @param number Number of nearest segments that should be returned. [ integer >= 1 (default 1) ] (optional)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
+ */
+ public okhttp3.Call nearestAsync(String coordinates, String generateHints, String exclude, String bearings, String radiuses, String approaches, Integer number, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = nearestValidateBeforeCall(coordinates, generateHints, exclude, bearings, radiuses, approaches, number, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+}
diff --git a/src/main/java/com/locationiq/client/api/ReverseApi.java b/src/main/java/com/locationiq/client/api/ReverseApi.java
index c455154..e80f40e 100644
--- a/src/main/java/com/locationiq/client/api/ReverseApi.java
+++ b/src/main/java/com/locationiq/client/api/ReverseApi.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -13,14 +13,14 @@
package com.locationiq.client.api;
-import LocationIq.ApiCallback;
-import LocationIq.ApiClient;
-import LocationIq.ApiException;
-import LocationIq.ApiResponse;
-import LocationIq.Configuration;
-import LocationIq.Pair;
-import LocationIq.ProgressRequestBody;
-import LocationIq.ProgressResponseBody;
+import com.locationiq.client.ApiCallback;
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.ApiResponse;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.Pair;
+import com.locationiq.client.ProgressRequestBody;
+import com.locationiq.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
@@ -38,22 +38,22 @@
import java.util.Map;
public class ReverseApi {
- private ApiClient apiClient;
+ private ApiClient localVarApiClient;
public ReverseApi() {
this(Configuration.getDefaultApiClient());
}
public ReverseApi(ApiClient apiClient) {
- this.apiClient = apiClient;
+ this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
- return apiClient;
+ return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
- this.apiClient = apiClient;
+ this.localVarApiClient = apiClient;
}
/**
@@ -67,72 +67,98 @@ public void setApiClient(ApiClient apiClient) {
* @param namedetails Include a list of alternative names in the results. These may include language variants, references, operator and brand. (optional)
* @param extratags Include additional information in the result if available, e.g. wikipedia link, opening hours. (optional)
* @param statecode Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 (optional)
- * @param progressListener Progress listener
- * @param progressRequestListener Progress request listener
+ * @param showdistance Returns the straight line distance (meters) between the input location and the result's location. Value is set in the distance key of the response. Defaults to 0 [0,1] (optional)
+ * @param postaladdress Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] (optional)
+ * @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
*/
- public com.squareup.okhttp.Call reverseCall(BigDecimal lat, BigDecimal lon, String format, Integer normalizecity, Integer addressdetails, String acceptLanguage, Integer namedetails, Integer extratags, Integer statecode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = new Object();
+ public okhttp3.Call reverseCall(BigDecimal lat, BigDecimal lon, String format, Integer normalizecity, Integer addressdetails, String acceptLanguage, Integer namedetails, Integer extratags, Integer statecode, Integer showdistance, Integer postaladdress, final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/reverse.php";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
- if (lat != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("lat", lat));
- if (lon != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("lon", lon));
- if (format != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("format", format));
- if (normalizecity != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("normalizecity", normalizecity));
- if (addressdetails != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("addressdetails", addressdetails));
- if (acceptLanguage != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("accept-language", acceptLanguage));
- if (namedetails != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("namedetails", namedetails));
- if (extratags != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("extratags", extratags));
- if (statecode != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("statecode", statecode));
+ if (lat != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("lat", lat));
+ }
- Map localVarHeaderParams = new HashMap();
+ if (lon != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("lon", lon));
+ }
- Map localVarFormParams = new HashMap();
+ if (format != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("format", format));
+ }
+
+ if (normalizecity != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("normalizecity", normalizecity));
+ }
+
+ if (addressdetails != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("addressdetails", addressdetails));
+ }
+
+ if (acceptLanguage != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("accept-language", acceptLanguage));
+ }
+
+ if (namedetails != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("namedetails", namedetails));
+ }
+
+ if (extratags != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("extratags", extratags));
+ }
+ if (statecode != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("statecode", statecode));
+ }
+
+ if (showdistance != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("showdistance", showdistance));
+ }
+
+ if (postaladdress != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("postaladdress", postaladdress));
+ }
+
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = 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 localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
final String[] localVarContentTypes = {
};
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ final String localVarContentType = localVarApiClient.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[] { "key" };
- return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
- private com.squareup.okhttp.Call reverseValidateBeforeCall(BigDecimal lat, BigDecimal lon, String format, Integer normalizecity, Integer addressdetails, String acceptLanguage, Integer namedetails, Integer extratags, Integer statecode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ private okhttp3.Call reverseValidateBeforeCall(BigDecimal lat, BigDecimal lon, String format, Integer normalizecity, Integer addressdetails, String acceptLanguage, Integer namedetails, Integer extratags, Integer statecode, Integer showdistance, Integer postaladdress, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'lat' is set
if (lat == null) {
@@ -155,8 +181,8 @@ private com.squareup.okhttp.Call reverseValidateBeforeCall(BigDecimal lat, BigDe
}
- com.squareup.okhttp.Call call = reverseCall(lat, lon, format, normalizecity, addressdetails, acceptLanguage, namedetails, extratags, statecode, progressListener, progressRequestListener);
- return call;
+ okhttp3.Call localVarCall = reverseCall(lat, lon, format, normalizecity, addressdetails, acceptLanguage, namedetails, extratags, statecode, showdistance, postaladdress, _callback);
+ return localVarCall;
}
@@ -172,12 +198,25 @@ private com.squareup.okhttp.Call reverseValidateBeforeCall(BigDecimal lat, BigDe
* @param namedetails Include a list of alternative names in the results. These may include language variants, references, operator and brand. (optional)
* @param extratags Include additional information in the result if available, e.g. wikipedia link, opening hours. (optional)
* @param statecode Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 (optional)
+ * @param showdistance Returns the straight line distance (meters) between the input location and the result's location. Value is set in the distance key of the response. Defaults to 0 [0,1] (optional)
+ * @param postaladdress Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] (optional)
* @return Location
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
*/
- public Location reverse(BigDecimal lat, BigDecimal lon, String format, Integer normalizecity, Integer addressdetails, String acceptLanguage, Integer namedetails, Integer extratags, Integer statecode) throws ApiException {
- ApiResponse resp = reverseWithHttpInfo(lat, lon, format, normalizecity, addressdetails, acceptLanguage, namedetails, extratags, statecode);
- return resp.getData();
+ public Location reverse(BigDecimal lat, BigDecimal lon, String format, Integer normalizecity, Integer addressdetails, String acceptLanguage, Integer namedetails, Integer extratags, Integer statecode, Integer showdistance, Integer postaladdress) throws ApiException {
+ ApiResponse localVarResp = reverseWithHttpInfo(lat, lon, format, normalizecity, addressdetails, acceptLanguage, namedetails, extratags, statecode, showdistance, postaladdress);
+ return localVarResp.getData();
}
/**
@@ -192,13 +231,26 @@ public Location reverse(BigDecimal lat, BigDecimal lon, String format, Integer n
* @param namedetails Include a list of alternative names in the results. These may include language variants, references, operator and brand. (optional)
* @param extratags Include additional information in the result if available, e.g. wikipedia link, opening hours. (optional)
* @param statecode Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 (optional)
+ * @param showdistance Returns the straight line distance (meters) between the input location and the result's location. Value is set in the distance key of the response. Defaults to 0 [0,1] (optional)
+ * @param postaladdress Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] (optional)
* @return ApiResponse<Location>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
*/
- public ApiResponse reverseWithHttpInfo(BigDecimal lat, BigDecimal lon, String format, Integer normalizecity, Integer addressdetails, String acceptLanguage, Integer namedetails, Integer extratags, Integer statecode) throws ApiException {
- com.squareup.okhttp.Call call = reverseValidateBeforeCall(lat, lon, format, normalizecity, addressdetails, acceptLanguage, namedetails, extratags, statecode, null, null);
+ public ApiResponse reverseWithHttpInfo(BigDecimal lat, BigDecimal lon, String format, Integer normalizecity, Integer addressdetails, String acceptLanguage, Integer namedetails, Integer extratags, Integer statecode, Integer showdistance, Integer postaladdress) throws ApiException {
+ okhttp3.Call localVarCall = reverseValidateBeforeCall(lat, lon, format, normalizecity, addressdetails, acceptLanguage, namedetails, extratags, statecode, showdistance, postaladdress, null);
Type localVarReturnType = new TypeToken(){}.getType();
- return apiClient.execute(call, localVarReturnType);
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
@@ -213,34 +265,28 @@ public ApiResponse reverseWithHttpInfo(BigDecimal lat, BigDecimal lon,
* @param namedetails Include a list of alternative names in the results. These may include language variants, references, operator and brand. (optional)
* @param extratags Include additional information in the result if available, e.g. wikipedia link, opening hours. (optional)
* @param statecode Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 (optional)
- * @param callback The callback to be executed when the API call finishes
+ * @param showdistance Returns the straight line distance (meters) between the input location and the result's location. Value is set in the distance key of the response. Defaults to 0 [0,1] (optional)
+ * @param postaladdress Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] (optional)
+ * @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
*/
- public com.squareup.okhttp.Call reverseAsync(BigDecimal lat, BigDecimal lon, String format, Integer normalizecity, Integer addressdetails, String acceptLanguage, Integer namedetails, Integer extratags, Integer statecode, 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);
- }
- };
- }
+ public okhttp3.Call reverseAsync(BigDecimal lat, BigDecimal lon, String format, Integer normalizecity, Integer addressdetails, String acceptLanguage, Integer namedetails, Integer extratags, Integer statecode, Integer showdistance, Integer postaladdress, final ApiCallback _callback) throws ApiException {
- com.squareup.okhttp.Call call = reverseValidateBeforeCall(lat, lon, format, normalizecity, addressdetails, acceptLanguage, namedetails, extratags, statecode, progressListener, progressRequestListener);
+ okhttp3.Call localVarCall = reverseValidateBeforeCall(lat, lon, format, normalizecity, addressdetails, acceptLanguage, namedetails, extratags, statecode, showdistance, postaladdress, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
- apiClient.executeAsync(call, localVarReturnType, callback);
- return call;
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
}
}
diff --git a/src/main/java/com/locationiq/client/api/SearchApi.java b/src/main/java/com/locationiq/client/api/SearchApi.java
index 0a3a8c5..0ee2938 100644
--- a/src/main/java/com/locationiq/client/api/SearchApi.java
+++ b/src/main/java/com/locationiq/client/api/SearchApi.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -13,14 +13,14 @@
package com.locationiq.client.api;
-import LocationIq.ApiCallback;
-import LocationIq.ApiClient;
-import LocationIq.ApiException;
-import LocationIq.ApiResponse;
-import LocationIq.Configuration;
-import LocationIq.Pair;
-import LocationIq.ProgressRequestBody;
-import LocationIq.ProgressResponseBody;
+import com.locationiq.client.ApiCallback;
+import com.locationiq.client.ApiClient;
+import com.locationiq.client.ApiException;
+import com.locationiq.client.ApiResponse;
+import com.locationiq.client.Configuration;
+import com.locationiq.client.Pair;
+import com.locationiq.client.ProgressRequestBody;
+import com.locationiq.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
@@ -37,22 +37,22 @@
import java.util.Map;
public class SearchApi {
- private ApiClient apiClient;
+ private ApiClient localVarApiClient;
public SearchApi() {
this(Configuration.getDefaultApiClient());
}
public SearchApi(ApiClient apiClient) {
- this.apiClient = apiClient;
+ this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
- return apiClient;
+ return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
- this.apiClient = apiClient;
+ this.localVarApiClient = apiClient;
}
/**
@@ -70,80 +70,114 @@ public void setApiClient(ApiClient apiClient) {
* @param dedupe Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split in many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match; this is controlled by the dedupe parameter which defaults to 1. Since the limit is, for reasons of efficiency, enforced before and not after de-duplicating, it is possible that de-duplicating leaves you with less results than requested. (optional)
* @param extratags Include additional information in the result if available, e.g. wikipedia link, opening hours. (optional)
* @param statecode Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 (optional)
- * @param progressListener Progress listener
- * @param progressRequestListener Progress request listener
+ * @param matchquality Returns additional information about quality of the result in a matchquality object. Read more Defaults to 0 [0,1] (optional)
+ * @param postaladdress Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] (optional)
+ * @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
*/
- public com.squareup.okhttp.Call searchCall(String q, String format, Integer normalizecity, Integer addressdetails, String viewbox, Integer bounded, Integer limit, String acceptLanguage, String countrycodes, Integer namedetails, Integer dedupe, Integer extratags, Integer statecode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = new Object();
+ public okhttp3.Call searchCall(String q, String format, Integer normalizecity, Integer addressdetails, String viewbox, Integer bounded, Integer limit, String acceptLanguage, String countrycodes, Integer namedetails, Integer dedupe, Integer extratags, Integer statecode, Integer matchquality, Integer postaladdress, final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/search.php";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
- if (q != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("q", q));
- if (format != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("format", format));
- if (normalizecity != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("normalizecity", normalizecity));
- if (addressdetails != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("addressdetails", addressdetails));
- if (viewbox != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("viewbox", viewbox));
- if (bounded != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("bounded", bounded));
- if (limit != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
- if (acceptLanguage != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("accept-language", acceptLanguage));
- if (countrycodes != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("countrycodes", countrycodes));
- if (namedetails != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("namedetails", namedetails));
- if (dedupe != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("dedupe", dedupe));
- if (extratags != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("extratags", extratags));
- if (statecode != null)
- localVarQueryParams.addAll(apiClient.parameterToPair("statecode", statecode));
+ if (q != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("q", q));
+ }
- Map localVarHeaderParams = new HashMap();
+ if (format != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("format", format));
+ }
- Map localVarFormParams = new HashMap();
+ if (normalizecity != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("normalizecity", normalizecity));
+ }
+
+ if (addressdetails != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("addressdetails", addressdetails));
+ }
+
+ if (viewbox != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("viewbox", viewbox));
+ }
+ if (bounded != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("bounded", bounded));
+ }
+
+ if (limit != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit));
+ }
+
+ if (acceptLanguage != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("accept-language", acceptLanguage));
+ }
+
+ if (countrycodes != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("countrycodes", countrycodes));
+ }
+
+ if (namedetails != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("namedetails", namedetails));
+ }
+
+ if (dedupe != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("dedupe", dedupe));
+ }
+
+ if (extratags != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("extratags", extratags));
+ }
+
+ if (statecode != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("statecode", statecode));
+ }
+
+ if (matchquality != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("matchquality", matchquality));
+ }
+
+ if (postaladdress != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("postaladdress", postaladdress));
+ }
+
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = 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 localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
final String[] localVarContentTypes = {
};
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ final String localVarContentType = localVarApiClient.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[] { "key" };
- return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
- private com.squareup.okhttp.Call searchValidateBeforeCall(String q, String format, Integer normalizecity, Integer addressdetails, String viewbox, Integer bounded, Integer limit, String acceptLanguage, String countrycodes, Integer namedetails, Integer dedupe, Integer extratags, Integer statecode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ private okhttp3.Call searchValidateBeforeCall(String q, String format, Integer normalizecity, Integer addressdetails, String viewbox, Integer bounded, Integer limit, String acceptLanguage, String countrycodes, Integer namedetails, Integer dedupe, Integer extratags, Integer statecode, Integer matchquality, Integer postaladdress, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'q' is set
if (q == null) {
@@ -161,8 +195,8 @@ private com.squareup.okhttp.Call searchValidateBeforeCall(String q, String forma
}
- com.squareup.okhttp.Call call = searchCall(q, format, normalizecity, addressdetails, viewbox, bounded, limit, acceptLanguage, countrycodes, namedetails, dedupe, extratags, statecode, progressListener, progressRequestListener);
- return call;
+ okhttp3.Call localVarCall = searchCall(q, format, normalizecity, addressdetails, viewbox, bounded, limit, acceptLanguage, countrycodes, namedetails, dedupe, extratags, statecode, matchquality, postaladdress, _callback);
+ return localVarCall;
}
@@ -182,12 +216,25 @@ private com.squareup.okhttp.Call searchValidateBeforeCall(String q, String forma
* @param dedupe Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split in many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match; this is controlled by the dedupe parameter which defaults to 1. Since the limit is, for reasons of efficiency, enforced before and not after de-duplicating, it is possible that de-duplicating leaves you with less results than requested. (optional)
* @param extratags Include additional information in the result if available, e.g. wikipedia link, opening hours. (optional)
* @param statecode Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 (optional)
+ * @param matchquality Returns additional information about quality of the result in a matchquality object. Read more Defaults to 0 [0,1] (optional)
+ * @param postaladdress Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] (optional)
* @return List<Location>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
*/
- public List search(String q, String format, Integer normalizecity, Integer addressdetails, String viewbox, Integer bounded, Integer limit, String acceptLanguage, String countrycodes, Integer namedetails, Integer dedupe, Integer extratags, Integer statecode) throws ApiException {
- ApiResponse> resp = searchWithHttpInfo(q, format, normalizecity, addressdetails, viewbox, bounded, limit, acceptLanguage, countrycodes, namedetails, dedupe, extratags, statecode);
- return resp.getData();
+ public List search(String q, String format, Integer normalizecity, Integer addressdetails, String viewbox, Integer bounded, Integer limit, String acceptLanguage, String countrycodes, Integer namedetails, Integer dedupe, Integer extratags, Integer statecode, Integer matchquality, Integer postaladdress) throws ApiException {
+ ApiResponse> localVarResp = searchWithHttpInfo(q, format, normalizecity, addressdetails, viewbox, bounded, limit, acceptLanguage, countrycodes, namedetails, dedupe, extratags, statecode, matchquality, postaladdress);
+ return localVarResp.getData();
}
/**
@@ -206,13 +253,26 @@ public List search(String q, String format, Integer normalizecity, Int
* @param dedupe Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split in many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match; this is controlled by the dedupe parameter which defaults to 1. Since the limit is, for reasons of efficiency, enforced before and not after de-duplicating, it is possible that de-duplicating leaves you with less results than requested. (optional)
* @param extratags Include additional information in the result if available, e.g. wikipedia link, opening hours. (optional)
* @param statecode Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 (optional)
+ * @param matchquality Returns additional information about quality of the result in a matchquality object. Read more Defaults to 0 [0,1] (optional)
+ * @param postaladdress Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] (optional)
* @return ApiResponse<List<Location>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
*/
- public ApiResponse> searchWithHttpInfo(String q, String format, Integer normalizecity, Integer addressdetails, String viewbox, Integer bounded, Integer limit, String acceptLanguage, String countrycodes, Integer namedetails, Integer dedupe, Integer extratags, Integer statecode) throws ApiException {
- com.squareup.okhttp.Call call = searchValidateBeforeCall(q, format, normalizecity, addressdetails, viewbox, bounded, limit, acceptLanguage, countrycodes, namedetails, dedupe, extratags, statecode, null, null);
+ public ApiResponse> searchWithHttpInfo(String q, String format, Integer normalizecity, Integer addressdetails, String viewbox, Integer bounded, Integer limit, String acceptLanguage, String countrycodes, Integer namedetails, Integer dedupe, Integer extratags, Integer statecode, Integer matchquality, Integer postaladdress) throws ApiException {
+ okhttp3.Call localVarCall = searchValidateBeforeCall(q, format, normalizecity, addressdetails, viewbox, bounded, limit, acceptLanguage, countrycodes, namedetails, dedupe, extratags, statecode, matchquality, postaladdress, null);
Type localVarReturnType = new TypeToken>(){}.getType();
- return apiClient.execute(call, localVarReturnType);
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
@@ -231,34 +291,28 @@ public ApiResponse> searchWithHttpInfo(String q, String format, I
* @param dedupe Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split in many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match; this is controlled by the dedupe parameter which defaults to 1. Since the limit is, for reasons of efficiency, enforced before and not after de-duplicating, it is possible that de-duplicating leaves you with less results than requested. (optional)
* @param extratags Include additional information in the result if available, e.g. wikipedia link, opening hours. (optional)
* @param statecode Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 (optional)
- * @param callback The callback to be executed when the API call finishes
+ * @param matchquality Returns additional information about quality of the result in a matchquality object. Read more Defaults to 0 [0,1] (optional)
+ * @param postaladdress Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] (optional)
+ * @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
OK
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
The request has been made from an unauthorized domain.
-
+
404
No location or places were found for the given input
-
+
429
Request exceeded the rate-limits set on your account
-
+
500
Internal Server Error
-
+
*/
- public com.squareup.okhttp.Call searchAsync(String q, String format, Integer normalizecity, Integer addressdetails, String viewbox, Integer bounded, Integer limit, String acceptLanguage, String countrycodes, Integer namedetails, Integer dedupe, Integer extratags, Integer statecode, 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);
- }
- };
- }
+ public okhttp3.Call searchAsync(String q, String format, Integer normalizecity, Integer addressdetails, String viewbox, Integer bounded, Integer limit, String acceptLanguage, String countrycodes, Integer namedetails, Integer dedupe, Integer extratags, Integer statecode, Integer matchquality, Integer postaladdress, final ApiCallback> _callback) throws ApiException {
- com.squareup.okhttp.Call call = searchValidateBeforeCall(q, format, normalizecity, addressdetails, viewbox, bounded, limit, acceptLanguage, countrycodes, namedetails, dedupe, extratags, statecode, progressListener, progressRequestListener);
+ okhttp3.Call localVarCall = searchValidateBeforeCall(q, format, normalizecity, addressdetails, viewbox, bounded, limit, acceptLanguage, countrycodes, namedetails, dedupe, extratags, statecode, matchquality, postaladdress, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
- apiClient.executeAsync(call, localVarReturnType, callback);
- return call;
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
}
}
diff --git a/src/main/java/LocationIq/auth/ApiKeyAuth.java b/src/main/java/com/locationiq/client/auth/ApiKeyAuth.java
similarity index 80%
rename from src/main/java/LocationIq/auth/ApiKeyAuth.java
rename to src/main/java/com/locationiq/client/auth/ApiKeyAuth.java
index f18a7b2..a161231 100644
--- a/src/main/java/LocationIq/auth/ApiKeyAuth.java
+++ b/src/main/java/com/locationiq/client/auth/ApiKeyAuth.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -11,14 +11,14 @@
*/
-package LocationIq.auth;
+package com.locationiq.client.auth;
-import LocationIq.Pair;
+import com.locationiq.client.Pair;
import java.util.Map;
import java.util.List;
-
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-02-14T16:06:31.759327+05:30[Asia/Kolkata]")
public class ApiKeyAuth implements Authentication {
private final String location;
private final String paramName;
@@ -56,7 +56,7 @@ public void setApiKeyPrefix(String apiKeyPrefix) {
}
@Override
- public void applyToParams(List queryParams, Map headerParams) {
+ public void applyToParams(List queryParams, Map headerParams, Map cookieParams) {
if (apiKey == null) {
return;
}
@@ -70,6 +70,8 @@ public void applyToParams(List queryParams, Map headerPara
queryParams.add(new Pair(paramName, value));
} else if ("header".equals(location)) {
headerParams.put(paramName, value);
+ } else if ("cookie".equals(location)) {
+ cookieParams.put(paramName, value);
}
}
}
diff --git a/src/main/java/LocationIq/auth/Authentication.java b/src/main/java/com/locationiq/client/auth/Authentication.java
similarity index 78%
rename from src/main/java/LocationIq/auth/Authentication.java
rename to src/main/java/com/locationiq/client/auth/Authentication.java
index 5bb9b11..db5b2c4 100644
--- a/src/main/java/LocationIq/auth/Authentication.java
+++ b/src/main/java/com/locationiq/client/auth/Authentication.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -11,9 +11,9 @@
*/
-package LocationIq.auth;
+package com.locationiq.client.auth;
-import LocationIq.Pair;
+import com.locationiq.client.Pair;
import java.util.Map;
import java.util.List;
@@ -24,6 +24,7 @@ public interface Authentication {
*
* @param queryParams List of query parameters
* @param headerParams Map of header parameters
+ * @param cookieParams Map of cookie parameters
*/
- void applyToParams(List queryParams, Map headerParams);
+ void applyToParams(List queryParams, Map headerParams, Map cookieParams);
}
diff --git a/src/main/java/LocationIq/auth/HttpBasicAuth.java b/src/main/java/com/locationiq/client/auth/HttpBasicAuth.java
similarity index 86%
rename from src/main/java/LocationIq/auth/HttpBasicAuth.java
rename to src/main/java/com/locationiq/client/auth/HttpBasicAuth.java
index 62c8042..de65e67 100644
--- a/src/main/java/LocationIq/auth/HttpBasicAuth.java
+++ b/src/main/java/com/locationiq/client/auth/HttpBasicAuth.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -11,11 +11,11 @@
*/
-package LocationIq.auth;
+package com.locationiq.client.auth;
-import LocationIq.Pair;
+import com.locationiq.client.Pair;
-import com.squareup.okhttp.Credentials;
+import okhttp3.Credentials;
import java.util.Map;
import java.util.List;
@@ -43,7 +43,7 @@ public void setPassword(String password) {
}
@Override
- public void applyToParams(List queryParams, Map headerParams) {
+ public void applyToParams(List queryParams, Map headerParams, Map cookieParams) {
if (username == null && password == null) {
return;
}
diff --git a/src/main/java/com/locationiq/client/auth/HttpBearerAuth.java b/src/main/java/com/locationiq/client/auth/HttpBearerAuth.java
new file mode 100644
index 0000000..bafab37
--- /dev/null
+++ b/src/main/java/com/locationiq/client/auth/HttpBearerAuth.java
@@ -0,0 +1,60 @@
+/*
+ * LocationIQ
+ * LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
+ *
+ * The version of the OpenAPI document: 2.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.locationiq.client.auth;
+
+import com.locationiq.client.Pair;
+
+import java.util.Map;
+import java.util.List;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-02-14T16:06:31.759327+05:30[Asia/Kolkata]")
+public class HttpBearerAuth implements Authentication {
+ private final String scheme;
+ private String bearerToken;
+
+ public HttpBearerAuth(String scheme) {
+ this.scheme = scheme;
+ }
+
+ /**
+ * Gets the token, which together with the scheme, will be sent as the value of the Authorization header.
+ *
+ * @return The bearer token
+ */
+ public String getBearerToken() {
+ return bearerToken;
+ }
+
+ /**
+ * Sets the token, which together with the scheme, will be sent as the value of the Authorization header.
+ *
+ * @param bearerToken The bearer token to send in the Authorization header
+ */
+ public void setBearerToken(String bearerToken) {
+ this.bearerToken = bearerToken;
+ }
+
+ @Override
+ public void applyToParams(List queryParams, Map headerParams, Map cookieParams) {
+ if(bearerToken == null) {
+ return;
+ }
+
+ headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken);
+ }
+
+ private static String upperCaseBearer(String scheme) {
+ return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme;
+ }
+}
diff --git a/src/main/java/com/locationiq/client/model/Address.java b/src/main/java/com/locationiq/client/model/Address.java
index 020c2dc..b6fac7d 100644
--- a/src/main/java/com/locationiq/client/model/Address.java
+++ b/src/main/java/com/locationiq/client/model/Address.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -27,89 +27,91 @@
/**
* Address
*/
-
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-02-14T16:06:31.759327+05:30[Asia/Kolkata]")
public class Address {
public static final String SERIALIZED_NAME_HOUSE_NUMBER = "house_number";
@SerializedName(SERIALIZED_NAME_HOUSE_NUMBER)
- private String houseNumber = null;
+ private String houseNumber;
public static final String SERIALIZED_NAME_ROAD = "road";
@SerializedName(SERIALIZED_NAME_ROAD)
- private String road = null;
+ private String road;
public static final String SERIALIZED_NAME_RESIDENTIAL = "residential";
@SerializedName(SERIALIZED_NAME_RESIDENTIAL)
- private String residential = null;
+ private String residential;
public static final String SERIALIZED_NAME_BOROUGH = "borough";
@SerializedName(SERIALIZED_NAME_BOROUGH)
- private String borough = null;
+ private String borough;
public static final String SERIALIZED_NAME_NEIGHBOURHOOD = "neighbourhood";
@SerializedName(SERIALIZED_NAME_NEIGHBOURHOOD)
- private String neighbourhood = null;
+ private String neighbourhood;
public static final String SERIALIZED_NAME_QUARTER = "quarter";
@SerializedName(SERIALIZED_NAME_QUARTER)
- private String quarter = null;
+ private String quarter;
public static final String SERIALIZED_NAME_HAMLET = "hamlet";
@SerializedName(SERIALIZED_NAME_HAMLET)
- private String hamlet = null;
+ private String hamlet;
public static final String SERIALIZED_NAME_SUBURB = "suburb";
@SerializedName(SERIALIZED_NAME_SUBURB)
- private String suburb = null;
+ private String suburb;
public static final String SERIALIZED_NAME_ISLAND = "island";
@SerializedName(SERIALIZED_NAME_ISLAND)
- private String island = null;
+ private String island;
public static final String SERIALIZED_NAME_VILLAGE = "village";
@SerializedName(SERIALIZED_NAME_VILLAGE)
- private String village = null;
+ private String village;
public static final String SERIALIZED_NAME_TOWN = "town";
@SerializedName(SERIALIZED_NAME_TOWN)
- private String town = null;
+ private String town;
public static final String SERIALIZED_NAME_CITY = "city";
@SerializedName(SERIALIZED_NAME_CITY)
- private String city = null;
+ private String city;
public static final String SERIALIZED_NAME_CITY_DISTRICT = "city_district";
@SerializedName(SERIALIZED_NAME_CITY_DISTRICT)
- private String cityDistrict = null;
+ private String cityDistrict;
public static final String SERIALIZED_NAME_COUNTY = "county";
@SerializedName(SERIALIZED_NAME_COUNTY)
- private String county = null;
+ private String county;
public static final String SERIALIZED_NAME_STATE = "state";
@SerializedName(SERIALIZED_NAME_STATE)
- private String state = null;
+ private String state;
public static final String SERIALIZED_NAME_STATE_DISTRICT = "state_district";
@SerializedName(SERIALIZED_NAME_STATE_DISTRICT)
- private String stateDistrict = null;
+ private String stateDistrict;
public static final String SERIALIZED_NAME_POSTCODE = "postcode";
@SerializedName(SERIALIZED_NAME_POSTCODE)
- private String postcode = null;
+ private String postcode;
public static final String SERIALIZED_NAME_COUNTRY = "country";
@SerializedName(SERIALIZED_NAME_COUNTRY)
- private String country = null;
+ private String country;
public static final String SERIALIZED_NAME_COUNTRY_CODE = "country_code";
@SerializedName(SERIALIZED_NAME_COUNTRY_CODE)
- private String countryCode = null;
+ private String countryCode;
public static final String SERIALIZED_NAME_STATE_CODE = "state_code";
@SerializedName(SERIALIZED_NAME_STATE_CODE)
- private String stateCode = null;
+ private String stateCode;
+
public Address houseNumber(String houseNumber) {
+
this.houseNumber = houseNumber;
return this;
}
@@ -118,16 +120,21 @@ public Address houseNumber(String houseNumber) {
* Get houseNumber
* @return houseNumber
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getHouseNumber() {
return houseNumber;
}
+
public void setHouseNumber(String houseNumber) {
this.houseNumber = houseNumber;
}
+
public Address road(String road) {
+
this.road = road;
return this;
}
@@ -136,16 +143,21 @@ public Address road(String road) {
* Get road
* @return road
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getRoad() {
return road;
}
+
public void setRoad(String road) {
this.road = road;
}
+
public Address residential(String residential) {
+
this.residential = residential;
return this;
}
@@ -154,16 +166,21 @@ public Address residential(String residential) {
* Get residential
* @return residential
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getResidential() {
return residential;
}
+
public void setResidential(String residential) {
this.residential = residential;
}
+
public Address borough(String borough) {
+
this.borough = borough;
return this;
}
@@ -172,16 +189,21 @@ public Address borough(String borough) {
* Get borough
* @return borough
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getBorough() {
return borough;
}
+
public void setBorough(String borough) {
this.borough = borough;
}
+
public Address neighbourhood(String neighbourhood) {
+
this.neighbourhood = neighbourhood;
return this;
}
@@ -190,16 +212,21 @@ public Address neighbourhood(String neighbourhood) {
* Get neighbourhood
* @return neighbourhood
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getNeighbourhood() {
return neighbourhood;
}
+
public void setNeighbourhood(String neighbourhood) {
this.neighbourhood = neighbourhood;
}
+
public Address quarter(String quarter) {
+
this.quarter = quarter;
return this;
}
@@ -208,16 +235,21 @@ public Address quarter(String quarter) {
* Get quarter
* @return quarter
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getQuarter() {
return quarter;
}
+
public void setQuarter(String quarter) {
this.quarter = quarter;
}
+
public Address hamlet(String hamlet) {
+
this.hamlet = hamlet;
return this;
}
@@ -226,16 +258,21 @@ public Address hamlet(String hamlet) {
* Get hamlet
* @return hamlet
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getHamlet() {
return hamlet;
}
+
public void setHamlet(String hamlet) {
this.hamlet = hamlet;
}
+
public Address suburb(String suburb) {
+
this.suburb = suburb;
return this;
}
@@ -244,16 +281,21 @@ public Address suburb(String suburb) {
* Get suburb
* @return suburb
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getSuburb() {
return suburb;
}
+
public void setSuburb(String suburb) {
this.suburb = suburb;
}
+
public Address island(String island) {
+
this.island = island;
return this;
}
@@ -262,16 +304,21 @@ public Address island(String island) {
* Get island
* @return island
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getIsland() {
return island;
}
+
public void setIsland(String island) {
this.island = island;
}
+
public Address village(String village) {
+
this.village = village;
return this;
}
@@ -280,16 +327,21 @@ public Address village(String village) {
* Get village
* @return village
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getVillage() {
return village;
}
+
public void setVillage(String village) {
this.village = village;
}
+
public Address town(String town) {
+
this.town = town;
return this;
}
@@ -298,16 +350,21 @@ public Address town(String town) {
* Get town
* @return town
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getTown() {
return town;
}
+
public void setTown(String town) {
this.town = town;
}
+
public Address city(String city) {
+
this.city = city;
return this;
}
@@ -316,16 +373,21 @@ public Address city(String city) {
* Get city
* @return city
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getCity() {
return city;
}
+
public void setCity(String city) {
this.city = city;
}
+
public Address cityDistrict(String cityDistrict) {
+
this.cityDistrict = cityDistrict;
return this;
}
@@ -334,16 +396,21 @@ public Address cityDistrict(String cityDistrict) {
* Get cityDistrict
* @return cityDistrict
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getCityDistrict() {
return cityDistrict;
}
+
public void setCityDistrict(String cityDistrict) {
this.cityDistrict = cityDistrict;
}
+
public Address county(String county) {
+
this.county = county;
return this;
}
@@ -352,16 +419,21 @@ public Address county(String county) {
* Get county
* @return county
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getCounty() {
return county;
}
+
public void setCounty(String county) {
this.county = county;
}
+
public Address state(String state) {
+
this.state = state;
return this;
}
@@ -370,16 +442,21 @@ public Address state(String state) {
* Get state
* @return state
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getState() {
return state;
}
+
public void setState(String state) {
this.state = state;
}
+
public Address stateDistrict(String stateDistrict) {
+
this.stateDistrict = stateDistrict;
return this;
}
@@ -388,16 +465,21 @@ public Address stateDistrict(String stateDistrict) {
* Get stateDistrict
* @return stateDistrict
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getStateDistrict() {
return stateDistrict;
}
+
public void setStateDistrict(String stateDistrict) {
this.stateDistrict = stateDistrict;
}
+
public Address postcode(String postcode) {
+
this.postcode = postcode;
return this;
}
@@ -406,16 +488,21 @@ public Address postcode(String postcode) {
* Get postcode
* @return postcode
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getPostcode() {
return postcode;
}
+
public void setPostcode(String postcode) {
this.postcode = postcode;
}
+
public Address country(String country) {
+
this.country = country;
return this;
}
@@ -424,16 +511,21 @@ public Address country(String country) {
* Get country
* @return country
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getCountry() {
return country;
}
+
public void setCountry(String country) {
this.country = country;
}
+
public Address countryCode(String countryCode) {
+
this.countryCode = countryCode;
return this;
}
@@ -442,16 +534,21 @@ public Address countryCode(String countryCode) {
* Get countryCode
* @return countryCode
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getCountryCode() {
return countryCode;
}
+
public void setCountryCode(String countryCode) {
this.countryCode = countryCode;
}
+
public Address stateCode(String stateCode) {
+
this.stateCode = stateCode;
return this;
}
@@ -460,11 +557,14 @@ public Address stateCode(String stateCode) {
* Get stateCode
* @return stateCode
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getStateCode() {
return stateCode;
}
+
public void setStateCode(String stateCode) {
this.stateCode = stateCode;
}
@@ -511,7 +611,6 @@ public int hashCode() {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Address {\n");
-
sb.append(" houseNumber: ").append(toIndentedString(houseNumber)).append("\n");
sb.append(" road: ").append(toIndentedString(road)).append("\n");
sb.append(" residential: ").append(toIndentedString(residential)).append("\n");
diff --git a/src/main/java/com/locationiq/client/model/Balance.java b/src/main/java/com/locationiq/client/model/Balance.java
index eccd867..fec4720 100644
--- a/src/main/java/com/locationiq/client/model/Balance.java
+++ b/src/main/java/com/locationiq/client/model/Balance.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -28,17 +28,19 @@
/**
* Balance
*/
-
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-02-14T16:06:31.759327+05:30[Asia/Kolkata]")
public class Balance {
public static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
- private String status = null;
+ private String status;
public static final String SERIALIZED_NAME_BALANCE = "balance";
@SerializedName(SERIALIZED_NAME_BALANCE)
- private Daybalance balance = null;
+ private Daybalance balance;
+
public Balance status(String status) {
+
this.status = status;
return this;
}
@@ -47,16 +49,21 @@ public Balance status(String status) {
* Get status
* @return status
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public String getStatus() {
return status;
}
+
public void setStatus(String status) {
this.status = status;
}
+
public Balance balance(Daybalance balance) {
+
this.balance = balance;
return this;
}
@@ -65,11 +72,14 @@ public Balance balance(Daybalance balance) {
* Get balance
* @return balance
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public Daybalance getBalance() {
return balance;
}
+
public void setBalance(Daybalance balance) {
this.balance = balance;
}
@@ -98,7 +108,6 @@ public int hashCode() {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Balance {\n");
-
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" balance: ").append(toIndentedString(balance)).append("\n");
sb.append("}");
diff --git a/src/main/java/com/locationiq/client/model/Daybalance.java b/src/main/java/com/locationiq/client/model/Daybalance.java
index 4b19624..7362017 100644
--- a/src/main/java/com/locationiq/client/model/Daybalance.java
+++ b/src/main/java/com/locationiq/client/model/Daybalance.java
@@ -2,7 +2,7 @@
* LocationIQ
* LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
*
- * OpenAPI spec version: 1.0.1
+ * The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -27,17 +27,19 @@
/**
* Daybalance
*/
-
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-02-14T16:06:31.759327+05:30[Asia/Kolkata]")
public class Daybalance {
public static final String SERIALIZED_NAME_DAY = "day";
@SerializedName(SERIALIZED_NAME_DAY)
- private Integer day = null;
+ private Integer day;
public static final String SERIALIZED_NAME_BONUS = "bonus";
@SerializedName(SERIALIZED_NAME_BONUS)
- private Integer bonus = null;
+ private Integer bonus;
+
public Daybalance day(Integer day) {
+
this.day = day;
return this;
}
@@ -46,16 +48,21 @@ public Daybalance day(Integer day) {
* Get day
* @return day
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public Integer getDay() {
return day;
}
+
public void setDay(Integer day) {
this.day = day;
}
+
public Daybalance bonus(Integer bonus) {
+
this.bonus = bonus;
return this;
}
@@ -64,11 +71,14 @@ public Daybalance bonus(Integer bonus) {
* Get bonus
* @return bonus
**/
+ @javax.annotation.Nullable
@ApiModelProperty(value = "")
+
public Integer getBonus() {
return bonus;
}
+
public void setBonus(Integer bonus) {
this.bonus = bonus;
}
@@ -97,7 +107,6 @@ public int hashCode() {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Daybalance {\n");
-
sb.append(" day: ").append(toIndentedString(day)).append("\n");
sb.append(" bonus: ").append(toIndentedString(bonus)).append("\n");
sb.append("}");
diff --git a/src/main/java/com/locationiq/client/model/DirectionsDirections.java b/src/main/java/com/locationiq/client/model/DirectionsDirections.java
new file mode 100644
index 0000000..4ad8e04
--- /dev/null
+++ b/src/main/java/com/locationiq/client/model/DirectionsDirections.java
@@ -0,0 +1,176 @@
+/*
+ * LocationIQ
+ * LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
+ *
+ * The version of the OpenAPI document: 2.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.locationiq.client.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import com.google.gson.TypeAdapter;
+import com.google.gson.annotations.JsonAdapter;
+import com.google.gson.annotations.SerializedName;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+import com.locationiq.client.model.DirectionsDirectionsRoutes;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * DirectionsDirections
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-02-14T16:06:31.759327+05:30[Asia/Kolkata]")
+public class DirectionsDirections {
+ public static final String SERIALIZED_NAME_CODE = "code";
+ @SerializedName(SERIALIZED_NAME_CODE)
+ private String code;
+
+ public static final String SERIALIZED_NAME_WAYPOINTS = "waypoints";
+ @SerializedName(SERIALIZED_NAME_WAYPOINTS)
+ private List