diff --git a/Dockerfile b/Dockerfile
index a624d90565..1e64e9e2cb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -5,6 +5,7 @@ FROM node:$NODE_VERSION-alpine
ENV DOCKER=true
RUN apk add openjdk11 maven jq bash perl curl
+ENV JAVA_HOME=/usr/lib/jvm/default-jvm
WORKDIR /app
diff --git a/clients/algoliasearch-client-java-2/.openapi-generator-ignore b/clients/algoliasearch-client-java-2/.openapi-generator-ignore
index dd94f3e8b5..913185fd6c 100644
--- a/clients/algoliasearch-client-java-2/.openapi-generator-ignore
+++ b/clients/algoliasearch-client-java-2/.openapi-generator-ignore
@@ -8,6 +8,7 @@ api/**
docs/**
gradle/**
src/**
+README.md
.travis.yml
build.gradle
diff --git a/clients/algoliasearch-client-java-2/README.md b/clients/algoliasearch-client-java-2/README.md
deleted file mode 100644
index d1fe04db28..0000000000
--- a/clients/algoliasearch-client-java-2/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-# algoliasearch-client-java-2
-
-Search API
-- API version: 0.1.0
-
-API powering the Search feature of Algolia.
-
-*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
-
-## Requirements
-
-Building the API client library requires:
-1. Java 1.8+
-2. Maven/Gradle
-
-## Installation
-
-To install the API client library to your local Maven repository, simply execute:
-
-```shell
-mvn clean install
-```
-
-To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
-
-```shell
-mvn clean deploy
-```
-
-Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
-
-### Maven users
-
-Add this dependency to your project's POM:
-
-```xml
-
- com.algolia
- algoliasearch-client-java-2
- 0.1.0
- compile
-
-```
-
-### Gradle users
-
-Add this dependency to your project's build file:
-
-```groovy
-compile "com.algolia:algoliasearch-client-java-2:0.1.0"
-```
-
-### Others
-
-At first generate the JAR by executing:
-
-```shell
-mvn clean package
-```
-
-Then manually install the following JARs:
-
-* `target/algoliasearch-client-java-2-0.1.0.jar`
-* `target/lib/*.jar`
-
-## Getting Started
-
-Checkout the playground.
diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java
index c89d7d6044..fe63fb8313 100644
--- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java
+++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java
@@ -1,5 +1,6 @@
package com.algolia;
+import com.algolia.utils.Requester;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Type;
@@ -9,11 +10,8 @@
import java.time.OffsetDateTime;
import java.util.*;
import java.util.Map.Entry;
-import java.util.concurrent.TimeUnit;
import okhttp3.*;
import okhttp3.internal.http.HttpMethod;
-import okhttp3.logging.HttpLoggingInterceptor;
-import okhttp3.logging.HttpLoggingInterceptor.Level;
public class ApiClient {
@@ -25,36 +23,21 @@ public class ApiClient {
private DateFormat dateFormat;
- private OkHttpClient httpClient;
private JSON json;
- private HttpLoggingInterceptor loggingInterceptor;
+ private Requester requester;
/*
- * Basic constructor for ApiClient
+ * Constructor for ApiClient with custom Requester
*/
- public ApiClient(String appId, String apiKey) {
+ public ApiClient(String appId, String apiKey, Requester requester) {
json = new JSON();
setUserAgent("OpenAPI-Generator/0.1.0/java");
- initHttpClient();
this.basePath = "https://" + appId + "-1.algolianet.com";
this.appId = appId;
this.apiKey = apiKey;
- }
-
- private void initHttpClient() {
- initHttpClient(Collections.emptyList());
- }
-
- private void initHttpClient(List interceptors) {
- OkHttpClient.Builder builder = new OkHttpClient.Builder();
- builder.addNetworkInterceptor(getProgressInterceptor());
- for (Interceptor interceptor : interceptors) {
- builder.addInterceptor(interceptor);
- }
-
- httpClient = builder.build();
+ this.requester = requester;
}
/**
@@ -130,20 +113,7 @@ public boolean isDebugging() {
* @return ApiClient
*/
public ApiClient setDebugging(boolean debugging) {
- if (debugging != this.debugging) {
- if (debugging) {
- loggingInterceptor = new HttpLoggingInterceptor();
- loggingInterceptor.setLevel(Level.BODY);
- httpClient =
- httpClient.newBuilder().addInterceptor(loggingInterceptor).build();
- } else {
- final OkHttpClient.Builder builder = httpClient.newBuilder();
- builder.interceptors().remove(loggingInterceptor);
- httpClient = builder.build();
- loggingInterceptor = null;
- }
- }
- this.debugging = debugging;
+ requester.setDebugging(debugging);
return this;
}
@@ -153,7 +123,7 @@ public ApiClient setDebugging(boolean debugging) {
* @return Timeout in milliseconds
*/
public int getConnectTimeout() {
- return httpClient.connectTimeoutMillis();
+ return requester.getConnectTimeout();
}
/**
@@ -164,11 +134,7 @@ public int getConnectTimeout() {
* @return Api client
*/
public ApiClient setConnectTimeout(int connectionTimeout) {
- httpClient =
- httpClient
- .newBuilder()
- .connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS)
- .build();
+ requester.setConnectTimeout(connectionTimeout);
return this;
}
@@ -178,7 +144,7 @@ public ApiClient setConnectTimeout(int connectionTimeout) {
* @return Timeout in milliseconds
*/
public int getReadTimeout() {
- return httpClient.readTimeoutMillis();
+ return requester.getReadTimeout();
}
/**
@@ -189,11 +155,7 @@ public int getReadTimeout() {
* @return Api client
*/
public ApiClient setReadTimeout(int readTimeout) {
- httpClient =
- httpClient
- .newBuilder()
- .readTimeout(readTimeout, TimeUnit.MILLISECONDS)
- .build();
+ requester.setReadTimeout(readTimeout);
return this;
}
@@ -203,7 +165,7 @@ public ApiClient setReadTimeout(int readTimeout) {
* @return Timeout in milliseconds
*/
public int getWriteTimeout() {
- return httpClient.writeTimeoutMillis();
+ return requester.getWriteTimeout();
}
/**
@@ -214,11 +176,7 @@ public int getWriteTimeout() {
* @return Api client
*/
public ApiClient setWriteTimeout(int writeTimeout) {
- httpClient =
- httpClient
- .newBuilder()
- .writeTimeout(writeTimeout, TimeUnit.MILLISECONDS)
- .build();
+ requester.setWriteTimeout(writeTimeout);
return this;
}
@@ -672,7 +630,7 @@ public Call buildCall(
callback
);
- return httpClient.newCall(request);
+ return requester.newCall(request);
}
/**
@@ -815,26 +773,4 @@ public RequestBody buildRequestBodyFormEncoding(
}
return formBuilder.build();
}
-
- /**
- * 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;
- }
- };
- }
}
diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java
index c1322fd8be..7795c1d446 100644
--- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java
+++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java
@@ -5,61 +5,9 @@
import com.algolia.ApiException;
import com.algolia.ApiResponse;
import com.algolia.Pair;
-import com.algolia.model.AddApiKeyResponse;
-import com.algolia.model.ApiKey;
-import com.algolia.model.AssignUserIdParams;
-import com.algolia.model.BatchAssignUserIdsParams;
-import com.algolia.model.BatchDictionaryEntries;
-import com.algolia.model.BatchParams;
-import com.algolia.model.BatchResponse;
-import com.algolia.model.BatchWriteParams;
-import com.algolia.model.BrowseRequest;
-import com.algolia.model.BrowseResponse;
-import com.algolia.model.CreatedAtResponse;
-import com.algolia.model.DeleteApiKeyResponse;
-import com.algolia.model.DeleteSourceResponse;
-import com.algolia.model.DeletedAtResponse;
-import com.algolia.model.DictionarySettingsRequest;
-import com.algolia.model.GetDictionarySettingsResponse;
-import com.algolia.model.GetLogsResponse;
-import com.algolia.model.GetObjectsParams;
-import com.algolia.model.GetObjectsResponse;
-import com.algolia.model.GetTaskResponse;
-import com.algolia.model.GetTopUserIdsResponse;
-import com.algolia.model.IndexSettings;
-import com.algolia.model.Key;
-import com.algolia.model.Languages;
-import com.algolia.model.ListApiKeysResponse;
-import com.algolia.model.ListClustersResponse;
-import com.algolia.model.ListIndicesResponse;
-import com.algolia.model.ListUserIdsResponse;
-import com.algolia.model.MultipleBatchResponse;
-import com.algolia.model.MultipleQueriesParams;
-import com.algolia.model.MultipleQueriesResponse;
-import com.algolia.model.OneOfstringbuiltInOperation;
-import com.algolia.model.OperationIndexParams;
-import com.algolia.model.RemoveUserIdResponse;
-import com.algolia.model.ReplaceSourceResponse;
-import com.algolia.model.Rule;
-import com.algolia.model.SaveObjectResponse;
-import com.algolia.model.SaveSynonymResponse;
-import com.algolia.model.SearchDictionaryEntries;
-import com.algolia.model.SearchForFacetValuesRequest;
-import com.algolia.model.SearchForFacetValuesResponse;
-import com.algolia.model.SearchParams;
-import com.algolia.model.SearchResponse;
-import com.algolia.model.SearchRulesParams;
-import com.algolia.model.SearchRulesResponse;
-import com.algolia.model.SearchSynonymsResponse;
-import com.algolia.model.SearchUserIdsParams;
-import com.algolia.model.SearchUserIdsResponse;
-import com.algolia.model.Source;
-import com.algolia.model.SynonymHit;
-import com.algolia.model.UpdateApiKeyResponse;
-import com.algolia.model.UpdatedAtResponse;
-import com.algolia.model.UpdatedAtWithObjectIdResponse;
-import com.algolia.model.UpdatedRuleResponse;
-import com.algolia.model.UserId;
+import com.algolia.model.*;
+import com.algolia.utils.*;
+import com.algolia.utils.echo.*;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.ArrayList;
@@ -71,7 +19,11 @@
public class SearchApi extends ApiClient {
public SearchApi(String appId, String apiKey) {
- super(appId, apiKey);
+ super(appId, apiKey, new HttpRequester());
+ }
+
+ public SearchApi(String appId, String apiKey, Requester requester) {
+ super(appId, apiKey, requester);
}
/**
@@ -82,8 +34,10 @@ public SearchApi(String appId, String apiKey) {
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
- private Call addApiKeyCall(ApiKey apiKey, final ApiCallback _callback)
- throws ApiException {
+ private Call addApiKeyCall(
+ ApiKey apiKey,
+ final ApiCallback _callback
+ ) throws ApiException {
Object bodyObj = apiKey;
// create path and map variables
@@ -105,10 +59,9 @@ private Call addApiKeyCall(ApiKey apiKey, final ApiCallback _callback)
);
}
- @SuppressWarnings("rawtypes")
private Call addApiKeyValidateBeforeCall(
ApiKey apiKey,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'apiKey' is set
if (apiKey == null) {
@@ -129,7 +82,11 @@ private Call addApiKeyValidateBeforeCall(
* response body
*/
public AddApiKeyResponse addApiKey(ApiKey apiKey) throws ApiException {
- Call call = addApiKeyValidateBeforeCall(apiKey, null);
+ Call req = addApiKeyValidateBeforeCall(apiKey, null);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.AddApiKey(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -167,7 +124,7 @@ private Call addOrUpdateObjectCall(
String indexName,
String objectID,
Object body,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
Object bodyObj = body;
@@ -198,12 +155,11 @@ private Call addOrUpdateObjectCall(
);
}
- @SuppressWarnings("rawtypes")
private Call addOrUpdateObjectValidateBeforeCall(
String indexName,
String objectID,
Object body,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'indexName' is set
if (indexName == null) {
@@ -245,12 +201,16 @@ public UpdatedAtWithObjectIdResponse addOrUpdateObject(
String objectID,
Object body
) throws ApiException {
- Call call = addOrUpdateObjectValidateBeforeCall(
+ Call req = addOrUpdateObjectValidateBeforeCall(
indexName,
objectID,
body,
null
);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.AddOrUpdateObject(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}
.getType();
ApiResponse res =
@@ -295,8 +255,10 @@ public Call addOrUpdateObjectAsync(
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
- private Call appendSourceCall(Source source, final ApiCallback _callback)
- throws ApiException {
+ private Call appendSourceCall(
+ Source source,
+ final ApiCallback _callback
+ ) throws ApiException {
Object bodyObj = source;
// create path and map variables
@@ -318,10 +280,9 @@ private Call appendSourceCall(Source source, final ApiCallback _callback)
);
}
- @SuppressWarnings("rawtypes")
private Call appendSourceValidateBeforeCall(
Source source,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'source' is set
if (source == null) {
@@ -342,7 +303,11 @@ private Call appendSourceValidateBeforeCall(
* response body
*/
public CreatedAtResponse appendSource(Source source) throws ApiException {
- Call call = appendSourceValidateBeforeCall(source, null);
+ Call req = appendSourceValidateBeforeCall(source, null);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.AppendSource(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -378,7 +343,7 @@ public Call appendSourceAsync(
private Call assignUserIdCall(
String xAlgoliaUserID,
AssignUserIdParams assignUserIdParams,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
Object bodyObj = assignUserIdParams;
@@ -407,11 +372,10 @@ private Call assignUserIdCall(
);
}
- @SuppressWarnings("rawtypes")
private Call assignUserIdValidateBeforeCall(
String xAlgoliaUserID,
AssignUserIdParams assignUserIdParams,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'xAlgoliaUserID' is set
if (xAlgoliaUserID == null) {
@@ -446,11 +410,15 @@ public CreatedAtResponse assignUserId(
String xAlgoliaUserID,
AssignUserIdParams assignUserIdParams
) throws ApiException {
- Call call = assignUserIdValidateBeforeCall(
+ Call req = assignUserIdValidateBeforeCall(
xAlgoliaUserID,
assignUserIdParams,
null
);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.AssignUserId(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -495,7 +463,7 @@ public Call assignUserIdAsync(
private Call batchCall(
String indexName,
BatchWriteParams batchWriteParams,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
Object bodyObj = batchWriteParams;
@@ -522,11 +490,10 @@ private Call batchCall(
);
}
- @SuppressWarnings("rawtypes")
private Call batchValidateBeforeCall(
String indexName,
BatchWriteParams batchWriteParams,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'indexName' is set
if (indexName == null) {
@@ -558,7 +525,11 @@ public BatchResponse batch(
String indexName,
BatchWriteParams batchWriteParams
) throws ApiException {
- Call call = batchValidateBeforeCall(indexName, batchWriteParams, null);
+ Call req = batchValidateBeforeCall(indexName, batchWriteParams, null);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.Batch(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -596,7 +567,7 @@ public Call batchAsync(
private Call batchAssignUserIdsCall(
String xAlgoliaUserID,
BatchAssignUserIdsParams batchAssignUserIdsParams,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
Object bodyObj = batchAssignUserIdsParams;
@@ -625,11 +596,10 @@ private Call batchAssignUserIdsCall(
);
}
- @SuppressWarnings("rawtypes")
private Call batchAssignUserIdsValidateBeforeCall(
String xAlgoliaUserID,
BatchAssignUserIdsParams batchAssignUserIdsParams,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'xAlgoliaUserID' is set
if (xAlgoliaUserID == null) {
@@ -668,11 +638,15 @@ public CreatedAtResponse batchAssignUserIds(
String xAlgoliaUserID,
BatchAssignUserIdsParams batchAssignUserIdsParams
) throws ApiException {
- Call call = batchAssignUserIdsValidateBeforeCall(
+ Call req = batchAssignUserIdsValidateBeforeCall(
xAlgoliaUserID,
batchAssignUserIdsParams,
null
);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.BatchAssignUserIds(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -716,7 +690,7 @@ public Call batchAssignUserIdsAsync(
private Call batchDictionaryEntriesCall(
String dictionaryName,
BatchDictionaryEntries batchDictionaryEntries,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
Object bodyObj = batchDictionaryEntries;
@@ -743,11 +717,10 @@ private Call batchDictionaryEntriesCall(
);
}
- @SuppressWarnings("rawtypes")
private Call batchDictionaryEntriesValidateBeforeCall(
String dictionaryName,
BatchDictionaryEntries batchDictionaryEntries,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'dictionaryName' is set
if (dictionaryName == null) {
@@ -785,11 +758,17 @@ public UpdatedAtResponse batchDictionaryEntries(
String dictionaryName,
BatchDictionaryEntries batchDictionaryEntries
) throws ApiException {
- Call call = batchDictionaryEntriesValidateBeforeCall(
+ Call req = batchDictionaryEntriesValidateBeforeCall(
dictionaryName,
batchDictionaryEntries,
null
);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.BatchDictionaryEntries(
+ ((CallEcho) req).request()
+ );
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -837,7 +816,7 @@ private Call batchRulesCall(
List rule,
Boolean forwardToReplicas,
Boolean clearExistingRules,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
Object bodyObj = rule;
@@ -876,13 +855,12 @@ private Call batchRulesCall(
);
}
- @SuppressWarnings("rawtypes")
private Call batchRulesValidateBeforeCall(
String indexName,
List rule,
Boolean forwardToReplicas,
Boolean clearExistingRules,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'indexName' is set
if (indexName == null) {
@@ -926,13 +904,17 @@ public UpdatedAtResponse batchRules(
Boolean forwardToReplicas,
Boolean clearExistingRules
) throws ApiException {
- Call call = batchRulesValidateBeforeCall(
+ Call req = batchRulesValidateBeforeCall(
indexName,
rule,
forwardToReplicas,
clearExistingRules,
null
);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.BatchRules(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -982,7 +964,7 @@ public Call batchRulesAsync(
private Call browseCall(
String indexName,
BrowseRequest browseRequest,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
Object bodyObj = browseRequest;
@@ -1009,11 +991,10 @@ private Call browseCall(
);
}
- @SuppressWarnings("rawtypes")
private Call browseValidateBeforeCall(
String indexName,
BrowseRequest browseRequest,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'indexName' is set
if (indexName == null) {
@@ -1041,7 +1022,11 @@ private Call browseValidateBeforeCall(
*/
public BrowseResponse browse(String indexName, BrowseRequest browseRequest)
throws ApiException {
- Call call = browseValidateBeforeCall(indexName, browseRequest, null);
+ Call req = browseValidateBeforeCall(indexName, browseRequest, null);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.Browse(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -1086,7 +1071,7 @@ public Call browseAsync(
private Call clearAllSynonymsCall(
String indexName,
Boolean forwardToReplicas,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
Object bodyObj = null;
@@ -1119,11 +1104,10 @@ private Call clearAllSynonymsCall(
);
}
- @SuppressWarnings("rawtypes")
private Call clearAllSynonymsValidateBeforeCall(
String indexName,
Boolean forwardToReplicas,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'indexName' is set
if (indexName == null) {
@@ -1149,11 +1133,15 @@ public UpdatedAtResponse clearAllSynonyms(
String indexName,
Boolean forwardToReplicas
) throws ApiException {
- Call call = clearAllSynonymsValidateBeforeCall(
+ Call req = clearAllSynonymsValidateBeforeCall(
indexName,
forwardToReplicas,
null
);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.ClearAllSynonyms(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -1192,8 +1180,10 @@ public Call clearAllSynonymsAsync(
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
- private Call clearObjectsCall(String indexName, final ApiCallback _callback)
- throws ApiException {
+ private Call clearObjectsCall(
+ String indexName,
+ final ApiCallback _callback
+ ) throws ApiException {
Object bodyObj = null;
// create path and map variables
@@ -1219,10 +1209,9 @@ private Call clearObjectsCall(String indexName, final ApiCallback _callback)
);
}
- @SuppressWarnings("rawtypes")
private Call clearObjectsValidateBeforeCall(
String indexName,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'indexName' is set
if (indexName == null) {
@@ -1243,7 +1232,11 @@ private Call clearObjectsValidateBeforeCall(
* response body
*/
public UpdatedAtResponse clearObjects(String indexName) throws ApiException {
- Call call = clearObjectsValidateBeforeCall(indexName, null);
+ Call req = clearObjectsValidateBeforeCall(indexName, null);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.ClearObjects(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -1281,7 +1274,7 @@ public Call clearObjectsAsync(
private Call clearRulesCall(
String indexName,
Boolean forwardToReplicas,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
Object bodyObj = null;
@@ -1314,11 +1307,10 @@ private Call clearRulesCall(
);
}
- @SuppressWarnings("rawtypes")
private Call clearRulesValidateBeforeCall(
String indexName,
Boolean forwardToReplicas,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'indexName' is set
if (indexName == null) {
@@ -1344,11 +1336,11 @@ public UpdatedAtResponse clearRules(
String indexName,
Boolean forwardToReplicas
) throws ApiException {
- Call call = clearRulesValidateBeforeCall(
- indexName,
- forwardToReplicas,
- null
- );
+ Call req = clearRulesValidateBeforeCall(indexName, forwardToReplicas, null);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.ClearRules(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -1387,8 +1379,10 @@ public Call clearRulesAsync(
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
- private Call deleteApiKeyCall(String key, final ApiCallback _callback)
- throws ApiException {
+ private Call deleteApiKeyCall(
+ String key,
+ final ApiCallback _callback
+ ) throws ApiException {
Object bodyObj = null;
// create path and map variables
@@ -1414,10 +1408,9 @@ private Call deleteApiKeyCall(String key, final ApiCallback _callback)
);
}
- @SuppressWarnings("rawtypes")
private Call deleteApiKeyValidateBeforeCall(
String key,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'key' is set
if (key == null) {
@@ -1438,7 +1431,11 @@ private Call deleteApiKeyValidateBeforeCall(
* response body
*/
public DeleteApiKeyResponse deleteApiKey(String key) throws ApiException {
- Call call = deleteApiKeyValidateBeforeCall(key, null);
+ Call req = deleteApiKeyValidateBeforeCall(key, null);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.DeleteApiKey(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -1474,7 +1471,7 @@ public Call deleteApiKeyAsync(
private Call deleteByCall(
String indexName,
SearchParams searchParams,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
Object bodyObj = searchParams;
@@ -1501,11 +1498,10 @@ private Call deleteByCall(
);
}
- @SuppressWarnings("rawtypes")
private Call deleteByValidateBeforeCall(
String indexName,
SearchParams searchParams,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'indexName' is set
if (indexName == null) {
@@ -1539,7 +1535,11 @@ public DeletedAtResponse deleteBy(
String indexName,
SearchParams searchParams
) throws ApiException {
- Call call = deleteByValidateBeforeCall(indexName, searchParams, null);
+ Call req = deleteByValidateBeforeCall(indexName, searchParams, null);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.DeleteBy(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -1575,8 +1575,10 @@ public Call deleteByAsync(
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
- private Call deleteIndexCall(String indexName, final ApiCallback _callback)
- throws ApiException {
+ private Call deleteIndexCall(
+ String indexName,
+ final ApiCallback _callback
+ ) throws ApiException {
Object bodyObj = null;
// create path and map variables
@@ -1602,10 +1604,9 @@ private Call deleteIndexCall(String indexName, final ApiCallback _callback)
);
}
- @SuppressWarnings("rawtypes")
private Call deleteIndexValidateBeforeCall(
String indexName,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'indexName' is set
if (indexName == null) {
@@ -1626,7 +1627,11 @@ private Call deleteIndexValidateBeforeCall(
* response body
*/
public DeletedAtResponse deleteIndex(String indexName) throws ApiException {
- Call call = deleteIndexValidateBeforeCall(indexName, null);
+ Call req = deleteIndexValidateBeforeCall(indexName, null);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.DeleteIndex(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -1662,7 +1667,7 @@ public Call deleteIndexAsync(
private Call deleteObjectCall(
String indexName,
String objectID,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
Object bodyObj = null;
@@ -1693,11 +1698,10 @@ private Call deleteObjectCall(
);
}
- @SuppressWarnings("rawtypes")
private Call deleteObjectValidateBeforeCall(
String indexName,
String objectID,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'indexName' is set
if (indexName == null) {
@@ -1727,7 +1731,11 @@ private Call deleteObjectValidateBeforeCall(
*/
public DeletedAtResponse deleteObject(String indexName, String objectID)
throws ApiException {
- Call call = deleteObjectValidateBeforeCall(indexName, objectID, null);
+ Call req = deleteObjectValidateBeforeCall(indexName, objectID, null);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.DeleteObject(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -1768,7 +1776,7 @@ private Call deleteRuleCall(
String indexName,
String objectID,
Boolean forwardToReplicas,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
Object bodyObj = null;
@@ -1805,12 +1813,11 @@ private Call deleteRuleCall(
);
}
- @SuppressWarnings("rawtypes")
private Call deleteRuleValidateBeforeCall(
String indexName,
String objectID,
Boolean forwardToReplicas,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'indexName' is set
if (indexName == null) {
@@ -1845,12 +1852,16 @@ public UpdatedAtResponse deleteRule(
String objectID,
Boolean forwardToReplicas
) throws ApiException {
- Call call = deleteRuleValidateBeforeCall(
+ Call req = deleteRuleValidateBeforeCall(
indexName,
objectID,
forwardToReplicas,
null
);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.DeleteRule(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -1892,8 +1903,10 @@ public Call deleteRuleAsync(
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
- private Call deleteSourceCall(String source, final ApiCallback _callback)
- throws ApiException {
+ private Call deleteSourceCall(
+ String source,
+ final ApiCallback _callback
+ ) throws ApiException {
Object bodyObj = null;
// create path and map variables
@@ -1919,10 +1932,9 @@ private Call deleteSourceCall(String source, final ApiCallback _callback)
);
}
- @SuppressWarnings("rawtypes")
private Call deleteSourceValidateBeforeCall(
String source,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'source' is set
if (source == null) {
@@ -1943,7 +1955,11 @@ private Call deleteSourceValidateBeforeCall(
* response body
*/
public DeleteSourceResponse deleteSource(String source) throws ApiException {
- Call call = deleteSourceValidateBeforeCall(source, null);
+ Call req = deleteSourceValidateBeforeCall(source, null);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.DeleteSource(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -1982,7 +1998,7 @@ private Call deleteSynonymCall(
String indexName,
String objectID,
Boolean forwardToReplicas,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
Object bodyObj = null;
@@ -2019,12 +2035,11 @@ private Call deleteSynonymCall(
);
}
- @SuppressWarnings("rawtypes")
private Call deleteSynonymValidateBeforeCall(
String indexName,
String objectID,
Boolean forwardToReplicas,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'indexName' is set
if (indexName == null) {
@@ -2059,12 +2074,16 @@ public DeletedAtResponse deleteSynonym(
String objectID,
Boolean forwardToReplicas
) throws ApiException {
- Call call = deleteSynonymValidateBeforeCall(
+ Call req = deleteSynonymValidateBeforeCall(
indexName,
objectID,
forwardToReplicas,
null
);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.DeleteSynonym(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -2106,7 +2125,7 @@ public Call deleteSynonymAsync(
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
- private Call getApiKeyCall(String key, final ApiCallback _callback)
+ private Call getApiKeyCall(String key, final ApiCallback _callback)
throws ApiException {
Object bodyObj = null;
@@ -2133,10 +2152,9 @@ private Call getApiKeyCall(String key, final ApiCallback _callback)
);
}
- @SuppressWarnings("rawtypes")
private Call getApiKeyValidateBeforeCall(
String key,
- final ApiCallback _callback
+ final ApiCallback _callback
) throws ApiException {
// verify the required parameter 'key' is set
if (key == null) {
@@ -2157,7 +2175,11 @@ private Call getApiKeyValidateBeforeCall(
* response body
*/
public Key getApiKey(String key) throws ApiException {
- Call call = getApiKeyValidateBeforeCall(key, null);
+ Call req = getApiKeyValidateBeforeCall(key, null);
+ if (req instanceof CallEcho) {
+ return new EchoResponse.GetApiKey(((CallEcho) req).request());
+ }
+ Call call = (Call) req;
Type returnType = new TypeToken() {}.getType();
ApiResponse res = this.execute(call, returnType);
return res.getData();
@@ -2186,8 +2208,9 @@ public Call getApiKeyAsync(String key, final ApiCallback _callback)
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
- private Call getDictionaryLanguagesCall(final ApiCallback _callback)
- throws ApiException {
+ private Call getDictionaryLanguagesCall(
+ final ApiCallback