diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/ApiClient.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/ApiClient.java index adf1e820ff..f726c3515f 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/ApiClient.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/ApiClient.java @@ -283,7 +283,7 @@ public void onResponse(Call call, Response response) public Call buildCall( String path, String method, - Map queryParameters, + Map queryParameters, Object body, Map headerParams, RequestOptions requestOptions @@ -317,7 +317,7 @@ public Call buildCall( public Request buildRequest( String path, String method, - Map queryParameters, + Map queryParameters, Object body, Map headerParams, RequestOptions requestOptions @@ -363,37 +363,24 @@ public Request buildRequest( */ public String buildUrl( String path, - Map queryParameters, - Map extraQueryParameters + Map queryParameters, + Map extraQueryParameters ) { - StringBuilder url = new StringBuilder(); + if (extraQueryParameters != null) { + for (Entry param : extraQueryParameters.entrySet()) { + queryParameters.put(param.getKey(), param.getValue()); + } + } + + final StringBuilder url = new StringBuilder(); // The real host will be assigned by the retry strategy url.append("http://temp.path").append(path); - url = parseQueryParameters(path, url, queryParameters); - url = parseQueryParameters(path, url, extraQueryParameters); - - return url.toString(); - } - - /** - * Parses the given map of Query Parameters to a given URL. - * - * @param path The sub path - * @param url The url to add queryParameters to - * @param queryParameters The query parameters - * @return The URL - */ - public StringBuilder parseQueryParameters( - String path, - StringBuilder url, - Map queryParameters - ) { if (queryParameters != null && !queryParameters.isEmpty()) { // support (constant) query string in `path`, e.g. "/posts?draft=1" String prefix = path.contains("?") ? "&" : "?"; - for (Entry param : queryParameters.entrySet()) { + for (Entry param : queryParameters.entrySet()) { if (param.getValue() != null) { if (prefix != null) { url.append(prefix); @@ -410,7 +397,7 @@ public StringBuilder parseQueryParameters( } } - return url; + return url.toString(); } /** diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/AbtestingClient.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/AbtestingClient.java index 0e80829d6e..9397a64bb9 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/AbtestingClient.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/AbtestingClient.java @@ -133,7 +133,7 @@ public CompletableFuture addABTestsAsync( // create path and map variables String requestPath = "/2/abtests"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -217,7 +217,7 @@ public CompletableFuture delAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -310,7 +310,7 @@ public CompletableFuture deleteABTestAsync( this.escapeString(id.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -393,7 +393,7 @@ public CompletableFuture getAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -485,7 +485,7 @@ public CompletableFuture getABTestAsync( this.escapeString(id.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -568,7 +568,7 @@ public CompletableFuture listABTestsAsync( // create path and map variables String requestPath = "/2/abtests"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (offset != null) { @@ -678,7 +678,7 @@ public CompletableFuture postAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -791,7 +791,7 @@ public CompletableFuture putAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -888,7 +888,7 @@ public CompletableFuture stopABTestAsync( this.escapeString(id.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/AnalyticsClient.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/AnalyticsClient.java index ed01620746..7004497339 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/AnalyticsClient.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/AnalyticsClient.java @@ -142,7 +142,7 @@ public CompletableFuture delAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -248,7 +248,7 @@ public CompletableFuture getAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -391,7 +391,7 @@ public CompletableFuture getAverageClickPositio // create path and map variables String requestPath = "/2/clicks/averageClickPosition"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -548,7 +548,7 @@ public CompletableFuture getClickPositionsAsync( // create path and map variables String requestPath = "/2/clicks/positions"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -691,7 +691,7 @@ public CompletableFuture getClickThroughRateAsync( // create path and map variables String requestPath = "/2/clicks/clickThroughRate"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -840,7 +840,7 @@ public CompletableFuture getConversationRateAsync( // create path and map variables String requestPath = "/2/conversions/conversionRate"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -989,7 +989,7 @@ public CompletableFuture getNoClickRateAsync( // create path and map variables String requestPath = "/2/searches/noClickRate"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -1132,7 +1132,7 @@ public CompletableFuture getNoResultsRateAsync( // create path and map variables String requestPath = "/2/searches/noResultRate"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -1273,7 +1273,7 @@ public CompletableFuture getSearchesCountAsync( // create path and map variables String requestPath = "/2/searches/count"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -1452,7 +1452,7 @@ public CompletableFuture getSearchesNoClicksAsync( // create path and map variables String requestPath = "/2/searches/noClicks"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -1664,7 +1664,7 @@ public CompletableFuture getSearchesNoResultsAsync // create path and map variables String requestPath = "/2/searches/noResults"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -1803,7 +1803,7 @@ public CompletableFuture getStatusAsync( // create path and map variables String requestPath = "/2/status"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -1951,7 +1951,7 @@ public CompletableFuture getTopCountriesAsync( // create path and map variables String requestPath = "/2/countries"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -2171,7 +2171,7 @@ public CompletableFuture getTopFilterAttributesA // create path and map variables String requestPath = "/2/filters"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -2432,7 +2432,7 @@ public CompletableFuture getTopFilterForAttrib this.escapeString(attribute.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -2675,7 +2675,7 @@ public CompletableFuture getTopFiltersNoResultsA // create path and map variables String requestPath = "/2/filters/noResults"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -2923,7 +2923,7 @@ public CompletableFuture getTopHitsAsync( // create path and map variables String requestPath = "/2/hits"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -3188,7 +3188,7 @@ public CompletableFuture getTopSearchesAsync( // create path and map variables String requestPath = "/2/searches"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -3387,7 +3387,7 @@ public CompletableFuture getUsersCountAsync( // create path and map variables String requestPath = "/2/users/count"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (index != null) { @@ -3509,7 +3509,7 @@ public CompletableFuture postAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -3622,7 +3622,7 @@ public CompletableFuture putAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/InsightsClient.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/InsightsClient.java index 01a4abadc2..2c75b248ed 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/InsightsClient.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/InsightsClient.java @@ -142,7 +142,7 @@ public CompletableFuture delAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -248,7 +248,7 @@ public CompletableFuture getAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -360,7 +360,7 @@ public CompletableFuture postAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -470,7 +470,7 @@ public CompletableFuture pushEventsAsync( // create path and map variables String requestPath = "/1/events"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -560,7 +560,7 @@ public CompletableFuture putAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/PersonalizationClient.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/PersonalizationClient.java index 7958c32a12..c7a61b2e3c 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/PersonalizationClient.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/PersonalizationClient.java @@ -128,7 +128,7 @@ public CompletableFuture delAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -235,7 +235,7 @@ public CompletableFuture deleteUserProfileAsync( this.escapeString(userToken.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -319,7 +319,7 @@ public CompletableFuture getAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -404,7 +404,7 @@ public CompletableFuture getPersonalizationStrate // create path and map variables String requestPath = "/1/strategies/personalization"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -489,7 +489,7 @@ public CompletableFuture getUserTokenProfileAsync( this.escapeString(userToken.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -579,7 +579,7 @@ public CompletableFuture postAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -692,7 +692,7 @@ public CompletableFuture putAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -793,7 +793,7 @@ public CompletableFuture setPersonalizationS // create path and map variables String requestPath = "/1/strategies/personalization"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/PredictClient.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/PredictClient.java index 81b8dc33dc..88cde56028 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/PredictClient.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/PredictClient.java @@ -124,7 +124,7 @@ public CompletableFuture delAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -237,7 +237,7 @@ public CompletableFuture fetchUserProfileAsync( this.escapeString(userID.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -322,7 +322,7 @@ public CompletableFuture getAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -434,7 +434,7 @@ public CompletableFuture postAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -547,7 +547,7 @@ public CompletableFuture putAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/QuerySuggestionsClient.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/QuerySuggestionsClient.java index 3b1d7a2f4b..a3d16934e5 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/QuerySuggestionsClient.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/QuerySuggestionsClient.java @@ -119,7 +119,7 @@ public CompletableFuture createConfigAsync( // create path and map variables String requestPath = "/1/configs"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -203,7 +203,7 @@ public CompletableFuture delAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -302,7 +302,7 @@ public CompletableFuture deleteConfigAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -385,7 +385,7 @@ public CompletableFuture getAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -468,7 +468,7 @@ public CompletableFuture> getAllConfigsAsync( // create path and map variables String requestPath = "/1/configs"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -540,7 +540,7 @@ public CompletableFuture getConfigAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -618,7 +618,7 @@ public CompletableFuture getConfigStatusAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -690,7 +690,7 @@ public CompletableFuture> getLogFileAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -779,7 +779,7 @@ public CompletableFuture postAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -892,7 +892,7 @@ public CompletableFuture putAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -1003,7 +1003,7 @@ public CompletableFuture updateConfigAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/RecommendClient.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/RecommendClient.java index dfbb12421a..ca123ddb44 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/RecommendClient.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/RecommendClient.java @@ -162,7 +162,7 @@ public CompletableFuture delAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -268,7 +268,7 @@ public CompletableFuture getAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -364,7 +364,7 @@ public CompletableFuture getRecommendationsAsync( // create path and map variables String requestPath = "/1/indexes/*/recommendations"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -454,7 +454,7 @@ public CompletableFuture postAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -567,7 +567,7 @@ public CompletableFuture putAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/SearchClient.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/SearchClient.java index 45de70990c..563d0f0157 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/SearchClient.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/SearchClient.java @@ -147,7 +147,7 @@ public CompletableFuture addApiKeyAsync( // create path and map variables String requestPath = "/1/keys"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -247,7 +247,7 @@ public CompletableFuture addOrUpdateObjectAsync( ) .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -319,7 +319,7 @@ public CompletableFuture appendSourceAsync( // create path and map variables String requestPath = "/1/security/sources/append"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -407,7 +407,7 @@ public CompletableFuture assignUserIdAsync( // create path and map variables String requestPath = "/1/clusters/mapping"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (xAlgoliaUserID != null) { @@ -499,7 +499,7 @@ public CompletableFuture batchAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -596,7 +596,7 @@ public CompletableFuture batchAssignUserIdsAsync( // create path and map variables String requestPath = "/1/clusters/mapping/batch"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (xAlgoliaUserID != null) { @@ -702,7 +702,7 @@ public CompletableFuture batchDictionaryEntriesAsync( this.escapeString(dictionaryName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -833,7 +833,7 @@ public CompletableFuture batchRulesAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (forwardToReplicas != null) { @@ -971,7 +971,7 @@ public CompletableFuture browseAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -1079,7 +1079,7 @@ public CompletableFuture clearAllSynonymsAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (forwardToReplicas != null) { @@ -1174,7 +1174,7 @@ public CompletableFuture clearObjectsAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -1269,7 +1269,7 @@ public CompletableFuture clearRulesAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (forwardToReplicas != null) { @@ -1373,7 +1373,7 @@ public CompletableFuture delAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -1468,7 +1468,7 @@ public CompletableFuture deleteApiKeyAsync( this.escapeString(key.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -1558,7 +1558,7 @@ public CompletableFuture deleteByAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -1632,7 +1632,7 @@ public CompletableFuture deleteIndexAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -1718,7 +1718,7 @@ public CompletableFuture deleteObjectAsync( ) .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -1827,7 +1827,7 @@ public CompletableFuture deleteRuleAsync( ) .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (forwardToReplicas != null) { @@ -1924,7 +1924,7 @@ public CompletableFuture deleteSourceAsync( this.escapeString(source.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -2032,7 +2032,7 @@ public CompletableFuture deleteSynonymAsync( ) .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (forwardToReplicas != null) { @@ -2145,7 +2145,7 @@ public CompletableFuture getAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -2237,7 +2237,7 @@ public CompletableFuture getApiKeyAsync( this.escapeString(key.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -2295,7 +2295,7 @@ public CompletableFuture> getDictionaryLanguagesAsync( // create path and map variables String requestPath = "/1/dictionaries/*/languages"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -2355,7 +2355,7 @@ public CompletableFuture getDictionarySettingsAsy // create path and map variables String requestPath = "/1/dictionaries/*/settings"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -2453,7 +2453,7 @@ public CompletableFuture getLogsAsync( // create path and map variables String requestPath = "/1/logs"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (offset != null) { @@ -2591,7 +2591,7 @@ public CompletableFuture> getObjectAsync( ) .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (attributesToRetrieve != null) { @@ -2687,7 +2687,7 @@ public CompletableFuture getObjectsAsync( // create path and map variables String requestPath = "/1/indexes/*/objects"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -2773,7 +2773,7 @@ public CompletableFuture getRuleAsync( ) .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -2847,7 +2847,7 @@ public CompletableFuture getSettingsAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -2903,7 +2903,7 @@ public CompletableFuture> getSourcesAsync( // create path and map variables String requestPath = "/1/security/sources"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -2988,7 +2988,7 @@ public CompletableFuture getSynonymAsync( ) .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -3075,7 +3075,7 @@ public CompletableFuture getTaskAsync( ) .replaceAll("\\{taskID\\}", this.escapeString(taskID.toString())); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -3139,7 +3139,7 @@ public CompletableFuture getTopUserIdsAsync( // create path and map variables String requestPath = "/1/clusters/mapping/top"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -3214,7 +3214,7 @@ public CompletableFuture getUserIdAsync( this.escapeString(userID.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -3295,7 +3295,7 @@ public CompletableFuture hasPendingMappingsAsync( // create path and map variables String requestPath = "/1/clusters/mapping/pending"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (getClusters != null) { @@ -3367,7 +3367,7 @@ public CompletableFuture listApiKeysAsync( // create path and map variables String requestPath = "/1/keys"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -3425,7 +3425,7 @@ public CompletableFuture listClustersAsync( // create path and map variables String requestPath = "/1/clusters"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -3500,7 +3500,7 @@ public CompletableFuture listIndicesAsync( // create path and map variables String requestPath = "/1/indexes"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (page != null) { @@ -3602,7 +3602,7 @@ public CompletableFuture listUserIdsAsync( // create path and map variables String requestPath = "/1/clusters/mapping"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (page != null) { @@ -3695,7 +3695,7 @@ public CompletableFuture multipleBatchAsync( // create path and map variables String requestPath = "/1/indexes/*/batch"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -3768,7 +3768,7 @@ public CompletableFuture multipleQueriesAsync( // create path and map variables String requestPath = "/1/indexes/*/queries"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -3856,7 +3856,7 @@ public CompletableFuture operationIndexAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -4011,7 +4011,7 @@ public CompletableFuture partialUpdateObjectAsync ) .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (createIfNotExists != null) { @@ -4147,7 +4147,7 @@ public CompletableFuture postAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -4260,7 +4260,7 @@ public CompletableFuture putAsync( // create path and map variables String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (parameters != null) { @@ -4358,7 +4358,7 @@ public CompletableFuture removeUserIdAsync( this.escapeString(userID.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -4427,7 +4427,7 @@ public CompletableFuture replaceSourcesAsync( // create path and map variables String requestPath = "/1/security/sources"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -4500,7 +4500,7 @@ public CompletableFuture restoreApiKeyAsync( this.escapeString(key.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -4584,7 +4584,7 @@ public CompletableFuture saveObjectAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -4714,7 +4714,7 @@ public CompletableFuture saveRuleAsync( ) .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (forwardToReplicas != null) { @@ -4889,7 +4889,7 @@ public CompletableFuture saveSynonymAsync( ) .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (forwardToReplicas != null) { @@ -5058,7 +5058,7 @@ public CompletableFuture saveSynonymsAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (forwardToReplicas != null) { @@ -5187,7 +5187,7 @@ public CompletableFuture searchAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -5285,7 +5285,7 @@ public CompletableFuture searchDictionaryEntriesAsync( this.escapeString(dictionaryName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -5415,7 +5415,7 @@ public CompletableFuture searchForFacetValuesAsync ) .replaceAll("\\{facetName\\}", this.escapeString(facetName.toString())); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -5530,7 +5530,7 @@ public CompletableFuture searchRulesAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -5657,7 +5657,7 @@ public CompletableFuture searchSynonymsAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (query != null) { @@ -5788,7 +5788,7 @@ public CompletableFuture searchUserIdsAsync( // create path and map variables String requestPath = "/1/clusters/mapping/search"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -5861,7 +5861,7 @@ public CompletableFuture setDictionarySettingsAsync( // create path and map variables String requestPath = "/1/dictionaries/*/settings"; - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = @@ -5978,7 +5978,7 @@ public CompletableFuture setSettingsAsync( this.escapeString(indexName.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); if (forwardToReplicas != null) { @@ -6097,7 +6097,7 @@ public CompletableFuture updateApiKeyAsync( this.escapeString(key.toString()) ); - Map queryParameters = new HashMap(); + Map queryParameters = new HashMap(); Map headers = new HashMap(); Call call = diff --git a/clients/algoliasearch-client-php/lib/Api/AbtestingClient.php b/clients/algoliasearch-client-php/lib/Api/AbtestingClient.php index 66838990d0..2dfe3a7c5f 100644 --- a/clients/algoliasearch-client-php/lib/Api/AbtestingClient.php +++ b/clients/algoliasearch-client-php/lib/Api/AbtestingClient.php @@ -5,7 +5,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\AbtestingConfig; use Algolia\AlgoliaSearch\ObjectSerializer; -use Algolia\AlgoliaSearch\RequestOptions\RequestOptionsFactory; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; use Algolia\AlgoliaSearch\RetryStrategy\ClusterHosts; @@ -168,20 +167,7 @@ public function del($path, $parameters = null, $requestOptions = []) $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -264,20 +250,7 @@ public function get($path, $parameters = null, $requestOptions = []) $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -356,37 +329,11 @@ public function listABTests( $httpBody = []; if ($offset !== null) { - if ( - is_array($offset) && - !in_array( - 'offset', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($offset as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['offset'] = $offset; - } + $queryParameters['offset'] = $offset; } if ($limit !== null) { - if ( - is_array($limit) && - !in_array( - 'limit', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($limit as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['limit'] = $limit; - } + $queryParameters['limit'] = $limit; } return $this->sendRequest( @@ -428,20 +375,7 @@ public function post( $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -492,20 +426,7 @@ public function put( $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params diff --git a/clients/algoliasearch-client-php/lib/Api/AnalyticsClient.php b/clients/algoliasearch-client-php/lib/Api/AnalyticsClient.php index 11995dfc4e..7c4fdb009e 100644 --- a/clients/algoliasearch-client-php/lib/Api/AnalyticsClient.php +++ b/clients/algoliasearch-client-php/lib/Api/AnalyticsClient.php @@ -5,7 +5,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\AnalyticsConfig; use Algolia\AlgoliaSearch\ObjectSerializer; -use Algolia\AlgoliaSearch\RequestOptions\RequestOptionsFactory; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; use Algolia\AlgoliaSearch\RetryStrategy\ClusterHosts; @@ -123,20 +122,7 @@ public function del($path, $parameters = null, $requestOptions = []) $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -178,20 +164,7 @@ public function get($path, $parameters = null, $requestOptions = []) $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -263,71 +236,19 @@ public function getAverageClickPosition( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -394,71 +315,19 @@ public function getClickPositions( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -525,71 +394,19 @@ public function getClickThroughRate( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -656,71 +473,19 @@ public function getConversationRate( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -787,71 +552,19 @@ public function getNoClickRate( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -918,71 +631,19 @@ public function getNoResultsRate( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -1049,71 +710,19 @@ public function getSearchesCount( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -1184,105 +793,27 @@ public function getSearchesNoClicks( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($limit !== null) { - if ( - is_array($limit) && - !in_array( - 'limit', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($limit as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['limit'] = $limit; - } + $queryParameters['limit'] = $limit; } if ($offset !== null) { - if ( - is_array($offset) && - !in_array( - 'offset', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($offset as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['offset'] = $offset; - } + $queryParameters['offset'] = $offset; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -1353,105 +884,27 @@ public function getSearchesNoResults( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($limit !== null) { - if ( - is_array($limit) && - !in_array( - 'limit', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($limit as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['limit'] = $limit; - } + $queryParameters['limit'] = $limit; } if ($offset !== null) { - if ( - is_array($offset) && - !in_array( - 'offset', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($offset as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['offset'] = $offset; - } + $queryParameters['offset'] = $offset; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -1487,20 +940,7 @@ public function getStatus($index, $requestOptions = []) $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } return $this->sendRequest( @@ -1571,105 +1011,27 @@ public function getTopCountries( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($limit !== null) { - if ( - is_array($limit) && - !in_array( - 'limit', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($limit as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['limit'] = $limit; - } + $queryParameters['limit'] = $limit; } if ($offset !== null) { - if ( - is_array($offset) && - !in_array( - 'offset', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($offset as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['offset'] = $offset; - } + $queryParameters['offset'] = $offset; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -1742,122 +1104,31 @@ public function getTopFilterAttributes( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($search !== null) { - if ( - is_array($search) && - !in_array( - 'search', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($search as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['search'] = $search; - } + $queryParameters['search'] = $search; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($limit !== null) { - if ( - is_array($limit) && - !in_array( - 'limit', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($limit as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['limit'] = $limit; - } + $queryParameters['limit'] = $limit; } if ($offset !== null) { - if ( - is_array($offset) && - !in_array( - 'offset', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($offset as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['offset'] = $offset; - } + $queryParameters['offset'] = $offset; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -1941,122 +1212,31 @@ public function getTopFilterForAttribute( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($search !== null) { - if ( - is_array($search) && - !in_array( - 'search', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($search as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['search'] = $search; - } + $queryParameters['search'] = $search; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($limit !== null) { - if ( - is_array($limit) && - !in_array( - 'limit', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($limit as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['limit'] = $limit; - } + $queryParameters['limit'] = $limit; } if ($offset !== null) { - if ( - is_array($offset) && - !in_array( - 'offset', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($offset as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['offset'] = $offset; - } + $queryParameters['offset'] = $offset; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } // path params @@ -2138,122 +1318,31 @@ public function getTopFiltersNoResults( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($search !== null) { - if ( - is_array($search) && - !in_array( - 'search', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($search as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['search'] = $search; - } + $queryParameters['search'] = $search; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($limit !== null) { - if ( - is_array($limit) && - !in_array( - 'limit', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($limit as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['limit'] = $limit; - } + $queryParameters['limit'] = $limit; } if ($offset !== null) { - if ( - is_array($offset) && - !in_array( - 'offset', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($offset as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['offset'] = $offset; - } + $queryParameters['offset'] = $offset; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -2328,139 +1417,35 @@ public function getTopHits( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($search !== null) { - if ( - is_array($search) && - !in_array( - 'search', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($search as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['search'] = $search; - } + $queryParameters['search'] = $search; } if ($clickAnalytics !== null) { - if ( - is_array($clickAnalytics) && - !in_array( - 'clickAnalytics', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($clickAnalytics as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['clickAnalytics'] = $clickAnalytics; - } + $queryParameters['clickAnalytics'] = $clickAnalytics; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($limit !== null) { - if ( - is_array($limit) && - !in_array( - 'limit', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($limit as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['limit'] = $limit; - } + $queryParameters['limit'] = $limit; } if ($offset !== null) { - if ( - is_array($offset) && - !in_array( - 'offset', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($offset as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['offset'] = $offset; - } + $queryParameters['offset'] = $offset; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -2537,156 +1522,39 @@ public function getTopSearches( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($clickAnalytics !== null) { - if ( - is_array($clickAnalytics) && - !in_array( - 'clickAnalytics', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($clickAnalytics as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['clickAnalytics'] = $clickAnalytics; - } + $queryParameters['clickAnalytics'] = $clickAnalytics; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($orderBy !== null) { - if ( - is_array($orderBy) && - !in_array( - 'orderBy', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($orderBy as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['orderBy'] = $orderBy; - } + $queryParameters['orderBy'] = $orderBy; } if ($direction !== null) { - if ( - is_array($direction) && - !in_array( - 'direction', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($direction as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['direction'] = $direction; - } + $queryParameters['direction'] = $direction; } if ($limit !== null) { - if ( - is_array($limit) && - !in_array( - 'limit', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($limit as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['limit'] = $limit; - } + $queryParameters['limit'] = $limit; } if ($offset !== null) { - if ( - is_array($offset) && - !in_array( - 'offset', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($offset as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['offset'] = $offset; - } + $queryParameters['offset'] = $offset; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -2753,71 +1621,19 @@ public function getUsersCount( $httpBody = []; if ($index !== null) { - if ( - is_array($index) && - !in_array( - 'index', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($index as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['index'] = $index; - } + $queryParameters['index'] = $index; } if ($startDate !== null) { - if ( - is_array($startDate) && - !in_array( - 'startDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($startDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['startDate'] = $startDate; - } + $queryParameters['startDate'] = $startDate; } if ($endDate !== null) { - if ( - is_array($endDate) && - !in_array( - 'endDate', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($endDate as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['endDate'] = $endDate; - } + $queryParameters['endDate'] = $endDate; } if ($tags !== null) { - if ( - is_array($tags) && - !in_array( - 'tags', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($tags as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['tags'] = $tags; - } + $queryParameters['tags'] = $tags; } return $this->sendRequest( @@ -2859,20 +1675,7 @@ public function post( $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -2923,20 +1726,7 @@ public function put( $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params diff --git a/clients/algoliasearch-client-php/lib/Api/InsightsClient.php b/clients/algoliasearch-client-php/lib/Api/InsightsClient.php index 517657608b..4f995870ea 100644 --- a/clients/algoliasearch-client-php/lib/Api/InsightsClient.php +++ b/clients/algoliasearch-client-php/lib/Api/InsightsClient.php @@ -4,7 +4,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\InsightsConfig; -use Algolia\AlgoliaSearch\RequestOptions\RequestOptionsFactory; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; use Algolia\AlgoliaSearch\RetryStrategy\ClusterHosts; @@ -122,20 +121,7 @@ public function del($path, $parameters = null, $requestOptions = []) $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -177,20 +163,7 @@ public function get($path, $parameters = null, $requestOptions = []) $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -237,20 +210,7 @@ public function post( $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -344,20 +304,7 @@ public function put( $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params diff --git a/clients/algoliasearch-client-php/lib/Api/PersonalizationClient.php b/clients/algoliasearch-client-php/lib/Api/PersonalizationClient.php index ad85a58443..59527d87e1 100644 --- a/clients/algoliasearch-client-php/lib/Api/PersonalizationClient.php +++ b/clients/algoliasearch-client-php/lib/Api/PersonalizationClient.php @@ -5,7 +5,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\PersonalizationConfig; use Algolia\AlgoliaSearch\ObjectSerializer; -use Algolia\AlgoliaSearch\RequestOptions\RequestOptionsFactory; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; use Algolia\AlgoliaSearch\RetryStrategy\ClusterHosts; @@ -123,20 +122,7 @@ public function del($path, $parameters = null, $requestOptions = []) $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -222,20 +208,7 @@ public function get($path, $parameters = null, $requestOptions = []) $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -350,20 +323,7 @@ public function post( $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -414,20 +374,7 @@ public function put( $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params diff --git a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsClient.php b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsClient.php index 057f203bc7..05dd21507a 100644 --- a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsClient.php +++ b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsClient.php @@ -5,7 +5,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\QuerySuggestionsConfig; use Algolia\AlgoliaSearch\ObjectSerializer; -use Algolia\AlgoliaSearch\RequestOptions\RequestOptionsFactory; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; use Algolia\AlgoliaSearch\RetryStrategy\ClusterHosts; @@ -168,20 +167,7 @@ public function del($path, $parameters = null, $requestOptions = []) $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -267,20 +253,7 @@ public function get($path, $parameters = null, $requestOptions = []) $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -483,20 +456,7 @@ public function post( $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -547,20 +507,7 @@ public function put( $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params diff --git a/clients/algoliasearch-client-php/lib/Api/RecommendClient.php b/clients/algoliasearch-client-php/lib/Api/RecommendClient.php index daa86e59e4..dcab314ff8 100644 --- a/clients/algoliasearch-client-php/lib/Api/RecommendClient.php +++ b/clients/algoliasearch-client-php/lib/Api/RecommendClient.php @@ -4,7 +4,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\RecommendConfig; -use Algolia\AlgoliaSearch\RequestOptions\RequestOptionsFactory; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; use Algolia\AlgoliaSearch\RetryStrategy\ClusterHosts; @@ -122,20 +121,7 @@ public function del($path, $parameters = null, $requestOptions = []) $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -177,20 +163,7 @@ public function get($path, $parameters = null, $requestOptions = []) $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -283,20 +256,7 @@ public function post( $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -347,20 +307,7 @@ public function put( $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params diff --git a/clients/algoliasearch-client-php/lib/Api/SearchClient.php b/clients/algoliasearch-client-php/lib/Api/SearchClient.php index 7519bc54f8..5fe227de36 100644 --- a/clients/algoliasearch-client-php/lib/Api/SearchClient.php +++ b/clients/algoliasearch-client-php/lib/Api/SearchClient.php @@ -5,7 +5,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\SearchConfig; use Algolia\AlgoliaSearch\ObjectSerializer; -use Algolia\AlgoliaSearch\RequestOptions\RequestOptionsFactory; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; use Algolia\AlgoliaSearch\RetryStrategy\ClusterHosts; @@ -558,37 +557,11 @@ public function batchRules( $httpBody = []; if ($forwardToReplicas !== null) { - if ( - is_array($forwardToReplicas) && - !in_array( - 'forwardToReplicas', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($forwardToReplicas as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['forwardToReplicas'] = $forwardToReplicas; - } + $queryParameters['forwardToReplicas'] = $forwardToReplicas; } if ($clearExistingRules !== null) { - if ( - is_array($clearExistingRules) && - !in_array( - 'clearExistingRules', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($clearExistingRules as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['clearExistingRules'] = $clearExistingRules; - } + $queryParameters['clearExistingRules'] = $clearExistingRules; } // path params @@ -701,20 +674,7 @@ public function clearAllSynonyms( $httpBody = []; if ($forwardToReplicas !== null) { - if ( - is_array($forwardToReplicas) && - !in_array( - 'forwardToReplicas', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($forwardToReplicas as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['forwardToReplicas'] = $forwardToReplicas; - } + $queryParameters['forwardToReplicas'] = $forwardToReplicas; } // path params @@ -810,20 +770,7 @@ public function clearRules( $httpBody = []; if ($forwardToReplicas !== null) { - if ( - is_array($forwardToReplicas) && - !in_array( - 'forwardToReplicas', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($forwardToReplicas as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['forwardToReplicas'] = $forwardToReplicas; - } + $queryParameters['forwardToReplicas'] = $forwardToReplicas; } // path params @@ -869,20 +816,7 @@ public function del($path, $parameters = null, $requestOptions = []) $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -1150,20 +1084,7 @@ public function deleteRule( $httpBody = []; if ($forwardToReplicas !== null) { - if ( - is_array($forwardToReplicas) && - !in_array( - 'forwardToReplicas', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($forwardToReplicas as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['forwardToReplicas'] = $forwardToReplicas; - } + $queryParameters['forwardToReplicas'] = $forwardToReplicas; } // path params @@ -1276,20 +1197,7 @@ public function deleteSynonym( $httpBody = []; if ($forwardToReplicas !== null) { - if ( - is_array($forwardToReplicas) && - !in_array( - 'forwardToReplicas', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($forwardToReplicas as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['forwardToReplicas'] = $forwardToReplicas; - } + $queryParameters['forwardToReplicas'] = $forwardToReplicas; } // path params @@ -1344,20 +1252,7 @@ public function get($path, $parameters = null, $requestOptions = []) $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -1494,71 +1389,19 @@ public function getLogs( $httpBody = []; if ($offset !== null) { - if ( - is_array($offset) && - !in_array( - 'offset', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($offset as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['offset'] = $offset; - } + $queryParameters['offset'] = $offset; } if ($length !== null) { - if ( - is_array($length) && - !in_array( - 'length', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($length as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['length'] = $length; - } + $queryParameters['length'] = $length; } if ($indexName !== null) { - if ( - is_array($indexName) && - !in_array( - 'indexName', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($indexName as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['indexName'] = $indexName; - } + $queryParameters['indexName'] = $indexName; } if ($type !== null) { - if ( - is_array($type) && - !in_array( - 'type', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($type as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['type'] = $type; - } + $queryParameters['type'] = $type; } return $this->sendRequest( @@ -1612,22 +1455,7 @@ public function getObject( $httpBody = []; if ($attributesToRetrieve !== null) { - if ( - is_array($attributesToRetrieve) && - !in_array( - 'attributesToRetrieve', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($attributesToRetrieve as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters[ - 'attributesToRetrieve' - ] = $attributesToRetrieve; - } + $queryParameters['attributesToRetrieve'] = $attributesToRetrieve; } // path params @@ -2043,20 +1871,7 @@ public function hasPendingMappings( $httpBody = []; if ($getClusters !== null) { - if ( - is_array($getClusters) && - !in_array( - 'getClusters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($getClusters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['getClusters'] = $getClusters; - } + $queryParameters['getClusters'] = $getClusters; } return $this->sendRequest( @@ -2133,20 +1948,7 @@ public function listIndices($page = null, $requestOptions = []) $httpBody = []; if ($page !== null) { - if ( - is_array($page) && - !in_array( - 'page', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($page as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['page'] = $page; - } + $queryParameters['page'] = $page; } return $this->sendRequest( @@ -2179,37 +1981,11 @@ public function listUserIds( $httpBody = []; if ($page !== null) { - if ( - is_array($page) && - !in_array( - 'page', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($page as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['page'] = $page; - } + $queryParameters['page'] = $page; } if ($hitsPerPage !== null) { - if ( - is_array($hitsPerPage) && - !in_array( - 'hitsPerPage', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($hitsPerPage as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['hitsPerPage'] = $hitsPerPage; - } + $queryParameters['hitsPerPage'] = $hitsPerPage; } return $this->sendRequest( @@ -2433,20 +2209,7 @@ public function partialUpdateObject( $httpBody = []; if ($createIfNotExists !== null) { - if ( - is_array($createIfNotExists) && - !in_array( - 'createIfNotExists', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($createIfNotExists as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['createIfNotExists'] = $createIfNotExists; - } + $queryParameters['createIfNotExists'] = $createIfNotExists; } // path params @@ -2510,20 +2273,7 @@ public function post( $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -2574,20 +2324,7 @@ public function put( $httpBody = []; if ($parameters !== null) { - if ( - is_array($parameters) && - !in_array( - 'parameters', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($parameters as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters = $parameters; - } + $queryParameters = $parameters; } // path params @@ -2845,20 +2582,7 @@ public function saveRule( $httpBody = []; if ($forwardToReplicas !== null) { - if ( - is_array($forwardToReplicas) && - !in_array( - 'forwardToReplicas', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($forwardToReplicas as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['forwardToReplicas'] = $forwardToReplicas; - } + $queryParameters['forwardToReplicas'] = $forwardToReplicas; } // path params @@ -2957,20 +2681,7 @@ public function saveSynonym( $httpBody = []; if ($forwardToReplicas !== null) { - if ( - is_array($forwardToReplicas) && - !in_array( - 'forwardToReplicas', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($forwardToReplicas as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['forwardToReplicas'] = $forwardToReplicas; - } + $queryParameters['forwardToReplicas'] = $forwardToReplicas; } // path params @@ -3048,39 +2759,13 @@ public function saveSynonyms( $httpBody = []; if ($forwardToReplicas !== null) { - if ( - is_array($forwardToReplicas) && - !in_array( - 'forwardToReplicas', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($forwardToReplicas as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['forwardToReplicas'] = $forwardToReplicas; - } + $queryParameters['forwardToReplicas'] = $forwardToReplicas; } if ($replaceExistingSynonyms !== null) { - if ( - is_array($replaceExistingSynonyms) && - !in_array( - 'replaceExistingSynonyms', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($replaceExistingSynonyms as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters[ - 'replaceExistingSynonyms' - ] = $replaceExistingSynonyms; - } + $queryParameters[ + 'replaceExistingSynonyms' + ] = $replaceExistingSynonyms; } // path params @@ -3421,71 +3106,19 @@ public function searchSynonyms( $httpBody = []; if ($query !== null) { - if ( - is_array($query) && - !in_array( - 'query', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($query as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['query'] = $query; - } + $queryParameters['query'] = $query; } if ($type !== null) { - if ( - is_array($type) && - !in_array( - 'type', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($type as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['type'] = $type; - } + $queryParameters['type'] = $type; } if ($page !== null) { - if ( - is_array($page) && - !in_array( - 'page', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($page as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['page'] = $page; - } + $queryParameters['page'] = $page; } if ($hitsPerPage !== null) { - if ( - is_array($hitsPerPage) && - !in_array( - 'hitsPerPage', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($hitsPerPage as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['hitsPerPage'] = $hitsPerPage; - } + $queryParameters['hitsPerPage'] = $hitsPerPage; } // path params @@ -3644,20 +3277,7 @@ public function setSettings( $httpBody = []; if ($forwardToReplicas !== null) { - if ( - is_array($forwardToReplicas) && - !in_array( - 'forwardToReplicas', - RequestOptionsFactory::getAttributesToFormat(), - true - ) - ) { - foreach ($forwardToReplicas as $key => $value) { - $queryParameters[$key] = $value; - } - } else { - $queryParameters['forwardToReplicas'] = $forwardToReplicas; - } + $queryParameters['forwardToReplicas'] = $forwardToReplicas; } // path params diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/abtesting.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/abtesting.test.java index 04dd1b0414..baf892c70c 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/abtesting.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/abtesting.test.java @@ -113,10 +113,10 @@ void delTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -171,10 +171,10 @@ void getTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -211,10 +211,10 @@ void listABTestsTest0() { "{\"offset\":\"42\",\"limit\":\"21\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -268,10 +268,10 @@ void postTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -325,10 +325,10 @@ void putTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/analytics.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/analytics.test.java index ddac920238..228c601998 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/analytics.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/analytics.test.java @@ -65,10 +65,10 @@ void delTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -109,10 +109,10 @@ void getTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -134,10 +134,10 @@ void getAverageClickPositionTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -162,10 +162,10 @@ void getAverageClickPositionTest1() { "{\"index\":\"index\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -187,10 +187,10 @@ void getClickPositionsTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -215,10 +215,10 @@ void getClickPositionsTest1() { "{\"index\":\"index\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -240,10 +240,10 @@ void getClickThroughRateTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -268,10 +268,10 @@ void getClickThroughRateTest1() { "{\"index\":\"index\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -293,10 +293,10 @@ void getConversationRateTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -321,10 +321,10 @@ void getConversationRateTest1() { "{\"index\":\"index\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -346,10 +346,10 @@ void getNoClickRateTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -374,10 +374,10 @@ void getNoClickRateTest1() { "{\"index\":\"index\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -399,10 +399,10 @@ void getNoResultsRateTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -427,10 +427,10 @@ void getNoResultsRateTest1() { "{\"index\":\"index\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -452,10 +452,10 @@ void getSearchesCountTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -480,10 +480,10 @@ void getSearchesCountTest1() { "{\"index\":\"index\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -505,10 +505,10 @@ void getSearchesNoClicksTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -542,10 +542,10 @@ void getSearchesNoClicksTest1() { "{\"index\":\"index\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"limit\":\"21\",\"offset\":\"42\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -567,10 +567,10 @@ void getSearchesNoResultsTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -604,10 +604,10 @@ void getSearchesNoResultsTest1() { "{\"index\":\"index\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"limit\":\"21\",\"offset\":\"42\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -629,10 +629,10 @@ void getStatusTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -654,10 +654,10 @@ void getTopCountriesTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -691,10 +691,10 @@ void getTopCountriesTest1() { "{\"index\":\"index\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"limit\":\"21\",\"offset\":\"42\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -716,10 +716,10 @@ void getTopFilterAttributesTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -755,10 +755,10 @@ void getTopFilterAttributesTest1() { "{\"index\":\"index\",\"search\":\"mySearch\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"limit\":\"21\",\"offset\":\"42\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -781,10 +781,10 @@ void getTopFilterForAttributeTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -809,10 +809,10 @@ void getTopFilterForAttributeTest1() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -850,10 +850,10 @@ void getTopFilterForAttributeTest2() { "{\"index\":\"index\",\"search\":\"mySearch\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"limit\":\"21\",\"offset\":\"42\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -893,10 +893,10 @@ void getTopFilterForAttributeTest3() { "{\"index\":\"index\",\"search\":\"mySearch\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"limit\":\"21\",\"offset\":\"42\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -918,10 +918,10 @@ void getTopFiltersNoResultsTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -957,10 +957,10 @@ void getTopFiltersNoResultsTest1() { "{\"index\":\"index\",\"search\":\"mySearch\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"limit\":\"21\",\"offset\":\"42\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -982,10 +982,10 @@ void getTopHitsTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1023,10 +1023,10 @@ void getTopHitsTest1() { "{\"index\":\"index\",\"search\":\"mySearch\",\"clickAnalytics\":\"true\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"limit\":\"21\",\"offset\":\"42\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1048,10 +1048,10 @@ void getTopSearchesTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1091,10 +1091,10 @@ void getTopSearchesTest1() { "{\"index\":\"index\",\"clickAnalytics\":\"true\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"orderBy\":\"searchCount\",\"direction\":\"asc\",\"limit\":\"21\",\"offset\":\"42\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1116,10 +1116,10 @@ void getUsersCountTest0() { "{\"index\":\"index\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1144,10 +1144,10 @@ void getUsersCountTest1() { "{\"index\":\"index\",\"startDate\":\"1999-09-19\",\"endDate\":\"2001-01-01\",\"tags\":\"tag\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1201,10 +1201,10 @@ void postTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1258,10 +1258,10 @@ void putTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/insights.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/insights.test.java index 18b1727b65..40051ba6b2 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/insights.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/insights.test.java @@ -65,10 +65,10 @@ void delTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -109,10 +109,10 @@ void getTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -166,10 +166,10 @@ void postTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -333,10 +333,10 @@ void putTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/personalization.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/personalization.test.java index 6cfd4b7aae..511cf73d4e 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/personalization.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/personalization.test.java @@ -65,10 +65,10 @@ void delTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -123,10 +123,10 @@ void getTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -206,10 +206,10 @@ void postTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -263,10 +263,10 @@ void putTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/predict.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/predict.test.java index cc8f6f3ada..91088a7abd 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/predict.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/predict.test.java @@ -65,10 +65,10 @@ void delTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -240,10 +240,10 @@ void getTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -297,10 +297,10 @@ void postTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -354,10 +354,10 @@ void putTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/query-suggestions.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/query-suggestions.test.java index 1be838fa51..c3f5573613 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/query-suggestions.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/query-suggestions.test.java @@ -141,10 +141,10 @@ void delTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -199,10 +199,10 @@ void getTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -310,10 +310,10 @@ void postTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -367,10 +367,10 @@ void putTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/recommend.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/recommend.test.java index b49a410ae9..2c0630305d 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/recommend.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/recommend.test.java @@ -65,10 +65,10 @@ void delTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -109,10 +109,10 @@ void getTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -620,10 +620,10 @@ void postTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -677,10 +677,10 @@ void putTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/search.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/search.test.java index ac0ea3224f..d6765d1a5c 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/search.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/search.test.java @@ -508,10 +508,10 @@ void batchRulesTest0() { "{\"forwardToReplicas\":\"true\",\"clearExistingRules\":\"true\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -637,10 +637,10 @@ void delTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -798,10 +798,10 @@ void getTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -864,10 +864,10 @@ void getLogsTest0() { "{\"offset\":\"5\",\"length\":\"10\",\"indexName\":\"theIndexName\",\"type\":\"all\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -897,10 +897,10 @@ void getObjectTest0() { "{\"attributesToRetrieve\":\"attr1,attr2\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1063,10 +1063,10 @@ void hasPendingMappingsTest0() { "{\"getClusters\":\"true\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1112,10 +1112,10 @@ void listIndicesTest0() { "{\"page\":\"8\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1138,10 +1138,10 @@ void listUserIdsTest0() { "{\"page\":\"8\",\"hitsPerPage\":\"100\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1378,10 +1378,10 @@ void partialUpdateObjectTest0() { "{\"createIfNotExists\":\"true\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1435,10 +1435,10 @@ void postTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1492,10 +1492,10 @@ void putTest1() { "{\"query\":\"parameters\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1643,10 +1643,10 @@ void saveRuleTest0() { "{\"forwardToReplicas\":\"true\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1700,10 +1700,10 @@ void saveSynonymTest0() { "{\"forwardToReplicas\":\"true\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -1781,10 +1781,10 @@ void saveSynonymsTest0() { "{\"forwardToReplicas\":\"true\",\"replaceExistingSynonyms\":\"false\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } } @@ -2168,10 +2168,10 @@ void setSettingsTest0() { "{\"forwardToReplicas\":\"true\"}", new TypeToken>() {}.getType() ); - Map actualQuery = req.queryParameters; + Map actualQuery = req.queryParameters; assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { + for (Map.Entry p : actualQuery.entrySet()) { assertEquals(expectedQuery.get(p.getKey()), p.getValue()); } }