From ee9c021d5bc2385ffee1438f16e8456e54962ef8 Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Wed, 11 May 2022 10:11:24 +0000 Subject: [PATCH] chore: generated code for commit c5ac1854a6ce4f7be58e8bf924bbf6ecd2c14d89. [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clément Vannicatte --- .../src/main/java/com/algolia/ApiClient.java | 129 +- .../java/com/algolia/api/AbtestingClient.java | 396 ++- .../java/com/algolia/api/AnalyticsClient.java | 1724 +++++++++- .../java/com/algolia/api/InsightsClient.java | 250 +- .../algolia/api/PersonalizationClient.java | 355 +- .../java/com/algolia/api/PredictClient.java | 252 +- .../algolia/api/QuerySuggestionsClient.java | 448 ++- .../java/com/algolia/api/RecommendClient.java | 250 +- .../java/com/algolia/api/SearchClient.java | 2850 +++++++++++++++-- .../src/transporter/createTransporter.ts | 4 +- 10 files changed, 6068 insertions(+), 590 deletions(-) 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 7de7f89f59..fb43511660 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 @@ -2,6 +2,7 @@ import com.algolia.exceptions.*; import com.algolia.utils.JSON; +import com.algolia.utils.RequestOptions; import com.algolia.utils.Requester; import com.algolia.utils.UserAgent; import java.io.IOException; @@ -22,7 +23,7 @@ public class ApiClient { private boolean debugging = false; private Map defaultHeaderMap = new HashMap(); - private String appId, apiKey; + private String contentType; private DateFormat dateFormat; @@ -38,6 +39,8 @@ public ApiClient( String clientName, UserAgent.Segment[] segments ) { + this.contentType = "application/json"; + UserAgent ua = new UserAgent("0.0.1"); ua.addSegment(new UserAgent.Segment(clientName, "0.0.1")); if (segments != null) { @@ -47,8 +50,11 @@ public ApiClient( } setUserAgent(ua.toString()); - this.appId = appId; - this.apiKey = apiKey; + defaultHeaderMap.put("X-Algolia-Application-Id", appId); + defaultHeaderMap.put("X-Algolia-API-Key", apiKey); + defaultHeaderMap.put("Accept", this.contentType); + defaultHeaderMap.put("Content-Type", this.contentType); + this.requester = requester; } @@ -190,19 +196,6 @@ public String parameterToString(Object param) { } } - /** - * Check if the given MIME is a JSON MIME. JSON MIME examples: application/json application/json; - * charset=UTF8 APPLICATION/JSON application/vnd.company+json "* / *" is also default to JSON - * - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public static boolean isJsonMime(String mime) { - String jsonMime = - "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); - } - /** * Escape the given string to be used as URL query value. * @@ -222,28 +215,19 @@ public String escapeString(String str) { * request Content-Type. * * @param obj The Java object - * @param contentType The request Content-Type * @return The serialized request body * @throws AlgoliaRuntimeException If fail to serialize the given object */ - public RequestBody serialize(Object obj, String contentType) - throws AlgoliaRuntimeException { - if (obj instanceof byte[]) { - // Binary (byte array) body parameter support. - return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); - } else if (isJsonMime(contentType)) { - String content; - if (obj != null) { - content = JSON.serialize(obj); - } else { - content = null; - } - return RequestBody.create(content, MediaType.parse(contentType)); + public RequestBody serialize(Object obj) throws AlgoliaRuntimeException { + String content; + + if (obj != null) { + content = JSON.serialize(obj); } else { - throw new AlgoliaRuntimeException( - "Content type \"" + contentType + "\" is not supported" - ); + content = null; } + + return RequestBody.create(content, MediaType.parse(this.contentType)); } /** @@ -291,6 +275,8 @@ public void onResponse(Call call, Response response) * @param queryParams The query parameters * @param body The request body object * @param headerParams The header parameters + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The HTTP call * @throws AlgoliaRuntimeException If fail to serialize the request body object */ @@ -299,14 +285,16 @@ public Call buildCall( String method, Map queryParams, Object body, - Map headerParams + Map headerParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { Request request = buildRequest( path, method, queryParams, body, - headerParams + headerParams, + requestOptions ); return requester.newCall(request); @@ -321,6 +309,8 @@ public Call buildCall( * @param queryParams The query parameters * @param body The request body object * @param headerParams The header parameters + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The HTTP request * @throws AlgoliaRuntimeException If fail to serialize the request body object */ @@ -329,20 +319,21 @@ public Request buildRequest( String method, Map queryParams, Object body, - Map headerParams + Map headerParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { - headerParams.put("X-Algolia-Application-Id", this.appId); - headerParams.put("X-Algolia-API-Key", this.apiKey); - headerParams.put("Accept", "application/json"); - headerParams.put("Content-Type", "application/json"); - - String contentType = "application/json"; - headerParams.put("Accept", contentType); - headerParams.put("Content-Type", contentType); - - final String url = buildUrl(path, queryParams); + boolean hasRequestOptions = requestOptions != null; + final String url = buildUrl( + path, + queryParams, + hasRequestOptions ? requestOptions.getExtraQueryParams() : null + ); final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); + processHeaderParams( + headerParams, + hasRequestOptions ? requestOptions.getExtraHeaders() : null, + reqBuilder + ); RequestBody reqBody; if (!HttpMethod.permitsRequestBody(method)) { @@ -353,10 +344,10 @@ public Request buildRequest( reqBody = null; } else { // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", MediaType.parse(contentType)); + reqBody = RequestBody.create("", MediaType.parse(this.contentType)); } } else { - reqBody = serialize(body, contentType); + reqBody = serialize(body); } return reqBuilder.method(method, reqBody).build(); @@ -367,14 +358,38 @@ public Request buildRequest( * * @param path The sub path * @param queryParams The query parameters + * @param extraQueryParams The query parameters, coming from the requestOptions * @return The full URL */ - public String buildUrl(String path, Map queryParams) { - final StringBuilder url = new StringBuilder(); + public String buildUrl( + String path, + Map queryParams, + Map extraQueryParams + ) { + 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, queryParams); + url = parseQueryParameters(path, url, extraQueryParams); + + 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 queryParams to + * @param queryParams The query parameters + * @return The URL + */ + public StringBuilder parseQueryParameters( + String path, + StringBuilder url, + Map queryParams + ) { if (queryParams != null && !queryParams.isEmpty()) { // support (constant) query string in `path`, e.g. "/posts?draft=1" String prefix = path.contains("?") ? "&" : "?"; @@ -395,17 +410,19 @@ public String buildUrl(String path, Map queryParams) { } } - return url.toString(); + return url; } /** * Set header parameters to the request builder, including default headers. * * @param headerParams Header parameters in the form of Map + * @param extraHeaderParams Header parameters in the form of Map, coming from RequestOptions * @param reqBuilder Request.Builder */ public void processHeaderParams( Map headerParams, + Map extraHeaderParams, Request.Builder reqBuilder ) { for (Entry param : headerParams.entrySet()) { @@ -419,6 +436,14 @@ public void processHeaderParams( ); } } + if (extraHeaderParams != null) { + for (Entry header : extraHeaderParams.entrySet()) { + reqBuilder.header( + header.getKey(), + parameterToString(header.getValue()) + ); + } + } } /** 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 4b39567846..543fe46a64 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 @@ -4,6 +4,7 @@ import com.algolia.exceptions.*; import com.algolia.model.abtesting.*; import com.algolia.utils.*; +import com.algolia.utils.RequestOptions; import com.algolia.utils.retry.CallType; import com.algolia.utils.retry.StatefulHost; import com.google.gson.reflect.TypeToken; @@ -85,13 +86,24 @@ private static List getDefaultHosts(String region) { * providing a customSearchParameters setting on one of the variants. * * @param addABTestsRequest (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return ABTestResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public ABTestResponse addABTests( + AddABTestsRequest addABTestsRequest, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + addABTestsAsync(addABTestsRequest, requestOptions) + ); + } + public ABTestResponse addABTests(AddABTestsRequest addABTestsRequest) throws AlgoliaRuntimeException { - return LaunderThrowable.await(addABTestsAsync(addABTestsRequest)); + return this.addABTests(addABTestsRequest, null); } /** @@ -100,12 +112,15 @@ public ABTestResponse addABTests(AddABTestsRequest addABTestsRequest) * parameters by providing a customSearchParameters setting on one of the variants. * * @param addABTestsRequest (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture addABTestsAsync( - AddABTestsRequest addABTestsRequest + AddABTestsRequest addABTestsRequest, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (addABTestsRequest == null) { throw new AlgoliaRuntimeException( @@ -122,28 +137,56 @@ public CompletableFuture addABTestsAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture addABTestsAsync( + AddABTestsRequest addABTestsRequest + ) throws AlgoliaRuntimeException { + return this.addABTestsAsync(addABTestsRequest, null); + } + /** * This method allow you to send requests to the Algolia REST API. * * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object del( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(delAsync(path, parameters, requestOptions)); + } + public Object del(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(delAsync(path, parameters)); + return this.del(path, parameters, null); + } + + public Object del(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.del(path, null, requestOptions); } public Object del(String path) throws AlgoliaRuntimeException { - return this.del(path, null); + return this.del(path, null, null); } /** @@ -152,13 +195,16 @@ public Object del(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture delAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -184,34 +230,71 @@ public CompletableFuture delAsync( } Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture delAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.delAsync(path, parameters, null); + } + + public CompletableFuture delAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.delAsync(path, null, requestOptions); + } + + public CompletableFuture delAsync(String path) + throws AlgoliaRuntimeException { + return this.delAsync(path, null, null); + } + /** * Delete a test. * * @param id The A/B test ID. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return ABTestResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public ABTestResponse deleteABTest(Integer id, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return LaunderThrowable.await(deleteABTestAsync(id, requestOptions)); + } + public ABTestResponse deleteABTest(Integer id) throws AlgoliaRuntimeException { - return LaunderThrowable.await(deleteABTestAsync(id)); + return this.deleteABTest(id, null); } /** * (asynchronously) Delete a test. * * @param id The A/B test ID. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture deleteABTestAsync(Integer id) - throws AlgoliaRuntimeException { + public CompletableFuture deleteABTestAsync( + Integer id, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { if (id == null) { throw new AlgoliaRuntimeException( "Missing the required parameter 'id' when calling deleteABTest(Async)" @@ -231,28 +314,55 @@ public CompletableFuture deleteABTestAsync(Integer id) Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture deleteABTestAsync(Integer id) + throws AlgoliaRuntimeException { + return this.deleteABTestAsync(id, null); + } + /** * This method allow you to send requests to the Algolia REST API. * * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object get( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getAsync(path, parameters, requestOptions)); + } + public Object get(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getAsync(path, parameters)); + return this.get(path, parameters, null); + } + + public Object get(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.get(path, null, requestOptions); } public Object get(String path) throws AlgoliaRuntimeException { - return this.get(path, null); + return this.get(path, null, null); } /** @@ -261,13 +371,16 @@ public Object get(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -293,33 +406,70 @@ public CompletableFuture getAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.getAsync(path, parameters, null); + } + + public CompletableFuture getAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getAsync(path, null, requestOptions); + } + + public CompletableFuture getAsync(String path) + throws AlgoliaRuntimeException { + return this.getAsync(path, null, null); + } + /** * Returns metadata and metrics for an A/B test. * * @param id The A/B test ID. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return ABTest * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public ABTest getABTest(Integer id, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return LaunderThrowable.await(getABTestAsync(id, requestOptions)); + } + public ABTest getABTest(Integer id) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getABTestAsync(id)); + return this.getABTest(id, null); } /** * (asynchronously) Returns metadata and metrics for an A/B test. * * @param id The A/B test ID. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture getABTestAsync(Integer id) - throws AlgoliaRuntimeException { + public CompletableFuture getABTestAsync( + Integer id, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { if (id == null) { throw new AlgoliaRuntimeException( "Missing the required parameter 'id' when calling getABTest(Async)" @@ -339,11 +489,23 @@ public CompletableFuture getABTestAsync(Integer id) Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getABTestAsync(Integer id) + throws AlgoliaRuntimeException { + return this.getABTestAsync(id, null); + } + /** * Fetch all existing A/B tests for App that are available for the current API Key. When no data * has been processed, the metrics will be returned as null. @@ -352,17 +514,34 @@ public CompletableFuture getABTestAsync(Integer id) * (optional, default to 0) * @param limit Number of records to return. Limit is the size of the page. (optional, default to * 10) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return ListABTestsResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public ListABTestsResponse listABTests( + Integer offset, + Integer limit, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + listABTestsAsync(offset, limit, requestOptions) + ); + } + public ListABTestsResponse listABTests(Integer offset, Integer limit) throws AlgoliaRuntimeException { - return LaunderThrowable.await(listABTestsAsync(offset, limit)); + return this.listABTests(offset, limit, null); + } + + public ListABTestsResponse listABTests(RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.listABTests(null, null, requestOptions); } public ListABTestsResponse listABTests() throws AlgoliaRuntimeException { - return this.listABTests(null, null); + return this.listABTests(null, null, null); } /** @@ -373,13 +552,16 @@ public ListABTestsResponse listABTests() throws AlgoliaRuntimeException { * (optional, default to 0) * @param limit Number of records to return. Limit is the size of the page. (optional, default to * 10) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture listABTestsAsync( Integer offset, - Integer limit + Integer limit, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { Object bodyObj = null; @@ -398,11 +580,36 @@ public CompletableFuture listABTestsAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture listABTestsAsync( + Integer offset, + Integer limit + ) throws AlgoliaRuntimeException { + return this.listABTestsAsync(offset, limit, null); + } + + public CompletableFuture listABTestsAsync( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.listABTestsAsync(null, null, requestOptions); + } + + public CompletableFuture listABTestsAsync() + throws AlgoliaRuntimeException { + return this.listABTestsAsync(null, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -410,17 +617,35 @@ public CompletableFuture listABTestsAsync( * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object post( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + postAsync(path, parameters, body, requestOptions) + ); + } + public Object post(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(postAsync(path, parameters, body)); + return this.post(path, parameters, body, null); + } + + public Object post(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.post(path, null, null, requestOptions); } public Object post(String path) throws AlgoliaRuntimeException { - return this.post(path, null, null); + return this.post(path, null, null, null); } /** @@ -430,6 +655,8 @@ public Object post(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -437,7 +664,8 @@ public Object post(String path) throws AlgoliaRuntimeException { public CompletableFuture postAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -463,11 +691,38 @@ public CompletableFuture postAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture postAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.postAsync(path, parameters, body, null); + } + + public CompletableFuture postAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, requestOptions); + } + + public CompletableFuture postAsync(String path) + throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -475,17 +730,35 @@ public CompletableFuture postAsync( * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object put( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + putAsync(path, parameters, body, requestOptions) + ); + } + public Object put(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(putAsync(path, parameters, body)); + return this.put(path, parameters, body, null); + } + + public Object put(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.put(path, null, null, requestOptions); } public Object put(String path) throws AlgoliaRuntimeException { - return this.put(path, null, null); + return this.put(path, null, null, null); } /** @@ -495,6 +768,8 @@ public Object put(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -502,7 +777,8 @@ public Object put(String path) throws AlgoliaRuntimeException { public CompletableFuture putAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -528,23 +804,57 @@ public CompletableFuture putAsync( } Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture putAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.putAsync(path, parameters, body, null); + } + + public CompletableFuture putAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, requestOptions); + } + + public CompletableFuture putAsync(String path) + throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, null); + } + /** * Marks the A/B test as stopped. At this point, the test is over and cannot be restarted. As a * result, your application is back to normal: index A will perform as usual, receiving 100% of * all search requests. Associated metadata and metrics are still stored. * * @param id The A/B test ID. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return ABTestResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public ABTestResponse stopABTest(Integer id, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return LaunderThrowable.await(stopABTestAsync(id, requestOptions)); + } + public ABTestResponse stopABTest(Integer id) throws AlgoliaRuntimeException { - return LaunderThrowable.await(stopABTestAsync(id)); + return this.stopABTest(id, null); } /** @@ -553,12 +863,16 @@ public ABTestResponse stopABTest(Integer id) throws AlgoliaRuntimeException { * receiving 100% of all search requests. Associated metadata and metrics are still stored. * * @param id The A/B test ID. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture stopABTestAsync(Integer id) - throws AlgoliaRuntimeException { + public CompletableFuture stopABTestAsync( + Integer id, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { if (id == null) { throw new AlgoliaRuntimeException( "Missing the required parameter 'id' when calling stopABTest(Async)" @@ -578,8 +892,20 @@ public CompletableFuture stopABTestAsync(Integer id) Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + + public CompletableFuture stopABTestAsync(Integer id) + throws AlgoliaRuntimeException { + return this.stopABTestAsync(id, null); + } } 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 7edb70ec13..91528b5036 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 @@ -4,6 +4,7 @@ import com.algolia.exceptions.*; import com.algolia.model.analytics.*; import com.algolia.utils.*; +import com.algolia.utils.RequestOptions; import com.algolia.utils.retry.CallType; import com.algolia.utils.retry.StatefulHost; import com.google.gson.reflect.TypeToken; @@ -85,17 +86,32 @@ private static List getDefaultHosts(String region) { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object del( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(delAsync(path, parameters, requestOptions)); + } + public Object del(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(delAsync(path, parameters)); + return this.del(path, parameters, null); + } + + public Object del(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.del(path, null, requestOptions); } public Object del(String path) throws AlgoliaRuntimeException { - return this.del(path, null); + return this.del(path, null, null); } /** @@ -104,13 +120,16 @@ public Object del(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture delAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -136,28 +155,69 @@ public CompletableFuture delAsync( } Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture delAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.delAsync(path, parameters, null); + } + + public CompletableFuture delAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.delAsync(path, null, requestOptions); + } + + public CompletableFuture delAsync(String path) + throws AlgoliaRuntimeException { + return this.delAsync(path, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object get( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getAsync(path, parameters, requestOptions)); + } + public Object get(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getAsync(path, parameters)); + return this.get(path, parameters, null); + } + + public Object get(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.get(path, null, requestOptions); } public Object get(String path) throws AlgoliaRuntimeException { - return this.get(path, null); + return this.get(path, null, null); } /** @@ -166,13 +226,16 @@ public Object get(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -198,11 +261,37 @@ public CompletableFuture getAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.getAsync(path, parameters, null); + } + + public CompletableFuture getAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getAsync(path, null, requestOptions); + } + + public CompletableFuture getAsync(String path) + throws AlgoliaRuntimeException { + return this.getAsync(path, null, null); + } + /** * Returns the average click position. The endpoint returns a value for the complete given time * range, as well as a value per day. @@ -215,6 +304,8 @@ public CompletableFuture getAsync( * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetAverageClickPositionResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -223,16 +314,45 @@ public GetAverageClickPositionResponse getAverageClickPosition( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - getAverageClickPositionAsync(index, startDate, endDate, tags) + getAverageClickPositionAsync( + index, + startDate, + endDate, + tags, + requestOptions + ) ); } + public GetAverageClickPositionResponse getAverageClickPosition( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getAverageClickPosition(index, startDate, endDate, tags, null); + } + + public GetAverageClickPositionResponse getAverageClickPosition( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getAverageClickPosition( + index, + null, + null, + null, + requestOptions + ); + } + public GetAverageClickPositionResponse getAverageClickPosition(String index) throws AlgoliaRuntimeException { - return this.getAverageClickPosition(index, null, null, null); + return this.getAverageClickPosition(index, null, null, null, null); } /** @@ -247,6 +367,8 @@ public GetAverageClickPositionResponse getAverageClickPosition(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -255,7 +377,8 @@ public CompletableFuture getAverageClickPositio String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -288,12 +411,53 @@ public CompletableFuture getAverageClickPositio } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {} .getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getAverageClickPositionAsync( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getAverageClickPositionAsync( + index, + startDate, + endDate, + tags, + null + ); + } + + public CompletableFuture getAverageClickPositionAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getAverageClickPositionAsync( + index, + null, + null, + null, + requestOptions + ); + } + + public CompletableFuture getAverageClickPositionAsync( + String index + ) throws AlgoliaRuntimeException { + return this.getAverageClickPositionAsync(index, null, null, null, null); + } + /** * Returns the distribution of clicks per range of positions. If the groups all have a count of 0, * it means Algolia didn’t receive any click events for the queries with the clickAnalytics search @@ -307,6 +471,8 @@ public CompletableFuture getAverageClickPositio * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetClickPositionsResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -315,16 +481,33 @@ public GetClickPositionsResponse getClickPositions( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - getClickPositionsAsync(index, startDate, endDate, tags) + getClickPositionsAsync(index, startDate, endDate, tags, requestOptions) ); } + public GetClickPositionsResponse getClickPositions( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getClickPositions(index, startDate, endDate, tags, null); + } + + public GetClickPositionsResponse getClickPositions( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getClickPositions(index, null, null, null, requestOptions); + } + public GetClickPositionsResponse getClickPositions(String index) throws AlgoliaRuntimeException { - return this.getClickPositions(index, null, null, null); + return this.getClickPositions(index, null, null, null, null); } /** @@ -341,6 +524,8 @@ public GetClickPositionsResponse getClickPositions(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -349,7 +534,8 @@ public CompletableFuture getClickPositionsAsync( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -382,11 +568,40 @@ public CompletableFuture getClickPositionsAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getClickPositionsAsync( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getClickPositionsAsync(index, startDate, endDate, tags, null); + } + + public CompletableFuture getClickPositionsAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getClickPositionsAsync(index, null, null, null, requestOptions); + } + + public CompletableFuture getClickPositionsAsync( + String index + ) throws AlgoliaRuntimeException { + return this.getClickPositionsAsync(index, null, null, null, null); + } + /** * Returns a click-through rate (CTR). The endpoint returns a value for the complete given time * range, as well as a value per day. It also returns the count of clicks and searches used to @@ -400,6 +615,8 @@ public CompletableFuture getClickPositionsAsync( * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetClickThroughRateResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -408,16 +625,33 @@ public GetClickThroughRateResponse getClickThroughRate( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - getClickThroughRateAsync(index, startDate, endDate, tags) + getClickThroughRateAsync(index, startDate, endDate, tags, requestOptions) ); } + public GetClickThroughRateResponse getClickThroughRate( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getClickThroughRate(index, startDate, endDate, tags, null); + } + + public GetClickThroughRateResponse getClickThroughRate( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getClickThroughRate(index, null, null, null, requestOptions); + } + public GetClickThroughRateResponse getClickThroughRate(String index) throws AlgoliaRuntimeException { - return this.getClickThroughRate(index, null, null, null); + return this.getClickThroughRate(index, null, null, null, null); } /** @@ -433,6 +667,8 @@ public GetClickThroughRateResponse getClickThroughRate(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -441,7 +677,8 @@ public CompletableFuture getClickThroughRateAsync( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -474,11 +711,46 @@ public CompletableFuture getClickThroughRateAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getClickThroughRateAsync( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getClickThroughRateAsync(index, startDate, endDate, tags, null); + } + + public CompletableFuture getClickThroughRateAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getClickThroughRateAsync( + index, + null, + null, + null, + requestOptions + ); + } + + public CompletableFuture getClickThroughRateAsync( + String index + ) throws AlgoliaRuntimeException { + return this.getClickThroughRateAsync(index, null, null, null, null); + } + /** * Returns a conversion rate (CR). The endpoint returns a value for the complete given time range, * as well as a value per day. It also returns the count of conversion and searches used to @@ -492,6 +764,8 @@ public CompletableFuture getClickThroughRateAsync( * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetConversationRateResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -500,16 +774,33 @@ public GetConversationRateResponse getConversationRate( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - getConversationRateAsync(index, startDate, endDate, tags) + getConversationRateAsync(index, startDate, endDate, tags, requestOptions) ); } + public GetConversationRateResponse getConversationRate( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getConversationRate(index, startDate, endDate, tags, null); + } + + public GetConversationRateResponse getConversationRate( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getConversationRate(index, null, null, null, requestOptions); + } + public GetConversationRateResponse getConversationRate(String index) throws AlgoliaRuntimeException { - return this.getConversationRate(index, null, null, null); + return this.getConversationRate(index, null, null, null, null); } /** @@ -525,6 +816,8 @@ public GetConversationRateResponse getConversationRate(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -533,7 +826,8 @@ public CompletableFuture getConversationRateAsync( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -566,11 +860,46 @@ public CompletableFuture getConversationRateAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getConversationRateAsync( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getConversationRateAsync(index, startDate, endDate, tags, null); + } + + public CompletableFuture getConversationRateAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getConversationRateAsync( + index, + null, + null, + null, + requestOptions + ); + } + + public CompletableFuture getConversationRateAsync( + String index + ) throws AlgoliaRuntimeException { + return this.getConversationRateAsync(index, null, null, null, null); + } + /** * Returns the rate at which searches didn't lead to any clicks. The endpoint returns a value for * the complete given time range, as well as a value per day. It also returns the count of @@ -584,6 +913,8 @@ public CompletableFuture getConversationRateAsync( * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetNoClickRateResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -592,16 +923,33 @@ public GetNoClickRateResponse getNoClickRate( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - getNoClickRateAsync(index, startDate, endDate, tags) + getNoClickRateAsync(index, startDate, endDate, tags, requestOptions) ); } + public GetNoClickRateResponse getNoClickRate( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getNoClickRate(index, startDate, endDate, tags, null); + } + + public GetNoClickRateResponse getNoClickRate( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getNoClickRate(index, null, null, null, requestOptions); + } + public GetNoClickRateResponse getNoClickRate(String index) throws AlgoliaRuntimeException { - return this.getNoClickRate(index, null, null, null); + return this.getNoClickRate(index, null, null, null, null); } /** @@ -617,6 +965,8 @@ public GetNoClickRateResponse getNoClickRate(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -625,7 +975,8 @@ public CompletableFuture getNoClickRateAsync( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -658,11 +1009,40 @@ public CompletableFuture getNoClickRateAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getNoClickRateAsync( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getNoClickRateAsync(index, startDate, endDate, tags, null); + } + + public CompletableFuture getNoClickRateAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getNoClickRateAsync(index, null, null, null, requestOptions); + } + + public CompletableFuture getNoClickRateAsync( + String index + ) throws AlgoliaRuntimeException { + return this.getNoClickRateAsync(index, null, null, null, null); + } + /** * Returns the rate at which searches didn't return any results. The endpoint returns a value for * the complete given time range, as well as a value per day. It also returns the count of @@ -676,6 +1056,8 @@ public CompletableFuture getNoClickRateAsync( * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetNoResultsRateResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -684,20 +1066,37 @@ public GetNoResultsRateResponse getNoResultsRate( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - getNoResultsRateAsync(index, startDate, endDate, tags) + getNoResultsRateAsync(index, startDate, endDate, tags, requestOptions) ); } - public GetNoResultsRateResponse getNoResultsRate(String index) - throws AlgoliaRuntimeException { - return this.getNoResultsRate(index, null, null, null); - } - - /** - * (asynchronously) Returns the rate at which searches didn't return any results. The endpoint + public GetNoResultsRateResponse getNoResultsRate( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getNoResultsRate(index, startDate, endDate, tags, null); + } + + public GetNoResultsRateResponse getNoResultsRate( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getNoResultsRate(index, null, null, null, requestOptions); + } + + public GetNoResultsRateResponse getNoResultsRate(String index) + throws AlgoliaRuntimeException { + return this.getNoResultsRate(index, null, null, null, null); + } + + /** + * (asynchronously) Returns the rate at which searches didn't return any results. The endpoint * returns a value for the complete given time range, as well as a value per day. It also returns * the count of searches and searches without results used to compute the rates. * @@ -709,6 +1108,8 @@ public GetNoResultsRateResponse getNoResultsRate(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -717,7 +1118,8 @@ public CompletableFuture getNoResultsRateAsync( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -750,11 +1152,40 @@ public CompletableFuture getNoResultsRateAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getNoResultsRateAsync( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getNoResultsRateAsync(index, startDate, endDate, tags, null); + } + + public CompletableFuture getNoResultsRateAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getNoResultsRateAsync(index, null, null, null, requestOptions); + } + + public CompletableFuture getNoResultsRateAsync( + String index + ) throws AlgoliaRuntimeException { + return this.getNoResultsRateAsync(index, null, null, null, null); + } + /** * Returns the number of searches across the given time range. The endpoint returns a value for * the complete given time range, as well as a value per day. @@ -767,6 +1198,8 @@ public CompletableFuture getNoResultsRateAsync( * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetSearchesCountResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -775,16 +1208,33 @@ public GetSearchesCountResponse getSearchesCount( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - getSearchesCountAsync(index, startDate, endDate, tags) + getSearchesCountAsync(index, startDate, endDate, tags, requestOptions) ); } + public GetSearchesCountResponse getSearchesCount( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getSearchesCount(index, startDate, endDate, tags, null); + } + + public GetSearchesCountResponse getSearchesCount( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getSearchesCount(index, null, null, null, requestOptions); + } + public GetSearchesCountResponse getSearchesCount(String index) throws AlgoliaRuntimeException { - return this.getSearchesCount(index, null, null, null); + return this.getSearchesCount(index, null, null, null, null); } /** @@ -799,6 +1249,8 @@ public GetSearchesCountResponse getSearchesCount(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -807,7 +1259,8 @@ public CompletableFuture getSearchesCountAsync( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -840,11 +1293,40 @@ public CompletableFuture getSearchesCountAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getSearchesCountAsync( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getSearchesCountAsync(index, startDate, endDate, tags, null); + } + + public CompletableFuture getSearchesCountAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getSearchesCountAsync(index, null, null, null, requestOptions); + } + + public CompletableFuture getSearchesCountAsync( + String index + ) throws AlgoliaRuntimeException { + return this.getSearchesCountAsync(index, null, null, null, null); + } + /** * Returns top searches that didn't lead to any clicks. Limited to the 1000 most frequent ones. * For each search, also returns the average number of found hits. @@ -861,6 +1343,8 @@ public CompletableFuture getSearchesCountAsync( * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetSearchesNoClicksResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -871,16 +1355,59 @@ public GetSearchesNoClicksResponse getSearchesNoClicks( String endDate, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - getSearchesNoClicksAsync(index, startDate, endDate, limit, offset, tags) + getSearchesNoClicksAsync( + index, + startDate, + endDate, + limit, + offset, + tags, + requestOptions + ) ); } + public GetSearchesNoClicksResponse getSearchesNoClicks( + String index, + String startDate, + String endDate, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getSearchesNoClicks( + index, + startDate, + endDate, + limit, + offset, + tags, + null + ); + } + + public GetSearchesNoClicksResponse getSearchesNoClicks( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getSearchesNoClicks( + index, + null, + null, + null, + null, + null, + requestOptions + ); + } + public GetSearchesNoClicksResponse getSearchesNoClicks(String index) throws AlgoliaRuntimeException { - return this.getSearchesNoClicks(index, null, null, null, null, null); + return this.getSearchesNoClicks(index, null, null, null, null, null, null); } /** @@ -899,6 +1426,8 @@ public GetSearchesNoClicksResponse getSearchesNoClicks(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -909,7 +1438,8 @@ public CompletableFuture getSearchesNoClicksAsync( String endDate, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -950,11 +1480,66 @@ public CompletableFuture getSearchesNoClicksAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getSearchesNoClicksAsync( + String index, + String startDate, + String endDate, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getSearchesNoClicksAsync( + index, + startDate, + endDate, + limit, + offset, + tags, + null + ); + } + + public CompletableFuture getSearchesNoClicksAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getSearchesNoClicksAsync( + index, + null, + null, + null, + null, + null, + requestOptions + ); + } + + public CompletableFuture getSearchesNoClicksAsync( + String index + ) throws AlgoliaRuntimeException { + return this.getSearchesNoClicksAsync( + index, + null, + null, + null, + null, + null, + null + ); + } + /** * Returns top searches that didn't return any results. Limited to the 1000 most frequent ones. * @@ -970,6 +1555,8 @@ public CompletableFuture getSearchesNoClicksAsync( * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetSearchesNoResultsResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -980,16 +1567,59 @@ public GetSearchesNoResultsResponse getSearchesNoResults( String endDate, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - getSearchesNoResultsAsync(index, startDate, endDate, limit, offset, tags) + getSearchesNoResultsAsync( + index, + startDate, + endDate, + limit, + offset, + tags, + requestOptions + ) ); } + public GetSearchesNoResultsResponse getSearchesNoResults( + String index, + String startDate, + String endDate, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getSearchesNoResults( + index, + startDate, + endDate, + limit, + offset, + tags, + null + ); + } + + public GetSearchesNoResultsResponse getSearchesNoResults( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getSearchesNoResults( + index, + null, + null, + null, + null, + null, + requestOptions + ); + } + public GetSearchesNoResultsResponse getSearchesNoResults(String index) throws AlgoliaRuntimeException { - return this.getSearchesNoResults(index, null, null, null, null, null); + return this.getSearchesNoResults(index, null, null, null, null, null, null); } /** @@ -1008,6 +1638,8 @@ public GetSearchesNoResultsResponse getSearchesNoResults(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -1018,7 +1650,8 @@ public CompletableFuture getSearchesNoResultsAsync String endDate, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -1059,24 +1692,88 @@ public CompletableFuture getSearchesNoResultsAsync } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {} .getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getSearchesNoResultsAsync( + String index, + String startDate, + String endDate, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getSearchesNoResultsAsync( + index, + startDate, + endDate, + limit, + offset, + tags, + null + ); + } + + public CompletableFuture getSearchesNoResultsAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getSearchesNoResultsAsync( + index, + null, + null, + null, + null, + null, + requestOptions + ); + } + + public CompletableFuture getSearchesNoResultsAsync( + String index + ) throws AlgoliaRuntimeException { + return this.getSearchesNoResultsAsync( + index, + null, + null, + null, + null, + null, + null + ); + } + /** * Returns the latest update time of the analytics API for a given index. If the index has been * recently created and/or no search has been performed yet the updated time will be null. * * @param index The index name to target. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetStatusResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public GetStatusResponse getStatus( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getStatusAsync(index, requestOptions)); + } + public GetStatusResponse getStatus(String index) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getStatusAsync(index)); + return this.getStatus(index, null); } /** @@ -1085,12 +1782,16 @@ public GetStatusResponse getStatus(String index) * be null. * * @param index The index name to target. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture getStatusAsync(String index) - throws AlgoliaRuntimeException { + public CompletableFuture getStatusAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( "Missing the required parameter 'index' when calling getStatus(Async)" @@ -1110,11 +1811,23 @@ public CompletableFuture getStatusAsync(String index) } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getStatusAsync(String index) + throws AlgoliaRuntimeException { + return this.getStatusAsync(index, null); + } + /** * Returns top countries. Limited to the 1000 most frequent ones. * @@ -1130,6 +1843,8 @@ public CompletableFuture getStatusAsync(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetTopCountriesResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -1140,17 +1855,60 @@ public GetTopCountriesResponse getTopCountries( String endDate, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - getTopCountriesAsync(index, startDate, endDate, limit, offset, tags) + getTopCountriesAsync( + index, + startDate, + endDate, + limit, + offset, + tags, + requestOptions + ) ); } - public GetTopCountriesResponse getTopCountries(String index) - throws AlgoliaRuntimeException { - return this.getTopCountries(index, null, null, null, null, null); - } + public GetTopCountriesResponse getTopCountries( + String index, + String startDate, + String endDate, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getTopCountries( + index, + startDate, + endDate, + limit, + offset, + tags, + null + ); + } + + public GetTopCountriesResponse getTopCountries( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getTopCountries( + index, + null, + null, + null, + null, + null, + requestOptions + ); + } + + public GetTopCountriesResponse getTopCountries(String index) + throws AlgoliaRuntimeException { + return this.getTopCountries(index, null, null, null, null, null, null); + } /** * (asynchronously) Returns top countries. Limited to the 1000 most frequent ones. @@ -1167,6 +1925,8 @@ public GetTopCountriesResponse getTopCountries(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -1177,7 +1937,8 @@ public CompletableFuture getTopCountriesAsync( String endDate, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -1218,11 +1979,58 @@ public CompletableFuture getTopCountriesAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getTopCountriesAsync( + String index, + String startDate, + String endDate, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getTopCountriesAsync( + index, + startDate, + endDate, + limit, + offset, + tags, + null + ); + } + + public CompletableFuture getTopCountriesAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getTopCountriesAsync( + index, + null, + null, + null, + null, + null, + requestOptions + ); + } + + public CompletableFuture getTopCountriesAsync( + String index + ) throws AlgoliaRuntimeException { + return this.getTopCountriesAsync(index, null, null, null, null, null, null); + } + /** * Returns top filter attributes. Limited to the 1000 most used filters. * @@ -1239,6 +2047,8 @@ public CompletableFuture getTopCountriesAsync( * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetTopFilterAttributesResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -1250,7 +2060,8 @@ public GetTopFilterAttributesResponse getTopFilterAttributes( String endDate, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( getTopFilterAttributesAsync( @@ -1260,11 +2071,49 @@ public GetTopFilterAttributesResponse getTopFilterAttributes( endDate, limit, offset, - tags + tags, + requestOptions ) ); } + public GetTopFilterAttributesResponse getTopFilterAttributes( + String index, + String search, + String startDate, + String endDate, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getTopFilterAttributes( + index, + search, + startDate, + endDate, + limit, + offset, + tags, + null + ); + } + + public GetTopFilterAttributesResponse getTopFilterAttributes( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getTopFilterAttributes( + index, + null, + null, + null, + null, + null, + null, + requestOptions + ); + } + public GetTopFilterAttributesResponse getTopFilterAttributes(String index) throws AlgoliaRuntimeException { return this.getTopFilterAttributes( @@ -1274,6 +2123,7 @@ public GetTopFilterAttributesResponse getTopFilterAttributes(String index) null, null, null, + null, null ); } @@ -1294,6 +2144,8 @@ public GetTopFilterAttributesResponse getTopFilterAttributes(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -1305,7 +2157,8 @@ public CompletableFuture getTopFilterAttributesA String endDate, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -1350,12 +2203,71 @@ public CompletableFuture getTopFilterAttributesA } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {} .getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getTopFilterAttributesAsync( + String index, + String search, + String startDate, + String endDate, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getTopFilterAttributesAsync( + index, + search, + startDate, + endDate, + limit, + offset, + tags, + null + ); + } + + public CompletableFuture getTopFilterAttributesAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getTopFilterAttributesAsync( + index, + null, + null, + null, + null, + null, + null, + requestOptions + ); + } + + public CompletableFuture getTopFilterAttributesAsync( + String index + ) throws AlgoliaRuntimeException { + return this.getTopFilterAttributesAsync( + index, + null, + null, + null, + null, + null, + null, + null + ); + } + /** * Returns top filters for the given attribute. Limited to the 1000 most used filters. * @@ -1373,6 +2285,8 @@ public CompletableFuture getTopFilterAttributesA * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetTopFilterForAttributeResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -1385,7 +2299,8 @@ public GetTopFilterForAttributeResponse getTopFilterForAttribute( String endDate, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( getTopFilterForAttributeAsync( @@ -1396,11 +2311,53 @@ public GetTopFilterForAttributeResponse getTopFilterForAttribute( endDate, limit, offset, - tags + tags, + requestOptions ) ); } + public GetTopFilterForAttributeResponse getTopFilterForAttribute( + String attribute, + String index, + String search, + String startDate, + String endDate, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getTopFilterForAttribute( + attribute, + index, + search, + startDate, + endDate, + limit, + offset, + tags, + null + ); + } + + public GetTopFilterForAttributeResponse getTopFilterForAttribute( + String attribute, + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getTopFilterForAttribute( + attribute, + index, + null, + null, + null, + null, + null, + null, + requestOptions + ); + } + public GetTopFilterForAttributeResponse getTopFilterForAttribute( String attribute, String index @@ -1413,6 +2370,7 @@ public GetTopFilterForAttributeResponse getTopFilterForAttribute( null, null, null, + null, null ); } @@ -1435,6 +2393,8 @@ public GetTopFilterForAttributeResponse getTopFilterForAttribute( * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -1447,7 +2407,8 @@ public CompletableFuture getTopFilterForAttrib String endDate, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (attribute == null) { throw new AlgoliaRuntimeException( @@ -1503,12 +2464,77 @@ public CompletableFuture getTopFilterForAttrib } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {} .getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getTopFilterForAttributeAsync( + String attribute, + String index, + String search, + String startDate, + String endDate, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getTopFilterForAttributeAsync( + attribute, + index, + search, + startDate, + endDate, + limit, + offset, + tags, + null + ); + } + + public CompletableFuture getTopFilterForAttributeAsync( + String attribute, + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getTopFilterForAttributeAsync( + attribute, + index, + null, + null, + null, + null, + null, + null, + requestOptions + ); + } + + public CompletableFuture getTopFilterForAttributeAsync( + String attribute, + String index + ) throws AlgoliaRuntimeException { + return this.getTopFilterForAttributeAsync( + attribute, + index, + null, + null, + null, + null, + null, + null, + null + ); + } + /** * Returns top filters with no results. Limited to the 1000 most used filters. * @@ -1525,6 +2551,8 @@ public CompletableFuture getTopFilterForAttrib * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetTopFiltersNoResultsResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -1536,7 +2564,8 @@ public GetTopFiltersNoResultsResponse getTopFiltersNoResults( String endDate, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( getTopFiltersNoResultsAsync( @@ -1546,11 +2575,49 @@ public GetTopFiltersNoResultsResponse getTopFiltersNoResults( endDate, limit, offset, - tags + tags, + requestOptions ) ); } + public GetTopFiltersNoResultsResponse getTopFiltersNoResults( + String index, + String search, + String startDate, + String endDate, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getTopFiltersNoResults( + index, + search, + startDate, + endDate, + limit, + offset, + tags, + null + ); + } + + public GetTopFiltersNoResultsResponse getTopFiltersNoResults( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getTopFiltersNoResults( + index, + null, + null, + null, + null, + null, + null, + requestOptions + ); + } + public GetTopFiltersNoResultsResponse getTopFiltersNoResults(String index) throws AlgoliaRuntimeException { return this.getTopFiltersNoResults( @@ -1560,6 +2627,7 @@ public GetTopFiltersNoResultsResponse getTopFiltersNoResults(String index) null, null, null, + null, null ); } @@ -1580,6 +2648,8 @@ public GetTopFiltersNoResultsResponse getTopFiltersNoResults(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -1591,7 +2661,8 @@ public CompletableFuture getTopFiltersNoResultsA String endDate, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -1636,12 +2707,71 @@ public CompletableFuture getTopFiltersNoResultsA } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {} .getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getTopFiltersNoResultsAsync( + String index, + String search, + String startDate, + String endDate, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getTopFiltersNoResultsAsync( + index, + search, + startDate, + endDate, + limit, + offset, + tags, + null + ); + } + + public CompletableFuture getTopFiltersNoResultsAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getTopFiltersNoResultsAsync( + index, + null, + null, + null, + null, + null, + null, + requestOptions + ); + } + + public CompletableFuture getTopFiltersNoResultsAsync( + String index + ) throws AlgoliaRuntimeException { + return this.getTopFiltersNoResultsAsync( + index, + null, + null, + null, + null, + null, + null, + null + ); + } + /** * Returns top hits. Limited to the 1000 most frequent ones. * @@ -1660,6 +2790,8 @@ public CompletableFuture getTopFiltersNoResultsA * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetTopHitsResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -1672,7 +2804,8 @@ public GetTopHitsResponse getTopHits( String endDate, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( getTopHitsAsync( @@ -1683,14 +2816,65 @@ public GetTopHitsResponse getTopHits( endDate, limit, offset, - tags + tags, + requestOptions ) ); } + public GetTopHitsResponse getTopHits( + String index, + String search, + Boolean clickAnalytics, + String startDate, + String endDate, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getTopHits( + index, + search, + clickAnalytics, + startDate, + endDate, + limit, + offset, + tags, + null + ); + } + + public GetTopHitsResponse getTopHits( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getTopHits( + index, + null, + null, + null, + null, + null, + null, + null, + requestOptions + ); + } + public GetTopHitsResponse getTopHits(String index) throws AlgoliaRuntimeException { - return this.getTopHits(index, null, null, null, null, null, null, null); + return this.getTopHits( + index, + null, + null, + null, + null, + null, + null, + null, + null + ); } /** @@ -1711,6 +2895,8 @@ public GetTopHitsResponse getTopHits(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -1723,7 +2909,8 @@ public CompletableFuture getTopHitsAsync( String endDate, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -1772,11 +2959,73 @@ public CompletableFuture getTopHitsAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getTopHitsAsync( + String index, + String search, + Boolean clickAnalytics, + String startDate, + String endDate, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getTopHitsAsync( + index, + search, + clickAnalytics, + startDate, + endDate, + limit, + offset, + tags, + null + ); + } + + public CompletableFuture getTopHitsAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getTopHitsAsync( + index, + null, + null, + null, + null, + null, + null, + null, + requestOptions + ); + } + + public CompletableFuture getTopHitsAsync(String index) + throws AlgoliaRuntimeException { + return this.getTopHitsAsync( + index, + null, + null, + null, + null, + null, + null, + null, + null + ); + } + /** * Returns top searches. Limited to the 1000 most frequent ones. For each search, also returns the * average number of hits returned. @@ -1797,6 +3046,8 @@ public CompletableFuture getTopHitsAsync( * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetTopSearchesResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -1810,7 +3061,8 @@ public GetTopSearchesResponse getTopSearches( Direction direction, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( getTopSearchesAsync( @@ -1822,11 +3074,55 @@ public GetTopSearchesResponse getTopSearches( direction, limit, offset, - tags + tags, + requestOptions ) ); } + public GetTopSearchesResponse getTopSearches( + String index, + Boolean clickAnalytics, + String startDate, + String endDate, + OrderBy orderBy, + Direction direction, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getTopSearches( + index, + clickAnalytics, + startDate, + endDate, + orderBy, + direction, + limit, + offset, + tags, + null + ); + } + + public GetTopSearchesResponse getTopSearches( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getTopSearches( + index, + null, + null, + null, + null, + null, + null, + null, + null, + requestOptions + ); + } + public GetTopSearchesResponse getTopSearches(String index) throws AlgoliaRuntimeException { return this.getTopSearches( @@ -1838,6 +3134,7 @@ public GetTopSearchesResponse getTopSearches(String index) null, null, null, + null, null ); } @@ -1862,6 +3159,8 @@ public GetTopSearchesResponse getTopSearches(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -1875,7 +3174,8 @@ public CompletableFuture getTopSearchesAsync( Direction direction, Integer limit, Integer offset, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -1928,11 +3228,78 @@ public CompletableFuture getTopSearchesAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getTopSearchesAsync( + String index, + Boolean clickAnalytics, + String startDate, + String endDate, + OrderBy orderBy, + Direction direction, + Integer limit, + Integer offset, + String tags + ) throws AlgoliaRuntimeException { + return this.getTopSearchesAsync( + index, + clickAnalytics, + startDate, + endDate, + orderBy, + direction, + limit, + offset, + tags, + null + ); + } + + public CompletableFuture getTopSearchesAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getTopSearchesAsync( + index, + null, + null, + null, + null, + null, + null, + null, + null, + requestOptions + ); + } + + public CompletableFuture getTopSearchesAsync( + String index + ) throws AlgoliaRuntimeException { + return this.getTopSearchesAsync( + index, + null, + null, + null, + null, + null, + null, + null, + null, + null + ); + } + /** * Returns the distinct count of users across the given time range. The endpoint returns a value * for the complete given time range, as well as a value per day. @@ -1945,6 +3312,8 @@ public CompletableFuture getTopSearchesAsync( * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetUsersCountResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -1953,16 +3322,33 @@ public GetUsersCountResponse getUsersCount( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - getUsersCountAsync(index, startDate, endDate, tags) + getUsersCountAsync(index, startDate, endDate, tags, requestOptions) ); } + public GetUsersCountResponse getUsersCount( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getUsersCount(index, startDate, endDate, tags, null); + } + + public GetUsersCountResponse getUsersCount( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getUsersCount(index, null, null, null, requestOptions); + } + public GetUsersCountResponse getUsersCount(String index) throws AlgoliaRuntimeException { - return this.getUsersCount(index, null, null, null); + return this.getUsersCount(index, null, null, null, null); } /** @@ -1977,6 +3363,8 @@ public GetUsersCountResponse getUsersCount(String index) * @param tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags * set at search time. Multiple tags can be combined with the operators OR and AND. If a tag * contains characters like spaces or parentheses, it should be URL encoded. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -1985,7 +3373,8 @@ public CompletableFuture getUsersCountAsync( String index, String startDate, String endDate, - String tags + String tags, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (index == null) { throw new AlgoliaRuntimeException( @@ -2018,11 +3407,40 @@ public CompletableFuture getUsersCountAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getUsersCountAsync( + String index, + String startDate, + String endDate, + String tags + ) throws AlgoliaRuntimeException { + return this.getUsersCountAsync(index, startDate, endDate, tags, null); + } + + public CompletableFuture getUsersCountAsync( + String index, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getUsersCountAsync(index, null, null, null, requestOptions); + } + + public CompletableFuture getUsersCountAsync( + String index + ) throws AlgoliaRuntimeException { + return this.getUsersCountAsync(index, null, null, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -2030,17 +3448,35 @@ public CompletableFuture getUsersCountAsync( * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object post( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + postAsync(path, parameters, body, requestOptions) + ); + } + public Object post(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(postAsync(path, parameters, body)); + return this.post(path, parameters, body, null); + } + + public Object post(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.post(path, null, null, requestOptions); } public Object post(String path) throws AlgoliaRuntimeException { - return this.post(path, null, null); + return this.post(path, null, null, null); } /** @@ -2050,6 +3486,8 @@ public Object post(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -2057,7 +3495,8 @@ public Object post(String path) throws AlgoliaRuntimeException { public CompletableFuture postAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -2083,11 +3522,38 @@ public CompletableFuture postAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture postAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.postAsync(path, parameters, body, null); + } + + public CompletableFuture postAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, requestOptions); + } + + public CompletableFuture postAsync(String path) + throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -2095,17 +3561,35 @@ public CompletableFuture postAsync( * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object put( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + putAsync(path, parameters, body, requestOptions) + ); + } + public Object put(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(putAsync(path, parameters, body)); + return this.put(path, parameters, body, null); + } + + public Object put(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.put(path, null, null, requestOptions); } public Object put(String path) throws AlgoliaRuntimeException { - return this.put(path, null, null); + return this.put(path, null, null, null); } /** @@ -2115,6 +3599,8 @@ public Object put(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -2122,7 +3608,8 @@ public Object put(String path) throws AlgoliaRuntimeException { public CompletableFuture putAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -2148,8 +3635,35 @@ public CompletableFuture putAsync( } Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + + public CompletableFuture putAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.putAsync(path, parameters, body, null); + } + + public CompletableFuture putAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, requestOptions); + } + + public CompletableFuture putAsync(String path) + throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, 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 91c7437f24..30c2fb1e08 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 @@ -4,6 +4,7 @@ import com.algolia.exceptions.*; import com.algolia.model.insights.*; import com.algolia.utils.*; +import com.algolia.utils.RequestOptions; import com.algolia.utils.retry.CallType; import com.algolia.utils.retry.StatefulHost; import com.google.gson.reflect.TypeToken; @@ -85,17 +86,32 @@ private static List getDefaultHosts(String region) { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object del( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(delAsync(path, parameters, requestOptions)); + } + public Object del(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(delAsync(path, parameters)); + return this.del(path, parameters, null); + } + + public Object del(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.del(path, null, requestOptions); } public Object del(String path) throws AlgoliaRuntimeException { - return this.del(path, null); + return this.del(path, null, null); } /** @@ -104,13 +120,16 @@ public Object del(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture delAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -136,28 +155,69 @@ public CompletableFuture delAsync( } Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture delAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.delAsync(path, parameters, null); + } + + public CompletableFuture delAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.delAsync(path, null, requestOptions); + } + + public CompletableFuture delAsync(String path) + throws AlgoliaRuntimeException { + return this.delAsync(path, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object get( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getAsync(path, parameters, requestOptions)); + } + public Object get(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getAsync(path, parameters)); + return this.get(path, parameters, null); + } + + public Object get(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.get(path, null, requestOptions); } public Object get(String path) throws AlgoliaRuntimeException { - return this.get(path, null); + return this.get(path, null, null); } /** @@ -166,13 +226,16 @@ public Object get(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -198,11 +261,37 @@ public CompletableFuture getAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.getAsync(path, parameters, null); + } + + public CompletableFuture getAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getAsync(path, null, requestOptions); + } + + public CompletableFuture getAsync(String path) + throws AlgoliaRuntimeException { + return this.getAsync(path, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -210,17 +299,35 @@ public CompletableFuture getAsync( * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object post( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + postAsync(path, parameters, body, requestOptions) + ); + } + public Object post(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(postAsync(path, parameters, body)); + return this.post(path, parameters, body, null); + } + + public Object post(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.post(path, null, null, requestOptions); } public Object post(String path) throws AlgoliaRuntimeException { - return this.post(path, null, null); + return this.post(path, null, null, null); } /** @@ -230,6 +337,8 @@ public Object post(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -237,7 +346,8 @@ public Object post(String path) throws AlgoliaRuntimeException { public CompletableFuture postAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -263,11 +373,38 @@ public CompletableFuture postAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture postAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.postAsync(path, parameters, body, null); + } + + public CompletableFuture postAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, requestOptions); + } + + public CompletableFuture postAsync(String path) + throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, null); + } + /** * This command pushes an array of events. An event is - an action: `eventName` - performed in a * context: `eventType` - at some point in time provided: `timestamp` - by an end user: @@ -279,13 +416,24 @@ public CompletableFuture postAsync( * single item. As such an event will accept an array of `objectIDs` or `filters`. * * @param insightEvents (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return PushEventsResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public PushEventsResponse pushEvents( + InsightEvents insightEvents, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + pushEventsAsync(insightEvents, requestOptions) + ); + } + public PushEventsResponse pushEvents(InsightEvents insightEvents) throws AlgoliaRuntimeException { - return LaunderThrowable.await(pushEventsAsync(insightEvents)); + return this.pushEvents(insightEvents, null); } /** @@ -301,12 +449,15 @@ public PushEventsResponse pushEvents(InsightEvents insightEvents) * `objectIDs` or `filters`. * * @param insightEvents (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture pushEventsAsync( - InsightEvents insightEvents + InsightEvents insightEvents, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (insightEvents == null) { throw new AlgoliaRuntimeException( @@ -323,11 +474,24 @@ public CompletableFuture pushEventsAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture pushEventsAsync( + InsightEvents insightEvents + ) throws AlgoliaRuntimeException { + return this.pushEventsAsync(insightEvents, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -335,17 +499,35 @@ public CompletableFuture pushEventsAsync( * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object put( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + putAsync(path, parameters, body, requestOptions) + ); + } + public Object put(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(putAsync(path, parameters, body)); + return this.put(path, parameters, body, null); + } + + public Object put(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.put(path, null, null, requestOptions); } public Object put(String path) throws AlgoliaRuntimeException { - return this.put(path, null, null); + return this.put(path, null, null, null); } /** @@ -355,6 +537,8 @@ public Object put(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -362,7 +546,8 @@ public Object put(String path) throws AlgoliaRuntimeException { public CompletableFuture putAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -388,8 +573,35 @@ public CompletableFuture putAsync( } Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + + public CompletableFuture putAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.putAsync(path, parameters, body, null); + } + + public CompletableFuture putAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, requestOptions); + } + + public CompletableFuture putAsync(String path) + throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, 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 43bd874977..1afb1cb9e6 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 @@ -4,6 +4,7 @@ import com.algolia.exceptions.*; import com.algolia.model.personalization.*; import com.algolia.utils.*; +import com.algolia.utils.RequestOptions; import com.algolia.utils.retry.CallType; import com.algolia.utils.retry.StatefulHost; import com.google.gson.reflect.TypeToken; @@ -71,17 +72,32 @@ private static List getDefaultHosts(String region) { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object del( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(delAsync(path, parameters, requestOptions)); + } + public Object del(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(delAsync(path, parameters)); + return this.del(path, parameters, null); + } + + public Object del(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.del(path, null, requestOptions); } public Object del(String path) throws AlgoliaRuntimeException { - return this.del(path, null); + return this.del(path, null, null); } /** @@ -90,13 +106,16 @@ public Object del(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture delAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -122,11 +141,37 @@ public CompletableFuture delAsync( } Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture delAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.delAsync(path, parameters, null); + } + + public CompletableFuture delAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.delAsync(path, null, requestOptions); + } + + public CompletableFuture delAsync(String path) + throws AlgoliaRuntimeException { + return this.delAsync(path, null, null); + } + /** * Delete the user profile and all its associated data. Returns, as part of the response, a date * until which the data can safely be considered as deleted for the given user. This means if you @@ -136,13 +181,24 @@ public CompletableFuture delAsync( * * @param userToken userToken representing the user for which to fetch the Personalization * profile. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return DeleteUserProfileResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public DeleteUserProfileResponse deleteUserProfile( + String userToken, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + deleteUserProfileAsync(userToken, requestOptions) + ); + } + public DeleteUserProfileResponse deleteUserProfile(String userToken) throws AlgoliaRuntimeException { - return LaunderThrowable.await(deleteUserProfileAsync(userToken)); + return this.deleteUserProfile(userToken, null); } /** @@ -154,12 +210,15 @@ public DeleteUserProfileResponse deleteUserProfile(String userToken) * * @param userToken userToken representing the user for which to fetch the Personalization * profile. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture deleteUserProfileAsync( - String userToken + String userToken, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (userToken == null) { throw new AlgoliaRuntimeException( @@ -180,28 +239,56 @@ public CompletableFuture deleteUserProfileAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture deleteUserProfileAsync( + String userToken + ) throws AlgoliaRuntimeException { + return this.deleteUserProfileAsync(userToken, null); + } + /** * This method allow you to send requests to the Algolia REST API. * * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object get( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getAsync(path, parameters, requestOptions)); + } + public Object get(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getAsync(path, parameters)); + return this.get(path, parameters, null); + } + + public Object get(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.get(path, null, requestOptions); } public Object get(String path) throws AlgoliaRuntimeException { - return this.get(path, null); + return this.get(path, null, null); } /** @@ -210,13 +297,16 @@ public Object get(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -242,34 +332,73 @@ public CompletableFuture getAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.getAsync(path, parameters, null); + } + + public CompletableFuture getAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getAsync(path, null, requestOptions); + } + + public CompletableFuture getAsync(String path) + throws AlgoliaRuntimeException { + return this.getAsync(path, null, null); + } + /** * The strategy contains information on the events and facets that impact user profiles and * personalized search results. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return PersonalizationStrategyParams * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public PersonalizationStrategyParams getPersonalizationStrategy( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + getPersonalizationStrategyAsync(requestOptions) + ); + } + public PersonalizationStrategyParams getPersonalizationStrategy() throws AlgoliaRuntimeException { - return LaunderThrowable.await(getPersonalizationStrategyAsync()); + return this.getPersonalizationStrategy(null); } /** * (asynchronously) The strategy contains information on the events and facets that impact user * profiles and personalized search results. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture getPersonalizationStrategyAsync() - throws AlgoliaRuntimeException { + public CompletableFuture getPersonalizationStrategyAsync( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -279,12 +408,24 @@ public CompletableFuture getPersonalizationStrate Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {} .getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getPersonalizationStrategyAsync() + throws AlgoliaRuntimeException { + return this.getPersonalizationStrategyAsync(null); + } + /** * Get the user profile built from Personalization strategy. The profile is structured by facet * name used in the strategy. Each facet value is mapped to its score. Each score represents the @@ -294,13 +435,24 @@ public CompletableFuture getPersonalizationStrate * * @param userToken userToken representing the user for which to fetch the Personalization * profile. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetUserTokenResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public GetUserTokenResponse getUserTokenProfile( + String userToken, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + getUserTokenProfileAsync(userToken, requestOptions) + ); + } + public GetUserTokenResponse getUserTokenProfile(String userToken) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getUserTokenProfileAsync(userToken)); + return this.getUserTokenProfile(userToken, null); } /** @@ -312,12 +464,15 @@ public GetUserTokenResponse getUserTokenProfile(String userToken) * * @param userToken userToken representing the user for which to fetch the Personalization * profile. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getUserTokenProfileAsync( - String userToken + String userToken, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (userToken == null) { throw new AlgoliaRuntimeException( @@ -338,11 +493,24 @@ public CompletableFuture getUserTokenProfileAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getUserTokenProfileAsync( + String userToken + ) throws AlgoliaRuntimeException { + return this.getUserTokenProfileAsync(userToken, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -350,17 +518,35 @@ public CompletableFuture getUserTokenProfileAsync( * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object post( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + postAsync(path, parameters, body, requestOptions) + ); + } + public Object post(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(postAsync(path, parameters, body)); + return this.post(path, parameters, body, null); + } + + public Object post(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.post(path, null, null, requestOptions); } public Object post(String path) throws AlgoliaRuntimeException { - return this.post(path, null, null); + return this.post(path, null, null, null); } /** @@ -370,6 +556,8 @@ public Object post(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -377,7 +565,8 @@ public Object post(String path) throws AlgoliaRuntimeException { public CompletableFuture postAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -403,11 +592,38 @@ public CompletableFuture postAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture postAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.postAsync(path, parameters, body, null); + } + + public CompletableFuture postAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, requestOptions); + } + + public CompletableFuture postAsync(String path) + throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -415,17 +631,35 @@ public CompletableFuture postAsync( * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object put( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + putAsync(path, parameters, body, requestOptions) + ); + } + public Object put(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(putAsync(path, parameters, body)); + return this.put(path, parameters, body, null); + } + + public Object put(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.put(path, null, null, requestOptions); } public Object put(String path) throws AlgoliaRuntimeException { - return this.put(path, null, null); + return this.put(path, null, null, null); } /** @@ -435,6 +669,8 @@ public Object put(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -442,7 +678,8 @@ public Object put(String path) throws AlgoliaRuntimeException { public CompletableFuture putAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -468,39 +705,81 @@ public CompletableFuture putAsync( } Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture putAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.putAsync(path, parameters, body, null); + } + + public CompletableFuture putAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, requestOptions); + } + + public CompletableFuture putAsync(String path) + throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, null); + } + /** * A strategy defines the events and facets that impact user profiles and personalized search * results. * * @param personalizationStrategyParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return SetPersonalizationStrategyResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ public SetPersonalizationStrategyResponse setPersonalizationStrategy( - PersonalizationStrategyParams personalizationStrategyParams + PersonalizationStrategyParams personalizationStrategyParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - setPersonalizationStrategyAsync(personalizationStrategyParams) + setPersonalizationStrategyAsync( + personalizationStrategyParams, + requestOptions + ) ); } + public SetPersonalizationStrategyResponse setPersonalizationStrategy( + PersonalizationStrategyParams personalizationStrategyParams + ) throws AlgoliaRuntimeException { + return this.setPersonalizationStrategy(personalizationStrategyParams, null); + } + /** * (asynchronously) A strategy defines the events and facets that impact user profiles and * personalized search results. * * @param personalizationStrategyParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture setPersonalizationStrategyAsync( - PersonalizationStrategyParams personalizationStrategyParams + PersonalizationStrategyParams personalizationStrategyParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (personalizationStrategyParams == null) { throw new AlgoliaRuntimeException( @@ -518,9 +797,25 @@ public CompletableFuture setPersonalizationS Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {} .getType(); return this.executeAsync(call, returnType); } + + public CompletableFuture setPersonalizationStrategyAsync( + PersonalizationStrategyParams personalizationStrategyParams + ) throws AlgoliaRuntimeException { + return this.setPersonalizationStrategyAsync( + personalizationStrategyParams, + null + ); + } } 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 89d7831d7b..9c82a58940 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 @@ -4,6 +4,7 @@ import com.algolia.exceptions.*; import com.algolia.model.predict.*; import com.algolia.utils.*; +import com.algolia.utils.RequestOptions; import com.algolia.utils.retry.CallType; import com.algolia.utils.retry.StatefulHost; import com.google.gson.reflect.TypeToken; @@ -67,17 +68,32 @@ private static List getDefaultHosts(String region) { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object del( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(delAsync(path, parameters, requestOptions)); + } + public Object del(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(delAsync(path, parameters)); + return this.del(path, parameters, null); + } + + public Object del(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.del(path, null, requestOptions); } public Object del(String path) throws AlgoliaRuntimeException { - return this.del(path, null); + return this.del(path, null, null); } /** @@ -86,13 +102,16 @@ public Object del(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture delAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -118,11 +137,37 @@ public CompletableFuture delAsync( } Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture delAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.delAsync(path, parameters, null); + } + + public CompletableFuture delAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.delAsync(path, null, requestOptions); + } + + public CompletableFuture delAsync(String path) + throws AlgoliaRuntimeException { + return this.delAsync(path, null, null); + } + /** * Get predictions, properties (raw, computed or custom) and segments (computed or custom) for a * user profile. @@ -130,15 +175,27 @@ public CompletableFuture delAsync( * @param userID User ID for authenticated users or cookie ID for non-authenticated repeated users * (visitors). (required) * @param params (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return FetchUserProfileResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public FetchUserProfileResponse fetchUserProfile( + String userID, + Params params, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + fetchUserProfileAsync(userID, params, requestOptions) + ); + } + public FetchUserProfileResponse fetchUserProfile( String userID, Params params ) throws AlgoliaRuntimeException { - return LaunderThrowable.await(fetchUserProfileAsync(userID, params)); + return this.fetchUserProfile(userID, params, null); } /** @@ -148,13 +205,16 @@ public FetchUserProfileResponse fetchUserProfile( * @param userID User ID for authenticated users or cookie ID for non-authenticated repeated users * (visitors). (required) * @param params (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture fetchUserProfileAsync( String userID, - Params params + Params params, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (userID == null) { throw new AlgoliaRuntimeException( @@ -181,28 +241,57 @@ public CompletableFuture fetchUserProfileAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture fetchUserProfileAsync( + String userID, + Params params + ) throws AlgoliaRuntimeException { + return this.fetchUserProfileAsync(userID, params, null); + } + /** * This method allow you to send requests to the Algolia REST API. * * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object get( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getAsync(path, parameters, requestOptions)); + } + public Object get(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getAsync(path, parameters)); + return this.get(path, parameters, null); + } + + public Object get(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.get(path, null, requestOptions); } public Object get(String path) throws AlgoliaRuntimeException { - return this.get(path, null); + return this.get(path, null, null); } /** @@ -211,13 +300,16 @@ public Object get(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -243,11 +335,37 @@ public CompletableFuture getAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.getAsync(path, parameters, null); + } + + public CompletableFuture getAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getAsync(path, null, requestOptions); + } + + public CompletableFuture getAsync(String path) + throws AlgoliaRuntimeException { + return this.getAsync(path, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -255,17 +373,35 @@ public CompletableFuture getAsync( * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object post( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + postAsync(path, parameters, body, requestOptions) + ); + } + public Object post(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(postAsync(path, parameters, body)); + return this.post(path, parameters, body, null); + } + + public Object post(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.post(path, null, null, requestOptions); } public Object post(String path) throws AlgoliaRuntimeException { - return this.post(path, null, null); + return this.post(path, null, null, null); } /** @@ -275,6 +411,8 @@ public Object post(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -282,7 +420,8 @@ public Object post(String path) throws AlgoliaRuntimeException { public CompletableFuture postAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -308,11 +447,38 @@ public CompletableFuture postAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture postAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.postAsync(path, parameters, body, null); + } + + public CompletableFuture postAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, requestOptions); + } + + public CompletableFuture postAsync(String path) + throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -320,17 +486,35 @@ public CompletableFuture postAsync( * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object put( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + putAsync(path, parameters, body, requestOptions) + ); + } + public Object put(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(putAsync(path, parameters, body)); + return this.put(path, parameters, body, null); + } + + public Object put(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.put(path, null, null, requestOptions); } public Object put(String path) throws AlgoliaRuntimeException { - return this.put(path, null, null); + return this.put(path, null, null, null); } /** @@ -340,6 +524,8 @@ public Object put(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -347,7 +533,8 @@ public Object put(String path) throws AlgoliaRuntimeException { public CompletableFuture putAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -373,8 +560,35 @@ public CompletableFuture putAsync( } Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + + public CompletableFuture putAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.putAsync(path, parameters, body, null); + } + + public CompletableFuture putAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, requestOptions); + } + + public CompletableFuture putAsync(String path) + throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, 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 c3ec933933..1c3d7c038d 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 @@ -4,6 +4,7 @@ import com.algolia.exceptions.*; import com.algolia.model.querySuggestions.*; import com.algolia.utils.*; +import com.algolia.utils.RequestOptions; import com.algolia.utils.retry.CallType; import com.algolia.utils.retry.StatefulHost; import com.google.gson.reflect.TypeToken; @@ -70,29 +71,41 @@ private static List getDefaultHosts(String region) { * application. * * @param querySuggestionsIndexWithIndexParam (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return SucessResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ public SucessResponse createConfig( - QuerySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam + QuerySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - createConfigAsync(querySuggestionsIndexWithIndexParam) + createConfigAsync(querySuggestionsIndexWithIndexParam, requestOptions) ); } + public SucessResponse createConfig( + QuerySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam + ) throws AlgoliaRuntimeException { + return this.createConfig(querySuggestionsIndexWithIndexParam, null); + } + /** * (asynchronously) Create a configuration of a Query Suggestions index. There's a limit of * 100 configurations per application. * * @param querySuggestionsIndexWithIndexParam (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture createConfigAsync( - QuerySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam + QuerySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (querySuggestionsIndexWithIndexParam == null) { throw new AlgoliaRuntimeException( @@ -110,28 +123,56 @@ public CompletableFuture createConfigAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture createConfigAsync( + QuerySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam + ) throws AlgoliaRuntimeException { + return this.createConfigAsync(querySuggestionsIndexWithIndexParam, null); + } + /** * This method allow you to send requests to the Algolia REST API. * * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object del( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(delAsync(path, parameters, requestOptions)); + } + public Object del(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(delAsync(path, parameters)); + return this.del(path, parameters, null); + } + + public Object del(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.del(path, null, requestOptions); } public Object del(String path) throws AlgoliaRuntimeException { - return this.del(path, null); + return this.del(path, null, null); } /** @@ -140,13 +181,16 @@ public Object del(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture delAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -172,24 +216,59 @@ public CompletableFuture delAsync( } Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture delAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.delAsync(path, parameters, null); + } + + public CompletableFuture delAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.delAsync(path, null, requestOptions); + } + + public CompletableFuture delAsync(String path) + throws AlgoliaRuntimeException { + return this.delAsync(path, null, null); + } + /** * Delete a configuration of a Query Suggestion's index. By deleting a configuraton, you stop all * updates to the underlying query suggestion index. Note that when doing this, the underlying * index does not change - existing suggestions remain untouched. * * @param indexName The index in which to perform the request. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return SucessResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public SucessResponse deleteConfig( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(deleteConfigAsync(indexName, requestOptions)); + } + public SucessResponse deleteConfig(String indexName) throws AlgoliaRuntimeException { - return LaunderThrowable.await(deleteConfigAsync(indexName)); + return this.deleteConfig(indexName, null); } /** @@ -198,12 +277,16 @@ public SucessResponse deleteConfig(String indexName) * doing this, the underlying index does not change - existing suggestions remain untouched. * * @param indexName The index in which to perform the request. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture deleteConfigAsync(String indexName) - throws AlgoliaRuntimeException { + public CompletableFuture deleteConfigAsync( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling deleteConfig(Async)" @@ -223,28 +306,55 @@ public CompletableFuture deleteConfigAsync(String indexName) Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture deleteConfigAsync(String indexName) + throws AlgoliaRuntimeException { + return this.deleteConfigAsync(indexName, null); + } + /** * This method allow you to send requests to the Algolia REST API. * * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object get( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getAsync(path, parameters, requestOptions)); + } + public Object get(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getAsync(path, parameters)); + return this.get(path, parameters, null); + } + + public Object get(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.get(path, null, requestOptions); } public Object get(String path) throws AlgoliaRuntimeException { - return this.get(path, null); + return this.get(path, null, null); } /** @@ -253,13 +363,16 @@ public Object get(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -285,34 +398,71 @@ public CompletableFuture getAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.getAsync(path, parameters, null); + } + + public CompletableFuture getAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getAsync(path, null, requestOptions); + } + + public CompletableFuture getAsync(String path) + throws AlgoliaRuntimeException { + return this.getAsync(path, null, null); + } + /** * Get all the configurations of Query Suggestions. For each index, you get a block of JSON with a * list of its configuration settings. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return List<QuerySuggestionsIndex> * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public List getAllConfigs( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getAllConfigsAsync(requestOptions)); + } + public List getAllConfigs() throws AlgoliaRuntimeException { - return LaunderThrowable.await(getAllConfigsAsync()); + return this.getAllConfigs(null); } /** * (asynchronously) Get all the configurations of Query Suggestions. For each index, you get a * block of JSON with a list of its configuration settings. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture> getAllConfigsAsync() - throws AlgoliaRuntimeException { + public CompletableFuture> getAllConfigsAsync( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -322,34 +472,58 @@ public CompletableFuture> getAllConfigsAsync() Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken>() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture> getAllConfigsAsync() + throws AlgoliaRuntimeException { + return this.getAllConfigsAsync(null); + } + /** * Get the configuration of a single Query Suggestions index. * * @param indexName The index in which to perform the request. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return QuerySuggestionsIndex * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public QuerySuggestionsIndex getConfig( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getConfigAsync(indexName, requestOptions)); + } + public QuerySuggestionsIndex getConfig(String indexName) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getConfigAsync(indexName)); + return this.getConfig(indexName, null); } /** * (asynchronously) Get the configuration of a single Query Suggestions index. * * @param indexName The index in which to perform the request. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getConfigAsync( - String indexName + String indexName, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -370,23 +544,47 @@ public CompletableFuture getConfigAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getConfigAsync( + String indexName + ) throws AlgoliaRuntimeException { + return this.getConfigAsync(indexName, null); + } + /** * Get the status of a Query Suggestion's index. The status includes whether the Query Suggestions * index is currently in the process of being built, and the last build time. * * @param indexName The index in which to perform the request. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Status * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Status getConfigStatus( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + getConfigStatusAsync(indexName, requestOptions) + ); + } + public Status getConfigStatus(String indexName) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getConfigStatusAsync(indexName)); + return this.getConfigStatus(indexName, null); } /** @@ -395,12 +593,16 @@ public Status getConfigStatus(String indexName) * time. * * @param indexName The index in which to perform the request. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture getConfigStatusAsync(String indexName) - throws AlgoliaRuntimeException { + public CompletableFuture getConfigStatusAsync( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling getConfigStatus(Async)" @@ -420,34 +622,59 @@ public CompletableFuture getConfigStatusAsync(String indexName) Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getConfigStatusAsync(String indexName) + throws AlgoliaRuntimeException { + return this.getConfigStatusAsync(indexName, null); + } + /** * Get the log file of the last build of a single Query Suggestion index. * * @param indexName The index in which to perform the request. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return List<LogFile> * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public List getLogFile( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getLogFileAsync(indexName, requestOptions)); + } + public List getLogFile(String indexName) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getLogFileAsync(indexName)); + return this.getLogFile(indexName, null); } /** * (asynchronously) Get the log file of the last build of a single Query Suggestion index. * * @param indexName The index in which to perform the request. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture> getLogFileAsync(String indexName) - throws AlgoliaRuntimeException { + public CompletableFuture> getLogFileAsync( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling getLogFile(Async)" @@ -467,11 +694,23 @@ public CompletableFuture> getLogFileAsync(String indexName) Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken>() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture> getLogFileAsync(String indexName) + throws AlgoliaRuntimeException { + return this.getLogFileAsync(indexName, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -479,17 +718,35 @@ public CompletableFuture> getLogFileAsync(String indexName) * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object post( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + postAsync(path, parameters, body, requestOptions) + ); + } + public Object post(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(postAsync(path, parameters, body)); + return this.post(path, parameters, body, null); + } + + public Object post(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.post(path, null, null, requestOptions); } public Object post(String path) throws AlgoliaRuntimeException { - return this.post(path, null, null); + return this.post(path, null, null, null); } /** @@ -499,6 +756,8 @@ public Object post(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -506,7 +765,8 @@ public Object post(String path) throws AlgoliaRuntimeException { public CompletableFuture postAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -532,11 +792,38 @@ public CompletableFuture postAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture postAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.postAsync(path, parameters, body, null); + } + + public CompletableFuture postAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, requestOptions); + } + + public CompletableFuture postAsync(String path) + throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -544,17 +831,35 @@ public CompletableFuture postAsync( * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object put( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + putAsync(path, parameters, body, requestOptions) + ); + } + public Object put(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(putAsync(path, parameters, body)); + return this.put(path, parameters, body, null); + } + + public Object put(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.put(path, null, null, requestOptions); } public Object put(String path) throws AlgoliaRuntimeException { - return this.put(path, null, null); + return this.put(path, null, null, null); } /** @@ -564,6 +869,8 @@ public Object put(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -571,7 +878,8 @@ public Object put(String path) throws AlgoliaRuntimeException { public CompletableFuture putAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -597,41 +905,81 @@ public CompletableFuture putAsync( } Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture putAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.putAsync(path, parameters, body, null); + } + + public CompletableFuture putAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, requestOptions); + } + + public CompletableFuture putAsync(String path) + throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, null); + } + /** * Update the configuration of a Query Suggestions index. * * @param indexName The index in which to perform the request. (required) * @param querySuggestionsIndexParam (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return SucessResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ public SucessResponse updateConfig( String indexName, - QuerySuggestionsIndexParam querySuggestionsIndexParam + QuerySuggestionsIndexParam querySuggestionsIndexParam, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - updateConfigAsync(indexName, querySuggestionsIndexParam) + updateConfigAsync(indexName, querySuggestionsIndexParam, requestOptions) ); } + public SucessResponse updateConfig( + String indexName, + QuerySuggestionsIndexParam querySuggestionsIndexParam + ) throws AlgoliaRuntimeException { + return this.updateConfig(indexName, querySuggestionsIndexParam, null); + } + /** * (asynchronously) Update the configuration of a Query Suggestions index. * * @param indexName The index in which to perform the request. (required) * @param querySuggestionsIndexParam (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture updateConfigAsync( String indexName, - QuerySuggestionsIndexParam querySuggestionsIndexParam + QuerySuggestionsIndexParam querySuggestionsIndexParam, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -659,8 +1007,22 @@ public CompletableFuture updateConfigAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + + public CompletableFuture updateConfigAsync( + String indexName, + QuerySuggestionsIndexParam querySuggestionsIndexParam + ) throws AlgoliaRuntimeException { + return this.updateConfigAsync(indexName, querySuggestionsIndexParam, null); + } } 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 0367fc490d..7a2e96f366 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 @@ -4,6 +4,7 @@ import com.algolia.exceptions.*; import com.algolia.model.recommend.*; import com.algolia.utils.*; +import com.algolia.utils.RequestOptions; import com.algolia.utils.retry.CallType; import com.algolia.utils.retry.StatefulHost; import com.google.gson.reflect.TypeToken; @@ -105,17 +106,32 @@ private static List getDefaultHosts(String appId) { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object del( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(delAsync(path, parameters, requestOptions)); + } + public Object del(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(delAsync(path, parameters)); + return this.del(path, parameters, null); + } + + public Object del(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.del(path, null, requestOptions); } public Object del(String path) throws AlgoliaRuntimeException { - return this.del(path, null); + return this.del(path, null, null); } /** @@ -124,13 +140,16 @@ public Object del(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture delAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -156,28 +175,69 @@ public CompletableFuture delAsync( } Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture delAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.delAsync(path, parameters, null); + } + + public CompletableFuture delAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.delAsync(path, null, requestOptions); + } + + public CompletableFuture delAsync(String path) + throws AlgoliaRuntimeException { + return this.delAsync(path, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object get( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getAsync(path, parameters, requestOptions)); + } + public Object get(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getAsync(path, parameters)); + return this.get(path, parameters, null); + } + + public Object get(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.get(path, null, requestOptions); } public Object get(String path) throws AlgoliaRuntimeException { - return this.get(path, null); + return this.get(path, null, null); } /** @@ -186,13 +246,16 @@ public Object get(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -218,38 +281,76 @@ public CompletableFuture getAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.getAsync(path, parameters, null); + } + + public CompletableFuture getAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getAsync(path, null, requestOptions); + } + + public CompletableFuture getAsync(String path) + throws AlgoliaRuntimeException { + return this.getAsync(path, null, null); + } + /** * Returns recommendations or trending results, for a specific model and `objectID`. * * @param getRecommendationsParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetRecommendationsResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ public GetRecommendationsResponse getRecommendations( - GetRecommendationsParams getRecommendationsParams + GetRecommendationsParams getRecommendationsParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - getRecommendationsAsync(getRecommendationsParams) + getRecommendationsAsync(getRecommendationsParams, requestOptions) ); } + public GetRecommendationsResponse getRecommendations( + GetRecommendationsParams getRecommendationsParams + ) throws AlgoliaRuntimeException { + return this.getRecommendations(getRecommendationsParams, null); + } + /** * (asynchronously) Returns recommendations or trending results, for a specific model and * `objectID`. * * @param getRecommendationsParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getRecommendationsAsync( - GetRecommendationsParams getRecommendationsParams + GetRecommendationsParams getRecommendationsParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (getRecommendationsParams == null) { throw new AlgoliaRuntimeException( @@ -267,11 +368,24 @@ public CompletableFuture getRecommendationsAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getRecommendationsAsync( + GetRecommendationsParams getRecommendationsParams + ) throws AlgoliaRuntimeException { + return this.getRecommendationsAsync(getRecommendationsParams, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -279,17 +393,35 @@ public CompletableFuture getRecommendationsAsync( * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object post( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + postAsync(path, parameters, body, requestOptions) + ); + } + public Object post(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(postAsync(path, parameters, body)); + return this.post(path, parameters, body, null); + } + + public Object post(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.post(path, null, null, requestOptions); } public Object post(String path) throws AlgoliaRuntimeException { - return this.post(path, null, null); + return this.post(path, null, null, null); } /** @@ -299,6 +431,8 @@ public Object post(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -306,7 +440,8 @@ public Object post(String path) throws AlgoliaRuntimeException { public CompletableFuture postAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -332,11 +467,38 @@ public CompletableFuture postAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture postAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.postAsync(path, parameters, body, null); + } + + public CompletableFuture postAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, requestOptions); + } + + public CompletableFuture postAsync(String path) + throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -344,17 +506,35 @@ public CompletableFuture postAsync( * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object put( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + putAsync(path, parameters, body, requestOptions) + ); + } + public Object put(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(putAsync(path, parameters, body)); + return this.put(path, parameters, body, null); + } + + public Object put(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.put(path, null, null, requestOptions); } public Object put(String path) throws AlgoliaRuntimeException { - return this.put(path, null, null); + return this.put(path, null, null, null); } /** @@ -364,6 +544,8 @@ public Object put(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -371,7 +553,8 @@ public Object put(String path) throws AlgoliaRuntimeException { public CompletableFuture putAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -397,8 +580,35 @@ public CompletableFuture putAsync( } Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + + public CompletableFuture putAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.putAsync(path, parameters, body, null); + } + + public CompletableFuture putAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, requestOptions); + } + + public CompletableFuture putAsync(String path) + throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, 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 69c2807feb..8578894fa2 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 @@ -4,6 +4,7 @@ import com.algolia.exceptions.*; import com.algolia.model.search.*; import com.algolia.utils.*; +import com.algolia.utils.RequestOptions; import com.algolia.utils.retry.CallType; import com.algolia.utils.retry.StatefulHost; import com.google.gson.reflect.TypeToken; @@ -103,25 +104,38 @@ private static List getDefaultHosts(String appId) { * Add a new API Key with specific permissions/restrictions. * * @param apiKey (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return AddApiKeyResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public AddApiKeyResponse addApiKey( + ApiKey apiKey, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(addApiKeyAsync(apiKey, requestOptions)); + } + public AddApiKeyResponse addApiKey(ApiKey apiKey) throws AlgoliaRuntimeException { - return LaunderThrowable.await(addApiKeyAsync(apiKey)); + return this.addApiKey(apiKey, null); } /** * (asynchronously) Add a new API Key with specific permissions/restrictions. * * @param apiKey (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture addApiKeyAsync(ApiKey apiKey) - throws AlgoliaRuntimeException { + public CompletableFuture addApiKeyAsync( + ApiKey apiKey, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { if (apiKey == null) { throw new AlgoliaRuntimeException( "Missing the required parameter 'apiKey' when calling addApiKey(Async)" @@ -137,11 +151,23 @@ public CompletableFuture addApiKeyAsync(ApiKey apiKey) Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture addApiKeyAsync(ApiKey apiKey) + throws AlgoliaRuntimeException { + return this.addApiKeyAsync(apiKey, null); + } + /** * Add or replace an object with a given object ID. If the object does not exist, it will be * created. If it already exists, it will be replaced. @@ -149,6 +175,8 @@ public CompletableFuture addApiKeyAsync(ApiKey apiKey) * @param indexName The index in which to perform the request. (required) * @param objectID Unique identifier of an object. (required) * @param body The Algolia object. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdatedAtWithObjectIdResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -156,13 +184,22 @@ public CompletableFuture addApiKeyAsync(ApiKey apiKey) public UpdatedAtWithObjectIdResponse addOrUpdateObject( String indexName, String objectID, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - addOrUpdateObjectAsync(indexName, objectID, body) + addOrUpdateObjectAsync(indexName, objectID, body, requestOptions) ); } + public UpdatedAtWithObjectIdResponse addOrUpdateObject( + String indexName, + String objectID, + Object body + ) throws AlgoliaRuntimeException { + return this.addOrUpdateObject(indexName, objectID, body, null); + } + /** * (asynchronously) Add or replace an object with a given object ID. If the object does not exist, * it will be created. If it already exists, it will be replaced. @@ -170,6 +207,8 @@ public UpdatedAtWithObjectIdResponse addOrUpdateObject( * @param indexName The index in which to perform the request. (required) * @param objectID Unique identifier of an object. (required) * @param body The Algolia object. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -177,7 +216,8 @@ public UpdatedAtWithObjectIdResponse addOrUpdateObject( public CompletableFuture addOrUpdateObjectAsync( String indexName, String objectID, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -211,35 +251,63 @@ public CompletableFuture addOrUpdateObjectAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {} .getType(); return this.executeAsync(call, returnType); } + public CompletableFuture addOrUpdateObjectAsync( + String indexName, + String objectID, + Object body + ) throws AlgoliaRuntimeException { + return this.addOrUpdateObjectAsync(indexName, objectID, body, null); + } + /** * Add a single source to the list of allowed sources. * * @param source The source to add. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return CreatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public CreatedAtResponse appendSource( + Source source, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(appendSourceAsync(source, requestOptions)); + } + public CreatedAtResponse appendSource(Source source) throws AlgoliaRuntimeException { - return LaunderThrowable.await(appendSourceAsync(source)); + return this.appendSource(source, null); } /** * (asynchronously) Add a single source to the list of allowed sources. * * @param source The source to add. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture appendSourceAsync(Source source) - throws AlgoliaRuntimeException { + public CompletableFuture appendSourceAsync( + Source source, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { if (source == null) { throw new AlgoliaRuntimeException( "Missing the required parameter 'source' when calling appendSource(Async)" @@ -255,11 +323,23 @@ public CompletableFuture appendSourceAsync(Source source) Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture appendSourceAsync(Source source) + throws AlgoliaRuntimeException { + return this.appendSourceAsync(source, null); + } + /** * Assign or Move a userID to a cluster. The time it takes to migrate (move) a user is * proportional to the amount of data linked to the userID. Upon success, the response is 200 OK. @@ -268,19 +348,29 @@ public CompletableFuture appendSourceAsync(Source source) * * @param xAlgoliaUserID userID to assign. (required) * @param assignUserIdParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return CreatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ public CreatedAtResponse assignUserId( String xAlgoliaUserID, - AssignUserIdParams assignUserIdParams + AssignUserIdParams assignUserIdParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - assignUserIdAsync(xAlgoliaUserID, assignUserIdParams) + assignUserIdAsync(xAlgoliaUserID, assignUserIdParams, requestOptions) ); } + public CreatedAtResponse assignUserId( + String xAlgoliaUserID, + AssignUserIdParams assignUserIdParams + ) throws AlgoliaRuntimeException { + return this.assignUserId(xAlgoliaUserID, assignUserIdParams, null); + } + /** * (asynchronously) Assign or Move a userID to a cluster. The time it takes to migrate (move) a * user is proportional to the amount of data linked to the userID. Upon success, the response is @@ -289,13 +379,16 @@ public CreatedAtResponse assignUserId( * * @param xAlgoliaUserID userID to assign. (required) * @param assignUserIdParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture assignUserIdAsync( String xAlgoliaUserID, - AssignUserIdParams assignUserIdParams + AssignUserIdParams assignUserIdParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (xAlgoliaUserID == null) { throw new AlgoliaRuntimeException( @@ -322,25 +415,51 @@ public CompletableFuture assignUserIdAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture assignUserIdAsync( + String xAlgoliaUserID, + AssignUserIdParams assignUserIdParams + ) throws AlgoliaRuntimeException { + return this.assignUserIdAsync(xAlgoliaUserID, assignUserIdParams, null); + } + /** * Perform multiple write operations targeting one index, in a single API call. * * @param indexName The index in which to perform the request. (required) * @param batchWriteParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return BatchResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public BatchResponse batch( + String indexName, + BatchWriteParams batchWriteParams, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + batchAsync(indexName, batchWriteParams, requestOptions) + ); + } + public BatchResponse batch( String indexName, BatchWriteParams batchWriteParams ) throws AlgoliaRuntimeException { - return LaunderThrowable.await(batchAsync(indexName, batchWriteParams)); + return this.batch(indexName, batchWriteParams, null); } /** @@ -348,13 +467,16 @@ public BatchResponse batch( * * @param indexName The index in which to perform the request. (required) * @param batchWriteParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture batchAsync( String indexName, - BatchWriteParams batchWriteParams + BatchWriteParams batchWriteParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -381,11 +503,25 @@ public CompletableFuture batchAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture batchAsync( + String indexName, + BatchWriteParams batchWriteParams + ) throws AlgoliaRuntimeException { + return this.batchAsync(indexName, batchWriteParams, null); + } + /** * Assign multiple userIDs to a cluster. Upon success, the response is 200 OK. A successful * response indicates that the operation has been taken into account, and the userIDs are directly @@ -393,19 +529,37 @@ public CompletableFuture batchAsync( * * @param xAlgoliaUserID userID to assign. (required) * @param batchAssignUserIdsParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return CreatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ public CreatedAtResponse batchAssignUserIds( String xAlgoliaUserID, - BatchAssignUserIdsParams batchAssignUserIdsParams + BatchAssignUserIdsParams batchAssignUserIdsParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - batchAssignUserIdsAsync(xAlgoliaUserID, batchAssignUserIdsParams) + batchAssignUserIdsAsync( + xAlgoliaUserID, + batchAssignUserIdsParams, + requestOptions + ) ); } + public CreatedAtResponse batchAssignUserIds( + String xAlgoliaUserID, + BatchAssignUserIdsParams batchAssignUserIdsParams + ) throws AlgoliaRuntimeException { + return this.batchAssignUserIds( + xAlgoliaUserID, + batchAssignUserIdsParams, + null + ); + } + /** * (asynchronously) Assign multiple userIDs to a cluster. Upon success, the response is 200 OK. A * successful response indicates that the operation has been taken into account, and the userIDs @@ -413,13 +567,16 @@ public CreatedAtResponse batchAssignUserIds( * * @param xAlgoliaUserID userID to assign. (required) * @param batchAssignUserIdsParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture batchAssignUserIdsAsync( String xAlgoliaUserID, - BatchAssignUserIdsParams batchAssignUserIdsParams + BatchAssignUserIdsParams batchAssignUserIdsParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (xAlgoliaUserID == null) { throw new AlgoliaRuntimeException( @@ -447,41 +604,80 @@ public CompletableFuture batchAssignUserIdsAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture batchAssignUserIdsAsync( + String xAlgoliaUserID, + BatchAssignUserIdsParams batchAssignUserIdsParams + ) throws AlgoliaRuntimeException { + return this.batchAssignUserIdsAsync( + xAlgoliaUserID, + batchAssignUserIdsParams, + null + ); + } + /** * Send a batch of dictionary entries. * * @param dictionaryName The dictionary to search in. (required) * @param batchDictionaryEntriesParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ public UpdatedAtResponse batchDictionaryEntries( DictionaryType dictionaryName, - BatchDictionaryEntriesParams batchDictionaryEntriesParams + BatchDictionaryEntriesParams batchDictionaryEntriesParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - batchDictionaryEntriesAsync(dictionaryName, batchDictionaryEntriesParams) + batchDictionaryEntriesAsync( + dictionaryName, + batchDictionaryEntriesParams, + requestOptions + ) ); } + public UpdatedAtResponse batchDictionaryEntries( + DictionaryType dictionaryName, + BatchDictionaryEntriesParams batchDictionaryEntriesParams + ) throws AlgoliaRuntimeException { + return this.batchDictionaryEntries( + dictionaryName, + batchDictionaryEntriesParams, + null + ); + } + /** * (asynchronously) Send a batch of dictionary entries. * * @param dictionaryName The dictionary to search in. (required) * @param batchDictionaryEntriesParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture batchDictionaryEntriesAsync( DictionaryType dictionaryName, - BatchDictionaryEntriesParams batchDictionaryEntriesParams + BatchDictionaryEntriesParams batchDictionaryEntriesParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (dictionaryName == null) { throw new AlgoliaRuntimeException( @@ -510,11 +706,29 @@ public CompletableFuture batchDictionaryEntriesAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture batchDictionaryEntriesAsync( + DictionaryType dictionaryName, + BatchDictionaryEntriesParams batchDictionaryEntriesParams + ) throws AlgoliaRuntimeException { + return this.batchDictionaryEntriesAsync( + dictionaryName, + batchDictionaryEntriesParams, + null + ); + } + /** * Create or update a batch of Rules. * @@ -524,6 +738,8 @@ public CompletableFuture batchDictionaryEntriesAsync( * indexName. (optional) * @param clearExistingRules When true, existing Rules are cleared before adding this batch. When * false, existing Rules are kept. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -532,16 +748,46 @@ public UpdatedAtResponse batchRules( String indexName, List rule, Boolean forwardToReplicas, - Boolean clearExistingRules + Boolean clearExistingRules, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - batchRulesAsync(indexName, rule, forwardToReplicas, clearExistingRules) + batchRulesAsync( + indexName, + rule, + forwardToReplicas, + clearExistingRules, + requestOptions + ) ); } + public UpdatedAtResponse batchRules( + String indexName, + List rule, + Boolean forwardToReplicas, + Boolean clearExistingRules + ) throws AlgoliaRuntimeException { + return this.batchRules( + indexName, + rule, + forwardToReplicas, + clearExistingRules, + null + ); + } + + public UpdatedAtResponse batchRules( + String indexName, + List rule, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.batchRules(indexName, rule, null, null, requestOptions); + } + public UpdatedAtResponse batchRules(String indexName, List rule) throws AlgoliaRuntimeException { - return this.batchRules(indexName, rule, null, null); + return this.batchRules(indexName, rule, null, null, null); } /** @@ -553,6 +799,8 @@ public UpdatedAtResponse batchRules(String indexName, List rule) * indexName. (optional) * @param clearExistingRules When true, existing Rules are cleared before adding this batch. When * false, existing Rules are kept. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -561,7 +809,8 @@ public CompletableFuture batchRulesAsync( String indexName, List rule, Boolean forwardToReplicas, - Boolean clearExistingRules + Boolean clearExistingRules, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -602,11 +851,48 @@ public CompletableFuture batchRulesAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture batchRulesAsync( + String indexName, + List rule, + Boolean forwardToReplicas, + Boolean clearExistingRules + ) throws AlgoliaRuntimeException { + return this.batchRulesAsync( + indexName, + rule, + forwardToReplicas, + clearExistingRules, + null + ); + } + + public CompletableFuture batchRulesAsync( + String indexName, + List rule, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.batchRulesAsync(indexName, rule, null, null, requestOptions); + } + + public CompletableFuture batchRulesAsync( + String indexName, + List rule + ) throws AlgoliaRuntimeException { + return this.batchRulesAsync(indexName, rule, null, null, null); + } + /** * This method allows you to retrieve all index content. It can retrieve up to 1,000 records per * call and supports full text search and filters. For performance reasons, some features are not @@ -617,18 +903,35 @@ public CompletableFuture batchRulesAsync( * * @param indexName The index in which to perform the request. (required) * @param browseRequest (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return BrowseResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public BrowseResponse browse( + String indexName, + BrowseRequest browseRequest, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + browseAsync(indexName, browseRequest, requestOptions) + ); + } + public BrowseResponse browse(String indexName, BrowseRequest browseRequest) throws AlgoliaRuntimeException { - return LaunderThrowable.await(browseAsync(indexName, browseRequest)); + return this.browse(indexName, browseRequest, null); + } + + public BrowseResponse browse(String indexName, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.browse(indexName, null, requestOptions); } public BrowseResponse browse(String indexName) throws AlgoliaRuntimeException { - return this.browse(indexName, null); + return this.browse(indexName, null, null); } /** @@ -642,13 +945,16 @@ public BrowseResponse browse(String indexName) * * @param indexName The index in which to perform the request. (required) * @param browseRequest (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture browseAsync( String indexName, - BrowseRequest browseRequest + BrowseRequest browseRequest, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -669,33 +975,76 @@ public CompletableFuture browseAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture browseAsync( + String indexName, + BrowseRequest browseRequest + ) throws AlgoliaRuntimeException { + return this.browseAsync(indexName, browseRequest, null); + } + + public CompletableFuture browseAsync( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.browseAsync(indexName, null, requestOptions); + } + + public CompletableFuture browseAsync(String indexName) + throws AlgoliaRuntimeException { + return this.browseAsync(indexName, null, null); + } + /** * Remove all synonyms from an index. * * @param indexName The index in which to perform the request. (required) * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ public UpdatedAtResponse clearAllSynonyms( String indexName, - Boolean forwardToReplicas + Boolean forwardToReplicas, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - clearAllSynonymsAsync(indexName, forwardToReplicas) + clearAllSynonymsAsync(indexName, forwardToReplicas, requestOptions) ); } + public UpdatedAtResponse clearAllSynonyms( + String indexName, + Boolean forwardToReplicas + ) throws AlgoliaRuntimeException { + return this.clearAllSynonyms(indexName, forwardToReplicas, null); + } + + public UpdatedAtResponse clearAllSynonyms( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.clearAllSynonyms(indexName, null, requestOptions); + } + public UpdatedAtResponse clearAllSynonyms(String indexName) throws AlgoliaRuntimeException { - return this.clearAllSynonyms(indexName, null); + return this.clearAllSynonyms(indexName, null, null); } /** @@ -704,13 +1053,16 @@ public UpdatedAtResponse clearAllSynonyms(String indexName) * @param indexName The index in which to perform the request. (required) * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture clearAllSynonymsAsync( String indexName, - Boolean forwardToReplicas + Boolean forwardToReplicas, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -738,22 +1090,58 @@ public CompletableFuture clearAllSynonymsAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture clearAllSynonymsAsync( + String indexName, + Boolean forwardToReplicas + ) throws AlgoliaRuntimeException { + return this.clearAllSynonymsAsync(indexName, forwardToReplicas, null); + } + + public CompletableFuture clearAllSynonymsAsync( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.clearAllSynonymsAsync(indexName, null, requestOptions); + } + + public CompletableFuture clearAllSynonymsAsync( + String indexName + ) throws AlgoliaRuntimeException { + return this.clearAllSynonymsAsync(indexName, null, null); + } + /** * Delete an index's content, but leave settings and index-specific API keys untouched. * * @param indexName The index in which to perform the request. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public UpdatedAtResponse clearObjects( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(clearObjectsAsync(indexName, requestOptions)); + } + public UpdatedAtResponse clearObjects(String indexName) throws AlgoliaRuntimeException { - return LaunderThrowable.await(clearObjectsAsync(indexName)); + return this.clearObjects(indexName, null); } /** @@ -761,12 +1149,15 @@ public UpdatedAtResponse clearObjects(String indexName) * untouched. * * @param indexName The index in which to perform the request. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture clearObjectsAsync( - String indexName + String indexName, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -787,33 +1178,63 @@ public CompletableFuture clearObjectsAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture clearObjectsAsync( + String indexName + ) throws AlgoliaRuntimeException { + return this.clearObjectsAsync(indexName, null); + } + /** * Delete all Rules in the index. * * @param indexName The index in which to perform the request. (required) * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ public UpdatedAtResponse clearRules( String indexName, - Boolean forwardToReplicas + Boolean forwardToReplicas, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - clearRulesAsync(indexName, forwardToReplicas) + clearRulesAsync(indexName, forwardToReplicas, requestOptions) ); } + public UpdatedAtResponse clearRules( + String indexName, + Boolean forwardToReplicas + ) throws AlgoliaRuntimeException { + return this.clearRules(indexName, forwardToReplicas, null); + } + + public UpdatedAtResponse clearRules( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.clearRules(indexName, null, requestOptions); + } + public UpdatedAtResponse clearRules(String indexName) throws AlgoliaRuntimeException { - return this.clearRules(indexName, null); + return this.clearRules(indexName, null, null); } /** @@ -822,13 +1243,16 @@ public UpdatedAtResponse clearRules(String indexName) * @param indexName The index in which to perform the request. (required) * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture clearRulesAsync( String indexName, - Boolean forwardToReplicas + Boolean forwardToReplicas, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -856,28 +1280,69 @@ public CompletableFuture clearRulesAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } - /** - * This method allow you to send requests to the Algolia REST API. - * - * @param path The path of the API endpoint to target, anything after the /1 needs to be - * specified. (required) - * @param parameters Query parameters to be applied to the current query. (optional) - * @return Object - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public Object del(String path, Map parameters) - throws AlgoliaRuntimeException { - return LaunderThrowable.await(delAsync(path, parameters)); + public CompletableFuture clearRulesAsync( + String indexName, + Boolean forwardToReplicas + ) throws AlgoliaRuntimeException { + return this.clearRulesAsync(indexName, forwardToReplicas, null); + } + + public CompletableFuture clearRulesAsync( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.clearRulesAsync(indexName, null, requestOptions); + } + + public CompletableFuture clearRulesAsync(String indexName) + throws AlgoliaRuntimeException { + return this.clearRulesAsync(indexName, null, null); + } + + /** + * This method allow you to send requests to the Algolia REST API. + * + * @param path The path of the API endpoint to target, anything after the /1 needs to be + * specified. (required) + * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. + * @return Object + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body + */ + public Object del( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(delAsync(path, parameters, requestOptions)); + } + + public Object del(String path, Map parameters) + throws AlgoliaRuntimeException { + return this.del(path, parameters, null); + } + + public Object del(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.del(path, null, requestOptions); } public Object del(String path) throws AlgoliaRuntimeException { - return this.del(path, null); + return this.del(path, null, null); } /** @@ -886,13 +1351,16 @@ public Object del(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture delAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -918,34 +1386,73 @@ public CompletableFuture delAsync( } Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture delAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.delAsync(path, parameters, null); + } + + public CompletableFuture delAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.delAsync(path, null, requestOptions); + } + + public CompletableFuture delAsync(String path) + throws AlgoliaRuntimeException { + return this.delAsync(path, null, null); + } + /** * Delete an existing API Key. * * @param key API Key string. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return DeleteApiKeyResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public DeleteApiKeyResponse deleteApiKey( + String key, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(deleteApiKeyAsync(key, requestOptions)); + } + public DeleteApiKeyResponse deleteApiKey(String key) throws AlgoliaRuntimeException { - return LaunderThrowable.await(deleteApiKeyAsync(key)); + return this.deleteApiKey(key, null); } /** * (asynchronously) Delete an existing API Key. * * @param key API Key string. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture deleteApiKeyAsync(String key) - throws AlgoliaRuntimeException { + public CompletableFuture deleteApiKeyAsync( + String key, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { if (key == null) { throw new AlgoliaRuntimeException( "Missing the required parameter 'key' when calling deleteApiKey(Async)" @@ -965,11 +1472,23 @@ public CompletableFuture deleteApiKeyAsync(String key) Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture deleteApiKeyAsync(String key) + throws AlgoliaRuntimeException { + return this.deleteApiKeyAsync(key, null); + } + /** * Remove all objects matching a filter (including geo filters). This method enables you to delete * one or more objects based on filters (numeric, facet, tag or geo queries). It doesn't accept @@ -977,15 +1496,27 @@ public CompletableFuture deleteApiKeyAsync(String key) * * @param indexName The index in which to perform the request. (required) * @param searchParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return DeletedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public DeletedAtResponse deleteBy( + String indexName, + SearchParams searchParams, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + deleteByAsync(indexName, searchParams, requestOptions) + ); + } + public DeletedAtResponse deleteBy( String indexName, SearchParams searchParams ) throws AlgoliaRuntimeException { - return LaunderThrowable.await(deleteByAsync(indexName, searchParams)); + return this.deleteBy(indexName, searchParams, null); } /** @@ -995,13 +1526,16 @@ public DeletedAtResponse deleteBy( * * @param indexName The index in which to perform the request. (required) * @param searchParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture deleteByAsync( String indexName, - SearchParams searchParams + SearchParams searchParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -1028,34 +1562,60 @@ public CompletableFuture deleteByAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture deleteByAsync( + String indexName, + SearchParams searchParams + ) throws AlgoliaRuntimeException { + return this.deleteByAsync(indexName, searchParams, null); + } + /** * Delete an existing index. * * @param indexName The index in which to perform the request. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return DeletedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public DeletedAtResponse deleteIndex( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(deleteIndexAsync(indexName, requestOptions)); + } + public DeletedAtResponse deleteIndex(String indexName) throws AlgoliaRuntimeException { - return LaunderThrowable.await(deleteIndexAsync(indexName)); + return this.deleteIndex(indexName, null); } /** * (asynchronously) Delete an existing index. * * @param indexName The index in which to perform the request. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture deleteIndexAsync( - String indexName + String indexName, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -1076,23 +1636,48 @@ public CompletableFuture deleteIndexAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture deleteIndexAsync( + String indexName + ) throws AlgoliaRuntimeException { + return this.deleteIndexAsync(indexName, null); + } + /** * Delete an existing object. * * @param indexName The index in which to perform the request. (required) * @param objectID Unique identifier of an object. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return DeletedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public DeletedAtResponse deleteObject( + String indexName, + String objectID, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + deleteObjectAsync(indexName, objectID, requestOptions) + ); + } + public DeletedAtResponse deleteObject(String indexName, String objectID) throws AlgoliaRuntimeException { - return LaunderThrowable.await(deleteObjectAsync(indexName, objectID)); + return this.deleteObject(indexName, objectID, null); } /** @@ -1100,13 +1685,16 @@ public DeletedAtResponse deleteObject(String indexName, String objectID) * * @param indexName The index in which to perform the request. (required) * @param objectID Unique identifier of an object. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture deleteObjectAsync( String indexName, - String objectID + String objectID, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -1134,11 +1722,25 @@ public CompletableFuture deleteObjectAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture deleteObjectAsync( + String indexName, + String objectID + ) throws AlgoliaRuntimeException { + return this.deleteObjectAsync(indexName, objectID, null); + } + /** * Delete the Rule with the specified objectID. * @@ -1146,6 +1748,8 @@ public CompletableFuture deleteObjectAsync( * @param objectID Unique identifier of an object. (required) * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -1153,16 +1757,33 @@ public CompletableFuture deleteObjectAsync( public UpdatedAtResponse deleteRule( String indexName, String objectID, - Boolean forwardToReplicas + Boolean forwardToReplicas, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - deleteRuleAsync(indexName, objectID, forwardToReplicas) + deleteRuleAsync(indexName, objectID, forwardToReplicas, requestOptions) ); } + public UpdatedAtResponse deleteRule( + String indexName, + String objectID, + Boolean forwardToReplicas + ) throws AlgoliaRuntimeException { + return this.deleteRule(indexName, objectID, forwardToReplicas, null); + } + + public UpdatedAtResponse deleteRule( + String indexName, + String objectID, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.deleteRule(indexName, objectID, null, requestOptions); + } + public UpdatedAtResponse deleteRule(String indexName, String objectID) throws AlgoliaRuntimeException { - return this.deleteRule(indexName, objectID, null); + return this.deleteRule(indexName, objectID, null, null); } /** @@ -1172,6 +1793,8 @@ public UpdatedAtResponse deleteRule(String indexName, String objectID) * @param objectID Unique identifier of an object. (required) * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -1179,7 +1802,8 @@ public UpdatedAtResponse deleteRule(String indexName, String objectID) public CompletableFuture deleteRuleAsync( String indexName, String objectID, - Boolean forwardToReplicas + Boolean forwardToReplicas, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -1214,34 +1838,76 @@ public CompletableFuture deleteRuleAsync( } Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture deleteRuleAsync( + String indexName, + String objectID, + Boolean forwardToReplicas + ) throws AlgoliaRuntimeException { + return this.deleteRuleAsync(indexName, objectID, forwardToReplicas, null); + } + + public CompletableFuture deleteRuleAsync( + String indexName, + String objectID, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.deleteRuleAsync(indexName, objectID, null, requestOptions); + } + + public CompletableFuture deleteRuleAsync( + String indexName, + String objectID + ) throws AlgoliaRuntimeException { + return this.deleteRuleAsync(indexName, objectID, null, null); + } + /** * Remove a single source from the list of allowed sources. * * @param source The IP range of the source. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return DeleteSourceResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public DeleteSourceResponse deleteSource( + String source, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(deleteSourceAsync(source, requestOptions)); + } + public DeleteSourceResponse deleteSource(String source) throws AlgoliaRuntimeException { - return LaunderThrowable.await(deleteSourceAsync(source)); + return this.deleteSource(source, null); } /** * (asynchronously) Remove a single source from the list of allowed sources. * * @param source The IP range of the source. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture deleteSourceAsync( - String source + String source, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (source == null) { throw new AlgoliaRuntimeException( @@ -1262,11 +1928,24 @@ public CompletableFuture deleteSourceAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture deleteSourceAsync( + String source + ) throws AlgoliaRuntimeException { + return this.deleteSourceAsync(source, null); + } + /** * Delete a single synonyms set, identified by the given objectID. * @@ -1274,6 +1953,8 @@ public CompletableFuture deleteSourceAsync( * @param objectID Unique identifier of an object. (required) * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return DeletedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -1281,16 +1962,33 @@ public CompletableFuture deleteSourceAsync( public DeletedAtResponse deleteSynonym( String indexName, String objectID, - Boolean forwardToReplicas + Boolean forwardToReplicas, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - deleteSynonymAsync(indexName, objectID, forwardToReplicas) + deleteSynonymAsync(indexName, objectID, forwardToReplicas, requestOptions) ); } + public DeletedAtResponse deleteSynonym( + String indexName, + String objectID, + Boolean forwardToReplicas + ) throws AlgoliaRuntimeException { + return this.deleteSynonym(indexName, objectID, forwardToReplicas, null); + } + + public DeletedAtResponse deleteSynonym( + String indexName, + String objectID, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.deleteSynonym(indexName, objectID, null, requestOptions); + } + public DeletedAtResponse deleteSynonym(String indexName, String objectID) throws AlgoliaRuntimeException { - return this.deleteSynonym(indexName, objectID, null); + return this.deleteSynonym(indexName, objectID, null, null); } /** @@ -1300,6 +1998,8 @@ public DeletedAtResponse deleteSynonym(String indexName, String objectID) * @param objectID Unique identifier of an object. (required) * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -1307,7 +2007,8 @@ public DeletedAtResponse deleteSynonym(String indexName, String objectID) public CompletableFuture deleteSynonymAsync( String indexName, String objectID, - Boolean forwardToReplicas + Boolean forwardToReplicas, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -1342,28 +2043,78 @@ public CompletableFuture deleteSynonymAsync( } Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture deleteSynonymAsync( + String indexName, + String objectID, + Boolean forwardToReplicas + ) throws AlgoliaRuntimeException { + return this.deleteSynonymAsync( + indexName, + objectID, + forwardToReplicas, + null + ); + } + + public CompletableFuture deleteSynonymAsync( + String indexName, + String objectID, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.deleteSynonymAsync(indexName, objectID, null, requestOptions); + } + + public CompletableFuture deleteSynonymAsync( + String indexName, + String objectID + ) throws AlgoliaRuntimeException { + return this.deleteSynonymAsync(indexName, objectID, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object get( + String path, + Map parameters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getAsync(path, parameters, requestOptions)); + } + public Object get(String path, Map parameters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getAsync(path, parameters)); + return this.get(path, parameters, null); + } + + public Object get(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.get(path, null, requestOptions); } public Object get(String path) throws AlgoliaRuntimeException { - return this.get(path, null); + return this.get(path, null, null); } /** @@ -1372,13 +2123,16 @@ public Object get(String path) throws AlgoliaRuntimeException { * @param path The path of the API endpoint to target, anything after the /1 needs to be * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getAsync( String path, - Map parameters + Map parameters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -1404,33 +2158,70 @@ public CompletableFuture getAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getAsync( + String path, + Map parameters + ) throws AlgoliaRuntimeException { + return this.getAsync(path, parameters, null); + } + + public CompletableFuture getAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getAsync(path, null, requestOptions); + } + + public CompletableFuture getAsync(String path) + throws AlgoliaRuntimeException { + return this.getAsync(path, null, null); + } + /** * Get the permissions of an API key. * * @param key API Key string. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Key * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Key getApiKey(String key, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return LaunderThrowable.await(getApiKeyAsync(key, requestOptions)); + } + public Key getApiKey(String key) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getApiKeyAsync(key)); + return this.getApiKey(key, null); } /** * (asynchronously) Get the permissions of an API key. * * @param key API Key string. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture getApiKeyAsync(String key) - throws AlgoliaRuntimeException { + public CompletableFuture getApiKeyAsync( + String key, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { if (key == null) { throw new AlgoliaRuntimeException( "Missing the required parameter 'key' when calling getApiKey(Async)" @@ -1450,32 +2241,55 @@ public CompletableFuture getApiKeyAsync(String key) Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getApiKeyAsync(String key) + throws AlgoliaRuntimeException { + return this.getApiKeyAsync(key, null); + } + /** * List dictionaries supported per language. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Map<String, Languages> * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Map getDictionaryLanguages( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getDictionaryLanguagesAsync(requestOptions)); + } + public Map getDictionaryLanguages() throws AlgoliaRuntimeException { - return LaunderThrowable.await(getDictionaryLanguagesAsync()); + return this.getDictionaryLanguages(null); } /** * (asynchronously) List dictionaries supported per language. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture> getDictionaryLanguagesAsync() - throws AlgoliaRuntimeException { + public CompletableFuture> getDictionaryLanguagesAsync( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -1485,34 +2299,57 @@ public CompletableFuture> getDictionaryLanguagesAsync() Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken>() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture> getDictionaryLanguagesAsync() + throws AlgoliaRuntimeException { + return this.getDictionaryLanguagesAsync(null); + } + /** * Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. * Fetch settings does not return false values. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetDictionarySettingsResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public GetDictionarySettingsResponse getDictionarySettings( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getDictionarySettingsAsync(requestOptions)); + } + public GetDictionarySettingsResponse getDictionarySettings() throws AlgoliaRuntimeException { - return LaunderThrowable.await(getDictionarySettingsAsync()); + return this.getDictionarySettings(null); } /** * (asynchronously) Retrieve dictionaries settings. The API stores languages whose standard * entries are disabled. Fetch settings does not return false values. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture getDictionarySettingsAsync() - throws AlgoliaRuntimeException { + public CompletableFuture getDictionarySettingsAsync( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -1522,12 +2359,24 @@ public CompletableFuture getDictionarySettingsAsy Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {} .getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getDictionarySettingsAsync() + throws AlgoliaRuntimeException { + return this.getDictionarySettingsAsync(null); + } + /** * Return the latest log entries. * @@ -1539,6 +2388,8 @@ public CompletableFuture getDictionarySettingsAsy * retrieved across all indices. (optional) * @param type Type of log entries to retrieve. When omitted, all log entries are retrieved. * (optional, default to all) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetLogsResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -1547,15 +2398,30 @@ public GetLogsResponse getLogs( Integer offset, Integer length, String indexName, - LogType type + LogType type, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - getLogsAsync(offset, length, indexName, type) + getLogsAsync(offset, length, indexName, type, requestOptions) ); } + public GetLogsResponse getLogs( + Integer offset, + Integer length, + String indexName, + LogType type + ) throws AlgoliaRuntimeException { + return this.getLogs(offset, length, indexName, type, null); + } + + public GetLogsResponse getLogs(RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.getLogs(null, null, null, null, requestOptions); + } + public GetLogsResponse getLogs() throws AlgoliaRuntimeException { - return this.getLogs(null, null, null, null); + return this.getLogs(null, null, null, null, null); } /** @@ -1569,6 +2435,8 @@ public GetLogsResponse getLogs() throws AlgoliaRuntimeException { * retrieved across all indices. (optional) * @param type Type of log entries to retrieve. When omitted, all log entries are retrieved. * (optional, default to all) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -1577,7 +2445,8 @@ public CompletableFuture getLogsAsync( Integer offset, Integer length, String indexName, - LogType type + LogType type, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { Object bodyObj = null; @@ -1604,11 +2473,38 @@ public CompletableFuture getLogsAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getLogsAsync( + Integer offset, + Integer length, + String indexName, + LogType type + ) throws AlgoliaRuntimeException { + return this.getLogsAsync(offset, length, indexName, type, null); + } + + public CompletableFuture getLogsAsync( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getLogsAsync(null, null, null, null, requestOptions); + } + + public CompletableFuture getLogsAsync() + throws AlgoliaRuntimeException { + return this.getLogsAsync(null, null, null, null, null); + } + /** * Retrieve one object from the index. * @@ -1616,6 +2512,8 @@ public CompletableFuture getLogsAsync( * @param objectID Unique identifier of an object. (required) * @param attributesToRetrieve List of attributes to retrieve. If not specified, all retrievable * attributes are returned. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Map<String, String> * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -1623,16 +2521,33 @@ public CompletableFuture getLogsAsync( public Map getObject( String indexName, String objectID, - List attributesToRetrieve + List attributesToRetrieve, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - getObjectAsync(indexName, objectID, attributesToRetrieve) + getObjectAsync(indexName, objectID, attributesToRetrieve, requestOptions) ); } + public Map getObject( + String indexName, + String objectID, + List attributesToRetrieve + ) throws AlgoliaRuntimeException { + return this.getObject(indexName, objectID, attributesToRetrieve, null); + } + + public Map getObject( + String indexName, + String objectID, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getObject(indexName, objectID, null, requestOptions); + } + public Map getObject(String indexName, String objectID) throws AlgoliaRuntimeException { - return this.getObject(indexName, objectID, null); + return this.getObject(indexName, objectID, null, null); } /** @@ -1642,6 +2557,8 @@ public Map getObject(String indexName, String objectID) * @param objectID Unique identifier of an object. (required) * @param attributesToRetrieve List of attributes to retrieve. If not specified, all retrievable * attributes are returned. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -1649,7 +2566,8 @@ public Map getObject(String indexName, String objectID) public CompletableFuture> getObjectAsync( String indexName, String objectID, - List attributesToRetrieve + List attributesToRetrieve, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -1684,22 +2602,63 @@ public CompletableFuture> getObjectAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken>() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture> getObjectAsync( + String indexName, + String objectID, + List attributesToRetrieve + ) throws AlgoliaRuntimeException { + return this.getObjectAsync(indexName, objectID, attributesToRetrieve, null); + } + + public CompletableFuture> getObjectAsync( + String indexName, + String objectID, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.getObjectAsync(indexName, objectID, null, requestOptions); + } + + public CompletableFuture> getObjectAsync( + String indexName, + String objectID + ) throws AlgoliaRuntimeException { + return this.getObjectAsync(indexName, objectID, null, null); + } + /** * Retrieve one or more objects, potentially from different indices, in a single API call. * * @param getObjectsParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetObjectsResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public GetObjectsResponse getObjects( + GetObjectsParams getObjectsParams, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + getObjectsAsync(getObjectsParams, requestOptions) + ); + } + public GetObjectsResponse getObjects(GetObjectsParams getObjectsParams) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getObjectsAsync(getObjectsParams)); + return this.getObjects(getObjectsParams, null); } /** @@ -1707,12 +2666,15 @@ public GetObjectsResponse getObjects(GetObjectsParams getObjectsParams) * API call. * * @param getObjectsParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getObjectsAsync( - GetObjectsParams getObjectsParams + GetObjectsParams getObjectsParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (getObjectsParams == null) { throw new AlgoliaRuntimeException( @@ -1729,23 +2691,48 @@ public CompletableFuture getObjectsAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getObjectsAsync( + GetObjectsParams getObjectsParams + ) throws AlgoliaRuntimeException { + return this.getObjectsAsync(getObjectsParams, null); + } + /** * Retrieve the Rule with the specified objectID. * * @param indexName The index in which to perform the request. (required) * @param objectID Unique identifier of an object. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Rule * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Rule getRule( + String indexName, + String objectID, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + getRuleAsync(indexName, objectID, requestOptions) + ); + } + public Rule getRule(String indexName, String objectID) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getRuleAsync(indexName, objectID)); + return this.getRule(indexName, objectID, null); } /** @@ -1753,13 +2740,16 @@ public Rule getRule(String indexName, String objectID) * * @param indexName The index in which to perform the request. (required) * @param objectID Unique identifier of an object. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getRuleAsync( String indexName, - String objectID + String objectID, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -1787,34 +2777,61 @@ public CompletableFuture getRuleAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getRuleAsync( + String indexName, + String objectID + ) throws AlgoliaRuntimeException { + return this.getRuleAsync(indexName, objectID, null); + } + /** * Retrieve settings of an index. * * @param indexName The index in which to perform the request. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return IndexSettings * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public IndexSettings getSettings( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(getSettingsAsync(indexName, requestOptions)); + } + public IndexSettings getSettings(String indexName) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getSettingsAsync(indexName)); + return this.getSettings(indexName, null); } /** * (asynchronously) Retrieve settings of an index. * * @param indexName The index in which to perform the request. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture getSettingsAsync(String indexName) - throws AlgoliaRuntimeException { + public CompletableFuture getSettingsAsync( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling getSettings(Async)" @@ -1834,31 +2851,53 @@ public CompletableFuture getSettingsAsync(String indexName) Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getSettingsAsync(String indexName) + throws AlgoliaRuntimeException { + return this.getSettingsAsync(indexName, null); + } + /** * List all allowed sources. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return List<Source> * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public List getSources(RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return LaunderThrowable.await(getSourcesAsync(requestOptions)); + } + public List getSources() throws AlgoliaRuntimeException { - return LaunderThrowable.await(getSourcesAsync()); + return this.getSources(null); } /** * (asynchronously) List all allowed sources. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture> getSourcesAsync() - throws AlgoliaRuntimeException { + public CompletableFuture> getSourcesAsync( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -1868,23 +2907,47 @@ public CompletableFuture> getSourcesAsync() Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken>() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture> getSourcesAsync() + throws AlgoliaRuntimeException { + return this.getSourcesAsync(null); + } + /** * Fetch a synonym object identified by its objectID. * * @param indexName The index in which to perform the request. (required) * @param objectID Unique identifier of an object. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return SynonymHit * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public SynonymHit getSynonym( + String indexName, + String objectID, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + getSynonymAsync(indexName, objectID, requestOptions) + ); + } + public SynonymHit getSynonym(String indexName, String objectID) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getSynonymAsync(indexName, objectID)); + return this.getSynonym(indexName, objectID, null); } /** @@ -1892,13 +2955,16 @@ public SynonymHit getSynonym(String indexName, String objectID) * * @param indexName The index in which to perform the request. (required) * @param objectID Unique identifier of an object. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getSynonymAsync( String indexName, - String objectID + String objectID, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -1926,23 +2992,49 @@ public CompletableFuture getSynonymAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getSynonymAsync( + String indexName, + String objectID + ) throws AlgoliaRuntimeException { + return this.getSynonymAsync(indexName, objectID, null); + } + /** * Check the current status of a given task. * * @param indexName The index in which to perform the request. (required) * @param taskID Unique identifier of an task. Numeric value (up to 64bits). (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetTaskResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public GetTaskResponse getTask( + String indexName, + Integer taskID, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + getTaskAsync(indexName, taskID, requestOptions) + ); + } + public GetTaskResponse getTask(String indexName, Integer taskID) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getTaskAsync(indexName, taskID)); + return this.getTask(indexName, taskID, null); } /** @@ -1950,13 +3042,16 @@ public GetTaskResponse getTask(String indexName, Integer taskID) * * @param indexName The index in which to perform the request. (required) * @param taskID Unique identifier of an task. Numeric value (up to 64bits). (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture getTaskAsync( String indexName, - Integer taskID + Integer taskID, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -1984,23 +3079,44 @@ public CompletableFuture getTaskAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getTaskAsync( + String indexName, + Integer taskID + ) throws AlgoliaRuntimeException { + return this.getTaskAsync(indexName, taskID, null); + } + /** * Get the top 10 userIDs with the highest number of records per cluster. The data returned will * usually be a few seconds behind real time, because userID usage may take up to a few seconds to * propagate to the different clusters. Upon success, the response is 200 OK and contains the * following array of userIDs and clusters. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return GetTopUserIdsResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public GetTopUserIdsResponse getTopUserIds(RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return LaunderThrowable.await(getTopUserIdsAsync(requestOptions)); + } + public GetTopUserIdsResponse getTopUserIds() throws AlgoliaRuntimeException { - return LaunderThrowable.await(getTopUserIdsAsync()); + return this.getTopUserIds(null); } /** @@ -2009,12 +3125,15 @@ public GetTopUserIdsResponse getTopUserIds() throws AlgoliaRuntimeException { * to a few seconds to propagate to the different clusters. Upon success, the response is 200 OK * and contains the following array of userIDs and clusters. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture getTopUserIdsAsync() - throws AlgoliaRuntimeException { + public CompletableFuture getTopUserIdsAsync( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -2024,11 +3143,23 @@ public CompletableFuture getTopUserIdsAsync() Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getTopUserIdsAsync() + throws AlgoliaRuntimeException { + return this.getTopUserIdsAsync(null); + } + /** * Returns the userID data stored in the mapping. The data returned will usually be a few seconds * behind real time, because userID usage may take up to a few seconds to propagate to the @@ -2036,12 +3167,19 @@ public CompletableFuture getTopUserIdsAsync() * data. * * @param userID userID to assign. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UserId * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public UserId getUserId(String userID, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return LaunderThrowable.await(getUserIdAsync(userID, requestOptions)); + } + public UserId getUserId(String userID) throws AlgoliaRuntimeException { - return LaunderThrowable.await(getUserIdAsync(userID)); + return this.getUserId(userID, null); } /** @@ -2051,12 +3189,16 @@ public UserId getUserId(String userID) throws AlgoliaRuntimeException { * following userID data. * * @param userID userID to assign. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture getUserIdAsync(String userID) - throws AlgoliaRuntimeException { + public CompletableFuture getUserIdAsync( + String userID, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { if (userID == null) { throw new AlgoliaRuntimeException( "Missing the required parameter 'userID' when calling getUserId(Async)" @@ -2076,11 +3218,23 @@ public CompletableFuture getUserIdAsync(String userID) Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture getUserIdAsync(String userID) + throws AlgoliaRuntimeException { + return this.getUserIdAsync(userID, null); + } + /** * Get the status of your clusters' migrations or user creations. Creating a large batch of users * or migrating your multi-cluster may take quite some time. This method lets you retrieve the @@ -2089,17 +3243,33 @@ public CompletableFuture getUserIdAsync(String userID) * are directly usable. * * @param getClusters Whether to get clusters or not. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return CreatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public CreatedAtResponse hasPendingMappings( + Boolean getClusters, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + hasPendingMappingsAsync(getClusters, requestOptions) + ); + } + public CreatedAtResponse hasPendingMappings(Boolean getClusters) throws AlgoliaRuntimeException { - return LaunderThrowable.await(hasPendingMappingsAsync(getClusters)); + return this.hasPendingMappings(getClusters, null); + } + + public CreatedAtResponse hasPendingMappings(RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.hasPendingMappings(null, requestOptions); } public CreatedAtResponse hasPendingMappings() throws AlgoliaRuntimeException { - return this.hasPendingMappings(null); + return this.hasPendingMappings(null, null); } /** @@ -2110,12 +3280,15 @@ public CreatedAtResponse hasPendingMappings() throws AlgoliaRuntimeException { * account, and the userIDs are directly usable. * * @param getClusters Whether to get clusters or not. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture hasPendingMappingsAsync( - Boolean getClusters + Boolean getClusters, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { Object bodyObj = null; @@ -2130,31 +3303,65 @@ public CompletableFuture hasPendingMappingsAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture hasPendingMappingsAsync( + Boolean getClusters + ) throws AlgoliaRuntimeException { + return this.hasPendingMappingsAsync(getClusters, null); + } + + public CompletableFuture hasPendingMappingsAsync( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.hasPendingMappingsAsync(null, requestOptions); + } + + public CompletableFuture hasPendingMappingsAsync() + throws AlgoliaRuntimeException { + return this.hasPendingMappingsAsync(null, null); + } + /** * List API keys, along with their associated rights. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return ListApiKeysResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public ListApiKeysResponse listApiKeys(RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return LaunderThrowable.await(listApiKeysAsync(requestOptions)); + } + public ListApiKeysResponse listApiKeys() throws AlgoliaRuntimeException { - return LaunderThrowable.await(listApiKeysAsync()); + return this.listApiKeys(null); } /** * (asynchronously) List API keys, along with their associated rights. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture listApiKeysAsync() - throws AlgoliaRuntimeException { + public CompletableFuture listApiKeysAsync( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -2164,33 +3371,55 @@ public CompletableFuture listApiKeysAsync() Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture listApiKeysAsync() + throws AlgoliaRuntimeException { + return this.listApiKeysAsync(null); + } + /** * List the clusters available in a multi-clusters setup for a single appID. Upon success, the * response is 200 OK and contains the following clusters. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return ListClustersResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public ListClustersResponse listClusters(RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return LaunderThrowable.await(listClustersAsync(requestOptions)); + } + public ListClustersResponse listClusters() throws AlgoliaRuntimeException { - return LaunderThrowable.await(listClustersAsync()); + return this.listClusters(null); } /** * (asynchronously) List the clusters available in a multi-clusters setup for a single appID. Upon * success, the response is 200 OK and contains the following clusters. * + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture listClustersAsync() - throws AlgoliaRuntimeException { + public CompletableFuture listClustersAsync( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -2200,28 +3429,54 @@ public CompletableFuture listClustersAsync() Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture listClustersAsync() + throws AlgoliaRuntimeException { + return this.listClustersAsync(null); + } + /** * List existing indexes from an application. * * @param page Requested page (zero-based). When specified, will retrieve a specific page; the * page size is implicitly set to 100. When null, will retrieve all indices (no pagination). * (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return ListIndicesResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public ListIndicesResponse listIndices( + Integer page, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(listIndicesAsync(page, requestOptions)); + } + public ListIndicesResponse listIndices(Integer page) throws AlgoliaRuntimeException { - return LaunderThrowable.await(listIndicesAsync(page)); + return this.listIndices(page, null); + } + + public ListIndicesResponse listIndices(RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.listIndices(null, requestOptions); } public ListIndicesResponse listIndices() throws AlgoliaRuntimeException { - return this.listIndices(null); + return this.listIndices(null, null); } /** @@ -2230,12 +3485,16 @@ public ListIndicesResponse listIndices() throws AlgoliaRuntimeException { * @param page Requested page (zero-based). When specified, will retrieve a specific page; the * page size is implicitly set to 100. When null, will retrieve all indices (no pagination). * (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture listIndicesAsync(Integer page) - throws AlgoliaRuntimeException { + public CompletableFuture listIndicesAsync( + Integer page, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -2249,11 +3508,34 @@ public CompletableFuture listIndicesAsync(Integer page) } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture listIndicesAsync(Integer page) + throws AlgoliaRuntimeException { + return this.listIndicesAsync(page, null); + } + + public CompletableFuture listIndicesAsync( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.listIndicesAsync(null, requestOptions); + } + + public CompletableFuture listIndicesAsync() + throws AlgoliaRuntimeException { + return this.listIndicesAsync(null, null); + } + /** * List the userIDs assigned to a multi-clusters appID. The data returned will usually be a few * seconds behind real time, because userID usage may take up to a few seconds to propagate to the @@ -2264,17 +3546,34 @@ public CompletableFuture listIndicesAsync(Integer page) * page size is implicitly set to 100. When null, will retrieve all indices (no pagination). * (optional) * @param hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return ListUserIdsResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public ListUserIdsResponse listUserIds( + Integer page, + Integer hitsPerPage, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + listUserIdsAsync(page, hitsPerPage, requestOptions) + ); + } + public ListUserIdsResponse listUserIds(Integer page, Integer hitsPerPage) throws AlgoliaRuntimeException { - return LaunderThrowable.await(listUserIdsAsync(page, hitsPerPage)); + return this.listUserIds(page, hitsPerPage, null); + } + + public ListUserIdsResponse listUserIds(RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.listUserIds(null, null, requestOptions); } public ListUserIdsResponse listUserIds() throws AlgoliaRuntimeException { - return this.listUserIds(null, null); + return this.listUserIds(null, null, null); } /** @@ -2287,13 +3586,16 @@ public ListUserIdsResponse listUserIds() throws AlgoliaRuntimeException { * page size is implicitly set to 100. When null, will retrieve all indices (no pagination). * (optional) * @param hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture listUserIdsAsync( Integer page, - Integer hitsPerPage + Integer hitsPerPage, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { Object bodyObj = null; @@ -2312,36 +3614,75 @@ public CompletableFuture listUserIdsAsync( } Call call = - this.buildCall(requestPath, "GET", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "GET", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } - /** - * Perform multiple write operations, potentially targeting multiple indices, in a single API - * call. - * - * @param batchParams (required) - * @return MultipleBatchResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public MultipleBatchResponse multipleBatch(BatchParams batchParams) - throws AlgoliaRuntimeException { - return LaunderThrowable.await(multipleBatchAsync(batchParams)); - } + public CompletableFuture listUserIdsAsync( + Integer page, + Integer hitsPerPage + ) throws AlgoliaRuntimeException { + return this.listUserIdsAsync(page, hitsPerPage, null); + } + + public CompletableFuture listUserIdsAsync( + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.listUserIdsAsync(null, null, requestOptions); + } + + public CompletableFuture listUserIdsAsync() + throws AlgoliaRuntimeException { + return this.listUserIdsAsync(null, null, null); + } + + /** + * Perform multiple write operations, potentially targeting multiple indices, in a single API + * call. + * + * @param batchParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. + * @return MultipleBatchResponse + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body + */ + public MultipleBatchResponse multipleBatch( + BatchParams batchParams, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + multipleBatchAsync(batchParams, requestOptions) + ); + } + + public MultipleBatchResponse multipleBatch(BatchParams batchParams) + throws AlgoliaRuntimeException { + return this.multipleBatch(batchParams, null); + } /** * (asynchronously) Perform multiple write operations, potentially targeting multiple indices, in * a single API call. * * @param batchParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture multipleBatchAsync( - BatchParams batchParams + BatchParams batchParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (batchParams == null) { throw new AlgoliaRuntimeException( @@ -2358,35 +3699,62 @@ public CompletableFuture multipleBatchAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture multipleBatchAsync( + BatchParams batchParams + ) throws AlgoliaRuntimeException { + return this.multipleBatchAsync(batchParams, null); + } + /** * Perform a search operation targeting one or many indices. * * @param multipleQueriesParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return MultipleQueriesResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public MultipleQueriesResponse multipleQueries( + MultipleQueriesParams multipleQueriesParams, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + multipleQueriesAsync(multipleQueriesParams, requestOptions) + ); + } + public MultipleQueriesResponse multipleQueries( MultipleQueriesParams multipleQueriesParams ) throws AlgoliaRuntimeException { - return LaunderThrowable.await(multipleQueriesAsync(multipleQueriesParams)); + return this.multipleQueries(multipleQueriesParams, null); } /** * (asynchronously) Perform a search operation targeting one or many indices. * * @param multipleQueriesParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture multipleQueriesAsync( - MultipleQueriesParams multipleQueriesParams + MultipleQueriesParams multipleQueriesParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (multipleQueriesParams == null) { throw new AlgoliaRuntimeException( @@ -2404,41 +3772,67 @@ public CompletableFuture multipleQueriesAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture multipleQueriesAsync( + MultipleQueriesParams multipleQueriesParams + ) throws AlgoliaRuntimeException { + return this.multipleQueriesAsync(multipleQueriesParams, null); + } + /** * Peforms a copy or a move operation on a index. * * @param indexName The index in which to perform the request. (required) * @param operationIndexParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ public UpdatedAtResponse operationIndex( String indexName, - OperationIndexParams operationIndexParams + OperationIndexParams operationIndexParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - operationIndexAsync(indexName, operationIndexParams) + operationIndexAsync(indexName, operationIndexParams, requestOptions) ); } + public UpdatedAtResponse operationIndex( + String indexName, + OperationIndexParams operationIndexParams + ) throws AlgoliaRuntimeException { + return this.operationIndex(indexName, operationIndexParams, null); + } + /** * (asynchronously) Peforms a copy or a move operation on a index. * * @param indexName The index in which to perform the request. (required) * @param operationIndexParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture operationIndexAsync( String indexName, - OperationIndexParams operationIndexParams + OperationIndexParams operationIndexParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -2466,11 +3860,25 @@ public CompletableFuture operationIndexAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture operationIndexAsync( + String indexName, + OperationIndexParams operationIndexParams + ) throws AlgoliaRuntimeException { + return this.operationIndexAsync(indexName, operationIndexParams, null); + } + /** * Update one or more attributes of an existing object. This method lets you update only a part of * an existing object, either by adding new attributes or updating existing ones. You can @@ -2482,6 +3890,8 @@ public CompletableFuture operationIndexAsync( * @param attributeOrBuiltInOperation List of attributes to update. (required) * @param createIfNotExists Creates the record if it does not exist yet. (optional, default to * true) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdatedAtWithObjectIdResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -2490,18 +3900,50 @@ public UpdatedAtWithObjectIdResponse partialUpdateObject( String indexName, String objectID, List> attributeOrBuiltInOperation, - Boolean createIfNotExists + Boolean createIfNotExists, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( partialUpdateObjectAsync( indexName, objectID, attributeOrBuiltInOperation, - createIfNotExists + createIfNotExists, + requestOptions ) ); } + public UpdatedAtWithObjectIdResponse partialUpdateObject( + String indexName, + String objectID, + List> attributeOrBuiltInOperation, + Boolean createIfNotExists + ) throws AlgoliaRuntimeException { + return this.partialUpdateObject( + indexName, + objectID, + attributeOrBuiltInOperation, + createIfNotExists, + null + ); + } + + public UpdatedAtWithObjectIdResponse partialUpdateObject( + String indexName, + String objectID, + List> attributeOrBuiltInOperation, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.partialUpdateObject( + indexName, + objectID, + attributeOrBuiltInOperation, + null, + requestOptions + ); + } + public UpdatedAtWithObjectIdResponse partialUpdateObject( String indexName, String objectID, @@ -2511,6 +3953,7 @@ public UpdatedAtWithObjectIdResponse partialUpdateObject( indexName, objectID, attributeOrBuiltInOperation, + null, null ); } @@ -2526,6 +3969,8 @@ public UpdatedAtWithObjectIdResponse partialUpdateObject( * @param attributeOrBuiltInOperation List of attributes to update. (required) * @param createIfNotExists Creates the record if it does not exist yet. (optional, default to * true) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -2534,7 +3979,8 @@ public CompletableFuture partialUpdateObjectAsync String indexName, String objectID, List> attributeOrBuiltInOperation, - Boolean createIfNotExists + Boolean createIfNotExists, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -2576,12 +4022,63 @@ public CompletableFuture partialUpdateObjectAsync } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {} .getType(); return this.executeAsync(call, returnType); } + public CompletableFuture partialUpdateObjectAsync( + String indexName, + String objectID, + List> attributeOrBuiltInOperation, + Boolean createIfNotExists + ) throws AlgoliaRuntimeException { + return this.partialUpdateObjectAsync( + indexName, + objectID, + attributeOrBuiltInOperation, + createIfNotExists, + null + ); + } + + public CompletableFuture partialUpdateObjectAsync( + String indexName, + String objectID, + List> attributeOrBuiltInOperation, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.partialUpdateObjectAsync( + indexName, + objectID, + attributeOrBuiltInOperation, + null, + requestOptions + ); + } + + public CompletableFuture partialUpdateObjectAsync( + String indexName, + String objectID, + List> attributeOrBuiltInOperation + ) throws AlgoliaRuntimeException { + return this.partialUpdateObjectAsync( + indexName, + objectID, + attributeOrBuiltInOperation, + null, + null + ); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -2589,17 +4086,35 @@ public CompletableFuture partialUpdateObjectAsync * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object post( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + postAsync(path, parameters, body, requestOptions) + ); + } + public Object post(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(postAsync(path, parameters, body)); + return this.post(path, parameters, body, null); + } + + public Object post(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.post(path, null, null, requestOptions); } public Object post(String path) throws AlgoliaRuntimeException { - return this.post(path, null, null); + return this.post(path, null, null, null); } /** @@ -2609,6 +4124,8 @@ public Object post(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -2616,7 +4133,8 @@ public Object post(String path) throws AlgoliaRuntimeException { public CompletableFuture postAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -2642,11 +4160,38 @@ public CompletableFuture postAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture postAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.postAsync(path, parameters, body, null); + } + + public CompletableFuture postAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, requestOptions); + } + + public CompletableFuture postAsync(String path) + throws AlgoliaRuntimeException { + return this.postAsync(path, null, null, null); + } + /** * This method allow you to send requests to the Algolia REST API. * @@ -2654,17 +4199,35 @@ public CompletableFuture postAsync( * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return Object * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public Object put( + String path, + Map parameters, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + putAsync(path, parameters, body, requestOptions) + ); + } + public Object put(String path, Map parameters, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(putAsync(path, parameters, body)); + return this.put(path, parameters, body, null); + } + + public Object put(String path, RequestOptions requestOptions) + throws AlgoliaRuntimeException { + return this.put(path, null, null, requestOptions); } public Object put(String path) throws AlgoliaRuntimeException { - return this.put(path, null, null); + return this.put(path, null, null, null); } /** @@ -2674,6 +4237,8 @@ public Object put(String path) throws AlgoliaRuntimeException { * specified. (required) * @param parameters Query parameters to be applied to the current query. (optional) * @param body The parameters to send with the custom request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -2681,7 +4246,8 @@ public Object put(String path) throws AlgoliaRuntimeException { public CompletableFuture putAsync( String path, Map parameters, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (path == null) { throw new AlgoliaRuntimeException( @@ -2707,23 +4273,59 @@ public CompletableFuture putAsync( } Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture putAsync( + String path, + Map parameters, + Object body + ) throws AlgoliaRuntimeException { + return this.putAsync(path, parameters, body, null); + } + + public CompletableFuture putAsync( + String path, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, requestOptions); + } + + public CompletableFuture putAsync(String path) + throws AlgoliaRuntimeException { + return this.putAsync(path, null, null, null); + } + /** * Remove a userID and its associated data from the multi-clusters. Upon success, the response is * 200 OK and a task is created to remove the userID data and mapping. * * @param userID userID to assign. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return RemoveUserIdResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public RemoveUserIdResponse removeUserId( + String userID, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(removeUserIdAsync(userID, requestOptions)); + } + public RemoveUserIdResponse removeUserId(String userID) throws AlgoliaRuntimeException { - return LaunderThrowable.await(removeUserIdAsync(userID)); + return this.removeUserId(userID, null); } /** @@ -2731,12 +4333,15 @@ public RemoveUserIdResponse removeUserId(String userID) * the response is 200 OK and a task is created to remove the userID data and mapping. * * @param userID userID to assign. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture removeUserIdAsync( - String userID + String userID, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (userID == null) { throw new AlgoliaRuntimeException( @@ -2757,34 +4362,59 @@ public CompletableFuture removeUserIdAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "DELETE", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "DELETE", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture removeUserIdAsync( + String userID + ) throws AlgoliaRuntimeException { + return this.removeUserIdAsync(userID, null); + } + /** * Replace all allowed sources. * * @param source The sources to allow. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return ReplaceSourceResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public ReplaceSourceResponse replaceSources( + List source, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(replaceSourcesAsync(source, requestOptions)); + } + public ReplaceSourceResponse replaceSources(List source) throws AlgoliaRuntimeException { - return LaunderThrowable.await(replaceSourcesAsync(source)); + return this.replaceSources(source, null); } /** * (asynchronously) Replace all allowed sources. * * @param source The sources to allow. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture replaceSourcesAsync( - List source + List source, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (source == null) { throw new AlgoliaRuntimeException( @@ -2801,34 +4431,60 @@ public CompletableFuture replaceSourcesAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture replaceSourcesAsync( + List source + ) throws AlgoliaRuntimeException { + return this.replaceSourcesAsync(source, null); + } + /** * Restore a deleted API key, along with its associated rights. * * @param key API Key string. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return AddApiKeyResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public AddApiKeyResponse restoreApiKey( + String key, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(restoreApiKeyAsync(key, requestOptions)); + } + public AddApiKeyResponse restoreApiKey(String key) throws AlgoliaRuntimeException { - return LaunderThrowable.await(restoreApiKeyAsync(key)); + return this.restoreApiKey(key, null); } /** * (asynchronously) Restore a deleted API key, along with its associated rights. * * @param key API Key string. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture restoreApiKeyAsync(String key) - throws AlgoliaRuntimeException { + public CompletableFuture restoreApiKeyAsync( + String key, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { if (key == null) { throw new AlgoliaRuntimeException( "Missing the required parameter 'key' when calling restoreApiKey(Async)" @@ -2848,23 +4504,47 @@ public CompletableFuture restoreApiKeyAsync(String key) Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture restoreApiKeyAsync(String key) + throws AlgoliaRuntimeException { + return this.restoreApiKeyAsync(key, null); + } + /** * Add an object to the index, automatically assigning it an object ID. * * @param indexName The index in which to perform the request. (required) * @param body The Algolia record. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return SaveObjectResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public SaveObjectResponse saveObject( + String indexName, + Object body, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + saveObjectAsync(indexName, body, requestOptions) + ); + } + public SaveObjectResponse saveObject(String indexName, Object body) throws AlgoliaRuntimeException { - return LaunderThrowable.await(saveObjectAsync(indexName, body)); + return this.saveObject(indexName, body, null); } /** @@ -2872,13 +4552,16 @@ public SaveObjectResponse saveObject(String indexName, Object body) * * @param indexName The index in which to perform the request. (required) * @param body The Algolia record. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture saveObjectAsync( String indexName, - Object body + Object body, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -2905,11 +4588,25 @@ public CompletableFuture saveObjectAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture saveObjectAsync( + String indexName, + Object body + ) throws AlgoliaRuntimeException { + return this.saveObjectAsync(indexName, body, null); + } + /** * Create or update the Rule with the specified objectID. * @@ -2918,6 +4615,8 @@ public CompletableFuture saveObjectAsync( * @param rule (required) * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdatedRuleResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -2926,19 +4625,44 @@ public UpdatedRuleResponse saveRule( String indexName, String objectID, Rule rule, - Boolean forwardToReplicas + Boolean forwardToReplicas, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - saveRuleAsync(indexName, objectID, rule, forwardToReplicas) + saveRuleAsync( + indexName, + objectID, + rule, + forwardToReplicas, + requestOptions + ) ); } + public UpdatedRuleResponse saveRule( + String indexName, + String objectID, + Rule rule, + Boolean forwardToReplicas + ) throws AlgoliaRuntimeException { + return this.saveRule(indexName, objectID, rule, forwardToReplicas, null); + } + + public UpdatedRuleResponse saveRule( + String indexName, + String objectID, + Rule rule, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.saveRule(indexName, objectID, rule, null, requestOptions); + } + public UpdatedRuleResponse saveRule( String indexName, String objectID, Rule rule ) throws AlgoliaRuntimeException { - return this.saveRule(indexName, objectID, rule, null); + return this.saveRule(indexName, objectID, rule, null, null); } /** @@ -2949,6 +4673,8 @@ public UpdatedRuleResponse saveRule( * @param rule (required) * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -2957,7 +4683,8 @@ public CompletableFuture saveRuleAsync( String indexName, String objectID, Rule rule, - Boolean forwardToReplicas + Boolean forwardToReplicas, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -2998,12 +4725,51 @@ public CompletableFuture saveRuleAsync( } Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } - /** + public CompletableFuture saveRuleAsync( + String indexName, + String objectID, + Rule rule, + Boolean forwardToReplicas + ) throws AlgoliaRuntimeException { + return this.saveRuleAsync( + indexName, + objectID, + rule, + forwardToReplicas, + null + ); + } + + public CompletableFuture saveRuleAsync( + String indexName, + String objectID, + Rule rule, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.saveRuleAsync(indexName, objectID, rule, null, requestOptions); + } + + public CompletableFuture saveRuleAsync( + String indexName, + String objectID, + Rule rule + ) throws AlgoliaRuntimeException { + return this.saveRuleAsync(indexName, objectID, rule, null, null); + } + + /** * Create a new synonym object or update the existing synonym object with the given object ID. * * @param indexName The index in which to perform the request. (required) @@ -3011,6 +4777,8 @@ public CompletableFuture saveRuleAsync( * @param synonymHit (required) * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return SaveSynonymResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -3019,19 +4787,56 @@ public SaveSynonymResponse saveSynonym( String indexName, String objectID, SynonymHit synonymHit, - Boolean forwardToReplicas + Boolean forwardToReplicas, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - saveSynonymAsync(indexName, objectID, synonymHit, forwardToReplicas) + saveSynonymAsync( + indexName, + objectID, + synonymHit, + forwardToReplicas, + requestOptions + ) ); } + public SaveSynonymResponse saveSynonym( + String indexName, + String objectID, + SynonymHit synonymHit, + Boolean forwardToReplicas + ) throws AlgoliaRuntimeException { + return this.saveSynonym( + indexName, + objectID, + synonymHit, + forwardToReplicas, + null + ); + } + + public SaveSynonymResponse saveSynonym( + String indexName, + String objectID, + SynonymHit synonymHit, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.saveSynonym( + indexName, + objectID, + synonymHit, + null, + requestOptions + ); + } + public SaveSynonymResponse saveSynonym( String indexName, String objectID, SynonymHit synonymHit ) throws AlgoliaRuntimeException { - return this.saveSynonym(indexName, objectID, synonymHit, null); + return this.saveSynonym(indexName, objectID, synonymHit, null, null); } /** @@ -3043,6 +4848,8 @@ public SaveSynonymResponse saveSynonym( * @param synonymHit (required) * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -3051,7 +4858,8 @@ public CompletableFuture saveSynonymAsync( String indexName, String objectID, SynonymHit synonymHit, - Boolean forwardToReplicas + Boolean forwardToReplicas, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -3092,11 +4900,56 @@ public CompletableFuture saveSynonymAsync( } Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture saveSynonymAsync( + String indexName, + String objectID, + SynonymHit synonymHit, + Boolean forwardToReplicas + ) throws AlgoliaRuntimeException { + return this.saveSynonymAsync( + indexName, + objectID, + synonymHit, + forwardToReplicas, + null + ); + } + + public CompletableFuture saveSynonymAsync( + String indexName, + String objectID, + SynonymHit synonymHit, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.saveSynonymAsync( + indexName, + objectID, + synonymHit, + null, + requestOptions + ); + } + + public CompletableFuture saveSynonymAsync( + String indexName, + String objectID, + SynonymHit synonymHit + ) throws AlgoliaRuntimeException { + return this.saveSynonymAsync(indexName, objectID, synonymHit, null, null); + } + /** * Create/update multiple synonym objects at once, potentially replacing the entire list of * synonyms if replaceExistingSynonyms is true. @@ -3107,6 +4960,8 @@ public CompletableFuture saveSynonymAsync( * indexName. (optional) * @param replaceExistingSynonyms Replace all synonyms of the index with the ones sent with this * request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -3115,23 +4970,48 @@ public UpdatedAtResponse saveSynonyms( String indexName, List synonymHit, Boolean forwardToReplicas, - Boolean replaceExistingSynonyms + Boolean replaceExistingSynonyms, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( saveSynonymsAsync( indexName, synonymHit, forwardToReplicas, - replaceExistingSynonyms + replaceExistingSynonyms, + requestOptions ) ); } + public UpdatedAtResponse saveSynonyms( + String indexName, + List synonymHit, + Boolean forwardToReplicas, + Boolean replaceExistingSynonyms + ) throws AlgoliaRuntimeException { + return this.saveSynonyms( + indexName, + synonymHit, + forwardToReplicas, + replaceExistingSynonyms, + null + ); + } + + public UpdatedAtResponse saveSynonyms( + String indexName, + List synonymHit, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.saveSynonyms(indexName, synonymHit, null, null, requestOptions); + } + public UpdatedAtResponse saveSynonyms( String indexName, List synonymHit ) throws AlgoliaRuntimeException { - return this.saveSynonyms(indexName, synonymHit, null, null); + return this.saveSynonyms(indexName, synonymHit, null, null, null); } /** @@ -3144,6 +5024,8 @@ public UpdatedAtResponse saveSynonyms( * indexName. (optional) * @param replaceExistingSynonyms Replace all synonyms of the index with the ones sent with this * request. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -3152,7 +5034,8 @@ public CompletableFuture saveSynonymsAsync( String indexName, List synonymHit, Boolean forwardToReplicas, - Boolean replaceExistingSynonyms + Boolean replaceExistingSynonyms, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -3193,23 +5076,78 @@ public CompletableFuture saveSynonymsAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture saveSynonymsAsync( + String indexName, + List synonymHit, + Boolean forwardToReplicas, + Boolean replaceExistingSynonyms + ) throws AlgoliaRuntimeException { + return this.saveSynonymsAsync( + indexName, + synonymHit, + forwardToReplicas, + replaceExistingSynonyms, + null + ); + } + + public CompletableFuture saveSynonymsAsync( + String indexName, + List synonymHit, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.saveSynonymsAsync( + indexName, + synonymHit, + null, + null, + requestOptions + ); + } + + public CompletableFuture saveSynonymsAsync( + String indexName, + List synonymHit + ) throws AlgoliaRuntimeException { + return this.saveSynonymsAsync(indexName, synonymHit, null, null, null); + } + /** * Perform a search operation targeting one specific index. * * @param indexName The index in which to perform the request. (required) * @param searchParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return SearchResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public SearchResponse search( + String indexName, + SearchParams searchParams, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + searchAsync(indexName, searchParams, requestOptions) + ); + } + public SearchResponse search(String indexName, SearchParams searchParams) throws AlgoliaRuntimeException { - return LaunderThrowable.await(searchAsync(indexName, searchParams)); + return this.search(indexName, searchParams, null); } /** @@ -3217,13 +5155,16 @@ public SearchResponse search(String indexName, SearchParams searchParams) * * @param indexName The index in which to perform the request. (required) * @param searchParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture searchAsync( String indexName, - SearchParams searchParams + SearchParams searchParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -3250,44 +5191,76 @@ public CompletableFuture searchAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture searchAsync( + String indexName, + SearchParams searchParams + ) throws AlgoliaRuntimeException { + return this.searchAsync(indexName, searchParams, null); + } + /** * Search the dictionary entries. * * @param dictionaryName The dictionary to search in. (required) * @param searchDictionaryEntriesParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ public UpdatedAtResponse searchDictionaryEntries( DictionaryType dictionaryName, - SearchDictionaryEntriesParams searchDictionaryEntriesParams + SearchDictionaryEntriesParams searchDictionaryEntriesParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( searchDictionaryEntriesAsync( dictionaryName, - searchDictionaryEntriesParams + searchDictionaryEntriesParams, + requestOptions ) ); } + public UpdatedAtResponse searchDictionaryEntries( + DictionaryType dictionaryName, + SearchDictionaryEntriesParams searchDictionaryEntriesParams + ) throws AlgoliaRuntimeException { + return this.searchDictionaryEntries( + dictionaryName, + searchDictionaryEntriesParams, + null + ); + } + /** * (asynchronously) Search the dictionary entries. * * @param dictionaryName The dictionary to search in. (required) * @param searchDictionaryEntriesParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture searchDictionaryEntriesAsync( DictionaryType dictionaryName, - SearchDictionaryEntriesParams searchDictionaryEntriesParams + SearchDictionaryEntriesParams searchDictionaryEntriesParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (dictionaryName == null) { throw new AlgoliaRuntimeException( @@ -3316,11 +5289,29 @@ public CompletableFuture searchDictionaryEntriesAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture searchDictionaryEntriesAsync( + DictionaryType dictionaryName, + SearchDictionaryEntriesParams searchDictionaryEntriesParams + ) throws AlgoliaRuntimeException { + return this.searchDictionaryEntriesAsync( + dictionaryName, + searchDictionaryEntriesParams, + null + ); + } + /** * Search for values of a given facet, optionally restricting the returned values to those * contained in objects matching other search criteria. @@ -3328,6 +5319,8 @@ public CompletableFuture searchDictionaryEntriesAsync( * @param indexName The index in which to perform the request. (required) * @param facetName The facet name. (required) * @param searchForFacetValuesRequest (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return SearchForFacetValuesResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -3335,22 +5328,50 @@ public CompletableFuture searchDictionaryEntriesAsync( public SearchForFacetValuesResponse searchForFacetValues( String indexName, String facetName, - SearchForFacetValuesRequest searchForFacetValuesRequest + SearchForFacetValuesRequest searchForFacetValuesRequest, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( searchForFacetValuesAsync( indexName, facetName, - searchForFacetValuesRequest + searchForFacetValuesRequest, + requestOptions ) ); } + public SearchForFacetValuesResponse searchForFacetValues( + String indexName, + String facetName, + SearchForFacetValuesRequest searchForFacetValuesRequest + ) throws AlgoliaRuntimeException { + return this.searchForFacetValues( + indexName, + facetName, + searchForFacetValuesRequest, + null + ); + } + + public SearchForFacetValuesResponse searchForFacetValues( + String indexName, + String facetName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.searchForFacetValues( + indexName, + facetName, + null, + requestOptions + ); + } + public SearchForFacetValuesResponse searchForFacetValues( String indexName, String facetName ) throws AlgoliaRuntimeException { - return this.searchForFacetValues(indexName, facetName, null); + return this.searchForFacetValues(indexName, facetName, null, null); } /** @@ -3360,6 +5381,8 @@ public SearchForFacetValuesResponse searchForFacetValues( * @param indexName The index in which to perform the request. (required) * @param facetName The facet name. (required) * @param searchForFacetValuesRequest (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -3367,7 +5390,8 @@ public SearchForFacetValuesResponse searchForFacetValues( public CompletableFuture searchForFacetValuesAsync( String indexName, String facetName, - SearchForFacetValuesRequest searchForFacetValuesRequest + SearchForFacetValuesRequest searchForFacetValuesRequest, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -3395,42 +5419,95 @@ public CompletableFuture searchForFacetValuesAsync Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {} .getType(); return this.executeAsync(call, returnType); } + public CompletableFuture searchForFacetValuesAsync( + String indexName, + String facetName, + SearchForFacetValuesRequest searchForFacetValuesRequest + ) throws AlgoliaRuntimeException { + return this.searchForFacetValuesAsync( + indexName, + facetName, + searchForFacetValuesRequest, + null + ); + } + + public CompletableFuture searchForFacetValuesAsync( + String indexName, + String facetName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.searchForFacetValuesAsync( + indexName, + facetName, + null, + requestOptions + ); + } + + public CompletableFuture searchForFacetValuesAsync( + String indexName, + String facetName + ) throws AlgoliaRuntimeException { + return this.searchForFacetValuesAsync(indexName, facetName, null, null); + } + /** * Search for rules matching various criteria. * * @param indexName The index in which to perform the request. (required) * @param searchRulesParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return SearchRulesResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ public SearchRulesResponse searchRules( String indexName, - SearchRulesParams searchRulesParams + SearchRulesParams searchRulesParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - searchRulesAsync(indexName, searchRulesParams) + searchRulesAsync(indexName, searchRulesParams, requestOptions) ); } + public SearchRulesResponse searchRules( + String indexName, + SearchRulesParams searchRulesParams + ) throws AlgoliaRuntimeException { + return this.searchRules(indexName, searchRulesParams, null); + } + /** * (asynchronously) Search for rules matching various criteria. * * @param indexName The index in which to perform the request. (required) * @param searchRulesParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture searchRulesAsync( String indexName, - SearchRulesParams searchRulesParams + SearchRulesParams searchRulesParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -3457,11 +5534,25 @@ public CompletableFuture searchRulesAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture searchRulesAsync( + String indexName, + SearchRulesParams searchRulesParams + ) throws AlgoliaRuntimeException { + return this.searchRulesAsync(indexName, searchRulesParams, null); + } + /** * Search or browse all synonyms, optionally filtering them by type. * @@ -3472,6 +5563,8 @@ public CompletableFuture searchRulesAsync( * page size is implicitly set to 100. When null, will retrieve all indices (no pagination). * (optional, default to 0) * @param hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return SearchSynonymsResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -3481,16 +5574,48 @@ public SearchSynonymsResponse searchSynonyms( String query, SynonymType type, Integer page, - Integer hitsPerPage + Integer hitsPerPage, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - searchSynonymsAsync(indexName, query, type, page, hitsPerPage) + searchSynonymsAsync( + indexName, + query, + type, + page, + hitsPerPage, + requestOptions + ) ); } + public SearchSynonymsResponse searchSynonyms( + String indexName, + String query, + SynonymType type, + Integer page, + Integer hitsPerPage + ) throws AlgoliaRuntimeException { + return this.searchSynonyms(indexName, query, type, page, hitsPerPage, null); + } + + public SearchSynonymsResponse searchSynonyms( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.searchSynonyms( + indexName, + null, + null, + null, + null, + requestOptions + ); + } + public SearchSynonymsResponse searchSynonyms(String indexName) throws AlgoliaRuntimeException { - return this.searchSynonyms(indexName, null, null, null, null); + return this.searchSynonyms(indexName, null, null, null, null, null); } /** @@ -3503,6 +5628,8 @@ public SearchSynonymsResponse searchSynonyms(String indexName) * page size is implicitly set to 100. When null, will retrieve all indices (no pagination). * (optional, default to 0) * @param hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -3512,7 +5639,8 @@ public CompletableFuture searchSynonymsAsync( String query, SynonymType type, Integer page, - Integer hitsPerPage + Integer hitsPerPage, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -3549,11 +5677,55 @@ public CompletableFuture searchSynonymsAsync( } Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture searchSynonymsAsync( + String indexName, + String query, + SynonymType type, + Integer page, + Integer hitsPerPage + ) throws AlgoliaRuntimeException { + return this.searchSynonymsAsync( + indexName, + query, + type, + page, + hitsPerPage, + null + ); + } + + public CompletableFuture searchSynonymsAsync( + String indexName, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.searchSynonymsAsync( + indexName, + null, + null, + null, + null, + requestOptions + ); + } + + public CompletableFuture searchSynonymsAsync( + String indexName + ) throws AlgoliaRuntimeException { + return this.searchSynonymsAsync(indexName, null, null, null, null, null); + } + /** * Search for userIDs. The data returned will usually be a few seconds behind real time, because * userID usage may take up to a few seconds propagate to the different clusters. To keep updates @@ -3564,14 +5736,25 @@ public CompletableFuture searchSynonymsAsync( * success, the response is 200 OK and contains the following userIDs data. * * @param searchUserIdsParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return SearchUserIdsResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public SearchUserIdsResponse searchUserIds( + SearchUserIdsParams searchUserIdsParams, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + searchUserIdsAsync(searchUserIdsParams, requestOptions) + ); + } + public SearchUserIdsResponse searchUserIds( SearchUserIdsParams searchUserIdsParams ) throws AlgoliaRuntimeException { - return LaunderThrowable.await(searchUserIdsAsync(searchUserIdsParams)); + return this.searchUserIds(searchUserIdsParams, null); } /** @@ -3584,12 +5767,15 @@ public SearchUserIdsResponse searchUserIds( * every 12h. Upon success, the response is 200 OK and contains the following userIDs data. * * @param searchUserIdsParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture searchUserIdsAsync( - SearchUserIdsParams searchUserIdsParams + SearchUserIdsParams searchUserIdsParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (searchUserIdsParams == null) { throw new AlgoliaRuntimeException( @@ -3606,37 +5792,62 @@ public CompletableFuture searchUserIdsAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "POST", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "POST", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture searchUserIdsAsync( + SearchUserIdsParams searchUserIdsParams + ) throws AlgoliaRuntimeException { + return this.searchUserIdsAsync(searchUserIdsParams, null); + } + /** * Set dictionaries settings. * * @param dictionarySettingsParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ public UpdatedAtResponse setDictionarySettings( - DictionarySettingsParams dictionarySettingsParams + DictionarySettingsParams dictionarySettingsParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - setDictionarySettingsAsync(dictionarySettingsParams) + setDictionarySettingsAsync(dictionarySettingsParams, requestOptions) ); } + public UpdatedAtResponse setDictionarySettings( + DictionarySettingsParams dictionarySettingsParams + ) throws AlgoliaRuntimeException { + return this.setDictionarySettings(dictionarySettingsParams, null); + } + /** * (asynchronously) Set dictionaries settings. * * @param dictionarySettingsParams (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture setDictionarySettingsAsync( - DictionarySettingsParams dictionarySettingsParams + DictionarySettingsParams dictionarySettingsParams, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (dictionarySettingsParams == null) { throw new AlgoliaRuntimeException( @@ -3654,11 +5865,24 @@ public CompletableFuture setDictionarySettingsAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture setDictionarySettingsAsync( + DictionarySettingsParams dictionarySettingsParams + ) throws AlgoliaRuntimeException { + return this.setDictionarySettingsAsync(dictionarySettingsParams, null); + } + /** * Update settings of an index. Only specified settings are overridden; unspecified settings are * left unchanged. Specifying null for a setting resets it to its default value. @@ -3667,6 +5891,8 @@ public CompletableFuture setDictionarySettingsAsync( * @param indexSettings (required) * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdatedAtResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body @@ -3674,18 +5900,40 @@ public CompletableFuture setDictionarySettingsAsync( public UpdatedAtResponse setSettings( String indexName, IndexSettings indexSettings, - Boolean forwardToReplicas + Boolean forwardToReplicas, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await( - setSettingsAsync(indexName, indexSettings, forwardToReplicas) + setSettingsAsync( + indexName, + indexSettings, + forwardToReplicas, + requestOptions + ) ); } + public UpdatedAtResponse setSettings( + String indexName, + IndexSettings indexSettings, + Boolean forwardToReplicas + ) throws AlgoliaRuntimeException { + return this.setSettings(indexName, indexSettings, forwardToReplicas, null); + } + + public UpdatedAtResponse setSettings( + String indexName, + IndexSettings indexSettings, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.setSettings(indexName, indexSettings, null, requestOptions); + } + public UpdatedAtResponse setSettings( String indexName, IndexSettings indexSettings ) throws AlgoliaRuntimeException { - return this.setSettings(indexName, indexSettings, null); + return this.setSettings(indexName, indexSettings, null, null); } /** @@ -3697,6 +5945,8 @@ public UpdatedAtResponse setSettings( * @param indexSettings (required) * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object @@ -3704,7 +5954,8 @@ public UpdatedAtResponse setSettings( public CompletableFuture setSettingsAsync( String indexName, IndexSettings indexSettings, - Boolean forwardToReplicas + Boolean forwardToReplicas, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (indexName == null) { throw new AlgoliaRuntimeException( @@ -3738,23 +5989,75 @@ public CompletableFuture setSettingsAsync( } Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + public CompletableFuture setSettingsAsync( + String indexName, + IndexSettings indexSettings, + Boolean forwardToReplicas + ) throws AlgoliaRuntimeException { + return this.setSettingsAsync( + indexName, + indexSettings, + forwardToReplicas, + null + ); + } + + public CompletableFuture setSettingsAsync( + String indexName, + IndexSettings indexSettings, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.setSettingsAsync( + indexName, + indexSettings, + null, + requestOptions + ); + } + + public CompletableFuture setSettingsAsync( + String indexName, + IndexSettings indexSettings + ) throws AlgoliaRuntimeException { + return this.setSettingsAsync(indexName, indexSettings, null, null); + } + /** * Replace every permission of an existing API key. * * @param key API Key string. (required) * @param apiKey (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return UpdateApiKeyResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ + public UpdateApiKeyResponse updateApiKey( + String key, + ApiKey apiKey, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await( + updateApiKeyAsync(key, apiKey, requestOptions) + ); + } + public UpdateApiKeyResponse updateApiKey(String key, ApiKey apiKey) throws AlgoliaRuntimeException { - return LaunderThrowable.await(updateApiKeyAsync(key, apiKey)); + return this.updateApiKey(key, apiKey, null); } /** @@ -3762,13 +6065,16 @@ public UpdateApiKeyResponse updateApiKey(String key, ApiKey apiKey) * * @param key API Key string. (required) * @param apiKey (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. * @return The awaitable future * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ public CompletableFuture updateApiKeyAsync( String key, - ApiKey apiKey + ApiKey apiKey, + RequestOptions requestOptions ) throws AlgoliaRuntimeException { if (key == null) { throw new AlgoliaRuntimeException( @@ -3795,8 +6101,22 @@ public CompletableFuture updateApiKeyAsync( Map headers = new HashMap(); Call call = - this.buildCall(requestPath, "PUT", queryParams, bodyObj, headers); + this.buildCall( + requestPath, + "PUT", + queryParams, + bodyObj, + headers, + requestOptions + ); Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } + + public CompletableFuture updateApiKeyAsync( + String key, + ApiKey apiKey + ) throws AlgoliaRuntimeException { + return this.updateApiKeyAsync(key, apiKey, null); + } } diff --git a/clients/algoliasearch-client-javascript/packages/client-common/src/transporter/createTransporter.ts b/clients/algoliasearch-client-javascript/packages/client-common/src/transporter/createTransporter.ts index fa9a44c48f..ce4a832332 100644 --- a/clients/algoliasearch-client-javascript/packages/client-common/src/transporter/createTransporter.ts +++ b/clients/algoliasearch-client-javascript/packages/client-common/src/transporter/createTransporter.ts @@ -240,13 +240,13 @@ export function createTransporter({ cacheable: baseRequestOptions?.cacheable, timeout: baseRequestOptions?.timeout, queryParameters: { - ...methodOptions.queryParameters, ...baseRequestOptions?.queryParameters, + ...methodOptions.queryParameters, }, headers: { Accept: 'application/json', - ...methodOptions.headers, ...baseRequestOptions?.headers, + ...methodOptions.headers, }, };