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> _callback + ) throws ApiException { Object bodyObj = null; // create path and map variables @@ -2209,9 +2232,8 @@ private Call getDictionaryLanguagesCall(final ApiCallback _callback) ); } - @SuppressWarnings("rawtypes") private Call getDictionaryLanguagesValidateBeforeCall( - final ApiCallback _callback + final ApiCallback> _callback ) throws ApiException { return getDictionaryLanguagesCall(_callback); } @@ -2224,7 +2246,13 @@ private Call getDictionaryLanguagesValidateBeforeCall( * response body */ public Map getDictionaryLanguages() throws ApiException { - Call call = getDictionaryLanguagesValidateBeforeCall(null); + Call req = getDictionaryLanguagesValidateBeforeCall(null); + if (req instanceof CallEcho) { + return new EchoResponse.GetDictionaryLanguages( + ((CallEcho) req).request() + ); + } + Call call = (Call) req; Type returnType = new TypeToken>() {}.getType(); ApiResponse> res = this.execute(call, returnType); return res.getData(); @@ -2253,8 +2281,9 @@ public Call getDictionaryLanguagesAsync( * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - private Call getDictionarySettingsCall(final ApiCallback _callback) - throws ApiException { + private Call getDictionarySettingsCall( + final ApiCallback _callback + ) throws ApiException { Object bodyObj = null; // create path and map variables @@ -2276,9 +2305,8 @@ private Call getDictionarySettingsCall(final ApiCallback _callback) ); } - @SuppressWarnings("rawtypes") private Call getDictionarySettingsValidateBeforeCall( - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { return getDictionarySettingsCall(_callback); } @@ -2292,7 +2320,11 @@ private Call getDictionarySettingsValidateBeforeCall( */ public GetDictionarySettingsResponse getDictionarySettings() throws ApiException { - Call call = getDictionarySettingsValidateBeforeCall(null); + Call req = getDictionarySettingsValidateBeforeCall(null); + if (req instanceof CallEcho) { + return new EchoResponse.GetDictionarySettings(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {} .getType(); ApiResponse res = @@ -2337,7 +2369,7 @@ private Call getLogsCall( Integer length, String indexName, String type, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = null; @@ -2376,13 +2408,12 @@ private Call getLogsCall( ); } - @SuppressWarnings("rawtypes") private Call getLogsValidateBeforeCall( Integer offset, Integer length, String indexName, String type, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { return getLogsCall(offset, length, indexName, type, _callback); } @@ -2408,13 +2439,11 @@ public GetLogsResponse getLogs( String indexName, String type ) throws ApiException { - Call call = getLogsValidateBeforeCall( - offset, - length, - indexName, - type, - null - ); + Call req = getLogsValidateBeforeCall(offset, length, indexName, type, null); + if (req instanceof CallEcho) { + return new EchoResponse.GetLogs(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -2469,7 +2498,7 @@ private Call getObjectCall( String indexName, String objectID, List attributesToRetrieve, - final ApiCallback _callback + final ApiCallback> _callback ) throws ApiException { Object bodyObj = null; @@ -2506,12 +2535,11 @@ private Call getObjectCall( ); } - @SuppressWarnings("rawtypes") private Call getObjectValidateBeforeCall( String indexName, String objectID, List attributesToRetrieve, - final ApiCallback _callback + final ApiCallback> _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -2546,12 +2574,16 @@ public Map getObject( String objectID, List attributesToRetrieve ) throws ApiException { - Call call = getObjectValidateBeforeCall( + Call req = getObjectValidateBeforeCall( indexName, objectID, attributesToRetrieve, null ); + if (req instanceof CallEcho) { + return new EchoResponse.GetObject(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken>() {}.getType(); ApiResponse> res = this.execute(call, returnType); return res.getData(); @@ -2595,7 +2627,7 @@ public Call getObjectAsync( */ private Call getObjectsCall( GetObjectsParams getObjectsParams, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = getObjectsParams; @@ -2618,10 +2650,9 @@ private Call getObjectsCall( ); } - @SuppressWarnings("rawtypes") private Call getObjectsValidateBeforeCall( GetObjectsParams getObjectsParams, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'getObjectsParams' is set if (getObjectsParams == null) { @@ -2643,7 +2674,11 @@ private Call getObjectsValidateBeforeCall( */ public GetObjectsResponse getObjects(GetObjectsParams getObjectsParams) throws ApiException { - Call call = getObjectsValidateBeforeCall(getObjectsParams, null); + Call req = getObjectsValidateBeforeCall(getObjectsParams, null); + if (req instanceof CallEcho) { + return new EchoResponse.GetObjects(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -2680,7 +2715,7 @@ public Call getObjectsAsync( private Call getRuleCall( String indexName, String objectID, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = null; @@ -2711,11 +2746,10 @@ private Call getRuleCall( ); } - @SuppressWarnings("rawtypes") private Call getRuleValidateBeforeCall( String indexName, String objectID, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -2744,7 +2778,11 @@ private Call getRuleValidateBeforeCall( * response body */ public Rule getRule(String indexName, String objectID) throws ApiException { - Call call = getRuleValidateBeforeCall(indexName, objectID, null); + Call req = getRuleValidateBeforeCall(indexName, objectID, null); + if (req instanceof CallEcho) { + return new EchoResponse.GetRule(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -2778,8 +2816,10 @@ public Call getRuleAsync( * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - private Call getSettingsCall(String indexName, final ApiCallback _callback) - throws ApiException { + private Call getSettingsCall( + String indexName, + final ApiCallback _callback + ) throws ApiException { Object bodyObj = null; // create path and map variables @@ -2805,10 +2845,9 @@ private Call getSettingsCall(String indexName, final ApiCallback _callback) ); } - @SuppressWarnings("rawtypes") private Call getSettingsValidateBeforeCall( String indexName, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -2829,7 +2868,11 @@ private Call getSettingsValidateBeforeCall( * response body */ public IndexSettings getSettings(String indexName) throws ApiException { - Call call = getSettingsValidateBeforeCall(indexName, null); + Call req = getSettingsValidateBeforeCall(indexName, null); + if (req instanceof CallEcho) { + return new EchoResponse.GetSettings(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -2860,7 +2903,8 @@ public Call getSettingsAsync( * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - private Call getSourcesCall(final ApiCallback _callback) throws ApiException { + private Call getSourcesCall(final ApiCallback> _callback) + throws ApiException { Object bodyObj = null; // create path and map variables @@ -2882,9 +2926,9 @@ private Call getSourcesCall(final ApiCallback _callback) throws ApiException { ); } - @SuppressWarnings("rawtypes") - private Call getSourcesValidateBeforeCall(final ApiCallback _callback) - throws ApiException { + private Call getSourcesValidateBeforeCall( + final ApiCallback> _callback + ) throws ApiException { return getSourcesCall(_callback); } @@ -2896,7 +2940,11 @@ private Call getSourcesValidateBeforeCall(final ApiCallback _callback) * response body */ public List getSources() throws ApiException { - Call call = getSourcesValidateBeforeCall(null); + Call req = getSourcesValidateBeforeCall(null); + if (req instanceof CallEcho) { + return new EchoResponse.GetSources(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken>() {}.getType(); ApiResponse> res = this.execute(call, returnType); return res.getData(); @@ -2929,7 +2977,7 @@ public Call getSourcesAsync(final ApiCallback> _callback) private Call getSynonymCall( String indexName, String objectID, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = null; @@ -2960,11 +3008,10 @@ private Call getSynonymCall( ); } - @SuppressWarnings("rawtypes") private Call getSynonymValidateBeforeCall( String indexName, String objectID, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -2994,7 +3041,11 @@ private Call getSynonymValidateBeforeCall( */ public SynonymHit getSynonym(String indexName, String objectID) throws ApiException { - Call call = getSynonymValidateBeforeCall(indexName, objectID, null); + Call req = getSynonymValidateBeforeCall(indexName, objectID, null); + if (req instanceof CallEcho) { + return new EchoResponse.GetSynonym(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -3032,7 +3083,7 @@ public Call getSynonymAsync( private Call getTaskCall( String indexName, Integer taskID, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = null; @@ -3063,11 +3114,10 @@ private Call getTaskCall( ); } - @SuppressWarnings("rawtypes") private Call getTaskValidateBeforeCall( String indexName, Integer taskID, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -3097,7 +3147,11 @@ private Call getTaskValidateBeforeCall( */ public GetTaskResponse getTask(String indexName, Integer taskID) throws ApiException { - Call call = getTaskValidateBeforeCall(indexName, taskID, null); + Call req = getTaskValidateBeforeCall(indexName, taskID, null); + if (req instanceof CallEcho) { + return new EchoResponse.GetTask(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -3130,8 +3184,9 @@ public Call getTaskAsync( * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - private Call getTopUserIdsCall(final ApiCallback _callback) - throws ApiException { + private Call getTopUserIdsCall( + final ApiCallback _callback + ) throws ApiException { Object bodyObj = null; // create path and map variables @@ -3153,9 +3208,9 @@ private Call getTopUserIdsCall(final ApiCallback _callback) ); } - @SuppressWarnings("rawtypes") - private Call getTopUserIdsValidateBeforeCall(final ApiCallback _callback) - throws ApiException { + private Call getTopUserIdsValidateBeforeCall( + final ApiCallback _callback + ) throws ApiException { return getTopUserIdsCall(_callback); } @@ -3170,7 +3225,11 @@ private Call getTopUserIdsValidateBeforeCall(final ApiCallback _callback) * response body */ public GetTopUserIdsResponse getTopUserIds() throws ApiException { - Call call = getTopUserIdsValidateBeforeCall(null); + Call req = getTopUserIdsValidateBeforeCall(null); + if (req instanceof CallEcho) { + return new EchoResponse.GetTopUserIds(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -3203,8 +3262,10 @@ public Call getTopUserIdsAsync( * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - private Call getUserIdCall(String userID, final ApiCallback _callback) - throws ApiException { + private Call getUserIdCall( + String userID, + final ApiCallback _callback + ) throws ApiException { Object bodyObj = null; // create path and map variables @@ -3230,10 +3291,9 @@ private Call getUserIdCall(String userID, final ApiCallback _callback) ); } - @SuppressWarnings("rawtypes") private Call getUserIdValidateBeforeCall( String userID, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'userID' is set if (userID == null) { @@ -3257,7 +3317,11 @@ private Call getUserIdValidateBeforeCall( * response body */ public UserId getUserId(String userID) throws ApiException { - Call call = getUserIdValidateBeforeCall(userID, null); + Call req = getUserIdValidateBeforeCall(userID, null); + if (req instanceof CallEcho) { + return new EchoResponse.GetUserId(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -3294,7 +3358,7 @@ public Call getUserIdAsync( */ private Call hasPendingMappingsCall( Boolean getClusters, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = null; @@ -3321,10 +3385,9 @@ private Call hasPendingMappingsCall( ); } - @SuppressWarnings("rawtypes") private Call hasPendingMappingsValidateBeforeCall( Boolean getClusters, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { return hasPendingMappingsCall(getClusters, _callback); } @@ -3343,7 +3406,11 @@ private Call hasPendingMappingsValidateBeforeCall( */ public CreatedAtResponse hasPendingMappings(Boolean getClusters) throws ApiException { - Call call = hasPendingMappingsValidateBeforeCall(getClusters, null); + Call req = hasPendingMappingsValidateBeforeCall(getClusters, null); + if (req instanceof CallEcho) { + return new EchoResponse.HasPendingMappings(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -3378,8 +3445,9 @@ public Call hasPendingMappingsAsync( * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - private Call listApiKeysCall(final ApiCallback _callback) - throws ApiException { + private Call listApiKeysCall( + final ApiCallback _callback + ) throws ApiException { Object bodyObj = null; // create path and map variables @@ -3401,9 +3469,9 @@ private Call listApiKeysCall(final ApiCallback _callback) ); } - @SuppressWarnings("rawtypes") - private Call listApiKeysValidateBeforeCall(final ApiCallback _callback) - throws ApiException { + private Call listApiKeysValidateBeforeCall( + final ApiCallback _callback + ) throws ApiException { return listApiKeysCall(_callback); } @@ -3415,7 +3483,11 @@ private Call listApiKeysValidateBeforeCall(final ApiCallback _callback) * response body */ public ListApiKeysResponse listApiKeys() throws ApiException { - Call call = listApiKeysValidateBeforeCall(null); + Call req = listApiKeysValidateBeforeCall(null); + if (req instanceof CallEcho) { + return new EchoResponse.ListApiKeys(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -3444,8 +3516,9 @@ public Call listApiKeysAsync( * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - private Call listClustersCall(final ApiCallback _callback) - throws ApiException { + private Call listClustersCall( + final ApiCallback _callback + ) throws ApiException { Object bodyObj = null; // create path and map variables @@ -3467,9 +3540,9 @@ private Call listClustersCall(final ApiCallback _callback) ); } - @SuppressWarnings("rawtypes") - private Call listClustersValidateBeforeCall(final ApiCallback _callback) - throws ApiException { + private Call listClustersValidateBeforeCall( + final ApiCallback _callback + ) throws ApiException { return listClustersCall(_callback); } @@ -3482,7 +3555,11 @@ private Call listClustersValidateBeforeCall(final ApiCallback _callback) * response body */ public ListClustersResponse listClusters() throws ApiException { - Call call = listClustersValidateBeforeCall(null); + Call req = listClustersValidateBeforeCall(null); + if (req instanceof CallEcho) { + return new EchoResponse.ListClusters(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -3515,8 +3592,10 @@ public Call listClustersAsync( * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - private Call listIndicesCall(Integer page, final ApiCallback _callback) - throws ApiException { + private Call listIndicesCall( + Integer page, + final ApiCallback _callback + ) throws ApiException { Object bodyObj = null; // create path and map variables @@ -3542,10 +3621,9 @@ private Call listIndicesCall(Integer page, final ApiCallback _callback) ); } - @SuppressWarnings("rawtypes") private Call listIndicesValidateBeforeCall( Integer page, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { return listIndicesCall(page, _callback); } @@ -3561,7 +3639,11 @@ private Call listIndicesValidateBeforeCall( * response body */ public ListIndicesResponse listIndices(Integer page) throws ApiException { - Call call = listIndicesValidateBeforeCall(page, null); + Call req = listIndicesValidateBeforeCall(page, null); + if (req instanceof CallEcho) { + return new EchoResponse.ListIndices(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -3601,7 +3683,7 @@ public Call listIndicesAsync( private Call listUserIdsCall( Integer page, Integer hitsPerPage, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = null; @@ -3632,11 +3714,10 @@ private Call listUserIdsCall( ); } - @SuppressWarnings("rawtypes") private Call listUserIdsValidateBeforeCall( Integer page, Integer hitsPerPage, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { return listUserIdsCall(page, hitsPerPage, _callback); } @@ -3657,7 +3738,11 @@ private Call listUserIdsValidateBeforeCall( */ public ListUserIdsResponse listUserIds(Integer page, Integer hitsPerPage) throws ApiException { - Call call = listUserIdsValidateBeforeCall(page, hitsPerPage, null); + Call req = listUserIdsValidateBeforeCall(page, hitsPerPage, null); + if (req instanceof CallEcho) { + return new EchoResponse.ListUserIds(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -3698,7 +3783,7 @@ public Call listUserIdsAsync( */ private Call multipleBatchCall( BatchParams batchParams, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = batchParams; @@ -3721,10 +3806,9 @@ private Call multipleBatchCall( ); } - @SuppressWarnings("rawtypes") private Call multipleBatchValidateBeforeCall( BatchParams batchParams, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'batchParams' is set if (batchParams == null) { @@ -3747,7 +3831,11 @@ private Call multipleBatchValidateBeforeCall( */ public MultipleBatchResponse multipleBatch(BatchParams batchParams) throws ApiException { - Call call = multipleBatchValidateBeforeCall(batchParams, null); + Call req = multipleBatchValidateBeforeCall(batchParams, null); + if (req instanceof CallEcho) { + return new EchoResponse.MultipleBatch(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -3782,7 +3870,7 @@ public Call multipleBatchAsync( */ private Call multipleQueriesCall( MultipleQueriesParams multipleQueriesParams, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = multipleQueriesParams; @@ -3805,10 +3893,9 @@ private Call multipleQueriesCall( ); } - @SuppressWarnings("rawtypes") private Call multipleQueriesValidateBeforeCall( MultipleQueriesParams multipleQueriesParams, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'multipleQueriesParams' is set if (multipleQueriesParams == null) { @@ -3832,7 +3919,11 @@ private Call multipleQueriesValidateBeforeCall( public MultipleQueriesResponse multipleQueries( MultipleQueriesParams multipleQueriesParams ) throws ApiException { - Call call = multipleQueriesValidateBeforeCall(multipleQueriesParams, null); + Call req = multipleQueriesValidateBeforeCall(multipleQueriesParams, null); + if (req instanceof CallEcho) { + return new EchoResponse.MultipleQueries(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -3871,7 +3962,7 @@ public Call multipleQueriesAsync( private Call operationIndexCall( String indexName, OperationIndexParams operationIndexParams, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = operationIndexParams; @@ -3898,11 +3989,10 @@ private Call operationIndexCall( ); } - @SuppressWarnings("rawtypes") private Call operationIndexValidateBeforeCall( String indexName, OperationIndexParams operationIndexParams, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -3935,11 +4025,15 @@ public UpdatedAtResponse operationIndex( String indexName, OperationIndexParams operationIndexParams ) throws ApiException { - Call call = operationIndexValidateBeforeCall( + Call req = operationIndexValidateBeforeCall( indexName, operationIndexParams, null ); + if (req instanceof CallEcho) { + return new EchoResponse.OperationIndex(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -3986,7 +4080,7 @@ private Call partialUpdateObjectCall( String objectID, List> oneOfstringbuiltInOperation, Boolean createIfNotExists, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = oneOfstringbuiltInOperation; @@ -4023,13 +4117,12 @@ private Call partialUpdateObjectCall( ); } - @SuppressWarnings("rawtypes") private Call partialUpdateObjectValidateBeforeCall( String indexName, String objectID, List> oneOfstringbuiltInOperation, Boolean createIfNotExists, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -4083,13 +4176,17 @@ public UpdatedAtWithObjectIdResponse partialUpdateObject( List> oneOfstringbuiltInOperation, Boolean createIfNotExists ) throws ApiException { - Call call = partialUpdateObjectValidateBeforeCall( + Call req = partialUpdateObjectValidateBeforeCall( indexName, objectID, oneOfstringbuiltInOperation, createIfNotExists, null ); + if (req instanceof CallEcho) { + return new EchoResponse.PartialUpdateObject(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {} .getType(); ApiResponse res = @@ -4140,8 +4237,10 @@ public Call partialUpdateObjectAsync( * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - private Call removeUserIdCall(String userID, final ApiCallback _callback) - throws ApiException { + private Call removeUserIdCall( + String userID, + final ApiCallback _callback + ) throws ApiException { Object bodyObj = null; // create path and map variables @@ -4167,10 +4266,9 @@ private Call removeUserIdCall(String userID, final ApiCallback _callback) ); } - @SuppressWarnings("rawtypes") private Call removeUserIdValidateBeforeCall( String userID, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'userID' is set if (userID == null) { @@ -4192,7 +4290,11 @@ private Call removeUserIdValidateBeforeCall( * response body */ public RemoveUserIdResponse removeUserId(String userID) throws ApiException { - Call call = removeUserIdValidateBeforeCall(userID, null); + Call req = removeUserIdValidateBeforeCall(userID, null); + if (req instanceof CallEcho) { + return new EchoResponse.RemoveUserId(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -4227,7 +4329,7 @@ public Call removeUserIdAsync( */ private Call replaceSourcesCall( List source, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = source; @@ -4250,10 +4352,9 @@ private Call replaceSourcesCall( ); } - @SuppressWarnings("rawtypes") private Call replaceSourcesValidateBeforeCall( List source, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'source' is set if (source == null) { @@ -4275,7 +4376,11 @@ private Call replaceSourcesValidateBeforeCall( */ public ReplaceSourceResponse replaceSources(List source) throws ApiException { - Call call = replaceSourcesValidateBeforeCall(source, null); + Call req = replaceSourcesValidateBeforeCall(source, null); + if (req instanceof CallEcho) { + return new EchoResponse.ReplaceSources(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -4307,8 +4412,10 @@ public Call replaceSourcesAsync( * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - private Call restoreApiKeyCall(String key, final ApiCallback _callback) - throws ApiException { + private Call restoreApiKeyCall( + String key, + final ApiCallback _callback + ) throws ApiException { Object bodyObj = null; // create path and map variables @@ -4334,10 +4441,9 @@ private Call restoreApiKeyCall(String key, final ApiCallback _callback) ); } - @SuppressWarnings("rawtypes") private Call restoreApiKeyValidateBeforeCall( String key, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'key' is set if (key == null) { @@ -4358,7 +4464,11 @@ private Call restoreApiKeyValidateBeforeCall( * response body */ public AddApiKeyResponse restoreApiKey(String key) throws ApiException { - Call call = restoreApiKeyValidateBeforeCall(key, null); + Call req = restoreApiKeyValidateBeforeCall(key, null); + if (req instanceof CallEcho) { + return new EchoResponse.RestoreApiKey(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -4394,7 +4504,7 @@ public Call restoreApiKeyAsync( private Call saveObjectCall( String indexName, Object body, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = body; @@ -4421,11 +4531,10 @@ private Call saveObjectCall( ); } - @SuppressWarnings("rawtypes") private Call saveObjectValidateBeforeCall( String indexName, Object body, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -4455,7 +4564,11 @@ private Call saveObjectValidateBeforeCall( */ public SaveObjectResponse saveObject(String indexName, Object body) throws ApiException { - Call call = saveObjectValidateBeforeCall(indexName, body, null); + Call req = saveObjectValidateBeforeCall(indexName, body, null); + if (req instanceof CallEcho) { + return new EchoResponse.SaveObject(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -4498,7 +4611,7 @@ private Call saveRuleCall( String objectID, Rule rule, Boolean forwardToReplicas, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = rule; @@ -4535,13 +4648,12 @@ private Call saveRuleCall( ); } - @SuppressWarnings("rawtypes") private Call saveRuleValidateBeforeCall( String indexName, String objectID, Rule rule, Boolean forwardToReplicas, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -4591,13 +4703,17 @@ public UpdatedRuleResponse saveRule( Rule rule, Boolean forwardToReplicas ) throws ApiException { - Call call = saveRuleValidateBeforeCall( + Call req = saveRuleValidateBeforeCall( indexName, objectID, rule, forwardToReplicas, null ); + if (req instanceof CallEcho) { + return new EchoResponse.SaveRule(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -4651,7 +4767,7 @@ private Call saveSynonymCall( String objectID, SynonymHit synonymHit, Boolean forwardToReplicas, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = synonymHit; @@ -4688,13 +4804,12 @@ private Call saveSynonymCall( ); } - @SuppressWarnings("rawtypes") private Call saveSynonymValidateBeforeCall( String indexName, String objectID, SynonymHit synonymHit, Boolean forwardToReplicas, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -4744,13 +4859,17 @@ public SaveSynonymResponse saveSynonym( SynonymHit synonymHit, Boolean forwardToReplicas ) throws ApiException { - Call call = saveSynonymValidateBeforeCall( + Call req = saveSynonymValidateBeforeCall( indexName, objectID, synonymHit, forwardToReplicas, null ); + if (req instanceof CallEcho) { + return new EchoResponse.SaveSynonym(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -4806,7 +4925,7 @@ private Call saveSynonymsCall( List synonymHit, Boolean forwardToReplicas, Boolean replaceExistingSynonyms, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = synonymHit; @@ -4845,13 +4964,12 @@ private Call saveSynonymsCall( ); } - @SuppressWarnings("rawtypes") private Call saveSynonymsValidateBeforeCall( String indexName, List synonymHit, Boolean forwardToReplicas, Boolean replaceExistingSynonyms, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -4896,13 +5014,17 @@ public UpdatedAtResponse saveSynonyms( Boolean forwardToReplicas, Boolean replaceExistingSynonyms ) throws ApiException { - Call call = saveSynonymsValidateBeforeCall( + Call req = saveSynonymsValidateBeforeCall( indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms, null ); + if (req instanceof CallEcho) { + return new EchoResponse.SaveSynonyms(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -4953,7 +5075,7 @@ public Call saveSynonymsAsync( private Call searchCall( String indexName, SearchParams searchParams, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = searchParams; @@ -4980,11 +5102,10 @@ private Call searchCall( ); } - @SuppressWarnings("rawtypes") private Call searchValidateBeforeCall( String indexName, SearchParams searchParams, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -5014,7 +5135,11 @@ private Call searchValidateBeforeCall( */ public SearchResponse search(String indexName, SearchParams searchParams) throws ApiException { - Call call = searchValidateBeforeCall(indexName, searchParams, null); + Call req = searchValidateBeforeCall(indexName, searchParams, null); + if (req instanceof CallEcho) { + return new EchoResponse.Search(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -5052,7 +5177,7 @@ public Call searchAsync( private Call searchDictionaryEntriesCall( String dictionaryName, SearchDictionaryEntries searchDictionaryEntries, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = searchDictionaryEntries; @@ -5079,11 +5204,10 @@ private Call searchDictionaryEntriesCall( ); } - @SuppressWarnings("rawtypes") private Call searchDictionaryEntriesValidateBeforeCall( String dictionaryName, SearchDictionaryEntries searchDictionaryEntries, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'dictionaryName' is set if (dictionaryName == null) { @@ -5121,11 +5245,17 @@ public UpdatedAtResponse searchDictionaryEntries( String dictionaryName, SearchDictionaryEntries searchDictionaryEntries ) throws ApiException { - Call call = searchDictionaryEntriesValidateBeforeCall( + Call req = searchDictionaryEntriesValidateBeforeCall( dictionaryName, searchDictionaryEntries, null ); + if (req instanceof CallEcho) { + return new EchoResponse.SearchDictionaryEntries( + ((CallEcho) req).request() + ); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -5169,7 +5299,7 @@ private Call searchForFacetValuesCall( String indexName, String facetName, SearchForFacetValuesRequest searchForFacetValuesRequest, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = searchForFacetValuesRequest; @@ -5200,12 +5330,11 @@ private Call searchForFacetValuesCall( ); } - @SuppressWarnings("rawtypes") private Call searchForFacetValuesValidateBeforeCall( String indexName, String facetName, SearchForFacetValuesRequest searchForFacetValuesRequest, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -5245,12 +5374,16 @@ public SearchForFacetValuesResponse searchForFacetValues( String facetName, SearchForFacetValuesRequest searchForFacetValuesRequest ) throws ApiException { - Call call = searchForFacetValuesValidateBeforeCall( + Call req = searchForFacetValuesValidateBeforeCall( indexName, facetName, searchForFacetValuesRequest, null ); + if (req instanceof CallEcho) { + return new EchoResponse.SearchForFacetValues(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {} .getType(); ApiResponse res = @@ -5299,7 +5432,7 @@ public Call searchForFacetValuesAsync( private Call searchRulesCall( String indexName, SearchRulesParams searchRulesParams, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = searchRulesParams; @@ -5326,11 +5459,10 @@ private Call searchRulesCall( ); } - @SuppressWarnings("rawtypes") private Call searchRulesValidateBeforeCall( String indexName, SearchRulesParams searchRulesParams, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -5362,11 +5494,15 @@ public SearchRulesResponse searchRules( String indexName, SearchRulesParams searchRulesParams ) throws ApiException { - Call call = searchRulesValidateBeforeCall( + Call req = searchRulesValidateBeforeCall( indexName, searchRulesParams, null ); + if (req instanceof CallEcho) { + return new EchoResponse.SearchRules(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -5416,7 +5552,7 @@ private Call searchSynonymsCall( String type, Integer page, Integer hitsPerPage, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = null; @@ -5459,14 +5595,13 @@ private Call searchSynonymsCall( ); } - @SuppressWarnings("rawtypes") private Call searchSynonymsValidateBeforeCall( String indexName, String query, String type, Integer page, Integer hitsPerPage, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -5506,7 +5641,7 @@ public SearchSynonymsResponse searchSynonyms( Integer page, Integer hitsPerPage ) throws ApiException { - Call call = searchSynonymsValidateBeforeCall( + Call req = searchSynonymsValidateBeforeCall( indexName, query, type, @@ -5514,6 +5649,10 @@ public SearchSynonymsResponse searchSynonyms( hitsPerPage, null ); + if (req instanceof CallEcho) { + return new EchoResponse.SearchSynonyms(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -5564,7 +5703,7 @@ public Call searchSynonymsAsync( */ private Call searchUserIdsCall( SearchUserIdsParams searchUserIdsParams, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = searchUserIdsParams; @@ -5587,10 +5726,9 @@ private Call searchUserIdsCall( ); } - @SuppressWarnings("rawtypes") private Call searchUserIdsValidateBeforeCall( SearchUserIdsParams searchUserIdsParams, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'searchUserIdsParams' is set if (searchUserIdsParams == null) { @@ -5619,7 +5757,11 @@ private Call searchUserIdsValidateBeforeCall( public SearchUserIdsResponse searchUserIds( SearchUserIdsParams searchUserIdsParams ) throws ApiException { - Call call = searchUserIdsValidateBeforeCall(searchUserIdsParams, null); + Call req = searchUserIdsValidateBeforeCall(searchUserIdsParams, null); + if (req instanceof CallEcho) { + return new EchoResponse.SearchUserIds(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -5659,7 +5801,7 @@ public Call searchUserIdsAsync( */ private Call setDictionarySettingsCall( DictionarySettingsRequest dictionarySettingsRequest, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = dictionarySettingsRequest; @@ -5682,10 +5824,9 @@ private Call setDictionarySettingsCall( ); } - @SuppressWarnings("rawtypes") private Call setDictionarySettingsValidateBeforeCall( DictionarySettingsRequest dictionarySettingsRequest, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'dictionarySettingsRequest' is set if (dictionarySettingsRequest == null) { @@ -5709,10 +5850,14 @@ private Call setDictionarySettingsValidateBeforeCall( public UpdatedAtResponse setDictionarySettings( DictionarySettingsRequest dictionarySettingsRequest ) throws ApiException { - Call call = setDictionarySettingsValidateBeforeCall( + Call req = setDictionarySettingsValidateBeforeCall( dictionarySettingsRequest, null ); + if (req instanceof CallEcho) { + return new EchoResponse.SetDictionarySettings(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -5754,7 +5899,7 @@ private Call setSettingsCall( String indexName, IndexSettings indexSettings, Boolean forwardToReplicas, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = indexSettings; @@ -5787,12 +5932,11 @@ private Call setSettingsCall( ); } - @SuppressWarnings("rawtypes") private Call setSettingsValidateBeforeCall( String indexName, IndexSettings indexSettings, Boolean forwardToReplicas, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { @@ -5833,12 +5977,16 @@ public UpdatedAtResponse setSettings( IndexSettings indexSettings, Boolean forwardToReplicas ) throws ApiException { - Call call = setSettingsValidateBeforeCall( + Call req = setSettingsValidateBeforeCall( indexName, indexSettings, forwardToReplicas, null ); + if (req instanceof CallEcho) { + return new EchoResponse.SetSettings(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); @@ -5886,7 +6034,7 @@ public Call setSettingsAsync( private Call updateApiKeyCall( String key, ApiKey apiKey, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { Object bodyObj = apiKey; @@ -5913,11 +6061,10 @@ private Call updateApiKeyCall( ); } - @SuppressWarnings("rawtypes") private Call updateApiKeyValidateBeforeCall( String key, ApiKey apiKey, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { // verify the required parameter 'key' is set if (key == null) { @@ -5947,7 +6094,11 @@ private Call updateApiKeyValidateBeforeCall( */ public UpdateApiKeyResponse updateApiKey(String key, ApiKey apiKey) throws ApiException { - Call call = updateApiKeyValidateBeforeCall(key, apiKey, null); + Call req = updateApiKeyValidateBeforeCall(key, apiKey, null); + if (req instanceof CallEcho) { + return new EchoResponse.UpdateApiKey(((CallEcho) req).request()); + } + Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); ApiResponse res = this.execute(call, returnType); return res.getData(); diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/HttpRequester.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/HttpRequester.java new file mode 100644 index 0000000000..1da39b461e --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/HttpRequester.java @@ -0,0 +1,107 @@ +package com.algolia.utils; + +import com.algolia.ApiCallback; +import com.algolia.ApiException; +import com.algolia.ProgressResponseBody; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import okhttp3.Call; +import okhttp3.Interceptor; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; + +public class HttpRequester implements Requester { + + private OkHttpClient httpClient; + private HttpLoggingInterceptor loggingInterceptor; + private boolean debugging; + + public HttpRequester() { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + + httpClient = builder.build(); + } + + public Call newCall(Request request) throws ApiException { + return httpClient.newCall(request); + } + + public void 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; + } + + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + public void setConnectTimeout(int connectionTimeout) { + httpClient = + httpClient + .newBuilder() + .connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS) + .build(); + } + + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + public void setReadTimeout(int readTimeout) { + httpClient = + httpClient + .newBuilder() + .readTimeout(readTimeout, TimeUnit.MILLISECONDS) + .build(); + } + + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + public void setWriteTimeout(int writeTimeout) { + httpClient = + httpClient + .newBuilder() + .writeTimeout(writeTimeout, TimeUnit.MILLISECONDS) + .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/utils/Requester.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/Requester.java new file mode 100644 index 0000000000..9f7f262846 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/Requester.java @@ -0,0 +1,61 @@ +package com.algolia.utils; + +import com.algolia.ApiException; +import okhttp3.Call; +import okhttp3.Request; + +public interface Requester { + public Call newCall(Request request) throws ApiException; + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + */ + public void setDebugging(boolean debugging); + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout(); + + /** + * Sets the connect timeout (in milliseconds). A value of 0 means no timeout, otherwise values + * must be between 1 and {@link Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + */ + public void setConnectTimeout(int connectionTimeout); + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout(); + + /** + * Sets the read timeout (in milliseconds). A value of 0 means no timeout, otherwise values must + * be between 1 and {@link Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + */ + public void setReadTimeout(int readTimeout); + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout(); + + /** + * Sets the write timeout (in milliseconds). A value of 0 means no timeout, otherwise values must + * be between 1 and {@link Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + */ + public void setWriteTimeout(int writeTimeout); +} diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/CallEcho.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/CallEcho.java new file mode 100644 index 0000000000..1712669790 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/CallEcho.java @@ -0,0 +1,53 @@ +package com.algolia.utils.echo; + +import java.io.IOException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Request; +import okhttp3.Response; +import okio.Timeout; + +public class CallEcho implements Call { + + private Request request; + + public CallEcho(Request request) { + this.request = request; + } + + @Override + public Request request() { + return request; + } + + @Override + public void cancel() {} + + @Override + public Call clone() { + return null; + } + + @Override + public void enqueue(Callback arg0) {} + + @Override + public Response execute() throws IOException { + return null; + } + + @Override + public boolean isExecuted() { + return false; + } + + @Override + public boolean isCanceled() { + return false; + } + + @Override + public Timeout timeout() { + return null; + } +} diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoRequester.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoRequester.java new file mode 100644 index 0000000000..7719400fcd --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoRequester.java @@ -0,0 +1,34 @@ +package com.algolia.utils.echo; + +import com.algolia.ApiException; +import com.algolia.utils.Requester; +import okhttp3.Request; + +public class EchoRequester implements Requester { + + public CallEcho newCall(Request request) throws ApiException { + return new CallEcho(request); + } + + // NO-OP for now + + public void setDebugging(boolean debugging) {} + + public int getConnectTimeout() { + return 100; + } + + public void setConnectTimeout(int connectionTimeout) {} + + public int getReadTimeout() { + return 100; + } + + public void setReadTimeout(int readTimeout) {} + + public int getWriteTimeout() { + return 100; + } + + public void setWriteTimeout(int writeTimeout) {} +} diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponse.java new file mode 100644 index 0000000000..ba47fd2d70 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponse.java @@ -0,0 +1,1329 @@ +package com.algolia.utils.echo; + +import com.algolia.model.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import okhttp3.Request; +import okio.Buffer; + +public class EchoResponse { + + private static String parseRequestBody(Request req) { + try { + final Request copy = req.newBuilder().build(); + final Buffer buffer = new Buffer(); + copy.body().writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + return "error"; + } + } + + public static class AddApiKey + extends AddApiKeyResponse + implements EchoResponseInterface { + + private Request request; + + public AddApiKey(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class AddOrUpdateObject + extends UpdatedAtWithObjectIdResponse + implements EchoResponseInterface { + + private Request request; + + public AddOrUpdateObject(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class AppendSource + extends CreatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public AppendSource(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class AssignUserId + extends CreatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public AssignUserId(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class Batch + extends BatchResponse + implements EchoResponseInterface { + + private Request request; + + public Batch(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class BatchAssignUserIds + extends CreatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public BatchAssignUserIds(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class BatchDictionaryEntries + extends UpdatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public BatchDictionaryEntries(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class BatchRules + extends UpdatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public BatchRules(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class Browse + extends BrowseResponse + implements EchoResponseInterface { + + private Request request; + + public Browse(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class ClearAllSynonyms + extends UpdatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public ClearAllSynonyms(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class ClearObjects + extends UpdatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public ClearObjects(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class ClearRules + extends UpdatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public ClearRules(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class DeleteApiKey + extends DeleteApiKeyResponse + implements EchoResponseInterface { + + private Request request; + + public DeleteApiKey(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class DeleteBy + extends DeletedAtResponse + implements EchoResponseInterface { + + private Request request; + + public DeleteBy(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class DeleteIndex + extends DeletedAtResponse + implements EchoResponseInterface { + + private Request request; + + public DeleteIndex(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class DeleteObject + extends DeletedAtResponse + implements EchoResponseInterface { + + private Request request; + + public DeleteObject(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class DeleteRule + extends UpdatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public DeleteRule(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class DeleteSource + extends DeleteSourceResponse + implements EchoResponseInterface { + + private Request request; + + public DeleteSource(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class DeleteSynonym + extends DeletedAtResponse + implements EchoResponseInterface { + + private Request request; + + public DeleteSynonym(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class GetApiKey extends Key implements EchoResponseInterface { + + private Request request; + + public GetApiKey(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class GetDictionaryLanguages + extends HashMap + implements EchoResponseInterface { + + private Request request; + + public GetDictionaryLanguages(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class GetDictionarySettings + extends GetDictionarySettingsResponse + implements EchoResponseInterface { + + private Request request; + + public GetDictionarySettings(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class GetLogs + extends GetLogsResponse + implements EchoResponseInterface { + + private Request request; + + public GetLogs(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class GetObject + extends HashMap + implements EchoResponseInterface { + + private Request request; + + public GetObject(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class GetObjects + extends GetObjectsResponse + implements EchoResponseInterface { + + private Request request; + + public GetObjects(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class GetRule extends Rule implements EchoResponseInterface { + + private Request request; + + public GetRule(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class GetSettings + extends IndexSettings + implements EchoResponseInterface { + + private Request request; + + public GetSettings(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class GetSources + extends ArrayList + implements EchoResponseInterface { + + private Request request; + + public GetSources(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class GetSynonym + extends SynonymHit + implements EchoResponseInterface { + + private Request request; + + public GetSynonym(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class GetTask + extends GetTaskResponse + implements EchoResponseInterface { + + private Request request; + + public GetTask(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class GetTopUserIds + extends GetTopUserIdsResponse + implements EchoResponseInterface { + + private Request request; + + public GetTopUserIds(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class GetUserId + extends UserId + implements EchoResponseInterface { + + private Request request; + + public GetUserId(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class HasPendingMappings + extends CreatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public HasPendingMappings(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class ListApiKeys + extends ListApiKeysResponse + implements EchoResponseInterface { + + private Request request; + + public ListApiKeys(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class ListClusters + extends ListClustersResponse + implements EchoResponseInterface { + + private Request request; + + public ListClusters(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class ListIndices + extends ListIndicesResponse + implements EchoResponseInterface { + + private Request request; + + public ListIndices(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class ListUserIds + extends ListUserIdsResponse + implements EchoResponseInterface { + + private Request request; + + public ListUserIds(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class MultipleBatch + extends MultipleBatchResponse + implements EchoResponseInterface { + + private Request request; + + public MultipleBatch(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class MultipleQueries + extends MultipleQueriesResponse + implements EchoResponseInterface { + + private Request request; + + public MultipleQueries(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class OperationIndex + extends UpdatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public OperationIndex(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class PartialUpdateObject + extends UpdatedAtWithObjectIdResponse + implements EchoResponseInterface { + + private Request request; + + public PartialUpdateObject(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class RemoveUserId + extends RemoveUserIdResponse + implements EchoResponseInterface { + + private Request request; + + public RemoveUserId(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class ReplaceSources + extends ReplaceSourceResponse + implements EchoResponseInterface { + + private Request request; + + public ReplaceSources(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class RestoreApiKey + extends AddApiKeyResponse + implements EchoResponseInterface { + + private Request request; + + public RestoreApiKey(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class SaveObject + extends SaveObjectResponse + implements EchoResponseInterface { + + private Request request; + + public SaveObject(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class SaveRule + extends UpdatedRuleResponse + implements EchoResponseInterface { + + private Request request; + + public SaveRule(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class SaveSynonym + extends SaveSynonymResponse + implements EchoResponseInterface { + + private Request request; + + public SaveSynonym(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class SaveSynonyms + extends UpdatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public SaveSynonyms(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class Search + extends SearchResponse + implements EchoResponseInterface { + + private Request request; + + public Search(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class SearchDictionaryEntries + extends UpdatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public SearchDictionaryEntries(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class SearchForFacetValues + extends SearchForFacetValuesResponse + implements EchoResponseInterface { + + private Request request; + + public SearchForFacetValues(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class SearchRules + extends SearchRulesResponse + implements EchoResponseInterface { + + private Request request; + + public SearchRules(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class SearchSynonyms + extends SearchSynonymsResponse + implements EchoResponseInterface { + + private Request request; + + public SearchSynonyms(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class SearchUserIds + extends SearchUserIdsResponse + implements EchoResponseInterface { + + private Request request; + + public SearchUserIds(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class SetDictionarySettings + extends UpdatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public SetDictionarySettings(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class SetSettings + extends UpdatedAtResponse + implements EchoResponseInterface { + + private Request request; + + public SetSettings(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + + public static class UpdateApiKey + extends UpdateApiKeyResponse + implements EchoResponseInterface { + + private Request request; + + public UpdateApiKey(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } +} diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponseInterface.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponseInterface.java new file mode 100644 index 0000000000..60c99a6ec6 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponseInterface.java @@ -0,0 +1,9 @@ +package com.algolia.utils.echo; + +public interface EchoResponseInterface { + public String getPath(); + + public String getMethod(); + + public String getBody(); +} diff --git a/clients/algoliasearch-client-java-2/pom.xml b/clients/algoliasearch-client-java-2/pom.xml index 86b619a5bd..f1d434e47f 100644 --- a/clients/algoliasearch-client-java-2/pom.xml +++ b/clients/algoliasearch-client-java-2/pom.xml @@ -67,22 +67,6 @@ - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0-M4 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - 10 - - maven-dependency-plugin diff --git a/package.json b/package.json index 95252af214..87bc173ef8 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "build:clients": "./scripts/multiplexer.sh ${2:-nonverbose} ./scripts/builds/clients.sh ${0:-all} ${1:-all}", "build:specs": "./scripts/builds/specs.sh ${0:-all} ${1:-yml}", "build": "yarn build:specs && yarn build:clients", - "clean": "rm -rf **/dist **/build **/node_modules", - "cts:generate": "yarn workspace tests build && ./scripts/multiplexer.sh ${2:-nonverbose} yarn workspace tests generate ${0:-all} ${1:-all} && yarn workspace tests lint:fix", + "clean": "rm -rf **/dist **/build **/node_modules **/target", + "cts:generate": "yarn workspace tests build && ./scripts/multiplexer.sh ${2:-nonverbose} yarn workspace tests generate ${0:-all} ${1:-all}", "cts:test": "./scripts/multiplexer.sh ${1:-nonverbose} ./scripts/runCTS.sh ${0:-javascript} all", "docker:build": "./scripts/docker/build.sh", "docker:clean": "docker stop dev; docker rm -f dev; docker image rm -f api-clients-automation", @@ -42,6 +42,7 @@ "eslint-plugin-unused-imports": "2.0.0", "eslint-plugin-yml": "0.12.0", "json": "11.0.0", + "mustache": "4.2.0", "prettier": "2.5.1", "prettier-plugin-java": "1.6.0", "typescript": "4.5.4" diff --git a/scripts/builds/clients.sh b/scripts/builds/clients.sh index aabb944e43..0b5cc3ffec 100755 --- a/scripts/builds/clients.sh +++ b/scripts/builds/clients.sh @@ -19,7 +19,7 @@ build_client(){ if [[ $lang == 'javascript' ]]; then yarn workspace $package build elif [[ $lang == 'java' ]]; then - CMD="mvn clean install -f clients/$package/pom.xml" + CMD="mvn install -f clients/$package/pom.xml" if [[ $VERBOSE == "true" ]]; then $CMD else diff --git a/scripts/post-gen/java.sh b/scripts/post-gen/java.sh index 5d3c52664b..9cba61f159 100755 --- a/scripts/post-gen/java.sh +++ b/scripts/post-gen/java.sh @@ -15,6 +15,21 @@ find "$CLIENT" -type f -name "*.java" | xargs sed -i -e 's~= {}~= new Object()~g echo "package com.algolia.model;public class OneOfintegerstring {}" > $CLIENT/algoliasearch-core/com/algolia/model/OneOfintegerstring.java echo "package com.algolia.model;public class OneOfstringbuiltInOperation {}" > $CLIENT/algoliasearch-core/com/algolia/model/OneOfstringbuiltInOperation.java +# Generate types for the EchoRequester, to be able to keep the correct response type on the API method. + +# Extract the normal response to extend it +responses=($(grep -o 'public .*ApiCallback<.*>' $CLIENT/algoliasearch-core/com/algolia/**/*Api.java | sed 's/public.*ApiCallback$//; s/ //; s/^Map $CLIENT/algoliasearch-core/com/algolia/utils/echo/EchoResponse.java + format_client() { echo "> Formatting $GENERATOR..." @@ -34,7 +49,7 @@ format_client() { --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \ -jar dist/$javaFormatter -r - CMD="yarn prettier --write $CLIENT/**/*.java" + CMD="yarn prettier --write $CLIENT" if [[ $VERBOSE == "true" ]]; then $CMD else diff --git a/scripts/post-gen/javaEchoResponse.mustache b/scripts/post-gen/javaEchoResponse.mustache new file mode 100644 index 0000000000..8028cb3d8d --- /dev/null +++ b/scripts/post-gen/javaEchoResponse.mustache @@ -0,0 +1,44 @@ +package com.algolia.utils.echo; + +import java.io.IOException; +import com.algolia.model.*; +import okhttp3.Request; +import java.util.ArrayList; +import java.util.HashMap; +import okio.Buffer; + +public class EchoResponse { + + private static String parseRequestBody(Request req) { + try { + final Request copy = req.newBuilder().build(); + final Buffer buffer = new Buffer(); + copy.body().writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + return "error"; + } + } + + {{#responses}} + public static class {{{className}}} extends {{{superClass}}} implements EchoResponseInterface { + private Request request; + + public {{{className}}}(Request request) { + this.request = request; + } + + public String getPath() { + return request.url().encodedPath(); + } + + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } + } + {{/responses}} +} diff --git a/templates/java/libraries/okhttp-gson/ApiClient.mustache b/templates/java/libraries/okhttp-gson/ApiClient.mustache index e729d7161e..991a5644dd 100644 --- a/templates/java/libraries/okhttp-gson/ApiClient.mustache +++ b/templates/java/libraries/okhttp-gson/ApiClient.mustache @@ -1,5 +1,7 @@ package {{invokerPackage}}; +import com.algolia.utils.Requester; + import okhttp3.*; import okhttp3.internal.http.HttpMethod; import okhttp3.logging.HttpLoggingInterceptor; @@ -30,36 +32,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("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); - 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; } /** @@ -135,19 +122,7 @@ public class ApiClient { * @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; } @@ -157,7 +132,7 @@ public class ApiClient { * @return Timeout in milliseconds */ public int getConnectTimeout() { - return httpClient.connectTimeoutMillis(); + return requester.getConnectTimeout(); } /** @@ -169,7 +144,7 @@ public class ApiClient { * @return Api client */ public ApiClient setConnectTimeout(int connectionTimeout) { - httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + requester.setConnectTimeout(connectionTimeout); return this; } @@ -179,7 +154,7 @@ public class ApiClient { * @return Timeout in milliseconds */ public int getReadTimeout() { - return httpClient.readTimeoutMillis(); + return requester.getReadTimeout(); } /** @@ -191,7 +166,7 @@ public class ApiClient { * @return Api client */ public ApiClient setReadTimeout(int readTimeout) { - httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + requester.setReadTimeout(readTimeout); return this; } @@ -201,7 +176,7 @@ public class ApiClient { * @return Timeout in milliseconds */ public int getWriteTimeout() { - return httpClient.writeTimeoutMillis(); + return requester.getWriteTimeout(); } /** @@ -213,7 +188,7 @@ public class ApiClient { * @return Api client */ public ApiClient setWriteTimeout(int writeTimeout) { - httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + requester.setWriteTimeout(writeTimeout); return this; } @@ -611,7 +586,7 @@ public class ApiClient { public Call buildCall(String path, String method, List queryParams, Object body, Map headerParams, ApiCallback callback) throws ApiException { Request request = buildRequest(path, method, queryParams, body, headerParams, callback); - return httpClient.newCall(request); + return requester.newCall(request); } /** @@ -732,25 +707,4 @@ public class ApiClient { } 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/templates/java/libraries/okhttp-gson/README.mustache b/templates/java/libraries/okhttp-gson/README.mustache deleted file mode 100644 index f3620a9cd3..0000000000 --- a/templates/java/libraries/okhttp-gson/README.mustache +++ /dev/null @@ -1,72 +0,0 @@ -# {{artifactId}} - -{{appName}} -- API version: {{appVersion}} - -{{{appDescriptionWithNewLines}}} -{{#infoUrl}} - - For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - -*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* - -## Requirements - -Building the API client library requires: -1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ -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 - - {{{groupId}}} - {{{artifactId}}} - {{{artifactVersion}}} - compile - -``` - -### Gradle users - -Add this dependency to your project's build file: - -```groovy -compile "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}" -``` - -### Others - -At first generate the JAR by executing: - -```shell -mvn clean package -``` - -Then manually install the following JARs: - -* `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` -* `target/lib/*.jar` - -## Getting Started - -Checkout the playground. diff --git a/templates/java/libraries/okhttp-gson/api.mustache b/templates/java/libraries/okhttp-gson/api.mustache index dfac1c987a..d8b4129ca0 100644 --- a/templates/java/libraries/okhttp-gson/api.mustache +++ b/templates/java/libraries/okhttp-gson/api.mustache @@ -9,9 +9,11 @@ import {{invokerPackage}}.Pair; import com.google.gson.reflect.TypeToken; import okhttp3.Call; +import okhttp3.Request; -{{#imports}}import {{import}}; -{{/imports}} +import com.algolia.utils.*; +import com.algolia.utils.echo.*; +import com.algolia.model.*; import java.lang.reflect.Type; {{^fullJavaUtil}} @@ -24,7 +26,11 @@ import java.util.Map; {{#operations}} public class {{classname}} extends ApiClient { public {{classname}}(String appId, String apiKey) { - super(appId, apiKey); + super(appId, apiKey, new HttpRequester()); + } + + public {{classname}}(String appId, String apiKey, Requester requester) { + super(appId, apiKey, requester); } {{#operation}} @@ -45,7 +51,7 @@ public class {{classname}} extends ApiClient { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - private Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { + private Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{{returnType}}}> _callback) throws ApiException { Object bodyObj = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; // create path and map variables @@ -76,8 +82,7 @@ public class {{classname}} extends ApiClient { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - @SuppressWarnings("rawtypes") - private Call {{operationId}}ValidateBeforeCall({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { + private Call {{operationId}}ValidateBeforeCall({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{{returnType}}}> _callback) throws ApiException { {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { @@ -105,10 +110,14 @@ public class {{classname}} extends ApiClient { @Deprecated {{/isDeprecated}} public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - Call call = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); + Call req = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); + if (req instanceof CallEcho) { + {{#returnType}}return new EchoResponse.{{#lambda.titlecase}}{{{operationId}}}{{/lambda.titlecase}}(((CallEcho)req).request());{{/returnType}} + } + Call call = (Call)req; {{#returnType}}Type returnType = new TypeToken<{{{.}}}>(){}.getType(); ApiResponse<{{{.}}}> res = this.execute(call, returnType); - return res.getData();{{/returnType}}{{^returnType}}return this.execute(call).getData();{{/returnType}} + return res.getData();{{/returnType}}{{^returnType}}this.execute(call).getData();{{/returnType}} } /** * (asynchronously) diff --git a/templates/java/libraries/okhttp-gson/pom.mustache b/templates/java/libraries/okhttp-gson/pom.mustache index c366b27545..7f48155402 100644 --- a/templates/java/libraries/okhttp-gson/pom.mustache +++ b/templates/java/libraries/okhttp-gson/pom.mustache @@ -74,22 +74,6 @@ - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0-M4 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - 10 - - maven-dependency-plugin diff --git a/tests/output/java/tests/searchRequests.java b/tests/output/java/tests/searchRequests.java deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/package.json b/tests/package.json index 82fd1ec450..cdc3063807 100644 --- a/tests/package.json +++ b/tests/package.json @@ -6,7 +6,6 @@ ], "scripts": { "build": "tsc", - "lint:fix": "yarn workspace javascript-tests lint:fix", "generate": "yarn generate:methods:requets ${0:-javascript} ${1:-search}", "generate:methods:requets": "node dist/tests/src/methods/requests/main.js ${0:-javascript} ${1:-search}", "start": "yarn build && yarn generate ${0:-javascript} ${1:-search} && yarn lint:fix" diff --git a/yarn.lock b/yarn.lock index fb69be092b..3a4b9ec327 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25,6 +25,7 @@ __metadata: eslint-plugin-unused-imports: 2.0.0 eslint-plugin-yml: 0.12.0 json: 11.0.0 + mustache: 4.2.0 prettier: 2.5.1 prettier-plugin-java: 1.6.0 typescript: 4.5.4