diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 7b4b7e7ff..a90fa1864 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -19,6 +19,7 @@ gradle* # Selective source file algoliasearch-core/com/algolia/auth/** +algoliasearch-core/com/algolia/ApiException.java algoliasearch-core/com/algolia/Configuration.java algoliasearch-core/com/algolia/Server*.java algoliasearch-core/com/algolia/StringUtil.java diff --git a/algoliasearch-client-java-2/.gitignore b/algoliasearch-client-java-2/.gitignore deleted file mode 100644 index 7cf2ea329..000000000 --- a/algoliasearch-client-java-2/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -*.class - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.ear - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -# build files -**/target -target -.gradle -build - -.openapi-generator diff --git a/algoliasearch-client-java-2/.openapi-generator-ignore b/algoliasearch-client-java-2/.openapi-generator-ignore deleted file mode 100644 index a90fa1864..000000000 --- a/algoliasearch-client-java-2/.openapi-generator-ignore +++ /dev/null @@ -1,26 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -api/** -docs/** -gradle/** -src/** -README.md - -.travis.yml -build.sbt -gradle.properties -git_push.sh -pom.xml -gradle* - -# Selective source file -algoliasearch-core/com/algolia/auth/** -algoliasearch-core/com/algolia/ApiException.java -algoliasearch-core/com/algolia/Configuration.java -algoliasearch-core/com/algolia/Server*.java -algoliasearch-core/com/algolia/StringUtil.java -algoliasearch-core/com/algolia/GzipRequestInterceptor.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiCallback.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiCallback.java deleted file mode 100644 index 1c1d61bcf..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiCallback.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.algolia; - -import com.algolia.exceptions.AlgoliaRuntimeException; -import java.util.List; -import java.util.Map; - -/** - * Callback for asynchronous API call. - * - * @param The return type - */ -public interface ApiCallback { - /** - * This is called when the API call fails. - * - * @param e The exception causing the failure - * @param statusCode Status code of the response if available, otherwise it would be 0 - * @param responseHeaders Headers of the response if available, otherwise it would be null - */ - void onFailure( - AlgoliaRuntimeException e, - int statusCode, - Map> responseHeaders - ); - - /** - * This is called when the API call succeeded. - * - * @param result The result deserialized from response - * @param statusCode Status code of the response - * @param responseHeaders Headers of the response - */ - void onSuccess( - T result, - int statusCode, - Map> responseHeaders - ); - - /** - * This is called when the API upload processing. - * - * @param bytesWritten bytes Written - * @param contentLength content length of request body - * @param done write end - */ - void onUploadProgress(long bytesWritten, long contentLength, boolean done); - - /** - * This is called when the API download processing. - * - * @param bytesRead bytes Read - * @param contentLength content length of the response - * @param done Read end - */ - void onDownloadProgress(long bytesRead, long contentLength, boolean done); -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java deleted file mode 100644 index 2a89b58b9..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java +++ /dev/null @@ -1,730 +0,0 @@ -package com.algolia; - -import com.algolia.exceptions.*; -import com.algolia.utils.Requester; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Type; -import java.net.URLEncoder; -import java.text.DateFormat; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.*; -import java.util.Map.Entry; -import okhttp3.*; -import okhttp3.internal.http.HttpMethod; - -public class ApiClient { - - private boolean debugging = false; - private Map defaultHeaderMap = new HashMap(); - - private String appId, apiKey; - - private DateFormat dateFormat; - - private Requester requester; - - /* - * Constructor for ApiClient with custom Requester - */ - public ApiClient(String appId, String apiKey, Requester requester) { - setUserAgent("OpenAPI-Generator/0.1.0/java"); - - this.appId = appId; - this.apiKey = apiKey; - this.requester = requester; - } - - public DateFormat getDateFormat() { - return dateFormat; - } - - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent HTTP request's user agent - * @return ApiClient - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; - } - - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return ApiClient - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; - } - - /** - * Check that whether debugging is enabled for this API client. - * - * @return True if debugging is enabled, false otherwise. - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - * @return ApiClient - */ - public ApiClient setDebugging(boolean debugging) { - requester.setDebugging(debugging); - return this; - } - - /** - * Get connection timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getConnectTimeout() { - return requester.getConnectTimeout(); - } - - /** - * Sets the connect timeout (in milliseconds). A value of 0 means no timeout, otherwise values - * must be between 1 and {@link Integer#MAX_VALUE}. - * - * @param connectionTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setConnectTimeout(int connectionTimeout) { - requester.setConnectTimeout(connectionTimeout); - return this; - } - - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return requester.getReadTimeout(); - } - - /** - * Sets the read timeout (in milliseconds). A value of 0 means no timeout, otherwise values must - * be between 1 and {@link Integer#MAX_VALUE}. - * - * @param readTimeout read timeout in milliseconds - * @return Api client - */ - public ApiClient setReadTimeout(int readTimeout) { - requester.setReadTimeout(readTimeout); - return this; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return requester.getWriteTimeout(); - } - - /** - * Sets the write timeout (in milliseconds). A value of 0 means no timeout, otherwise values must - * be between 1 and {@link Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(int writeTimeout) { - requester.setWriteTimeout(writeTimeout); - return this; - } - - /** - * Format the given parameter object into string. - * - * @param param Parameter - * @return String representation of the parameter - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if ( - param instanceof Date || - param instanceof OffsetDateTime || - param instanceof LocalDate - ) { - // Serialize to json string and remove the " enclosing characters - String jsonStr = JSON.serialize(param); - return jsonStr.substring(1, jsonStr.length() - 1); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for (Object o : (Collection) param) { - if (b.length() > 0) { - b.append(","); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /** - * Formats the specified query parameter to a list containing a single {@code Pair} object. - * - *

Note that {@code value} must not be a collection. - * - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list containing a single {@code Pair} object. - */ - public List parameterToPair(String name, Object value) { - List params = new ArrayList(); - - // preconditions - if ( - name == null || - name.isEmpty() || - value == null || - value instanceof Collection - ) { - return params; - } - - params.add(new Pair(name, parameterToString(value))); - return params; - } - - /** - * Formats the specified collection query parameters to a list of {@code Pair} objects. - * - *

Note that the values of each of the returned Pair objects are percent-encoded. - * - * @param collectionFormat The collection format of the parameter. - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list of {@code Pair} objects. - */ - public List parameterToPairs( - String collectionFormat, - String name, - Collection value - ) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value.isEmpty()) { - return params; - } - - // create the params based on the collection format - if ("multi".equals(collectionFormat)) { - for (Object item : value) { - params.add(new Pair(name, escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if ("ssv".equals(collectionFormat)) { - delimiter = escapeString(" "); - } else if ("tsv".equals(collectionFormat)) { - delimiter = escapeString("\t"); - } else if ("pipes".equals(collectionFormat)) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(name, sb.substring(delimiter.length()))); - - return params; - } - - /** - * Formats the specified collection path parameter to a string value. - * - * @param collectionFormat The collection format of the parameter. - * @param value The value of the parameter. - * @return String representation of the parameter - */ - public String collectionPathParameterToString( - String collectionFormat, - Collection value - ) { - // create the value based on the collection format - if ("multi".equals(collectionFormat)) { - // not valid for path params - return parameterToString(value); - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - if ("ssv".equals(collectionFormat)) { - delimiter = " "; - } else if ("tsv".equals(collectionFormat)) { - delimiter = "\t"; - } else if ("pipes".equals(collectionFormat)) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - return sb.substring(delimiter.length()); - } - - /** - * 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 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. - * - * @param str String to be escaped - * @return Escaped string - */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; - } - } - - /** - * Deserialize response body to Java object, according to the return type and the Content-Type - * response header. - * - * @param Type - * @param response HTTP response - * @param returnType The type of the Java object - * @return The deserialized Java object - * @throws AlgoliaRuntimeException If fail to deserialize response body, i.e. cannot read response - * body or the Content-Type of the response is not supported. - */ - public T deserialize(Response response, Type returnType) - throws AlgoliaRuntimeException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - try { - return (T) response.body().bytes(); - } catch (IOException e) { - throw new AlgoliaRuntimeException(e); - } - } - - String respBody; - try { - if (response.body() != null) respBody = - response.body().string(); else respBody = null; - } catch (IOException e) { - throw new AlgoliaRuntimeException(e); - } - - if (respBody == null || "".equals(respBody)) { - return null; - } - - String contentType = response.headers().get("Content-Type"); - if (contentType == null) { - // ensuring a default content type - contentType = "application/json"; - } - if (isJsonMime(contentType)) { - return JSON.deserialize(respBody, returnType); - } else if (returnType.equals(String.class)) { - // Expecting string, return the raw response body. - return (T) respBody; - } else { - throw new AlgoliaApiException( - "Content type \"" + - contentType + - "\" is not supported for type: " + - returnType, - response.code() - ); - } - } - - /** - * Serialize the given Java object into request body according to the object's class and the - * 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)); - } else { - throw new AlgoliaRuntimeException( - "Content type \"" + contentType + "\" is not supported" - ); - } - } - - /** - * {@link #execute(Call, Type)} - * - * @param Type - * @param call An instance of the Call object - * @return ApiResponse<T> - * @throws AlgoliaRuntimeException If fail to execute the call - */ - public ApiResponse execute(Call call) throws AlgoliaRuntimeException { - return execute(call, null); - } - - /** - * Execute HTTP call and deserialize the HTTP response body into the given return type. - * - * @param returnType The return type used to deserialize HTTP response body - * @param The return type corresponding to (same with) returnType - * @param call Call - * @return ApiResponse object containing response status, headers and data, which is a Java object - * deserialized from response body and would be null when returnType is null. - * @throws AlgoliaRuntimeException If fail to execute the call - */ - public ApiResponse execute(Call call, Type returnType) - throws AlgoliaRuntimeException { - try { - Response response = call.execute(); - T data = handleResponse(response, returnType); - return new ApiResponse( - response.code(), - response.headers().toMultimap(), - data - ); - } catch (IOException e) { - throw new AlgoliaRuntimeException(e); - } - } - - /** - * {@link #executeAsync(Call, Type, ApiCallback)} - * - * @param Type - * @param call An instance of the Call object - * @param callback ApiCallback<T> - */ - public void executeAsync(Call call, ApiCallback callback) { - executeAsync(call, null, callback); - } - - /** - * Execute HTTP call asynchronously. - * - * @param Type - * @param call The callback to be executed when the API call finishes - * @param returnType Return type - * @param callback ApiCallback - * @see #execute(Call, Type) - */ - public void executeAsync( - Call call, - final Type returnType, - final ApiCallback callback - ) { - call.enqueue( - new Callback() { - @Override - public void onFailure(Call call, IOException e) { - callback.onFailure(new AlgoliaRuntimeException(e), 0, null); - } - - @Override - public void onResponse(Call call, Response response) - throws IOException { - T result; - try { - result = (T) handleResponse(response, returnType); - } catch (AlgoliaRuntimeException e) { - callback.onFailure( - e, - response.code(), - response.headers().toMultimap() - ); - return; - } catch (Exception e) { - callback.onFailure( - new AlgoliaRuntimeException(e), - response.code(), - response.headers().toMultimap() - ); - return; - } - callback.onSuccess( - result, - response.code(), - response.headers().toMultimap() - ); - } - } - ); - } - - /** - * Handle the given response, return the deserialized object when the response is successful. - * - * @param Type - * @param response Response - * @param returnType Return type - * @return Type - * @throws AlgoliaRuntimeException If the response has an unsuccessful status code or fail to - * deserialize the response body - */ - public T handleResponse(Response response, Type returnType) - throws AlgoliaRuntimeException { - if (response.isSuccessful()) { - if (returnType == null || response.code() == 204) { - // returning null if the returnType is not defined, - // or the status code is 204 (No Content) - if (response.body() != null) { - try { - response.body().close(); - } catch (Exception e) { - throw new AlgoliaApiException( - response.message(), - e, - response.code() - ); - } - } - return null; - } else { - return deserialize(response, returnType); - } - } else { - if (response.body() != null) { - try { - response.body().string(); - } catch (IOException e) { - throw new AlgoliaApiException(response.message(), e, response.code()); - } - } - throw new AlgoliaApiException(response.message(), response.code()); - } - } - - /** - * Build HTTP call with the given options. - * - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and - * "DELETE" - * @param queryParams The query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param callback Callback for upload/download progress - * @return The HTTP call - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - public Call buildCall( - String path, - String method, - List queryParams, - Object body, - Map headerParams, - ApiCallback callback - ) throws AlgoliaRuntimeException { - Request request = buildRequest( - path, - method, - queryParams, - body, - headerParams, - callback - ); - - return requester.newCall(request); - } - - /** - * Build an HTTP request with the given options. - * - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and - * "DELETE" - * @param queryParams The query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param callback Callback for upload/download progress - * @return The HTTP request - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - public Request buildRequest( - String path, - String method, - List queryParams, - Object body, - Map headerParams, - ApiCallback callback - ) throws AlgoliaRuntimeException { - headerParams.put("X-Algolia-Application-Id", this.appId); - headerParams.put("X-Algolia-API-Key", this.apiKey); - - final String url = buildUrl(path, queryParams); - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - - String contentType = (String) headerParams.get("Content-Type"); - // ensuring a default content type - if (contentType == null) { - contentType = "application/json"; - } - - RequestBody reqBody; - if (!HttpMethod.permitsRequestBody(method)) { - reqBody = null; - } else if (body == null) { - if ("DELETE".equals(method)) { - // allow calling DELETE without sending a request body - reqBody = null; - } else { - // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", MediaType.parse(contentType)); - } - } else { - reqBody = serialize(body, contentType); - } - - // Associate callback with request (if not null) so interceptor can - // access it when creating ProgressResponseBody - reqBuilder.tag(callback); - - Request request = null; - - if (callback != null && reqBody != null) { - ProgressRequestBody progressRequestBody = new ProgressRequestBody( - reqBody, - callback - ); - request = reqBuilder.method(method, progressRequestBody).build(); - } else { - request = reqBuilder.method(method, reqBody).build(); - } - - return request; - } - - /** - * Build full URL by concatenating base path, the given sub path and query parameters. - * - * @param path The sub path - * @param queryParams The query parameters - * @return The full URL - */ - public String buildUrl(String path, List queryParams) { - final StringBuilder url = new StringBuilder(); - - // The real host will be assigned by the retry strategy - url.append("http://temp.path").append(path); - - if (queryParams != null && !queryParams.isEmpty()) { - // support (constant) query string in `path`, e.g. "/posts?draft=1" - String prefix = path.contains("?") ? "&" : "?"; - for (Pair param : queryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - url - .append(escapeString(param.getName())) - .append("=") - .append(escapeString(value)); - } - } - } - - return url.toString(); - } - - /** - * Set header parameters to the request builder, including default headers. - * - * @param headerParams Header parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processHeaderParams( - Map headerParams, - Request.Builder reqBuilder - ) { - for (Entry param : headerParams.entrySet()) { - reqBuilder.header(param.getKey(), parameterToString(param.getValue())); - } - for (Entry header : defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(header.getKey())) { - reqBuilder.header( - header.getKey(), - parameterToString(header.getValue()) - ); - } - } - } - - /** - * Build a form-encoding request body with the given form parameters. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyFormEncoding( - Map formParams - ) { - okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); - for (Entry param : formParams.entrySet()) { - formBuilder.add(param.getKey(), parameterToString(param.getValue())); - } - return formBuilder.build(); - } -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiResponse.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiResponse.java deleted file mode 100644 index 3826fd075..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiResponse.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.algolia; - -import java.util.List; -import java.util.Map; - -/** - * API response returned by API call. - * - * @param The type of data that is deserialized from response body - */ -public class ApiResponse { - - private final int statusCode; - private final Map> headers; - private final T data; - - /** - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - */ - public ApiResponse(int statusCode, Map> headers) { - this(statusCode, headers, null); - } - - /** - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - * @param data The object deserialized from response bod - */ - public ApiResponse( - int statusCode, - Map> headers, - T data - ) { - this.statusCode = statusCode; - this.headers = headers; - this.data = data; - } - - public int getStatusCode() { - return statusCode; - } - - public Map> getHeaders() { - return headers; - } - - public T getData() { - return data; - } -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/JSON.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/JSON.java deleted file mode 100644 index dc2203683..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/JSON.java +++ /dev/null @@ -1,634 +0,0 @@ -package com.algolia; - -import com.google.gson.FieldNamingPolicy; -import com.google.gson.FieldNamingStrategy; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.InstanceCreator; -import com.google.gson.JsonParseException; -import com.google.gson.JsonSyntaxException; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.internal.$Gson$Types; -import com.google.gson.internal.ConstructorConstructor; -import com.google.gson.internal.Excluder; -import com.google.gson.internal.LinkedTreeMap; -import com.google.gson.internal.ObjectConstructor; -import com.google.gson.internal.Primitives; -import com.google.gson.internal.bind.MapTypeAdapterFactory; -import com.google.gson.internal.bind.util.ISO8601Utils; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonToken; -import com.google.gson.stream.JsonWriter; -import io.gsonfire.GsonFireBuilder; -import java.io.IOException; -import java.io.StringWriter; -import java.lang.reflect.Field; -import java.lang.reflect.Type; -import java.lang.reflect.TypeVariable; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.ParsePosition; -import java.util.Collections; -import java.util.Date; -import java.util.EnumMap; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.IdentityHashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.TreeMap; -import java.util.WeakHashMap; -import java.util.concurrent.ConcurrentHashMap; -import okio.ByteString; - -public class JSON { - - private static Gson gson; - private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); - private static RetainFieldMapFactory mapAdapter = new RetainFieldMapFactory(); - - static { - gson = - createGson() - .registerTypeAdapter(Date.class, dateTypeAdapter) - .registerTypeAdapter(byte[].class, byteArrayAdapter) - .registerTypeAdapterFactory(mapAdapter) - .create(); - } - - public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder(); - return fireBuilder.createGsonBuilder(); - } - - /** - * Get Gson. - * - * @return Gson - */ - public static Gson getGson() { - return gson; - } - - /** - * Set Gson. - * - * @param gson Gson - * @return JSON - */ - public static void setGson(Gson gon) { - gson = gon; - } - - /** - * Serialize the given Java object into JSON string. - * - * @param obj Object - * @return String representation of the JSON - */ - public static String serialize(Object obj) { - return gson.toJson(obj); - } - - /** - * Deserialize the given JSON string to Java object. - * - * @param Type - * @param body The JSON string - * @param returnType The type to deserialize into - * @return The deserialized Java object - */ - public static T deserialize(String body, Type returnType) { - try { - return gson.fromJson(body, returnType); - } catch (JsonParseException e) { - // Fallback processing when failed to parse JSON form response body: - // return the response body string directly for the String return type; - if (returnType != null && returnType.equals(String.class)) { - return (T) body; - } else { - throw (e); - } - } - } - - public static void setDateFormat(DateFormat dateFormat) { - dateTypeAdapter.setFormat(dateFormat); - } -} - -/** Gson TypeAdapter for Byte Array type */ -class ByteArrayAdapter extends TypeAdapter { - - @Override - public void write(JsonWriter out, byte[] value) throws IOException { - if (value == null) { - out.nullValue(); - } else { - out.value(ByteString.of(value).base64()); - } - } - - @Override - public byte[] read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String bytesAsBase64 = in.nextString(); - ByteString byteString = ByteString.decodeBase64(bytesAsBase64); - return byteString.toByteArray(); - } - } -} - -/** - * Gson TypeAdapter for java.util.Date type If the dateFormat is null, ISO8601Utils will be used. - */ -class DateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public DateTypeAdapter() {} - - public DateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = ISO8601Utils.format(date, true); - } - out.value(value); - } - } - - @Override - public Date read(JsonReader in) throws IOException { - try { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return dateFormat.parse(date); - } - return ISO8601Utils.parse(date, new ParsePosition(0)); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } catch (IllegalArgumentException e) { - throw new JsonParseException(e); - } - } -} - -// https://stackoverflow.com/questions/21458468/gson-wont-properly-serialise-a-class-that-extends-hashmap -class RetainFieldMapFactory implements TypeAdapterFactory { - - FieldNamingPolicy fieldNamingPolicy = FieldNamingPolicy.IDENTITY; - ConstructorConstructor constructorConstructor = new ConstructorConstructor( - Collections.>emptyMap() - ); - MapTypeAdapterFactory defaultMapFactory = new MapTypeAdapterFactory( - constructorConstructor, - false - ); - ReflectiveFilterMapFieldFactory defaultObjectFactory = new ReflectiveFilterMapFieldFactory( - constructorConstructor, - fieldNamingPolicy, - Excluder.DEFAULT - ); - - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - final TypeAdapter mapAdapter = defaultMapFactory.create(gson, type); - if (mapAdapter != null) { - return (TypeAdapter) new RetainFieldMapAdapter( - mapAdapter, - defaultObjectFactory.create(gson, type) - ); - } - return mapAdapter; - } - - class RetainFieldMapAdapter extends TypeAdapter> { - - TypeAdapter> mapAdapter; - ReflectiveTypeAdapterFactory.Adapter> objectAdapter; - - RetainFieldMapAdapter( - TypeAdapter mapAdapter, - ReflectiveTypeAdapterFactory.Adapter objectAdapter - ) { - this.mapAdapter = mapAdapter; - this.objectAdapter = objectAdapter; - } - - @Override - public void write(final JsonWriter out, Map value) - throws IOException { - if (value == null) { - out.nullValue(); - return; - } - // 1.write object - StringWriter sw = new StringWriter(); - objectAdapter.write(new JsonWriter(sw), value); - - // 2.convert object to a map - Map objectMap = mapAdapter.fromJson(sw.toString()); - - // 3.overwrite fields in object to a copy map - value = new LinkedHashMap(value); - value.putAll(objectMap); - - // 4.write the copy map - mapAdapter.write(out, value); - } - - @Override - public Map read(JsonReader in) throws IOException { - // 1.create map, all key-value retain in map - Map map = mapAdapter.read(in); - - // 2.create object from created map - Map object = objectAdapter.fromJsonTree( - mapAdapter.toJsonTree(map) - ); - - // 3.remove fields in object from map - for (String field : objectAdapter.boundFields.keySet()) { - map.remove(field); - } - // 4.put map to object - object.putAll(map); - return object; - } - } - - static class ReflectiveFilterMapFieldFactory - extends ReflectiveTypeAdapterFactory { - - public ReflectiveFilterMapFieldFactory( - ConstructorConstructor constructorConstructor, - FieldNamingStrategy fieldNamingPolicy, - Excluder excluder - ) { - super(constructorConstructor, fieldNamingPolicy, excluder); - } - - @Override - protected boolean shouldFindFieldInClass( - Class willFindClass, - Class originalRaw - ) { - Class[] endClasses = new Class[] { - Object.class, - HashMap.class, - LinkedHashMap.class, - LinkedTreeMap.class, - Hashtable.class, - TreeMap.class, - ConcurrentHashMap.class, - IdentityHashMap.class, - WeakHashMap.class, - EnumMap.class, - }; - for (Class c : endClasses) { - if (willFindClass == c) return false; - } - - return super.shouldFindFieldInClass(willFindClass, originalRaw); - } - } - - /** - * below code copy from {@link com.google.gson.internal.bind.ReflectiveTypeAdapterFactory} (little - * modify, in source this class is final) Type adapter that reflects over the fields and methods - * of a class. - */ - static class ReflectiveTypeAdapterFactory implements TypeAdapterFactory { - - private final ConstructorConstructor constructorConstructor; - private final FieldNamingStrategy fieldNamingPolicy; - private final Excluder excluder; - - public ReflectiveTypeAdapterFactory( - ConstructorConstructor constructorConstructor, - FieldNamingStrategy fieldNamingPolicy, - Excluder excluder - ) { - this.constructorConstructor = constructorConstructor; - this.fieldNamingPolicy = fieldNamingPolicy; - this.excluder = excluder; - } - - public boolean excludeField(Field f, boolean serialize) { - return ( - !excluder.excludeClass(f.getType(), serialize) && - !excluder.excludeField(f, serialize) - ); - } - - private String getFieldName(Field f) { - SerializedName serializedName = f.getAnnotation(SerializedName.class); - return serializedName == null - ? fieldNamingPolicy.translateName(f) - : serializedName.value(); - } - - public Adapter create(Gson gson, final TypeToken type) { - Class raw = type.getRawType(); - - if (!Object.class.isAssignableFrom(raw)) { - return null; // it's a primitive! - } - - ObjectConstructor constructor = constructorConstructor.get(type); - return new Adapter(constructor, getBoundFields(gson, type, raw)); - } - - private ReflectiveTypeAdapterFactory.BoundField createBoundField( - final Gson context, - final Field field, - final String name, - final TypeToken fieldType, - boolean serialize, - boolean deserialize - ) { - final boolean isPrimitive = Primitives.isPrimitive( - fieldType.getRawType() - ); - - // special casing primitives here saves ~5% on Android... - return new ReflectiveTypeAdapterFactory.BoundField( - name, - serialize, - deserialize - ) { - final TypeAdapter typeAdapter = context.getAdapter(fieldType); - - @SuppressWarnings({ "unchecked", "rawtypes" }) // the type adapter and field type always agree - @Override - void write(JsonWriter writer, Object value) - throws IOException, IllegalAccessException { - Object fieldValue = field.get(value); - TypeAdapter t = new TypeAdapterRuntimeTypeWrapper( - context, - this.typeAdapter, - fieldType.getType() - ); - t.write(writer, fieldValue); - } - - @Override - void read(JsonReader reader, Object value) - throws IOException, IllegalAccessException { - Object fieldValue = typeAdapter.read(reader); - if (fieldValue != null || !isPrimitive) { - field.set(value, fieldValue); - } - } - }; - } - - private Map getBoundFields( - Gson context, - TypeToken type, - Class raw - ) { - Map result = new LinkedHashMap(); - if (raw.isInterface()) { - return result; - } - - Type declaredType = type.getType(); - Class originalRaw = type.getRawType(); - while (shouldFindFieldInClass(raw, originalRaw)) { - Field[] fields = raw.getDeclaredFields(); - for (Field field : fields) { - boolean serialize = excludeField(field, true); - boolean deserialize = excludeField(field, false); - if (!serialize && !deserialize) { - continue; - } - field.setAccessible(true); - Type fieldType = $Gson$Types.resolve( - type.getType(), - raw, - field.getGenericType() - ); - BoundField boundField = createBoundField( - context, - field, - getFieldName(field), - TypeToken.get(fieldType), - serialize, - deserialize - ); - BoundField previous = result.put(boundField.name, boundField); - if (previous != null) { - throw new IllegalArgumentException( - declaredType + - " declares multiple JSON fields named " + - previous.name - ); - } - } - type = - TypeToken.get( - $Gson$Types.resolve(type.getType(), raw, raw.getGenericSuperclass()) - ); - raw = type.getRawType(); - } - return result; - } - - protected boolean shouldFindFieldInClass( - Class willFindClass, - Class originalRaw - ) { - return willFindClass != Object.class; - } - - abstract static class BoundField { - - final String name; - final boolean serialized; - final boolean deserialized; - - protected BoundField( - String name, - boolean serialized, - boolean deserialized - ) { - this.name = name; - this.serialized = serialized; - this.deserialized = deserialized; - } - - abstract void write(JsonWriter writer, Object value) - throws IOException, IllegalAccessException; - - abstract void read(JsonReader reader, Object value) - throws IOException, IllegalAccessException; - } - - public static final class Adapter extends TypeAdapter { - - private final ObjectConstructor constructor; - private final Map boundFields; - - private Adapter( - ObjectConstructor constructor, - Map boundFields - ) { - this.constructor = constructor; - this.boundFields = boundFields; - } - - @Override - public T read(JsonReader in) throws IOException { - if (in.peek() == JsonToken.NULL) { - in.nextNull(); - return null; - } - - T instance = constructor.construct(); - - try { - in.beginObject(); - while (in.hasNext()) { - String name = in.nextName(); - BoundField field = boundFields.get(name); - if (field == null || !field.deserialized) { - in.skipValue(); - } else { - field.read(in, instance); - } - } - } catch (IllegalStateException e) { - throw new JsonSyntaxException(e); - } catch (IllegalAccessException e) { - throw new AssertionError(e); - } - in.endObject(); - return instance; - } - - @Override - public void write(JsonWriter out, T value) throws IOException { - if (value == null) { - out.nullValue(); - return; - } - - out.beginObject(); - try { - for (BoundField boundField : boundFields.values()) { - if (boundField.serialized) { - out.name(boundField.name); - boundField.write(out, value); - } - } - } catch (IllegalAccessException e) { - throw new AssertionError(); - } - out.endObject(); - } - } - } - - static class TypeAdapterRuntimeTypeWrapper extends TypeAdapter { - - private final Gson context; - private final TypeAdapter delegate; - private final Type type; - - TypeAdapterRuntimeTypeWrapper( - Gson context, - TypeAdapter delegate, - Type type - ) { - this.context = context; - this.delegate = delegate; - this.type = type; - } - - @Override - public T read(JsonReader in) throws IOException { - return delegate.read(in); - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - public void write(JsonWriter out, T value) throws IOException { - // Order of preference for choosing type adapters - // First preference: a type adapter registered for the runtime type - // Second preference: a type adapter registered for the declared type - // Third preference: reflective type adapter for the runtime type (if it is a - // sub class of the declared type) - // Fourth preference: reflective type adapter for the declared type - - TypeAdapter chosen = delegate; - Type runtimeType = getRuntimeTypeIfMoreSpecific(type, value); - if (runtimeType != type) { - TypeAdapter runtimeTypeAdapter = context.getAdapter( - TypeToken.get(runtimeType) - ); - if ( - !(runtimeTypeAdapter instanceof ReflectiveTypeAdapterFactory.Adapter) - ) { - // The user registered a type adapter for the runtime type, so we will use that - chosen = runtimeTypeAdapter; - } else if ( - !(delegate instanceof ReflectiveTypeAdapterFactory.Adapter) - ) { - // The user registered a type adapter for Base class, so we prefer it over the - // reflective type adapter for the runtime type - chosen = delegate; - } else { - // Use the type adapter for runtime type - chosen = runtimeTypeAdapter; - } - } - chosen.write(out, value); - } - - /** Finds a compatible runtime type if it is more specific */ - private Type getRuntimeTypeIfMoreSpecific(Type type, Object value) { - if ( - value != null && - ( - type == Object.class || - type instanceof TypeVariable || - type instanceof Class - ) - ) { - type = value.getClass(); - } - return type; - } - } -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/Pair.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/Pair.java deleted file mode 100644 index 1e5bf539e..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/Pair.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.algolia; - -public class Pair { - - private String name = ""; - private String value = ""; - - public Pair(String name, String value) { - setName(name); - setValue(value); - } - - private void setName(String name) { - if (!isValidString(name)) { - return; - } - - this.name = name; - } - - private void setValue(String value) { - if (!isValidString(value)) { - return; - } - - this.value = value; - } - - public String getName() { - return this.name; - } - - public String getValue() { - return this.value; - } - - private boolean isValidString(String arg) { - if (arg == null) { - return false; - } - - if (arg.trim().isEmpty()) { - return false; - } - - return true; - } -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ProgressRequestBody.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ProgressRequestBody.java deleted file mode 100644 index 42c926955..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ProgressRequestBody.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.algolia; - -import java.io.IOException; -import okhttp3.MediaType; -import okhttp3.RequestBody; -import okio.Buffer; -import okio.BufferedSink; -import okio.ForwardingSink; -import okio.Okio; -import okio.Sink; - -public class ProgressRequestBody extends RequestBody { - - private final RequestBody requestBody; - - private final ApiCallback callback; - - public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { - this.requestBody = requestBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() throws IOException { - return requestBody.contentLength(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink bufferedSink = Okio.buffer(sink(sink)); - requestBody.writeTo(bufferedSink); - bufferedSink.flush(); - } - - private Sink sink(Sink sink) { - return new ForwardingSink(sink) { - long bytesWritten = 0L; - long contentLength = 0L; - - @Override - public void write(Buffer source, long byteCount) throws IOException { - super.write(source, byteCount); - if (contentLength == 0) { - contentLength = contentLength(); - } - - bytesWritten += byteCount; - callback.onUploadProgress( - bytesWritten, - contentLength, - bytesWritten == contentLength - ); - } - }; - } -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ProgressResponseBody.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ProgressResponseBody.java deleted file mode 100644 index d5f13aa6e..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ProgressResponseBody.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.algolia; - -import java.io.IOException; -import okhttp3.MediaType; -import okhttp3.ResponseBody; -import okio.Buffer; -import okio.BufferedSource; -import okio.ForwardingSource; -import okio.Okio; -import okio.Source; - -public class ProgressResponseBody extends ResponseBody { - - private final ResponseBody responseBody; - private final ApiCallback callback; - private BufferedSource bufferedSource; - - public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { - this.responseBody = responseBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return responseBody.contentType(); - } - - @Override - public long contentLength() { - return responseBody.contentLength(); - } - - @Override - public BufferedSource source() { - if (bufferedSource == null) { - bufferedSource = Okio.buffer(source(responseBody.source())); - } - return bufferedSource; - } - - private Source source(Source source) { - return new ForwardingSource(source) { - long totalBytesRead = 0L; - - @Override - public long read(Buffer sink, long byteCount) throws IOException { - long bytesRead = super.read(sink, byteCount); - // read() returns the number of bytes read, or -1 if this source is exhausted. - totalBytesRead += bytesRead != -1 ? bytesRead : 0; - callback.onDownloadProgress( - totalBytesRead, - responseBody.contentLength(), - bytesRead == -1 - ); - return bytesRead; - } - }; - } -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java deleted file mode 100644 index 69c5a46d6..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java +++ /dev/null @@ -1,6737 +0,0 @@ -package com.algolia.search; - -import com.algolia.ApiCallback; -import com.algolia.ApiClient; -import com.algolia.ApiResponse; -import com.algolia.Pair; -import com.algolia.exceptions.*; -import com.algolia.model.search.*; -import com.algolia.utils.*; -import com.algolia.utils.echo.*; -import com.algolia.utils.retry.CallType; -import com.algolia.utils.retry.StatefulHost; -import com.google.gson.reflect.TypeToken; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.Collections; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import okhttp3.Call; - -public class SearchApi extends ApiClient { - - public SearchApi(String appId, String apiKey) { - super(appId, apiKey, new HttpRequester(getDefaultHosts(appId))); - } - - public SearchApi(String appId, String apiKey, Requester requester) { - super(appId, apiKey, requester); - } - - private static List getDefaultHosts(String appId) { - List hosts = new ArrayList(); - hosts.add( - new StatefulHost( - appId + "-dsn.algolia.net", - "https", - EnumSet.of(CallType.READ) - ) - ); - hosts.add( - new StatefulHost( - appId + ".algolia.net", - "https", - EnumSet.of(CallType.WRITE) - ) - ); - - List commonHosts = new ArrayList(); - hosts.add( - new StatefulHost( - appId + "-1.algolianet.net", - "https", - EnumSet.of(CallType.READ, CallType.WRITE) - ) - ); - hosts.add( - new StatefulHost( - appId + "-2.algolianet.net", - "https", - EnumSet.of(CallType.READ, CallType.WRITE) - ) - ); - hosts.add( - new StatefulHost( - appId + "-3.algolianet.net", - "https", - EnumSet.of(CallType.READ, CallType.WRITE) - ) - ); - - Collections.shuffle(commonHosts, new Random()); - - return Stream - .concat(hosts.stream(), commonHosts.stream()) - .collect(Collectors.toList()); - } - - /** - * Build call for addApiKey - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call addApiKeyCall( - ApiKey apiKey, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = apiKey; - - // create path and map variables - String requestPath = "/1/keys"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call addApiKeyValidateBeforeCall( - ApiKey apiKey, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'apiKey' is set - if (apiKey == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'apiKey' when calling addApiKey(Async)" - ); - } - - return addApiKeyCall(apiKey, _callback); - } - - /** - * Add a new API Key with specific permissions/restrictions. - * - * @param apiKey (required) - * @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) - throws AlgoliaRuntimeException { - Call req = addApiKeyValidateBeforeCall(apiKey, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.AddApiKey(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Add a new API Key with specific permissions/restrictions. - * - * @param apiKey (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call addApiKeyAsync( - ApiKey apiKey, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = addApiKeyValidateBeforeCall(apiKey, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for addOrUpdateObject - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call addOrUpdateObjectCall( - String indexName, - String objectID, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = body; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "PUT", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call addOrUpdateObjectValidateBeforeCall( - String indexName, - String objectID, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling addOrUpdateObject(Async)" - ); - } - - // verify the required parameter 'objectID' is set - if (objectID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'objectID' when calling addOrUpdateObject(Async)" - ); - } - - // verify the required parameter 'body' is set - if (body == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'body' when calling addOrUpdateObject(Async)" - ); - } - - return addOrUpdateObjectCall(indexName, objectID, body, _callback); - } - - /** - * 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. - * - * @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) - * @return UpdatedAtWithObjectIdResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public UpdatedAtWithObjectIdResponse addOrUpdateObject( - String indexName, - String objectID, - Object body - ) throws AlgoliaRuntimeException { - Call req = addOrUpdateObjectValidateBeforeCall( - indexName, - objectID, - body, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.AddOrUpdateObject( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {} - .getType(); - ApiResponse res = - this.execute(call, returnType); - return res.getData(); - } - - /** - * (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. - * - * @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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call addOrUpdateObjectAsync( - String indexName, - String objectID, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = addOrUpdateObjectValidateBeforeCall( - indexName, - objectID, - body, - _callback - ); - Type returnType = new TypeToken() {} - .getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for appendSource - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call appendSourceCall( - Source source, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = source; - - // create path and map variables - String requestPath = "/1/security/sources/append"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call appendSourceValidateBeforeCall( - Source source, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'source' is set - if (source == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'source' when calling appendSource(Async)" - ); - } - - return appendSourceCall(source, _callback); - } - - /** - * Add a single source to the list of allowed sources. - * - * @param source The source to add. (required) - * @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) - throws AlgoliaRuntimeException { - Call req = appendSourceValidateBeforeCall(source, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.AppendSource( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Add a single source to the list of allowed sources. - * - * @param source The source to add. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call appendSourceAsync( - Source source, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = appendSourceValidateBeforeCall(source, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for assignUserId - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call assignUserIdCall( - String xAlgoliaUserID, - AssignUserIdParams assignUserIdParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = assignUserIdParams; - - // create path and map variables - String requestPath = "/1/clusters/mapping"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (xAlgoliaUserID != null) { - queryParams.addAll( - this.parameterToPair("X-Algolia-User-ID", xAlgoliaUserID) - ); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call assignUserIdValidateBeforeCall( - String xAlgoliaUserID, - AssignUserIdParams assignUserIdParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'xAlgoliaUserID' is set - if (xAlgoliaUserID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'xAlgoliaUserID' when calling assignUserId(Async)" - ); - } - - // verify the required parameter 'assignUserIdParams' is set - if (assignUserIdParams == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'assignUserIdParams' when calling assignUserId(Async)" - ); - } - - return assignUserIdCall(xAlgoliaUserID, assignUserIdParams, _callback); - } - - /** - * 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. - * A successful response indicates that the operation has been taken into account, and the userID - * is directly usable. - * - * @param xAlgoliaUserID userID to assign. (required) - * @param assignUserIdParams (required) - * @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 - ) throws AlgoliaRuntimeException { - Call req = assignUserIdValidateBeforeCall( - xAlgoliaUserID, - assignUserIdParams, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.AssignUserId( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (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 - * 200 OK. A successful response indicates that the operation has been taken into account, and the - * userID is directly usable. - * - * @param xAlgoliaUserID userID to assign. (required) - * @param assignUserIdParams (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call assignUserIdAsync( - String xAlgoliaUserID, - AssignUserIdParams assignUserIdParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = assignUserIdValidateBeforeCall( - xAlgoliaUserID, - assignUserIdParams, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for batch - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call batchCall( - String indexName, - BatchWriteParams batchWriteParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = batchWriteParams; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/batch".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call batchValidateBeforeCall( - String indexName, - BatchWriteParams batchWriteParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling batch(Async)" - ); - } - - // verify the required parameter 'batchWriteParams' is set - if (batchWriteParams == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'batchWriteParams' when calling batch(Async)" - ); - } - - return batchCall(indexName, batchWriteParams, _callback); - } - - /** - * Performs multiple write operations in a single API call. - * - * @param indexName The index in which to perform the request. (required) - * @param batchWriteParams (required) - * @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 - ) throws AlgoliaRuntimeException { - Call req = batchValidateBeforeCall(indexName, batchWriteParams, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.Batch(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Performs multiple write operations in a single API call. - * - * @param indexName The index in which to perform the request. (required) - * @param batchWriteParams (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call batchAsync( - String indexName, - BatchWriteParams batchWriteParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = batchValidateBeforeCall(indexName, batchWriteParams, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for batchAssignUserIds - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call batchAssignUserIdsCall( - String xAlgoliaUserID, - BatchAssignUserIdsParams batchAssignUserIdsParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = batchAssignUserIdsParams; - - // create path and map variables - String requestPath = "/1/clusters/mapping/batch"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (xAlgoliaUserID != null) { - queryParams.addAll( - this.parameterToPair("X-Algolia-User-ID", xAlgoliaUserID) - ); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call batchAssignUserIdsValidateBeforeCall( - String xAlgoliaUserID, - BatchAssignUserIdsParams batchAssignUserIdsParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'xAlgoliaUserID' is set - if (xAlgoliaUserID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'xAlgoliaUserID' when calling batchAssignUserIds(Async)" - ); - } - - // verify the required parameter 'batchAssignUserIdsParams' is set - if (batchAssignUserIdsParams == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'batchAssignUserIdsParams' when calling" + - " batchAssignUserIds(Async)" - ); - } - - return batchAssignUserIdsCall( - xAlgoliaUserID, - batchAssignUserIdsParams, - _callback - ); - } - - /** - * 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 - * usable. - * - * @param xAlgoliaUserID userID to assign. (required) - * @param batchAssignUserIdsParams (required) - * @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 - ) throws AlgoliaRuntimeException { - Call req = batchAssignUserIdsValidateBeforeCall( - xAlgoliaUserID, - batchAssignUserIdsParams, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.BatchAssignUserIds( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (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 - * are directly usable. - * - * @param xAlgoliaUserID userID to assign. (required) - * @param batchAssignUserIdsParams (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call batchAssignUserIdsAsync( - String xAlgoliaUserID, - BatchAssignUserIdsParams batchAssignUserIdsParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = batchAssignUserIdsValidateBeforeCall( - xAlgoliaUserID, - batchAssignUserIdsParams, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for batchDictionaryEntries - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call batchDictionaryEntriesCall( - DictionaryType dictionaryName, - BatchDictionaryEntriesParams batchDictionaryEntriesParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = batchDictionaryEntriesParams; - - // create path and map variables - String requestPath = - "/1/dictionaries/{dictionaryName}/batch".replaceAll( - "\\{" + "dictionaryName" + "\\}", - this.escapeString(dictionaryName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call batchDictionaryEntriesValidateBeforeCall( - DictionaryType dictionaryName, - BatchDictionaryEntriesParams batchDictionaryEntriesParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'dictionaryName' is set - if (dictionaryName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'dictionaryName' when calling" + - " batchDictionaryEntries(Async)" - ); - } - - // verify the required parameter 'batchDictionaryEntriesParams' is set - if (batchDictionaryEntriesParams == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'batchDictionaryEntriesParams' when calling" + - " batchDictionaryEntries(Async)" - ); - } - - return batchDictionaryEntriesCall( - dictionaryName, - batchDictionaryEntriesParams, - _callback - ); - } - - /** - * Send a batch of dictionary entries. - * - * @param dictionaryName The dictionary to search in. (required) - * @param batchDictionaryEntriesParams (required) - * @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 - ) throws AlgoliaRuntimeException { - Call req = batchDictionaryEntriesValidateBeforeCall( - dictionaryName, - batchDictionaryEntriesParams, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.BatchDictionaryEntries( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Send a batch of dictionary entries. - * - * @param dictionaryName The dictionary to search in. (required) - * @param batchDictionaryEntriesParams (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call batchDictionaryEntriesAsync( - DictionaryType dictionaryName, - BatchDictionaryEntriesParams batchDictionaryEntriesParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = batchDictionaryEntriesValidateBeforeCall( - dictionaryName, - batchDictionaryEntriesParams, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for batchRules - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call batchRulesCall( - String indexName, - List rule, - Boolean forwardToReplicas, - Boolean clearExistingRules, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = rule; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/rules/batch".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (forwardToReplicas != null) { - queryParams.addAll( - this.parameterToPair("forwardToReplicas", forwardToReplicas) - ); - } - - if (clearExistingRules != null) { - queryParams.addAll( - this.parameterToPair("clearExistingRules", clearExistingRules) - ); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call batchRulesValidateBeforeCall( - String indexName, - List rule, - Boolean forwardToReplicas, - Boolean clearExistingRules, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling batchRules(Async)" - ); - } - - // verify the required parameter 'rule' is set - if (rule == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'rule' when calling batchRules(Async)" - ); - } - - return batchRulesCall( - indexName, - rule, - forwardToReplicas, - clearExistingRules, - _callback - ); - } - - /** - * Create or update a batch of Rules. - * - * @param indexName The index in which to perform the request. (required) - * @param rule (required) - * @param forwardToReplicas When true, changes are also propagated to replicas of the given - * indexName. (optional) - * @param clearExistingRules When true, existing Rules are cleared before adding this batch. When - * false, existing Rules are kept. (optional) - * @return UpdatedAtResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public UpdatedAtResponse batchRules( - String indexName, - List rule, - Boolean forwardToReplicas, - Boolean clearExistingRules - ) throws AlgoliaRuntimeException { - Call req = batchRulesValidateBeforeCall( - indexName, - rule, - forwardToReplicas, - clearExistingRules, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.BatchRules(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public UpdatedAtResponse batchRules(String indexName, List rule) - throws AlgoliaRuntimeException { - return this.batchRules(indexName, rule, null, null); - } - - /** - * (asynchronously) Create or update a batch of Rules. - * - * @param indexName The index in which to perform the request. (required) - * @param rule (required) - * @param forwardToReplicas When true, changes are also propagated to replicas of the given - * indexName. (optional) - * @param clearExistingRules When true, existing Rules are cleared before adding this batch. When - * false, existing Rules are kept. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call batchRulesAsync( - String indexName, - List rule, - Boolean forwardToReplicas, - Boolean clearExistingRules, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = batchRulesValidateBeforeCall( - indexName, - rule, - forwardToReplicas, - clearExistingRules, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for browse - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call browseCall( - String indexName, - BrowseRequest browseRequest, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = browseRequest; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/browse".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call browseValidateBeforeCall( - String indexName, - BrowseRequest browseRequest, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling browse(Async)" - ); - } - - return browseCall(indexName, browseRequest, _callback); - } - - /** - * 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 - * supported, including `distinct`, sorting by `typos`, `words` or `geo distance`. When there is - * more content to be browsed, the response contains a cursor field. This cursor has to be passed - * to the subsequent call to browse in order to get the next page of results. When the end of the - * index has been reached, the cursor field is absent from the response. - * - * @param indexName The index in which to perform the request. (required) - * @param browseRequest (optional) - * @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) - throws AlgoliaRuntimeException { - Call req = browseValidateBeforeCall(indexName, browseRequest, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.Browse(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public BrowseResponse browse(String indexName) - throws AlgoliaRuntimeException { - return this.browse(indexName, null); - } - - /** - * (asynchronously) 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 supported, including `distinct`, sorting by `typos`, - * `words` or `geo distance`. When there is more content to be browsed, the - * response contains a cursor field. This cursor has to be passed to the subsequent call to browse - * in order to get the next page of results. When the end of the index has been reached, the - * cursor field is absent from the response. - * - * @param indexName The index in which to perform the request. (required) - * @param browseRequest (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call browseAsync( - String indexName, - BrowseRequest browseRequest, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = browseValidateBeforeCall(indexName, browseRequest, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for clearAllSynonyms - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call clearAllSynonymsCall( - String indexName, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/synonyms/clear".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (forwardToReplicas != null) { - queryParams.addAll( - this.parameterToPair("forwardToReplicas", forwardToReplicas) - ); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call clearAllSynonymsValidateBeforeCall( - String indexName, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling clearAllSynonyms(Async)" - ); - } - - return clearAllSynonymsCall(indexName, forwardToReplicas, _callback); - } - - /** - * 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) - * @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 - ) throws AlgoliaRuntimeException { - Call req = clearAllSynonymsValidateBeforeCall( - indexName, - forwardToReplicas, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.ClearAllSynonyms( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public UpdatedAtResponse clearAllSynonyms(String indexName) - throws AlgoliaRuntimeException { - return this.clearAllSynonyms(indexName, null); - } - - /** - * (asynchronously) 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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call clearAllSynonymsAsync( - String indexName, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = clearAllSynonymsValidateBeforeCall( - indexName, - forwardToReplicas, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for clearObjects - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call clearObjectsCall( - String indexName, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/clear".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call clearObjectsValidateBeforeCall( - String indexName, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling clearObjects(Async)" - ); - } - - return clearObjectsCall(indexName, _callback); - } - - /** - * 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) - * @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) - throws AlgoliaRuntimeException { - Call req = clearObjectsValidateBeforeCall(indexName, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.ClearObjects( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) 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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call clearObjectsAsync( - String indexName, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = clearObjectsValidateBeforeCall(indexName, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for clearRules - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call clearRulesCall( - String indexName, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/rules/clear".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (forwardToReplicas != null) { - queryParams.addAll( - this.parameterToPair("forwardToReplicas", forwardToReplicas) - ); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call clearRulesValidateBeforeCall( - String indexName, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling clearRules(Async)" - ); - } - - return clearRulesCall(indexName, forwardToReplicas, _callback); - } - - /** - * 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) - * @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 - ) throws AlgoliaRuntimeException { - Call req = clearRulesValidateBeforeCall(indexName, forwardToReplicas, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.ClearRules(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public UpdatedAtResponse clearRules(String indexName) - throws AlgoliaRuntimeException { - return this.clearRules(indexName, null); - } - - /** - * (asynchronously) 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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call clearRulesAsync( - String indexName, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = clearRulesValidateBeforeCall( - indexName, - forwardToReplicas, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for del - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call delCall( - String path, - String parameters, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = body; - - // create path and map variables - String requestPath = - "/1{path}".replaceAll( - "\\{" + "path" + "\\}", - this.escapeString(path.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (parameters != null) { - queryParams.addAll(this.parameterToPair("parameters", parameters)); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "DELETE", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call delValidateBeforeCall( - String path, - String parameters, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'path' is set - if (path == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'path' when calling del(Async)" - ); - } - - return delCall(path, parameters, body, _callback); - } - - /** - * 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 URL-encoded query string. Force some query parameters to be applied for each - * query made with this API key. (optional) - * @param body The parameters to send with the custom request. (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, String parameters, Object body) - throws AlgoliaRuntimeException { - Call req = delValidateBeforeCall(path, parameters, body, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.Del(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public Object del(String path) throws AlgoliaRuntimeException { - return this.del(path, null, null); - } - - /** - * (asynchronously) 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 URL-encoded query string. Force some query parameters to be applied for each - * query made with this API key. (optional) - * @param body The parameters to send with the custom request. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call delAsync( - String path, - String parameters, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = delValidateBeforeCall(path, parameters, body, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for deleteApiKey - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call deleteApiKeyCall( - String key, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/keys/{key}".replaceAll( - "\\{" + "key" + "\\}", - this.escapeString(key.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "DELETE", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call deleteApiKeyValidateBeforeCall( - String key, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'key' is set - if (key == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'key' when calling deleteApiKey(Async)" - ); - } - - return deleteApiKeyCall(key, _callback); - } - - /** - * Delete an existing API Key. - * - * @param key API Key string. (required) - * @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) - throws AlgoliaRuntimeException { - Call req = deleteApiKeyValidateBeforeCall(key, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.DeleteApiKey( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Delete an existing API Key. - * - * @param key API Key string. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call deleteApiKeyAsync( - String key, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = deleteApiKeyValidateBeforeCall(key, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for deleteBy - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call deleteByCall( - String indexName, - SearchParams searchParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = searchParams; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/deleteByQuery".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call deleteByValidateBeforeCall( - String indexName, - SearchParams searchParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling deleteBy(Async)" - ); - } - - // verify the required parameter 'searchParams' is set - if (searchParams == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'searchParams' when calling deleteBy(Async)" - ); - } - - return deleteByCall(indexName, searchParams, _callback); - } - - /** - * 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 - * empty filters or a query. - * - * @param indexName The index in which to perform the request. (required) - * @param searchParams (required) - * @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 - ) throws AlgoliaRuntimeException { - Call req = deleteByValidateBeforeCall(indexName, searchParams, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.DeleteBy(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) 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 empty filters or a query. - * - * @param indexName The index in which to perform the request. (required) - * @param searchParams (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call deleteByAsync( - String indexName, - SearchParams searchParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = deleteByValidateBeforeCall(indexName, searchParams, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for deleteIndex - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call deleteIndexCall( - String indexName, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "DELETE", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call deleteIndexValidateBeforeCall( - String indexName, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling deleteIndex(Async)" - ); - } - - return deleteIndexCall(indexName, _callback); - } - - /** - * Delete an existing index. - * - * @param indexName The index in which to perform the request. (required) - * @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) - throws AlgoliaRuntimeException { - Call req = deleteIndexValidateBeforeCall(indexName, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.DeleteIndex( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Delete an existing index. - * - * @param indexName The index in which to perform the request. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call deleteIndexAsync( - String indexName, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = deleteIndexValidateBeforeCall(indexName, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for deleteObject - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call deleteObjectCall( - String indexName, - String objectID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "DELETE", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call deleteObjectValidateBeforeCall( - String indexName, - String objectID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling deleteObject(Async)" - ); - } - - // verify the required parameter 'objectID' is set - if (objectID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'objectID' when calling deleteObject(Async)" - ); - } - - return deleteObjectCall(indexName, objectID, _callback); - } - - /** - * Delete an existing object. - * - * @param indexName The index in which to perform the request. (required) - * @param objectID Unique identifier of an object. (required) - * @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) - throws AlgoliaRuntimeException { - Call req = deleteObjectValidateBeforeCall(indexName, objectID, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.DeleteObject( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Delete an existing object. - * - * @param indexName The index in which to perform the request. (required) - * @param objectID Unique identifier of an object. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call deleteObjectAsync( - String indexName, - String objectID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = deleteObjectValidateBeforeCall(indexName, objectID, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for deleteRule - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call deleteRuleCall( - String indexName, - String objectID, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/rules/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (forwardToReplicas != null) { - queryParams.addAll( - this.parameterToPair("forwardToReplicas", forwardToReplicas) - ); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "DELETE", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call deleteRuleValidateBeforeCall( - String indexName, - String objectID, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling deleteRule(Async)" - ); - } - - // verify the required parameter 'objectID' is set - if (objectID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'objectID' when calling deleteRule(Async)" - ); - } - - return deleteRuleCall(indexName, objectID, forwardToReplicas, _callback); - } - - /** - * Delete 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 forwardToReplicas When true, changes are also propagated to replicas of the given - * indexName. (optional) - * @return UpdatedAtResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public UpdatedAtResponse deleteRule( - String indexName, - String objectID, - Boolean forwardToReplicas - ) throws AlgoliaRuntimeException { - Call req = deleteRuleValidateBeforeCall( - indexName, - objectID, - forwardToReplicas, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.DeleteRule(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public UpdatedAtResponse deleteRule(String indexName, String objectID) - throws AlgoliaRuntimeException { - return this.deleteRule(indexName, objectID, null); - } - - /** - * (asynchronously) Delete 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 forwardToReplicas When true, changes are also propagated to replicas of the given - * indexName. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call deleteRuleAsync( - String indexName, - String objectID, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = deleteRuleValidateBeforeCall( - indexName, - objectID, - forwardToReplicas, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for deleteSource - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call deleteSourceCall( - String source, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/security/sources/{source}".replaceAll( - "\\{" + "source" + "\\}", - this.escapeString(source.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "DELETE", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call deleteSourceValidateBeforeCall( - String source, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'source' is set - if (source == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'source' when calling deleteSource(Async)" - ); - } - - return deleteSourceCall(source, _callback); - } - - /** - * Remove a single source from the list of allowed sources. - * - * @param source The IP range of the source. (required) - * @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) - throws AlgoliaRuntimeException { - Call req = deleteSourceValidateBeforeCall(source, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.DeleteSource( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Remove a single source from the list of allowed sources. - * - * @param source The IP range of the source. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call deleteSourceAsync( - String source, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = deleteSourceValidateBeforeCall(source, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for deleteSynonym - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call deleteSynonymCall( - String indexName, - String objectID, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/synonyms/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (forwardToReplicas != null) { - queryParams.addAll( - this.parameterToPair("forwardToReplicas", forwardToReplicas) - ); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "DELETE", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call deleteSynonymValidateBeforeCall( - String indexName, - String objectID, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling deleteSynonym(Async)" - ); - } - - // verify the required parameter 'objectID' is set - if (objectID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'objectID' when calling deleteSynonym(Async)" - ); - } - - return deleteSynonymCall(indexName, objectID, forwardToReplicas, _callback); - } - - /** - * Delete a single synonyms set, identified by the given objectID. - * - * @param indexName The index in which to perform the request. (required) - * @param objectID Unique identifier of an object. (required) - * @param forwardToReplicas When true, changes are also propagated to replicas of the given - * indexName. (optional) - * @return DeletedAtResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public DeletedAtResponse deleteSynonym( - String indexName, - String objectID, - Boolean forwardToReplicas - ) throws AlgoliaRuntimeException { - Call req = deleteSynonymValidateBeforeCall( - indexName, - objectID, - forwardToReplicas, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.DeleteSynonym( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public DeletedAtResponse deleteSynonym(String indexName, String objectID) - throws AlgoliaRuntimeException { - return this.deleteSynonym(indexName, objectID, null); - } - - /** - * (asynchronously) Delete a single synonyms set, identified by the given objectID. - * - * @param indexName The index in which to perform the request. (required) - * @param objectID Unique identifier of an object. (required) - * @param forwardToReplicas When true, changes are also propagated to replicas of the given - * indexName. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call deleteSynonymAsync( - String indexName, - String objectID, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = deleteSynonymValidateBeforeCall( - indexName, - objectID, - forwardToReplicas, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for get - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call getCall( - String path, - String parameters, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1{path}".replaceAll( - "\\{" + "path" + "\\}", - this.escapeString(path.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (parameters != null) { - queryParams.addAll(this.parameterToPair("parameters", parameters)); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call getValidateBeforeCall( - String path, - String parameters, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'path' is set - if (path == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'path' when calling get(Async)" - ); - } - - return getCall(path, parameters, _callback); - } - - /** - * 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 URL-encoded query string. Force some query parameters to be applied for each - * query made with this API key. (optional) - * @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, String parameters) - throws AlgoliaRuntimeException { - Call req = getValidateBeforeCall(path, parameters, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.Get(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public Object get(String path) throws AlgoliaRuntimeException { - return this.get(path, null); - } - - /** - * (asynchronously) 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 URL-encoded query string. Force some query parameters to be applied for each - * query made with this API key. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call getAsync( - String path, - String parameters, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = getValidateBeforeCall(path, parameters, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for getApiKey - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call getApiKeyCall(String key, final ApiCallback _callback) - throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/keys/{key}".replaceAll( - "\\{" + "key" + "\\}", - this.escapeString(key.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call getApiKeyValidateBeforeCall( - String key, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'key' is set - if (key == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'key' when calling getApiKey(Async)" - ); - } - - return getApiKeyCall(key, _callback); - } - - /** - * Get the permissions of an API key. - * - * @param key API Key string. (required) - * @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) throws AlgoliaRuntimeException { - Call req = getApiKeyValidateBeforeCall(key, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.GetApiKey(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Get the permissions of an API key. - * - * @param key API Key string. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call getApiKeyAsync(String key, final ApiCallback _callback) - throws AlgoliaRuntimeException { - Call call = getApiKeyValidateBeforeCall(key, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for getDictionaryLanguages - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call getDictionaryLanguagesCall( - final ApiCallback> _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = "/1/dictionaries/*/languages"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call getDictionaryLanguagesValidateBeforeCall( - final ApiCallback> _callback - ) throws AlgoliaRuntimeException { - return getDictionaryLanguagesCall(_callback); - } - - /** - * List dictionaries supported per language. - * - * @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() - throws AlgoliaRuntimeException { - Call req = getDictionaryLanguagesValidateBeforeCall(null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.GetDictionaryLanguages( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken>() {}.getType(); - ApiResponse> res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) List dictionaries supported per language. - * - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call getDictionaryLanguagesAsync( - final ApiCallback> _callback - ) throws AlgoliaRuntimeException { - Call call = getDictionaryLanguagesValidateBeforeCall(_callback); - Type returnType = new TypeToken>() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for getDictionarySettings - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call getDictionarySettingsCall( - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = "/1/dictionaries/*/settings"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call getDictionarySettingsValidateBeforeCall( - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - return getDictionarySettingsCall(_callback); - } - - /** - * Retrieve dictionaries settings. - * - * @return GetDictionarySettingsResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public GetDictionarySettingsResponse getDictionarySettings() - throws AlgoliaRuntimeException { - Call req = getDictionarySettingsValidateBeforeCall(null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.GetDictionarySettings( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {} - .getType(); - ApiResponse res = - this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Retrieve dictionaries settings. - * - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call getDictionarySettingsAsync( - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = getDictionarySettingsValidateBeforeCall(_callback); - Type returnType = new TypeToken() {} - .getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for getLogs - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call getLogsCall( - Integer offset, - Integer length, - String indexName, - LogType type, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = "/1/logs"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (offset != null) { - queryParams.addAll(this.parameterToPair("offset", offset)); - } - - if (length != null) { - queryParams.addAll(this.parameterToPair("length", length)); - } - - if (indexName != null) { - queryParams.addAll(this.parameterToPair("indexName", indexName)); - } - - if (type != null) { - queryParams.addAll(this.parameterToPair("type", type)); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call getLogsValidateBeforeCall( - Integer offset, - Integer length, - String indexName, - LogType type, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - return getLogsCall(offset, length, indexName, type, _callback); - } - - /** - * Return the lastest log entries. - * - * @param offset First entry to retrieve (zero-based). Log entries are sorted by decreasing date, - * therefore 0 designates the most recent log entry. (optional, default to 0) - * @param length Maximum number of entries to retrieve. The maximum allowed value is 1000. - * (optional, default to 10) - * @param indexName Index for which log entries should be retrieved. When omitted, log entries are - * retrieved across all indices. (optional) - * @param type Type of log entries to retrieve. When omitted, all log entries are retrieved. - * (optional, default to all) - * @return GetLogsResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public GetLogsResponse getLogs( - Integer offset, - Integer length, - String indexName, - LogType type - ) throws AlgoliaRuntimeException { - Call req = getLogsValidateBeforeCall(offset, length, indexName, type, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.GetLogs(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public GetLogsResponse getLogs() throws AlgoliaRuntimeException { - return this.getLogs(0, 10, null, LogType.ALL); - } - - /** - * (asynchronously) Return the lastest log entries. - * - * @param offset First entry to retrieve (zero-based). Log entries are sorted by decreasing date, - * therefore 0 designates the most recent log entry. (optional, default to 0) - * @param length Maximum number of entries to retrieve. The maximum allowed value is 1000. - * (optional, default to 10) - * @param indexName Index for which log entries should be retrieved. When omitted, log entries are - * 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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call getLogsAsync( - Integer offset, - Integer length, - String indexName, - LogType type, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = getLogsValidateBeforeCall( - offset, - length, - indexName, - type, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for getObject - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call getObjectCall( - String indexName, - String objectID, - List attributesToRetrieve, - final ApiCallback> _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (attributesToRetrieve != null) { - queryParams.addAll( - this.parameterToPair("attributesToRetrieve", attributesToRetrieve) - ); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call getObjectValidateBeforeCall( - String indexName, - String objectID, - List attributesToRetrieve, - final ApiCallback> _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling getObject(Async)" - ); - } - - // verify the required parameter 'objectID' is set - if (objectID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'objectID' when calling getObject(Async)" - ); - } - - return getObjectCall(indexName, objectID, attributesToRetrieve, _callback); - } - - /** - * Retrieve one object from the index. - * - * @param indexName The index in which to perform the request. (required) - * @param objectID Unique identifier of an object. (required) - * @param attributesToRetrieve List of attributes to retrieve. If not specified, all retrievable - * attributes are returned. (optional) - * @return Map<String, String> - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public Map getObject( - String indexName, - String objectID, - List attributesToRetrieve - ) throws AlgoliaRuntimeException { - Call req = getObjectValidateBeforeCall( - indexName, - objectID, - attributesToRetrieve, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.GetObject(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken>() {}.getType(); - ApiResponse> res = this.execute(call, returnType); - return res.getData(); - } - - public Map getObject(String indexName, String objectID) - throws AlgoliaRuntimeException { - return this.getObject(indexName, objectID, new ArrayList<>()); - } - - /** - * (asynchronously) Retrieve one object from the index. - * - * @param indexName The index in which to perform the request. (required) - * @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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call getObjectAsync( - String indexName, - String objectID, - List attributesToRetrieve, - final ApiCallback> _callback - ) throws AlgoliaRuntimeException { - Call call = getObjectValidateBeforeCall( - indexName, - objectID, - attributesToRetrieve, - _callback - ); - Type returnType = new TypeToken>() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for getObjects - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call getObjectsCall( - GetObjectsParams getObjectsParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = getObjectsParams; - - // create path and map variables - String requestPath = "/1/indexes/*/objects"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call getObjectsValidateBeforeCall( - GetObjectsParams getObjectsParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'getObjectsParams' is set - if (getObjectsParams == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'getObjectsParams' when calling getObjects(Async)" - ); - } - - return getObjectsCall(getObjectsParams, _callback); - } - - /** - * Retrieve one or more objects, potentially from different indices, in a single API call. - * - * @param getObjectsParams (required) - * @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) - throws AlgoliaRuntimeException { - Call req = getObjectsValidateBeforeCall(getObjectsParams, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.GetObjects(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Retrieve one or more objects, potentially from different indices, in a single - * API call. - * - * @param getObjectsParams (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call getObjectsAsync( - GetObjectsParams getObjectsParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = getObjectsValidateBeforeCall(getObjectsParams, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for getRule - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call getRuleCall( - String indexName, - String objectID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/rules/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call getRuleValidateBeforeCall( - String indexName, - String objectID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling getRule(Async)" - ); - } - - // verify the required parameter 'objectID' is set - if (objectID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'objectID' when calling getRule(Async)" - ); - } - - return getRuleCall(indexName, objectID, _callback); - } - - /** - * 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) - * @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) - throws AlgoliaRuntimeException { - Call req = getRuleValidateBeforeCall(indexName, objectID, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.GetRule(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) 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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call getRuleAsync( - String indexName, - String objectID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = getRuleValidateBeforeCall(indexName, objectID, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for getSettings - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call getSettingsCall( - String indexName, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/settings".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call getSettingsValidateBeforeCall( - String indexName, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling getSettings(Async)" - ); - } - - return getSettingsCall(indexName, _callback); - } - - /** - * Retrieve settings of a given indexName. - * - * @param indexName The index in which to perform the request. (required) - * @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) - throws AlgoliaRuntimeException { - Call req = getSettingsValidateBeforeCall(indexName, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.GetSettings( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Retrieve settings of a given indexName. - * - * @param indexName The index in which to perform the request. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call getSettingsAsync( - String indexName, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = getSettingsValidateBeforeCall(indexName, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for getSources - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call getSourcesCall(final ApiCallback> _callback) - throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = "/1/security/sources"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call getSourcesValidateBeforeCall( - final ApiCallback> _callback - ) throws AlgoliaRuntimeException { - return getSourcesCall(_callback); - } - - /** - * List all allowed sources. - * - * @return List<Source> - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public List getSources() throws AlgoliaRuntimeException { - Call req = getSourcesValidateBeforeCall(null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.GetSources(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken>() {}.getType(); - ApiResponse> res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) List all allowed sources. - * - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call getSourcesAsync(final ApiCallback> _callback) - throws AlgoliaRuntimeException { - Call call = getSourcesValidateBeforeCall(_callback); - Type returnType = new TypeToken>() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for getSynonym - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call getSynonymCall( - String indexName, - String objectID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/synonyms/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call getSynonymValidateBeforeCall( - String indexName, - String objectID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling getSynonym(Async)" - ); - } - - // verify the required parameter 'objectID' is set - if (objectID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'objectID' when calling getSynonym(Async)" - ); - } - - return getSynonymCall(indexName, objectID, _callback); - } - - /** - * 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) - * @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) - throws AlgoliaRuntimeException { - Call req = getSynonymValidateBeforeCall(indexName, objectID, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.GetSynonym(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) 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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call getSynonymAsync( - String indexName, - String objectID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = getSynonymValidateBeforeCall(indexName, objectID, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for getTask - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call getTaskCall( - String indexName, - Integer taskID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/task/{taskID}".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ) - .replaceAll( - "\\{" + "taskID" + "\\}", - this.escapeString(taskID.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call getTaskValidateBeforeCall( - String indexName, - Integer taskID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling getTask(Async)" - ); - } - - // verify the required parameter 'taskID' is set - if (taskID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'taskID' when calling getTask(Async)" - ); - } - - return getTaskCall(indexName, taskID, _callback); - } - - /** - * 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) - * @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) - throws AlgoliaRuntimeException { - Call req = getTaskValidateBeforeCall(indexName, taskID, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.GetTask(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) 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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call getTaskAsync( - String indexName, - Integer taskID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = getTaskValidateBeforeCall(indexName, taskID, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for getTopUserIds - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call getTopUserIdsCall( - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = "/1/clusters/mapping/top"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call getTopUserIdsValidateBeforeCall( - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - return getTopUserIdsCall(_callback); - } - - /** - * 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. - * - * @return GetTopUserIdsResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public GetTopUserIdsResponse getTopUserIds() throws AlgoliaRuntimeException { - Call req = getTopUserIdsValidateBeforeCall(null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.GetTopUserIds( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) 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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call getTopUserIdsAsync( - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = getTopUserIdsValidateBeforeCall(_callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for getUserId - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call getUserIdCall( - String userID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/clusters/mapping/{userID}".replaceAll( - "\\{" + "userID" + "\\}", - this.escapeString(userID.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call getUserIdValidateBeforeCall( - String userID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'userID' when calling getUserId(Async)" - ); - } - - return getUserIdCall(userID, _callback); - } - - /** - * 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 - * different clusters. Upon success, the response is 200 OK and contains the following userID - * data. - * - * @param userID userID to assign. (required) - * @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) throws AlgoliaRuntimeException { - Call req = getUserIdValidateBeforeCall(userID, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.GetUserId(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) 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 different clusters. Upon success, the response is 200 OK and contains the - * following userID data. - * - * @param userID userID to assign. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call getUserIdAsync( - String userID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = getUserIdValidateBeforeCall(userID, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for hasPendingMappings - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call hasPendingMappingsCall( - Boolean getClusters, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = "/1/clusters/mapping/pending"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (getClusters != null) { - queryParams.addAll(this.parameterToPair("getClusters", getClusters)); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call hasPendingMappingsValidateBeforeCall( - Boolean getClusters, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - return hasPendingMappingsCall(getClusters, _callback); - } - - /** - * 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 - * status of the migration, so you can know when it's done. Upon success, the response is 200 OK. - * A successful response indicates that the operation has been taken into account, and the userIDs - * are directly usable. - * - * @param getClusters Whether to get clusters or not. (optional) - * @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) - throws AlgoliaRuntimeException { - Call req = hasPendingMappingsValidateBeforeCall(getClusters, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.HasPendingMappings( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public CreatedAtResponse hasPendingMappings() throws AlgoliaRuntimeException { - return this.hasPendingMappings(null); - } - - /** - * (asynchronously) 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 status of the migration, so you can know when it's done. Upon success, the - * response is 200 OK. A successful response indicates that the operation has been taken into - * account, and the userIDs are directly usable. - * - * @param getClusters Whether to get clusters or not. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call hasPendingMappingsAsync( - Boolean getClusters, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = hasPendingMappingsValidateBeforeCall(getClusters, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for listApiKeys - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call listApiKeysCall( - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = "/1/keys"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call listApiKeysValidateBeforeCall( - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - return listApiKeysCall(_callback); - } - - /** - * List API keys, along with their associated rights. - * - * @return ListApiKeysResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public ListApiKeysResponse listApiKeys() throws AlgoliaRuntimeException { - Call req = listApiKeysValidateBeforeCall(null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.ListApiKeys( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) List API keys, along with their associated rights. - * - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call listApiKeysAsync( - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = listApiKeysValidateBeforeCall(_callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for listClusters - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call listClustersCall( - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = "/1/clusters"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call listClustersValidateBeforeCall( - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - return listClustersCall(_callback); - } - - /** - * 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. - * - * @return ListClustersResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public ListClustersResponse listClusters() throws AlgoliaRuntimeException { - Call req = listClustersValidateBeforeCall(null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.ListClusters( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call listClustersAsync( - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = listClustersValidateBeforeCall(_callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for listIndices - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call listIndicesCall( - Integer page, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = "/1/indexes"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (page != null) { - queryParams.addAll(this.parameterToPair("page", page)); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call listIndicesValidateBeforeCall( - Integer page, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - return listIndicesCall(page, _callback); - } - - /** - * 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) - * @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) - throws AlgoliaRuntimeException { - Call req = listIndicesValidateBeforeCall(page, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.ListIndices( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public ListIndicesResponse listIndices() throws AlgoliaRuntimeException { - return this.listIndices(null); - } - - /** - * (asynchronously) 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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call listIndicesAsync( - Integer page, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = listIndicesValidateBeforeCall(page, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for listUserIds - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call listUserIdsCall( - Integer page, - Integer hitsPerPage, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = "/1/clusters/mapping"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (page != null) { - queryParams.addAll(this.parameterToPair("page", page)); - } - - if (hitsPerPage != null) { - queryParams.addAll(this.parameterToPair("hitsPerPage", hitsPerPage)); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "GET", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call listUserIdsValidateBeforeCall( - Integer page, - Integer hitsPerPage, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - return listUserIdsCall(page, hitsPerPage, _callback); - } - - /** - * 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 - * different clusters. Upon success, the response is 200 OK and contains the following userIDs - * data. - * - * @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 hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) - * @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) - throws AlgoliaRuntimeException { - Call req = listUserIdsValidateBeforeCall(page, hitsPerPage, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.ListUserIds( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public ListUserIdsResponse listUserIds() throws AlgoliaRuntimeException { - return this.listUserIds(null, 100); - } - - /** - * (asynchronously) 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 different clusters. Upon success, the response is 200 OK and contains the - * following userIDs data. - * - * @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 hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call listUserIdsAsync( - Integer page, - Integer hitsPerPage, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = listUserIdsValidateBeforeCall(page, hitsPerPage, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for multipleBatch - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call multipleBatchCall( - BatchParams batchParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = batchParams; - - // create path and map variables - String requestPath = "/1/indexes/*/batch"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call multipleBatchValidateBeforeCall( - BatchParams batchParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'batchParams' is set - if (batchParams == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'batchParams' when calling multipleBatch(Async)" - ); - } - - return multipleBatchCall(batchParams, _callback); - } - - /** - * 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 { - Call req = multipleBatchValidateBeforeCall(batchParams, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.MultipleBatch( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Perform multiple write operations, potentially targeting multiple indices, in - * a single API call. - * - * @param batchParams (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call multipleBatchAsync( - BatchParams batchParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = multipleBatchValidateBeforeCall(batchParams, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for multipleQueries - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call multipleQueriesCall( - MultipleQueriesParams multipleQueriesParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = multipleQueriesParams; - - // create path and map variables - String requestPath = "/1/indexes/*/queries"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call multipleQueriesValidateBeforeCall( - MultipleQueriesParams multipleQueriesParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'multipleQueriesParams' is set - if (multipleQueriesParams == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'multipleQueriesParams' when calling" + - " multipleQueries(Async)" - ); - } - - return multipleQueriesCall(multipleQueriesParams, _callback); - } - - /** - * Get search results for the given requests. - * - * @param multipleQueriesParams (required) - * @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 - ) throws AlgoliaRuntimeException { - Call req = multipleQueriesValidateBeforeCall(multipleQueriesParams, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.MultipleQueries( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Get search results for the given requests. - * - * @param multipleQueriesParams (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call multipleQueriesAsync( - MultipleQueriesParams multipleQueriesParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = multipleQueriesValidateBeforeCall( - multipleQueriesParams, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for operationIndex - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call operationIndexCall( - String indexName, - OperationIndexParams operationIndexParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = operationIndexParams; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/operation".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call operationIndexValidateBeforeCall( - String indexName, - OperationIndexParams operationIndexParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling operationIndex(Async)" - ); - } - - // verify the required parameter 'operationIndexParams' is set - if (operationIndexParams == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'operationIndexParams' when calling" + - " operationIndex(Async)" - ); - } - - return operationIndexCall(indexName, operationIndexParams, _callback); - } - - /** - * Peforms a copy or a move operation on a index. - * - * @param indexName The index in which to perform the request. (required) - * @param operationIndexParams (required) - * @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 - ) throws AlgoliaRuntimeException { - Call req = operationIndexValidateBeforeCall( - indexName, - operationIndexParams, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.OperationIndex( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call operationIndexAsync( - String indexName, - OperationIndexParams operationIndexParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = operationIndexValidateBeforeCall( - indexName, - operationIndexParams, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for partialUpdateObject - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call partialUpdateObjectCall( - String indexName, - String objectID, - List> attributeOrBuiltInOperation, - Boolean createIfNotExists, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = attributeOrBuiltInOperation; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/{objectID}/partial".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (createIfNotExists != null) { - queryParams.addAll( - this.parameterToPair("createIfNotExists", createIfNotExists) - ); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call partialUpdateObjectValidateBeforeCall( - String indexName, - String objectID, - List> attributeOrBuiltInOperation, - Boolean createIfNotExists, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling partialUpdateObject(Async)" - ); - } - - // verify the required parameter 'objectID' is set - if (objectID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'objectID' when calling partialUpdateObject(Async)" - ); - } - - // verify the required parameter 'attributeOrBuiltInOperation' is set - if (attributeOrBuiltInOperation == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'attributeOrBuiltInOperation' when calling" + - " partialUpdateObject(Async)" - ); - } - - return partialUpdateObjectCall( - indexName, - objectID, - attributeOrBuiltInOperation, - createIfNotExists, - _callback - ); - } - - /** - * 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 - * partially update several objects in a single method call. If the index targeted by this - * operation doesn't exist yet, it's automatically created. - * - * @param indexName The index in which to perform the request. (required) - * @param objectID Unique identifier of an object. (required) - * @param attributeOrBuiltInOperation List of attributes to update. (required) - * @param createIfNotExists Creates the record if it does not exist yet. (optional, default to - * true) - * @return UpdatedAtWithObjectIdResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public UpdatedAtWithObjectIdResponse partialUpdateObject( - String indexName, - String objectID, - List> attributeOrBuiltInOperation, - Boolean createIfNotExists - ) throws AlgoliaRuntimeException { - Call req = partialUpdateObjectValidateBeforeCall( - indexName, - objectID, - attributeOrBuiltInOperation, - createIfNotExists, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.PartialUpdateObject( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {} - .getType(); - ApiResponse res = - this.execute(call, returnType); - return res.getData(); - } - - public UpdatedAtWithObjectIdResponse partialUpdateObject( - String indexName, - String objectID, - List> attributeOrBuiltInOperation - ) throws AlgoliaRuntimeException { - return this.partialUpdateObject( - indexName, - objectID, - attributeOrBuiltInOperation, - true - ); - } - - /** - * (asynchronously) 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 partially update several objects in a single method call. If the index targeted - * by this operation doesn't exist yet, it's automatically created. - * - * @param indexName The index in which to perform the request. (required) - * @param objectID Unique identifier of an object. (required) - * @param attributeOrBuiltInOperation List of attributes to update. (required) - * @param createIfNotExists Creates the record if it does not exist yet. (optional, default to - * true) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call partialUpdateObjectAsync( - String indexName, - String objectID, - List> attributeOrBuiltInOperation, - Boolean createIfNotExists, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = partialUpdateObjectValidateBeforeCall( - indexName, - objectID, - attributeOrBuiltInOperation, - createIfNotExists, - _callback - ); - Type returnType = new TypeToken() {} - .getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for post - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call postCall( - String path, - String parameters, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = body; - - // create path and map variables - String requestPath = - "/1{path}".replaceAll( - "\\{" + "path" + "\\}", - this.escapeString(path.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (parameters != null) { - queryParams.addAll(this.parameterToPair("parameters", parameters)); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call postValidateBeforeCall( - String path, - String parameters, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'path' is set - if (path == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'path' when calling post(Async)" - ); - } - - return postCall(path, parameters, body, _callback); - } - - /** - * 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 URL-encoded query string. Force some query parameters to be applied for each - * query made with this API key. (optional) - * @param body The parameters to send with the custom request. (optional) - * @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, String parameters, Object body) - throws AlgoliaRuntimeException { - Call req = postValidateBeforeCall(path, parameters, body, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.Post(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public Object post(String path) throws AlgoliaRuntimeException { - return this.post(path, null, null); - } - - /** - * (asynchronously) 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 URL-encoded query string. Force some query parameters to be applied for each - * query made with this API key. (optional) - * @param body The parameters to send with the custom request. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call postAsync( - String path, - String parameters, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = postValidateBeforeCall(path, parameters, body, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for put - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call putCall( - String path, - String parameters, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = body; - - // create path and map variables - String requestPath = - "/1{path}".replaceAll( - "\\{" + "path" + "\\}", - this.escapeString(path.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (parameters != null) { - queryParams.addAll(this.parameterToPair("parameters", parameters)); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "PUT", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call putValidateBeforeCall( - String path, - String parameters, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'path' is set - if (path == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'path' when calling put(Async)" - ); - } - - return putCall(path, parameters, body, _callback); - } - - /** - * 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 URL-encoded query string. Force some query parameters to be applied for each - * query made with this API key. (optional) - * @param body The parameters to send with the custom request. (optional) - * @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, String parameters, Object body) - throws AlgoliaRuntimeException { - Call req = putValidateBeforeCall(path, parameters, body, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.Put(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public Object put(String path) throws AlgoliaRuntimeException { - return this.put(path, null, null); - } - - /** - * (asynchronously) 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 URL-encoded query string. Force some query parameters to be applied for each - * query made with this API key. (optional) - * @param body The parameters to send with the custom request. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call putAsync( - String path, - String parameters, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = putValidateBeforeCall(path, parameters, body, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for removeUserId - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call removeUserIdCall( - String userID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/clusters/mapping/{userID}".replaceAll( - "\\{" + "userID" + "\\}", - this.escapeString(userID.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "DELETE", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call removeUserIdValidateBeforeCall( - String userID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'userID' when calling removeUserId(Async)" - ); - } - - return removeUserIdCall(userID, _callback); - } - - /** - * 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) - * @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) - throws AlgoliaRuntimeException { - Call req = removeUserIdValidateBeforeCall(userID, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.RemoveUserId( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) 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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call removeUserIdAsync( - String userID, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = removeUserIdValidateBeforeCall(userID, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for replaceSources - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call replaceSourcesCall( - List source, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = source; - - // create path and map variables - String requestPath = "/1/security/sources"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "PUT", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call replaceSourcesValidateBeforeCall( - List source, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'source' is set - if (source == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'source' when calling replaceSources(Async)" - ); - } - - return replaceSourcesCall(source, _callback); - } - - /** - * Replace all allowed sources. - * - * @param source The sources to allow. (required) - * @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) - throws AlgoliaRuntimeException { - Call req = replaceSourcesValidateBeforeCall(source, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.ReplaceSources( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Replace all allowed sources. - * - * @param source The sources to allow. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call replaceSourcesAsync( - List source, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = replaceSourcesValidateBeforeCall(source, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for restoreApiKey - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call restoreApiKeyCall( - String key, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/keys/{key}/restore".replaceAll( - "\\{" + "key" + "\\}", - this.escapeString(key.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call restoreApiKeyValidateBeforeCall( - String key, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'key' is set - if (key == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'key' when calling restoreApiKey(Async)" - ); - } - - return restoreApiKeyCall(key, _callback); - } - - /** - * Restore a deleted API key, along with its associated rights. - * - * @param key API Key string. (required) - * @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) - throws AlgoliaRuntimeException { - Call req = restoreApiKeyValidateBeforeCall(key, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.RestoreApiKey( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Restore a deleted API key, along with its associated rights. - * - * @param key API Key string. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call restoreApiKeyAsync( - String key, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = restoreApiKeyValidateBeforeCall(key, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for saveObject - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call saveObjectCall( - String indexName, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = body; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call saveObjectValidateBeforeCall( - String indexName, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling saveObject(Async)" - ); - } - - // verify the required parameter 'body' is set - if (body == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'body' when calling saveObject(Async)" - ); - } - - return saveObjectCall(indexName, body, _callback); - } - - /** - * 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) - * @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) - throws AlgoliaRuntimeException { - Call req = saveObjectValidateBeforeCall(indexName, body, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.SaveObject(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) 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 _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call saveObjectAsync( - String indexName, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = saveObjectValidateBeforeCall(indexName, body, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for saveRule - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call saveRuleCall( - String indexName, - String objectID, - Rule rule, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = rule; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/rules/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (forwardToReplicas != null) { - queryParams.addAll( - this.parameterToPair("forwardToReplicas", forwardToReplicas) - ); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "PUT", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call saveRuleValidateBeforeCall( - String indexName, - String objectID, - Rule rule, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling saveRule(Async)" - ); - } - - // verify the required parameter 'objectID' is set - if (objectID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'objectID' when calling saveRule(Async)" - ); - } - - // verify the required parameter 'rule' is set - if (rule == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'rule' when calling saveRule(Async)" - ); - } - - return saveRuleCall( - indexName, - objectID, - rule, - forwardToReplicas, - _callback - ); - } - - /** - * Create or update 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 rule (required) - * @param forwardToReplicas When true, changes are also propagated to replicas of the given - * indexName. (optional) - * @return UpdatedRuleResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public UpdatedRuleResponse saveRule( - String indexName, - String objectID, - Rule rule, - Boolean forwardToReplicas - ) throws AlgoliaRuntimeException { - Call req = saveRuleValidateBeforeCall( - indexName, - objectID, - rule, - forwardToReplicas, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.SaveRule(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public UpdatedRuleResponse saveRule( - String indexName, - String objectID, - Rule rule - ) throws AlgoliaRuntimeException { - return this.saveRule(indexName, objectID, rule, null); - } - - /** - * (asynchronously) Create or update 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 rule (required) - * @param forwardToReplicas When true, changes are also propagated to replicas of the given - * indexName. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call saveRuleAsync( - String indexName, - String objectID, - Rule rule, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = saveRuleValidateBeforeCall( - indexName, - objectID, - rule, - forwardToReplicas, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for saveSynonym - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call saveSynonymCall( - String indexName, - String objectID, - SynonymHit synonymHit, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = synonymHit; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/synonyms/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (forwardToReplicas != null) { - queryParams.addAll( - this.parameterToPair("forwardToReplicas", forwardToReplicas) - ); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "PUT", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call saveSynonymValidateBeforeCall( - String indexName, - String objectID, - SynonymHit synonymHit, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling saveSynonym(Async)" - ); - } - - // verify the required parameter 'objectID' is set - if (objectID == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'objectID' when calling saveSynonym(Async)" - ); - } - - // verify the required parameter 'synonymHit' is set - if (synonymHit == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'synonymHit' when calling saveSynonym(Async)" - ); - } - - return saveSynonymCall( - indexName, - objectID, - synonymHit, - forwardToReplicas, - _callback - ); - } - - /** - * 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) - * @param objectID Unique identifier of an object. (required) - * @param synonymHit (required) - * @param forwardToReplicas When true, changes are also propagated to replicas of the given - * indexName. (optional) - * @return SaveSynonymResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public SaveSynonymResponse saveSynonym( - String indexName, - String objectID, - SynonymHit synonymHit, - Boolean forwardToReplicas - ) throws AlgoliaRuntimeException { - Call req = saveSynonymValidateBeforeCall( - indexName, - objectID, - synonymHit, - forwardToReplicas, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.SaveSynonym( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public SaveSynonymResponse saveSynonym( - String indexName, - String objectID, - SynonymHit synonymHit - ) throws AlgoliaRuntimeException { - return this.saveSynonym(indexName, objectID, synonymHit, null); - } - - /** - * (asynchronously) 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) - * @param objectID Unique identifier of an object. (required) - * @param synonymHit (required) - * @param forwardToReplicas When true, changes are also propagated to replicas of the given - * indexName. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call saveSynonymAsync( - String indexName, - String objectID, - SynonymHit synonymHit, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = saveSynonymValidateBeforeCall( - indexName, - objectID, - synonymHit, - forwardToReplicas, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for saveSynonyms - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call saveSynonymsCall( - String indexName, - List synonymHit, - Boolean forwardToReplicas, - Boolean replaceExistingSynonyms, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = synonymHit; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/synonyms/batch".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (forwardToReplicas != null) { - queryParams.addAll( - this.parameterToPair("forwardToReplicas", forwardToReplicas) - ); - } - - if (replaceExistingSynonyms != null) { - queryParams.addAll( - this.parameterToPair("replaceExistingSynonyms", replaceExistingSynonyms) - ); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call saveSynonymsValidateBeforeCall( - String indexName, - List synonymHit, - Boolean forwardToReplicas, - Boolean replaceExistingSynonyms, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling saveSynonyms(Async)" - ); - } - - // verify the required parameter 'synonymHit' is set - if (synonymHit == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'synonymHit' when calling saveSynonyms(Async)" - ); - } - - return saveSynonymsCall( - indexName, - synonymHit, - forwardToReplicas, - replaceExistingSynonyms, - _callback - ); - } - - /** - * Create/update multiple synonym objects at once, potentially replacing the entire list of - * synonyms if replaceExistingSynonyms is true. - * - * @param indexName The index in which to perform the request. (required) - * @param synonymHit (required) - * @param forwardToReplicas When true, changes are also propagated to replicas of the given - * indexName. (optional) - * @param replaceExistingSynonyms Replace all synonyms of the index with the ones sent with this - * request. (optional) - * @return UpdatedAtResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public UpdatedAtResponse saveSynonyms( - String indexName, - List synonymHit, - Boolean forwardToReplicas, - Boolean replaceExistingSynonyms - ) throws AlgoliaRuntimeException { - Call req = saveSynonymsValidateBeforeCall( - indexName, - synonymHit, - forwardToReplicas, - replaceExistingSynonyms, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.SaveSynonyms( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public UpdatedAtResponse saveSynonyms( - String indexName, - List synonymHit - ) throws AlgoliaRuntimeException { - return this.saveSynonyms(indexName, synonymHit, null, null); - } - - /** - * (asynchronously) Create/update multiple synonym objects at once, potentially replacing the - * entire list of synonyms if replaceExistingSynonyms is true. - * - * @param indexName The index in which to perform the request. (required) - * @param synonymHit (required) - * @param forwardToReplicas When true, changes are also propagated to replicas of the given - * indexName. (optional) - * @param replaceExistingSynonyms Replace all synonyms of the index with the ones sent with this - * request. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call saveSynonymsAsync( - String indexName, - List synonymHit, - Boolean forwardToReplicas, - Boolean replaceExistingSynonyms, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = saveSynonymsValidateBeforeCall( - indexName, - synonymHit, - forwardToReplicas, - replaceExistingSynonyms, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for search - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call searchCall( - String indexName, - SearchParams searchParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = searchParams; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/query".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call searchValidateBeforeCall( - String indexName, - SearchParams searchParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling search(Async)" - ); - } - - // verify the required parameter 'searchParams' is set - if (searchParams == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'searchParams' when calling search(Async)" - ); - } - - return searchCall(indexName, searchParams, _callback); - } - - /** - * Get search results. - * - * @param indexName The index in which to perform the request. (required) - * @param searchParams (required) - * @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) - throws AlgoliaRuntimeException { - Call req = searchValidateBeforeCall(indexName, searchParams, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.Search(((CallEcho) req).request()); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Get search results. - * - * @param indexName The index in which to perform the request. (required) - * @param searchParams (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call searchAsync( - String indexName, - SearchParams searchParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = searchValidateBeforeCall(indexName, searchParams, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for searchDictionaryEntries - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call searchDictionaryEntriesCall( - DictionaryType dictionaryName, - SearchDictionaryEntriesParams searchDictionaryEntriesParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = searchDictionaryEntriesParams; - - // create path and map variables - String requestPath = - "/1/dictionaries/{dictionaryName}/search".replaceAll( - "\\{" + "dictionaryName" + "\\}", - this.escapeString(dictionaryName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call searchDictionaryEntriesValidateBeforeCall( - DictionaryType dictionaryName, - SearchDictionaryEntriesParams searchDictionaryEntriesParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'dictionaryName' is set - if (dictionaryName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'dictionaryName' when calling" + - " searchDictionaryEntries(Async)" - ); - } - - // verify the required parameter 'searchDictionaryEntriesParams' is set - if (searchDictionaryEntriesParams == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'searchDictionaryEntriesParams' when calling" + - " searchDictionaryEntries(Async)" - ); - } - - return searchDictionaryEntriesCall( - dictionaryName, - searchDictionaryEntriesParams, - _callback - ); - } - - /** - * Search the dictionary entries. - * - * @param dictionaryName The dictionary to search in. (required) - * @param searchDictionaryEntriesParams (required) - * @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 - ) throws AlgoliaRuntimeException { - Call req = searchDictionaryEntriesValidateBeforeCall( - dictionaryName, - searchDictionaryEntriesParams, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.SearchDictionaryEntries( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Search the dictionary entries. - * - * @param dictionaryName The dictionary to search in. (required) - * @param searchDictionaryEntriesParams (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call searchDictionaryEntriesAsync( - DictionaryType dictionaryName, - SearchDictionaryEntriesParams searchDictionaryEntriesParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = searchDictionaryEntriesValidateBeforeCall( - dictionaryName, - searchDictionaryEntriesParams, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for searchForFacetValues - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call searchForFacetValuesCall( - String indexName, - String facetName, - SearchForFacetValuesRequest searchForFacetValuesRequest, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = searchForFacetValuesRequest; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/facets/{facetName}/query".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ) - .replaceAll( - "\\{" + "facetName" + "\\}", - this.escapeString(facetName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call searchForFacetValuesValidateBeforeCall( - String indexName, - String facetName, - SearchForFacetValuesRequest searchForFacetValuesRequest, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling searchForFacetValues(Async)" - ); - } - - // verify the required parameter 'facetName' is set - if (facetName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'facetName' when calling searchForFacetValues(Async)" - ); - } - - return searchForFacetValuesCall( - indexName, - facetName, - searchForFacetValuesRequest, - _callback - ); - } - - /** - * Search for values of a given facet, optionally restricting the returned values to those - * contained in objects matching other search criteria. - * - * @param indexName The index in which to perform the request. (required) - * @param facetName The facet name. (required) - * @param searchForFacetValuesRequest (optional) - * @return SearchForFacetValuesResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public SearchForFacetValuesResponse searchForFacetValues( - String indexName, - String facetName, - SearchForFacetValuesRequest searchForFacetValuesRequest - ) throws AlgoliaRuntimeException { - Call req = searchForFacetValuesValidateBeforeCall( - indexName, - facetName, - searchForFacetValuesRequest, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.SearchForFacetValues( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {} - .getType(); - ApiResponse res = - this.execute(call, returnType); - return res.getData(); - } - - public SearchForFacetValuesResponse searchForFacetValues( - String indexName, - String facetName - ) throws AlgoliaRuntimeException { - return this.searchForFacetValues(indexName, facetName, null); - } - - /** - * (asynchronously) Search for values of a given facet, optionally restricting the returned values - * to those contained in objects matching other search criteria. - * - * @param indexName The index in which to perform the request. (required) - * @param facetName The facet name. (required) - * @param searchForFacetValuesRequest (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call searchForFacetValuesAsync( - String indexName, - String facetName, - SearchForFacetValuesRequest searchForFacetValuesRequest, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = searchForFacetValuesValidateBeforeCall( - indexName, - facetName, - searchForFacetValuesRequest, - _callback - ); - Type returnType = new TypeToken() {} - .getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for searchRules - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call searchRulesCall( - String indexName, - SearchRulesParams searchRulesParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = searchRulesParams; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/rules/search".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call searchRulesValidateBeforeCall( - String indexName, - SearchRulesParams searchRulesParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling searchRules(Async)" - ); - } - - // verify the required parameter 'searchRulesParams' is set - if (searchRulesParams == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'searchRulesParams' when calling searchRules(Async)" - ); - } - - return searchRulesCall(indexName, searchRulesParams, _callback); - } - - /** - * Search for rules matching various criteria. - * - * @param indexName The index in which to perform the request. (required) - * @param searchRulesParams (required) - * @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 - ) throws AlgoliaRuntimeException { - Call req = searchRulesValidateBeforeCall( - indexName, - searchRulesParams, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.SearchRules( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Search for rules matching various criteria. - * - * @param indexName The index in which to perform the request. (required) - * @param searchRulesParams (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call searchRulesAsync( - String indexName, - SearchRulesParams searchRulesParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = searchRulesValidateBeforeCall( - indexName, - searchRulesParams, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for searchSynonyms - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call searchSynonymsCall( - String indexName, - String query, - SynonymType type, - Integer page, - Integer hitsPerPage, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/synonyms/search".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (query != null) { - queryParams.addAll(this.parameterToPair("query", query)); - } - - if (type != null) { - queryParams.addAll(this.parameterToPair("type", type)); - } - - if (page != null) { - queryParams.addAll(this.parameterToPair("page", page)); - } - - if (hitsPerPage != null) { - queryParams.addAll(this.parameterToPair("hitsPerPage", hitsPerPage)); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call searchSynonymsValidateBeforeCall( - String indexName, - String query, - SynonymType type, - Integer page, - Integer hitsPerPage, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling searchSynonyms(Async)" - ); - } - - return searchSynonymsCall( - indexName, - query, - type, - page, - hitsPerPage, - _callback - ); - } - - /** - * Search or browse all synonyms, optionally filtering them by type. - * - * @param indexName The index in which to perform the request. (required) - * @param query Search for specific synonyms matching this string. (optional, default to ) - * @param type Only search for specific types of synonyms. (optional) - * @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, default to 0) - * @param hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) - * @return SearchSynonymsResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public SearchSynonymsResponse searchSynonyms( - String indexName, - String query, - SynonymType type, - Integer page, - Integer hitsPerPage - ) throws AlgoliaRuntimeException { - Call req = searchSynonymsValidateBeforeCall( - indexName, - query, - type, - page, - hitsPerPage, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.SearchSynonyms( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public SearchSynonymsResponse searchSynonyms(String indexName) - throws AlgoliaRuntimeException { - return this.searchSynonyms(indexName, "", null, 0, 100); - } - - /** - * (asynchronously) Search or browse all synonyms, optionally filtering them by type. - * - * @param indexName The index in which to perform the request. (required) - * @param query Search for specific synonyms matching this string. (optional, default to ) - * @param type Only search for specific types of synonyms. (optional) - * @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, default to 0) - * @param hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call searchSynonymsAsync( - String indexName, - String query, - SynonymType type, - Integer page, - Integer hitsPerPage, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = searchSynonymsValidateBeforeCall( - indexName, - query, - type, - page, - hitsPerPage, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for searchUserIds - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call searchUserIdsCall( - SearchUserIdsParams searchUserIdsParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = searchUserIdsParams; - - // create path and map variables - String requestPath = "/1/clusters/mapping/search"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "POST", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call searchUserIdsValidateBeforeCall( - SearchUserIdsParams searchUserIdsParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'searchUserIdsParams' is set - if (searchUserIdsParams == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'searchUserIdsParams' when calling searchUserIds(Async)" - ); - } - - return searchUserIdsCall(searchUserIdsParams, _callback); - } - - /** - * 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 - * moving quickly, the index of userIDs isn't built synchronously with the mapping. Instead, the - * index is built once every 12h, at the same time as the update of userID usage. For example, - * when you perform a modification like adding or moving a userID, the search will report an - * outdated value until the next rebuild of the mapping, which takes place every 12h. Upon - * success, the response is 200 OK and contains the following userIDs data. - * - * @param searchUserIdsParams (required) - * @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 - ) throws AlgoliaRuntimeException { - Call req = searchUserIdsValidateBeforeCall(searchUserIdsParams, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.SearchUserIds( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) 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 moving quickly, the index of userIDs isn't built synchronously - * with the mapping. Instead, the index is built once every 12h, at the same time as the update of - * userID usage. For example, when you perform a modification like adding or moving a userID, the - * search will report an outdated value until the next rebuild of the mapping, which takes place - * every 12h. Upon success, the response is 200 OK and contains the following userIDs data. - * - * @param searchUserIdsParams (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call searchUserIdsAsync( - SearchUserIdsParams searchUserIdsParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = searchUserIdsValidateBeforeCall(searchUserIdsParams, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for setDictionarySettings - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call setDictionarySettingsCall( - DictionarySettingsParams dictionarySettingsParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = dictionarySettingsParams; - - // create path and map variables - String requestPath = "/1/dictionaries/*/settings"; - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "PUT", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call setDictionarySettingsValidateBeforeCall( - DictionarySettingsParams dictionarySettingsParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'dictionarySettingsParams' is set - if (dictionarySettingsParams == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'dictionarySettingsParams' when calling" + - " setDictionarySettings(Async)" - ); - } - - return setDictionarySettingsCall(dictionarySettingsParams, _callback); - } - - /** - * Set dictionary settings. - * - * @param dictionarySettingsParams (required) - * @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 - ) throws AlgoliaRuntimeException { - Call req = setDictionarySettingsValidateBeforeCall( - dictionarySettingsParams, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.SetDictionarySettings( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Set dictionary settings. - * - * @param dictionarySettingsParams (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call setDictionarySettingsAsync( - DictionarySettingsParams dictionarySettingsParams, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = setDictionarySettingsValidateBeforeCall( - dictionarySettingsParams, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for setSettings - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call setSettingsCall( - String indexName, - IndexSettings indexSettings, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = indexSettings; - - // create path and map variables - String requestPath = - "/1/indexes/{indexName}/settings".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (forwardToReplicas != null) { - queryParams.addAll( - this.parameterToPair("forwardToReplicas", forwardToReplicas) - ); - } - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "PUT", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call setSettingsValidateBeforeCall( - String indexName, - IndexSettings indexSettings, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexName' when calling setSettings(Async)" - ); - } - - // verify the required parameter 'indexSettings' is set - if (indexSettings == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'indexSettings' when calling setSettings(Async)" - ); - } - - return setSettingsCall( - indexName, - indexSettings, - forwardToReplicas, - _callback - ); - } - - /** - * Update settings of a given indexName. Only specified settings are overridden; unspecified - * settings are left unchanged. Specifying null for a setting resets it to its default value. - * - * @param indexName The index in which to perform the request. (required) - * @param indexSettings (required) - * @param forwardToReplicas When true, changes are also propagated to replicas of the given - * indexName. (optional) - * @return UpdatedAtResponse - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public UpdatedAtResponse setSettings( - String indexName, - IndexSettings indexSettings, - Boolean forwardToReplicas - ) throws AlgoliaRuntimeException { - Call req = setSettingsValidateBeforeCall( - indexName, - indexSettings, - forwardToReplicas, - null - ); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.SetSettings( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - public UpdatedAtResponse setSettings( - String indexName, - IndexSettings indexSettings - ) throws AlgoliaRuntimeException { - return this.setSettings(indexName, indexSettings, null); - } - - /** - * (asynchronously) Update settings of a given indexName. Only specified settings are overridden; - * unspecified settings are left unchanged. Specifying null for a setting resets it to its default - * value. - * - * @param indexName The index in which to perform the request. (required) - * @param indexSettings (required) - * @param forwardToReplicas When true, changes are also propagated to replicas of the given - * indexName. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call setSettingsAsync( - String indexName, - IndexSettings indexSettings, - Boolean forwardToReplicas, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = setSettingsValidateBeforeCall( - indexName, - indexSettings, - forwardToReplicas, - _callback - ); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } - - /** - * Build call for updateApiKey - * - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws AlgoliaRuntimeException If fail to serialize the request body object - */ - private Call updateApiKeyCall( - String key, - ApiKey apiKey, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = apiKey; - - // create path and map variables - String requestPath = - "/1/keys/{key}".replaceAll( - "\\{" + "key" + "\\}", - this.escapeString(key.toString()) - ); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json"); - - return this.buildCall( - requestPath, - "PUT", - queryParams, - bodyObj, - headers, - _callback - ); - } - - private Call updateApiKeyValidateBeforeCall( - String key, - ApiKey apiKey, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - // verify the required parameter 'key' is set - if (key == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'key' when calling updateApiKey(Async)" - ); - } - - // verify the required parameter 'apiKey' is set - if (apiKey == null) { - throw new AlgoliaRuntimeException( - "Missing the required parameter 'apiKey' when calling updateApiKey(Async)" - ); - } - - return updateApiKeyCall(key, apiKey, _callback); - } - - /** - * Replace every permission of an existing API key. - * - * @param key API Key string. (required) - * @param apiKey (required) - * @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) - throws AlgoliaRuntimeException { - Call req = updateApiKeyValidateBeforeCall(key, apiKey, null); - if (req instanceof CallEcho) { - return new EchoResponse.SearchEcho.UpdateApiKey( - ((CallEcho) req).request() - ); - } - Call call = (Call) req; - Type returnType = new TypeToken() {}.getType(); - ApiResponse res = this.execute(call, returnType); - return res.getData(); - } - - /** - * (asynchronously) Replace every permission of an existing API key. - * - * @param key API Key string. (required) - * @param apiKey (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request - * body object - */ - public Call updateApiKeyAsync( - String key, - ApiKey apiKey, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Call call = updateApiKeyValidateBeforeCall(key, apiKey, _callback); - Type returnType = new TypeToken() {}.getType(); - this.executeAsync(call, returnType, _callback); - return call; - } -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/CompoundType.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/CompoundType.java deleted file mode 100644 index 9a64ddd3c..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/CompoundType.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.algolia.utils; - -public interface CompoundType { - Object getInsideValue(); -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/HttpRequester.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/HttpRequester.java deleted file mode 100644 index 07cbae53b..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/HttpRequester.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.algolia.utils; - -import com.algolia.ApiCallback; -import com.algolia.ProgressResponseBody; -import com.algolia.utils.retry.RetryStrategy; -import com.algolia.utils.retry.StatefulHost; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; -import okhttp3.Call; -import okhttp3.Interceptor; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.logging.HttpLoggingInterceptor; -import okhttp3.logging.HttpLoggingInterceptor.Level; - -public class HttpRequester implements Requester { - - private RetryStrategy retryStrategy; - private OkHttpClient httpClient; - private HttpLoggingInterceptor loggingInterceptor; - private boolean debugging; - - public HttpRequester(List hosts) { - this.retryStrategy = new RetryStrategy(hosts); - - OkHttpClient.Builder builder = new OkHttpClient.Builder(); - builder.addInterceptor(retryStrategy.getRetryInterceptor()); - builder.addNetworkInterceptor(getProgressInterceptor()); - builder.retryOnConnectionFailure(false); - - httpClient = builder.build(); - } - - public Call newCall(Request request) { - return httpClient.newCall(request); - } - - public void setDebugging(boolean debugging) { - if (debugging != this.debugging) { - if (debugging) { - loggingInterceptor = new HttpLoggingInterceptor(); - loggingInterceptor.setLevel(Level.BODY); - httpClient = - httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); - } else { - final OkHttpClient.Builder builder = httpClient.newBuilder(); - builder.interceptors().remove(loggingInterceptor); - httpClient = builder.build(); - loggingInterceptor = null; - } - } - this.debugging = debugging; - } - - public int getConnectTimeout() { - return httpClient.connectTimeoutMillis(); - } - - public void setConnectTimeout(int connectionTimeout) { - httpClient = - httpClient - .newBuilder() - .connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS) - .build(); - } - - public int getReadTimeout() { - return httpClient.readTimeoutMillis(); - } - - public void setReadTimeout(int readTimeout) { - httpClient = - httpClient - .newBuilder() - .readTimeout(readTimeout, TimeUnit.MILLISECONDS) - .build(); - } - - public int getWriteTimeout() { - return httpClient.writeTimeoutMillis(); - } - - public void setWriteTimeout(int writeTimeout) { - httpClient = - httpClient - .newBuilder() - .writeTimeout(writeTimeout, TimeUnit.MILLISECONDS) - .build(); - } - - /** - * Get network interceptor to add it to the httpClient to track download progress for async - * requests. - */ - private Interceptor getProgressInterceptor() { - return new Interceptor() { - @Override - public Response intercept(Interceptor.Chain chain) throws IOException { - final Request request = chain.request(); - final Response originalResponse = chain.proceed(request); - if (request.tag() instanceof ApiCallback) { - final ApiCallback callback = (ApiCallback) request.tag(); - return originalResponse - .newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), callback)) - .build(); - } - return originalResponse; - } - }; - } -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/Requester.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/Requester.java deleted file mode 100644 index 919dd7c8b..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/Requester.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.algolia.utils; - -import okhttp3.Call; -import okhttp3.Request; - -public interface Requester { - public Call newCall(Request request); - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - */ - public void setDebugging(boolean debugging); - - /** - * Get connection timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getConnectTimeout(); - - /** - * Sets the connect timeout (in milliseconds). A value of 0 means no timeout, otherwise values - * must be between 1 and {@link Integer#MAX_VALUE}. - * - * @param connectionTimeout connection timeout in milliseconds - */ - public void setConnectTimeout(int connectionTimeout); - - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout(); - - /** - * Sets the read timeout (in milliseconds). A value of 0 means no timeout, otherwise values must - * be between 1 and {@link Integer#MAX_VALUE}. - * - * @param readTimeout read timeout in milliseconds - */ - public void setReadTimeout(int readTimeout); - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout(); - - /** - * Sets the write timeout (in milliseconds). A value of 0 means no timeout, otherwise values must - * be between 1 and {@link Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - */ - public void setWriteTimeout(int writeTimeout); -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/CallEcho.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/CallEcho.java deleted file mode 100644 index 171266979..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/CallEcho.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.algolia.utils.echo; - -import java.io.IOException; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Request; -import okhttp3.Response; -import okio.Timeout; - -public class CallEcho implements Call { - - private Request request; - - public CallEcho(Request request) { - this.request = request; - } - - @Override - public Request request() { - return request; - } - - @Override - public void cancel() {} - - @Override - public Call clone() { - return null; - } - - @Override - public void enqueue(Callback arg0) {} - - @Override - public Response execute() throws IOException { - return null; - } - - @Override - public boolean isExecuted() { - return false; - } - - @Override - public boolean isCanceled() { - return false; - } - - @Override - public Timeout timeout() { - return null; - } -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoRequester.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoRequester.java deleted file mode 100644 index 8e49cf5b1..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoRequester.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.algolia.utils.echo; - -import com.algolia.utils.Requester; -import okhttp3.Request; - -public class EchoRequester implements Requester { - - private int connectionTimeout, readTimeout, writeTimeout; - - public EchoRequester() { - this.connectionTimeout = 100; - this.readTimeout = 100; - this.writeTimeout = 100; - } - - public CallEcho newCall(Request request) { - return new CallEcho(request); - } - - // NO-OP for now - public void setDebugging(boolean debugging) {} - - public int getConnectTimeout() { - return this.connectionTimeout; - } - - public void setConnectTimeout(int connectionTimeout) { - this.connectionTimeout = connectionTimeout; - } - - public int getReadTimeout() { - return this.readTimeout; - } - - public void setReadTimeout(int readTimeout) { - this.readTimeout = readTimeout; - } - - public int getWriteTimeout() { - return this.writeTimeout; - } - - public void setWriteTimeout(int writeTimeout) { - this.writeTimeout = writeTimeout; - } -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponse.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponse.java deleted file mode 100644 index be4971a77..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponse.java +++ /dev/null @@ -1,1674 +0,0 @@ -package com.algolia.utils.echo; - -import com.algolia.Pair; -import com.algolia.model.search.*; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import okhttp3.HttpUrl; -import okhttp3.Request; -import okio.Buffer; - -public class EchoResponse { - - private static String parseRequestBody(Request req) { - try { - final Request copy = req.newBuilder().build(); - final Buffer buffer = new Buffer(); - copy.body().writeTo(buffer); - return buffer.readUtf8(); - } catch (final IOException e) { - return "error"; - } - } - - private static List buildQueryParams(Request req) { - List params = new ArrayList(); - HttpUrl url = req.url(); - for (String name : url.queryParameterNames()) { - for (String value : url.queryParameterValues(name)) { - params.add(new Pair(name, value)); - } - } - return params; - } - - public static class SearchEcho { - - public static class AddApiKey - extends AddApiKeyResponse - implements EchoResponseInterface { - - private Request request; - - public AddApiKey(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class AddOrUpdateObject - extends UpdatedAtWithObjectIdResponse - implements EchoResponseInterface { - - private Request request; - - public AddOrUpdateObject(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class AppendSource - extends CreatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public AppendSource(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class AssignUserId - extends CreatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public AssignUserId(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class Batch - extends BatchResponse - implements EchoResponseInterface { - - private Request request; - - public Batch(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class BatchAssignUserIds - extends CreatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public BatchAssignUserIds(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class BatchDictionaryEntries - extends UpdatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public BatchDictionaryEntries(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class BatchRules - extends UpdatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public BatchRules(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class Browse - extends BrowseResponse - implements EchoResponseInterface { - - private Request request; - - public Browse(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class ClearAllSynonyms - extends UpdatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public ClearAllSynonyms(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class ClearObjects - extends UpdatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public ClearObjects(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class ClearRules - extends UpdatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public ClearRules(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class Del extends Object implements EchoResponseInterface { - - private Request request; - - public Del(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class DeleteApiKey - extends DeleteApiKeyResponse - implements EchoResponseInterface { - - private Request request; - - public DeleteApiKey(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class DeleteBy - extends DeletedAtResponse - implements EchoResponseInterface { - - private Request request; - - public DeleteBy(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class DeleteIndex - extends DeletedAtResponse - implements EchoResponseInterface { - - private Request request; - - public DeleteIndex(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class DeleteObject - extends DeletedAtResponse - implements EchoResponseInterface { - - private Request request; - - public DeleteObject(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class DeleteRule - extends UpdatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public DeleteRule(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class DeleteSource - extends DeleteSourceResponse - implements EchoResponseInterface { - - private Request request; - - public DeleteSource(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class DeleteSynonym - extends DeletedAtResponse - implements EchoResponseInterface { - - private Request request; - - public DeleteSynonym(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class Get extends Object implements EchoResponseInterface { - - private Request request; - - public Get(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class GetApiKey extends Key implements EchoResponseInterface { - - private Request request; - - public GetApiKey(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class GetDictionaryLanguages - extends HashMap - implements EchoResponseInterface { - - private Request request; - - public GetDictionaryLanguages(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class GetDictionarySettings - extends GetDictionarySettingsResponse - implements EchoResponseInterface { - - private Request request; - - public GetDictionarySettings(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class GetLogs - extends GetLogsResponse - implements EchoResponseInterface { - - private Request request; - - public GetLogs(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class GetObject - extends HashMap - implements EchoResponseInterface { - - private Request request; - - public GetObject(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class GetObjects - extends GetObjectsResponse - implements EchoResponseInterface { - - private Request request; - - public GetObjects(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class GetRule extends Rule implements EchoResponseInterface { - - private Request request; - - public GetRule(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class GetSettings - extends IndexSettings - implements EchoResponseInterface { - - private Request request; - - public GetSettings(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class GetSources - extends ArrayList - implements EchoResponseInterface { - - private Request request; - - public GetSources(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class GetSynonym - extends SynonymHit - implements EchoResponseInterface { - - private Request request; - - public GetSynonym(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class GetTask - extends GetTaskResponse - implements EchoResponseInterface { - - private Request request; - - public GetTask(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class GetTopUserIds - extends GetTopUserIdsResponse - implements EchoResponseInterface { - - private Request request; - - public GetTopUserIds(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class GetUserId - extends UserId - implements EchoResponseInterface { - - private Request request; - - public GetUserId(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class HasPendingMappings - extends CreatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public HasPendingMappings(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class ListApiKeys - extends ListApiKeysResponse - implements EchoResponseInterface { - - private Request request; - - public ListApiKeys(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class ListClusters - extends ListClustersResponse - implements EchoResponseInterface { - - private Request request; - - public ListClusters(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class ListIndices - extends ListIndicesResponse - implements EchoResponseInterface { - - private Request request; - - public ListIndices(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class ListUserIds - extends ListUserIdsResponse - implements EchoResponseInterface { - - private Request request; - - public ListUserIds(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class MultipleBatch - extends MultipleBatchResponse - implements EchoResponseInterface { - - private Request request; - - public MultipleBatch(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class MultipleQueries - extends MultipleQueriesResponse - implements EchoResponseInterface { - - private Request request; - - public MultipleQueries(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class OperationIndex - extends UpdatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public OperationIndex(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class PartialUpdateObject - extends UpdatedAtWithObjectIdResponse - implements EchoResponseInterface { - - private Request request; - - public PartialUpdateObject(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class Post extends Object implements EchoResponseInterface { - - private Request request; - - public Post(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class Put extends Object implements EchoResponseInterface { - - private Request request; - - public Put(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class RemoveUserId - extends RemoveUserIdResponse - implements EchoResponseInterface { - - private Request request; - - public RemoveUserId(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class ReplaceSources - extends ReplaceSourceResponse - implements EchoResponseInterface { - - private Request request; - - public ReplaceSources(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class RestoreApiKey - extends AddApiKeyResponse - implements EchoResponseInterface { - - private Request request; - - public RestoreApiKey(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class SaveObject - extends SaveObjectResponse - implements EchoResponseInterface { - - private Request request; - - public SaveObject(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class SaveRule - extends UpdatedRuleResponse - implements EchoResponseInterface { - - private Request request; - - public SaveRule(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class SaveSynonym - extends SaveSynonymResponse - implements EchoResponseInterface { - - private Request request; - - public SaveSynonym(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class SaveSynonyms - extends UpdatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public SaveSynonyms(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class Search - extends SearchResponse - implements EchoResponseInterface { - - private Request request; - - public Search(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class SearchDictionaryEntries - extends UpdatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public SearchDictionaryEntries(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class SearchForFacetValues - extends SearchForFacetValuesResponse - implements EchoResponseInterface { - - private Request request; - - public SearchForFacetValues(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class SearchRules - extends SearchRulesResponse - implements EchoResponseInterface { - - private Request request; - - public SearchRules(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class SearchSynonyms - extends SearchSynonymsResponse - implements EchoResponseInterface { - - private Request request; - - public SearchSynonyms(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class SearchUserIds - extends SearchUserIdsResponse - implements EchoResponseInterface { - - private Request request; - - public SearchUserIds(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class SetDictionarySettings - extends UpdatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public SetDictionarySettings(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class SetSettings - extends UpdatedAtResponse - implements EchoResponseInterface { - - private Request request; - - public SetSettings(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - - public static class UpdateApiKey - extends UpdateApiKeyResponse - implements EchoResponseInterface { - - private Request request; - - public UpdateApiKey(Request request) { - this.request = request; - } - - public String getPath() { - return request.url().encodedPath(); - } - - public String getMethod() { - return request.method(); - } - - public String getBody() { - return parseRequestBody(request); - } - - public List getQueryParams() { - return buildQueryParams(request); - } - } - } -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponseInterface.java b/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponseInterface.java deleted file mode 100644 index 1a5ab9cba..000000000 --- a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponseInterface.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.algolia.utils.echo; - -import com.algolia.Pair; -import java.util.List; - -public interface EchoResponseInterface { - public String getPath(); - - public String getMethod(); - - public String getBody(); - - public List getQueryParams(); -} diff --git a/algoliasearch-client-java-2/build.gradle b/algoliasearch-client-java-2/build.gradle deleted file mode 100644 index 6649f2617..000000000 --- a/algoliasearch-client-java-2/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -plugins { - id 'java' - id 'maven-publish' -} - -group = 'com.algolia' -version = '0.1.0' -description = 'algoliasearch-client-java-2' -java.sourceCompatibility = JavaVersion.VERSION_1_8 - -repositories { - mavenCentral() -} - -dependencies { - implementation 'com.google.code.findbugs:jsr305:3.0.2' - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' - implementation 'com.google.code.gson:gson:2.8.9' - implementation 'io.gsonfire:gson-fire:1.8.5' -} - -publishing { - publications { - maven(MavenPublication) { - from(components.java) - } - } -} - -tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' -} - -sourceSets { - main { - java { - srcDirs = ["algoliasearch-core"] - } - } -} diff --git a/algoliasearch-client-java-2/settings.gradle b/algoliasearch-client-java-2/settings.gradle deleted file mode 100644 index 8fb6ea50f..000000000 --- a/algoliasearch-client-java-2/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "algoliasearch-client-java-2" \ No newline at end of file diff --git a/algoliasearch-core/com/algolia/ApiCallback.java b/algoliasearch-core/com/algolia/ApiCallback.java index 6b149c2b3..1c1d61bcf 100644 --- a/algoliasearch-core/com/algolia/ApiCallback.java +++ b/algoliasearch-core/com/algolia/ApiCallback.java @@ -1,5 +1,6 @@ package com.algolia; +import com.algolia.exceptions.AlgoliaRuntimeException; import java.util.List; import java.util.Map; @@ -17,7 +18,7 @@ public interface ApiCallback { * @param responseHeaders Headers of the response if available, otherwise it would be null */ void onFailure( - ApiException e, + AlgoliaRuntimeException e, int statusCode, Map> responseHeaders ); diff --git a/algoliasearch-core/com/algolia/ApiClient.java b/algoliasearch-core/com/algolia/ApiClient.java index fe63fb831..2a89b58b9 100644 --- a/algoliasearch-core/com/algolia/ApiClient.java +++ b/algoliasearch-core/com/algolia/ApiClient.java @@ -1,5 +1,6 @@ package com.algolia; +import com.algolia.exceptions.*; import com.algolia.utils.Requester; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -18,62 +19,27 @@ public class ApiClient { private boolean debugging = false; private Map defaultHeaderMap = new HashMap(); - private String basePath; private String appId, apiKey; private DateFormat dateFormat; - private JSON json; - private Requester requester; /* * Constructor for ApiClient with custom Requester */ public ApiClient(String appId, String apiKey, Requester requester) { - json = new JSON(); setUserAgent("OpenAPI-Generator/0.1.0/java"); - this.basePath = "https://" + appId + "-1.algolianet.com"; this.appId = appId; this.apiKey = apiKey; this.requester = requester; } - /** - * Get JSON - * - * @return JSON object - */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return Api client - */ - public ApiClient setJSON(JSON json) { - this.json = json; - return this; - } - public DateFormat getDateFormat() { return dateFormat; } - public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); - return this; - } - - public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); - return this; - } - /** * Set the User-Agent header's value (by adding to the default header map). * @@ -195,7 +161,7 @@ public String parameterToString(Object param) { param instanceof LocalDate ) { // Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); + String jsonStr = JSON.serialize(param); return jsonStr.substring(1, jsonStr.length() - 1); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); @@ -363,11 +329,11 @@ public String escapeString(String str) { * @param response HTTP response * @param returnType The type of the Java object * @return The deserialized Java object - * @throws ApiException If fail to deserialize response body, i.e. cannot read response body or - * the Content-Type of the response is not supported. + * @throws AlgoliaRuntimeException If fail to deserialize response body, i.e. cannot read response + * body or the Content-Type of the response is not supported. */ public T deserialize(Response response, Type returnType) - throws ApiException { + throws AlgoliaRuntimeException { if (response == null || returnType == null) { return null; } @@ -377,7 +343,7 @@ public T deserialize(Response response, Type returnType) try { return (T) response.body().bytes(); } catch (IOException e) { - throw new ApiException(e); + throw new AlgoliaRuntimeException(e); } } @@ -386,7 +352,7 @@ public T deserialize(Response response, Type returnType) if (response.body() != null) respBody = response.body().string(); else respBody = null; } catch (IOException e) { - throw new ApiException(e); + throw new AlgoliaRuntimeException(e); } if (respBody == null || "".equals(respBody)) { @@ -399,19 +365,17 @@ public T deserialize(Response response, Type returnType) contentType = "application/json"; } if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); + return JSON.deserialize(respBody, returnType); } else if (returnType.equals(String.class)) { // Expecting string, return the raw response body. return (T) respBody; } else { - throw new ApiException( + throw new AlgoliaApiException( "Content type \"" + contentType + "\" is not supported for type: " + returnType, - response.code(), - response.headers().toMultimap(), - respBody + response.code() ); } } @@ -423,23 +387,23 @@ public T deserialize(Response response, Type returnType) * @param obj The Java object * @param contentType The request Content-Type * @return The serialized request body - * @throws ApiException If fail to serialize the given object + * @throws AlgoliaRuntimeException If fail to serialize the given object */ public RequestBody serialize(Object obj, String contentType) - throws ApiException { + 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); + content = JSON.serialize(obj); } else { content = null; } return RequestBody.create(content, MediaType.parse(contentType)); } else { - throw new ApiException( + throw new AlgoliaRuntimeException( "Content type \"" + contentType + "\" is not supported" ); } @@ -451,9 +415,9 @@ public RequestBody serialize(Object obj, String contentType) * @param Type * @param call An instance of the Call object * @return ApiResponse<T> - * @throws ApiException If fail to execute the call + * @throws AlgoliaRuntimeException If fail to execute the call */ - public ApiResponse execute(Call call) throws ApiException { + public ApiResponse execute(Call call) throws AlgoliaRuntimeException { return execute(call, null); } @@ -465,10 +429,10 @@ public ApiResponse execute(Call call) throws ApiException { * @param call Call * @return ApiResponse object containing response status, headers and data, which is a Java object * deserialized from response body and would be null when returnType is null. - * @throws ApiException If fail to execute the call + * @throws AlgoliaRuntimeException If fail to execute the call */ public ApiResponse execute(Call call, Type returnType) - throws ApiException { + throws AlgoliaRuntimeException { try { Response response = call.execute(); T data = handleResponse(response, returnType); @@ -478,7 +442,7 @@ public ApiResponse execute(Call call, Type returnType) data ); } catch (IOException e) { - throw new ApiException(e); + throw new AlgoliaRuntimeException(e); } } @@ -511,7 +475,7 @@ public void executeAsync( new Callback() { @Override public void onFailure(Call call, IOException e) { - callback.onFailure(new ApiException(e), 0, null); + callback.onFailure(new AlgoliaRuntimeException(e), 0, null); } @Override @@ -520,7 +484,7 @@ public void onResponse(Call call, Response response) T result; try { result = (T) handleResponse(response, returnType); - } catch (ApiException e) { + } catch (AlgoliaRuntimeException e) { callback.onFailure( e, response.code(), @@ -529,7 +493,7 @@ public void onResponse(Call call, Response response) return; } catch (Exception e) { callback.onFailure( - new ApiException(e), + new AlgoliaRuntimeException(e), response.code(), response.headers().toMultimap() ); @@ -552,11 +516,11 @@ public void onResponse(Call call, Response response) * @param response Response * @param returnType Return type * @return Type - * @throws ApiException If the response has an unsuccessful status code or fail to deserialize the - * response body + * @throws AlgoliaRuntimeException If the response has an unsuccessful status code or fail to + * deserialize the response body */ public T handleResponse(Response response, Type returnType) - throws ApiException { + throws AlgoliaRuntimeException { if (response.isSuccessful()) { if (returnType == null || response.code() == 204) { // returning null if the returnType is not defined, @@ -565,11 +529,10 @@ public T handleResponse(Response response, Type returnType) try { response.body().close(); } catch (Exception e) { - throw new ApiException( + throw new AlgoliaApiException( response.message(), e, - response.code(), - response.headers().toMultimap() + response.code() ); } } @@ -578,25 +541,14 @@ public T handleResponse(Response response, Type returnType) return deserialize(response, returnType); } } else { - String respBody = null; if (response.body() != null) { try { - respBody = response.body().string(); + response.body().string(); } catch (IOException e) { - throw new ApiException( - response.message(), - e, - response.code(), - response.headers().toMultimap() - ); + throw new AlgoliaApiException(response.message(), e, response.code()); } } - throw new ApiException( - response.message(), - response.code(), - response.headers().toMultimap(), - respBody - ); + throw new AlgoliaApiException(response.message(), response.code()); } } @@ -611,7 +563,7 @@ public T handleResponse(Response response, Type returnType) * @param headerParams The header parameters * @param callback Callback for upload/download progress * @return The HTTP call - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ public Call buildCall( String path, @@ -620,7 +572,7 @@ public Call buildCall( Object body, Map headerParams, ApiCallback callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Request request = buildRequest( path, method, @@ -644,7 +596,7 @@ public Call buildCall( * @param headerParams The header parameters * @param callback Callback for upload/download progress * @return The HTTP request - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ public Request buildRequest( String path, @@ -653,7 +605,7 @@ public Request buildRequest( Object body, Map headerParams, ApiCallback callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { headerParams.put("X-Algolia-Application-Id", this.appId); headerParams.put("X-Algolia-API-Key", this.apiKey); @@ -710,7 +662,9 @@ public Request buildRequest( */ public String buildUrl(String path, List queryParams) { final StringBuilder url = new StringBuilder(); - url.append(basePath).append(path); + + // The real host will be assigned by the retry strategy + url.append("http://temp.path").append(path); if (queryParams != null && !queryParams.isEmpty()) { // support (constant) query string in `path`, e.g. "/posts?draft=1" diff --git a/algoliasearch-core/com/algolia/ApiException.java b/algoliasearch-core/com/algolia/ApiException.java deleted file mode 100644 index 06c74f5cc..000000000 --- a/algoliasearch-core/com/algolia/ApiException.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.algolia; - -import java.util.List; -import java.util.Map; - -public class ApiException extends Exception { - - private int code = 0; - private Map> responseHeaders = null; - private String responseBody = null; - - public ApiException() {} - - public ApiException(Throwable throwable) { - super(throwable); - } - - public ApiException(String message) { - super(message); - } - - public ApiException( - String message, - Throwable throwable, - int code, - Map> responseHeaders, - String responseBody - ) { - super(message, throwable); - this.code = code; - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - public ApiException( - String message, - int code, - Map> responseHeaders, - String responseBody - ) { - this(message, (Throwable) null, code, responseHeaders, responseBody); - } - - public ApiException( - String message, - Throwable throwable, - int code, - Map> responseHeaders - ) { - this(message, throwable, code, responseHeaders, null); - } - - public ApiException( - int code, - Map> responseHeaders, - String responseBody - ) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); - } - - public ApiException(int code, String message) { - super(message); - this.code = code; - } - - public ApiException( - int code, - String message, - Map> responseHeaders, - String responseBody - ) { - this(code, message); - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - /** - * Get the HTTP status code. - * - * @return HTTP status code - */ - public int getCode() { - return code; - } - - /** - * Get the HTTP response headers. - * - * @return A map of list of string - */ - public Map> getResponseHeaders() { - return responseHeaders; - } - - /** - * Get the HTTP response body. - * - * @return Response body in the form of string - */ - public String getResponseBody() { - return responseBody; - } -} diff --git a/algoliasearch-core/com/algolia/JSON.java b/algoliasearch-core/com/algolia/JSON.java index 0bfbbc876..dc2203683 100644 --- a/algoliasearch-core/com/algolia/JSON.java +++ b/algoliasearch-core/com/algolia/JSON.java @@ -24,7 +24,6 @@ import com.google.gson.stream.JsonWriter; import io.gsonfire.GsonFireBuilder; import java.io.IOException; -import java.io.StringReader; import java.io.StringWriter; import java.lang.reflect.Field; import java.lang.reflect.Type; @@ -32,9 +31,6 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; import java.util.Collections; import java.util.Date; import java.util.EnumMap; @@ -50,39 +46,31 @@ public class JSON { - private Gson gson; - private boolean isLenientOnJson = false; - private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); - private RetainFieldMapFactory mapAdapter = new RetainFieldMapFactory(); + private static Gson gson; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + private static RetainFieldMapFactory mapAdapter = new RetainFieldMapFactory(); - public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder(); - GsonBuilder builder = fireBuilder.createGsonBuilder(); - return builder; - } - - public JSON() { + static { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) - .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) - .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) - .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) .registerTypeAdapter(byte[].class, byteArrayAdapter) .registerTypeAdapterFactory(mapAdapter) .create(); } + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder(); + return fireBuilder.createGsonBuilder(); + } + /** * Get Gson. * * @return Gson */ - public Gson getGson() { + public static Gson getGson() { return gson; } @@ -92,14 +80,8 @@ public Gson getGson() { * @param gson Gson * @return JSON */ - public JSON setGson(Gson gson) { - this.gson = gson; - return this; - } - - public JSON setLenientOnJson(boolean lenientOnJson) { - isLenientOnJson = lenientOnJson; - return this; + public static void setGson(Gson gon) { + gson = gon; } /** @@ -108,7 +90,7 @@ public JSON setLenientOnJson(boolean lenientOnJson) { * @param obj Object * @return String representation of the JSON */ - public String serialize(Object obj) { + public static String serialize(Object obj) { return gson.toJson(obj); } @@ -120,21 +102,13 @@ public String serialize(Object obj) { * @param returnType The type to deserialize into * @return The deserialized Java object */ - public T deserialize(String body, Type returnType) { + public static T deserialize(String body, Type returnType) { try { - if (isLenientOnJson) { - JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see - // https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) - jsonReader.setLenient(true); - return gson.fromJson(jsonReader, returnType); - } else { - return gson.fromJson(body, returnType); - } + return gson.fromJson(body, returnType); } catch (JsonParseException e) { // Fallback processing when failed to parse JSON form response body: // return the response body string directly for the String return type; - if (returnType.equals(String.class)) { + if (returnType != null && returnType.equals(String.class)) { return (T) body; } else { throw (e); @@ -142,159 +116,72 @@ public T deserialize(String body, Type returnType) { } } - /** Gson TypeAdapter for Byte Array type */ - public class ByteArrayAdapter extends TypeAdapter { - - @Override - public void write(JsonWriter out, byte[] value) throws IOException { - if (value == null) { - out.nullValue(); - } else { - out.value(ByteString.of(value).base64()); - } - } - - @Override - public byte[] read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String bytesAsBase64 = in.nextString(); - ByteString byteString = ByteString.decodeBase64(bytesAsBase64); - return byteString.toByteArray(); - } - } + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); } +} - /** Gson TypeAdapter for JSR310 OffsetDateTime type */ - public static class OffsetDateTimeTypeAdapter - extends TypeAdapter { - - private DateTimeFormatter formatter; - - public OffsetDateTimeTypeAdapter() { - this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - - public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, OffsetDateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } +/** Gson TypeAdapter for Byte Array type */ +class ByteArrayAdapter extends TypeAdapter { - @Override - public OffsetDateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - if (date.endsWith("+0000")) { - date = date.substring(0, date.length() - 5) + "Z"; - } - return OffsetDateTime.parse(date, formatter); - } + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); } } - /** Gson TypeAdapter for JSR310 LocalDate type */ - public class LocalDateTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public LocalDateTypeAdapter() { - this(DateTimeFormatter.ISO_LOCAL_DATE); - } - - public LocalDateTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); } + } +} - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } +/** + * Gson TypeAdapter for java.util.Date type If the dateFormat is null, ISO8601Utils will be used. + */ +class DateTypeAdapter extends TypeAdapter { - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } + private DateFormat dateFormat; - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return LocalDate.parse(date, formatter); - } - } - } + public DateTypeAdapter() {} - public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - offsetDateTimeTypeAdapter.setFormat(dateFormat); - return this; + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; } - public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { - localDateTypeAdapter.setFormat(dateFormat); - return this; + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; } - /** - * Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" format - * will be used (more efficient than SimpleDateFormat). - */ - public static class SqlDateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public SqlDateTypeAdapter() {} - - public SqlDateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, java.sql.Date date) throws IOException { - if (date == null) { - out.nullValue(); + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = date.toString(); - } - out.value(value); + value = ISO8601Utils.format(date, true); } + out.value(value); } + } - @Override - public java.sql.Date read(JsonReader in) throws IOException { + @Override + public Date read(JsonReader in) throws IOException { + try { switch (in.peek()) { case NULL: in.nextNull(); @@ -303,83 +190,17 @@ public java.sql.Date read(JsonReader in) throws IOException { String date = in.nextString(); try { if (dateFormat != null) { - return new java.sql.Date(dateFormat.parse(date).getTime()); + return dateFormat.parse(date); } - return new java.sql.Date( - ISO8601Utils.parse(date, new ParsePosition(0)).getTime() - ); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); } } - - /** - * Gson TypeAdapter for java.util.Date type If the dateFormat is null, ISO8601Utils will be used. - */ - public static class DateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public DateTypeAdapter() {} - - public DateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = ISO8601Utils.format(date, true); - } - out.value(value); - } - } - - @Override - public Date read(JsonReader in) throws IOException { - try { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return dateFormat.parse(date); - } - return ISO8601Utils.parse(date, new ParsePosition(0)); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } catch (IllegalArgumentException e) { - throw new JsonParseException(e); - } - } - } - - public JSON setDateFormat(DateFormat dateFormat) { - dateTypeAdapter.setFormat(dateFormat); - return this; - } - - public JSON setSqlDateFormat(DateFormat dateFormat) { - sqlDateTypeAdapter.setFormat(dateFormat); - return this; - } } // https://stackoverflow.com/questions/21458468/gson-wont-properly-serialise-a-class-that-extends-hashmap diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/exceptions/AlgoliaApiException.java b/algoliasearch-core/com/algolia/exceptions/AlgoliaApiException.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/exceptions/AlgoliaApiException.java rename to algoliasearch-core/com/algolia/exceptions/AlgoliaApiException.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/exceptions/AlgoliaRetryException.java b/algoliasearch-core/com/algolia/exceptions/AlgoliaRetryException.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/exceptions/AlgoliaRetryException.java rename to algoliasearch-core/com/algolia/exceptions/AlgoliaRetryException.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/exceptions/AlgoliaRuntimeException.java b/algoliasearch-core/com/algolia/exceptions/AlgoliaRuntimeException.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/exceptions/AlgoliaRuntimeException.java rename to algoliasearch-core/com/algolia/exceptions/AlgoliaRuntimeException.java diff --git a/algoliasearch-core/com/algolia/model/Action.java b/algoliasearch-core/com/algolia/model/Action.java deleted file mode 100644 index d77747289..000000000 --- a/algoliasearch-core/com/algolia/model/Action.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -/** type of operation. */ -@JsonAdapter(Action.Adapter.class) -public enum Action { - ADDOBJECT("addObject"), - - UPDATEOBJECT("updateObject"), - - PARTIALUPDATEOBJECT("partialUpdateObject"), - - PARTIALUPDATEOBJECTNOCREATE("partialUpdateObjectNoCreate"), - - DELETEOBJECT("deleteObject"), - - DELETE("delete"), - - CLEAR("clear"); - - private String value; - - Action(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static Action fromValue(String value) { - for (Action b : Action.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write(final JsonWriter jsonWriter, final Action enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public Action read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return Action.fromValue(value); - } - } -} diff --git a/algoliasearch-core/com/algolia/model/AddApiKeyResponse.java b/algoliasearch-core/com/algolia/model/AddApiKeyResponse.java deleted file mode 100644 index 0de446c36..000000000 --- a/algoliasearch-core/com/algolia/model/AddApiKeyResponse.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** AddApiKeyResponse */ -public class AddApiKeyResponse { - - @SerializedName("key") - private String key; - - @SerializedName("createdAt") - private String createdAt; - - public AddApiKeyResponse key(String key) { - this.key = key; - return this; - } - - /** - * Key string. - * - * @return key - */ - @javax.annotation.Nonnull - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public AddApiKeyResponse createdAt(String createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Date of creation (ISO-8601 format). - * - * @return createdAt - */ - @javax.annotation.Nonnull - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AddApiKeyResponse addApiKeyResponse = (AddApiKeyResponse) o; - return ( - Objects.equals(this.key, addApiKeyResponse.key) && - Objects.equals(this.createdAt, addApiKeyResponse.createdAt) - ); - } - - @Override - public int hashCode() { - return Objects.hash(key, createdAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddApiKeyResponse {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb - .append(" createdAt: ") - .append(toIndentedString(createdAt)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/Anchoring.java b/algoliasearch-core/com/algolia/model/Anchoring.java deleted file mode 100644 index 6f7077ec8..000000000 --- a/algoliasearch-core/com/algolia/model/Anchoring.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -/** - * Whether the pattern parameter must match the beginning or the end of the query string, or both, - * or none. - */ -@JsonAdapter(Anchoring.Adapter.class) -public enum Anchoring { - IS("is"), - - STARTSWITH("startsWith"), - - ENDSWITH("endsWith"), - - CONTAINS("contains"); - - private String value; - - Anchoring(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static Anchoring fromValue(String value) { - for (Anchoring b : Anchoring.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write(final JsonWriter jsonWriter, final Anchoring enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public Anchoring read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return Anchoring.fromValue(value); - } - } -} diff --git a/algoliasearch-core/com/algolia/model/ApiKey.java b/algoliasearch-core/com/algolia/model/ApiKey.java deleted file mode 100644 index 313ed2554..000000000 --- a/algoliasearch-core/com/algolia/model/ApiKey.java +++ /dev/null @@ -1,363 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Api Key object. */ -public class ApiKey { - - /** Gets or Sets acl */ - @JsonAdapter(AclEnum.Adapter.class) - public enum AclEnum { - ADDOBJECT("addObject"), - - ANALYTICS("analytics"), - - BROWSE("browse"), - - DELETEOBJECT("deleteObject"), - - DELETEINDEX("deleteIndex"), - - EDITSETTINGS("editSettings"), - - LISTINDEXES("listIndexes"), - - LOGS("logs"), - - PERSONALIZATION("personalization"), - - RECOMMENDATION("recommendation"), - - SEARCH("search"), - - SEEUNRETRIEVABLEATTRIBUTES("seeUnretrievableAttributes"), - - SETTINGS("settings"), - - USAGE("usage"); - - private String value; - - AclEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AclEnum fromValue(String value) { - for (AclEnum b : AclEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write(final JsonWriter jsonWriter, final AclEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AclEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AclEnum.fromValue(value); - } - } - } - - @SerializedName("acl") - private List acl = new ArrayList<>(); - - @SerializedName("description") - private String description = ""; - - @SerializedName("indexes") - private List indexes = null; - - @SerializedName("maxHitsPerQuery") - private Integer maxHitsPerQuery = 0; - - @SerializedName("maxQueriesPerIPPerHour") - private Integer maxQueriesPerIPPerHour = 0; - - @SerializedName("queryParameters") - private String queryParameters = ""; - - @SerializedName("referers") - private List referers = null; - - @SerializedName("validity") - private Integer validity = 0; - - public ApiKey acl(List acl) { - this.acl = acl; - return this; - } - - public ApiKey addAclItem(AclEnum aclItem) { - this.acl.add(aclItem); - return this; - } - - /** - * Set of permissions associated with the key. - * - * @return acl - */ - @javax.annotation.Nonnull - public List getAcl() { - return acl; - } - - public void setAcl(List acl) { - this.acl = acl; - } - - public ApiKey description(String description) { - this.description = description; - return this; - } - - /** - * A comment used to identify a key more easily in the dashboard. It is not interpreted by the - * API. - * - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public ApiKey indexes(List indexes) { - this.indexes = indexes; - return this; - } - - public ApiKey addIndexesItem(String indexesItem) { - if (this.indexes == null) { - this.indexes = new ArrayList<>(); - } - this.indexes.add(indexesItem); - return this; - } - - /** - * Restrict this new API key to a list of indices or index patterns. If the list is empty, all - * indices are allowed. - * - * @return indexes - */ - @javax.annotation.Nullable - public List getIndexes() { - return indexes; - } - - public void setIndexes(List indexes) { - this.indexes = indexes; - } - - public ApiKey maxHitsPerQuery(Integer maxHitsPerQuery) { - this.maxHitsPerQuery = maxHitsPerQuery; - return this; - } - - /** - * Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. - * - * @return maxHitsPerQuery - */ - @javax.annotation.Nullable - public Integer getMaxHitsPerQuery() { - return maxHitsPerQuery; - } - - public void setMaxHitsPerQuery(Integer maxHitsPerQuery) { - this.maxHitsPerQuery = maxHitsPerQuery; - } - - public ApiKey maxQueriesPerIPPerHour(Integer maxQueriesPerIPPerHour) { - this.maxQueriesPerIPPerHour = maxQueriesPerIPPerHour; - return this; - } - - /** - * Maximum number of API calls per hour allowed from a given IP address or a user token. - * - * @return maxQueriesPerIPPerHour - */ - @javax.annotation.Nullable - public Integer getMaxQueriesPerIPPerHour() { - return maxQueriesPerIPPerHour; - } - - public void setMaxQueriesPerIPPerHour(Integer maxQueriesPerIPPerHour) { - this.maxQueriesPerIPPerHour = maxQueriesPerIPPerHour; - } - - public ApiKey queryParameters(String queryParameters) { - this.queryParameters = queryParameters; - return this; - } - - /** - * URL-encoded query string. Force some query parameters to be applied for each query made with - * this API key. - * - * @return queryParameters - */ - @javax.annotation.Nullable - public String getQueryParameters() { - return queryParameters; - } - - public void setQueryParameters(String queryParameters) { - this.queryParameters = queryParameters; - } - - public ApiKey referers(List referers) { - this.referers = referers; - return this; - } - - public ApiKey addReferersItem(String referersItem) { - if (this.referers == null) { - this.referers = new ArrayList<>(); - } - this.referers.add(referersItem); - return this; - } - - /** - * Restrict this new API key to specific referers. If empty or blank, defaults to all referers. - * - * @return referers - */ - @javax.annotation.Nullable - public List getReferers() { - return referers; - } - - public void setReferers(List referers) { - this.referers = referers; - } - - public ApiKey validity(Integer validity) { - this.validity = validity; - return this; - } - - /** - * Validity limit for this key in seconds. The key will automatically be removed after this period - * of time. - * - * @return validity - */ - @javax.annotation.Nullable - public Integer getValidity() { - return validity; - } - - public void setValidity(Integer validity) { - this.validity = validity; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ApiKey apiKey = (ApiKey) o; - return ( - Objects.equals(this.acl, apiKey.acl) && - Objects.equals(this.description, apiKey.description) && - Objects.equals(this.indexes, apiKey.indexes) && - Objects.equals(this.maxHitsPerQuery, apiKey.maxHitsPerQuery) && - Objects.equals( - this.maxQueriesPerIPPerHour, - apiKey.maxQueriesPerIPPerHour - ) && - Objects.equals(this.queryParameters, apiKey.queryParameters) && - Objects.equals(this.referers, apiKey.referers) && - Objects.equals(this.validity, apiKey.validity) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - acl, - description, - indexes, - maxHitsPerQuery, - maxQueriesPerIPPerHour, - queryParameters, - referers, - validity - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiKey {\n"); - sb.append(" acl: ").append(toIndentedString(acl)).append("\n"); - sb - .append(" description: ") - .append(toIndentedString(description)) - .append("\n"); - sb.append(" indexes: ").append(toIndentedString(indexes)).append("\n"); - sb - .append(" maxHitsPerQuery: ") - .append(toIndentedString(maxHitsPerQuery)) - .append("\n"); - sb - .append(" maxQueriesPerIPPerHour: ") - .append(toIndentedString(maxQueriesPerIPPerHour)) - .append("\n"); - sb - .append(" queryParameters: ") - .append(toIndentedString(queryParameters)) - .append("\n"); - sb.append(" referers: ").append(toIndentedString(referers)).append("\n"); - sb.append(" validity: ").append(toIndentedString(validity)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/AssignUserIdParams.java b/algoliasearch-core/com/algolia/model/AssignUserIdParams.java deleted file mode 100644 index 33f6d0cc7..000000000 --- a/algoliasearch-core/com/algolia/model/AssignUserIdParams.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** Assign userID parameters. */ -public class AssignUserIdParams { - - @SerializedName("cluster") - private String cluster; - - public AssignUserIdParams cluster(String cluster) { - this.cluster = cluster; - return this; - } - - /** - * Name of the cluster. - * - * @return cluster - */ - @javax.annotation.Nonnull - public String getCluster() { - return cluster; - } - - public void setCluster(String cluster) { - this.cluster = cluster; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AssignUserIdParams assignUserIdParams = (AssignUserIdParams) o; - return Objects.equals(this.cluster, assignUserIdParams.cluster); - } - - @Override - public int hashCode() { - return Objects.hash(cluster); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AssignUserIdParams {\n"); - sb.append(" cluster: ").append(toIndentedString(cluster)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/AutomaticFacetFilter.java b/algoliasearch-core/com/algolia/model/AutomaticFacetFilter.java deleted file mode 100644 index 0badc11f3..000000000 --- a/algoliasearch-core/com/algolia/model/AutomaticFacetFilter.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** Automatic facet Filter. */ -public class AutomaticFacetFilter { - - @SerializedName("facet") - private String facet; - - @SerializedName("score") - private Integer score = 1; - - @SerializedName("disjunctive") - private Boolean disjunctive = false; - - public AutomaticFacetFilter facet(String facet) { - this.facet = facet; - return this; - } - - /** - * Attribute to filter on. This must match a facet placeholder in the Rule's pattern. - * - * @return facet - */ - @javax.annotation.Nonnull - public String getFacet() { - return facet; - } - - public void setFacet(String facet) { - this.facet = facet; - } - - public AutomaticFacetFilter score(Integer score) { - this.score = score; - return this; - } - - /** - * Score for the filter. Typically used for optional or disjunctive filters. - * - * @return score - */ - @javax.annotation.Nullable - public Integer getScore() { - return score; - } - - public void setScore(Integer score) { - this.score = score; - } - - public AutomaticFacetFilter disjunctive(Boolean disjunctive) { - this.disjunctive = disjunctive; - return this; - } - - /** - * Whether the filter is disjunctive (true) or conjunctive (false). - * - * @return disjunctive - */ - @javax.annotation.Nullable - public Boolean getDisjunctive() { - return disjunctive; - } - - public void setDisjunctive(Boolean disjunctive) { - this.disjunctive = disjunctive; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AutomaticFacetFilter automaticFacetFilter = (AutomaticFacetFilter) o; - return ( - Objects.equals(this.facet, automaticFacetFilter.facet) && - Objects.equals(this.score, automaticFacetFilter.score) && - Objects.equals(this.disjunctive, automaticFacetFilter.disjunctive) - ); - } - - @Override - public int hashCode() { - return Objects.hash(facet, score, disjunctive); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AutomaticFacetFilter {\n"); - sb.append(" facet: ").append(toIndentedString(facet)).append("\n"); - sb.append(" score: ").append(toIndentedString(score)).append("\n"); - sb - .append(" disjunctive: ") - .append(toIndentedString(disjunctive)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BaseBrowseResponse.java b/algoliasearch-core/com/algolia/model/BaseBrowseResponse.java deleted file mode 100644 index 1657eccac..000000000 --- a/algoliasearch-core/com/algolia/model/BaseBrowseResponse.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** BaseBrowseResponse */ -public class BaseBrowseResponse { - - @SerializedName("cursor") - private String cursor; - - public BaseBrowseResponse cursor(String cursor) { - this.cursor = cursor; - return this; - } - - /** - * Cursor indicating the location to resume browsing from. Must match the value returned by the - * previous call. - * - * @return cursor - */ - @javax.annotation.Nonnull - public String getCursor() { - return cursor; - } - - public void setCursor(String cursor) { - this.cursor = cursor; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BaseBrowseResponse baseBrowseResponse = (BaseBrowseResponse) o; - return Objects.equals(this.cursor, baseBrowseResponse.cursor); - } - - @Override - public int hashCode() { - return Objects.hash(cursor); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseBrowseResponse {\n"); - sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BaseIndexSettings.java b/algoliasearch-core/com/algolia/model/BaseIndexSettings.java deleted file mode 100644 index 4b8304988..000000000 --- a/algoliasearch-core/com/algolia/model/BaseIndexSettings.java +++ /dev/null @@ -1,494 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** BaseIndexSettings */ -public class BaseIndexSettings { - - @SerializedName("replicas") - private List replicas = null; - - @SerializedName("paginationLimitedTo") - private Integer paginationLimitedTo = 1000; - - @SerializedName("disableTypoToleranceOnWords") - private List disableTypoToleranceOnWords = null; - - @SerializedName("attributesToTransliterate") - private List attributesToTransliterate = null; - - @SerializedName("camelCaseAttributes") - private List camelCaseAttributes = null; - - @SerializedName("decompoundedAttributes") - private Object decompoundedAttributes = new Object(); - - @SerializedName("indexLanguages") - private List indexLanguages = null; - - @SerializedName("filterPromotes") - private Boolean filterPromotes = false; - - @SerializedName("disablePrefixOnAttributes") - private List disablePrefixOnAttributes = null; - - @SerializedName("allowCompressionOfIntegerArray") - private Boolean allowCompressionOfIntegerArray = false; - - @SerializedName("numericAttributesForFiltering") - private List numericAttributesForFiltering = null; - - @SerializedName("userData") - private Object userData = new Object(); - - public BaseIndexSettings replicas(List replicas) { - this.replicas = replicas; - return this; - } - - public BaseIndexSettings addReplicasItem(String replicasItem) { - if (this.replicas == null) { - this.replicas = new ArrayList<>(); - } - this.replicas.add(replicasItem); - return this; - } - - /** - * Creates replicas, exact copies of an index. - * - * @return replicas - */ - @javax.annotation.Nullable - public List getReplicas() { - return replicas; - } - - public void setReplicas(List replicas) { - this.replicas = replicas; - } - - public BaseIndexSettings paginationLimitedTo(Integer paginationLimitedTo) { - this.paginationLimitedTo = paginationLimitedTo; - return this; - } - - /** - * Set the maximum number of hits accessible via pagination. - * - * @return paginationLimitedTo - */ - @javax.annotation.Nullable - public Integer getPaginationLimitedTo() { - return paginationLimitedTo; - } - - public void setPaginationLimitedTo(Integer paginationLimitedTo) { - this.paginationLimitedTo = paginationLimitedTo; - } - - public BaseIndexSettings disableTypoToleranceOnWords( - List disableTypoToleranceOnWords - ) { - this.disableTypoToleranceOnWords = disableTypoToleranceOnWords; - return this; - } - - public BaseIndexSettings addDisableTypoToleranceOnWordsItem( - String disableTypoToleranceOnWordsItem - ) { - if (this.disableTypoToleranceOnWords == null) { - this.disableTypoToleranceOnWords = new ArrayList<>(); - } - this.disableTypoToleranceOnWords.add(disableTypoToleranceOnWordsItem); - return this; - } - - /** - * A list of words for which you want to turn off typo tolerance. - * - * @return disableTypoToleranceOnWords - */ - @javax.annotation.Nullable - public List getDisableTypoToleranceOnWords() { - return disableTypoToleranceOnWords; - } - - public void setDisableTypoToleranceOnWords( - List disableTypoToleranceOnWords - ) { - this.disableTypoToleranceOnWords = disableTypoToleranceOnWords; - } - - public BaseIndexSettings attributesToTransliterate( - List attributesToTransliterate - ) { - this.attributesToTransliterate = attributesToTransliterate; - return this; - } - - public BaseIndexSettings addAttributesToTransliterateItem( - String attributesToTransliterateItem - ) { - if (this.attributesToTransliterate == null) { - this.attributesToTransliterate = new ArrayList<>(); - } - this.attributesToTransliterate.add(attributesToTransliterateItem); - return this; - } - - /** - * Specify on which attributes to apply transliteration. - * - * @return attributesToTransliterate - */ - @javax.annotation.Nullable - public List getAttributesToTransliterate() { - return attributesToTransliterate; - } - - public void setAttributesToTransliterate( - List attributesToTransliterate - ) { - this.attributesToTransliterate = attributesToTransliterate; - } - - public BaseIndexSettings camelCaseAttributes( - List camelCaseAttributes - ) { - this.camelCaseAttributes = camelCaseAttributes; - return this; - } - - public BaseIndexSettings addCamelCaseAttributesItem( - String camelCaseAttributesItem - ) { - if (this.camelCaseAttributes == null) { - this.camelCaseAttributes = new ArrayList<>(); - } - this.camelCaseAttributes.add(camelCaseAttributesItem); - return this; - } - - /** - * List of attributes on which to do a decomposition of camel case words. - * - * @return camelCaseAttributes - */ - @javax.annotation.Nullable - public List getCamelCaseAttributes() { - return camelCaseAttributes; - } - - public void setCamelCaseAttributes(List camelCaseAttributes) { - this.camelCaseAttributes = camelCaseAttributes; - } - - public BaseIndexSettings decompoundedAttributes( - Object decompoundedAttributes - ) { - this.decompoundedAttributes = decompoundedAttributes; - return this; - } - - /** - * Specify on which attributes in your index Algolia should apply word segmentation, also known as - * decompounding. - * - * @return decompoundedAttributes - */ - @javax.annotation.Nullable - public Object getDecompoundedAttributes() { - return decompoundedAttributes; - } - - public void setDecompoundedAttributes(Object decompoundedAttributes) { - this.decompoundedAttributes = decompoundedAttributes; - } - - public BaseIndexSettings indexLanguages(List indexLanguages) { - this.indexLanguages = indexLanguages; - return this; - } - - public BaseIndexSettings addIndexLanguagesItem(String indexLanguagesItem) { - if (this.indexLanguages == null) { - this.indexLanguages = new ArrayList<>(); - } - this.indexLanguages.add(indexLanguagesItem); - return this; - } - - /** - * Sets the languages at the index level for language-specific processing such as tokenization and - * normalization. - * - * @return indexLanguages - */ - @javax.annotation.Nullable - public List getIndexLanguages() { - return indexLanguages; - } - - public void setIndexLanguages(List indexLanguages) { - this.indexLanguages = indexLanguages; - } - - public BaseIndexSettings filterPromotes(Boolean filterPromotes) { - this.filterPromotes = filterPromotes; - return this; - } - - /** - * Whether promoted results should match the filters of the current search, except for geographic - * filters. - * - * @return filterPromotes - */ - @javax.annotation.Nullable - public Boolean getFilterPromotes() { - return filterPromotes; - } - - public void setFilterPromotes(Boolean filterPromotes) { - this.filterPromotes = filterPromotes; - } - - public BaseIndexSettings disablePrefixOnAttributes( - List disablePrefixOnAttributes - ) { - this.disablePrefixOnAttributes = disablePrefixOnAttributes; - return this; - } - - public BaseIndexSettings addDisablePrefixOnAttributesItem( - String disablePrefixOnAttributesItem - ) { - if (this.disablePrefixOnAttributes == null) { - this.disablePrefixOnAttributes = new ArrayList<>(); - } - this.disablePrefixOnAttributes.add(disablePrefixOnAttributesItem); - return this; - } - - /** - * List of attributes on which you want to disable prefix matching. - * - * @return disablePrefixOnAttributes - */ - @javax.annotation.Nullable - public List getDisablePrefixOnAttributes() { - return disablePrefixOnAttributes; - } - - public void setDisablePrefixOnAttributes( - List disablePrefixOnAttributes - ) { - this.disablePrefixOnAttributes = disablePrefixOnAttributes; - } - - public BaseIndexSettings allowCompressionOfIntegerArray( - Boolean allowCompressionOfIntegerArray - ) { - this.allowCompressionOfIntegerArray = allowCompressionOfIntegerArray; - return this; - } - - /** - * Enables compression of large integer arrays. - * - * @return allowCompressionOfIntegerArray - */ - @javax.annotation.Nullable - public Boolean getAllowCompressionOfIntegerArray() { - return allowCompressionOfIntegerArray; - } - - public void setAllowCompressionOfIntegerArray( - Boolean allowCompressionOfIntegerArray - ) { - this.allowCompressionOfIntegerArray = allowCompressionOfIntegerArray; - } - - public BaseIndexSettings numericAttributesForFiltering( - List numericAttributesForFiltering - ) { - this.numericAttributesForFiltering = numericAttributesForFiltering; - return this; - } - - public BaseIndexSettings addNumericAttributesForFilteringItem( - String numericAttributesForFilteringItem - ) { - if (this.numericAttributesForFiltering == null) { - this.numericAttributesForFiltering = new ArrayList<>(); - } - this.numericAttributesForFiltering.add(numericAttributesForFilteringItem); - return this; - } - - /** - * List of numeric attributes that can be used as numerical filters. - * - * @return numericAttributesForFiltering - */ - @javax.annotation.Nullable - public List getNumericAttributesForFiltering() { - return numericAttributesForFiltering; - } - - public void setNumericAttributesForFiltering( - List numericAttributesForFiltering - ) { - this.numericAttributesForFiltering = numericAttributesForFiltering; - } - - public BaseIndexSettings userData(Object userData) { - this.userData = userData; - return this; - } - - /** - * Lets you store custom data in your indices. - * - * @return userData - */ - @javax.annotation.Nullable - public Object getUserData() { - return userData; - } - - public void setUserData(Object userData) { - this.userData = userData; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BaseIndexSettings baseIndexSettings = (BaseIndexSettings) o; - return ( - Objects.equals(this.replicas, baseIndexSettings.replicas) && - Objects.equals( - this.paginationLimitedTo, - baseIndexSettings.paginationLimitedTo - ) && - Objects.equals( - this.disableTypoToleranceOnWords, - baseIndexSettings.disableTypoToleranceOnWords - ) && - Objects.equals( - this.attributesToTransliterate, - baseIndexSettings.attributesToTransliterate - ) && - Objects.equals( - this.camelCaseAttributes, - baseIndexSettings.camelCaseAttributes - ) && - Objects.equals( - this.decompoundedAttributes, - baseIndexSettings.decompoundedAttributes - ) && - Objects.equals(this.indexLanguages, baseIndexSettings.indexLanguages) && - Objects.equals(this.filterPromotes, baseIndexSettings.filterPromotes) && - Objects.equals( - this.disablePrefixOnAttributes, - baseIndexSettings.disablePrefixOnAttributes - ) && - Objects.equals( - this.allowCompressionOfIntegerArray, - baseIndexSettings.allowCompressionOfIntegerArray - ) && - Objects.equals( - this.numericAttributesForFiltering, - baseIndexSettings.numericAttributesForFiltering - ) && - Objects.equals(this.userData, baseIndexSettings.userData) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - replicas, - paginationLimitedTo, - disableTypoToleranceOnWords, - attributesToTransliterate, - camelCaseAttributes, - decompoundedAttributes, - indexLanguages, - filterPromotes, - disablePrefixOnAttributes, - allowCompressionOfIntegerArray, - numericAttributesForFiltering, - userData - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseIndexSettings {\n"); - sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n"); - sb - .append(" paginationLimitedTo: ") - .append(toIndentedString(paginationLimitedTo)) - .append("\n"); - sb - .append(" disableTypoToleranceOnWords: ") - .append(toIndentedString(disableTypoToleranceOnWords)) - .append("\n"); - sb - .append(" attributesToTransliterate: ") - .append(toIndentedString(attributesToTransliterate)) - .append("\n"); - sb - .append(" camelCaseAttributes: ") - .append(toIndentedString(camelCaseAttributes)) - .append("\n"); - sb - .append(" decompoundedAttributes: ") - .append(toIndentedString(decompoundedAttributes)) - .append("\n"); - sb - .append(" indexLanguages: ") - .append(toIndentedString(indexLanguages)) - .append("\n"); - sb - .append(" filterPromotes: ") - .append(toIndentedString(filterPromotes)) - .append("\n"); - sb - .append(" disablePrefixOnAttributes: ") - .append(toIndentedString(disablePrefixOnAttributes)) - .append("\n"); - sb - .append(" allowCompressionOfIntegerArray: ") - .append(toIndentedString(allowCompressionOfIntegerArray)) - .append("\n"); - sb - .append(" numericAttributesForFiltering: ") - .append(toIndentedString(numericAttributesForFiltering)) - .append("\n"); - sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BaseSearchParams.java b/algoliasearch-core/com/algolia/model/BaseSearchParams.java deleted file mode 100644 index cbe3be160..000000000 --- a/algoliasearch-core/com/algolia/model/BaseSearchParams.java +++ /dev/null @@ -1,1050 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** BaseSearchParams */ -public class BaseSearchParams { - - @SerializedName("similarQuery") - private String similarQuery = ""; - - @SerializedName("filters") - private String filters = ""; - - @SerializedName("facetFilters") - private List facetFilters = null; - - @SerializedName("optionalFilters") - private List optionalFilters = null; - - @SerializedName("numericFilters") - private List numericFilters = null; - - @SerializedName("tagFilters") - private List tagFilters = null; - - @SerializedName("sumOrFiltersScores") - private Boolean sumOrFiltersScores = false; - - @SerializedName("facets") - private List facets = null; - - @SerializedName("maxValuesPerFacet") - private Integer maxValuesPerFacet = 100; - - @SerializedName("facetingAfterDistinct") - private Boolean facetingAfterDistinct = false; - - @SerializedName("sortFacetValuesBy") - private String sortFacetValuesBy = "count"; - - @SerializedName("page") - private Integer page = 0; - - @SerializedName("offset") - private Integer offset; - - @SerializedName("length") - private Integer length; - - @SerializedName("aroundLatLng") - private String aroundLatLng = ""; - - @SerializedName("aroundLatLngViaIP") - private Boolean aroundLatLngViaIP = false; - - @SerializedName("aroundRadius") - private OneOfintegerstring aroundRadius; - - @SerializedName("aroundPrecision") - private Integer aroundPrecision = 10; - - @SerializedName("minimumAroundRadius") - private Integer minimumAroundRadius; - - @SerializedName("insideBoundingBox") - private List insideBoundingBox = null; - - @SerializedName("insidePolygon") - private List insidePolygon = null; - - @SerializedName("naturalLanguages") - private List naturalLanguages = null; - - @SerializedName("ruleContexts") - private List ruleContexts = null; - - @SerializedName("personalizationImpact") - private Integer personalizationImpact = 100; - - @SerializedName("userToken") - private String userToken; - - @SerializedName("getRankingInfo") - private Boolean getRankingInfo = false; - - @SerializedName("clickAnalytics") - private Boolean clickAnalytics = false; - - @SerializedName("analytics") - private Boolean analytics = true; - - @SerializedName("analyticsTags") - private List analyticsTags = null; - - @SerializedName("percentileComputation") - private Boolean percentileComputation = true; - - @SerializedName("enableABTest") - private Boolean enableABTest = true; - - @SerializedName("enableReRanking") - private Boolean enableReRanking = true; - - public BaseSearchParams similarQuery(String similarQuery) { - this.similarQuery = similarQuery; - return this; - } - - /** - * Overrides the query parameter and performs a more generic search that can be used to find - * \"similar\" results. - * - * @return similarQuery - */ - @javax.annotation.Nullable - public String getSimilarQuery() { - return similarQuery; - } - - public void setSimilarQuery(String similarQuery) { - this.similarQuery = similarQuery; - } - - public BaseSearchParams filters(String filters) { - this.filters = filters; - return this; - } - - /** - * Filter the query with numeric, facet and/or tag filters. - * - * @return filters - */ - @javax.annotation.Nullable - public String getFilters() { - return filters; - } - - public void setFilters(String filters) { - this.filters = filters; - } - - public BaseSearchParams facetFilters(List facetFilters) { - this.facetFilters = facetFilters; - return this; - } - - public BaseSearchParams addFacetFiltersItem(String facetFiltersItem) { - if (this.facetFilters == null) { - this.facetFilters = new ArrayList<>(); - } - this.facetFilters.add(facetFiltersItem); - return this; - } - - /** - * Filter hits by facet value. - * - * @return facetFilters - */ - @javax.annotation.Nullable - public List getFacetFilters() { - return facetFilters; - } - - public void setFacetFilters(List facetFilters) { - this.facetFilters = facetFilters; - } - - public BaseSearchParams optionalFilters(List optionalFilters) { - this.optionalFilters = optionalFilters; - return this; - } - - public BaseSearchParams addOptionalFiltersItem(String optionalFiltersItem) { - if (this.optionalFilters == null) { - this.optionalFilters = new ArrayList<>(); - } - this.optionalFilters.add(optionalFiltersItem); - return this; - } - - /** - * Create filters for ranking purposes, where records that match the filter are ranked higher, or - * lower in the case of a negative optional filter. - * - * @return optionalFilters - */ - @javax.annotation.Nullable - public List getOptionalFilters() { - return optionalFilters; - } - - public void setOptionalFilters(List optionalFilters) { - this.optionalFilters = optionalFilters; - } - - public BaseSearchParams numericFilters(List numericFilters) { - this.numericFilters = numericFilters; - return this; - } - - public BaseSearchParams addNumericFiltersItem(String numericFiltersItem) { - if (this.numericFilters == null) { - this.numericFilters = new ArrayList<>(); - } - this.numericFilters.add(numericFiltersItem); - return this; - } - - /** - * Filter on numeric attributes. - * - * @return numericFilters - */ - @javax.annotation.Nullable - public List getNumericFilters() { - return numericFilters; - } - - public void setNumericFilters(List numericFilters) { - this.numericFilters = numericFilters; - } - - public BaseSearchParams tagFilters(List tagFilters) { - this.tagFilters = tagFilters; - return this; - } - - public BaseSearchParams addTagFiltersItem(String tagFiltersItem) { - if (this.tagFilters == null) { - this.tagFilters = new ArrayList<>(); - } - this.tagFilters.add(tagFiltersItem); - return this; - } - - /** - * Filter hits by tags. - * - * @return tagFilters - */ - @javax.annotation.Nullable - public List getTagFilters() { - return tagFilters; - } - - public void setTagFilters(List tagFilters) { - this.tagFilters = tagFilters; - } - - public BaseSearchParams sumOrFiltersScores(Boolean sumOrFiltersScores) { - this.sumOrFiltersScores = sumOrFiltersScores; - return this; - } - - /** - * Determines how to calculate the total score for filtering. - * - * @return sumOrFiltersScores - */ - @javax.annotation.Nullable - public Boolean getSumOrFiltersScores() { - return sumOrFiltersScores; - } - - public void setSumOrFiltersScores(Boolean sumOrFiltersScores) { - this.sumOrFiltersScores = sumOrFiltersScores; - } - - public BaseSearchParams facets(List facets) { - this.facets = facets; - return this; - } - - public BaseSearchParams addFacetsItem(String facetsItem) { - if (this.facets == null) { - this.facets = new ArrayList<>(); - } - this.facets.add(facetsItem); - return this; - } - - /** - * Retrieve facets and their facet values. - * - * @return facets - */ - @javax.annotation.Nullable - public List getFacets() { - return facets; - } - - public void setFacets(List facets) { - this.facets = facets; - } - - public BaseSearchParams maxValuesPerFacet(Integer maxValuesPerFacet) { - this.maxValuesPerFacet = maxValuesPerFacet; - return this; - } - - /** - * Maximum number of facet values to return for each facet during a regular search. - * - * @return maxValuesPerFacet - */ - @javax.annotation.Nullable - public Integer getMaxValuesPerFacet() { - return maxValuesPerFacet; - } - - public void setMaxValuesPerFacet(Integer maxValuesPerFacet) { - this.maxValuesPerFacet = maxValuesPerFacet; - } - - public BaseSearchParams facetingAfterDistinct(Boolean facetingAfterDistinct) { - this.facetingAfterDistinct = facetingAfterDistinct; - return this; - } - - /** - * Force faceting to be applied after de-duplication (via the Distinct setting). - * - * @return facetingAfterDistinct - */ - @javax.annotation.Nullable - public Boolean getFacetingAfterDistinct() { - return facetingAfterDistinct; - } - - public void setFacetingAfterDistinct(Boolean facetingAfterDistinct) { - this.facetingAfterDistinct = facetingAfterDistinct; - } - - public BaseSearchParams sortFacetValuesBy(String sortFacetValuesBy) { - this.sortFacetValuesBy = sortFacetValuesBy; - return this; - } - - /** - * Controls how facet values are fetched. - * - * @return sortFacetValuesBy - */ - @javax.annotation.Nullable - public String getSortFacetValuesBy() { - return sortFacetValuesBy; - } - - public void setSortFacetValuesBy(String sortFacetValuesBy) { - this.sortFacetValuesBy = sortFacetValuesBy; - } - - public BaseSearchParams page(Integer page) { - this.page = page; - return this; - } - - /** - * Specify the page to retrieve. - * - * @return page - */ - @javax.annotation.Nullable - public Integer getPage() { - return page; - } - - public void setPage(Integer page) { - this.page = page; - } - - public BaseSearchParams offset(Integer offset) { - this.offset = offset; - return this; - } - - /** - * Specify the offset of the first hit to return. - * - * @return offset - */ - @javax.annotation.Nullable - public Integer getOffset() { - return offset; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public BaseSearchParams length(Integer length) { - this.length = length; - return this; - } - - /** - * Set the number of hits to retrieve (used only with offset). minimum: 1 maximum: 1000 - * - * @return length - */ - @javax.annotation.Nullable - public Integer getLength() { - return length; - } - - public void setLength(Integer length) { - this.length = length; - } - - public BaseSearchParams aroundLatLng(String aroundLatLng) { - this.aroundLatLng = aroundLatLng; - return this; - } - - /** - * Search for entries around a central geolocation, enabling a geo search within a circular area. - * - * @return aroundLatLng - */ - @javax.annotation.Nullable - public String getAroundLatLng() { - return aroundLatLng; - } - - public void setAroundLatLng(String aroundLatLng) { - this.aroundLatLng = aroundLatLng; - } - - public BaseSearchParams aroundLatLngViaIP(Boolean aroundLatLngViaIP) { - this.aroundLatLngViaIP = aroundLatLngViaIP; - return this; - } - - /** - * Search for entries around a given location automatically computed from the requester's IP - * address. - * - * @return aroundLatLngViaIP - */ - @javax.annotation.Nullable - public Boolean getAroundLatLngViaIP() { - return aroundLatLngViaIP; - } - - public void setAroundLatLngViaIP(Boolean aroundLatLngViaIP) { - this.aroundLatLngViaIP = aroundLatLngViaIP; - } - - public BaseSearchParams aroundRadius(OneOfintegerstring aroundRadius) { - this.aroundRadius = aroundRadius; - return this; - } - - /** - * Define the maximum radius for a geo search (in meters). - * - * @return aroundRadius - */ - @javax.annotation.Nullable - public OneOfintegerstring getAroundRadius() { - return aroundRadius; - } - - public void setAroundRadius(OneOfintegerstring aroundRadius) { - this.aroundRadius = aroundRadius; - } - - public BaseSearchParams aroundPrecision(Integer aroundPrecision) { - this.aroundPrecision = aroundPrecision; - return this; - } - - /** - * Precision of geo search (in meters), to add grouping by geo location to the ranking formula. - * - * @return aroundPrecision - */ - @javax.annotation.Nullable - public Integer getAroundPrecision() { - return aroundPrecision; - } - - public void setAroundPrecision(Integer aroundPrecision) { - this.aroundPrecision = aroundPrecision; - } - - public BaseSearchParams minimumAroundRadius(Integer minimumAroundRadius) { - this.minimumAroundRadius = minimumAroundRadius; - return this; - } - - /** - * Minimum radius (in meters) used for a geo search when aroundRadius is not set. minimum: 1 - * - * @return minimumAroundRadius - */ - @javax.annotation.Nullable - public Integer getMinimumAroundRadius() { - return minimumAroundRadius; - } - - public void setMinimumAroundRadius(Integer minimumAroundRadius) { - this.minimumAroundRadius = minimumAroundRadius; - } - - public BaseSearchParams insideBoundingBox( - List insideBoundingBox - ) { - this.insideBoundingBox = insideBoundingBox; - return this; - } - - public BaseSearchParams addInsideBoundingBoxItem( - BigDecimal insideBoundingBoxItem - ) { - if (this.insideBoundingBox == null) { - this.insideBoundingBox = new ArrayList<>(); - } - this.insideBoundingBox.add(insideBoundingBoxItem); - return this; - } - - /** - * Search inside a rectangular area (in geo coordinates). - * - * @return insideBoundingBox - */ - @javax.annotation.Nullable - public List getInsideBoundingBox() { - return insideBoundingBox; - } - - public void setInsideBoundingBox(List insideBoundingBox) { - this.insideBoundingBox = insideBoundingBox; - } - - public BaseSearchParams insidePolygon(List insidePolygon) { - this.insidePolygon = insidePolygon; - return this; - } - - public BaseSearchParams addInsidePolygonItem(BigDecimal insidePolygonItem) { - if (this.insidePolygon == null) { - this.insidePolygon = new ArrayList<>(); - } - this.insidePolygon.add(insidePolygonItem); - return this; - } - - /** - * Search inside a polygon (in geo coordinates). - * - * @return insidePolygon - */ - @javax.annotation.Nullable - public List getInsidePolygon() { - return insidePolygon; - } - - public void setInsidePolygon(List insidePolygon) { - this.insidePolygon = insidePolygon; - } - - public BaseSearchParams naturalLanguages(List naturalLanguages) { - this.naturalLanguages = naturalLanguages; - return this; - } - - public BaseSearchParams addNaturalLanguagesItem(String naturalLanguagesItem) { - if (this.naturalLanguages == null) { - this.naturalLanguages = new ArrayList<>(); - } - this.naturalLanguages.add(naturalLanguagesItem); - return this; - } - - /** - * This parameter changes the default values of certain parameters and settings that work best for - * a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, - * analyticsTags and ruleContexts. These parameters and settings work well together when the query - * is formatted in natural language instead of keywords, for example when your user performs a - * voice search. - * - * @return naturalLanguages - */ - @javax.annotation.Nullable - public List getNaturalLanguages() { - return naturalLanguages; - } - - public void setNaturalLanguages(List naturalLanguages) { - this.naturalLanguages = naturalLanguages; - } - - public BaseSearchParams ruleContexts(List ruleContexts) { - this.ruleContexts = ruleContexts; - return this; - } - - public BaseSearchParams addRuleContextsItem(String ruleContextsItem) { - if (this.ruleContexts == null) { - this.ruleContexts = new ArrayList<>(); - } - this.ruleContexts.add(ruleContextsItem); - return this; - } - - /** - * Enables contextual rules. - * - * @return ruleContexts - */ - @javax.annotation.Nullable - public List getRuleContexts() { - return ruleContexts; - } - - public void setRuleContexts(List ruleContexts) { - this.ruleContexts = ruleContexts; - } - - public BaseSearchParams personalizationImpact(Integer personalizationImpact) { - this.personalizationImpact = personalizationImpact; - return this; - } - - /** - * Define the impact of the Personalization feature. - * - * @return personalizationImpact - */ - @javax.annotation.Nullable - public Integer getPersonalizationImpact() { - return personalizationImpact; - } - - public void setPersonalizationImpact(Integer personalizationImpact) { - this.personalizationImpact = personalizationImpact; - } - - public BaseSearchParams userToken(String userToken) { - this.userToken = userToken; - return this; - } - - /** - * Associates a certain user token with the current search. - * - * @return userToken - */ - @javax.annotation.Nullable - public String getUserToken() { - return userToken; - } - - public void setUserToken(String userToken) { - this.userToken = userToken; - } - - public BaseSearchParams getRankingInfo(Boolean getRankingInfo) { - this.getRankingInfo = getRankingInfo; - return this; - } - - /** - * Retrieve detailed ranking information. - * - * @return getRankingInfo - */ - @javax.annotation.Nullable - public Boolean getGetRankingInfo() { - return getRankingInfo; - } - - public void setGetRankingInfo(Boolean getRankingInfo) { - this.getRankingInfo = getRankingInfo; - } - - public BaseSearchParams clickAnalytics(Boolean clickAnalytics) { - this.clickAnalytics = clickAnalytics; - return this; - } - - /** - * Enable the Click Analytics feature. - * - * @return clickAnalytics - */ - @javax.annotation.Nullable - public Boolean getClickAnalytics() { - return clickAnalytics; - } - - public void setClickAnalytics(Boolean clickAnalytics) { - this.clickAnalytics = clickAnalytics; - } - - public BaseSearchParams analytics(Boolean analytics) { - this.analytics = analytics; - return this; - } - - /** - * Whether the current query will be taken into account in the Analytics. - * - * @return analytics - */ - @javax.annotation.Nullable - public Boolean getAnalytics() { - return analytics; - } - - public void setAnalytics(Boolean analytics) { - this.analytics = analytics; - } - - public BaseSearchParams analyticsTags(List analyticsTags) { - this.analyticsTags = analyticsTags; - return this; - } - - public BaseSearchParams addAnalyticsTagsItem(String analyticsTagsItem) { - if (this.analyticsTags == null) { - this.analyticsTags = new ArrayList<>(); - } - this.analyticsTags.add(analyticsTagsItem); - return this; - } - - /** - * List of tags to apply to the query for analytics purposes. - * - * @return analyticsTags - */ - @javax.annotation.Nullable - public List getAnalyticsTags() { - return analyticsTags; - } - - public void setAnalyticsTags(List analyticsTags) { - this.analyticsTags = analyticsTags; - } - - public BaseSearchParams percentileComputation(Boolean percentileComputation) { - this.percentileComputation = percentileComputation; - return this; - } - - /** - * Whether to include or exclude a query from the processing-time percentile computation. - * - * @return percentileComputation - */ - @javax.annotation.Nullable - public Boolean getPercentileComputation() { - return percentileComputation; - } - - public void setPercentileComputation(Boolean percentileComputation) { - this.percentileComputation = percentileComputation; - } - - public BaseSearchParams enableABTest(Boolean enableABTest) { - this.enableABTest = enableABTest; - return this; - } - - /** - * Whether this search should participate in running AB tests. - * - * @return enableABTest - */ - @javax.annotation.Nullable - public Boolean getEnableABTest() { - return enableABTest; - } - - public void setEnableABTest(Boolean enableABTest) { - this.enableABTest = enableABTest; - } - - public BaseSearchParams enableReRanking(Boolean enableReRanking) { - this.enableReRanking = enableReRanking; - return this; - } - - /** - * Whether this search should use AI Re-Ranking. - * - * @return enableReRanking - */ - @javax.annotation.Nullable - public Boolean getEnableReRanking() { - return enableReRanking; - } - - public void setEnableReRanking(Boolean enableReRanking) { - this.enableReRanking = enableReRanking; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BaseSearchParams baseSearchParams = (BaseSearchParams) o; - return ( - Objects.equals(this.similarQuery, baseSearchParams.similarQuery) && - Objects.equals(this.filters, baseSearchParams.filters) && - Objects.equals(this.facetFilters, baseSearchParams.facetFilters) && - Objects.equals(this.optionalFilters, baseSearchParams.optionalFilters) && - Objects.equals(this.numericFilters, baseSearchParams.numericFilters) && - Objects.equals(this.tagFilters, baseSearchParams.tagFilters) && - Objects.equals( - this.sumOrFiltersScores, - baseSearchParams.sumOrFiltersScores - ) && - Objects.equals(this.facets, baseSearchParams.facets) && - Objects.equals( - this.maxValuesPerFacet, - baseSearchParams.maxValuesPerFacet - ) && - Objects.equals( - this.facetingAfterDistinct, - baseSearchParams.facetingAfterDistinct - ) && - Objects.equals( - this.sortFacetValuesBy, - baseSearchParams.sortFacetValuesBy - ) && - Objects.equals(this.page, baseSearchParams.page) && - Objects.equals(this.offset, baseSearchParams.offset) && - Objects.equals(this.length, baseSearchParams.length) && - Objects.equals(this.aroundLatLng, baseSearchParams.aroundLatLng) && - Objects.equals( - this.aroundLatLngViaIP, - baseSearchParams.aroundLatLngViaIP - ) && - Objects.equals(this.aroundRadius, baseSearchParams.aroundRadius) && - Objects.equals(this.aroundPrecision, baseSearchParams.aroundPrecision) && - Objects.equals( - this.minimumAroundRadius, - baseSearchParams.minimumAroundRadius - ) && - Objects.equals( - this.insideBoundingBox, - baseSearchParams.insideBoundingBox - ) && - Objects.equals(this.insidePolygon, baseSearchParams.insidePolygon) && - Objects.equals( - this.naturalLanguages, - baseSearchParams.naturalLanguages - ) && - Objects.equals(this.ruleContexts, baseSearchParams.ruleContexts) && - Objects.equals( - this.personalizationImpact, - baseSearchParams.personalizationImpact - ) && - Objects.equals(this.userToken, baseSearchParams.userToken) && - Objects.equals(this.getRankingInfo, baseSearchParams.getRankingInfo) && - Objects.equals(this.clickAnalytics, baseSearchParams.clickAnalytics) && - Objects.equals(this.analytics, baseSearchParams.analytics) && - Objects.equals(this.analyticsTags, baseSearchParams.analyticsTags) && - Objects.equals( - this.percentileComputation, - baseSearchParams.percentileComputation - ) && - Objects.equals(this.enableABTest, baseSearchParams.enableABTest) && - Objects.equals(this.enableReRanking, baseSearchParams.enableReRanking) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - similarQuery, - filters, - facetFilters, - optionalFilters, - numericFilters, - tagFilters, - sumOrFiltersScores, - facets, - maxValuesPerFacet, - facetingAfterDistinct, - sortFacetValuesBy, - page, - offset, - length, - aroundLatLng, - aroundLatLngViaIP, - aroundRadius, - aroundPrecision, - minimumAroundRadius, - insideBoundingBox, - insidePolygon, - naturalLanguages, - ruleContexts, - personalizationImpact, - userToken, - getRankingInfo, - clickAnalytics, - analytics, - analyticsTags, - percentileComputation, - enableABTest, - enableReRanking - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseSearchParams {\n"); - sb - .append(" similarQuery: ") - .append(toIndentedString(similarQuery)) - .append("\n"); - sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - sb - .append(" facetFilters: ") - .append(toIndentedString(facetFilters)) - .append("\n"); - sb - .append(" optionalFilters: ") - .append(toIndentedString(optionalFilters)) - .append("\n"); - sb - .append(" numericFilters: ") - .append(toIndentedString(numericFilters)) - .append("\n"); - sb - .append(" tagFilters: ") - .append(toIndentedString(tagFilters)) - .append("\n"); - sb - .append(" sumOrFiltersScores: ") - .append(toIndentedString(sumOrFiltersScores)) - .append("\n"); - sb.append(" facets: ").append(toIndentedString(facets)).append("\n"); - sb - .append(" maxValuesPerFacet: ") - .append(toIndentedString(maxValuesPerFacet)) - .append("\n"); - sb - .append(" facetingAfterDistinct: ") - .append(toIndentedString(facetingAfterDistinct)) - .append("\n"); - sb - .append(" sortFacetValuesBy: ") - .append(toIndentedString(sortFacetValuesBy)) - .append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); - sb.append(" length: ").append(toIndentedString(length)).append("\n"); - sb - .append(" aroundLatLng: ") - .append(toIndentedString(aroundLatLng)) - .append("\n"); - sb - .append(" aroundLatLngViaIP: ") - .append(toIndentedString(aroundLatLngViaIP)) - .append("\n"); - sb - .append(" aroundRadius: ") - .append(toIndentedString(aroundRadius)) - .append("\n"); - sb - .append(" aroundPrecision: ") - .append(toIndentedString(aroundPrecision)) - .append("\n"); - sb - .append(" minimumAroundRadius: ") - .append(toIndentedString(minimumAroundRadius)) - .append("\n"); - sb - .append(" insideBoundingBox: ") - .append(toIndentedString(insideBoundingBox)) - .append("\n"); - sb - .append(" insidePolygon: ") - .append(toIndentedString(insidePolygon)) - .append("\n"); - sb - .append(" naturalLanguages: ") - .append(toIndentedString(naturalLanguages)) - .append("\n"); - sb - .append(" ruleContexts: ") - .append(toIndentedString(ruleContexts)) - .append("\n"); - sb - .append(" personalizationImpact: ") - .append(toIndentedString(personalizationImpact)) - .append("\n"); - sb - .append(" userToken: ") - .append(toIndentedString(userToken)) - .append("\n"); - sb - .append(" getRankingInfo: ") - .append(toIndentedString(getRankingInfo)) - .append("\n"); - sb - .append(" clickAnalytics: ") - .append(toIndentedString(clickAnalytics)) - .append("\n"); - sb - .append(" analytics: ") - .append(toIndentedString(analytics)) - .append("\n"); - sb - .append(" analyticsTags: ") - .append(toIndentedString(analyticsTags)) - .append("\n"); - sb - .append(" percentileComputation: ") - .append(toIndentedString(percentileComputation)) - .append("\n"); - sb - .append(" enableABTest: ") - .append(toIndentedString(enableABTest)) - .append("\n"); - sb - .append(" enableReRanking: ") - .append(toIndentedString(enableReRanking)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BaseSearchResponse.java b/algoliasearch-core/com/algolia/model/BaseSearchResponse.java deleted file mode 100644 index b39969cca..000000000 --- a/algoliasearch-core/com/algolia/model/BaseSearchResponse.java +++ /dev/null @@ -1,741 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** BaseSearchResponse */ -public class BaseSearchResponse { - - @SerializedName("abTestID") - private Integer abTestID; - - @SerializedName("abTestVariantID") - private Integer abTestVariantID; - - @SerializedName("aroundLatLng") - private String aroundLatLng; - - @SerializedName("automaticRadius") - private String automaticRadius; - - @SerializedName("exhaustiveFacetsCount") - private Boolean exhaustiveFacetsCount; - - @SerializedName("exhaustiveNbHits") - private Boolean exhaustiveNbHits; - - @SerializedName("exhaustiveTypo") - private Boolean exhaustiveTypo; - - @SerializedName("facets") - private Map> facets = null; - - @SerializedName("facets_stats") - private Map facetsStats = null; - - @SerializedName("hitsPerPage") - private Integer hitsPerPage = 20; - - @SerializedName("index") - private String index; - - @SerializedName("indexUsed") - private String indexUsed; - - @SerializedName("message") - private String message; - - @SerializedName("nbHits") - private Integer nbHits; - - @SerializedName("nbPages") - private Integer nbPages; - - @SerializedName("nbSortedHits") - private Integer nbSortedHits; - - @SerializedName("page") - private Integer page = 0; - - @SerializedName("params") - private String params; - - @SerializedName("parsedQuery") - private String parsedQuery; - - @SerializedName("processingTimeMS") - private Integer processingTimeMS; - - @SerializedName("query") - private String query = ""; - - @SerializedName("queryAfterRemoval") - private String queryAfterRemoval; - - @SerializedName("serverUsed") - private String serverUsed; - - @SerializedName("userData") - private Object userData = new Object(); - - public BaseSearchResponse abTestID(Integer abTestID) { - this.abTestID = abTestID; - return this; - } - - /** - * If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test - * ID. - * - * @return abTestID - */ - @javax.annotation.Nullable - public Integer getAbTestID() { - return abTestID; - } - - public void setAbTestID(Integer abTestID) { - this.abTestID = abTestID; - } - - public BaseSearchResponse abTestVariantID(Integer abTestVariantID) { - this.abTestVariantID = abTestVariantID; - return this; - } - - /** - * If a search encounters an index that is being A/B tested, abTestVariantID reports the variant - * ID of the index used. - * - * @return abTestVariantID - */ - @javax.annotation.Nullable - public Integer getAbTestVariantID() { - return abTestVariantID; - } - - public void setAbTestVariantID(Integer abTestVariantID) { - this.abTestVariantID = abTestVariantID; - } - - public BaseSearchResponse aroundLatLng(String aroundLatLng) { - this.aroundLatLng = aroundLatLng; - return this; - } - - /** - * The computed geo location. - * - * @return aroundLatLng - */ - @javax.annotation.Nullable - public String getAroundLatLng() { - return aroundLatLng; - } - - public void setAroundLatLng(String aroundLatLng) { - this.aroundLatLng = aroundLatLng; - } - - public BaseSearchResponse automaticRadius(String automaticRadius) { - this.automaticRadius = automaticRadius; - return this; - } - - /** - * The automatically computed radius. For legacy reasons, this parameter is a string and not an - * integer. - * - * @return automaticRadius - */ - @javax.annotation.Nullable - public String getAutomaticRadius() { - return automaticRadius; - } - - public void setAutomaticRadius(String automaticRadius) { - this.automaticRadius = automaticRadius; - } - - public BaseSearchResponse exhaustiveFacetsCount( - Boolean exhaustiveFacetsCount - ) { - this.exhaustiveFacetsCount = exhaustiveFacetsCount; - return this; - } - - /** - * Whether the facet count is exhaustive or approximate. - * - * @return exhaustiveFacetsCount - */ - @javax.annotation.Nullable - public Boolean getExhaustiveFacetsCount() { - return exhaustiveFacetsCount; - } - - public void setExhaustiveFacetsCount(Boolean exhaustiveFacetsCount) { - this.exhaustiveFacetsCount = exhaustiveFacetsCount; - } - - public BaseSearchResponse exhaustiveNbHits(Boolean exhaustiveNbHits) { - this.exhaustiveNbHits = exhaustiveNbHits; - return this; - } - - /** - * Indicate if the nbHits count was exhaustive or approximate - * - * @return exhaustiveNbHits - */ - @javax.annotation.Nonnull - public Boolean getExhaustiveNbHits() { - return exhaustiveNbHits; - } - - public void setExhaustiveNbHits(Boolean exhaustiveNbHits) { - this.exhaustiveNbHits = exhaustiveNbHits; - } - - public BaseSearchResponse exhaustiveTypo(Boolean exhaustiveTypo) { - this.exhaustiveTypo = exhaustiveTypo; - return this; - } - - /** - * Indicate if the typo-tolerence search was exhaustive or approximate (only included when - * typo-tolerance is enabled) - * - * @return exhaustiveTypo - */ - @javax.annotation.Nonnull - public Boolean getExhaustiveTypo() { - return exhaustiveTypo; - } - - public void setExhaustiveTypo(Boolean exhaustiveTypo) { - this.exhaustiveTypo = exhaustiveTypo; - } - - public BaseSearchResponse facets(Map> facets) { - this.facets = facets; - return this; - } - - public BaseSearchResponse putFacetsItem( - String key, - Map facetsItem - ) { - if (this.facets == null) { - this.facets = new HashMap<>(); - } - this.facets.put(key, facetsItem); - return this; - } - - /** - * A mapping of each facet name to the corresponding facet counts. - * - * @return facets - */ - @javax.annotation.Nullable - public Map> getFacets() { - return facets; - } - - public void setFacets(Map> facets) { - this.facets = facets; - } - - public BaseSearchResponse facetsStats( - Map facetsStats - ) { - this.facetsStats = facetsStats; - return this; - } - - public BaseSearchResponse putFacetsStatsItem( - String key, - BaseSearchResponseFacetsStats facetsStatsItem - ) { - if (this.facetsStats == null) { - this.facetsStats = new HashMap<>(); - } - this.facetsStats.put(key, facetsStatsItem); - return this; - } - - /** - * Statistics for numerical facets. - * - * @return facetsStats - */ - @javax.annotation.Nullable - public Map getFacetsStats() { - return facetsStats; - } - - public void setFacetsStats( - Map facetsStats - ) { - this.facetsStats = facetsStats; - } - - public BaseSearchResponse hitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - return this; - } - - /** - * Set the number of hits per page. - * - * @return hitsPerPage - */ - @javax.annotation.Nonnull - public Integer getHitsPerPage() { - return hitsPerPage; - } - - public void setHitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - } - - public BaseSearchResponse index(String index) { - this.index = index; - return this; - } - - /** - * Index name used for the query. - * - * @return index - */ - @javax.annotation.Nullable - public String getIndex() { - return index; - } - - public void setIndex(String index) { - this.index = index; - } - - public BaseSearchResponse indexUsed(String indexUsed) { - this.indexUsed = indexUsed; - return this; - } - - /** - * Index name used for the query. In the case of an A/B test, the targeted index isn't always the - * index used by the query. - * - * @return indexUsed - */ - @javax.annotation.Nullable - public String getIndexUsed() { - return indexUsed; - } - - public void setIndexUsed(String indexUsed) { - this.indexUsed = indexUsed; - } - - public BaseSearchResponse message(String message) { - this.message = message; - return this; - } - - /** - * Used to return warnings about the query. - * - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public BaseSearchResponse nbHits(Integer nbHits) { - this.nbHits = nbHits; - return this; - } - - /** - * Number of hits that the search query matched. - * - * @return nbHits - */ - @javax.annotation.Nonnull - public Integer getNbHits() { - return nbHits; - } - - public void setNbHits(Integer nbHits) { - this.nbHits = nbHits; - } - - public BaseSearchResponse nbPages(Integer nbPages) { - this.nbPages = nbPages; - return this; - } - - /** - * Number of pages available for the current query - * - * @return nbPages - */ - @javax.annotation.Nonnull - public Integer getNbPages() { - return nbPages; - } - - public void setNbPages(Integer nbPages) { - this.nbPages = nbPages; - } - - public BaseSearchResponse nbSortedHits(Integer nbSortedHits) { - this.nbSortedHits = nbSortedHits; - return this; - } - - /** - * The number of hits selected and sorted by the relevant sort algorithm - * - * @return nbSortedHits - */ - @javax.annotation.Nullable - public Integer getNbSortedHits() { - return nbSortedHits; - } - - public void setNbSortedHits(Integer nbSortedHits) { - this.nbSortedHits = nbSortedHits; - } - - public BaseSearchResponse page(Integer page) { - this.page = page; - return this; - } - - /** - * Specify the page to retrieve. - * - * @return page - */ - @javax.annotation.Nonnull - public Integer getPage() { - return page; - } - - public void setPage(Integer page) { - this.page = page; - } - - public BaseSearchResponse params(String params) { - this.params = params; - return this; - } - - /** - * A url-encoded string of all search parameters. - * - * @return params - */ - @javax.annotation.Nonnull - public String getParams() { - return params; - } - - public void setParams(String params) { - this.params = params; - } - - public BaseSearchResponse parsedQuery(String parsedQuery) { - this.parsedQuery = parsedQuery; - return this; - } - - /** - * The query string that will be searched, after normalization. - * - * @return parsedQuery - */ - @javax.annotation.Nullable - public String getParsedQuery() { - return parsedQuery; - } - - public void setParsedQuery(String parsedQuery) { - this.parsedQuery = parsedQuery; - } - - public BaseSearchResponse processingTimeMS(Integer processingTimeMS) { - this.processingTimeMS = processingTimeMS; - return this; - } - - /** - * Time the server took to process the request, in milliseconds. - * - * @return processingTimeMS - */ - @javax.annotation.Nonnull - public Integer getProcessingTimeMS() { - return processingTimeMS; - } - - public void setProcessingTimeMS(Integer processingTimeMS) { - this.processingTimeMS = processingTimeMS; - } - - public BaseSearchResponse query(String query) { - this.query = query; - return this; - } - - /** - * The text to search in the index. - * - * @return query - */ - @javax.annotation.Nonnull - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public BaseSearchResponse queryAfterRemoval(String queryAfterRemoval) { - this.queryAfterRemoval = queryAfterRemoval; - return this; - } - - /** - * A markup text indicating which parts of the original query have been removed in order to - * retrieve a non-empty result set. - * - * @return queryAfterRemoval - */ - @javax.annotation.Nullable - public String getQueryAfterRemoval() { - return queryAfterRemoval; - } - - public void setQueryAfterRemoval(String queryAfterRemoval) { - this.queryAfterRemoval = queryAfterRemoval; - } - - public BaseSearchResponse serverUsed(String serverUsed) { - this.serverUsed = serverUsed; - return this; - } - - /** - * Actual host name of the server that processed the request. - * - * @return serverUsed - */ - @javax.annotation.Nullable - public String getServerUsed() { - return serverUsed; - } - - public void setServerUsed(String serverUsed) { - this.serverUsed = serverUsed; - } - - public BaseSearchResponse userData(Object userData) { - this.userData = userData; - return this; - } - - /** - * Lets you store custom data in your indices. - * - * @return userData - */ - @javax.annotation.Nullable - public Object getUserData() { - return userData; - } - - public void setUserData(Object userData) { - this.userData = userData; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BaseSearchResponse baseSearchResponse = (BaseSearchResponse) o; - return ( - Objects.equals(this.abTestID, baseSearchResponse.abTestID) && - Objects.equals( - this.abTestVariantID, - baseSearchResponse.abTestVariantID - ) && - Objects.equals(this.aroundLatLng, baseSearchResponse.aroundLatLng) && - Objects.equals( - this.automaticRadius, - baseSearchResponse.automaticRadius - ) && - Objects.equals( - this.exhaustiveFacetsCount, - baseSearchResponse.exhaustiveFacetsCount - ) && - Objects.equals( - this.exhaustiveNbHits, - baseSearchResponse.exhaustiveNbHits - ) && - Objects.equals(this.exhaustiveTypo, baseSearchResponse.exhaustiveTypo) && - Objects.equals(this.facets, baseSearchResponse.facets) && - Objects.equals(this.facetsStats, baseSearchResponse.facetsStats) && - Objects.equals(this.hitsPerPage, baseSearchResponse.hitsPerPage) && - Objects.equals(this.index, baseSearchResponse.index) && - Objects.equals(this.indexUsed, baseSearchResponse.indexUsed) && - Objects.equals(this.message, baseSearchResponse.message) && - Objects.equals(this.nbHits, baseSearchResponse.nbHits) && - Objects.equals(this.nbPages, baseSearchResponse.nbPages) && - Objects.equals(this.nbSortedHits, baseSearchResponse.nbSortedHits) && - Objects.equals(this.page, baseSearchResponse.page) && - Objects.equals(this.params, baseSearchResponse.params) && - Objects.equals(this.parsedQuery, baseSearchResponse.parsedQuery) && - Objects.equals( - this.processingTimeMS, - baseSearchResponse.processingTimeMS - ) && - Objects.equals(this.query, baseSearchResponse.query) && - Objects.equals( - this.queryAfterRemoval, - baseSearchResponse.queryAfterRemoval - ) && - Objects.equals(this.serverUsed, baseSearchResponse.serverUsed) && - Objects.equals(this.userData, baseSearchResponse.userData) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - abTestID, - abTestVariantID, - aroundLatLng, - automaticRadius, - exhaustiveFacetsCount, - exhaustiveNbHits, - exhaustiveTypo, - facets, - facetsStats, - hitsPerPage, - index, - indexUsed, - message, - nbHits, - nbPages, - nbSortedHits, - page, - params, - parsedQuery, - processingTimeMS, - query, - queryAfterRemoval, - serverUsed, - userData - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseSearchResponse {\n"); - sb.append(" abTestID: ").append(toIndentedString(abTestID)).append("\n"); - sb - .append(" abTestVariantID: ") - .append(toIndentedString(abTestVariantID)) - .append("\n"); - sb - .append(" aroundLatLng: ") - .append(toIndentedString(aroundLatLng)) - .append("\n"); - sb - .append(" automaticRadius: ") - .append(toIndentedString(automaticRadius)) - .append("\n"); - sb - .append(" exhaustiveFacetsCount: ") - .append(toIndentedString(exhaustiveFacetsCount)) - .append("\n"); - sb - .append(" exhaustiveNbHits: ") - .append(toIndentedString(exhaustiveNbHits)) - .append("\n"); - sb - .append(" exhaustiveTypo: ") - .append(toIndentedString(exhaustiveTypo)) - .append("\n"); - sb.append(" facets: ").append(toIndentedString(facets)).append("\n"); - sb - .append(" facetsStats: ") - .append(toIndentedString(facetsStats)) - .append("\n"); - sb - .append(" hitsPerPage: ") - .append(toIndentedString(hitsPerPage)) - .append("\n"); - sb.append(" index: ").append(toIndentedString(index)).append("\n"); - sb - .append(" indexUsed: ") - .append(toIndentedString(indexUsed)) - .append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" nbHits: ").append(toIndentedString(nbHits)).append("\n"); - sb.append(" nbPages: ").append(toIndentedString(nbPages)).append("\n"); - sb - .append(" nbSortedHits: ") - .append(toIndentedString(nbSortedHits)) - .append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb - .append(" parsedQuery: ") - .append(toIndentedString(parsedQuery)) - .append("\n"); - sb - .append(" processingTimeMS: ") - .append(toIndentedString(processingTimeMS)) - .append("\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb - .append(" queryAfterRemoval: ") - .append(toIndentedString(queryAfterRemoval)) - .append("\n"); - sb - .append(" serverUsed: ") - .append(toIndentedString(serverUsed)) - .append("\n"); - sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BaseSearchResponseFacetsStats.java b/algoliasearch-core/com/algolia/model/BaseSearchResponseFacetsStats.java deleted file mode 100644 index ddf47b677..000000000 --- a/algoliasearch-core/com/algolia/model/BaseSearchResponseFacetsStats.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** BaseSearchResponseFacetsStats */ -public class BaseSearchResponseFacetsStats { - - @SerializedName("min") - private Integer min; - - @SerializedName("max") - private Integer max; - - @SerializedName("avg") - private Integer avg; - - @SerializedName("sum") - private Integer sum; - - public BaseSearchResponseFacetsStats min(Integer min) { - this.min = min; - return this; - } - - /** - * The minimum value in the result set. - * - * @return min - */ - @javax.annotation.Nullable - public Integer getMin() { - return min; - } - - public void setMin(Integer min) { - this.min = min; - } - - public BaseSearchResponseFacetsStats max(Integer max) { - this.max = max; - return this; - } - - /** - * The maximum value in the result set. - * - * @return max - */ - @javax.annotation.Nullable - public Integer getMax() { - return max; - } - - public void setMax(Integer max) { - this.max = max; - } - - public BaseSearchResponseFacetsStats avg(Integer avg) { - this.avg = avg; - return this; - } - - /** - * The average facet value in the result set. - * - * @return avg - */ - @javax.annotation.Nullable - public Integer getAvg() { - return avg; - } - - public void setAvg(Integer avg) { - this.avg = avg; - } - - public BaseSearchResponseFacetsStats sum(Integer sum) { - this.sum = sum; - return this; - } - - /** - * The sum of all values in the result set. - * - * @return sum - */ - @javax.annotation.Nullable - public Integer getSum() { - return sum; - } - - public void setSum(Integer sum) { - this.sum = sum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BaseSearchResponseFacetsStats baseSearchResponseFacetsStats = (BaseSearchResponseFacetsStats) o; - return ( - Objects.equals(this.min, baseSearchResponseFacetsStats.min) && - Objects.equals(this.max, baseSearchResponseFacetsStats.max) && - Objects.equals(this.avg, baseSearchResponseFacetsStats.avg) && - Objects.equals(this.sum, baseSearchResponseFacetsStats.sum) - ); - } - - @Override - public int hashCode() { - return Objects.hash(min, max, avg, sum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseSearchResponseFacetsStats {\n"); - sb.append(" min: ").append(toIndentedString(min)).append("\n"); - sb.append(" max: ").append(toIndentedString(max)).append("\n"); - sb.append(" avg: ").append(toIndentedString(avg)).append("\n"); - sb.append(" sum: ").append(toIndentedString(sum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BatchAssignUserIdsParams.java b/algoliasearch-core/com/algolia/model/BatchAssignUserIdsParams.java deleted file mode 100644 index d2c89235a..000000000 --- a/algoliasearch-core/com/algolia/model/BatchAssignUserIdsParams.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Assign userID parameters. */ -public class BatchAssignUserIdsParams { - - @SerializedName("cluster") - private String cluster; - - @SerializedName("users") - private List users = new ArrayList<>(); - - public BatchAssignUserIdsParams cluster(String cluster) { - this.cluster = cluster; - return this; - } - - /** - * Name of the cluster. - * - * @return cluster - */ - @javax.annotation.Nonnull - public String getCluster() { - return cluster; - } - - public void setCluster(String cluster) { - this.cluster = cluster; - } - - public BatchAssignUserIdsParams users(List users) { - this.users = users; - return this; - } - - public BatchAssignUserIdsParams addUsersItem(String usersItem) { - this.users.add(usersItem); - return this; - } - - /** - * userIDs to assign. Note you cannot move users with this method. - * - * @return users - */ - @javax.annotation.Nonnull - public List getUsers() { - return users; - } - - public void setUsers(List users) { - this.users = users; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BatchAssignUserIdsParams batchAssignUserIdsParams = (BatchAssignUserIdsParams) o; - return ( - Objects.equals(this.cluster, batchAssignUserIdsParams.cluster) && - Objects.equals(this.users, batchAssignUserIdsParams.users) - ); - } - - @Override - public int hashCode() { - return Objects.hash(cluster, users); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchAssignUserIdsParams {\n"); - sb.append(" cluster: ").append(toIndentedString(cluster)).append("\n"); - sb.append(" users: ").append(toIndentedString(users)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BatchDictionaryEntriesParams.java b/algoliasearch-core/com/algolia/model/BatchDictionaryEntriesParams.java deleted file mode 100644 index 41bfc9d32..000000000 --- a/algoliasearch-core/com/algolia/model/BatchDictionaryEntriesParams.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** The `batchDictionaryEntries` parameters. */ -public class BatchDictionaryEntriesParams { - - @SerializedName("clearExistingDictionaryEntries") - private Boolean clearExistingDictionaryEntries = false; - - @SerializedName("requests") - private List requests = new ArrayList<>(); - - public BatchDictionaryEntriesParams clearExistingDictionaryEntries( - Boolean clearExistingDictionaryEntries - ) { - this.clearExistingDictionaryEntries = clearExistingDictionaryEntries; - return this; - } - - /** - * When `true`, start the batch by removing all the custom entries from the dictionary. - * - * @return clearExistingDictionaryEntries - */ - @javax.annotation.Nullable - public Boolean getClearExistingDictionaryEntries() { - return clearExistingDictionaryEntries; - } - - public void setClearExistingDictionaryEntries( - Boolean clearExistingDictionaryEntries - ) { - this.clearExistingDictionaryEntries = clearExistingDictionaryEntries; - } - - public BatchDictionaryEntriesParams requests( - List requests - ) { - this.requests = requests; - return this; - } - - public BatchDictionaryEntriesParams addRequestsItem( - BatchDictionaryEntriesRequest requestsItem - ) { - this.requests.add(requestsItem); - return this; - } - - /** - * List of operations to batch. Each operation is described by an `action` and a `body`. - * - * @return requests - */ - @javax.annotation.Nonnull - public List getRequests() { - return requests; - } - - public void setRequests(List requests) { - this.requests = requests; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BatchDictionaryEntriesParams batchDictionaryEntriesParams = (BatchDictionaryEntriesParams) o; - return ( - Objects.equals( - this.clearExistingDictionaryEntries, - batchDictionaryEntriesParams.clearExistingDictionaryEntries - ) && - Objects.equals(this.requests, batchDictionaryEntriesParams.requests) - ); - } - - @Override - public int hashCode() { - return Objects.hash(clearExistingDictionaryEntries, requests); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchDictionaryEntriesParams {\n"); - sb - .append(" clearExistingDictionaryEntries: ") - .append(toIndentedString(clearExistingDictionaryEntries)) - .append("\n"); - sb.append(" requests: ").append(toIndentedString(requests)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BatchDictionaryEntriesRequest.java b/algoliasearch-core/com/algolia/model/BatchDictionaryEntriesRequest.java deleted file mode 100644 index d356b71b3..000000000 --- a/algoliasearch-core/com/algolia/model/BatchDictionaryEntriesRequest.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** BatchDictionaryEntriesRequest */ -public class BatchDictionaryEntriesRequest { - - @SerializedName("action") - private DictionaryAction action; - - @SerializedName("body") - private DictionaryEntry body; - - public BatchDictionaryEntriesRequest action(DictionaryAction action) { - this.action = action; - return this; - } - - /** - * Get action - * - * @return action - */ - @javax.annotation.Nonnull - public DictionaryAction getAction() { - return action; - } - - public void setAction(DictionaryAction action) { - this.action = action; - } - - public BatchDictionaryEntriesRequest body(DictionaryEntry body) { - this.body = body; - return this; - } - - /** - * Get body - * - * @return body - */ - @javax.annotation.Nonnull - public DictionaryEntry getBody() { - return body; - } - - public void setBody(DictionaryEntry body) { - this.body = body; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BatchDictionaryEntriesRequest batchDictionaryEntriesRequest = (BatchDictionaryEntriesRequest) o; - return ( - Objects.equals(this.action, batchDictionaryEntriesRequest.action) && - Objects.equals(this.body, batchDictionaryEntriesRequest.body) - ); - } - - @Override - public int hashCode() { - return Objects.hash(action, body); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchDictionaryEntriesRequest {\n"); - sb.append(" action: ").append(toIndentedString(action)).append("\n"); - sb.append(" body: ").append(toIndentedString(body)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BatchOperation.java b/algoliasearch-core/com/algolia/model/BatchOperation.java deleted file mode 100644 index 85682a94a..000000000 --- a/algoliasearch-core/com/algolia/model/BatchOperation.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** BatchOperation */ -public class BatchOperation { - - @SerializedName("action") - private Action action; - - @SerializedName("body") - private Object body; - - public BatchOperation action(Action action) { - this.action = action; - return this; - } - - /** - * Get action - * - * @return action - */ - @javax.annotation.Nullable - public Action getAction() { - return action; - } - - public void setAction(Action action) { - this.action = action; - } - - public BatchOperation body(Object body) { - this.body = body; - return this; - } - - /** - * arguments to the operation (depends on the type of the operation). - * - * @return body - */ - @javax.annotation.Nullable - public Object getBody() { - return body; - } - - public void setBody(Object body) { - this.body = body; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BatchOperation batchOperation = (BatchOperation) o; - return ( - Objects.equals(this.action, batchOperation.action) && - Objects.equals(this.body, batchOperation.body) - ); - } - - @Override - public int hashCode() { - return Objects.hash(action, body); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchOperation {\n"); - sb.append(" action: ").append(toIndentedString(action)).append("\n"); - sb.append(" body: ").append(toIndentedString(body)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BatchParams.java b/algoliasearch-core/com/algolia/model/BatchParams.java deleted file mode 100644 index 40486b162..000000000 --- a/algoliasearch-core/com/algolia/model/BatchParams.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** The `multipleBatch` parameters. */ -public class BatchParams { - - @SerializedName("requests") - private List requests = null; - - public BatchParams requests(List requests) { - this.requests = requests; - return this; - } - - public BatchParams addRequestsItem(MultipleBatchOperation requestsItem) { - if (this.requests == null) { - this.requests = new ArrayList<>(); - } - this.requests.add(requestsItem); - return this; - } - - /** - * Get requests - * - * @return requests - */ - @javax.annotation.Nullable - public List getRequests() { - return requests; - } - - public void setRequests(List requests) { - this.requests = requests; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BatchParams batchParams = (BatchParams) o; - return Objects.equals(this.requests, batchParams.requests); - } - - @Override - public int hashCode() { - return Objects.hash(requests); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchParams {\n"); - sb.append(" requests: ").append(toIndentedString(requests)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BatchResponse.java b/algoliasearch-core/com/algolia/model/BatchResponse.java deleted file mode 100644 index 80cc720c2..000000000 --- a/algoliasearch-core/com/algolia/model/BatchResponse.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** BatchResponse */ -public class BatchResponse { - - @SerializedName("taskID") - private Integer taskID; - - @SerializedName("objectIDs") - private List objectIDs = null; - - public BatchResponse taskID(Integer taskID) { - this.taskID = taskID; - return this; - } - - /** - * taskID of the task to wait for. - * - * @return taskID - */ - @javax.annotation.Nullable - public Integer getTaskID() { - return taskID; - } - - public void setTaskID(Integer taskID) { - this.taskID = taskID; - } - - public BatchResponse objectIDs(List objectIDs) { - this.objectIDs = objectIDs; - return this; - } - - public BatchResponse addObjectIDsItem(String objectIDsItem) { - if (this.objectIDs == null) { - this.objectIDs = new ArrayList<>(); - } - this.objectIDs.add(objectIDsItem); - return this; - } - - /** - * List of objectID. - * - * @return objectIDs - */ - @javax.annotation.Nullable - public List getObjectIDs() { - return objectIDs; - } - - public void setObjectIDs(List objectIDs) { - this.objectIDs = objectIDs; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BatchResponse batchResponse = (BatchResponse) o; - return ( - Objects.equals(this.taskID, batchResponse.taskID) && - Objects.equals(this.objectIDs, batchResponse.objectIDs) - ); - } - - @Override - public int hashCode() { - return Objects.hash(taskID, objectIDs); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchResponse {\n"); - sb.append(" taskID: ").append(toIndentedString(taskID)).append("\n"); - sb - .append(" objectIDs: ") - .append(toIndentedString(objectIDs)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BatchWriteParams.java b/algoliasearch-core/com/algolia/model/BatchWriteParams.java deleted file mode 100644 index 020e1f9a4..000000000 --- a/algoliasearch-core/com/algolia/model/BatchWriteParams.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** The `batch` parameters. */ -public class BatchWriteParams { - - @SerializedName("requests") - private List requests = null; - - public BatchWriteParams requests(List requests) { - this.requests = requests; - return this; - } - - public BatchWriteParams addRequestsItem(BatchOperation requestsItem) { - if (this.requests == null) { - this.requests = new ArrayList<>(); - } - this.requests.add(requestsItem); - return this; - } - - /** - * Get requests - * - * @return requests - */ - @javax.annotation.Nullable - public List getRequests() { - return requests; - } - - public void setRequests(List requests) { - this.requests = requests; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BatchWriteParams batchWriteParams = (BatchWriteParams) o; - return Objects.equals(this.requests, batchWriteParams.requests); - } - - @Override - public int hashCode() { - return Objects.hash(requests); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchWriteParams {\n"); - sb.append(" requests: ").append(toIndentedString(requests)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BrowseRequest.java b/algoliasearch-core/com/algolia/model/BrowseRequest.java deleted file mode 100644 index c412ea0fe..000000000 --- a/algoliasearch-core/com/algolia/model/BrowseRequest.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** BrowseRequest */ -public class BrowseRequest { - - @SerializedName("params") - private String params = ""; - - @SerializedName("cursor") - private String cursor; - - public BrowseRequest params(String params) { - this.params = params; - return this; - } - - /** - * Search parameters as URL-encoded query string. - * - * @return params - */ - @javax.annotation.Nullable - public String getParams() { - return params; - } - - public void setParams(String params) { - this.params = params; - } - - public BrowseRequest cursor(String cursor) { - this.cursor = cursor; - return this; - } - - /** - * Cursor indicating the location to resume browsing from. Must match the value returned by the - * previous call. - * - * @return cursor - */ - @javax.annotation.Nullable - public String getCursor() { - return cursor; - } - - public void setCursor(String cursor) { - this.cursor = cursor; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BrowseRequest browseRequest = (BrowseRequest) o; - return ( - Objects.equals(this.params, browseRequest.params) && - Objects.equals(this.cursor, browseRequest.cursor) - ); - } - - @Override - public int hashCode() { - return Objects.hash(params, cursor); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BrowseRequest {\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BrowseResponse.java b/algoliasearch-core/com/algolia/model/BrowseResponse.java deleted file mode 100644 index 17d13c58f..000000000 --- a/algoliasearch-core/com/algolia/model/BrowseResponse.java +++ /dev/null @@ -1,785 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** BrowseResponse */ -public class BrowseResponse { - - @SerializedName("abTestID") - private Integer abTestID; - - @SerializedName("abTestVariantID") - private Integer abTestVariantID; - - @SerializedName("aroundLatLng") - private String aroundLatLng; - - @SerializedName("automaticRadius") - private String automaticRadius; - - @SerializedName("exhaustiveFacetsCount") - private Boolean exhaustiveFacetsCount; - - @SerializedName("exhaustiveNbHits") - private Boolean exhaustiveNbHits; - - @SerializedName("exhaustiveTypo") - private Boolean exhaustiveTypo; - - @SerializedName("facets") - private Map> facets = null; - - @SerializedName("facets_stats") - private Map facetsStats = null; - - @SerializedName("hitsPerPage") - private Integer hitsPerPage = 20; - - @SerializedName("index") - private String index; - - @SerializedName("indexUsed") - private String indexUsed; - - @SerializedName("message") - private String message; - - @SerializedName("nbHits") - private Integer nbHits; - - @SerializedName("nbPages") - private Integer nbPages; - - @SerializedName("nbSortedHits") - private Integer nbSortedHits; - - @SerializedName("page") - private Integer page = 0; - - @SerializedName("params") - private String params; - - @SerializedName("parsedQuery") - private String parsedQuery; - - @SerializedName("processingTimeMS") - private Integer processingTimeMS; - - @SerializedName("query") - private String query = ""; - - @SerializedName("queryAfterRemoval") - private String queryAfterRemoval; - - @SerializedName("serverUsed") - private String serverUsed; - - @SerializedName("userData") - private Object userData = new Object(); - - @SerializedName("hits") - private List hits = new ArrayList<>(); - - @SerializedName("cursor") - private String cursor; - - public BrowseResponse abTestID(Integer abTestID) { - this.abTestID = abTestID; - return this; - } - - /** - * If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test - * ID. - * - * @return abTestID - */ - @javax.annotation.Nullable - public Integer getAbTestID() { - return abTestID; - } - - public void setAbTestID(Integer abTestID) { - this.abTestID = abTestID; - } - - public BrowseResponse abTestVariantID(Integer abTestVariantID) { - this.abTestVariantID = abTestVariantID; - return this; - } - - /** - * If a search encounters an index that is being A/B tested, abTestVariantID reports the variant - * ID of the index used. - * - * @return abTestVariantID - */ - @javax.annotation.Nullable - public Integer getAbTestVariantID() { - return abTestVariantID; - } - - public void setAbTestVariantID(Integer abTestVariantID) { - this.abTestVariantID = abTestVariantID; - } - - public BrowseResponse aroundLatLng(String aroundLatLng) { - this.aroundLatLng = aroundLatLng; - return this; - } - - /** - * The computed geo location. - * - * @return aroundLatLng - */ - @javax.annotation.Nullable - public String getAroundLatLng() { - return aroundLatLng; - } - - public void setAroundLatLng(String aroundLatLng) { - this.aroundLatLng = aroundLatLng; - } - - public BrowseResponse automaticRadius(String automaticRadius) { - this.automaticRadius = automaticRadius; - return this; - } - - /** - * The automatically computed radius. For legacy reasons, this parameter is a string and not an - * integer. - * - * @return automaticRadius - */ - @javax.annotation.Nullable - public String getAutomaticRadius() { - return automaticRadius; - } - - public void setAutomaticRadius(String automaticRadius) { - this.automaticRadius = automaticRadius; - } - - public BrowseResponse exhaustiveFacetsCount(Boolean exhaustiveFacetsCount) { - this.exhaustiveFacetsCount = exhaustiveFacetsCount; - return this; - } - - /** - * Whether the facet count is exhaustive or approximate. - * - * @return exhaustiveFacetsCount - */ - @javax.annotation.Nullable - public Boolean getExhaustiveFacetsCount() { - return exhaustiveFacetsCount; - } - - public void setExhaustiveFacetsCount(Boolean exhaustiveFacetsCount) { - this.exhaustiveFacetsCount = exhaustiveFacetsCount; - } - - public BrowseResponse exhaustiveNbHits(Boolean exhaustiveNbHits) { - this.exhaustiveNbHits = exhaustiveNbHits; - return this; - } - - /** - * Indicate if the nbHits count was exhaustive or approximate - * - * @return exhaustiveNbHits - */ - @javax.annotation.Nonnull - public Boolean getExhaustiveNbHits() { - return exhaustiveNbHits; - } - - public void setExhaustiveNbHits(Boolean exhaustiveNbHits) { - this.exhaustiveNbHits = exhaustiveNbHits; - } - - public BrowseResponse exhaustiveTypo(Boolean exhaustiveTypo) { - this.exhaustiveTypo = exhaustiveTypo; - return this; - } - - /** - * Indicate if the typo-tolerence search was exhaustive or approximate (only included when - * typo-tolerance is enabled) - * - * @return exhaustiveTypo - */ - @javax.annotation.Nonnull - public Boolean getExhaustiveTypo() { - return exhaustiveTypo; - } - - public void setExhaustiveTypo(Boolean exhaustiveTypo) { - this.exhaustiveTypo = exhaustiveTypo; - } - - public BrowseResponse facets(Map> facets) { - this.facets = facets; - return this; - } - - public BrowseResponse putFacetsItem( - String key, - Map facetsItem - ) { - if (this.facets == null) { - this.facets = new HashMap<>(); - } - this.facets.put(key, facetsItem); - return this; - } - - /** - * A mapping of each facet name to the corresponding facet counts. - * - * @return facets - */ - @javax.annotation.Nullable - public Map> getFacets() { - return facets; - } - - public void setFacets(Map> facets) { - this.facets = facets; - } - - public BrowseResponse facetsStats( - Map facetsStats - ) { - this.facetsStats = facetsStats; - return this; - } - - public BrowseResponse putFacetsStatsItem( - String key, - BaseSearchResponseFacetsStats facetsStatsItem - ) { - if (this.facetsStats == null) { - this.facetsStats = new HashMap<>(); - } - this.facetsStats.put(key, facetsStatsItem); - return this; - } - - /** - * Statistics for numerical facets. - * - * @return facetsStats - */ - @javax.annotation.Nullable - public Map getFacetsStats() { - return facetsStats; - } - - public void setFacetsStats( - Map facetsStats - ) { - this.facetsStats = facetsStats; - } - - public BrowseResponse hitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - return this; - } - - /** - * Set the number of hits per page. - * - * @return hitsPerPage - */ - @javax.annotation.Nonnull - public Integer getHitsPerPage() { - return hitsPerPage; - } - - public void setHitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - } - - public BrowseResponse index(String index) { - this.index = index; - return this; - } - - /** - * Index name used for the query. - * - * @return index - */ - @javax.annotation.Nullable - public String getIndex() { - return index; - } - - public void setIndex(String index) { - this.index = index; - } - - public BrowseResponse indexUsed(String indexUsed) { - this.indexUsed = indexUsed; - return this; - } - - /** - * Index name used for the query. In the case of an A/B test, the targeted index isn't always the - * index used by the query. - * - * @return indexUsed - */ - @javax.annotation.Nullable - public String getIndexUsed() { - return indexUsed; - } - - public void setIndexUsed(String indexUsed) { - this.indexUsed = indexUsed; - } - - public BrowseResponse message(String message) { - this.message = message; - return this; - } - - /** - * Used to return warnings about the query. - * - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public BrowseResponse nbHits(Integer nbHits) { - this.nbHits = nbHits; - return this; - } - - /** - * Number of hits that the search query matched. - * - * @return nbHits - */ - @javax.annotation.Nonnull - public Integer getNbHits() { - return nbHits; - } - - public void setNbHits(Integer nbHits) { - this.nbHits = nbHits; - } - - public BrowseResponse nbPages(Integer nbPages) { - this.nbPages = nbPages; - return this; - } - - /** - * Number of pages available for the current query - * - * @return nbPages - */ - @javax.annotation.Nonnull - public Integer getNbPages() { - return nbPages; - } - - public void setNbPages(Integer nbPages) { - this.nbPages = nbPages; - } - - public BrowseResponse nbSortedHits(Integer nbSortedHits) { - this.nbSortedHits = nbSortedHits; - return this; - } - - /** - * The number of hits selected and sorted by the relevant sort algorithm - * - * @return nbSortedHits - */ - @javax.annotation.Nullable - public Integer getNbSortedHits() { - return nbSortedHits; - } - - public void setNbSortedHits(Integer nbSortedHits) { - this.nbSortedHits = nbSortedHits; - } - - public BrowseResponse page(Integer page) { - this.page = page; - return this; - } - - /** - * Specify the page to retrieve. - * - * @return page - */ - @javax.annotation.Nonnull - public Integer getPage() { - return page; - } - - public void setPage(Integer page) { - this.page = page; - } - - public BrowseResponse params(String params) { - this.params = params; - return this; - } - - /** - * A url-encoded string of all search parameters. - * - * @return params - */ - @javax.annotation.Nonnull - public String getParams() { - return params; - } - - public void setParams(String params) { - this.params = params; - } - - public BrowseResponse parsedQuery(String parsedQuery) { - this.parsedQuery = parsedQuery; - return this; - } - - /** - * The query string that will be searched, after normalization. - * - * @return parsedQuery - */ - @javax.annotation.Nullable - public String getParsedQuery() { - return parsedQuery; - } - - public void setParsedQuery(String parsedQuery) { - this.parsedQuery = parsedQuery; - } - - public BrowseResponse processingTimeMS(Integer processingTimeMS) { - this.processingTimeMS = processingTimeMS; - return this; - } - - /** - * Time the server took to process the request, in milliseconds. - * - * @return processingTimeMS - */ - @javax.annotation.Nonnull - public Integer getProcessingTimeMS() { - return processingTimeMS; - } - - public void setProcessingTimeMS(Integer processingTimeMS) { - this.processingTimeMS = processingTimeMS; - } - - public BrowseResponse query(String query) { - this.query = query; - return this; - } - - /** - * The text to search in the index. - * - * @return query - */ - @javax.annotation.Nonnull - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public BrowseResponse queryAfterRemoval(String queryAfterRemoval) { - this.queryAfterRemoval = queryAfterRemoval; - return this; - } - - /** - * A markup text indicating which parts of the original query have been removed in order to - * retrieve a non-empty result set. - * - * @return queryAfterRemoval - */ - @javax.annotation.Nullable - public String getQueryAfterRemoval() { - return queryAfterRemoval; - } - - public void setQueryAfterRemoval(String queryAfterRemoval) { - this.queryAfterRemoval = queryAfterRemoval; - } - - public BrowseResponse serverUsed(String serverUsed) { - this.serverUsed = serverUsed; - return this; - } - - /** - * Actual host name of the server that processed the request. - * - * @return serverUsed - */ - @javax.annotation.Nullable - public String getServerUsed() { - return serverUsed; - } - - public void setServerUsed(String serverUsed) { - this.serverUsed = serverUsed; - } - - public BrowseResponse userData(Object userData) { - this.userData = userData; - return this; - } - - /** - * Lets you store custom data in your indices. - * - * @return userData - */ - @javax.annotation.Nullable - public Object getUserData() { - return userData; - } - - public void setUserData(Object userData) { - this.userData = userData; - } - - public BrowseResponse hits(List hits) { - this.hits = hits; - return this; - } - - public BrowseResponse addHitsItem(Hit hitsItem) { - this.hits.add(hitsItem); - return this; - } - - /** - * Get hits - * - * @return hits - */ - @javax.annotation.Nonnull - public List getHits() { - return hits; - } - - public void setHits(List hits) { - this.hits = hits; - } - - public BrowseResponse cursor(String cursor) { - this.cursor = cursor; - return this; - } - - /** - * Cursor indicating the location to resume browsing from. Must match the value returned by the - * previous call. - * - * @return cursor - */ - @javax.annotation.Nonnull - public String getCursor() { - return cursor; - } - - public void setCursor(String cursor) { - this.cursor = cursor; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BrowseResponse browseResponse = (BrowseResponse) o; - return ( - Objects.equals(this.abTestID, browseResponse.abTestID) && - Objects.equals(this.abTestVariantID, browseResponse.abTestVariantID) && - Objects.equals(this.aroundLatLng, browseResponse.aroundLatLng) && - Objects.equals(this.automaticRadius, browseResponse.automaticRadius) && - Objects.equals( - this.exhaustiveFacetsCount, - browseResponse.exhaustiveFacetsCount - ) && - Objects.equals(this.exhaustiveNbHits, browseResponse.exhaustiveNbHits) && - Objects.equals(this.exhaustiveTypo, browseResponse.exhaustiveTypo) && - Objects.equals(this.facets, browseResponse.facets) && - Objects.equals(this.facetsStats, browseResponse.facetsStats) && - Objects.equals(this.hitsPerPage, browseResponse.hitsPerPage) && - Objects.equals(this.index, browseResponse.index) && - Objects.equals(this.indexUsed, browseResponse.indexUsed) && - Objects.equals(this.message, browseResponse.message) && - Objects.equals(this.nbHits, browseResponse.nbHits) && - Objects.equals(this.nbPages, browseResponse.nbPages) && - Objects.equals(this.nbSortedHits, browseResponse.nbSortedHits) && - Objects.equals(this.page, browseResponse.page) && - Objects.equals(this.params, browseResponse.params) && - Objects.equals(this.parsedQuery, browseResponse.parsedQuery) && - Objects.equals(this.processingTimeMS, browseResponse.processingTimeMS) && - Objects.equals(this.query, browseResponse.query) && - Objects.equals( - this.queryAfterRemoval, - browseResponse.queryAfterRemoval - ) && - Objects.equals(this.serverUsed, browseResponse.serverUsed) && - Objects.equals(this.userData, browseResponse.userData) && - Objects.equals(this.hits, browseResponse.hits) && - Objects.equals(this.cursor, browseResponse.cursor) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - abTestID, - abTestVariantID, - aroundLatLng, - automaticRadius, - exhaustiveFacetsCount, - exhaustiveNbHits, - exhaustiveTypo, - facets, - facetsStats, - hitsPerPage, - index, - indexUsed, - message, - nbHits, - nbPages, - nbSortedHits, - page, - params, - parsedQuery, - processingTimeMS, - query, - queryAfterRemoval, - serverUsed, - userData, - hits, - cursor - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BrowseResponse {\n"); - sb.append(" abTestID: ").append(toIndentedString(abTestID)).append("\n"); - sb - .append(" abTestVariantID: ") - .append(toIndentedString(abTestVariantID)) - .append("\n"); - sb - .append(" aroundLatLng: ") - .append(toIndentedString(aroundLatLng)) - .append("\n"); - sb - .append(" automaticRadius: ") - .append(toIndentedString(automaticRadius)) - .append("\n"); - sb - .append(" exhaustiveFacetsCount: ") - .append(toIndentedString(exhaustiveFacetsCount)) - .append("\n"); - sb - .append(" exhaustiveNbHits: ") - .append(toIndentedString(exhaustiveNbHits)) - .append("\n"); - sb - .append(" exhaustiveTypo: ") - .append(toIndentedString(exhaustiveTypo)) - .append("\n"); - sb.append(" facets: ").append(toIndentedString(facets)).append("\n"); - sb - .append(" facetsStats: ") - .append(toIndentedString(facetsStats)) - .append("\n"); - sb - .append(" hitsPerPage: ") - .append(toIndentedString(hitsPerPage)) - .append("\n"); - sb.append(" index: ").append(toIndentedString(index)).append("\n"); - sb - .append(" indexUsed: ") - .append(toIndentedString(indexUsed)) - .append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" nbHits: ").append(toIndentedString(nbHits)).append("\n"); - sb.append(" nbPages: ").append(toIndentedString(nbPages)).append("\n"); - sb - .append(" nbSortedHits: ") - .append(toIndentedString(nbSortedHits)) - .append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb - .append(" parsedQuery: ") - .append(toIndentedString(parsedQuery)) - .append("\n"); - sb - .append(" processingTimeMS: ") - .append(toIndentedString(processingTimeMS)) - .append("\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb - .append(" queryAfterRemoval: ") - .append(toIndentedString(queryAfterRemoval)) - .append("\n"); - sb - .append(" serverUsed: ") - .append(toIndentedString(serverUsed)) - .append("\n"); - sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); - sb.append(" hits: ").append(toIndentedString(hits)).append("\n"); - sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/BuiltInOperation.java b/algoliasearch-core/com/algolia/model/BuiltInOperation.java deleted file mode 100644 index b9ff646ce..000000000 --- a/algoliasearch-core/com/algolia/model/BuiltInOperation.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Objects; - -/** - * To update an attribute without pushing the entire record, you can use these built-in operations. - */ -public class BuiltInOperation { - - /** The operation to apply on the attribute. */ - @JsonAdapter(OperationEnum.Adapter.class) - public enum OperationEnum { - INCREMENT("Increment"), - - DECREMENT("Decrement"), - - ADD("Add"), - - REMOVE("Remove"), - - ADDUNIQUE("AddUnique"), - - INCREMENTFROM("IncrementFrom"), - - INCREMENTSET("IncrementSet"); - - private String value; - - OperationEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static OperationEnum fromValue(String value) { - for (OperationEnum b : OperationEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final OperationEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public OperationEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return OperationEnum.fromValue(value); - } - } - } - - @SerializedName("_operation") - private OperationEnum operation; - - @SerializedName("value") - private String value; - - public BuiltInOperation operation(OperationEnum operation) { - this.operation = operation; - return this; - } - - /** - * The operation to apply on the attribute. - * - * @return operation - */ - @javax.annotation.Nonnull - public OperationEnum getOperation() { - return operation; - } - - public void setOperation(OperationEnum operation) { - this.operation = operation; - } - - public BuiltInOperation value(String value) { - this.value = value; - return this; - } - - /** - * the right-hand side argument to the operation, for example, increment or decrement step, value - * to add or remove. - * - * @return value - */ - @javax.annotation.Nonnull - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BuiltInOperation builtInOperation = (BuiltInOperation) o; - return ( - Objects.equals(this.operation, builtInOperation.operation) && - Objects.equals(this.value, builtInOperation.value) - ); - } - - @Override - public int hashCode() { - return Objects.hash(operation, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BuiltInOperation {\n"); - sb - .append(" operation: ") - .append(toIndentedString(operation)) - .append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/Condition.java b/algoliasearch-core/com/algolia/model/Condition.java deleted file mode 100644 index c445c6bd5..000000000 --- a/algoliasearch-core/com/algolia/model/Condition.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** Condition */ -public class Condition { - - @SerializedName("pattern") - private String pattern; - - @SerializedName("anchoring") - private Anchoring anchoring; - - @SerializedName("alternatives") - private Boolean alternatives = false; - - @SerializedName("context") - private String context; - - public Condition pattern(String pattern) { - this.pattern = pattern; - return this; - } - - /** - * Query pattern syntax - * - * @return pattern - */ - @javax.annotation.Nullable - public String getPattern() { - return pattern; - } - - public void setPattern(String pattern) { - this.pattern = pattern; - } - - public Condition anchoring(Anchoring anchoring) { - this.anchoring = anchoring; - return this; - } - - /** - * Get anchoring - * - * @return anchoring - */ - @javax.annotation.Nullable - public Anchoring getAnchoring() { - return anchoring; - } - - public void setAnchoring(Anchoring anchoring) { - this.anchoring = anchoring; - } - - public Condition alternatives(Boolean alternatives) { - this.alternatives = alternatives; - return this; - } - - /** - * Whether the pattern matches on plurals, synonyms, and typos. - * - * @return alternatives - */ - @javax.annotation.Nullable - public Boolean getAlternatives() { - return alternatives; - } - - public void setAlternatives(Boolean alternatives) { - this.alternatives = alternatives; - } - - public Condition context(String context) { - this.context = context; - return this; - } - - /** - * Rule context format: [A-Za-z0-9_-]+). - * - * @return context - */ - @javax.annotation.Nullable - public String getContext() { - return context; - } - - public void setContext(String context) { - this.context = context; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Condition condition = (Condition) o; - return ( - Objects.equals(this.pattern, condition.pattern) && - Objects.equals(this.anchoring, condition.anchoring) && - Objects.equals(this.alternatives, condition.alternatives) && - Objects.equals(this.context, condition.context) - ); - } - - @Override - public int hashCode() { - return Objects.hash(pattern, anchoring, alternatives, context); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Condition {\n"); - sb.append(" pattern: ").append(toIndentedString(pattern)).append("\n"); - sb - .append(" anchoring: ") - .append(toIndentedString(anchoring)) - .append("\n"); - sb - .append(" alternatives: ") - .append(toIndentedString(alternatives)) - .append("\n"); - sb.append(" context: ").append(toIndentedString(context)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/Consequence.java b/algoliasearch-core/com/algolia/model/Consequence.java deleted file mode 100644 index 039564519..000000000 --- a/algoliasearch-core/com/algolia/model/Consequence.java +++ /dev/null @@ -1,189 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Consequence of the Rule. */ -public class Consequence { - - @SerializedName("params") - private ConsequenceParams params; - - @SerializedName("promote") - private List promote = null; - - @SerializedName("filterPromotes") - private Boolean filterPromotes = false; - - @SerializedName("hide") - private List hide = null; - - @SerializedName("userData") - private Object userData; - - public Consequence params(ConsequenceParams params) { - this.params = params; - return this; - } - - /** - * Get params - * - * @return params - */ - @javax.annotation.Nullable - public ConsequenceParams getParams() { - return params; - } - - public void setParams(ConsequenceParams params) { - this.params = params; - } - - public Consequence promote(List promote) { - this.promote = promote; - return this; - } - - public Consequence addPromoteItem(Promote promoteItem) { - if (this.promote == null) { - this.promote = new ArrayList<>(); - } - this.promote.add(promoteItem); - return this; - } - - /** - * Objects to promote as hits. - * - * @return promote - */ - @javax.annotation.Nullable - public List getPromote() { - return promote; - } - - public void setPromote(List promote) { - this.promote = promote; - } - - public Consequence filterPromotes(Boolean filterPromotes) { - this.filterPromotes = filterPromotes; - return this; - } - - /** - * Only use in combination with the promote consequence. When true, promoted results will be - * restricted to match the filters of the current search. When false, the promoted results will - * show up regardless of the filters. - * - * @return filterPromotes - */ - @javax.annotation.Nullable - public Boolean getFilterPromotes() { - return filterPromotes; - } - - public void setFilterPromotes(Boolean filterPromotes) { - this.filterPromotes = filterPromotes; - } - - public Consequence hide(List hide) { - this.hide = hide; - return this; - } - - public Consequence addHideItem(ConsequenceHide hideItem) { - if (this.hide == null) { - this.hide = new ArrayList<>(); - } - this.hide.add(hideItem); - return this; - } - - /** - * Objects to hide from hits. Each object must contain an objectID field. By default, you can hide - * up to 50 items per rule. - * - * @return hide - */ - @javax.annotation.Nullable - public List getHide() { - return hide; - } - - public void setHide(List hide) { - this.hide = hide; - } - - public Consequence userData(Object userData) { - this.userData = userData; - return this; - } - - /** - * Custom JSON object that will be appended to the userData array in the response. This object - * isn't interpreted by the API. It's limited to 1kB of minified JSON. - * - * @return userData - */ - @javax.annotation.Nullable - public Object getUserData() { - return userData; - } - - public void setUserData(Object userData) { - this.userData = userData; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Consequence consequence = (Consequence) o; - return ( - Objects.equals(this.params, consequence.params) && - Objects.equals(this.promote, consequence.promote) && - Objects.equals(this.filterPromotes, consequence.filterPromotes) && - Objects.equals(this.hide, consequence.hide) && - Objects.equals(this.userData, consequence.userData) - ); - } - - @Override - public int hashCode() { - return Objects.hash(params, promote, filterPromotes, hide, userData); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Consequence {\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb.append(" promote: ").append(toIndentedString(promote)).append("\n"); - sb - .append(" filterPromotes: ") - .append(toIndentedString(filterPromotes)) - .append("\n"); - sb.append(" hide: ").append(toIndentedString(hide)).append("\n"); - sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/ConsequenceHide.java b/algoliasearch-core/com/algolia/model/ConsequenceHide.java deleted file mode 100644 index eb08e8b59..000000000 --- a/algoliasearch-core/com/algolia/model/ConsequenceHide.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** Unique identifier of the object to hide. */ -public class ConsequenceHide { - - @SerializedName("objectID") - private String objectID; - - public ConsequenceHide objectID(String objectID) { - this.objectID = objectID; - return this; - } - - /** - * Unique identifier of the object. - * - * @return objectID - */ - @javax.annotation.Nonnull - public String getObjectID() { - return objectID; - } - - public void setObjectID(String objectID) { - this.objectID = objectID; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ConsequenceHide consequenceHide = (ConsequenceHide) o; - return Objects.equals(this.objectID, consequenceHide.objectID); - } - - @Override - public int hashCode() { - return Objects.hash(objectID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConsequenceHide {\n"); - sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/ConsequenceParams.java b/algoliasearch-core/com/algolia/model/ConsequenceParams.java deleted file mode 100644 index 2fd6c440a..000000000 --- a/algoliasearch-core/com/algolia/model/ConsequenceParams.java +++ /dev/null @@ -1,3018 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** ConsequenceParams */ -public class ConsequenceParams { - - @SerializedName("query") - private String query; - - @SerializedName("automaticFacetFilters") - private List automaticFacetFilters = null; - - @SerializedName("automaticOptionalFacetFilters") - private List automaticOptionalFacetFilters = null; - - @SerializedName("similarQuery") - private String similarQuery = ""; - - @SerializedName("filters") - private String filters = ""; - - @SerializedName("facetFilters") - private List facetFilters = null; - - @SerializedName("optionalFilters") - private List optionalFilters = null; - - @SerializedName("numericFilters") - private List numericFilters = null; - - @SerializedName("tagFilters") - private List tagFilters = null; - - @SerializedName("sumOrFiltersScores") - private Boolean sumOrFiltersScores = false; - - @SerializedName("facets") - private List facets = null; - - @SerializedName("maxValuesPerFacet") - private Integer maxValuesPerFacet = 100; - - @SerializedName("facetingAfterDistinct") - private Boolean facetingAfterDistinct = false; - - @SerializedName("sortFacetValuesBy") - private String sortFacetValuesBy = "count"; - - @SerializedName("page") - private Integer page = 0; - - @SerializedName("offset") - private Integer offset; - - @SerializedName("length") - private Integer length; - - @SerializedName("aroundLatLng") - private String aroundLatLng = ""; - - @SerializedName("aroundLatLngViaIP") - private Boolean aroundLatLngViaIP = false; - - @SerializedName("aroundRadius") - private OneOfintegerstring aroundRadius; - - @SerializedName("aroundPrecision") - private Integer aroundPrecision = 10; - - @SerializedName("minimumAroundRadius") - private Integer minimumAroundRadius; - - @SerializedName("insideBoundingBox") - private List insideBoundingBox = null; - - @SerializedName("insidePolygon") - private List insidePolygon = null; - - @SerializedName("naturalLanguages") - private List naturalLanguages = null; - - @SerializedName("ruleContexts") - private List ruleContexts = null; - - @SerializedName("personalizationImpact") - private Integer personalizationImpact = 100; - - @SerializedName("userToken") - private String userToken; - - @SerializedName("getRankingInfo") - private Boolean getRankingInfo = false; - - @SerializedName("clickAnalytics") - private Boolean clickAnalytics = false; - - @SerializedName("analytics") - private Boolean analytics = true; - - @SerializedName("analyticsTags") - private List analyticsTags = null; - - @SerializedName("percentileComputation") - private Boolean percentileComputation = true; - - @SerializedName("enableABTest") - private Boolean enableABTest = true; - - @SerializedName("enableReRanking") - private Boolean enableReRanking = true; - - @SerializedName("searchableAttributes") - private List searchableAttributes = null; - - @SerializedName("attributesForFaceting") - private List attributesForFaceting = null; - - @SerializedName("unretrievableAttributes") - private List unretrievableAttributes = null; - - @SerializedName("attributesToRetrieve") - private List attributesToRetrieve = null; - - @SerializedName("restrictSearchableAttributes") - private List restrictSearchableAttributes = null; - - @SerializedName("ranking") - private List ranking = null; - - @SerializedName("customRanking") - private List customRanking = null; - - @SerializedName("relevancyStrictness") - private Integer relevancyStrictness = 100; - - @SerializedName("attributesToHighlight") - private List attributesToHighlight = null; - - @SerializedName("attributesToSnippet") - private List attributesToSnippet = null; - - @SerializedName("highlightPreTag") - private String highlightPreTag = ""; - - @SerializedName("highlightPostTag") - private String highlightPostTag = ""; - - @SerializedName("snippetEllipsisText") - private String snippetEllipsisText = "…"; - - @SerializedName("restrictHighlightAndSnippetArrays") - private Boolean restrictHighlightAndSnippetArrays = false; - - @SerializedName("hitsPerPage") - private Integer hitsPerPage = 20; - - @SerializedName("minWordSizefor1Typo") - private Integer minWordSizefor1Typo = 4; - - @SerializedName("minWordSizefor2Typos") - private Integer minWordSizefor2Typos = 8; - - /** Controls whether typo tolerance is enabled and how it is applied. */ - @JsonAdapter(TypoToleranceEnum.Adapter.class) - public enum TypoToleranceEnum { - TRUE("true"), - - FALSE("false"), - - MIN("min"), - - STRICT("strict"); - - private String value; - - TypoToleranceEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypoToleranceEnum fromValue(String value) { - for (TypoToleranceEnum b : TypoToleranceEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final TypoToleranceEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypoToleranceEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return TypoToleranceEnum.fromValue(value); - } - } - } - - @SerializedName("typoTolerance") - private TypoToleranceEnum typoTolerance = TypoToleranceEnum.TRUE; - - @SerializedName("allowTyposOnNumericTokens") - private Boolean allowTyposOnNumericTokens = true; - - @SerializedName("disableTypoToleranceOnAttributes") - private List disableTypoToleranceOnAttributes = null; - - @SerializedName("separatorsToIndex") - private String separatorsToIndex = ""; - - @SerializedName("ignorePlurals") - private String ignorePlurals = "false"; - - @SerializedName("removeStopWords") - private String removeStopWords = "false"; - - @SerializedName("keepDiacriticsOnCharacters") - private String keepDiacriticsOnCharacters = ""; - - @SerializedName("queryLanguages") - private List queryLanguages = null; - - @SerializedName("decompoundQuery") - private Boolean decompoundQuery = true; - - @SerializedName("enableRules") - private Boolean enableRules = true; - - @SerializedName("enablePersonalization") - private Boolean enablePersonalization = false; - - /** Controls if and how query words are interpreted as prefixes. */ - @JsonAdapter(QueryTypeEnum.Adapter.class) - public enum QueryTypeEnum { - PREFIXLAST("prefixLast"), - - PREFIXALL("prefixAll"), - - PREFIXNONE("prefixNone"); - - private String value; - - QueryTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static QueryTypeEnum fromValue(String value) { - for (QueryTypeEnum b : QueryTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final QueryTypeEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public QueryTypeEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return QueryTypeEnum.fromValue(value); - } - } - } - - @SerializedName("queryType") - private QueryTypeEnum queryType = QueryTypeEnum.PREFIXLAST; - - /** Selects a strategy to remove words from the query when it doesn't match any hits. */ - @JsonAdapter(RemoveWordsIfNoResultsEnum.Adapter.class) - public enum RemoveWordsIfNoResultsEnum { - NONE("none"), - - LASTWORDS("lastWords"), - - FIRSTWORDS("firstWords"), - - ALLOPTIONAL("allOptional"); - - private String value; - - RemoveWordsIfNoResultsEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static RemoveWordsIfNoResultsEnum fromValue(String value) { - for (RemoveWordsIfNoResultsEnum b : RemoveWordsIfNoResultsEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final RemoveWordsIfNoResultsEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public RemoveWordsIfNoResultsEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return RemoveWordsIfNoResultsEnum.fromValue(value); - } - } - } - - @SerializedName("removeWordsIfNoResults") - private RemoveWordsIfNoResultsEnum removeWordsIfNoResults = - RemoveWordsIfNoResultsEnum.NONE; - - @SerializedName("advancedSyntax") - private Boolean advancedSyntax = false; - - @SerializedName("optionalWords") - private List optionalWords = null; - - @SerializedName("disableExactOnAttributes") - private List disableExactOnAttributes = null; - - /** Controls how the exact ranking criterion is computed when the query contains only one word. */ - @JsonAdapter(ExactOnSingleWordQueryEnum.Adapter.class) - public enum ExactOnSingleWordQueryEnum { - ATTRIBUTE("attribute"), - - NONE("none"), - - WORD("word"); - - private String value; - - ExactOnSingleWordQueryEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ExactOnSingleWordQueryEnum fromValue(String value) { - for (ExactOnSingleWordQueryEnum b : ExactOnSingleWordQueryEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final ExactOnSingleWordQueryEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ExactOnSingleWordQueryEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return ExactOnSingleWordQueryEnum.fromValue(value); - } - } - } - - @SerializedName("exactOnSingleWordQuery") - private ExactOnSingleWordQueryEnum exactOnSingleWordQuery = - ExactOnSingleWordQueryEnum.ATTRIBUTE; - - /** Gets or Sets alternativesAsExact */ - @JsonAdapter(AlternativesAsExactEnum.Adapter.class) - public enum AlternativesAsExactEnum { - IGNOREPLURALS("ignorePlurals"), - - SINGLEWORDSYNONYM("singleWordSynonym"), - - MULTIWORDSSYNONYM("multiWordsSynonym"); - - private String value; - - AlternativesAsExactEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AlternativesAsExactEnum fromValue(String value) { - for (AlternativesAsExactEnum b : AlternativesAsExactEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final AlternativesAsExactEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AlternativesAsExactEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return AlternativesAsExactEnum.fromValue(value); - } - } - } - - @SerializedName("alternativesAsExact") - private List alternativesAsExact = null; - - /** Gets or Sets advancedSyntaxFeatures */ - @JsonAdapter(AdvancedSyntaxFeaturesEnum.Adapter.class) - public enum AdvancedSyntaxFeaturesEnum { - EXACTPHRASE("exactPhrase"), - - EXCLUDEWORDS("excludeWords"); - - private String value; - - AdvancedSyntaxFeaturesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AdvancedSyntaxFeaturesEnum fromValue(String value) { - for (AdvancedSyntaxFeaturesEnum b : AdvancedSyntaxFeaturesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final AdvancedSyntaxFeaturesEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AdvancedSyntaxFeaturesEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return AdvancedSyntaxFeaturesEnum.fromValue(value); - } - } - } - - @SerializedName("advancedSyntaxFeatures") - private List advancedSyntaxFeatures = null; - - @SerializedName("distinct") - private Integer distinct = 0; - - @SerializedName("synonyms") - private Boolean synonyms = true; - - @SerializedName("replaceSynonymsInHighlight") - private Boolean replaceSynonymsInHighlight = false; - - @SerializedName("minProximity") - private Integer minProximity = 1; - - @SerializedName("responseFields") - private List responseFields = null; - - @SerializedName("maxFacetHits") - private Integer maxFacetHits = 10; - - @SerializedName("attributeCriteriaComputedByMinProximity") - private Boolean attributeCriteriaComputedByMinProximity = false; - - @SerializedName("renderingContent") - private Object renderingContent = new Object(); - - public ConsequenceParams query(String query) { - this.query = query; - return this; - } - - /** - * Query string. - * - * @return query - */ - @javax.annotation.Nullable - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public ConsequenceParams automaticFacetFilters( - List automaticFacetFilters - ) { - this.automaticFacetFilters = automaticFacetFilters; - return this; - } - - public ConsequenceParams addAutomaticFacetFiltersItem( - AutomaticFacetFilter automaticFacetFiltersItem - ) { - if (this.automaticFacetFilters == null) { - this.automaticFacetFilters = new ArrayList<>(); - } - this.automaticFacetFilters.add(automaticFacetFiltersItem); - return this; - } - - /** - * Names of facets to which automatic filtering must be applied; they must match the facet name of - * a facet value placeholder in the query pattern. - * - * @return automaticFacetFilters - */ - @javax.annotation.Nullable - public List getAutomaticFacetFilters() { - return automaticFacetFilters; - } - - public void setAutomaticFacetFilters( - List automaticFacetFilters - ) { - this.automaticFacetFilters = automaticFacetFilters; - } - - public ConsequenceParams automaticOptionalFacetFilters( - List automaticOptionalFacetFilters - ) { - this.automaticOptionalFacetFilters = automaticOptionalFacetFilters; - return this; - } - - public ConsequenceParams addAutomaticOptionalFacetFiltersItem( - AutomaticFacetFilter automaticOptionalFacetFiltersItem - ) { - if (this.automaticOptionalFacetFilters == null) { - this.automaticOptionalFacetFilters = new ArrayList<>(); - } - this.automaticOptionalFacetFilters.add(automaticOptionalFacetFiltersItem); - return this; - } - - /** - * Same syntax as automaticFacetFilters, but the engine treats the filters as optional. - * - * @return automaticOptionalFacetFilters - */ - @javax.annotation.Nullable - public List getAutomaticOptionalFacetFilters() { - return automaticOptionalFacetFilters; - } - - public void setAutomaticOptionalFacetFilters( - List automaticOptionalFacetFilters - ) { - this.automaticOptionalFacetFilters = automaticOptionalFacetFilters; - } - - public ConsequenceParams similarQuery(String similarQuery) { - this.similarQuery = similarQuery; - return this; - } - - /** - * Overrides the query parameter and performs a more generic search that can be used to find - * \"similar\" results. - * - * @return similarQuery - */ - @javax.annotation.Nullable - public String getSimilarQuery() { - return similarQuery; - } - - public void setSimilarQuery(String similarQuery) { - this.similarQuery = similarQuery; - } - - public ConsequenceParams filters(String filters) { - this.filters = filters; - return this; - } - - /** - * Filter the query with numeric, facet and/or tag filters. - * - * @return filters - */ - @javax.annotation.Nullable - public String getFilters() { - return filters; - } - - public void setFilters(String filters) { - this.filters = filters; - } - - public ConsequenceParams facetFilters(List facetFilters) { - this.facetFilters = facetFilters; - return this; - } - - public ConsequenceParams addFacetFiltersItem(String facetFiltersItem) { - if (this.facetFilters == null) { - this.facetFilters = new ArrayList<>(); - } - this.facetFilters.add(facetFiltersItem); - return this; - } - - /** - * Filter hits by facet value. - * - * @return facetFilters - */ - @javax.annotation.Nullable - public List getFacetFilters() { - return facetFilters; - } - - public void setFacetFilters(List facetFilters) { - this.facetFilters = facetFilters; - } - - public ConsequenceParams optionalFilters(List optionalFilters) { - this.optionalFilters = optionalFilters; - return this; - } - - public ConsequenceParams addOptionalFiltersItem(String optionalFiltersItem) { - if (this.optionalFilters == null) { - this.optionalFilters = new ArrayList<>(); - } - this.optionalFilters.add(optionalFiltersItem); - return this; - } - - /** - * Create filters for ranking purposes, where records that match the filter are ranked higher, or - * lower in the case of a negative optional filter. - * - * @return optionalFilters - */ - @javax.annotation.Nullable - public List getOptionalFilters() { - return optionalFilters; - } - - public void setOptionalFilters(List optionalFilters) { - this.optionalFilters = optionalFilters; - } - - public ConsequenceParams numericFilters(List numericFilters) { - this.numericFilters = numericFilters; - return this; - } - - public ConsequenceParams addNumericFiltersItem(String numericFiltersItem) { - if (this.numericFilters == null) { - this.numericFilters = new ArrayList<>(); - } - this.numericFilters.add(numericFiltersItem); - return this; - } - - /** - * Filter on numeric attributes. - * - * @return numericFilters - */ - @javax.annotation.Nullable - public List getNumericFilters() { - return numericFilters; - } - - public void setNumericFilters(List numericFilters) { - this.numericFilters = numericFilters; - } - - public ConsequenceParams tagFilters(List tagFilters) { - this.tagFilters = tagFilters; - return this; - } - - public ConsequenceParams addTagFiltersItem(String tagFiltersItem) { - if (this.tagFilters == null) { - this.tagFilters = new ArrayList<>(); - } - this.tagFilters.add(tagFiltersItem); - return this; - } - - /** - * Filter hits by tags. - * - * @return tagFilters - */ - @javax.annotation.Nullable - public List getTagFilters() { - return tagFilters; - } - - public void setTagFilters(List tagFilters) { - this.tagFilters = tagFilters; - } - - public ConsequenceParams sumOrFiltersScores(Boolean sumOrFiltersScores) { - this.sumOrFiltersScores = sumOrFiltersScores; - return this; - } - - /** - * Determines how to calculate the total score for filtering. - * - * @return sumOrFiltersScores - */ - @javax.annotation.Nullable - public Boolean getSumOrFiltersScores() { - return sumOrFiltersScores; - } - - public void setSumOrFiltersScores(Boolean sumOrFiltersScores) { - this.sumOrFiltersScores = sumOrFiltersScores; - } - - public ConsequenceParams facets(List facets) { - this.facets = facets; - return this; - } - - public ConsequenceParams addFacetsItem(String facetsItem) { - if (this.facets == null) { - this.facets = new ArrayList<>(); - } - this.facets.add(facetsItem); - return this; - } - - /** - * Retrieve facets and their facet values. - * - * @return facets - */ - @javax.annotation.Nullable - public List getFacets() { - return facets; - } - - public void setFacets(List facets) { - this.facets = facets; - } - - public ConsequenceParams maxValuesPerFacet(Integer maxValuesPerFacet) { - this.maxValuesPerFacet = maxValuesPerFacet; - return this; - } - - /** - * Maximum number of facet values to return for each facet during a regular search. - * - * @return maxValuesPerFacet - */ - @javax.annotation.Nullable - public Integer getMaxValuesPerFacet() { - return maxValuesPerFacet; - } - - public void setMaxValuesPerFacet(Integer maxValuesPerFacet) { - this.maxValuesPerFacet = maxValuesPerFacet; - } - - public ConsequenceParams facetingAfterDistinct( - Boolean facetingAfterDistinct - ) { - this.facetingAfterDistinct = facetingAfterDistinct; - return this; - } - - /** - * Force faceting to be applied after de-duplication (via the Distinct setting). - * - * @return facetingAfterDistinct - */ - @javax.annotation.Nullable - public Boolean getFacetingAfterDistinct() { - return facetingAfterDistinct; - } - - public void setFacetingAfterDistinct(Boolean facetingAfterDistinct) { - this.facetingAfterDistinct = facetingAfterDistinct; - } - - public ConsequenceParams sortFacetValuesBy(String sortFacetValuesBy) { - this.sortFacetValuesBy = sortFacetValuesBy; - return this; - } - - /** - * Controls how facet values are fetched. - * - * @return sortFacetValuesBy - */ - @javax.annotation.Nullable - public String getSortFacetValuesBy() { - return sortFacetValuesBy; - } - - public void setSortFacetValuesBy(String sortFacetValuesBy) { - this.sortFacetValuesBy = sortFacetValuesBy; - } - - public ConsequenceParams page(Integer page) { - this.page = page; - return this; - } - - /** - * Specify the page to retrieve. - * - * @return page - */ - @javax.annotation.Nullable - public Integer getPage() { - return page; - } - - public void setPage(Integer page) { - this.page = page; - } - - public ConsequenceParams offset(Integer offset) { - this.offset = offset; - return this; - } - - /** - * Specify the offset of the first hit to return. - * - * @return offset - */ - @javax.annotation.Nullable - public Integer getOffset() { - return offset; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public ConsequenceParams length(Integer length) { - this.length = length; - return this; - } - - /** - * Set the number of hits to retrieve (used only with offset). minimum: 1 maximum: 1000 - * - * @return length - */ - @javax.annotation.Nullable - public Integer getLength() { - return length; - } - - public void setLength(Integer length) { - this.length = length; - } - - public ConsequenceParams aroundLatLng(String aroundLatLng) { - this.aroundLatLng = aroundLatLng; - return this; - } - - /** - * Search for entries around a central geolocation, enabling a geo search within a circular area. - * - * @return aroundLatLng - */ - @javax.annotation.Nullable - public String getAroundLatLng() { - return aroundLatLng; - } - - public void setAroundLatLng(String aroundLatLng) { - this.aroundLatLng = aroundLatLng; - } - - public ConsequenceParams aroundLatLngViaIP(Boolean aroundLatLngViaIP) { - this.aroundLatLngViaIP = aroundLatLngViaIP; - return this; - } - - /** - * Search for entries around a given location automatically computed from the requester's IP - * address. - * - * @return aroundLatLngViaIP - */ - @javax.annotation.Nullable - public Boolean getAroundLatLngViaIP() { - return aroundLatLngViaIP; - } - - public void setAroundLatLngViaIP(Boolean aroundLatLngViaIP) { - this.aroundLatLngViaIP = aroundLatLngViaIP; - } - - public ConsequenceParams aroundRadius(OneOfintegerstring aroundRadius) { - this.aroundRadius = aroundRadius; - return this; - } - - /** - * Define the maximum radius for a geo search (in meters). - * - * @return aroundRadius - */ - @javax.annotation.Nullable - public OneOfintegerstring getAroundRadius() { - return aroundRadius; - } - - public void setAroundRadius(OneOfintegerstring aroundRadius) { - this.aroundRadius = aroundRadius; - } - - public ConsequenceParams aroundPrecision(Integer aroundPrecision) { - this.aroundPrecision = aroundPrecision; - return this; - } - - /** - * Precision of geo search (in meters), to add grouping by geo location to the ranking formula. - * - * @return aroundPrecision - */ - @javax.annotation.Nullable - public Integer getAroundPrecision() { - return aroundPrecision; - } - - public void setAroundPrecision(Integer aroundPrecision) { - this.aroundPrecision = aroundPrecision; - } - - public ConsequenceParams minimumAroundRadius(Integer minimumAroundRadius) { - this.minimumAroundRadius = minimumAroundRadius; - return this; - } - - /** - * Minimum radius (in meters) used for a geo search when aroundRadius is not set. minimum: 1 - * - * @return minimumAroundRadius - */ - @javax.annotation.Nullable - public Integer getMinimumAroundRadius() { - return minimumAroundRadius; - } - - public void setMinimumAroundRadius(Integer minimumAroundRadius) { - this.minimumAroundRadius = minimumAroundRadius; - } - - public ConsequenceParams insideBoundingBox( - List insideBoundingBox - ) { - this.insideBoundingBox = insideBoundingBox; - return this; - } - - public ConsequenceParams addInsideBoundingBoxItem( - BigDecimal insideBoundingBoxItem - ) { - if (this.insideBoundingBox == null) { - this.insideBoundingBox = new ArrayList<>(); - } - this.insideBoundingBox.add(insideBoundingBoxItem); - return this; - } - - /** - * Search inside a rectangular area (in geo coordinates). - * - * @return insideBoundingBox - */ - @javax.annotation.Nullable - public List getInsideBoundingBox() { - return insideBoundingBox; - } - - public void setInsideBoundingBox(List insideBoundingBox) { - this.insideBoundingBox = insideBoundingBox; - } - - public ConsequenceParams insidePolygon(List insidePolygon) { - this.insidePolygon = insidePolygon; - return this; - } - - public ConsequenceParams addInsidePolygonItem(BigDecimal insidePolygonItem) { - if (this.insidePolygon == null) { - this.insidePolygon = new ArrayList<>(); - } - this.insidePolygon.add(insidePolygonItem); - return this; - } - - /** - * Search inside a polygon (in geo coordinates). - * - * @return insidePolygon - */ - @javax.annotation.Nullable - public List getInsidePolygon() { - return insidePolygon; - } - - public void setInsidePolygon(List insidePolygon) { - this.insidePolygon = insidePolygon; - } - - public ConsequenceParams naturalLanguages(List naturalLanguages) { - this.naturalLanguages = naturalLanguages; - return this; - } - - public ConsequenceParams addNaturalLanguagesItem( - String naturalLanguagesItem - ) { - if (this.naturalLanguages == null) { - this.naturalLanguages = new ArrayList<>(); - } - this.naturalLanguages.add(naturalLanguagesItem); - return this; - } - - /** - * This parameter changes the default values of certain parameters and settings that work best for - * a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, - * analyticsTags and ruleContexts. These parameters and settings work well together when the query - * is formatted in natural language instead of keywords, for example when your user performs a - * voice search. - * - * @return naturalLanguages - */ - @javax.annotation.Nullable - public List getNaturalLanguages() { - return naturalLanguages; - } - - public void setNaturalLanguages(List naturalLanguages) { - this.naturalLanguages = naturalLanguages; - } - - public ConsequenceParams ruleContexts(List ruleContexts) { - this.ruleContexts = ruleContexts; - return this; - } - - public ConsequenceParams addRuleContextsItem(String ruleContextsItem) { - if (this.ruleContexts == null) { - this.ruleContexts = new ArrayList<>(); - } - this.ruleContexts.add(ruleContextsItem); - return this; - } - - /** - * Enables contextual rules. - * - * @return ruleContexts - */ - @javax.annotation.Nullable - public List getRuleContexts() { - return ruleContexts; - } - - public void setRuleContexts(List ruleContexts) { - this.ruleContexts = ruleContexts; - } - - public ConsequenceParams personalizationImpact( - Integer personalizationImpact - ) { - this.personalizationImpact = personalizationImpact; - return this; - } - - /** - * Define the impact of the Personalization feature. - * - * @return personalizationImpact - */ - @javax.annotation.Nullable - public Integer getPersonalizationImpact() { - return personalizationImpact; - } - - public void setPersonalizationImpact(Integer personalizationImpact) { - this.personalizationImpact = personalizationImpact; - } - - public ConsequenceParams userToken(String userToken) { - this.userToken = userToken; - return this; - } - - /** - * Associates a certain user token with the current search. - * - * @return userToken - */ - @javax.annotation.Nullable - public String getUserToken() { - return userToken; - } - - public void setUserToken(String userToken) { - this.userToken = userToken; - } - - public ConsequenceParams getRankingInfo(Boolean getRankingInfo) { - this.getRankingInfo = getRankingInfo; - return this; - } - - /** - * Retrieve detailed ranking information. - * - * @return getRankingInfo - */ - @javax.annotation.Nullable - public Boolean getGetRankingInfo() { - return getRankingInfo; - } - - public void setGetRankingInfo(Boolean getRankingInfo) { - this.getRankingInfo = getRankingInfo; - } - - public ConsequenceParams clickAnalytics(Boolean clickAnalytics) { - this.clickAnalytics = clickAnalytics; - return this; - } - - /** - * Enable the Click Analytics feature. - * - * @return clickAnalytics - */ - @javax.annotation.Nullable - public Boolean getClickAnalytics() { - return clickAnalytics; - } - - public void setClickAnalytics(Boolean clickAnalytics) { - this.clickAnalytics = clickAnalytics; - } - - public ConsequenceParams analytics(Boolean analytics) { - this.analytics = analytics; - return this; - } - - /** - * Whether the current query will be taken into account in the Analytics. - * - * @return analytics - */ - @javax.annotation.Nullable - public Boolean getAnalytics() { - return analytics; - } - - public void setAnalytics(Boolean analytics) { - this.analytics = analytics; - } - - public ConsequenceParams analyticsTags(List analyticsTags) { - this.analyticsTags = analyticsTags; - return this; - } - - public ConsequenceParams addAnalyticsTagsItem(String analyticsTagsItem) { - if (this.analyticsTags == null) { - this.analyticsTags = new ArrayList<>(); - } - this.analyticsTags.add(analyticsTagsItem); - return this; - } - - /** - * List of tags to apply to the query for analytics purposes. - * - * @return analyticsTags - */ - @javax.annotation.Nullable - public List getAnalyticsTags() { - return analyticsTags; - } - - public void setAnalyticsTags(List analyticsTags) { - this.analyticsTags = analyticsTags; - } - - public ConsequenceParams percentileComputation( - Boolean percentileComputation - ) { - this.percentileComputation = percentileComputation; - return this; - } - - /** - * Whether to include or exclude a query from the processing-time percentile computation. - * - * @return percentileComputation - */ - @javax.annotation.Nullable - public Boolean getPercentileComputation() { - return percentileComputation; - } - - public void setPercentileComputation(Boolean percentileComputation) { - this.percentileComputation = percentileComputation; - } - - public ConsequenceParams enableABTest(Boolean enableABTest) { - this.enableABTest = enableABTest; - return this; - } - - /** - * Whether this search should participate in running AB tests. - * - * @return enableABTest - */ - @javax.annotation.Nullable - public Boolean getEnableABTest() { - return enableABTest; - } - - public void setEnableABTest(Boolean enableABTest) { - this.enableABTest = enableABTest; - } - - public ConsequenceParams enableReRanking(Boolean enableReRanking) { - this.enableReRanking = enableReRanking; - return this; - } - - /** - * Whether this search should use AI Re-Ranking. - * - * @return enableReRanking - */ - @javax.annotation.Nullable - public Boolean getEnableReRanking() { - return enableReRanking; - } - - public void setEnableReRanking(Boolean enableReRanking) { - this.enableReRanking = enableReRanking; - } - - public ConsequenceParams searchableAttributes( - List searchableAttributes - ) { - this.searchableAttributes = searchableAttributes; - return this; - } - - public ConsequenceParams addSearchableAttributesItem( - String searchableAttributesItem - ) { - if (this.searchableAttributes == null) { - this.searchableAttributes = new ArrayList<>(); - } - this.searchableAttributes.add(searchableAttributesItem); - return this; - } - - /** - * The complete list of attributes used for searching. - * - * @return searchableAttributes - */ - @javax.annotation.Nullable - public List getSearchableAttributes() { - return searchableAttributes; - } - - public void setSearchableAttributes(List searchableAttributes) { - this.searchableAttributes = searchableAttributes; - } - - public ConsequenceParams attributesForFaceting( - List attributesForFaceting - ) { - this.attributesForFaceting = attributesForFaceting; - return this; - } - - public ConsequenceParams addAttributesForFacetingItem( - String attributesForFacetingItem - ) { - if (this.attributesForFaceting == null) { - this.attributesForFaceting = new ArrayList<>(); - } - this.attributesForFaceting.add(attributesForFacetingItem); - return this; - } - - /** - * The complete list of attributes that will be used for faceting. - * - * @return attributesForFaceting - */ - @javax.annotation.Nullable - public List getAttributesForFaceting() { - return attributesForFaceting; - } - - public void setAttributesForFaceting(List attributesForFaceting) { - this.attributesForFaceting = attributesForFaceting; - } - - public ConsequenceParams unretrievableAttributes( - List unretrievableAttributes - ) { - this.unretrievableAttributes = unretrievableAttributes; - return this; - } - - public ConsequenceParams addUnretrievableAttributesItem( - String unretrievableAttributesItem - ) { - if (this.unretrievableAttributes == null) { - this.unretrievableAttributes = new ArrayList<>(); - } - this.unretrievableAttributes.add(unretrievableAttributesItem); - return this; - } - - /** - * List of attributes that can't be retrieved at query time. - * - * @return unretrievableAttributes - */ - @javax.annotation.Nullable - public List getUnretrievableAttributes() { - return unretrievableAttributes; - } - - public void setUnretrievableAttributes(List unretrievableAttributes) { - this.unretrievableAttributes = unretrievableAttributes; - } - - public ConsequenceParams attributesToRetrieve( - List attributesToRetrieve - ) { - this.attributesToRetrieve = attributesToRetrieve; - return this; - } - - public ConsequenceParams addAttributesToRetrieveItem( - String attributesToRetrieveItem - ) { - if (this.attributesToRetrieve == null) { - this.attributesToRetrieve = new ArrayList<>(); - } - this.attributesToRetrieve.add(attributesToRetrieveItem); - return this; - } - - /** - * This parameter controls which attributes to retrieve and which not to retrieve. - * - * @return attributesToRetrieve - */ - @javax.annotation.Nullable - public List getAttributesToRetrieve() { - return attributesToRetrieve; - } - - public void setAttributesToRetrieve(List attributesToRetrieve) { - this.attributesToRetrieve = attributesToRetrieve; - } - - public ConsequenceParams restrictSearchableAttributes( - List restrictSearchableAttributes - ) { - this.restrictSearchableAttributes = restrictSearchableAttributes; - return this; - } - - public ConsequenceParams addRestrictSearchableAttributesItem( - String restrictSearchableAttributesItem - ) { - if (this.restrictSearchableAttributes == null) { - this.restrictSearchableAttributes = new ArrayList<>(); - } - this.restrictSearchableAttributes.add(restrictSearchableAttributesItem); - return this; - } - - /** - * Restricts a given query to look in only a subset of your searchable attributes. - * - * @return restrictSearchableAttributes - */ - @javax.annotation.Nullable - public List getRestrictSearchableAttributes() { - return restrictSearchableAttributes; - } - - public void setRestrictSearchableAttributes( - List restrictSearchableAttributes - ) { - this.restrictSearchableAttributes = restrictSearchableAttributes; - } - - public ConsequenceParams ranking(List ranking) { - this.ranking = ranking; - return this; - } - - public ConsequenceParams addRankingItem(String rankingItem) { - if (this.ranking == null) { - this.ranking = new ArrayList<>(); - } - this.ranking.add(rankingItem); - return this; - } - - /** - * Controls how Algolia should sort your results. - * - * @return ranking - */ - @javax.annotation.Nullable - public List getRanking() { - return ranking; - } - - public void setRanking(List ranking) { - this.ranking = ranking; - } - - public ConsequenceParams customRanking(List customRanking) { - this.customRanking = customRanking; - return this; - } - - public ConsequenceParams addCustomRankingItem(String customRankingItem) { - if (this.customRanking == null) { - this.customRanking = new ArrayList<>(); - } - this.customRanking.add(customRankingItem); - return this; - } - - /** - * Specifies the custom ranking criterion. - * - * @return customRanking - */ - @javax.annotation.Nullable - public List getCustomRanking() { - return customRanking; - } - - public void setCustomRanking(List customRanking) { - this.customRanking = customRanking; - } - - public ConsequenceParams relevancyStrictness(Integer relevancyStrictness) { - this.relevancyStrictness = relevancyStrictness; - return this; - } - - /** - * Controls the relevancy threshold below which less relevant results aren't included in the - * results. - * - * @return relevancyStrictness - */ - @javax.annotation.Nullable - public Integer getRelevancyStrictness() { - return relevancyStrictness; - } - - public void setRelevancyStrictness(Integer relevancyStrictness) { - this.relevancyStrictness = relevancyStrictness; - } - - public ConsequenceParams attributesToHighlight( - List attributesToHighlight - ) { - this.attributesToHighlight = attributesToHighlight; - return this; - } - - public ConsequenceParams addAttributesToHighlightItem( - String attributesToHighlightItem - ) { - if (this.attributesToHighlight == null) { - this.attributesToHighlight = new ArrayList<>(); - } - this.attributesToHighlight.add(attributesToHighlightItem); - return this; - } - - /** - * List of attributes to highlight. - * - * @return attributesToHighlight - */ - @javax.annotation.Nullable - public List getAttributesToHighlight() { - return attributesToHighlight; - } - - public void setAttributesToHighlight(List attributesToHighlight) { - this.attributesToHighlight = attributesToHighlight; - } - - public ConsequenceParams attributesToSnippet( - List attributesToSnippet - ) { - this.attributesToSnippet = attributesToSnippet; - return this; - } - - public ConsequenceParams addAttributesToSnippetItem( - String attributesToSnippetItem - ) { - if (this.attributesToSnippet == null) { - this.attributesToSnippet = new ArrayList<>(); - } - this.attributesToSnippet.add(attributesToSnippetItem); - return this; - } - - /** - * List of attributes to snippet, with an optional maximum number of words to snippet. - * - * @return attributesToSnippet - */ - @javax.annotation.Nullable - public List getAttributesToSnippet() { - return attributesToSnippet; - } - - public void setAttributesToSnippet(List attributesToSnippet) { - this.attributesToSnippet = attributesToSnippet; - } - - public ConsequenceParams highlightPreTag(String highlightPreTag) { - this.highlightPreTag = highlightPreTag; - return this; - } - - /** - * The HTML string to insert before the highlighted parts in all highlight and snippet results. - * - * @return highlightPreTag - */ - @javax.annotation.Nullable - public String getHighlightPreTag() { - return highlightPreTag; - } - - public void setHighlightPreTag(String highlightPreTag) { - this.highlightPreTag = highlightPreTag; - } - - public ConsequenceParams highlightPostTag(String highlightPostTag) { - this.highlightPostTag = highlightPostTag; - return this; - } - - /** - * The HTML string to insert after the highlighted parts in all highlight and snippet results. - * - * @return highlightPostTag - */ - @javax.annotation.Nullable - public String getHighlightPostTag() { - return highlightPostTag; - } - - public void setHighlightPostTag(String highlightPostTag) { - this.highlightPostTag = highlightPostTag; - } - - public ConsequenceParams snippetEllipsisText(String snippetEllipsisText) { - this.snippetEllipsisText = snippetEllipsisText; - return this; - } - - /** - * String used as an ellipsis indicator when a snippet is truncated. - * - * @return snippetEllipsisText - */ - @javax.annotation.Nullable - public String getSnippetEllipsisText() { - return snippetEllipsisText; - } - - public void setSnippetEllipsisText(String snippetEllipsisText) { - this.snippetEllipsisText = snippetEllipsisText; - } - - public ConsequenceParams restrictHighlightAndSnippetArrays( - Boolean restrictHighlightAndSnippetArrays - ) { - this.restrictHighlightAndSnippetArrays = restrictHighlightAndSnippetArrays; - return this; - } - - /** - * Restrict highlighting and snippeting to items that matched the query. - * - * @return restrictHighlightAndSnippetArrays - */ - @javax.annotation.Nullable - public Boolean getRestrictHighlightAndSnippetArrays() { - return restrictHighlightAndSnippetArrays; - } - - public void setRestrictHighlightAndSnippetArrays( - Boolean restrictHighlightAndSnippetArrays - ) { - this.restrictHighlightAndSnippetArrays = restrictHighlightAndSnippetArrays; - } - - public ConsequenceParams hitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - return this; - } - - /** - * Set the number of hits per page. - * - * @return hitsPerPage - */ - @javax.annotation.Nullable - public Integer getHitsPerPage() { - return hitsPerPage; - } - - public void setHitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - } - - public ConsequenceParams minWordSizefor1Typo(Integer minWordSizefor1Typo) { - this.minWordSizefor1Typo = minWordSizefor1Typo; - return this; - } - - /** - * Minimum number of characters a word in the query string must contain to accept matches with 1 - * typo. - * - * @return minWordSizefor1Typo - */ - @javax.annotation.Nullable - public Integer getMinWordSizefor1Typo() { - return minWordSizefor1Typo; - } - - public void setMinWordSizefor1Typo(Integer minWordSizefor1Typo) { - this.minWordSizefor1Typo = minWordSizefor1Typo; - } - - public ConsequenceParams minWordSizefor2Typos(Integer minWordSizefor2Typos) { - this.minWordSizefor2Typos = minWordSizefor2Typos; - return this; - } - - /** - * Minimum number of characters a word in the query string must contain to accept matches with 2 - * typos. - * - * @return minWordSizefor2Typos - */ - @javax.annotation.Nullable - public Integer getMinWordSizefor2Typos() { - return minWordSizefor2Typos; - } - - public void setMinWordSizefor2Typos(Integer minWordSizefor2Typos) { - this.minWordSizefor2Typos = minWordSizefor2Typos; - } - - public ConsequenceParams typoTolerance(TypoToleranceEnum typoTolerance) { - this.typoTolerance = typoTolerance; - return this; - } - - /** - * Controls whether typo tolerance is enabled and how it is applied. - * - * @return typoTolerance - */ - @javax.annotation.Nullable - public TypoToleranceEnum getTypoTolerance() { - return typoTolerance; - } - - public void setTypoTolerance(TypoToleranceEnum typoTolerance) { - this.typoTolerance = typoTolerance; - } - - public ConsequenceParams allowTyposOnNumericTokens( - Boolean allowTyposOnNumericTokens - ) { - this.allowTyposOnNumericTokens = allowTyposOnNumericTokens; - return this; - } - - /** - * Whether to allow typos on numbers (\"numeric tokens\") in the query string. - * - * @return allowTyposOnNumericTokens - */ - @javax.annotation.Nullable - public Boolean getAllowTyposOnNumericTokens() { - return allowTyposOnNumericTokens; - } - - public void setAllowTyposOnNumericTokens(Boolean allowTyposOnNumericTokens) { - this.allowTyposOnNumericTokens = allowTyposOnNumericTokens; - } - - public ConsequenceParams disableTypoToleranceOnAttributes( - List disableTypoToleranceOnAttributes - ) { - this.disableTypoToleranceOnAttributes = disableTypoToleranceOnAttributes; - return this; - } - - public ConsequenceParams addDisableTypoToleranceOnAttributesItem( - String disableTypoToleranceOnAttributesItem - ) { - if (this.disableTypoToleranceOnAttributes == null) { - this.disableTypoToleranceOnAttributes = new ArrayList<>(); - } - this.disableTypoToleranceOnAttributes.add( - disableTypoToleranceOnAttributesItem - ); - return this; - } - - /** - * List of attributes on which you want to disable typo tolerance. - * - * @return disableTypoToleranceOnAttributes - */ - @javax.annotation.Nullable - public List getDisableTypoToleranceOnAttributes() { - return disableTypoToleranceOnAttributes; - } - - public void setDisableTypoToleranceOnAttributes( - List disableTypoToleranceOnAttributes - ) { - this.disableTypoToleranceOnAttributes = disableTypoToleranceOnAttributes; - } - - public ConsequenceParams separatorsToIndex(String separatorsToIndex) { - this.separatorsToIndex = separatorsToIndex; - return this; - } - - /** - * Control which separators are indexed. - * - * @return separatorsToIndex - */ - @javax.annotation.Nullable - public String getSeparatorsToIndex() { - return separatorsToIndex; - } - - public void setSeparatorsToIndex(String separatorsToIndex) { - this.separatorsToIndex = separatorsToIndex; - } - - public ConsequenceParams ignorePlurals(String ignorePlurals) { - this.ignorePlurals = ignorePlurals; - return this; - } - - /** - * Treats singular, plurals, and other forms of declensions as matching terms. - * - * @return ignorePlurals - */ - @javax.annotation.Nullable - public String getIgnorePlurals() { - return ignorePlurals; - } - - public void setIgnorePlurals(String ignorePlurals) { - this.ignorePlurals = ignorePlurals; - } - - public ConsequenceParams removeStopWords(String removeStopWords) { - this.removeStopWords = removeStopWords; - return this; - } - - /** - * Removes stop (common) words from the query before executing it. - * - * @return removeStopWords - */ - @javax.annotation.Nullable - public String getRemoveStopWords() { - return removeStopWords; - } - - public void setRemoveStopWords(String removeStopWords) { - this.removeStopWords = removeStopWords; - } - - public ConsequenceParams keepDiacriticsOnCharacters( - String keepDiacriticsOnCharacters - ) { - this.keepDiacriticsOnCharacters = keepDiacriticsOnCharacters; - return this; - } - - /** - * List of characters that the engine shouldn't automatically normalize. - * - * @return keepDiacriticsOnCharacters - */ - @javax.annotation.Nullable - public String getKeepDiacriticsOnCharacters() { - return keepDiacriticsOnCharacters; - } - - public void setKeepDiacriticsOnCharacters(String keepDiacriticsOnCharacters) { - this.keepDiacriticsOnCharacters = keepDiacriticsOnCharacters; - } - - public ConsequenceParams queryLanguages(List queryLanguages) { - this.queryLanguages = queryLanguages; - return this; - } - - public ConsequenceParams addQueryLanguagesItem(String queryLanguagesItem) { - if (this.queryLanguages == null) { - this.queryLanguages = new ArrayList<>(); - } - this.queryLanguages.add(queryLanguagesItem); - return this; - } - - /** - * Sets the languages to be used by language-specific settings and functionalities such as - * ignorePlurals, removeStopWords, and CJK word-detection. - * - * @return queryLanguages - */ - @javax.annotation.Nullable - public List getQueryLanguages() { - return queryLanguages; - } - - public void setQueryLanguages(List queryLanguages) { - this.queryLanguages = queryLanguages; - } - - public ConsequenceParams decompoundQuery(Boolean decompoundQuery) { - this.decompoundQuery = decompoundQuery; - return this; - } - - /** - * Splits compound words into their composing atoms in the query. - * - * @return decompoundQuery - */ - @javax.annotation.Nullable - public Boolean getDecompoundQuery() { - return decompoundQuery; - } - - public void setDecompoundQuery(Boolean decompoundQuery) { - this.decompoundQuery = decompoundQuery; - } - - public ConsequenceParams enableRules(Boolean enableRules) { - this.enableRules = enableRules; - return this; - } - - /** - * Whether Rules should be globally enabled. - * - * @return enableRules - */ - @javax.annotation.Nullable - public Boolean getEnableRules() { - return enableRules; - } - - public void setEnableRules(Boolean enableRules) { - this.enableRules = enableRules; - } - - public ConsequenceParams enablePersonalization( - Boolean enablePersonalization - ) { - this.enablePersonalization = enablePersonalization; - return this; - } - - /** - * Enable the Personalization feature. - * - * @return enablePersonalization - */ - @javax.annotation.Nullable - public Boolean getEnablePersonalization() { - return enablePersonalization; - } - - public void setEnablePersonalization(Boolean enablePersonalization) { - this.enablePersonalization = enablePersonalization; - } - - public ConsequenceParams queryType(QueryTypeEnum queryType) { - this.queryType = queryType; - return this; - } - - /** - * Controls if and how query words are interpreted as prefixes. - * - * @return queryType - */ - @javax.annotation.Nullable - public QueryTypeEnum getQueryType() { - return queryType; - } - - public void setQueryType(QueryTypeEnum queryType) { - this.queryType = queryType; - } - - public ConsequenceParams removeWordsIfNoResults( - RemoveWordsIfNoResultsEnum removeWordsIfNoResults - ) { - this.removeWordsIfNoResults = removeWordsIfNoResults; - return this; - } - - /** - * Selects a strategy to remove words from the query when it doesn't match any hits. - * - * @return removeWordsIfNoResults - */ - @javax.annotation.Nullable - public RemoveWordsIfNoResultsEnum getRemoveWordsIfNoResults() { - return removeWordsIfNoResults; - } - - public void setRemoveWordsIfNoResults( - RemoveWordsIfNoResultsEnum removeWordsIfNoResults - ) { - this.removeWordsIfNoResults = removeWordsIfNoResults; - } - - public ConsequenceParams advancedSyntax(Boolean advancedSyntax) { - this.advancedSyntax = advancedSyntax; - return this; - } - - /** - * Enables the advanced query syntax. - * - * @return advancedSyntax - */ - @javax.annotation.Nullable - public Boolean getAdvancedSyntax() { - return advancedSyntax; - } - - public void setAdvancedSyntax(Boolean advancedSyntax) { - this.advancedSyntax = advancedSyntax; - } - - public ConsequenceParams optionalWords(List optionalWords) { - this.optionalWords = optionalWords; - return this; - } - - public ConsequenceParams addOptionalWordsItem(String optionalWordsItem) { - if (this.optionalWords == null) { - this.optionalWords = new ArrayList<>(); - } - this.optionalWords.add(optionalWordsItem); - return this; - } - - /** - * A list of words that should be considered as optional when found in the query. - * - * @return optionalWords - */ - @javax.annotation.Nullable - public List getOptionalWords() { - return optionalWords; - } - - public void setOptionalWords(List optionalWords) { - this.optionalWords = optionalWords; - } - - public ConsequenceParams disableExactOnAttributes( - List disableExactOnAttributes - ) { - this.disableExactOnAttributes = disableExactOnAttributes; - return this; - } - - public ConsequenceParams addDisableExactOnAttributesItem( - String disableExactOnAttributesItem - ) { - if (this.disableExactOnAttributes == null) { - this.disableExactOnAttributes = new ArrayList<>(); - } - this.disableExactOnAttributes.add(disableExactOnAttributesItem); - return this; - } - - /** - * List of attributes on which you want to disable the exact ranking criterion. - * - * @return disableExactOnAttributes - */ - @javax.annotation.Nullable - public List getDisableExactOnAttributes() { - return disableExactOnAttributes; - } - - public void setDisableExactOnAttributes( - List disableExactOnAttributes - ) { - this.disableExactOnAttributes = disableExactOnAttributes; - } - - public ConsequenceParams exactOnSingleWordQuery( - ExactOnSingleWordQueryEnum exactOnSingleWordQuery - ) { - this.exactOnSingleWordQuery = exactOnSingleWordQuery; - return this; - } - - /** - * Controls how the exact ranking criterion is computed when the query contains only one word. - * - * @return exactOnSingleWordQuery - */ - @javax.annotation.Nullable - public ExactOnSingleWordQueryEnum getExactOnSingleWordQuery() { - return exactOnSingleWordQuery; - } - - public void setExactOnSingleWordQuery( - ExactOnSingleWordQueryEnum exactOnSingleWordQuery - ) { - this.exactOnSingleWordQuery = exactOnSingleWordQuery; - } - - public ConsequenceParams alternativesAsExact( - List alternativesAsExact - ) { - this.alternativesAsExact = alternativesAsExact; - return this; - } - - public ConsequenceParams addAlternativesAsExactItem( - AlternativesAsExactEnum alternativesAsExactItem - ) { - if (this.alternativesAsExact == null) { - this.alternativesAsExact = new ArrayList<>(); - } - this.alternativesAsExact.add(alternativesAsExactItem); - return this; - } - - /** - * List of alternatives that should be considered an exact match by the exact ranking criterion. - * - * @return alternativesAsExact - */ - @javax.annotation.Nullable - public List getAlternativesAsExact() { - return alternativesAsExact; - } - - public void setAlternativesAsExact( - List alternativesAsExact - ) { - this.alternativesAsExact = alternativesAsExact; - } - - public ConsequenceParams advancedSyntaxFeatures( - List advancedSyntaxFeatures - ) { - this.advancedSyntaxFeatures = advancedSyntaxFeatures; - return this; - } - - public ConsequenceParams addAdvancedSyntaxFeaturesItem( - AdvancedSyntaxFeaturesEnum advancedSyntaxFeaturesItem - ) { - if (this.advancedSyntaxFeatures == null) { - this.advancedSyntaxFeatures = new ArrayList<>(); - } - this.advancedSyntaxFeatures.add(advancedSyntaxFeaturesItem); - return this; - } - - /** - * Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is - * enabled. - * - * @return advancedSyntaxFeatures - */ - @javax.annotation.Nullable - public List getAdvancedSyntaxFeatures() { - return advancedSyntaxFeatures; - } - - public void setAdvancedSyntaxFeatures( - List advancedSyntaxFeatures - ) { - this.advancedSyntaxFeatures = advancedSyntaxFeatures; - } - - public ConsequenceParams distinct(Integer distinct) { - this.distinct = distinct; - return this; - } - - /** - * Enables de-duplication or grouping of results. minimum: 0 maximum: 4 - * - * @return distinct - */ - @javax.annotation.Nullable - public Integer getDistinct() { - return distinct; - } - - public void setDistinct(Integer distinct) { - this.distinct = distinct; - } - - public ConsequenceParams synonyms(Boolean synonyms) { - this.synonyms = synonyms; - return this; - } - - /** - * Whether to take into account an index's synonyms for a particular search. - * - * @return synonyms - */ - @javax.annotation.Nullable - public Boolean getSynonyms() { - return synonyms; - } - - public void setSynonyms(Boolean synonyms) { - this.synonyms = synonyms; - } - - public ConsequenceParams replaceSynonymsInHighlight( - Boolean replaceSynonymsInHighlight - ) { - this.replaceSynonymsInHighlight = replaceSynonymsInHighlight; - return this; - } - - /** - * Whether to highlight and snippet the original word that matches the synonym or the synonym - * itself. - * - * @return replaceSynonymsInHighlight - */ - @javax.annotation.Nullable - public Boolean getReplaceSynonymsInHighlight() { - return replaceSynonymsInHighlight; - } - - public void setReplaceSynonymsInHighlight( - Boolean replaceSynonymsInHighlight - ) { - this.replaceSynonymsInHighlight = replaceSynonymsInHighlight; - } - - public ConsequenceParams minProximity(Integer minProximity) { - this.minProximity = minProximity; - return this; - } - - /** - * Precision of the proximity ranking criterion. minimum: 1 maximum: 7 - * - * @return minProximity - */ - @javax.annotation.Nullable - public Integer getMinProximity() { - return minProximity; - } - - public void setMinProximity(Integer minProximity) { - this.minProximity = minProximity; - } - - public ConsequenceParams responseFields(List responseFields) { - this.responseFields = responseFields; - return this; - } - - public ConsequenceParams addResponseFieldsItem(String responseFieldsItem) { - if (this.responseFields == null) { - this.responseFields = new ArrayList<>(); - } - this.responseFields.add(responseFieldsItem); - return this; - } - - /** - * Choose which fields to return in the API response. This parameters applies to search and browse - * queries. - * - * @return responseFields - */ - @javax.annotation.Nullable - public List getResponseFields() { - return responseFields; - } - - public void setResponseFields(List responseFields) { - this.responseFields = responseFields; - } - - public ConsequenceParams maxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * Maximum number of facet hits to return during a search for facet values. For performance - * reasons, the maximum allowed number of returned values is 100. maximum: 100 - * - * @return maxFacetHits - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - - public void setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - } - - public ConsequenceParams attributeCriteriaComputedByMinProximity( - Boolean attributeCriteriaComputedByMinProximity - ) { - this.attributeCriteriaComputedByMinProximity = - attributeCriteriaComputedByMinProximity; - return this; - } - - /** - * When attribute is ranked above proximity in your ranking formula, proximity is used to select - * which searchable attribute is matched in the attribute ranking stage. - * - * @return attributeCriteriaComputedByMinProximity - */ - @javax.annotation.Nullable - public Boolean getAttributeCriteriaComputedByMinProximity() { - return attributeCriteriaComputedByMinProximity; - } - - public void setAttributeCriteriaComputedByMinProximity( - Boolean attributeCriteriaComputedByMinProximity - ) { - this.attributeCriteriaComputedByMinProximity = - attributeCriteriaComputedByMinProximity; - } - - public ConsequenceParams renderingContent(Object renderingContent) { - this.renderingContent = renderingContent; - return this; - } - - /** - * Content defining how the search interface should be rendered. Can be set via the settings for a - * default value and can be overridden via rules. - * - * @return renderingContent - */ - @javax.annotation.Nullable - public Object getRenderingContent() { - return renderingContent; - } - - public void setRenderingContent(Object renderingContent) { - this.renderingContent = renderingContent; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ConsequenceParams consequenceParams = (ConsequenceParams) o; - return ( - Objects.equals(this.query, consequenceParams.query) && - Objects.equals( - this.automaticFacetFilters, - consequenceParams.automaticFacetFilters - ) && - Objects.equals( - this.automaticOptionalFacetFilters, - consequenceParams.automaticOptionalFacetFilters - ) && - Objects.equals(this.similarQuery, consequenceParams.similarQuery) && - Objects.equals(this.filters, consequenceParams.filters) && - Objects.equals(this.facetFilters, consequenceParams.facetFilters) && - Objects.equals(this.optionalFilters, consequenceParams.optionalFilters) && - Objects.equals(this.numericFilters, consequenceParams.numericFilters) && - Objects.equals(this.tagFilters, consequenceParams.tagFilters) && - Objects.equals( - this.sumOrFiltersScores, - consequenceParams.sumOrFiltersScores - ) && - Objects.equals(this.facets, consequenceParams.facets) && - Objects.equals( - this.maxValuesPerFacet, - consequenceParams.maxValuesPerFacet - ) && - Objects.equals( - this.facetingAfterDistinct, - consequenceParams.facetingAfterDistinct - ) && - Objects.equals( - this.sortFacetValuesBy, - consequenceParams.sortFacetValuesBy - ) && - Objects.equals(this.page, consequenceParams.page) && - Objects.equals(this.offset, consequenceParams.offset) && - Objects.equals(this.length, consequenceParams.length) && - Objects.equals(this.aroundLatLng, consequenceParams.aroundLatLng) && - Objects.equals( - this.aroundLatLngViaIP, - consequenceParams.aroundLatLngViaIP - ) && - Objects.equals(this.aroundRadius, consequenceParams.aroundRadius) && - Objects.equals(this.aroundPrecision, consequenceParams.aroundPrecision) && - Objects.equals( - this.minimumAroundRadius, - consequenceParams.minimumAroundRadius - ) && - Objects.equals( - this.insideBoundingBox, - consequenceParams.insideBoundingBox - ) && - Objects.equals(this.insidePolygon, consequenceParams.insidePolygon) && - Objects.equals( - this.naturalLanguages, - consequenceParams.naturalLanguages - ) && - Objects.equals(this.ruleContexts, consequenceParams.ruleContexts) && - Objects.equals( - this.personalizationImpact, - consequenceParams.personalizationImpact - ) && - Objects.equals(this.userToken, consequenceParams.userToken) && - Objects.equals(this.getRankingInfo, consequenceParams.getRankingInfo) && - Objects.equals(this.clickAnalytics, consequenceParams.clickAnalytics) && - Objects.equals(this.analytics, consequenceParams.analytics) && - Objects.equals(this.analyticsTags, consequenceParams.analyticsTags) && - Objects.equals( - this.percentileComputation, - consequenceParams.percentileComputation - ) && - Objects.equals(this.enableABTest, consequenceParams.enableABTest) && - Objects.equals(this.enableReRanking, consequenceParams.enableReRanking) && - Objects.equals( - this.searchableAttributes, - consequenceParams.searchableAttributes - ) && - Objects.equals( - this.attributesForFaceting, - consequenceParams.attributesForFaceting - ) && - Objects.equals( - this.unretrievableAttributes, - consequenceParams.unretrievableAttributes - ) && - Objects.equals( - this.attributesToRetrieve, - consequenceParams.attributesToRetrieve - ) && - Objects.equals( - this.restrictSearchableAttributes, - consequenceParams.restrictSearchableAttributes - ) && - Objects.equals(this.ranking, consequenceParams.ranking) && - Objects.equals(this.customRanking, consequenceParams.customRanking) && - Objects.equals( - this.relevancyStrictness, - consequenceParams.relevancyStrictness - ) && - Objects.equals( - this.attributesToHighlight, - consequenceParams.attributesToHighlight - ) && - Objects.equals( - this.attributesToSnippet, - consequenceParams.attributesToSnippet - ) && - Objects.equals(this.highlightPreTag, consequenceParams.highlightPreTag) && - Objects.equals( - this.highlightPostTag, - consequenceParams.highlightPostTag - ) && - Objects.equals( - this.snippetEllipsisText, - consequenceParams.snippetEllipsisText - ) && - Objects.equals( - this.restrictHighlightAndSnippetArrays, - consequenceParams.restrictHighlightAndSnippetArrays - ) && - Objects.equals(this.hitsPerPage, consequenceParams.hitsPerPage) && - Objects.equals( - this.minWordSizefor1Typo, - consequenceParams.minWordSizefor1Typo - ) && - Objects.equals( - this.minWordSizefor2Typos, - consequenceParams.minWordSizefor2Typos - ) && - Objects.equals(this.typoTolerance, consequenceParams.typoTolerance) && - Objects.equals( - this.allowTyposOnNumericTokens, - consequenceParams.allowTyposOnNumericTokens - ) && - Objects.equals( - this.disableTypoToleranceOnAttributes, - consequenceParams.disableTypoToleranceOnAttributes - ) && - Objects.equals( - this.separatorsToIndex, - consequenceParams.separatorsToIndex - ) && - Objects.equals(this.ignorePlurals, consequenceParams.ignorePlurals) && - Objects.equals(this.removeStopWords, consequenceParams.removeStopWords) && - Objects.equals( - this.keepDiacriticsOnCharacters, - consequenceParams.keepDiacriticsOnCharacters - ) && - Objects.equals(this.queryLanguages, consequenceParams.queryLanguages) && - Objects.equals(this.decompoundQuery, consequenceParams.decompoundQuery) && - Objects.equals(this.enableRules, consequenceParams.enableRules) && - Objects.equals( - this.enablePersonalization, - consequenceParams.enablePersonalization - ) && - Objects.equals(this.queryType, consequenceParams.queryType) && - Objects.equals( - this.removeWordsIfNoResults, - consequenceParams.removeWordsIfNoResults - ) && - Objects.equals(this.advancedSyntax, consequenceParams.advancedSyntax) && - Objects.equals(this.optionalWords, consequenceParams.optionalWords) && - Objects.equals( - this.disableExactOnAttributes, - consequenceParams.disableExactOnAttributes - ) && - Objects.equals( - this.exactOnSingleWordQuery, - consequenceParams.exactOnSingleWordQuery - ) && - Objects.equals( - this.alternativesAsExact, - consequenceParams.alternativesAsExact - ) && - Objects.equals( - this.advancedSyntaxFeatures, - consequenceParams.advancedSyntaxFeatures - ) && - Objects.equals(this.distinct, consequenceParams.distinct) && - Objects.equals(this.synonyms, consequenceParams.synonyms) && - Objects.equals( - this.replaceSynonymsInHighlight, - consequenceParams.replaceSynonymsInHighlight - ) && - Objects.equals(this.minProximity, consequenceParams.minProximity) && - Objects.equals(this.responseFields, consequenceParams.responseFields) && - Objects.equals(this.maxFacetHits, consequenceParams.maxFacetHits) && - Objects.equals( - this.attributeCriteriaComputedByMinProximity, - consequenceParams.attributeCriteriaComputedByMinProximity - ) && - Objects.equals(this.renderingContent, consequenceParams.renderingContent) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - query, - automaticFacetFilters, - automaticOptionalFacetFilters, - similarQuery, - filters, - facetFilters, - optionalFilters, - numericFilters, - tagFilters, - sumOrFiltersScores, - facets, - maxValuesPerFacet, - facetingAfterDistinct, - sortFacetValuesBy, - page, - offset, - length, - aroundLatLng, - aroundLatLngViaIP, - aroundRadius, - aroundPrecision, - minimumAroundRadius, - insideBoundingBox, - insidePolygon, - naturalLanguages, - ruleContexts, - personalizationImpact, - userToken, - getRankingInfo, - clickAnalytics, - analytics, - analyticsTags, - percentileComputation, - enableABTest, - enableReRanking, - searchableAttributes, - attributesForFaceting, - unretrievableAttributes, - attributesToRetrieve, - restrictSearchableAttributes, - ranking, - customRanking, - relevancyStrictness, - attributesToHighlight, - attributesToSnippet, - highlightPreTag, - highlightPostTag, - snippetEllipsisText, - restrictHighlightAndSnippetArrays, - hitsPerPage, - minWordSizefor1Typo, - minWordSizefor2Typos, - typoTolerance, - allowTyposOnNumericTokens, - disableTypoToleranceOnAttributes, - separatorsToIndex, - ignorePlurals, - removeStopWords, - keepDiacriticsOnCharacters, - queryLanguages, - decompoundQuery, - enableRules, - enablePersonalization, - queryType, - removeWordsIfNoResults, - advancedSyntax, - optionalWords, - disableExactOnAttributes, - exactOnSingleWordQuery, - alternativesAsExact, - advancedSyntaxFeatures, - distinct, - synonyms, - replaceSynonymsInHighlight, - minProximity, - responseFields, - maxFacetHits, - attributeCriteriaComputedByMinProximity, - renderingContent - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConsequenceParams {\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb - .append(" automaticFacetFilters: ") - .append(toIndentedString(automaticFacetFilters)) - .append("\n"); - sb - .append(" automaticOptionalFacetFilters: ") - .append(toIndentedString(automaticOptionalFacetFilters)) - .append("\n"); - sb - .append(" similarQuery: ") - .append(toIndentedString(similarQuery)) - .append("\n"); - sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - sb - .append(" facetFilters: ") - .append(toIndentedString(facetFilters)) - .append("\n"); - sb - .append(" optionalFilters: ") - .append(toIndentedString(optionalFilters)) - .append("\n"); - sb - .append(" numericFilters: ") - .append(toIndentedString(numericFilters)) - .append("\n"); - sb - .append(" tagFilters: ") - .append(toIndentedString(tagFilters)) - .append("\n"); - sb - .append(" sumOrFiltersScores: ") - .append(toIndentedString(sumOrFiltersScores)) - .append("\n"); - sb.append(" facets: ").append(toIndentedString(facets)).append("\n"); - sb - .append(" maxValuesPerFacet: ") - .append(toIndentedString(maxValuesPerFacet)) - .append("\n"); - sb - .append(" facetingAfterDistinct: ") - .append(toIndentedString(facetingAfterDistinct)) - .append("\n"); - sb - .append(" sortFacetValuesBy: ") - .append(toIndentedString(sortFacetValuesBy)) - .append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); - sb.append(" length: ").append(toIndentedString(length)).append("\n"); - sb - .append(" aroundLatLng: ") - .append(toIndentedString(aroundLatLng)) - .append("\n"); - sb - .append(" aroundLatLngViaIP: ") - .append(toIndentedString(aroundLatLngViaIP)) - .append("\n"); - sb - .append(" aroundRadius: ") - .append(toIndentedString(aroundRadius)) - .append("\n"); - sb - .append(" aroundPrecision: ") - .append(toIndentedString(aroundPrecision)) - .append("\n"); - sb - .append(" minimumAroundRadius: ") - .append(toIndentedString(minimumAroundRadius)) - .append("\n"); - sb - .append(" insideBoundingBox: ") - .append(toIndentedString(insideBoundingBox)) - .append("\n"); - sb - .append(" insidePolygon: ") - .append(toIndentedString(insidePolygon)) - .append("\n"); - sb - .append(" naturalLanguages: ") - .append(toIndentedString(naturalLanguages)) - .append("\n"); - sb - .append(" ruleContexts: ") - .append(toIndentedString(ruleContexts)) - .append("\n"); - sb - .append(" personalizationImpact: ") - .append(toIndentedString(personalizationImpact)) - .append("\n"); - sb - .append(" userToken: ") - .append(toIndentedString(userToken)) - .append("\n"); - sb - .append(" getRankingInfo: ") - .append(toIndentedString(getRankingInfo)) - .append("\n"); - sb - .append(" clickAnalytics: ") - .append(toIndentedString(clickAnalytics)) - .append("\n"); - sb - .append(" analytics: ") - .append(toIndentedString(analytics)) - .append("\n"); - sb - .append(" analyticsTags: ") - .append(toIndentedString(analyticsTags)) - .append("\n"); - sb - .append(" percentileComputation: ") - .append(toIndentedString(percentileComputation)) - .append("\n"); - sb - .append(" enableABTest: ") - .append(toIndentedString(enableABTest)) - .append("\n"); - sb - .append(" enableReRanking: ") - .append(toIndentedString(enableReRanking)) - .append("\n"); - sb - .append(" searchableAttributes: ") - .append(toIndentedString(searchableAttributes)) - .append("\n"); - sb - .append(" attributesForFaceting: ") - .append(toIndentedString(attributesForFaceting)) - .append("\n"); - sb - .append(" unretrievableAttributes: ") - .append(toIndentedString(unretrievableAttributes)) - .append("\n"); - sb - .append(" attributesToRetrieve: ") - .append(toIndentedString(attributesToRetrieve)) - .append("\n"); - sb - .append(" restrictSearchableAttributes: ") - .append(toIndentedString(restrictSearchableAttributes)) - .append("\n"); - sb.append(" ranking: ").append(toIndentedString(ranking)).append("\n"); - sb - .append(" customRanking: ") - .append(toIndentedString(customRanking)) - .append("\n"); - sb - .append(" relevancyStrictness: ") - .append(toIndentedString(relevancyStrictness)) - .append("\n"); - sb - .append(" attributesToHighlight: ") - .append(toIndentedString(attributesToHighlight)) - .append("\n"); - sb - .append(" attributesToSnippet: ") - .append(toIndentedString(attributesToSnippet)) - .append("\n"); - sb - .append(" highlightPreTag: ") - .append(toIndentedString(highlightPreTag)) - .append("\n"); - sb - .append(" highlightPostTag: ") - .append(toIndentedString(highlightPostTag)) - .append("\n"); - sb - .append(" snippetEllipsisText: ") - .append(toIndentedString(snippetEllipsisText)) - .append("\n"); - sb - .append(" restrictHighlightAndSnippetArrays: ") - .append(toIndentedString(restrictHighlightAndSnippetArrays)) - .append("\n"); - sb - .append(" hitsPerPage: ") - .append(toIndentedString(hitsPerPage)) - .append("\n"); - sb - .append(" minWordSizefor1Typo: ") - .append(toIndentedString(minWordSizefor1Typo)) - .append("\n"); - sb - .append(" minWordSizefor2Typos: ") - .append(toIndentedString(minWordSizefor2Typos)) - .append("\n"); - sb - .append(" typoTolerance: ") - .append(toIndentedString(typoTolerance)) - .append("\n"); - sb - .append(" allowTyposOnNumericTokens: ") - .append(toIndentedString(allowTyposOnNumericTokens)) - .append("\n"); - sb - .append(" disableTypoToleranceOnAttributes: ") - .append(toIndentedString(disableTypoToleranceOnAttributes)) - .append("\n"); - sb - .append(" separatorsToIndex: ") - .append(toIndentedString(separatorsToIndex)) - .append("\n"); - sb - .append(" ignorePlurals: ") - .append(toIndentedString(ignorePlurals)) - .append("\n"); - sb - .append(" removeStopWords: ") - .append(toIndentedString(removeStopWords)) - .append("\n"); - sb - .append(" keepDiacriticsOnCharacters: ") - .append(toIndentedString(keepDiacriticsOnCharacters)) - .append("\n"); - sb - .append(" queryLanguages: ") - .append(toIndentedString(queryLanguages)) - .append("\n"); - sb - .append(" decompoundQuery: ") - .append(toIndentedString(decompoundQuery)) - .append("\n"); - sb - .append(" enableRules: ") - .append(toIndentedString(enableRules)) - .append("\n"); - sb - .append(" enablePersonalization: ") - .append(toIndentedString(enablePersonalization)) - .append("\n"); - sb - .append(" queryType: ") - .append(toIndentedString(queryType)) - .append("\n"); - sb - .append(" removeWordsIfNoResults: ") - .append(toIndentedString(removeWordsIfNoResults)) - .append("\n"); - sb - .append(" advancedSyntax: ") - .append(toIndentedString(advancedSyntax)) - .append("\n"); - sb - .append(" optionalWords: ") - .append(toIndentedString(optionalWords)) - .append("\n"); - sb - .append(" disableExactOnAttributes: ") - .append(toIndentedString(disableExactOnAttributes)) - .append("\n"); - sb - .append(" exactOnSingleWordQuery: ") - .append(toIndentedString(exactOnSingleWordQuery)) - .append("\n"); - sb - .append(" alternativesAsExact: ") - .append(toIndentedString(alternativesAsExact)) - .append("\n"); - sb - .append(" advancedSyntaxFeatures: ") - .append(toIndentedString(advancedSyntaxFeatures)) - .append("\n"); - sb.append(" distinct: ").append(toIndentedString(distinct)).append("\n"); - sb.append(" synonyms: ").append(toIndentedString(synonyms)).append("\n"); - sb - .append(" replaceSynonymsInHighlight: ") - .append(toIndentedString(replaceSynonymsInHighlight)) - .append("\n"); - sb - .append(" minProximity: ") - .append(toIndentedString(minProximity)) - .append("\n"); - sb - .append(" responseFields: ") - .append(toIndentedString(responseFields)) - .append("\n"); - sb - .append(" maxFacetHits: ") - .append(toIndentedString(maxFacetHits)) - .append("\n"); - sb - .append(" attributeCriteriaComputedByMinProximity: ") - .append(toIndentedString(attributeCriteriaComputedByMinProximity)) - .append("\n"); - sb - .append(" renderingContent: ") - .append(toIndentedString(renderingContent)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/CreatedAtObject.java b/algoliasearch-core/com/algolia/model/CreatedAtObject.java deleted file mode 100644 index f8a04ae4f..000000000 --- a/algoliasearch-core/com/algolia/model/CreatedAtObject.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** CreatedAtObject */ -public class CreatedAtObject { - - @SerializedName("createdAt") - private String createdAt; - - public CreatedAtObject createdAt(String createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Date of creation (ISO-8601 format). - * - * @return createdAt - */ - @javax.annotation.Nonnull - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreatedAtObject createdAtObject = (CreatedAtObject) o; - return Objects.equals(this.createdAt, createdAtObject.createdAt); - } - - @Override - public int hashCode() { - return Objects.hash(createdAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreatedAtObject {\n"); - sb - .append(" createdAt: ") - .append(toIndentedString(createdAt)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/CreatedAtResponse.java b/algoliasearch-core/com/algolia/model/CreatedAtResponse.java deleted file mode 100644 index 2dcbfd7c2..000000000 --- a/algoliasearch-core/com/algolia/model/CreatedAtResponse.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** The response with a createdAt timestamp. */ -public class CreatedAtResponse { - - @SerializedName("createdAt") - private String createdAt; - - public CreatedAtResponse createdAt(String createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Date of creation (ISO-8601 format). - * - * @return createdAt - */ - @javax.annotation.Nonnull - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreatedAtResponse createdAtResponse = (CreatedAtResponse) o; - return Objects.equals(this.createdAt, createdAtResponse.createdAt); - } - - @Override - public int hashCode() { - return Objects.hash(createdAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreatedAtResponse {\n"); - sb - .append(" createdAt: ") - .append(toIndentedString(createdAt)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/DeleteApiKeyResponse.java b/algoliasearch-core/com/algolia/model/DeleteApiKeyResponse.java deleted file mode 100644 index 7f2ce42ef..000000000 --- a/algoliasearch-core/com/algolia/model/DeleteApiKeyResponse.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** DeleteApiKeyResponse */ -public class DeleteApiKeyResponse { - - @SerializedName("deletedAt") - private String deletedAt; - - public DeleteApiKeyResponse deletedAt(String deletedAt) { - this.deletedAt = deletedAt; - return this; - } - - /** - * Date of deletion (ISO-8601 format). - * - * @return deletedAt - */ - @javax.annotation.Nonnull - public String getDeletedAt() { - return deletedAt; - } - - public void setDeletedAt(String deletedAt) { - this.deletedAt = deletedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeleteApiKeyResponse deleteApiKeyResponse = (DeleteApiKeyResponse) o; - return Objects.equals(this.deletedAt, deleteApiKeyResponse.deletedAt); - } - - @Override - public int hashCode() { - return Objects.hash(deletedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteApiKeyResponse {\n"); - sb - .append(" deletedAt: ") - .append(toIndentedString(deletedAt)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/DeleteSourceResponse.java b/algoliasearch-core/com/algolia/model/DeleteSourceResponse.java deleted file mode 100644 index e68fac932..000000000 --- a/algoliasearch-core/com/algolia/model/DeleteSourceResponse.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** DeleteSourceResponse */ -public class DeleteSourceResponse { - - @SerializedName("deletedAt") - private String deletedAt; - - public DeleteSourceResponse deletedAt(String deletedAt) { - this.deletedAt = deletedAt; - return this; - } - - /** - * Date of deletion (ISO-8601 format). - * - * @return deletedAt - */ - @javax.annotation.Nonnull - public String getDeletedAt() { - return deletedAt; - } - - public void setDeletedAt(String deletedAt) { - this.deletedAt = deletedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeleteSourceResponse deleteSourceResponse = (DeleteSourceResponse) o; - return Objects.equals(this.deletedAt, deleteSourceResponse.deletedAt); - } - - @Override - public int hashCode() { - return Objects.hash(deletedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteSourceResponse {\n"); - sb - .append(" deletedAt: ") - .append(toIndentedString(deletedAt)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/DeletedAtResponse.java b/algoliasearch-core/com/algolia/model/DeletedAtResponse.java deleted file mode 100644 index 352e3f257..000000000 --- a/algoliasearch-core/com/algolia/model/DeletedAtResponse.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** The response with a taskID and a deletedAt timestamp. */ -public class DeletedAtResponse { - - @SerializedName("taskID") - private Integer taskID; - - @SerializedName("deletedAt") - private String deletedAt; - - public DeletedAtResponse taskID(Integer taskID) { - this.taskID = taskID; - return this; - } - - /** - * taskID of the task to wait for. - * - * @return taskID - */ - @javax.annotation.Nonnull - public Integer getTaskID() { - return taskID; - } - - public void setTaskID(Integer taskID) { - this.taskID = taskID; - } - - public DeletedAtResponse deletedAt(String deletedAt) { - this.deletedAt = deletedAt; - return this; - } - - /** - * Date of deletion (ISO-8601 format). - * - * @return deletedAt - */ - @javax.annotation.Nonnull - public String getDeletedAt() { - return deletedAt; - } - - public void setDeletedAt(String deletedAt) { - this.deletedAt = deletedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeletedAtResponse deletedAtResponse = (DeletedAtResponse) o; - return ( - Objects.equals(this.taskID, deletedAtResponse.taskID) && - Objects.equals(this.deletedAt, deletedAtResponse.deletedAt) - ); - } - - @Override - public int hashCode() { - return Objects.hash(taskID, deletedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeletedAtResponse {\n"); - sb.append(" taskID: ").append(toIndentedString(taskID)).append("\n"); - sb - .append(" deletedAt: ") - .append(toIndentedString(deletedAt)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/DictionaryAction.java b/algoliasearch-core/com/algolia/model/DictionaryAction.java deleted file mode 100644 index e5de49834..000000000 --- a/algoliasearch-core/com/algolia/model/DictionaryAction.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -/** Actions to perform. */ -@JsonAdapter(DictionaryAction.Adapter.class) -public enum DictionaryAction { - ADDENTRY("addEntry"), - - DELETEENTRY("deleteEntry"); - - private String value; - - DictionaryAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static DictionaryAction fromValue(String value) { - for (DictionaryAction b : DictionaryAction.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final DictionaryAction enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public DictionaryAction read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return DictionaryAction.fromValue(value); - } - } -} diff --git a/algoliasearch-core/com/algolia/model/DictionaryEntry.java b/algoliasearch-core/com/algolia/model/DictionaryEntry.java deleted file mode 100644 index d0b4bb179..000000000 --- a/algoliasearch-core/com/algolia/model/DictionaryEntry.java +++ /dev/null @@ -1,220 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Objects; - -/** A dictionary entry. */ -public class DictionaryEntry extends HashMap { - - @SerializedName("objectID") - private String objectID; - - @SerializedName("language") - private String language; - - @SerializedName("word") - private String word; - - @SerializedName("words") - private List words = null; - - @SerializedName("decomposition") - private List decomposition = null; - - @SerializedName("state") - private DictionaryEntryState state = DictionaryEntryState.ENABLED; - - public DictionaryEntry objectID(String objectID) { - this.objectID = objectID; - return this; - } - - /** - * Unique identifier of the object. - * - * @return objectID - */ - @javax.annotation.Nonnull - public String getObjectID() { - return objectID; - } - - public void setObjectID(String objectID) { - this.objectID = objectID; - } - - public DictionaryEntry language(String language) { - this.language = language; - return this; - } - - /** - * Language ISO code supported by the dictionary (e.g., \"en\" for English). - * - * @return language - */ - @javax.annotation.Nonnull - public String getLanguage() { - return language; - } - - public void setLanguage(String language) { - this.language = language; - } - - public DictionaryEntry word(String word) { - this.word = word; - return this; - } - - /** - * The word of the dictionary entry. - * - * @return word - */ - @javax.annotation.Nullable - public String getWord() { - return word; - } - - public void setWord(String word) { - this.word = word; - } - - public DictionaryEntry words(List words) { - this.words = words; - return this; - } - - public DictionaryEntry addWordsItem(String wordsItem) { - if (this.words == null) { - this.words = new ArrayList<>(); - } - this.words.add(wordsItem); - return this; - } - - /** - * The words of the dictionary entry. - * - * @return words - */ - @javax.annotation.Nullable - public List getWords() { - return words; - } - - public void setWords(List words) { - this.words = words; - } - - public DictionaryEntry decomposition(List decomposition) { - this.decomposition = decomposition; - return this; - } - - public DictionaryEntry addDecompositionItem(String decompositionItem) { - if (this.decomposition == null) { - this.decomposition = new ArrayList<>(); - } - this.decomposition.add(decompositionItem); - return this; - } - - /** - * A decomposition of the word of the dictionary entry. - * - * @return decomposition - */ - @javax.annotation.Nullable - public List getDecomposition() { - return decomposition; - } - - public void setDecomposition(List decomposition) { - this.decomposition = decomposition; - } - - public DictionaryEntry state(DictionaryEntryState state) { - this.state = state; - return this; - } - - /** - * Get state - * - * @return state - */ - @javax.annotation.Nullable - public DictionaryEntryState getState() { - return state; - } - - public void setState(DictionaryEntryState state) { - this.state = state; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DictionaryEntry dictionaryEntry = (DictionaryEntry) o; - return ( - Objects.equals(this.objectID, dictionaryEntry.objectID) && - Objects.equals(this.language, dictionaryEntry.language) && - Objects.equals(this.word, dictionaryEntry.word) && - Objects.equals(this.words, dictionaryEntry.words) && - Objects.equals(this.decomposition, dictionaryEntry.decomposition) && - Objects.equals(this.state, dictionaryEntry.state) && - super.equals(o) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - objectID, - language, - word, - words, - decomposition, - state, - super.hashCode() - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DictionaryEntry {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n"); - sb.append(" language: ").append(toIndentedString(language)).append("\n"); - sb.append(" word: ").append(toIndentedString(word)).append("\n"); - sb.append(" words: ").append(toIndentedString(words)).append("\n"); - sb - .append(" decomposition: ") - .append(toIndentedString(decomposition)) - .append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/DictionaryEntryState.java b/algoliasearch-core/com/algolia/model/DictionaryEntryState.java deleted file mode 100644 index 99d55c2bc..000000000 --- a/algoliasearch-core/com/algolia/model/DictionaryEntryState.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -/** The state of the dictionary entry. */ -@JsonAdapter(DictionaryEntryState.Adapter.class) -public enum DictionaryEntryState { - ENABLED("enabled"), - - DISABLED("disabled"); - - private String value; - - DictionaryEntryState(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static DictionaryEntryState fromValue(String value) { - for (DictionaryEntryState b : DictionaryEntryState.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final DictionaryEntryState enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public DictionaryEntryState read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return DictionaryEntryState.fromValue(value); - } - } -} diff --git a/algoliasearch-core/com/algolia/model/DictionaryLanguage.java b/algoliasearch-core/com/algolia/model/DictionaryLanguage.java deleted file mode 100644 index fce794e0d..000000000 --- a/algoliasearch-core/com/algolia/model/DictionaryLanguage.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** Custom entries for a dictionary */ -public class DictionaryLanguage { - - @SerializedName("nbCustomEntires") - private Integer nbCustomEntires; - - public DictionaryLanguage nbCustomEntires(Integer nbCustomEntires) { - this.nbCustomEntires = nbCustomEntires; - return this; - } - - /** - * When nbCustomEntries is set to 0, the user didn't customize the dictionary. The dictionary is - * still supported with standard, Algolia-provided entries. - * - * @return nbCustomEntires - */ - @javax.annotation.Nullable - public Integer getNbCustomEntires() { - return nbCustomEntires; - } - - public void setNbCustomEntires(Integer nbCustomEntires) { - this.nbCustomEntires = nbCustomEntires; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DictionaryLanguage dictionaryLanguage = (DictionaryLanguage) o; - return Objects.equals( - this.nbCustomEntires, - dictionaryLanguage.nbCustomEntires - ); - } - - @Override - public int hashCode() { - return Objects.hash(nbCustomEntires); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DictionaryLanguage {\n"); - sb - .append(" nbCustomEntires: ") - .append(toIndentedString(nbCustomEntires)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/DictionarySettingsParams.java b/algoliasearch-core/com/algolia/model/DictionarySettingsParams.java deleted file mode 100644 index f4ca45142..000000000 --- a/algoliasearch-core/com/algolia/model/DictionarySettingsParams.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** Disable the builtin Algolia entries for a type of dictionary per language. */ -public class DictionarySettingsParams { - - @SerializedName("disableStandardEntries") - private StandardEntries disableStandardEntries; - - public DictionarySettingsParams disableStandardEntries( - StandardEntries disableStandardEntries - ) { - this.disableStandardEntries = disableStandardEntries; - return this; - } - - /** - * Get disableStandardEntries - * - * @return disableStandardEntries - */ - @javax.annotation.Nonnull - public StandardEntries getDisableStandardEntries() { - return disableStandardEntries; - } - - public void setDisableStandardEntries( - StandardEntries disableStandardEntries - ) { - this.disableStandardEntries = disableStandardEntries; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DictionarySettingsParams dictionarySettingsParams = (DictionarySettingsParams) o; - return Objects.equals( - this.disableStandardEntries, - dictionarySettingsParams.disableStandardEntries - ); - } - - @Override - public int hashCode() { - return Objects.hash(disableStandardEntries); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DictionarySettingsParams {\n"); - sb - .append(" disableStandardEntries: ") - .append(toIndentedString(disableStandardEntries)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/ErrorBase.java b/algoliasearch-core/com/algolia/model/ErrorBase.java deleted file mode 100644 index c2828bf5d..000000000 --- a/algoliasearch-core/com/algolia/model/ErrorBase.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.HashMap; -import java.util.Objects; - -/** Error. */ -public class ErrorBase extends HashMap { - - @SerializedName("message") - private String message; - - public ErrorBase message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ErrorBase errorBase = (ErrorBase) o; - return Objects.equals(this.message, errorBase.message) && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(message, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ErrorBase {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/GetDictionarySettingsResponse.java b/algoliasearch-core/com/algolia/model/GetDictionarySettingsResponse.java deleted file mode 100644 index d622f2b32..000000000 --- a/algoliasearch-core/com/algolia/model/GetDictionarySettingsResponse.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** GetDictionarySettingsResponse */ -public class GetDictionarySettingsResponse { - - @SerializedName("disableStandardEntries") - private StandardEntries disableStandardEntries; - - public GetDictionarySettingsResponse disableStandardEntries( - StandardEntries disableStandardEntries - ) { - this.disableStandardEntries = disableStandardEntries; - return this; - } - - /** - * Get disableStandardEntries - * - * @return disableStandardEntries - */ - @javax.annotation.Nonnull - public StandardEntries getDisableStandardEntries() { - return disableStandardEntries; - } - - public void setDisableStandardEntries( - StandardEntries disableStandardEntries - ) { - this.disableStandardEntries = disableStandardEntries; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetDictionarySettingsResponse getDictionarySettingsResponse = (GetDictionarySettingsResponse) o; - return Objects.equals( - this.disableStandardEntries, - getDictionarySettingsResponse.disableStandardEntries - ); - } - - @Override - public int hashCode() { - return Objects.hash(disableStandardEntries); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDictionarySettingsResponse {\n"); - sb - .append(" disableStandardEntries: ") - .append(toIndentedString(disableStandardEntries)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/GetLogsResponse.java b/algoliasearch-core/com/algolia/model/GetLogsResponse.java deleted file mode 100644 index 346ab735e..000000000 --- a/algoliasearch-core/com/algolia/model/GetLogsResponse.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** GetLogsResponse */ -public class GetLogsResponse { - - @SerializedName("logs") - private List logs = new ArrayList<>(); - - public GetLogsResponse logs(List logs) { - this.logs = logs; - return this; - } - - public GetLogsResponse addLogsItem(GetLogsResponseLogs logsItem) { - this.logs.add(logsItem); - return this; - } - - /** - * Get logs - * - * @return logs - */ - @javax.annotation.Nonnull - public List getLogs() { - return logs; - } - - public void setLogs(List logs) { - this.logs = logs; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetLogsResponse getLogsResponse = (GetLogsResponse) o; - return Objects.equals(this.logs, getLogsResponse.logs); - } - - @Override - public int hashCode() { - return Objects.hash(logs); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetLogsResponse {\n"); - sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/GetLogsResponseInnerQueries.java b/algoliasearch-core/com/algolia/model/GetLogsResponseInnerQueries.java deleted file mode 100644 index 31a764dc5..000000000 --- a/algoliasearch-core/com/algolia/model/GetLogsResponseInnerQueries.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** GetLogsResponseInnerQueries */ -public class GetLogsResponseInnerQueries { - - @SerializedName("index_name") - private String indexName; - - @SerializedName("user_token") - private String userToken; - - @SerializedName("query_id") - private String queryId; - - public GetLogsResponseInnerQueries indexName(String indexName) { - this.indexName = indexName; - return this; - } - - /** - * Index targeted by the query. - * - * @return indexName - */ - @javax.annotation.Nullable - public String getIndexName() { - return indexName; - } - - public void setIndexName(String indexName) { - this.indexName = indexName; - } - - public GetLogsResponseInnerQueries userToken(String userToken) { - this.userToken = userToken; - return this; - } - - /** - * User identifier. - * - * @return userToken - */ - @javax.annotation.Nullable - public String getUserToken() { - return userToken; - } - - public void setUserToken(String userToken) { - this.userToken = userToken; - } - - public GetLogsResponseInnerQueries queryId(String queryId) { - this.queryId = queryId; - return this; - } - - /** - * QueryID for the given query. - * - * @return queryId - */ - @javax.annotation.Nullable - public String getQueryId() { - return queryId; - } - - public void setQueryId(String queryId) { - this.queryId = queryId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetLogsResponseInnerQueries getLogsResponseInnerQueries = (GetLogsResponseInnerQueries) o; - return ( - Objects.equals(this.indexName, getLogsResponseInnerQueries.indexName) && - Objects.equals(this.userToken, getLogsResponseInnerQueries.userToken) && - Objects.equals(this.queryId, getLogsResponseInnerQueries.queryId) - ); - } - - @Override - public int hashCode() { - return Objects.hash(indexName, userToken, queryId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetLogsResponseInnerQueries {\n"); - sb - .append(" indexName: ") - .append(toIndentedString(indexName)) - .append("\n"); - sb - .append(" userToken: ") - .append(toIndentedString(userToken)) - .append("\n"); - sb.append(" queryId: ").append(toIndentedString(queryId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/GetLogsResponseLogs.java b/algoliasearch-core/com/algolia/model/GetLogsResponseLogs.java deleted file mode 100644 index 0438a9465..000000000 --- a/algoliasearch-core/com/algolia/model/GetLogsResponseLogs.java +++ /dev/null @@ -1,464 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** GetLogsResponseLogs */ -public class GetLogsResponseLogs { - - @SerializedName("timestamp") - private String timestamp; - - @SerializedName("method") - private String method; - - @SerializedName("answer_code") - private String answerCode; - - @SerializedName("query_body") - private String queryBody; - - @SerializedName("answer") - private String answer; - - @SerializedName("url") - private String url; - - @SerializedName("ip") - private String ip; - - @SerializedName("query_headers") - private String queryHeaders; - - @SerializedName("sha1") - private String sha1; - - @SerializedName("nb_api_calls") - private String nbApiCalls; - - @SerializedName("processing_time_ms") - private String processingTimeMs; - - @SerializedName("index") - private String index; - - @SerializedName("query_params") - private String queryParams; - - @SerializedName("query_nb_hits") - private String queryNbHits; - - @SerializedName("inner_queries") - private List innerQueries = null; - - public GetLogsResponseLogs timestamp(String timestamp) { - this.timestamp = timestamp; - return this; - } - - /** - * Timestamp in ISO-8601 format. - * - * @return timestamp - */ - @javax.annotation.Nonnull - public String getTimestamp() { - return timestamp; - } - - public void setTimestamp(String timestamp) { - this.timestamp = timestamp; - } - - public GetLogsResponseLogs method(String method) { - this.method = method; - return this; - } - - /** - * HTTP method of the perfomed request. - * - * @return method - */ - @javax.annotation.Nonnull - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public GetLogsResponseLogs answerCode(String answerCode) { - this.answerCode = answerCode; - return this; - } - - /** - * HTTP response code. - * - * @return answerCode - */ - @javax.annotation.Nonnull - public String getAnswerCode() { - return answerCode; - } - - public void setAnswerCode(String answerCode) { - this.answerCode = answerCode; - } - - public GetLogsResponseLogs queryBody(String queryBody) { - this.queryBody = queryBody; - return this; - } - - /** - * Request body. Truncated after 1000 characters. - * - * @return queryBody - */ - @javax.annotation.Nonnull - public String getQueryBody() { - return queryBody; - } - - public void setQueryBody(String queryBody) { - this.queryBody = queryBody; - } - - public GetLogsResponseLogs answer(String answer) { - this.answer = answer; - return this; - } - - /** - * Answer body. Truncated after 1000 characters. - * - * @return answer - */ - @javax.annotation.Nonnull - public String getAnswer() { - return answer; - } - - public void setAnswer(String answer) { - this.answer = answer; - } - - public GetLogsResponseLogs url(String url) { - this.url = url; - return this; - } - - /** - * Request URL. - * - * @return url - */ - @javax.annotation.Nonnull - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public GetLogsResponseLogs ip(String ip) { - this.ip = ip; - return this; - } - - /** - * IP of the client which perfomed the request. - * - * @return ip - */ - @javax.annotation.Nonnull - public String getIp() { - return ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - public GetLogsResponseLogs queryHeaders(String queryHeaders) { - this.queryHeaders = queryHeaders; - return this; - } - - /** - * Request Headers (API Key is obfuscated). - * - * @return queryHeaders - */ - @javax.annotation.Nonnull - public String getQueryHeaders() { - return queryHeaders; - } - - public void setQueryHeaders(String queryHeaders) { - this.queryHeaders = queryHeaders; - } - - public GetLogsResponseLogs sha1(String sha1) { - this.sha1 = sha1; - return this; - } - - /** - * SHA1 signature of the log entry. - * - * @return sha1 - */ - @javax.annotation.Nonnull - public String getSha1() { - return sha1; - } - - public void setSha1(String sha1) { - this.sha1 = sha1; - } - - public GetLogsResponseLogs nbApiCalls(String nbApiCalls) { - this.nbApiCalls = nbApiCalls; - return this; - } - - /** - * Number of API calls. - * - * @return nbApiCalls - */ - @javax.annotation.Nonnull - public String getNbApiCalls() { - return nbApiCalls; - } - - public void setNbApiCalls(String nbApiCalls) { - this.nbApiCalls = nbApiCalls; - } - - public GetLogsResponseLogs processingTimeMs(String processingTimeMs) { - this.processingTimeMs = processingTimeMs; - return this; - } - - /** - * Processing time for the query. It doesn't include network time. - * - * @return processingTimeMs - */ - @javax.annotation.Nonnull - public String getProcessingTimeMs() { - return processingTimeMs; - } - - public void setProcessingTimeMs(String processingTimeMs) { - this.processingTimeMs = processingTimeMs; - } - - public GetLogsResponseLogs index(String index) { - this.index = index; - return this; - } - - /** - * Index targeted by the query. - * - * @return index - */ - @javax.annotation.Nullable - public String getIndex() { - return index; - } - - public void setIndex(String index) { - this.index = index; - } - - public GetLogsResponseLogs queryParams(String queryParams) { - this.queryParams = queryParams; - return this; - } - - /** - * Query parameters sent with the request. - * - * @return queryParams - */ - @javax.annotation.Nullable - public String getQueryParams() { - return queryParams; - } - - public void setQueryParams(String queryParams) { - this.queryParams = queryParams; - } - - public GetLogsResponseLogs queryNbHits(String queryNbHits) { - this.queryNbHits = queryNbHits; - return this; - } - - /** - * Number of hits returned for the query. - * - * @return queryNbHits - */ - @javax.annotation.Nullable - public String getQueryNbHits() { - return queryNbHits; - } - - public void setQueryNbHits(String queryNbHits) { - this.queryNbHits = queryNbHits; - } - - public GetLogsResponseLogs innerQueries( - List innerQueries - ) { - this.innerQueries = innerQueries; - return this; - } - - public GetLogsResponseLogs addInnerQueriesItem( - GetLogsResponseInnerQueries innerQueriesItem - ) { - if (this.innerQueries == null) { - this.innerQueries = new ArrayList<>(); - } - this.innerQueries.add(innerQueriesItem); - return this; - } - - /** - * Array of all performed queries for the given request. - * - * @return innerQueries - */ - @javax.annotation.Nullable - public List getInnerQueries() { - return innerQueries; - } - - public void setInnerQueries(List innerQueries) { - this.innerQueries = innerQueries; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetLogsResponseLogs getLogsResponseLogs = (GetLogsResponseLogs) o; - return ( - Objects.equals(this.timestamp, getLogsResponseLogs.timestamp) && - Objects.equals(this.method, getLogsResponseLogs.method) && - Objects.equals(this.answerCode, getLogsResponseLogs.answerCode) && - Objects.equals(this.queryBody, getLogsResponseLogs.queryBody) && - Objects.equals(this.answer, getLogsResponseLogs.answer) && - Objects.equals(this.url, getLogsResponseLogs.url) && - Objects.equals(this.ip, getLogsResponseLogs.ip) && - Objects.equals(this.queryHeaders, getLogsResponseLogs.queryHeaders) && - Objects.equals(this.sha1, getLogsResponseLogs.sha1) && - Objects.equals(this.nbApiCalls, getLogsResponseLogs.nbApiCalls) && - Objects.equals( - this.processingTimeMs, - getLogsResponseLogs.processingTimeMs - ) && - Objects.equals(this.index, getLogsResponseLogs.index) && - Objects.equals(this.queryParams, getLogsResponseLogs.queryParams) && - Objects.equals(this.queryNbHits, getLogsResponseLogs.queryNbHits) && - Objects.equals(this.innerQueries, getLogsResponseLogs.innerQueries) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - timestamp, - method, - answerCode, - queryBody, - answer, - url, - ip, - queryHeaders, - sha1, - nbApiCalls, - processingTimeMs, - index, - queryParams, - queryNbHits, - innerQueries - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetLogsResponseLogs {\n"); - sb - .append(" timestamp: ") - .append(toIndentedString(timestamp)) - .append("\n"); - sb.append(" method: ").append(toIndentedString(method)).append("\n"); - sb - .append(" answerCode: ") - .append(toIndentedString(answerCode)) - .append("\n"); - sb - .append(" queryBody: ") - .append(toIndentedString(queryBody)) - .append("\n"); - sb.append(" answer: ").append(toIndentedString(answer)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); - sb - .append(" queryHeaders: ") - .append(toIndentedString(queryHeaders)) - .append("\n"); - sb.append(" sha1: ").append(toIndentedString(sha1)).append("\n"); - sb - .append(" nbApiCalls: ") - .append(toIndentedString(nbApiCalls)) - .append("\n"); - sb - .append(" processingTimeMs: ") - .append(toIndentedString(processingTimeMs)) - .append("\n"); - sb.append(" index: ").append(toIndentedString(index)).append("\n"); - sb - .append(" queryParams: ") - .append(toIndentedString(queryParams)) - .append("\n"); - sb - .append(" queryNbHits: ") - .append(toIndentedString(queryNbHits)) - .append("\n"); - sb - .append(" innerQueries: ") - .append(toIndentedString(innerQueries)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/GetObjectsParams.java b/algoliasearch-core/com/algolia/model/GetObjectsParams.java deleted file mode 100644 index f6808cb8f..000000000 --- a/algoliasearch-core/com/algolia/model/GetObjectsParams.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** The `getObjects` parameters. */ -public class GetObjectsParams { - - @SerializedName("requests") - private List requests = null; - - public GetObjectsParams requests(List requests) { - this.requests = requests; - return this; - } - - public GetObjectsParams addRequestsItem( - MultipleGetObjectsParams requestsItem - ) { - if (this.requests == null) { - this.requests = new ArrayList<>(); - } - this.requests.add(requestsItem); - return this; - } - - /** - * Get requests - * - * @return requests - */ - @javax.annotation.Nullable - public List getRequests() { - return requests; - } - - public void setRequests(List requests) { - this.requests = requests; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetObjectsParams getObjectsParams = (GetObjectsParams) o; - return Objects.equals(this.requests, getObjectsParams.requests); - } - - @Override - public int hashCode() { - return Objects.hash(requests); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetObjectsParams {\n"); - sb.append(" requests: ").append(toIndentedString(requests)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/GetObjectsResponse.java b/algoliasearch-core/com/algolia/model/GetObjectsResponse.java deleted file mode 100644 index 7a96b37e9..000000000 --- a/algoliasearch-core/com/algolia/model/GetObjectsResponse.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** GetObjectsResponse */ -public class GetObjectsResponse { - - @SerializedName("results") - private List results = null; - - public GetObjectsResponse results(List results) { - this.results = results; - return this; - } - - public GetObjectsResponse addResultsItem(Object resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * List of results fetched. - * - * @return results - */ - @javax.annotation.Nullable - public List getResults() { - return results; - } - - public void setResults(List results) { - this.results = results; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetObjectsResponse getObjectsResponse = (GetObjectsResponse) o; - return Objects.equals(this.results, getObjectsResponse.results); - } - - @Override - public int hashCode() { - return Objects.hash(results); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetObjectsResponse {\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/GetTaskResponse.java b/algoliasearch-core/com/algolia/model/GetTaskResponse.java deleted file mode 100644 index 06fe5e240..000000000 --- a/algoliasearch-core/com/algolia/model/GetTaskResponse.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Objects; - -/** GetTaskResponse */ -public class GetTaskResponse { - - /** Gets or Sets status */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - PUBLISHED("published"), - - NOTPUBLISHED("notPublished"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final StatusEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - @SerializedName("status") - private StatusEnum status; - - public GetTaskResponse status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTaskResponse getTaskResponse = (GetTaskResponse) o; - return Objects.equals(this.status, getTaskResponse.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTaskResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/GetTopUserIdsResponse.java b/algoliasearch-core/com/algolia/model/GetTopUserIdsResponse.java deleted file mode 100644 index 94cf46ab3..000000000 --- a/algoliasearch-core/com/algolia/model/GetTopUserIdsResponse.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Array of userIDs and clusters. */ -public class GetTopUserIdsResponse { - - @SerializedName("topUsers") - private List>> topUsers = new ArrayList<>(); - - public GetTopUserIdsResponse topUsers( - List>> topUsers - ) { - this.topUsers = topUsers; - return this; - } - - public GetTopUserIdsResponse addTopUsersItem( - Map> topUsersItem - ) { - this.topUsers.add(topUsersItem); - return this; - } - - /** - * Mapping of cluster names to top users. - * - * @return topUsers - */ - @javax.annotation.Nonnull - public List>> getTopUsers() { - return topUsers; - } - - public void setTopUsers(List>> topUsers) { - this.topUsers = topUsers; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTopUserIdsResponse getTopUserIdsResponse = (GetTopUserIdsResponse) o; - return Objects.equals(this.topUsers, getTopUserIdsResponse.topUsers); - } - - @Override - public int hashCode() { - return Objects.hash(topUsers); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTopUserIdsResponse {\n"); - sb.append(" topUsers: ").append(toIndentedString(topUsers)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/HighlightResult.java b/algoliasearch-core/com/algolia/model/HighlightResult.java deleted file mode 100644 index 18aea7db1..000000000 --- a/algoliasearch-core/com/algolia/model/HighlightResult.java +++ /dev/null @@ -1,216 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Highlighted attributes. */ -public class HighlightResult { - - @SerializedName("value") - private String value; - - /** Indicates how well the attribute matched the search query. */ - @JsonAdapter(MatchLevelEnum.Adapter.class) - public enum MatchLevelEnum { - NONE("none"), - - PARTIAL("partial"), - - FULL("full"); - - private String value; - - MatchLevelEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static MatchLevelEnum fromValue(String value) { - for (MatchLevelEnum b : MatchLevelEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final MatchLevelEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public MatchLevelEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return MatchLevelEnum.fromValue(value); - } - } - } - - @SerializedName("matchLevel") - private MatchLevelEnum matchLevel; - - @SerializedName("matchedWords") - private List matchedWords = null; - - @SerializedName("fullyHighlighted") - private Boolean fullyHighlighted; - - public HighlightResult value(String value) { - this.value = value; - return this; - } - - /** - * Markup text with occurrences highlighted. - * - * @return value - */ - @javax.annotation.Nullable - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public HighlightResult matchLevel(MatchLevelEnum matchLevel) { - this.matchLevel = matchLevel; - return this; - } - - /** - * Indicates how well the attribute matched the search query. - * - * @return matchLevel - */ - @javax.annotation.Nullable - public MatchLevelEnum getMatchLevel() { - return matchLevel; - } - - public void setMatchLevel(MatchLevelEnum matchLevel) { - this.matchLevel = matchLevel; - } - - public HighlightResult matchedWords(List matchedWords) { - this.matchedWords = matchedWords; - return this; - } - - public HighlightResult addMatchedWordsItem(String matchedWordsItem) { - if (this.matchedWords == null) { - this.matchedWords = new ArrayList<>(); - } - this.matchedWords.add(matchedWordsItem); - return this; - } - - /** - * List of words from the query that matched the object. - * - * @return matchedWords - */ - @javax.annotation.Nullable - public List getMatchedWords() { - return matchedWords; - } - - public void setMatchedWords(List matchedWords) { - this.matchedWords = matchedWords; - } - - public HighlightResult fullyHighlighted(Boolean fullyHighlighted) { - this.fullyHighlighted = fullyHighlighted; - return this; - } - - /** - * Whether the entire attribute value is highlighted. - * - * @return fullyHighlighted - */ - @javax.annotation.Nullable - public Boolean getFullyHighlighted() { - return fullyHighlighted; - } - - public void setFullyHighlighted(Boolean fullyHighlighted) { - this.fullyHighlighted = fullyHighlighted; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HighlightResult highlightResult = (HighlightResult) o; - return ( - Objects.equals(this.value, highlightResult.value) && - Objects.equals(this.matchLevel, highlightResult.matchLevel) && - Objects.equals(this.matchedWords, highlightResult.matchedWords) && - Objects.equals(this.fullyHighlighted, highlightResult.fullyHighlighted) - ); - } - - @Override - public int hashCode() { - return Objects.hash(value, matchLevel, matchedWords, fullyHighlighted); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HighlightResult {\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb - .append(" matchLevel: ") - .append(toIndentedString(matchLevel)) - .append("\n"); - sb - .append(" matchedWords: ") - .append(toIndentedString(matchedWords)) - .append("\n"); - sb - .append(" fullyHighlighted: ") - .append(toIndentedString(fullyHighlighted)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/Hit.java b/algoliasearch-core/com/algolia/model/Hit.java deleted file mode 100644 index 5b6f67f71..000000000 --- a/algoliasearch-core/com/algolia/model/Hit.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.HashMap; -import java.util.Objects; - -/** A single hit. */ -public class Hit extends HashMap { - - @SerializedName("objectID") - private String objectID; - - @SerializedName("_highlightResult") - private HighlightResult highlightResult; - - @SerializedName("_snippetResult") - private SnippetResult snippetResult; - - @SerializedName("_rankingInfo") - private RankingInfo rankingInfo; - - @SerializedName("_distinctSeqID") - private Integer distinctSeqID; - - public Hit objectID(String objectID) { - this.objectID = objectID; - return this; - } - - /** - * Unique identifier of the object. - * - * @return objectID - */ - @javax.annotation.Nonnull - public String getObjectID() { - return objectID; - } - - public void setObjectID(String objectID) { - this.objectID = objectID; - } - - public Hit highlightResult(HighlightResult highlightResult) { - this.highlightResult = highlightResult; - return this; - } - - /** - * Get highlightResult - * - * @return highlightResult - */ - @javax.annotation.Nullable - public HighlightResult getHighlightResult() { - return highlightResult; - } - - public void setHighlightResult(HighlightResult highlightResult) { - this.highlightResult = highlightResult; - } - - public Hit snippetResult(SnippetResult snippetResult) { - this.snippetResult = snippetResult; - return this; - } - - /** - * Get snippetResult - * - * @return snippetResult - */ - @javax.annotation.Nullable - public SnippetResult getSnippetResult() { - return snippetResult; - } - - public void setSnippetResult(SnippetResult snippetResult) { - this.snippetResult = snippetResult; - } - - public Hit rankingInfo(RankingInfo rankingInfo) { - this.rankingInfo = rankingInfo; - return this; - } - - /** - * Get rankingInfo - * - * @return rankingInfo - */ - @javax.annotation.Nullable - public RankingInfo getRankingInfo() { - return rankingInfo; - } - - public void setRankingInfo(RankingInfo rankingInfo) { - this.rankingInfo = rankingInfo; - } - - public Hit distinctSeqID(Integer distinctSeqID) { - this.distinctSeqID = distinctSeqID; - return this; - } - - /** - * Get distinctSeqID - * - * @return distinctSeqID - */ - @javax.annotation.Nullable - public Integer getDistinctSeqID() { - return distinctSeqID; - } - - public void setDistinctSeqID(Integer distinctSeqID) { - this.distinctSeqID = distinctSeqID; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Hit hit = (Hit) o; - return ( - Objects.equals(this.objectID, hit.objectID) && - Objects.equals(this.highlightResult, hit.highlightResult) && - Objects.equals(this.snippetResult, hit.snippetResult) && - Objects.equals(this.rankingInfo, hit.rankingInfo) && - Objects.equals(this.distinctSeqID, hit.distinctSeqID) && - super.equals(o) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - objectID, - highlightResult, - snippetResult, - rankingInfo, - distinctSeqID, - super.hashCode() - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Hit {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n"); - sb - .append(" highlightResult: ") - .append(toIndentedString(highlightResult)) - .append("\n"); - sb - .append(" snippetResult: ") - .append(toIndentedString(snippetResult)) - .append("\n"); - sb - .append(" rankingInfo: ") - .append(toIndentedString(rankingInfo)) - .append("\n"); - sb - .append(" distinctSeqID: ") - .append(toIndentedString(distinctSeqID)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/IndexSettings.java b/algoliasearch-core/com/algolia/model/IndexSettings.java deleted file mode 100644 index 7a788bbe3..000000000 --- a/algoliasearch-core/com/algolia/model/IndexSettings.java +++ /dev/null @@ -1,2320 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** The Algolia index settings. */ -public class IndexSettings { - - @SerializedName("replicas") - private List replicas = null; - - @SerializedName("paginationLimitedTo") - private Integer paginationLimitedTo = 1000; - - @SerializedName("disableTypoToleranceOnWords") - private List disableTypoToleranceOnWords = null; - - @SerializedName("attributesToTransliterate") - private List attributesToTransliterate = null; - - @SerializedName("camelCaseAttributes") - private List camelCaseAttributes = null; - - @SerializedName("decompoundedAttributes") - private Object decompoundedAttributes = new Object(); - - @SerializedName("indexLanguages") - private List indexLanguages = null; - - @SerializedName("filterPromotes") - private Boolean filterPromotes = false; - - @SerializedName("disablePrefixOnAttributes") - private List disablePrefixOnAttributes = null; - - @SerializedName("allowCompressionOfIntegerArray") - private Boolean allowCompressionOfIntegerArray = false; - - @SerializedName("numericAttributesForFiltering") - private List numericAttributesForFiltering = null; - - @SerializedName("userData") - private Object userData = new Object(); - - @SerializedName("searchableAttributes") - private List searchableAttributes = null; - - @SerializedName("attributesForFaceting") - private List attributesForFaceting = null; - - @SerializedName("unretrievableAttributes") - private List unretrievableAttributes = null; - - @SerializedName("attributesToRetrieve") - private List attributesToRetrieve = null; - - @SerializedName("restrictSearchableAttributes") - private List restrictSearchableAttributes = null; - - @SerializedName("ranking") - private List ranking = null; - - @SerializedName("customRanking") - private List customRanking = null; - - @SerializedName("relevancyStrictness") - private Integer relevancyStrictness = 100; - - @SerializedName("attributesToHighlight") - private List attributesToHighlight = null; - - @SerializedName("attributesToSnippet") - private List attributesToSnippet = null; - - @SerializedName("highlightPreTag") - private String highlightPreTag = ""; - - @SerializedName("highlightPostTag") - private String highlightPostTag = ""; - - @SerializedName("snippetEllipsisText") - private String snippetEllipsisText = "…"; - - @SerializedName("restrictHighlightAndSnippetArrays") - private Boolean restrictHighlightAndSnippetArrays = false; - - @SerializedName("hitsPerPage") - private Integer hitsPerPage = 20; - - @SerializedName("minWordSizefor1Typo") - private Integer minWordSizefor1Typo = 4; - - @SerializedName("minWordSizefor2Typos") - private Integer minWordSizefor2Typos = 8; - - /** Controls whether typo tolerance is enabled and how it is applied. */ - @JsonAdapter(TypoToleranceEnum.Adapter.class) - public enum TypoToleranceEnum { - TRUE("true"), - - FALSE("false"), - - MIN("min"), - - STRICT("strict"); - - private String value; - - TypoToleranceEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypoToleranceEnum fromValue(String value) { - for (TypoToleranceEnum b : TypoToleranceEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final TypoToleranceEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypoToleranceEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return TypoToleranceEnum.fromValue(value); - } - } - } - - @SerializedName("typoTolerance") - private TypoToleranceEnum typoTolerance = TypoToleranceEnum.TRUE; - - @SerializedName("allowTyposOnNumericTokens") - private Boolean allowTyposOnNumericTokens = true; - - @SerializedName("disableTypoToleranceOnAttributes") - private List disableTypoToleranceOnAttributes = null; - - @SerializedName("separatorsToIndex") - private String separatorsToIndex = ""; - - @SerializedName("ignorePlurals") - private String ignorePlurals = "false"; - - @SerializedName("removeStopWords") - private String removeStopWords = "false"; - - @SerializedName("keepDiacriticsOnCharacters") - private String keepDiacriticsOnCharacters = ""; - - @SerializedName("queryLanguages") - private List queryLanguages = null; - - @SerializedName("decompoundQuery") - private Boolean decompoundQuery = true; - - @SerializedName("enableRules") - private Boolean enableRules = true; - - @SerializedName("enablePersonalization") - private Boolean enablePersonalization = false; - - /** Controls if and how query words are interpreted as prefixes. */ - @JsonAdapter(QueryTypeEnum.Adapter.class) - public enum QueryTypeEnum { - PREFIXLAST("prefixLast"), - - PREFIXALL("prefixAll"), - - PREFIXNONE("prefixNone"); - - private String value; - - QueryTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static QueryTypeEnum fromValue(String value) { - for (QueryTypeEnum b : QueryTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final QueryTypeEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public QueryTypeEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return QueryTypeEnum.fromValue(value); - } - } - } - - @SerializedName("queryType") - private QueryTypeEnum queryType = QueryTypeEnum.PREFIXLAST; - - /** Selects a strategy to remove words from the query when it doesn't match any hits. */ - @JsonAdapter(RemoveWordsIfNoResultsEnum.Adapter.class) - public enum RemoveWordsIfNoResultsEnum { - NONE("none"), - - LASTWORDS("lastWords"), - - FIRSTWORDS("firstWords"), - - ALLOPTIONAL("allOptional"); - - private String value; - - RemoveWordsIfNoResultsEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static RemoveWordsIfNoResultsEnum fromValue(String value) { - for (RemoveWordsIfNoResultsEnum b : RemoveWordsIfNoResultsEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final RemoveWordsIfNoResultsEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public RemoveWordsIfNoResultsEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return RemoveWordsIfNoResultsEnum.fromValue(value); - } - } - } - - @SerializedName("removeWordsIfNoResults") - private RemoveWordsIfNoResultsEnum removeWordsIfNoResults = - RemoveWordsIfNoResultsEnum.NONE; - - @SerializedName("advancedSyntax") - private Boolean advancedSyntax = false; - - @SerializedName("optionalWords") - private List optionalWords = null; - - @SerializedName("disableExactOnAttributes") - private List disableExactOnAttributes = null; - - /** Controls how the exact ranking criterion is computed when the query contains only one word. */ - @JsonAdapter(ExactOnSingleWordQueryEnum.Adapter.class) - public enum ExactOnSingleWordQueryEnum { - ATTRIBUTE("attribute"), - - NONE("none"), - - WORD("word"); - - private String value; - - ExactOnSingleWordQueryEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ExactOnSingleWordQueryEnum fromValue(String value) { - for (ExactOnSingleWordQueryEnum b : ExactOnSingleWordQueryEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final ExactOnSingleWordQueryEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ExactOnSingleWordQueryEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return ExactOnSingleWordQueryEnum.fromValue(value); - } - } - } - - @SerializedName("exactOnSingleWordQuery") - private ExactOnSingleWordQueryEnum exactOnSingleWordQuery = - ExactOnSingleWordQueryEnum.ATTRIBUTE; - - /** Gets or Sets alternativesAsExact */ - @JsonAdapter(AlternativesAsExactEnum.Adapter.class) - public enum AlternativesAsExactEnum { - IGNOREPLURALS("ignorePlurals"), - - SINGLEWORDSYNONYM("singleWordSynonym"), - - MULTIWORDSSYNONYM("multiWordsSynonym"); - - private String value; - - AlternativesAsExactEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AlternativesAsExactEnum fromValue(String value) { - for (AlternativesAsExactEnum b : AlternativesAsExactEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final AlternativesAsExactEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AlternativesAsExactEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return AlternativesAsExactEnum.fromValue(value); - } - } - } - - @SerializedName("alternativesAsExact") - private List alternativesAsExact = null; - - /** Gets or Sets advancedSyntaxFeatures */ - @JsonAdapter(AdvancedSyntaxFeaturesEnum.Adapter.class) - public enum AdvancedSyntaxFeaturesEnum { - EXACTPHRASE("exactPhrase"), - - EXCLUDEWORDS("excludeWords"); - - private String value; - - AdvancedSyntaxFeaturesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AdvancedSyntaxFeaturesEnum fromValue(String value) { - for (AdvancedSyntaxFeaturesEnum b : AdvancedSyntaxFeaturesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final AdvancedSyntaxFeaturesEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AdvancedSyntaxFeaturesEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return AdvancedSyntaxFeaturesEnum.fromValue(value); - } - } - } - - @SerializedName("advancedSyntaxFeatures") - private List advancedSyntaxFeatures = null; - - @SerializedName("distinct") - private Integer distinct = 0; - - @SerializedName("synonyms") - private Boolean synonyms = true; - - @SerializedName("replaceSynonymsInHighlight") - private Boolean replaceSynonymsInHighlight = false; - - @SerializedName("minProximity") - private Integer minProximity = 1; - - @SerializedName("responseFields") - private List responseFields = null; - - @SerializedName("maxFacetHits") - private Integer maxFacetHits = 10; - - @SerializedName("attributeCriteriaComputedByMinProximity") - private Boolean attributeCriteriaComputedByMinProximity = false; - - @SerializedName("renderingContent") - private Object renderingContent = new Object(); - - public IndexSettings replicas(List replicas) { - this.replicas = replicas; - return this; - } - - public IndexSettings addReplicasItem(String replicasItem) { - if (this.replicas == null) { - this.replicas = new ArrayList<>(); - } - this.replicas.add(replicasItem); - return this; - } - - /** - * Creates replicas, exact copies of an index. - * - * @return replicas - */ - @javax.annotation.Nullable - public List getReplicas() { - return replicas; - } - - public void setReplicas(List replicas) { - this.replicas = replicas; - } - - public IndexSettings paginationLimitedTo(Integer paginationLimitedTo) { - this.paginationLimitedTo = paginationLimitedTo; - return this; - } - - /** - * Set the maximum number of hits accessible via pagination. - * - * @return paginationLimitedTo - */ - @javax.annotation.Nullable - public Integer getPaginationLimitedTo() { - return paginationLimitedTo; - } - - public void setPaginationLimitedTo(Integer paginationLimitedTo) { - this.paginationLimitedTo = paginationLimitedTo; - } - - public IndexSettings disableTypoToleranceOnWords( - List disableTypoToleranceOnWords - ) { - this.disableTypoToleranceOnWords = disableTypoToleranceOnWords; - return this; - } - - public IndexSettings addDisableTypoToleranceOnWordsItem( - String disableTypoToleranceOnWordsItem - ) { - if (this.disableTypoToleranceOnWords == null) { - this.disableTypoToleranceOnWords = new ArrayList<>(); - } - this.disableTypoToleranceOnWords.add(disableTypoToleranceOnWordsItem); - return this; - } - - /** - * A list of words for which you want to turn off typo tolerance. - * - * @return disableTypoToleranceOnWords - */ - @javax.annotation.Nullable - public List getDisableTypoToleranceOnWords() { - return disableTypoToleranceOnWords; - } - - public void setDisableTypoToleranceOnWords( - List disableTypoToleranceOnWords - ) { - this.disableTypoToleranceOnWords = disableTypoToleranceOnWords; - } - - public IndexSettings attributesToTransliterate( - List attributesToTransliterate - ) { - this.attributesToTransliterate = attributesToTransliterate; - return this; - } - - public IndexSettings addAttributesToTransliterateItem( - String attributesToTransliterateItem - ) { - if (this.attributesToTransliterate == null) { - this.attributesToTransliterate = new ArrayList<>(); - } - this.attributesToTransliterate.add(attributesToTransliterateItem); - return this; - } - - /** - * Specify on which attributes to apply transliteration. - * - * @return attributesToTransliterate - */ - @javax.annotation.Nullable - public List getAttributesToTransliterate() { - return attributesToTransliterate; - } - - public void setAttributesToTransliterate( - List attributesToTransliterate - ) { - this.attributesToTransliterate = attributesToTransliterate; - } - - public IndexSettings camelCaseAttributes(List camelCaseAttributes) { - this.camelCaseAttributes = camelCaseAttributes; - return this; - } - - public IndexSettings addCamelCaseAttributesItem( - String camelCaseAttributesItem - ) { - if (this.camelCaseAttributes == null) { - this.camelCaseAttributes = new ArrayList<>(); - } - this.camelCaseAttributes.add(camelCaseAttributesItem); - return this; - } - - /** - * List of attributes on which to do a decomposition of camel case words. - * - * @return camelCaseAttributes - */ - @javax.annotation.Nullable - public List getCamelCaseAttributes() { - return camelCaseAttributes; - } - - public void setCamelCaseAttributes(List camelCaseAttributes) { - this.camelCaseAttributes = camelCaseAttributes; - } - - public IndexSettings decompoundedAttributes(Object decompoundedAttributes) { - this.decompoundedAttributes = decompoundedAttributes; - return this; - } - - /** - * Specify on which attributes in your index Algolia should apply word segmentation, also known as - * decompounding. - * - * @return decompoundedAttributes - */ - @javax.annotation.Nullable - public Object getDecompoundedAttributes() { - return decompoundedAttributes; - } - - public void setDecompoundedAttributes(Object decompoundedAttributes) { - this.decompoundedAttributes = decompoundedAttributes; - } - - public IndexSettings indexLanguages(List indexLanguages) { - this.indexLanguages = indexLanguages; - return this; - } - - public IndexSettings addIndexLanguagesItem(String indexLanguagesItem) { - if (this.indexLanguages == null) { - this.indexLanguages = new ArrayList<>(); - } - this.indexLanguages.add(indexLanguagesItem); - return this; - } - - /** - * Sets the languages at the index level for language-specific processing such as tokenization and - * normalization. - * - * @return indexLanguages - */ - @javax.annotation.Nullable - public List getIndexLanguages() { - return indexLanguages; - } - - public void setIndexLanguages(List indexLanguages) { - this.indexLanguages = indexLanguages; - } - - public IndexSettings filterPromotes(Boolean filterPromotes) { - this.filterPromotes = filterPromotes; - return this; - } - - /** - * Whether promoted results should match the filters of the current search, except for geographic - * filters. - * - * @return filterPromotes - */ - @javax.annotation.Nullable - public Boolean getFilterPromotes() { - return filterPromotes; - } - - public void setFilterPromotes(Boolean filterPromotes) { - this.filterPromotes = filterPromotes; - } - - public IndexSettings disablePrefixOnAttributes( - List disablePrefixOnAttributes - ) { - this.disablePrefixOnAttributes = disablePrefixOnAttributes; - return this; - } - - public IndexSettings addDisablePrefixOnAttributesItem( - String disablePrefixOnAttributesItem - ) { - if (this.disablePrefixOnAttributes == null) { - this.disablePrefixOnAttributes = new ArrayList<>(); - } - this.disablePrefixOnAttributes.add(disablePrefixOnAttributesItem); - return this; - } - - /** - * List of attributes on which you want to disable prefix matching. - * - * @return disablePrefixOnAttributes - */ - @javax.annotation.Nullable - public List getDisablePrefixOnAttributes() { - return disablePrefixOnAttributes; - } - - public void setDisablePrefixOnAttributes( - List disablePrefixOnAttributes - ) { - this.disablePrefixOnAttributes = disablePrefixOnAttributes; - } - - public IndexSettings allowCompressionOfIntegerArray( - Boolean allowCompressionOfIntegerArray - ) { - this.allowCompressionOfIntegerArray = allowCompressionOfIntegerArray; - return this; - } - - /** - * Enables compression of large integer arrays. - * - * @return allowCompressionOfIntegerArray - */ - @javax.annotation.Nullable - public Boolean getAllowCompressionOfIntegerArray() { - return allowCompressionOfIntegerArray; - } - - public void setAllowCompressionOfIntegerArray( - Boolean allowCompressionOfIntegerArray - ) { - this.allowCompressionOfIntegerArray = allowCompressionOfIntegerArray; - } - - public IndexSettings numericAttributesForFiltering( - List numericAttributesForFiltering - ) { - this.numericAttributesForFiltering = numericAttributesForFiltering; - return this; - } - - public IndexSettings addNumericAttributesForFilteringItem( - String numericAttributesForFilteringItem - ) { - if (this.numericAttributesForFiltering == null) { - this.numericAttributesForFiltering = new ArrayList<>(); - } - this.numericAttributesForFiltering.add(numericAttributesForFilteringItem); - return this; - } - - /** - * List of numeric attributes that can be used as numerical filters. - * - * @return numericAttributesForFiltering - */ - @javax.annotation.Nullable - public List getNumericAttributesForFiltering() { - return numericAttributesForFiltering; - } - - public void setNumericAttributesForFiltering( - List numericAttributesForFiltering - ) { - this.numericAttributesForFiltering = numericAttributesForFiltering; - } - - public IndexSettings userData(Object userData) { - this.userData = userData; - return this; - } - - /** - * Lets you store custom data in your indices. - * - * @return userData - */ - @javax.annotation.Nullable - public Object getUserData() { - return userData; - } - - public void setUserData(Object userData) { - this.userData = userData; - } - - public IndexSettings searchableAttributes(List searchableAttributes) { - this.searchableAttributes = searchableAttributes; - return this; - } - - public IndexSettings addSearchableAttributesItem( - String searchableAttributesItem - ) { - if (this.searchableAttributes == null) { - this.searchableAttributes = new ArrayList<>(); - } - this.searchableAttributes.add(searchableAttributesItem); - return this; - } - - /** - * The complete list of attributes used for searching. - * - * @return searchableAttributes - */ - @javax.annotation.Nullable - public List getSearchableAttributes() { - return searchableAttributes; - } - - public void setSearchableAttributes(List searchableAttributes) { - this.searchableAttributes = searchableAttributes; - } - - public IndexSettings attributesForFaceting( - List attributesForFaceting - ) { - this.attributesForFaceting = attributesForFaceting; - return this; - } - - public IndexSettings addAttributesForFacetingItem( - String attributesForFacetingItem - ) { - if (this.attributesForFaceting == null) { - this.attributesForFaceting = new ArrayList<>(); - } - this.attributesForFaceting.add(attributesForFacetingItem); - return this; - } - - /** - * The complete list of attributes that will be used for faceting. - * - * @return attributesForFaceting - */ - @javax.annotation.Nullable - public List getAttributesForFaceting() { - return attributesForFaceting; - } - - public void setAttributesForFaceting(List attributesForFaceting) { - this.attributesForFaceting = attributesForFaceting; - } - - public IndexSettings unretrievableAttributes( - List unretrievableAttributes - ) { - this.unretrievableAttributes = unretrievableAttributes; - return this; - } - - public IndexSettings addUnretrievableAttributesItem( - String unretrievableAttributesItem - ) { - if (this.unretrievableAttributes == null) { - this.unretrievableAttributes = new ArrayList<>(); - } - this.unretrievableAttributes.add(unretrievableAttributesItem); - return this; - } - - /** - * List of attributes that can't be retrieved at query time. - * - * @return unretrievableAttributes - */ - @javax.annotation.Nullable - public List getUnretrievableAttributes() { - return unretrievableAttributes; - } - - public void setUnretrievableAttributes(List unretrievableAttributes) { - this.unretrievableAttributes = unretrievableAttributes; - } - - public IndexSettings attributesToRetrieve(List attributesToRetrieve) { - this.attributesToRetrieve = attributesToRetrieve; - return this; - } - - public IndexSettings addAttributesToRetrieveItem( - String attributesToRetrieveItem - ) { - if (this.attributesToRetrieve == null) { - this.attributesToRetrieve = new ArrayList<>(); - } - this.attributesToRetrieve.add(attributesToRetrieveItem); - return this; - } - - /** - * This parameter controls which attributes to retrieve and which not to retrieve. - * - * @return attributesToRetrieve - */ - @javax.annotation.Nullable - public List getAttributesToRetrieve() { - return attributesToRetrieve; - } - - public void setAttributesToRetrieve(List attributesToRetrieve) { - this.attributesToRetrieve = attributesToRetrieve; - } - - public IndexSettings restrictSearchableAttributes( - List restrictSearchableAttributes - ) { - this.restrictSearchableAttributes = restrictSearchableAttributes; - return this; - } - - public IndexSettings addRestrictSearchableAttributesItem( - String restrictSearchableAttributesItem - ) { - if (this.restrictSearchableAttributes == null) { - this.restrictSearchableAttributes = new ArrayList<>(); - } - this.restrictSearchableAttributes.add(restrictSearchableAttributesItem); - return this; - } - - /** - * Restricts a given query to look in only a subset of your searchable attributes. - * - * @return restrictSearchableAttributes - */ - @javax.annotation.Nullable - public List getRestrictSearchableAttributes() { - return restrictSearchableAttributes; - } - - public void setRestrictSearchableAttributes( - List restrictSearchableAttributes - ) { - this.restrictSearchableAttributes = restrictSearchableAttributes; - } - - public IndexSettings ranking(List ranking) { - this.ranking = ranking; - return this; - } - - public IndexSettings addRankingItem(String rankingItem) { - if (this.ranking == null) { - this.ranking = new ArrayList<>(); - } - this.ranking.add(rankingItem); - return this; - } - - /** - * Controls how Algolia should sort your results. - * - * @return ranking - */ - @javax.annotation.Nullable - public List getRanking() { - return ranking; - } - - public void setRanking(List ranking) { - this.ranking = ranking; - } - - public IndexSettings customRanking(List customRanking) { - this.customRanking = customRanking; - return this; - } - - public IndexSettings addCustomRankingItem(String customRankingItem) { - if (this.customRanking == null) { - this.customRanking = new ArrayList<>(); - } - this.customRanking.add(customRankingItem); - return this; - } - - /** - * Specifies the custom ranking criterion. - * - * @return customRanking - */ - @javax.annotation.Nullable - public List getCustomRanking() { - return customRanking; - } - - public void setCustomRanking(List customRanking) { - this.customRanking = customRanking; - } - - public IndexSettings relevancyStrictness(Integer relevancyStrictness) { - this.relevancyStrictness = relevancyStrictness; - return this; - } - - /** - * Controls the relevancy threshold below which less relevant results aren't included in the - * results. - * - * @return relevancyStrictness - */ - @javax.annotation.Nullable - public Integer getRelevancyStrictness() { - return relevancyStrictness; - } - - public void setRelevancyStrictness(Integer relevancyStrictness) { - this.relevancyStrictness = relevancyStrictness; - } - - public IndexSettings attributesToHighlight( - List attributesToHighlight - ) { - this.attributesToHighlight = attributesToHighlight; - return this; - } - - public IndexSettings addAttributesToHighlightItem( - String attributesToHighlightItem - ) { - if (this.attributesToHighlight == null) { - this.attributesToHighlight = new ArrayList<>(); - } - this.attributesToHighlight.add(attributesToHighlightItem); - return this; - } - - /** - * List of attributes to highlight. - * - * @return attributesToHighlight - */ - @javax.annotation.Nullable - public List getAttributesToHighlight() { - return attributesToHighlight; - } - - public void setAttributesToHighlight(List attributesToHighlight) { - this.attributesToHighlight = attributesToHighlight; - } - - public IndexSettings attributesToSnippet(List attributesToSnippet) { - this.attributesToSnippet = attributesToSnippet; - return this; - } - - public IndexSettings addAttributesToSnippetItem( - String attributesToSnippetItem - ) { - if (this.attributesToSnippet == null) { - this.attributesToSnippet = new ArrayList<>(); - } - this.attributesToSnippet.add(attributesToSnippetItem); - return this; - } - - /** - * List of attributes to snippet, with an optional maximum number of words to snippet. - * - * @return attributesToSnippet - */ - @javax.annotation.Nullable - public List getAttributesToSnippet() { - return attributesToSnippet; - } - - public void setAttributesToSnippet(List attributesToSnippet) { - this.attributesToSnippet = attributesToSnippet; - } - - public IndexSettings highlightPreTag(String highlightPreTag) { - this.highlightPreTag = highlightPreTag; - return this; - } - - /** - * The HTML string to insert before the highlighted parts in all highlight and snippet results. - * - * @return highlightPreTag - */ - @javax.annotation.Nullable - public String getHighlightPreTag() { - return highlightPreTag; - } - - public void setHighlightPreTag(String highlightPreTag) { - this.highlightPreTag = highlightPreTag; - } - - public IndexSettings highlightPostTag(String highlightPostTag) { - this.highlightPostTag = highlightPostTag; - return this; - } - - /** - * The HTML string to insert after the highlighted parts in all highlight and snippet results. - * - * @return highlightPostTag - */ - @javax.annotation.Nullable - public String getHighlightPostTag() { - return highlightPostTag; - } - - public void setHighlightPostTag(String highlightPostTag) { - this.highlightPostTag = highlightPostTag; - } - - public IndexSettings snippetEllipsisText(String snippetEllipsisText) { - this.snippetEllipsisText = snippetEllipsisText; - return this; - } - - /** - * String used as an ellipsis indicator when a snippet is truncated. - * - * @return snippetEllipsisText - */ - @javax.annotation.Nullable - public String getSnippetEllipsisText() { - return snippetEllipsisText; - } - - public void setSnippetEllipsisText(String snippetEllipsisText) { - this.snippetEllipsisText = snippetEllipsisText; - } - - public IndexSettings restrictHighlightAndSnippetArrays( - Boolean restrictHighlightAndSnippetArrays - ) { - this.restrictHighlightAndSnippetArrays = restrictHighlightAndSnippetArrays; - return this; - } - - /** - * Restrict highlighting and snippeting to items that matched the query. - * - * @return restrictHighlightAndSnippetArrays - */ - @javax.annotation.Nullable - public Boolean getRestrictHighlightAndSnippetArrays() { - return restrictHighlightAndSnippetArrays; - } - - public void setRestrictHighlightAndSnippetArrays( - Boolean restrictHighlightAndSnippetArrays - ) { - this.restrictHighlightAndSnippetArrays = restrictHighlightAndSnippetArrays; - } - - public IndexSettings hitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - return this; - } - - /** - * Set the number of hits per page. - * - * @return hitsPerPage - */ - @javax.annotation.Nullable - public Integer getHitsPerPage() { - return hitsPerPage; - } - - public void setHitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - } - - public IndexSettings minWordSizefor1Typo(Integer minWordSizefor1Typo) { - this.minWordSizefor1Typo = minWordSizefor1Typo; - return this; - } - - /** - * Minimum number of characters a word in the query string must contain to accept matches with 1 - * typo. - * - * @return minWordSizefor1Typo - */ - @javax.annotation.Nullable - public Integer getMinWordSizefor1Typo() { - return minWordSizefor1Typo; - } - - public void setMinWordSizefor1Typo(Integer minWordSizefor1Typo) { - this.minWordSizefor1Typo = minWordSizefor1Typo; - } - - public IndexSettings minWordSizefor2Typos(Integer minWordSizefor2Typos) { - this.minWordSizefor2Typos = minWordSizefor2Typos; - return this; - } - - /** - * Minimum number of characters a word in the query string must contain to accept matches with 2 - * typos. - * - * @return minWordSizefor2Typos - */ - @javax.annotation.Nullable - public Integer getMinWordSizefor2Typos() { - return minWordSizefor2Typos; - } - - public void setMinWordSizefor2Typos(Integer minWordSizefor2Typos) { - this.minWordSizefor2Typos = minWordSizefor2Typos; - } - - public IndexSettings typoTolerance(TypoToleranceEnum typoTolerance) { - this.typoTolerance = typoTolerance; - return this; - } - - /** - * Controls whether typo tolerance is enabled and how it is applied. - * - * @return typoTolerance - */ - @javax.annotation.Nullable - public TypoToleranceEnum getTypoTolerance() { - return typoTolerance; - } - - public void setTypoTolerance(TypoToleranceEnum typoTolerance) { - this.typoTolerance = typoTolerance; - } - - public IndexSettings allowTyposOnNumericTokens( - Boolean allowTyposOnNumericTokens - ) { - this.allowTyposOnNumericTokens = allowTyposOnNumericTokens; - return this; - } - - /** - * Whether to allow typos on numbers (\"numeric tokens\") in the query string. - * - * @return allowTyposOnNumericTokens - */ - @javax.annotation.Nullable - public Boolean getAllowTyposOnNumericTokens() { - return allowTyposOnNumericTokens; - } - - public void setAllowTyposOnNumericTokens(Boolean allowTyposOnNumericTokens) { - this.allowTyposOnNumericTokens = allowTyposOnNumericTokens; - } - - public IndexSettings disableTypoToleranceOnAttributes( - List disableTypoToleranceOnAttributes - ) { - this.disableTypoToleranceOnAttributes = disableTypoToleranceOnAttributes; - return this; - } - - public IndexSettings addDisableTypoToleranceOnAttributesItem( - String disableTypoToleranceOnAttributesItem - ) { - if (this.disableTypoToleranceOnAttributes == null) { - this.disableTypoToleranceOnAttributes = new ArrayList<>(); - } - this.disableTypoToleranceOnAttributes.add( - disableTypoToleranceOnAttributesItem - ); - return this; - } - - /** - * List of attributes on which you want to disable typo tolerance. - * - * @return disableTypoToleranceOnAttributes - */ - @javax.annotation.Nullable - public List getDisableTypoToleranceOnAttributes() { - return disableTypoToleranceOnAttributes; - } - - public void setDisableTypoToleranceOnAttributes( - List disableTypoToleranceOnAttributes - ) { - this.disableTypoToleranceOnAttributes = disableTypoToleranceOnAttributes; - } - - public IndexSettings separatorsToIndex(String separatorsToIndex) { - this.separatorsToIndex = separatorsToIndex; - return this; - } - - /** - * Control which separators are indexed. - * - * @return separatorsToIndex - */ - @javax.annotation.Nullable - public String getSeparatorsToIndex() { - return separatorsToIndex; - } - - public void setSeparatorsToIndex(String separatorsToIndex) { - this.separatorsToIndex = separatorsToIndex; - } - - public IndexSettings ignorePlurals(String ignorePlurals) { - this.ignorePlurals = ignorePlurals; - return this; - } - - /** - * Treats singular, plurals, and other forms of declensions as matching terms. - * - * @return ignorePlurals - */ - @javax.annotation.Nullable - public String getIgnorePlurals() { - return ignorePlurals; - } - - public void setIgnorePlurals(String ignorePlurals) { - this.ignorePlurals = ignorePlurals; - } - - public IndexSettings removeStopWords(String removeStopWords) { - this.removeStopWords = removeStopWords; - return this; - } - - /** - * Removes stop (common) words from the query before executing it. - * - * @return removeStopWords - */ - @javax.annotation.Nullable - public String getRemoveStopWords() { - return removeStopWords; - } - - public void setRemoveStopWords(String removeStopWords) { - this.removeStopWords = removeStopWords; - } - - public IndexSettings keepDiacriticsOnCharacters( - String keepDiacriticsOnCharacters - ) { - this.keepDiacriticsOnCharacters = keepDiacriticsOnCharacters; - return this; - } - - /** - * List of characters that the engine shouldn't automatically normalize. - * - * @return keepDiacriticsOnCharacters - */ - @javax.annotation.Nullable - public String getKeepDiacriticsOnCharacters() { - return keepDiacriticsOnCharacters; - } - - public void setKeepDiacriticsOnCharacters(String keepDiacriticsOnCharacters) { - this.keepDiacriticsOnCharacters = keepDiacriticsOnCharacters; - } - - public IndexSettings queryLanguages(List queryLanguages) { - this.queryLanguages = queryLanguages; - return this; - } - - public IndexSettings addQueryLanguagesItem(String queryLanguagesItem) { - if (this.queryLanguages == null) { - this.queryLanguages = new ArrayList<>(); - } - this.queryLanguages.add(queryLanguagesItem); - return this; - } - - /** - * Sets the languages to be used by language-specific settings and functionalities such as - * ignorePlurals, removeStopWords, and CJK word-detection. - * - * @return queryLanguages - */ - @javax.annotation.Nullable - public List getQueryLanguages() { - return queryLanguages; - } - - public void setQueryLanguages(List queryLanguages) { - this.queryLanguages = queryLanguages; - } - - public IndexSettings decompoundQuery(Boolean decompoundQuery) { - this.decompoundQuery = decompoundQuery; - return this; - } - - /** - * Splits compound words into their composing atoms in the query. - * - * @return decompoundQuery - */ - @javax.annotation.Nullable - public Boolean getDecompoundQuery() { - return decompoundQuery; - } - - public void setDecompoundQuery(Boolean decompoundQuery) { - this.decompoundQuery = decompoundQuery; - } - - public IndexSettings enableRules(Boolean enableRules) { - this.enableRules = enableRules; - return this; - } - - /** - * Whether Rules should be globally enabled. - * - * @return enableRules - */ - @javax.annotation.Nullable - public Boolean getEnableRules() { - return enableRules; - } - - public void setEnableRules(Boolean enableRules) { - this.enableRules = enableRules; - } - - public IndexSettings enablePersonalization(Boolean enablePersonalization) { - this.enablePersonalization = enablePersonalization; - return this; - } - - /** - * Enable the Personalization feature. - * - * @return enablePersonalization - */ - @javax.annotation.Nullable - public Boolean getEnablePersonalization() { - return enablePersonalization; - } - - public void setEnablePersonalization(Boolean enablePersonalization) { - this.enablePersonalization = enablePersonalization; - } - - public IndexSettings queryType(QueryTypeEnum queryType) { - this.queryType = queryType; - return this; - } - - /** - * Controls if and how query words are interpreted as prefixes. - * - * @return queryType - */ - @javax.annotation.Nullable - public QueryTypeEnum getQueryType() { - return queryType; - } - - public void setQueryType(QueryTypeEnum queryType) { - this.queryType = queryType; - } - - public IndexSettings removeWordsIfNoResults( - RemoveWordsIfNoResultsEnum removeWordsIfNoResults - ) { - this.removeWordsIfNoResults = removeWordsIfNoResults; - return this; - } - - /** - * Selects a strategy to remove words from the query when it doesn't match any hits. - * - * @return removeWordsIfNoResults - */ - @javax.annotation.Nullable - public RemoveWordsIfNoResultsEnum getRemoveWordsIfNoResults() { - return removeWordsIfNoResults; - } - - public void setRemoveWordsIfNoResults( - RemoveWordsIfNoResultsEnum removeWordsIfNoResults - ) { - this.removeWordsIfNoResults = removeWordsIfNoResults; - } - - public IndexSettings advancedSyntax(Boolean advancedSyntax) { - this.advancedSyntax = advancedSyntax; - return this; - } - - /** - * Enables the advanced query syntax. - * - * @return advancedSyntax - */ - @javax.annotation.Nullable - public Boolean getAdvancedSyntax() { - return advancedSyntax; - } - - public void setAdvancedSyntax(Boolean advancedSyntax) { - this.advancedSyntax = advancedSyntax; - } - - public IndexSettings optionalWords(List optionalWords) { - this.optionalWords = optionalWords; - return this; - } - - public IndexSettings addOptionalWordsItem(String optionalWordsItem) { - if (this.optionalWords == null) { - this.optionalWords = new ArrayList<>(); - } - this.optionalWords.add(optionalWordsItem); - return this; - } - - /** - * A list of words that should be considered as optional when found in the query. - * - * @return optionalWords - */ - @javax.annotation.Nullable - public List getOptionalWords() { - return optionalWords; - } - - public void setOptionalWords(List optionalWords) { - this.optionalWords = optionalWords; - } - - public IndexSettings disableExactOnAttributes( - List disableExactOnAttributes - ) { - this.disableExactOnAttributes = disableExactOnAttributes; - return this; - } - - public IndexSettings addDisableExactOnAttributesItem( - String disableExactOnAttributesItem - ) { - if (this.disableExactOnAttributes == null) { - this.disableExactOnAttributes = new ArrayList<>(); - } - this.disableExactOnAttributes.add(disableExactOnAttributesItem); - return this; - } - - /** - * List of attributes on which you want to disable the exact ranking criterion. - * - * @return disableExactOnAttributes - */ - @javax.annotation.Nullable - public List getDisableExactOnAttributes() { - return disableExactOnAttributes; - } - - public void setDisableExactOnAttributes( - List disableExactOnAttributes - ) { - this.disableExactOnAttributes = disableExactOnAttributes; - } - - public IndexSettings exactOnSingleWordQuery( - ExactOnSingleWordQueryEnum exactOnSingleWordQuery - ) { - this.exactOnSingleWordQuery = exactOnSingleWordQuery; - return this; - } - - /** - * Controls how the exact ranking criterion is computed when the query contains only one word. - * - * @return exactOnSingleWordQuery - */ - @javax.annotation.Nullable - public ExactOnSingleWordQueryEnum getExactOnSingleWordQuery() { - return exactOnSingleWordQuery; - } - - public void setExactOnSingleWordQuery( - ExactOnSingleWordQueryEnum exactOnSingleWordQuery - ) { - this.exactOnSingleWordQuery = exactOnSingleWordQuery; - } - - public IndexSettings alternativesAsExact( - List alternativesAsExact - ) { - this.alternativesAsExact = alternativesAsExact; - return this; - } - - public IndexSettings addAlternativesAsExactItem( - AlternativesAsExactEnum alternativesAsExactItem - ) { - if (this.alternativesAsExact == null) { - this.alternativesAsExact = new ArrayList<>(); - } - this.alternativesAsExact.add(alternativesAsExactItem); - return this; - } - - /** - * List of alternatives that should be considered an exact match by the exact ranking criterion. - * - * @return alternativesAsExact - */ - @javax.annotation.Nullable - public List getAlternativesAsExact() { - return alternativesAsExact; - } - - public void setAlternativesAsExact( - List alternativesAsExact - ) { - this.alternativesAsExact = alternativesAsExact; - } - - public IndexSettings advancedSyntaxFeatures( - List advancedSyntaxFeatures - ) { - this.advancedSyntaxFeatures = advancedSyntaxFeatures; - return this; - } - - public IndexSettings addAdvancedSyntaxFeaturesItem( - AdvancedSyntaxFeaturesEnum advancedSyntaxFeaturesItem - ) { - if (this.advancedSyntaxFeatures == null) { - this.advancedSyntaxFeatures = new ArrayList<>(); - } - this.advancedSyntaxFeatures.add(advancedSyntaxFeaturesItem); - return this; - } - - /** - * Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is - * enabled. - * - * @return advancedSyntaxFeatures - */ - @javax.annotation.Nullable - public List getAdvancedSyntaxFeatures() { - return advancedSyntaxFeatures; - } - - public void setAdvancedSyntaxFeatures( - List advancedSyntaxFeatures - ) { - this.advancedSyntaxFeatures = advancedSyntaxFeatures; - } - - public IndexSettings distinct(Integer distinct) { - this.distinct = distinct; - return this; - } - - /** - * Enables de-duplication or grouping of results. minimum: 0 maximum: 4 - * - * @return distinct - */ - @javax.annotation.Nullable - public Integer getDistinct() { - return distinct; - } - - public void setDistinct(Integer distinct) { - this.distinct = distinct; - } - - public IndexSettings synonyms(Boolean synonyms) { - this.synonyms = synonyms; - return this; - } - - /** - * Whether to take into account an index's synonyms for a particular search. - * - * @return synonyms - */ - @javax.annotation.Nullable - public Boolean getSynonyms() { - return synonyms; - } - - public void setSynonyms(Boolean synonyms) { - this.synonyms = synonyms; - } - - public IndexSettings replaceSynonymsInHighlight( - Boolean replaceSynonymsInHighlight - ) { - this.replaceSynonymsInHighlight = replaceSynonymsInHighlight; - return this; - } - - /** - * Whether to highlight and snippet the original word that matches the synonym or the synonym - * itself. - * - * @return replaceSynonymsInHighlight - */ - @javax.annotation.Nullable - public Boolean getReplaceSynonymsInHighlight() { - return replaceSynonymsInHighlight; - } - - public void setReplaceSynonymsInHighlight( - Boolean replaceSynonymsInHighlight - ) { - this.replaceSynonymsInHighlight = replaceSynonymsInHighlight; - } - - public IndexSettings minProximity(Integer minProximity) { - this.minProximity = minProximity; - return this; - } - - /** - * Precision of the proximity ranking criterion. minimum: 1 maximum: 7 - * - * @return minProximity - */ - @javax.annotation.Nullable - public Integer getMinProximity() { - return minProximity; - } - - public void setMinProximity(Integer minProximity) { - this.minProximity = minProximity; - } - - public IndexSettings responseFields(List responseFields) { - this.responseFields = responseFields; - return this; - } - - public IndexSettings addResponseFieldsItem(String responseFieldsItem) { - if (this.responseFields == null) { - this.responseFields = new ArrayList<>(); - } - this.responseFields.add(responseFieldsItem); - return this; - } - - /** - * Choose which fields to return in the API response. This parameters applies to search and browse - * queries. - * - * @return responseFields - */ - @javax.annotation.Nullable - public List getResponseFields() { - return responseFields; - } - - public void setResponseFields(List responseFields) { - this.responseFields = responseFields; - } - - public IndexSettings maxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * Maximum number of facet hits to return during a search for facet values. For performance - * reasons, the maximum allowed number of returned values is 100. maximum: 100 - * - * @return maxFacetHits - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - - public void setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - } - - public IndexSettings attributeCriteriaComputedByMinProximity( - Boolean attributeCriteriaComputedByMinProximity - ) { - this.attributeCriteriaComputedByMinProximity = - attributeCriteriaComputedByMinProximity; - return this; - } - - /** - * When attribute is ranked above proximity in your ranking formula, proximity is used to select - * which searchable attribute is matched in the attribute ranking stage. - * - * @return attributeCriteriaComputedByMinProximity - */ - @javax.annotation.Nullable - public Boolean getAttributeCriteriaComputedByMinProximity() { - return attributeCriteriaComputedByMinProximity; - } - - public void setAttributeCriteriaComputedByMinProximity( - Boolean attributeCriteriaComputedByMinProximity - ) { - this.attributeCriteriaComputedByMinProximity = - attributeCriteriaComputedByMinProximity; - } - - public IndexSettings renderingContent(Object renderingContent) { - this.renderingContent = renderingContent; - return this; - } - - /** - * Content defining how the search interface should be rendered. Can be set via the settings for a - * default value and can be overridden via rules. - * - * @return renderingContent - */ - @javax.annotation.Nullable - public Object getRenderingContent() { - return renderingContent; - } - - public void setRenderingContent(Object renderingContent) { - this.renderingContent = renderingContent; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IndexSettings indexSettings = (IndexSettings) o; - return ( - Objects.equals(this.replicas, indexSettings.replicas) && - Objects.equals( - this.paginationLimitedTo, - indexSettings.paginationLimitedTo - ) && - Objects.equals( - this.disableTypoToleranceOnWords, - indexSettings.disableTypoToleranceOnWords - ) && - Objects.equals( - this.attributesToTransliterate, - indexSettings.attributesToTransliterate - ) && - Objects.equals( - this.camelCaseAttributes, - indexSettings.camelCaseAttributes - ) && - Objects.equals( - this.decompoundedAttributes, - indexSettings.decompoundedAttributes - ) && - Objects.equals(this.indexLanguages, indexSettings.indexLanguages) && - Objects.equals(this.filterPromotes, indexSettings.filterPromotes) && - Objects.equals( - this.disablePrefixOnAttributes, - indexSettings.disablePrefixOnAttributes - ) && - Objects.equals( - this.allowCompressionOfIntegerArray, - indexSettings.allowCompressionOfIntegerArray - ) && - Objects.equals( - this.numericAttributesForFiltering, - indexSettings.numericAttributesForFiltering - ) && - Objects.equals(this.userData, indexSettings.userData) && - Objects.equals( - this.searchableAttributes, - indexSettings.searchableAttributes - ) && - Objects.equals( - this.attributesForFaceting, - indexSettings.attributesForFaceting - ) && - Objects.equals( - this.unretrievableAttributes, - indexSettings.unretrievableAttributes - ) && - Objects.equals( - this.attributesToRetrieve, - indexSettings.attributesToRetrieve - ) && - Objects.equals( - this.restrictSearchableAttributes, - indexSettings.restrictSearchableAttributes - ) && - Objects.equals(this.ranking, indexSettings.ranking) && - Objects.equals(this.customRanking, indexSettings.customRanking) && - Objects.equals( - this.relevancyStrictness, - indexSettings.relevancyStrictness - ) && - Objects.equals( - this.attributesToHighlight, - indexSettings.attributesToHighlight - ) && - Objects.equals( - this.attributesToSnippet, - indexSettings.attributesToSnippet - ) && - Objects.equals(this.highlightPreTag, indexSettings.highlightPreTag) && - Objects.equals(this.highlightPostTag, indexSettings.highlightPostTag) && - Objects.equals( - this.snippetEllipsisText, - indexSettings.snippetEllipsisText - ) && - Objects.equals( - this.restrictHighlightAndSnippetArrays, - indexSettings.restrictHighlightAndSnippetArrays - ) && - Objects.equals(this.hitsPerPage, indexSettings.hitsPerPage) && - Objects.equals( - this.minWordSizefor1Typo, - indexSettings.minWordSizefor1Typo - ) && - Objects.equals( - this.minWordSizefor2Typos, - indexSettings.minWordSizefor2Typos - ) && - Objects.equals(this.typoTolerance, indexSettings.typoTolerance) && - Objects.equals( - this.allowTyposOnNumericTokens, - indexSettings.allowTyposOnNumericTokens - ) && - Objects.equals( - this.disableTypoToleranceOnAttributes, - indexSettings.disableTypoToleranceOnAttributes - ) && - Objects.equals(this.separatorsToIndex, indexSettings.separatorsToIndex) && - Objects.equals(this.ignorePlurals, indexSettings.ignorePlurals) && - Objects.equals(this.removeStopWords, indexSettings.removeStopWords) && - Objects.equals( - this.keepDiacriticsOnCharacters, - indexSettings.keepDiacriticsOnCharacters - ) && - Objects.equals(this.queryLanguages, indexSettings.queryLanguages) && - Objects.equals(this.decompoundQuery, indexSettings.decompoundQuery) && - Objects.equals(this.enableRules, indexSettings.enableRules) && - Objects.equals( - this.enablePersonalization, - indexSettings.enablePersonalization - ) && - Objects.equals(this.queryType, indexSettings.queryType) && - Objects.equals( - this.removeWordsIfNoResults, - indexSettings.removeWordsIfNoResults - ) && - Objects.equals(this.advancedSyntax, indexSettings.advancedSyntax) && - Objects.equals(this.optionalWords, indexSettings.optionalWords) && - Objects.equals( - this.disableExactOnAttributes, - indexSettings.disableExactOnAttributes - ) && - Objects.equals( - this.exactOnSingleWordQuery, - indexSettings.exactOnSingleWordQuery - ) && - Objects.equals( - this.alternativesAsExact, - indexSettings.alternativesAsExact - ) && - Objects.equals( - this.advancedSyntaxFeatures, - indexSettings.advancedSyntaxFeatures - ) && - Objects.equals(this.distinct, indexSettings.distinct) && - Objects.equals(this.synonyms, indexSettings.synonyms) && - Objects.equals( - this.replaceSynonymsInHighlight, - indexSettings.replaceSynonymsInHighlight - ) && - Objects.equals(this.minProximity, indexSettings.minProximity) && - Objects.equals(this.responseFields, indexSettings.responseFields) && - Objects.equals(this.maxFacetHits, indexSettings.maxFacetHits) && - Objects.equals( - this.attributeCriteriaComputedByMinProximity, - indexSettings.attributeCriteriaComputedByMinProximity - ) && - Objects.equals(this.renderingContent, indexSettings.renderingContent) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - replicas, - paginationLimitedTo, - disableTypoToleranceOnWords, - attributesToTransliterate, - camelCaseAttributes, - decompoundedAttributes, - indexLanguages, - filterPromotes, - disablePrefixOnAttributes, - allowCompressionOfIntegerArray, - numericAttributesForFiltering, - userData, - searchableAttributes, - attributesForFaceting, - unretrievableAttributes, - attributesToRetrieve, - restrictSearchableAttributes, - ranking, - customRanking, - relevancyStrictness, - attributesToHighlight, - attributesToSnippet, - highlightPreTag, - highlightPostTag, - snippetEllipsisText, - restrictHighlightAndSnippetArrays, - hitsPerPage, - minWordSizefor1Typo, - minWordSizefor2Typos, - typoTolerance, - allowTyposOnNumericTokens, - disableTypoToleranceOnAttributes, - separatorsToIndex, - ignorePlurals, - removeStopWords, - keepDiacriticsOnCharacters, - queryLanguages, - decompoundQuery, - enableRules, - enablePersonalization, - queryType, - removeWordsIfNoResults, - advancedSyntax, - optionalWords, - disableExactOnAttributes, - exactOnSingleWordQuery, - alternativesAsExact, - advancedSyntaxFeatures, - distinct, - synonyms, - replaceSynonymsInHighlight, - minProximity, - responseFields, - maxFacetHits, - attributeCriteriaComputedByMinProximity, - renderingContent - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IndexSettings {\n"); - sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n"); - sb - .append(" paginationLimitedTo: ") - .append(toIndentedString(paginationLimitedTo)) - .append("\n"); - sb - .append(" disableTypoToleranceOnWords: ") - .append(toIndentedString(disableTypoToleranceOnWords)) - .append("\n"); - sb - .append(" attributesToTransliterate: ") - .append(toIndentedString(attributesToTransliterate)) - .append("\n"); - sb - .append(" camelCaseAttributes: ") - .append(toIndentedString(camelCaseAttributes)) - .append("\n"); - sb - .append(" decompoundedAttributes: ") - .append(toIndentedString(decompoundedAttributes)) - .append("\n"); - sb - .append(" indexLanguages: ") - .append(toIndentedString(indexLanguages)) - .append("\n"); - sb - .append(" filterPromotes: ") - .append(toIndentedString(filterPromotes)) - .append("\n"); - sb - .append(" disablePrefixOnAttributes: ") - .append(toIndentedString(disablePrefixOnAttributes)) - .append("\n"); - sb - .append(" allowCompressionOfIntegerArray: ") - .append(toIndentedString(allowCompressionOfIntegerArray)) - .append("\n"); - sb - .append(" numericAttributesForFiltering: ") - .append(toIndentedString(numericAttributesForFiltering)) - .append("\n"); - sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); - sb - .append(" searchableAttributes: ") - .append(toIndentedString(searchableAttributes)) - .append("\n"); - sb - .append(" attributesForFaceting: ") - .append(toIndentedString(attributesForFaceting)) - .append("\n"); - sb - .append(" unretrievableAttributes: ") - .append(toIndentedString(unretrievableAttributes)) - .append("\n"); - sb - .append(" attributesToRetrieve: ") - .append(toIndentedString(attributesToRetrieve)) - .append("\n"); - sb - .append(" restrictSearchableAttributes: ") - .append(toIndentedString(restrictSearchableAttributes)) - .append("\n"); - sb.append(" ranking: ").append(toIndentedString(ranking)).append("\n"); - sb - .append(" customRanking: ") - .append(toIndentedString(customRanking)) - .append("\n"); - sb - .append(" relevancyStrictness: ") - .append(toIndentedString(relevancyStrictness)) - .append("\n"); - sb - .append(" attributesToHighlight: ") - .append(toIndentedString(attributesToHighlight)) - .append("\n"); - sb - .append(" attributesToSnippet: ") - .append(toIndentedString(attributesToSnippet)) - .append("\n"); - sb - .append(" highlightPreTag: ") - .append(toIndentedString(highlightPreTag)) - .append("\n"); - sb - .append(" highlightPostTag: ") - .append(toIndentedString(highlightPostTag)) - .append("\n"); - sb - .append(" snippetEllipsisText: ") - .append(toIndentedString(snippetEllipsisText)) - .append("\n"); - sb - .append(" restrictHighlightAndSnippetArrays: ") - .append(toIndentedString(restrictHighlightAndSnippetArrays)) - .append("\n"); - sb - .append(" hitsPerPage: ") - .append(toIndentedString(hitsPerPage)) - .append("\n"); - sb - .append(" minWordSizefor1Typo: ") - .append(toIndentedString(minWordSizefor1Typo)) - .append("\n"); - sb - .append(" minWordSizefor2Typos: ") - .append(toIndentedString(minWordSizefor2Typos)) - .append("\n"); - sb - .append(" typoTolerance: ") - .append(toIndentedString(typoTolerance)) - .append("\n"); - sb - .append(" allowTyposOnNumericTokens: ") - .append(toIndentedString(allowTyposOnNumericTokens)) - .append("\n"); - sb - .append(" disableTypoToleranceOnAttributes: ") - .append(toIndentedString(disableTypoToleranceOnAttributes)) - .append("\n"); - sb - .append(" separatorsToIndex: ") - .append(toIndentedString(separatorsToIndex)) - .append("\n"); - sb - .append(" ignorePlurals: ") - .append(toIndentedString(ignorePlurals)) - .append("\n"); - sb - .append(" removeStopWords: ") - .append(toIndentedString(removeStopWords)) - .append("\n"); - sb - .append(" keepDiacriticsOnCharacters: ") - .append(toIndentedString(keepDiacriticsOnCharacters)) - .append("\n"); - sb - .append(" queryLanguages: ") - .append(toIndentedString(queryLanguages)) - .append("\n"); - sb - .append(" decompoundQuery: ") - .append(toIndentedString(decompoundQuery)) - .append("\n"); - sb - .append(" enableRules: ") - .append(toIndentedString(enableRules)) - .append("\n"); - sb - .append(" enablePersonalization: ") - .append(toIndentedString(enablePersonalization)) - .append("\n"); - sb - .append(" queryType: ") - .append(toIndentedString(queryType)) - .append("\n"); - sb - .append(" removeWordsIfNoResults: ") - .append(toIndentedString(removeWordsIfNoResults)) - .append("\n"); - sb - .append(" advancedSyntax: ") - .append(toIndentedString(advancedSyntax)) - .append("\n"); - sb - .append(" optionalWords: ") - .append(toIndentedString(optionalWords)) - .append("\n"); - sb - .append(" disableExactOnAttributes: ") - .append(toIndentedString(disableExactOnAttributes)) - .append("\n"); - sb - .append(" exactOnSingleWordQuery: ") - .append(toIndentedString(exactOnSingleWordQuery)) - .append("\n"); - sb - .append(" alternativesAsExact: ") - .append(toIndentedString(alternativesAsExact)) - .append("\n"); - sb - .append(" advancedSyntaxFeatures: ") - .append(toIndentedString(advancedSyntaxFeatures)) - .append("\n"); - sb.append(" distinct: ").append(toIndentedString(distinct)).append("\n"); - sb.append(" synonyms: ").append(toIndentedString(synonyms)).append("\n"); - sb - .append(" replaceSynonymsInHighlight: ") - .append(toIndentedString(replaceSynonymsInHighlight)) - .append("\n"); - sb - .append(" minProximity: ") - .append(toIndentedString(minProximity)) - .append("\n"); - sb - .append(" responseFields: ") - .append(toIndentedString(responseFields)) - .append("\n"); - sb - .append(" maxFacetHits: ") - .append(toIndentedString(maxFacetHits)) - .append("\n"); - sb - .append(" attributeCriteriaComputedByMinProximity: ") - .append(toIndentedString(attributeCriteriaComputedByMinProximity)) - .append("\n"); - sb - .append(" renderingContent: ") - .append(toIndentedString(renderingContent)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/IndexSettingsAsSearchParams.java b/algoliasearch-core/com/algolia/model/IndexSettingsAsSearchParams.java deleted file mode 100644 index b848b133e..000000000 --- a/algoliasearch-core/com/algolia/model/IndexSettingsAsSearchParams.java +++ /dev/null @@ -1,1960 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** IndexSettingsAsSearchParams */ -public class IndexSettingsAsSearchParams { - - @SerializedName("searchableAttributes") - private List searchableAttributes = null; - - @SerializedName("attributesForFaceting") - private List attributesForFaceting = null; - - @SerializedName("unretrievableAttributes") - private List unretrievableAttributes = null; - - @SerializedName("attributesToRetrieve") - private List attributesToRetrieve = null; - - @SerializedName("restrictSearchableAttributes") - private List restrictSearchableAttributes = null; - - @SerializedName("ranking") - private List ranking = null; - - @SerializedName("customRanking") - private List customRanking = null; - - @SerializedName("relevancyStrictness") - private Integer relevancyStrictness = 100; - - @SerializedName("attributesToHighlight") - private List attributesToHighlight = null; - - @SerializedName("attributesToSnippet") - private List attributesToSnippet = null; - - @SerializedName("highlightPreTag") - private String highlightPreTag = ""; - - @SerializedName("highlightPostTag") - private String highlightPostTag = ""; - - @SerializedName("snippetEllipsisText") - private String snippetEllipsisText = "…"; - - @SerializedName("restrictHighlightAndSnippetArrays") - private Boolean restrictHighlightAndSnippetArrays = false; - - @SerializedName("hitsPerPage") - private Integer hitsPerPage = 20; - - @SerializedName("minWordSizefor1Typo") - private Integer minWordSizefor1Typo = 4; - - @SerializedName("minWordSizefor2Typos") - private Integer minWordSizefor2Typos = 8; - - /** Controls whether typo tolerance is enabled and how it is applied. */ - @JsonAdapter(TypoToleranceEnum.Adapter.class) - public enum TypoToleranceEnum { - TRUE("true"), - - FALSE("false"), - - MIN("min"), - - STRICT("strict"); - - private String value; - - TypoToleranceEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypoToleranceEnum fromValue(String value) { - for (TypoToleranceEnum b : TypoToleranceEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final TypoToleranceEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypoToleranceEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return TypoToleranceEnum.fromValue(value); - } - } - } - - @SerializedName("typoTolerance") - private TypoToleranceEnum typoTolerance = TypoToleranceEnum.TRUE; - - @SerializedName("allowTyposOnNumericTokens") - private Boolean allowTyposOnNumericTokens = true; - - @SerializedName("disableTypoToleranceOnAttributes") - private List disableTypoToleranceOnAttributes = null; - - @SerializedName("separatorsToIndex") - private String separatorsToIndex = ""; - - @SerializedName("ignorePlurals") - private String ignorePlurals = "false"; - - @SerializedName("removeStopWords") - private String removeStopWords = "false"; - - @SerializedName("keepDiacriticsOnCharacters") - private String keepDiacriticsOnCharacters = ""; - - @SerializedName("queryLanguages") - private List queryLanguages = null; - - @SerializedName("decompoundQuery") - private Boolean decompoundQuery = true; - - @SerializedName("enableRules") - private Boolean enableRules = true; - - @SerializedName("enablePersonalization") - private Boolean enablePersonalization = false; - - /** Controls if and how query words are interpreted as prefixes. */ - @JsonAdapter(QueryTypeEnum.Adapter.class) - public enum QueryTypeEnum { - PREFIXLAST("prefixLast"), - - PREFIXALL("prefixAll"), - - PREFIXNONE("prefixNone"); - - private String value; - - QueryTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static QueryTypeEnum fromValue(String value) { - for (QueryTypeEnum b : QueryTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final QueryTypeEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public QueryTypeEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return QueryTypeEnum.fromValue(value); - } - } - } - - @SerializedName("queryType") - private QueryTypeEnum queryType = QueryTypeEnum.PREFIXLAST; - - /** Selects a strategy to remove words from the query when it doesn't match any hits. */ - @JsonAdapter(RemoveWordsIfNoResultsEnum.Adapter.class) - public enum RemoveWordsIfNoResultsEnum { - NONE("none"), - - LASTWORDS("lastWords"), - - FIRSTWORDS("firstWords"), - - ALLOPTIONAL("allOptional"); - - private String value; - - RemoveWordsIfNoResultsEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static RemoveWordsIfNoResultsEnum fromValue(String value) { - for (RemoveWordsIfNoResultsEnum b : RemoveWordsIfNoResultsEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final RemoveWordsIfNoResultsEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public RemoveWordsIfNoResultsEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return RemoveWordsIfNoResultsEnum.fromValue(value); - } - } - } - - @SerializedName("removeWordsIfNoResults") - private RemoveWordsIfNoResultsEnum removeWordsIfNoResults = - RemoveWordsIfNoResultsEnum.NONE; - - @SerializedName("advancedSyntax") - private Boolean advancedSyntax = false; - - @SerializedName("optionalWords") - private List optionalWords = null; - - @SerializedName("disableExactOnAttributes") - private List disableExactOnAttributes = null; - - /** Controls how the exact ranking criterion is computed when the query contains only one word. */ - @JsonAdapter(ExactOnSingleWordQueryEnum.Adapter.class) - public enum ExactOnSingleWordQueryEnum { - ATTRIBUTE("attribute"), - - NONE("none"), - - WORD("word"); - - private String value; - - ExactOnSingleWordQueryEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ExactOnSingleWordQueryEnum fromValue(String value) { - for (ExactOnSingleWordQueryEnum b : ExactOnSingleWordQueryEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final ExactOnSingleWordQueryEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ExactOnSingleWordQueryEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return ExactOnSingleWordQueryEnum.fromValue(value); - } - } - } - - @SerializedName("exactOnSingleWordQuery") - private ExactOnSingleWordQueryEnum exactOnSingleWordQuery = - ExactOnSingleWordQueryEnum.ATTRIBUTE; - - /** Gets or Sets alternativesAsExact */ - @JsonAdapter(AlternativesAsExactEnum.Adapter.class) - public enum AlternativesAsExactEnum { - IGNOREPLURALS("ignorePlurals"), - - SINGLEWORDSYNONYM("singleWordSynonym"), - - MULTIWORDSSYNONYM("multiWordsSynonym"); - - private String value; - - AlternativesAsExactEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AlternativesAsExactEnum fromValue(String value) { - for (AlternativesAsExactEnum b : AlternativesAsExactEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final AlternativesAsExactEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AlternativesAsExactEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return AlternativesAsExactEnum.fromValue(value); - } - } - } - - @SerializedName("alternativesAsExact") - private List alternativesAsExact = null; - - /** Gets or Sets advancedSyntaxFeatures */ - @JsonAdapter(AdvancedSyntaxFeaturesEnum.Adapter.class) - public enum AdvancedSyntaxFeaturesEnum { - EXACTPHRASE("exactPhrase"), - - EXCLUDEWORDS("excludeWords"); - - private String value; - - AdvancedSyntaxFeaturesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AdvancedSyntaxFeaturesEnum fromValue(String value) { - for (AdvancedSyntaxFeaturesEnum b : AdvancedSyntaxFeaturesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final AdvancedSyntaxFeaturesEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AdvancedSyntaxFeaturesEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return AdvancedSyntaxFeaturesEnum.fromValue(value); - } - } - } - - @SerializedName("advancedSyntaxFeatures") - private List advancedSyntaxFeatures = null; - - @SerializedName("distinct") - private Integer distinct = 0; - - @SerializedName("synonyms") - private Boolean synonyms = true; - - @SerializedName("replaceSynonymsInHighlight") - private Boolean replaceSynonymsInHighlight = false; - - @SerializedName("minProximity") - private Integer minProximity = 1; - - @SerializedName("responseFields") - private List responseFields = null; - - @SerializedName("maxFacetHits") - private Integer maxFacetHits = 10; - - @SerializedName("attributeCriteriaComputedByMinProximity") - private Boolean attributeCriteriaComputedByMinProximity = false; - - @SerializedName("renderingContent") - private Object renderingContent = new Object(); - - public IndexSettingsAsSearchParams searchableAttributes( - List searchableAttributes - ) { - this.searchableAttributes = searchableAttributes; - return this; - } - - public IndexSettingsAsSearchParams addSearchableAttributesItem( - String searchableAttributesItem - ) { - if (this.searchableAttributes == null) { - this.searchableAttributes = new ArrayList<>(); - } - this.searchableAttributes.add(searchableAttributesItem); - return this; - } - - /** - * The complete list of attributes used for searching. - * - * @return searchableAttributes - */ - @javax.annotation.Nullable - public List getSearchableAttributes() { - return searchableAttributes; - } - - public void setSearchableAttributes(List searchableAttributes) { - this.searchableAttributes = searchableAttributes; - } - - public IndexSettingsAsSearchParams attributesForFaceting( - List attributesForFaceting - ) { - this.attributesForFaceting = attributesForFaceting; - return this; - } - - public IndexSettingsAsSearchParams addAttributesForFacetingItem( - String attributesForFacetingItem - ) { - if (this.attributesForFaceting == null) { - this.attributesForFaceting = new ArrayList<>(); - } - this.attributesForFaceting.add(attributesForFacetingItem); - return this; - } - - /** - * The complete list of attributes that will be used for faceting. - * - * @return attributesForFaceting - */ - @javax.annotation.Nullable - public List getAttributesForFaceting() { - return attributesForFaceting; - } - - public void setAttributesForFaceting(List attributesForFaceting) { - this.attributesForFaceting = attributesForFaceting; - } - - public IndexSettingsAsSearchParams unretrievableAttributes( - List unretrievableAttributes - ) { - this.unretrievableAttributes = unretrievableAttributes; - return this; - } - - public IndexSettingsAsSearchParams addUnretrievableAttributesItem( - String unretrievableAttributesItem - ) { - if (this.unretrievableAttributes == null) { - this.unretrievableAttributes = new ArrayList<>(); - } - this.unretrievableAttributes.add(unretrievableAttributesItem); - return this; - } - - /** - * List of attributes that can't be retrieved at query time. - * - * @return unretrievableAttributes - */ - @javax.annotation.Nullable - public List getUnretrievableAttributes() { - return unretrievableAttributes; - } - - public void setUnretrievableAttributes(List unretrievableAttributes) { - this.unretrievableAttributes = unretrievableAttributes; - } - - public IndexSettingsAsSearchParams attributesToRetrieve( - List attributesToRetrieve - ) { - this.attributesToRetrieve = attributesToRetrieve; - return this; - } - - public IndexSettingsAsSearchParams addAttributesToRetrieveItem( - String attributesToRetrieveItem - ) { - if (this.attributesToRetrieve == null) { - this.attributesToRetrieve = new ArrayList<>(); - } - this.attributesToRetrieve.add(attributesToRetrieveItem); - return this; - } - - /** - * This parameter controls which attributes to retrieve and which not to retrieve. - * - * @return attributesToRetrieve - */ - @javax.annotation.Nullable - public List getAttributesToRetrieve() { - return attributesToRetrieve; - } - - public void setAttributesToRetrieve(List attributesToRetrieve) { - this.attributesToRetrieve = attributesToRetrieve; - } - - public IndexSettingsAsSearchParams restrictSearchableAttributes( - List restrictSearchableAttributes - ) { - this.restrictSearchableAttributes = restrictSearchableAttributes; - return this; - } - - public IndexSettingsAsSearchParams addRestrictSearchableAttributesItem( - String restrictSearchableAttributesItem - ) { - if (this.restrictSearchableAttributes == null) { - this.restrictSearchableAttributes = new ArrayList<>(); - } - this.restrictSearchableAttributes.add(restrictSearchableAttributesItem); - return this; - } - - /** - * Restricts a given query to look in only a subset of your searchable attributes. - * - * @return restrictSearchableAttributes - */ - @javax.annotation.Nullable - public List getRestrictSearchableAttributes() { - return restrictSearchableAttributes; - } - - public void setRestrictSearchableAttributes( - List restrictSearchableAttributes - ) { - this.restrictSearchableAttributes = restrictSearchableAttributes; - } - - public IndexSettingsAsSearchParams ranking(List ranking) { - this.ranking = ranking; - return this; - } - - public IndexSettingsAsSearchParams addRankingItem(String rankingItem) { - if (this.ranking == null) { - this.ranking = new ArrayList<>(); - } - this.ranking.add(rankingItem); - return this; - } - - /** - * Controls how Algolia should sort your results. - * - * @return ranking - */ - @javax.annotation.Nullable - public List getRanking() { - return ranking; - } - - public void setRanking(List ranking) { - this.ranking = ranking; - } - - public IndexSettingsAsSearchParams customRanking(List customRanking) { - this.customRanking = customRanking; - return this; - } - - public IndexSettingsAsSearchParams addCustomRankingItem( - String customRankingItem - ) { - if (this.customRanking == null) { - this.customRanking = new ArrayList<>(); - } - this.customRanking.add(customRankingItem); - return this; - } - - /** - * Specifies the custom ranking criterion. - * - * @return customRanking - */ - @javax.annotation.Nullable - public List getCustomRanking() { - return customRanking; - } - - public void setCustomRanking(List customRanking) { - this.customRanking = customRanking; - } - - public IndexSettingsAsSearchParams relevancyStrictness( - Integer relevancyStrictness - ) { - this.relevancyStrictness = relevancyStrictness; - return this; - } - - /** - * Controls the relevancy threshold below which less relevant results aren't included in the - * results. - * - * @return relevancyStrictness - */ - @javax.annotation.Nullable - public Integer getRelevancyStrictness() { - return relevancyStrictness; - } - - public void setRelevancyStrictness(Integer relevancyStrictness) { - this.relevancyStrictness = relevancyStrictness; - } - - public IndexSettingsAsSearchParams attributesToHighlight( - List attributesToHighlight - ) { - this.attributesToHighlight = attributesToHighlight; - return this; - } - - public IndexSettingsAsSearchParams addAttributesToHighlightItem( - String attributesToHighlightItem - ) { - if (this.attributesToHighlight == null) { - this.attributesToHighlight = new ArrayList<>(); - } - this.attributesToHighlight.add(attributesToHighlightItem); - return this; - } - - /** - * List of attributes to highlight. - * - * @return attributesToHighlight - */ - @javax.annotation.Nullable - public List getAttributesToHighlight() { - return attributesToHighlight; - } - - public void setAttributesToHighlight(List attributesToHighlight) { - this.attributesToHighlight = attributesToHighlight; - } - - public IndexSettingsAsSearchParams attributesToSnippet( - List attributesToSnippet - ) { - this.attributesToSnippet = attributesToSnippet; - return this; - } - - public IndexSettingsAsSearchParams addAttributesToSnippetItem( - String attributesToSnippetItem - ) { - if (this.attributesToSnippet == null) { - this.attributesToSnippet = new ArrayList<>(); - } - this.attributesToSnippet.add(attributesToSnippetItem); - return this; - } - - /** - * List of attributes to snippet, with an optional maximum number of words to snippet. - * - * @return attributesToSnippet - */ - @javax.annotation.Nullable - public List getAttributesToSnippet() { - return attributesToSnippet; - } - - public void setAttributesToSnippet(List attributesToSnippet) { - this.attributesToSnippet = attributesToSnippet; - } - - public IndexSettingsAsSearchParams highlightPreTag(String highlightPreTag) { - this.highlightPreTag = highlightPreTag; - return this; - } - - /** - * The HTML string to insert before the highlighted parts in all highlight and snippet results. - * - * @return highlightPreTag - */ - @javax.annotation.Nullable - public String getHighlightPreTag() { - return highlightPreTag; - } - - public void setHighlightPreTag(String highlightPreTag) { - this.highlightPreTag = highlightPreTag; - } - - public IndexSettingsAsSearchParams highlightPostTag(String highlightPostTag) { - this.highlightPostTag = highlightPostTag; - return this; - } - - /** - * The HTML string to insert after the highlighted parts in all highlight and snippet results. - * - * @return highlightPostTag - */ - @javax.annotation.Nullable - public String getHighlightPostTag() { - return highlightPostTag; - } - - public void setHighlightPostTag(String highlightPostTag) { - this.highlightPostTag = highlightPostTag; - } - - public IndexSettingsAsSearchParams snippetEllipsisText( - String snippetEllipsisText - ) { - this.snippetEllipsisText = snippetEllipsisText; - return this; - } - - /** - * String used as an ellipsis indicator when a snippet is truncated. - * - * @return snippetEllipsisText - */ - @javax.annotation.Nullable - public String getSnippetEllipsisText() { - return snippetEllipsisText; - } - - public void setSnippetEllipsisText(String snippetEllipsisText) { - this.snippetEllipsisText = snippetEllipsisText; - } - - public IndexSettingsAsSearchParams restrictHighlightAndSnippetArrays( - Boolean restrictHighlightAndSnippetArrays - ) { - this.restrictHighlightAndSnippetArrays = restrictHighlightAndSnippetArrays; - return this; - } - - /** - * Restrict highlighting and snippeting to items that matched the query. - * - * @return restrictHighlightAndSnippetArrays - */ - @javax.annotation.Nullable - public Boolean getRestrictHighlightAndSnippetArrays() { - return restrictHighlightAndSnippetArrays; - } - - public void setRestrictHighlightAndSnippetArrays( - Boolean restrictHighlightAndSnippetArrays - ) { - this.restrictHighlightAndSnippetArrays = restrictHighlightAndSnippetArrays; - } - - public IndexSettingsAsSearchParams hitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - return this; - } - - /** - * Set the number of hits per page. - * - * @return hitsPerPage - */ - @javax.annotation.Nullable - public Integer getHitsPerPage() { - return hitsPerPage; - } - - public void setHitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - } - - public IndexSettingsAsSearchParams minWordSizefor1Typo( - Integer minWordSizefor1Typo - ) { - this.minWordSizefor1Typo = minWordSizefor1Typo; - return this; - } - - /** - * Minimum number of characters a word in the query string must contain to accept matches with 1 - * typo. - * - * @return minWordSizefor1Typo - */ - @javax.annotation.Nullable - public Integer getMinWordSizefor1Typo() { - return minWordSizefor1Typo; - } - - public void setMinWordSizefor1Typo(Integer minWordSizefor1Typo) { - this.minWordSizefor1Typo = minWordSizefor1Typo; - } - - public IndexSettingsAsSearchParams minWordSizefor2Typos( - Integer minWordSizefor2Typos - ) { - this.minWordSizefor2Typos = minWordSizefor2Typos; - return this; - } - - /** - * Minimum number of characters a word in the query string must contain to accept matches with 2 - * typos. - * - * @return minWordSizefor2Typos - */ - @javax.annotation.Nullable - public Integer getMinWordSizefor2Typos() { - return minWordSizefor2Typos; - } - - public void setMinWordSizefor2Typos(Integer minWordSizefor2Typos) { - this.minWordSizefor2Typos = minWordSizefor2Typos; - } - - public IndexSettingsAsSearchParams typoTolerance( - TypoToleranceEnum typoTolerance - ) { - this.typoTolerance = typoTolerance; - return this; - } - - /** - * Controls whether typo tolerance is enabled and how it is applied. - * - * @return typoTolerance - */ - @javax.annotation.Nullable - public TypoToleranceEnum getTypoTolerance() { - return typoTolerance; - } - - public void setTypoTolerance(TypoToleranceEnum typoTolerance) { - this.typoTolerance = typoTolerance; - } - - public IndexSettingsAsSearchParams allowTyposOnNumericTokens( - Boolean allowTyposOnNumericTokens - ) { - this.allowTyposOnNumericTokens = allowTyposOnNumericTokens; - return this; - } - - /** - * Whether to allow typos on numbers (\"numeric tokens\") in the query string. - * - * @return allowTyposOnNumericTokens - */ - @javax.annotation.Nullable - public Boolean getAllowTyposOnNumericTokens() { - return allowTyposOnNumericTokens; - } - - public void setAllowTyposOnNumericTokens(Boolean allowTyposOnNumericTokens) { - this.allowTyposOnNumericTokens = allowTyposOnNumericTokens; - } - - public IndexSettingsAsSearchParams disableTypoToleranceOnAttributes( - List disableTypoToleranceOnAttributes - ) { - this.disableTypoToleranceOnAttributes = disableTypoToleranceOnAttributes; - return this; - } - - public IndexSettingsAsSearchParams addDisableTypoToleranceOnAttributesItem( - String disableTypoToleranceOnAttributesItem - ) { - if (this.disableTypoToleranceOnAttributes == null) { - this.disableTypoToleranceOnAttributes = new ArrayList<>(); - } - this.disableTypoToleranceOnAttributes.add( - disableTypoToleranceOnAttributesItem - ); - return this; - } - - /** - * List of attributes on which you want to disable typo tolerance. - * - * @return disableTypoToleranceOnAttributes - */ - @javax.annotation.Nullable - public List getDisableTypoToleranceOnAttributes() { - return disableTypoToleranceOnAttributes; - } - - public void setDisableTypoToleranceOnAttributes( - List disableTypoToleranceOnAttributes - ) { - this.disableTypoToleranceOnAttributes = disableTypoToleranceOnAttributes; - } - - public IndexSettingsAsSearchParams separatorsToIndex( - String separatorsToIndex - ) { - this.separatorsToIndex = separatorsToIndex; - return this; - } - - /** - * Control which separators are indexed. - * - * @return separatorsToIndex - */ - @javax.annotation.Nullable - public String getSeparatorsToIndex() { - return separatorsToIndex; - } - - public void setSeparatorsToIndex(String separatorsToIndex) { - this.separatorsToIndex = separatorsToIndex; - } - - public IndexSettingsAsSearchParams ignorePlurals(String ignorePlurals) { - this.ignorePlurals = ignorePlurals; - return this; - } - - /** - * Treats singular, plurals, and other forms of declensions as matching terms. - * - * @return ignorePlurals - */ - @javax.annotation.Nullable - public String getIgnorePlurals() { - return ignorePlurals; - } - - public void setIgnorePlurals(String ignorePlurals) { - this.ignorePlurals = ignorePlurals; - } - - public IndexSettingsAsSearchParams removeStopWords(String removeStopWords) { - this.removeStopWords = removeStopWords; - return this; - } - - /** - * Removes stop (common) words from the query before executing it. - * - * @return removeStopWords - */ - @javax.annotation.Nullable - public String getRemoveStopWords() { - return removeStopWords; - } - - public void setRemoveStopWords(String removeStopWords) { - this.removeStopWords = removeStopWords; - } - - public IndexSettingsAsSearchParams keepDiacriticsOnCharacters( - String keepDiacriticsOnCharacters - ) { - this.keepDiacriticsOnCharacters = keepDiacriticsOnCharacters; - return this; - } - - /** - * List of characters that the engine shouldn't automatically normalize. - * - * @return keepDiacriticsOnCharacters - */ - @javax.annotation.Nullable - public String getKeepDiacriticsOnCharacters() { - return keepDiacriticsOnCharacters; - } - - public void setKeepDiacriticsOnCharacters(String keepDiacriticsOnCharacters) { - this.keepDiacriticsOnCharacters = keepDiacriticsOnCharacters; - } - - public IndexSettingsAsSearchParams queryLanguages( - List queryLanguages - ) { - this.queryLanguages = queryLanguages; - return this; - } - - public IndexSettingsAsSearchParams addQueryLanguagesItem( - String queryLanguagesItem - ) { - if (this.queryLanguages == null) { - this.queryLanguages = new ArrayList<>(); - } - this.queryLanguages.add(queryLanguagesItem); - return this; - } - - /** - * Sets the languages to be used by language-specific settings and functionalities such as - * ignorePlurals, removeStopWords, and CJK word-detection. - * - * @return queryLanguages - */ - @javax.annotation.Nullable - public List getQueryLanguages() { - return queryLanguages; - } - - public void setQueryLanguages(List queryLanguages) { - this.queryLanguages = queryLanguages; - } - - public IndexSettingsAsSearchParams decompoundQuery(Boolean decompoundQuery) { - this.decompoundQuery = decompoundQuery; - return this; - } - - /** - * Splits compound words into their composing atoms in the query. - * - * @return decompoundQuery - */ - @javax.annotation.Nullable - public Boolean getDecompoundQuery() { - return decompoundQuery; - } - - public void setDecompoundQuery(Boolean decompoundQuery) { - this.decompoundQuery = decompoundQuery; - } - - public IndexSettingsAsSearchParams enableRules(Boolean enableRules) { - this.enableRules = enableRules; - return this; - } - - /** - * Whether Rules should be globally enabled. - * - * @return enableRules - */ - @javax.annotation.Nullable - public Boolean getEnableRules() { - return enableRules; - } - - public void setEnableRules(Boolean enableRules) { - this.enableRules = enableRules; - } - - public IndexSettingsAsSearchParams enablePersonalization( - Boolean enablePersonalization - ) { - this.enablePersonalization = enablePersonalization; - return this; - } - - /** - * Enable the Personalization feature. - * - * @return enablePersonalization - */ - @javax.annotation.Nullable - public Boolean getEnablePersonalization() { - return enablePersonalization; - } - - public void setEnablePersonalization(Boolean enablePersonalization) { - this.enablePersonalization = enablePersonalization; - } - - public IndexSettingsAsSearchParams queryType(QueryTypeEnum queryType) { - this.queryType = queryType; - return this; - } - - /** - * Controls if and how query words are interpreted as prefixes. - * - * @return queryType - */ - @javax.annotation.Nullable - public QueryTypeEnum getQueryType() { - return queryType; - } - - public void setQueryType(QueryTypeEnum queryType) { - this.queryType = queryType; - } - - public IndexSettingsAsSearchParams removeWordsIfNoResults( - RemoveWordsIfNoResultsEnum removeWordsIfNoResults - ) { - this.removeWordsIfNoResults = removeWordsIfNoResults; - return this; - } - - /** - * Selects a strategy to remove words from the query when it doesn't match any hits. - * - * @return removeWordsIfNoResults - */ - @javax.annotation.Nullable - public RemoveWordsIfNoResultsEnum getRemoveWordsIfNoResults() { - return removeWordsIfNoResults; - } - - public void setRemoveWordsIfNoResults( - RemoveWordsIfNoResultsEnum removeWordsIfNoResults - ) { - this.removeWordsIfNoResults = removeWordsIfNoResults; - } - - public IndexSettingsAsSearchParams advancedSyntax(Boolean advancedSyntax) { - this.advancedSyntax = advancedSyntax; - return this; - } - - /** - * Enables the advanced query syntax. - * - * @return advancedSyntax - */ - @javax.annotation.Nullable - public Boolean getAdvancedSyntax() { - return advancedSyntax; - } - - public void setAdvancedSyntax(Boolean advancedSyntax) { - this.advancedSyntax = advancedSyntax; - } - - public IndexSettingsAsSearchParams optionalWords(List optionalWords) { - this.optionalWords = optionalWords; - return this; - } - - public IndexSettingsAsSearchParams addOptionalWordsItem( - String optionalWordsItem - ) { - if (this.optionalWords == null) { - this.optionalWords = new ArrayList<>(); - } - this.optionalWords.add(optionalWordsItem); - return this; - } - - /** - * A list of words that should be considered as optional when found in the query. - * - * @return optionalWords - */ - @javax.annotation.Nullable - public List getOptionalWords() { - return optionalWords; - } - - public void setOptionalWords(List optionalWords) { - this.optionalWords = optionalWords; - } - - public IndexSettingsAsSearchParams disableExactOnAttributes( - List disableExactOnAttributes - ) { - this.disableExactOnAttributes = disableExactOnAttributes; - return this; - } - - public IndexSettingsAsSearchParams addDisableExactOnAttributesItem( - String disableExactOnAttributesItem - ) { - if (this.disableExactOnAttributes == null) { - this.disableExactOnAttributes = new ArrayList<>(); - } - this.disableExactOnAttributes.add(disableExactOnAttributesItem); - return this; - } - - /** - * List of attributes on which you want to disable the exact ranking criterion. - * - * @return disableExactOnAttributes - */ - @javax.annotation.Nullable - public List getDisableExactOnAttributes() { - return disableExactOnAttributes; - } - - public void setDisableExactOnAttributes( - List disableExactOnAttributes - ) { - this.disableExactOnAttributes = disableExactOnAttributes; - } - - public IndexSettingsAsSearchParams exactOnSingleWordQuery( - ExactOnSingleWordQueryEnum exactOnSingleWordQuery - ) { - this.exactOnSingleWordQuery = exactOnSingleWordQuery; - return this; - } - - /** - * Controls how the exact ranking criterion is computed when the query contains only one word. - * - * @return exactOnSingleWordQuery - */ - @javax.annotation.Nullable - public ExactOnSingleWordQueryEnum getExactOnSingleWordQuery() { - return exactOnSingleWordQuery; - } - - public void setExactOnSingleWordQuery( - ExactOnSingleWordQueryEnum exactOnSingleWordQuery - ) { - this.exactOnSingleWordQuery = exactOnSingleWordQuery; - } - - public IndexSettingsAsSearchParams alternativesAsExact( - List alternativesAsExact - ) { - this.alternativesAsExact = alternativesAsExact; - return this; - } - - public IndexSettingsAsSearchParams addAlternativesAsExactItem( - AlternativesAsExactEnum alternativesAsExactItem - ) { - if (this.alternativesAsExact == null) { - this.alternativesAsExact = new ArrayList<>(); - } - this.alternativesAsExact.add(alternativesAsExactItem); - return this; - } - - /** - * List of alternatives that should be considered an exact match by the exact ranking criterion. - * - * @return alternativesAsExact - */ - @javax.annotation.Nullable - public List getAlternativesAsExact() { - return alternativesAsExact; - } - - public void setAlternativesAsExact( - List alternativesAsExact - ) { - this.alternativesAsExact = alternativesAsExact; - } - - public IndexSettingsAsSearchParams advancedSyntaxFeatures( - List advancedSyntaxFeatures - ) { - this.advancedSyntaxFeatures = advancedSyntaxFeatures; - return this; - } - - public IndexSettingsAsSearchParams addAdvancedSyntaxFeaturesItem( - AdvancedSyntaxFeaturesEnum advancedSyntaxFeaturesItem - ) { - if (this.advancedSyntaxFeatures == null) { - this.advancedSyntaxFeatures = new ArrayList<>(); - } - this.advancedSyntaxFeatures.add(advancedSyntaxFeaturesItem); - return this; - } - - /** - * Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is - * enabled. - * - * @return advancedSyntaxFeatures - */ - @javax.annotation.Nullable - public List getAdvancedSyntaxFeatures() { - return advancedSyntaxFeatures; - } - - public void setAdvancedSyntaxFeatures( - List advancedSyntaxFeatures - ) { - this.advancedSyntaxFeatures = advancedSyntaxFeatures; - } - - public IndexSettingsAsSearchParams distinct(Integer distinct) { - this.distinct = distinct; - return this; - } - - /** - * Enables de-duplication or grouping of results. minimum: 0 maximum: 4 - * - * @return distinct - */ - @javax.annotation.Nullable - public Integer getDistinct() { - return distinct; - } - - public void setDistinct(Integer distinct) { - this.distinct = distinct; - } - - public IndexSettingsAsSearchParams synonyms(Boolean synonyms) { - this.synonyms = synonyms; - return this; - } - - /** - * Whether to take into account an index's synonyms for a particular search. - * - * @return synonyms - */ - @javax.annotation.Nullable - public Boolean getSynonyms() { - return synonyms; - } - - public void setSynonyms(Boolean synonyms) { - this.synonyms = synonyms; - } - - public IndexSettingsAsSearchParams replaceSynonymsInHighlight( - Boolean replaceSynonymsInHighlight - ) { - this.replaceSynonymsInHighlight = replaceSynonymsInHighlight; - return this; - } - - /** - * Whether to highlight and snippet the original word that matches the synonym or the synonym - * itself. - * - * @return replaceSynonymsInHighlight - */ - @javax.annotation.Nullable - public Boolean getReplaceSynonymsInHighlight() { - return replaceSynonymsInHighlight; - } - - public void setReplaceSynonymsInHighlight( - Boolean replaceSynonymsInHighlight - ) { - this.replaceSynonymsInHighlight = replaceSynonymsInHighlight; - } - - public IndexSettingsAsSearchParams minProximity(Integer minProximity) { - this.minProximity = minProximity; - return this; - } - - /** - * Precision of the proximity ranking criterion. minimum: 1 maximum: 7 - * - * @return minProximity - */ - @javax.annotation.Nullable - public Integer getMinProximity() { - return minProximity; - } - - public void setMinProximity(Integer minProximity) { - this.minProximity = minProximity; - } - - public IndexSettingsAsSearchParams responseFields( - List responseFields - ) { - this.responseFields = responseFields; - return this; - } - - public IndexSettingsAsSearchParams addResponseFieldsItem( - String responseFieldsItem - ) { - if (this.responseFields == null) { - this.responseFields = new ArrayList<>(); - } - this.responseFields.add(responseFieldsItem); - return this; - } - - /** - * Choose which fields to return in the API response. This parameters applies to search and browse - * queries. - * - * @return responseFields - */ - @javax.annotation.Nullable - public List getResponseFields() { - return responseFields; - } - - public void setResponseFields(List responseFields) { - this.responseFields = responseFields; - } - - public IndexSettingsAsSearchParams maxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * Maximum number of facet hits to return during a search for facet values. For performance - * reasons, the maximum allowed number of returned values is 100. maximum: 100 - * - * @return maxFacetHits - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - - public void setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - } - - public IndexSettingsAsSearchParams attributeCriteriaComputedByMinProximity( - Boolean attributeCriteriaComputedByMinProximity - ) { - this.attributeCriteriaComputedByMinProximity = - attributeCriteriaComputedByMinProximity; - return this; - } - - /** - * When attribute is ranked above proximity in your ranking formula, proximity is used to select - * which searchable attribute is matched in the attribute ranking stage. - * - * @return attributeCriteriaComputedByMinProximity - */ - @javax.annotation.Nullable - public Boolean getAttributeCriteriaComputedByMinProximity() { - return attributeCriteriaComputedByMinProximity; - } - - public void setAttributeCriteriaComputedByMinProximity( - Boolean attributeCriteriaComputedByMinProximity - ) { - this.attributeCriteriaComputedByMinProximity = - attributeCriteriaComputedByMinProximity; - } - - public IndexSettingsAsSearchParams renderingContent(Object renderingContent) { - this.renderingContent = renderingContent; - return this; - } - - /** - * Content defining how the search interface should be rendered. Can be set via the settings for a - * default value and can be overridden via rules. - * - * @return renderingContent - */ - @javax.annotation.Nullable - public Object getRenderingContent() { - return renderingContent; - } - - public void setRenderingContent(Object renderingContent) { - this.renderingContent = renderingContent; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IndexSettingsAsSearchParams indexSettingsAsSearchParams = (IndexSettingsAsSearchParams) o; - return ( - Objects.equals( - this.searchableAttributes, - indexSettingsAsSearchParams.searchableAttributes - ) && - Objects.equals( - this.attributesForFaceting, - indexSettingsAsSearchParams.attributesForFaceting - ) && - Objects.equals( - this.unretrievableAttributes, - indexSettingsAsSearchParams.unretrievableAttributes - ) && - Objects.equals( - this.attributesToRetrieve, - indexSettingsAsSearchParams.attributesToRetrieve - ) && - Objects.equals( - this.restrictSearchableAttributes, - indexSettingsAsSearchParams.restrictSearchableAttributes - ) && - Objects.equals(this.ranking, indexSettingsAsSearchParams.ranking) && - Objects.equals( - this.customRanking, - indexSettingsAsSearchParams.customRanking - ) && - Objects.equals( - this.relevancyStrictness, - indexSettingsAsSearchParams.relevancyStrictness - ) && - Objects.equals( - this.attributesToHighlight, - indexSettingsAsSearchParams.attributesToHighlight - ) && - Objects.equals( - this.attributesToSnippet, - indexSettingsAsSearchParams.attributesToSnippet - ) && - Objects.equals( - this.highlightPreTag, - indexSettingsAsSearchParams.highlightPreTag - ) && - Objects.equals( - this.highlightPostTag, - indexSettingsAsSearchParams.highlightPostTag - ) && - Objects.equals( - this.snippetEllipsisText, - indexSettingsAsSearchParams.snippetEllipsisText - ) && - Objects.equals( - this.restrictHighlightAndSnippetArrays, - indexSettingsAsSearchParams.restrictHighlightAndSnippetArrays - ) && - Objects.equals( - this.hitsPerPage, - indexSettingsAsSearchParams.hitsPerPage - ) && - Objects.equals( - this.minWordSizefor1Typo, - indexSettingsAsSearchParams.minWordSizefor1Typo - ) && - Objects.equals( - this.minWordSizefor2Typos, - indexSettingsAsSearchParams.minWordSizefor2Typos - ) && - Objects.equals( - this.typoTolerance, - indexSettingsAsSearchParams.typoTolerance - ) && - Objects.equals( - this.allowTyposOnNumericTokens, - indexSettingsAsSearchParams.allowTyposOnNumericTokens - ) && - Objects.equals( - this.disableTypoToleranceOnAttributes, - indexSettingsAsSearchParams.disableTypoToleranceOnAttributes - ) && - Objects.equals( - this.separatorsToIndex, - indexSettingsAsSearchParams.separatorsToIndex - ) && - Objects.equals( - this.ignorePlurals, - indexSettingsAsSearchParams.ignorePlurals - ) && - Objects.equals( - this.removeStopWords, - indexSettingsAsSearchParams.removeStopWords - ) && - Objects.equals( - this.keepDiacriticsOnCharacters, - indexSettingsAsSearchParams.keepDiacriticsOnCharacters - ) && - Objects.equals( - this.queryLanguages, - indexSettingsAsSearchParams.queryLanguages - ) && - Objects.equals( - this.decompoundQuery, - indexSettingsAsSearchParams.decompoundQuery - ) && - Objects.equals( - this.enableRules, - indexSettingsAsSearchParams.enableRules - ) && - Objects.equals( - this.enablePersonalization, - indexSettingsAsSearchParams.enablePersonalization - ) && - Objects.equals(this.queryType, indexSettingsAsSearchParams.queryType) && - Objects.equals( - this.removeWordsIfNoResults, - indexSettingsAsSearchParams.removeWordsIfNoResults - ) && - Objects.equals( - this.advancedSyntax, - indexSettingsAsSearchParams.advancedSyntax - ) && - Objects.equals( - this.optionalWords, - indexSettingsAsSearchParams.optionalWords - ) && - Objects.equals( - this.disableExactOnAttributes, - indexSettingsAsSearchParams.disableExactOnAttributes - ) && - Objects.equals( - this.exactOnSingleWordQuery, - indexSettingsAsSearchParams.exactOnSingleWordQuery - ) && - Objects.equals( - this.alternativesAsExact, - indexSettingsAsSearchParams.alternativesAsExact - ) && - Objects.equals( - this.advancedSyntaxFeatures, - indexSettingsAsSearchParams.advancedSyntaxFeatures - ) && - Objects.equals(this.distinct, indexSettingsAsSearchParams.distinct) && - Objects.equals(this.synonyms, indexSettingsAsSearchParams.synonyms) && - Objects.equals( - this.replaceSynonymsInHighlight, - indexSettingsAsSearchParams.replaceSynonymsInHighlight - ) && - Objects.equals( - this.minProximity, - indexSettingsAsSearchParams.minProximity - ) && - Objects.equals( - this.responseFields, - indexSettingsAsSearchParams.responseFields - ) && - Objects.equals( - this.maxFacetHits, - indexSettingsAsSearchParams.maxFacetHits - ) && - Objects.equals( - this.attributeCriteriaComputedByMinProximity, - indexSettingsAsSearchParams.attributeCriteriaComputedByMinProximity - ) && - Objects.equals( - this.renderingContent, - indexSettingsAsSearchParams.renderingContent - ) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - searchableAttributes, - attributesForFaceting, - unretrievableAttributes, - attributesToRetrieve, - restrictSearchableAttributes, - ranking, - customRanking, - relevancyStrictness, - attributesToHighlight, - attributesToSnippet, - highlightPreTag, - highlightPostTag, - snippetEllipsisText, - restrictHighlightAndSnippetArrays, - hitsPerPage, - minWordSizefor1Typo, - minWordSizefor2Typos, - typoTolerance, - allowTyposOnNumericTokens, - disableTypoToleranceOnAttributes, - separatorsToIndex, - ignorePlurals, - removeStopWords, - keepDiacriticsOnCharacters, - queryLanguages, - decompoundQuery, - enableRules, - enablePersonalization, - queryType, - removeWordsIfNoResults, - advancedSyntax, - optionalWords, - disableExactOnAttributes, - exactOnSingleWordQuery, - alternativesAsExact, - advancedSyntaxFeatures, - distinct, - synonyms, - replaceSynonymsInHighlight, - minProximity, - responseFields, - maxFacetHits, - attributeCriteriaComputedByMinProximity, - renderingContent - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IndexSettingsAsSearchParams {\n"); - sb - .append(" searchableAttributes: ") - .append(toIndentedString(searchableAttributes)) - .append("\n"); - sb - .append(" attributesForFaceting: ") - .append(toIndentedString(attributesForFaceting)) - .append("\n"); - sb - .append(" unretrievableAttributes: ") - .append(toIndentedString(unretrievableAttributes)) - .append("\n"); - sb - .append(" attributesToRetrieve: ") - .append(toIndentedString(attributesToRetrieve)) - .append("\n"); - sb - .append(" restrictSearchableAttributes: ") - .append(toIndentedString(restrictSearchableAttributes)) - .append("\n"); - sb.append(" ranking: ").append(toIndentedString(ranking)).append("\n"); - sb - .append(" customRanking: ") - .append(toIndentedString(customRanking)) - .append("\n"); - sb - .append(" relevancyStrictness: ") - .append(toIndentedString(relevancyStrictness)) - .append("\n"); - sb - .append(" attributesToHighlight: ") - .append(toIndentedString(attributesToHighlight)) - .append("\n"); - sb - .append(" attributesToSnippet: ") - .append(toIndentedString(attributesToSnippet)) - .append("\n"); - sb - .append(" highlightPreTag: ") - .append(toIndentedString(highlightPreTag)) - .append("\n"); - sb - .append(" highlightPostTag: ") - .append(toIndentedString(highlightPostTag)) - .append("\n"); - sb - .append(" snippetEllipsisText: ") - .append(toIndentedString(snippetEllipsisText)) - .append("\n"); - sb - .append(" restrictHighlightAndSnippetArrays: ") - .append(toIndentedString(restrictHighlightAndSnippetArrays)) - .append("\n"); - sb - .append(" hitsPerPage: ") - .append(toIndentedString(hitsPerPage)) - .append("\n"); - sb - .append(" minWordSizefor1Typo: ") - .append(toIndentedString(minWordSizefor1Typo)) - .append("\n"); - sb - .append(" minWordSizefor2Typos: ") - .append(toIndentedString(minWordSizefor2Typos)) - .append("\n"); - sb - .append(" typoTolerance: ") - .append(toIndentedString(typoTolerance)) - .append("\n"); - sb - .append(" allowTyposOnNumericTokens: ") - .append(toIndentedString(allowTyposOnNumericTokens)) - .append("\n"); - sb - .append(" disableTypoToleranceOnAttributes: ") - .append(toIndentedString(disableTypoToleranceOnAttributes)) - .append("\n"); - sb - .append(" separatorsToIndex: ") - .append(toIndentedString(separatorsToIndex)) - .append("\n"); - sb - .append(" ignorePlurals: ") - .append(toIndentedString(ignorePlurals)) - .append("\n"); - sb - .append(" removeStopWords: ") - .append(toIndentedString(removeStopWords)) - .append("\n"); - sb - .append(" keepDiacriticsOnCharacters: ") - .append(toIndentedString(keepDiacriticsOnCharacters)) - .append("\n"); - sb - .append(" queryLanguages: ") - .append(toIndentedString(queryLanguages)) - .append("\n"); - sb - .append(" decompoundQuery: ") - .append(toIndentedString(decompoundQuery)) - .append("\n"); - sb - .append(" enableRules: ") - .append(toIndentedString(enableRules)) - .append("\n"); - sb - .append(" enablePersonalization: ") - .append(toIndentedString(enablePersonalization)) - .append("\n"); - sb - .append(" queryType: ") - .append(toIndentedString(queryType)) - .append("\n"); - sb - .append(" removeWordsIfNoResults: ") - .append(toIndentedString(removeWordsIfNoResults)) - .append("\n"); - sb - .append(" advancedSyntax: ") - .append(toIndentedString(advancedSyntax)) - .append("\n"); - sb - .append(" optionalWords: ") - .append(toIndentedString(optionalWords)) - .append("\n"); - sb - .append(" disableExactOnAttributes: ") - .append(toIndentedString(disableExactOnAttributes)) - .append("\n"); - sb - .append(" exactOnSingleWordQuery: ") - .append(toIndentedString(exactOnSingleWordQuery)) - .append("\n"); - sb - .append(" alternativesAsExact: ") - .append(toIndentedString(alternativesAsExact)) - .append("\n"); - sb - .append(" advancedSyntaxFeatures: ") - .append(toIndentedString(advancedSyntaxFeatures)) - .append("\n"); - sb.append(" distinct: ").append(toIndentedString(distinct)).append("\n"); - sb.append(" synonyms: ").append(toIndentedString(synonyms)).append("\n"); - sb - .append(" replaceSynonymsInHighlight: ") - .append(toIndentedString(replaceSynonymsInHighlight)) - .append("\n"); - sb - .append(" minProximity: ") - .append(toIndentedString(minProximity)) - .append("\n"); - sb - .append(" responseFields: ") - .append(toIndentedString(responseFields)) - .append("\n"); - sb - .append(" maxFacetHits: ") - .append(toIndentedString(maxFacetHits)) - .append("\n"); - sb - .append(" attributeCriteriaComputedByMinProximity: ") - .append(toIndentedString(attributeCriteriaComputedByMinProximity)) - .append("\n"); - sb - .append(" renderingContent: ") - .append(toIndentedString(renderingContent)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/Indice.java b/algoliasearch-core/com/algolia/model/Indice.java deleted file mode 100644 index ed64c6978..000000000 --- a/algoliasearch-core/com/algolia/model/Indice.java +++ /dev/null @@ -1,347 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Indice */ -public class Indice { - - @SerializedName("name") - private String name; - - @SerializedName("createdAt") - private String createdAt; - - @SerializedName("updatedAt") - private String updatedAt; - - @SerializedName("entries") - private Integer entries; - - @SerializedName("dataSize") - private Integer dataSize; - - @SerializedName("fileSize") - private Integer fileSize; - - @SerializedName("lastBuildTimeS") - private Integer lastBuildTimeS; - - @SerializedName("numberOfPendingTask") - private Integer numberOfPendingTask; - - @SerializedName("pendingTask") - private Boolean pendingTask; - - @SerializedName("primary") - private String primary; - - @SerializedName("replicas") - private List replicas = null; - - public Indice name(String name) { - this.name = name; - return this; - } - - /** - * Index name. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Indice createdAt(String createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Index creation date. An empty string means that the index has no records. - * - * @return createdAt - */ - @javax.annotation.Nonnull - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public Indice updatedAt(String updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Date of last update (ISO-8601 format). - * - * @return updatedAt - */ - @javax.annotation.Nonnull - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public Indice entries(Integer entries) { - this.entries = entries; - return this; - } - - /** - * Number of records contained in the index. - * - * @return entries - */ - @javax.annotation.Nonnull - public Integer getEntries() { - return entries; - } - - public void setEntries(Integer entries) { - this.entries = entries; - } - - public Indice dataSize(Integer dataSize) { - this.dataSize = dataSize; - return this; - } - - /** - * Number of bytes of the index in minified format. - * - * @return dataSize - */ - @javax.annotation.Nonnull - public Integer getDataSize() { - return dataSize; - } - - public void setDataSize(Integer dataSize) { - this.dataSize = dataSize; - } - - public Indice fileSize(Integer fileSize) { - this.fileSize = fileSize; - return this; - } - - /** - * Number of bytes of the index binary file. - * - * @return fileSize - */ - @javax.annotation.Nonnull - public Integer getFileSize() { - return fileSize; - } - - public void setFileSize(Integer fileSize) { - this.fileSize = fileSize; - } - - public Indice lastBuildTimeS(Integer lastBuildTimeS) { - this.lastBuildTimeS = lastBuildTimeS; - return this; - } - - /** - * Last build time - * - * @return lastBuildTimeS - */ - @javax.annotation.Nonnull - public Integer getLastBuildTimeS() { - return lastBuildTimeS; - } - - public void setLastBuildTimeS(Integer lastBuildTimeS) { - this.lastBuildTimeS = lastBuildTimeS; - } - - public Indice numberOfPendingTask(Integer numberOfPendingTask) { - this.numberOfPendingTask = numberOfPendingTask; - return this; - } - - /** - * Number of pending indexing operations. This value is deprecated and should not be used. - * - * @return numberOfPendingTask - */ - @javax.annotation.Nullable - public Integer getNumberOfPendingTask() { - return numberOfPendingTask; - } - - public void setNumberOfPendingTask(Integer numberOfPendingTask) { - this.numberOfPendingTask = numberOfPendingTask; - } - - public Indice pendingTask(Boolean pendingTask) { - this.pendingTask = pendingTask; - return this; - } - - /** - * A boolean which says whether the index has pending tasks. This value is deprecated and should - * not be used. - * - * @return pendingTask - */ - @javax.annotation.Nonnull - public Boolean getPendingTask() { - return pendingTask; - } - - public void setPendingTask(Boolean pendingTask) { - this.pendingTask = pendingTask; - } - - public Indice primary(String primary) { - this.primary = primary; - return this; - } - - /** - * Only present if the index is a replica. Contains the name of the related primary index. - * - * @return primary - */ - @javax.annotation.Nullable - public String getPrimary() { - return primary; - } - - public void setPrimary(String primary) { - this.primary = primary; - } - - public Indice replicas(List replicas) { - this.replicas = replicas; - return this; - } - - public Indice addReplicasItem(String replicasItem) { - if (this.replicas == null) { - this.replicas = new ArrayList<>(); - } - this.replicas.add(replicasItem); - return this; - } - - /** - * Only present if the index is a primary index with replicas. Contains the names of all linked - * replicas. - * - * @return replicas - */ - @javax.annotation.Nullable - public List getReplicas() { - return replicas; - } - - public void setReplicas(List replicas) { - this.replicas = replicas; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Indice indice = (Indice) o; - return ( - Objects.equals(this.name, indice.name) && - Objects.equals(this.createdAt, indice.createdAt) && - Objects.equals(this.updatedAt, indice.updatedAt) && - Objects.equals(this.entries, indice.entries) && - Objects.equals(this.dataSize, indice.dataSize) && - Objects.equals(this.fileSize, indice.fileSize) && - Objects.equals(this.lastBuildTimeS, indice.lastBuildTimeS) && - Objects.equals(this.numberOfPendingTask, indice.numberOfPendingTask) && - Objects.equals(this.pendingTask, indice.pendingTask) && - Objects.equals(this.primary, indice.primary) && - Objects.equals(this.replicas, indice.replicas) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - name, - createdAt, - updatedAt, - entries, - dataSize, - fileSize, - lastBuildTimeS, - numberOfPendingTask, - pendingTask, - primary, - replicas - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Indice {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb - .append(" createdAt: ") - .append(toIndentedString(createdAt)) - .append("\n"); - sb - .append(" updatedAt: ") - .append(toIndentedString(updatedAt)) - .append("\n"); - sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); - sb.append(" dataSize: ").append(toIndentedString(dataSize)).append("\n"); - sb.append(" fileSize: ").append(toIndentedString(fileSize)).append("\n"); - sb - .append(" lastBuildTimeS: ") - .append(toIndentedString(lastBuildTimeS)) - .append("\n"); - sb - .append(" numberOfPendingTask: ") - .append(toIndentedString(numberOfPendingTask)) - .append("\n"); - sb - .append(" pendingTask: ") - .append(toIndentedString(pendingTask)) - .append("\n"); - sb.append(" primary: ").append(toIndentedString(primary)).append("\n"); - sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/Key.java b/algoliasearch-core/com/algolia/model/Key.java deleted file mode 100644 index 5b61171f8..000000000 --- a/algoliasearch-core/com/algolia/model/Key.java +++ /dev/null @@ -1,388 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Key */ -public class Key { - - /** Gets or Sets acl */ - @JsonAdapter(AclEnum.Adapter.class) - public enum AclEnum { - ADDOBJECT("addObject"), - - ANALYTICS("analytics"), - - BROWSE("browse"), - - DELETEOBJECT("deleteObject"), - - DELETEINDEX("deleteIndex"), - - EDITSETTINGS("editSettings"), - - LISTINDEXES("listIndexes"), - - LOGS("logs"), - - PERSONALIZATION("personalization"), - - RECOMMENDATION("recommendation"), - - SEARCH("search"), - - SEEUNRETRIEVABLEATTRIBUTES("seeUnretrievableAttributes"), - - SETTINGS("settings"), - - USAGE("usage"); - - private String value; - - AclEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AclEnum fromValue(String value) { - for (AclEnum b : AclEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write(final JsonWriter jsonWriter, final AclEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AclEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AclEnum.fromValue(value); - } - } - } - - @SerializedName("acl") - private List acl = new ArrayList<>(); - - @SerializedName("description") - private String description = ""; - - @SerializedName("indexes") - private List indexes = null; - - @SerializedName("maxHitsPerQuery") - private Integer maxHitsPerQuery = 0; - - @SerializedName("maxQueriesPerIPPerHour") - private Integer maxQueriesPerIPPerHour = 0; - - @SerializedName("queryParameters") - private String queryParameters = ""; - - @SerializedName("referers") - private List referers = null; - - @SerializedName("validity") - private Integer validity = 0; - - @SerializedName("createdAt") - private String createdAt; - - public Key acl(List acl) { - this.acl = acl; - return this; - } - - public Key addAclItem(AclEnum aclItem) { - this.acl.add(aclItem); - return this; - } - - /** - * Set of permissions associated with the key. - * - * @return acl - */ - @javax.annotation.Nonnull - public List getAcl() { - return acl; - } - - public void setAcl(List acl) { - this.acl = acl; - } - - public Key description(String description) { - this.description = description; - return this; - } - - /** - * A comment used to identify a key more easily in the dashboard. It is not interpreted by the - * API. - * - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Key indexes(List indexes) { - this.indexes = indexes; - return this; - } - - public Key addIndexesItem(String indexesItem) { - if (this.indexes == null) { - this.indexes = new ArrayList<>(); - } - this.indexes.add(indexesItem); - return this; - } - - /** - * Restrict this new API key to a list of indices or index patterns. If the list is empty, all - * indices are allowed. - * - * @return indexes - */ - @javax.annotation.Nullable - public List getIndexes() { - return indexes; - } - - public void setIndexes(List indexes) { - this.indexes = indexes; - } - - public Key maxHitsPerQuery(Integer maxHitsPerQuery) { - this.maxHitsPerQuery = maxHitsPerQuery; - return this; - } - - /** - * Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. - * - * @return maxHitsPerQuery - */ - @javax.annotation.Nullable - public Integer getMaxHitsPerQuery() { - return maxHitsPerQuery; - } - - public void setMaxHitsPerQuery(Integer maxHitsPerQuery) { - this.maxHitsPerQuery = maxHitsPerQuery; - } - - public Key maxQueriesPerIPPerHour(Integer maxQueriesPerIPPerHour) { - this.maxQueriesPerIPPerHour = maxQueriesPerIPPerHour; - return this; - } - - /** - * Maximum number of API calls per hour allowed from a given IP address or a user token. - * - * @return maxQueriesPerIPPerHour - */ - @javax.annotation.Nullable - public Integer getMaxQueriesPerIPPerHour() { - return maxQueriesPerIPPerHour; - } - - public void setMaxQueriesPerIPPerHour(Integer maxQueriesPerIPPerHour) { - this.maxQueriesPerIPPerHour = maxQueriesPerIPPerHour; - } - - public Key queryParameters(String queryParameters) { - this.queryParameters = queryParameters; - return this; - } - - /** - * URL-encoded query string. Force some query parameters to be applied for each query made with - * this API key. - * - * @return queryParameters - */ - @javax.annotation.Nullable - public String getQueryParameters() { - return queryParameters; - } - - public void setQueryParameters(String queryParameters) { - this.queryParameters = queryParameters; - } - - public Key referers(List referers) { - this.referers = referers; - return this; - } - - public Key addReferersItem(String referersItem) { - if (this.referers == null) { - this.referers = new ArrayList<>(); - } - this.referers.add(referersItem); - return this; - } - - /** - * Restrict this new API key to specific referers. If empty or blank, defaults to all referers. - * - * @return referers - */ - @javax.annotation.Nullable - public List getReferers() { - return referers; - } - - public void setReferers(List referers) { - this.referers = referers; - } - - public Key validity(Integer validity) { - this.validity = validity; - return this; - } - - /** - * Validity limit for this key in seconds. The key will automatically be removed after this period - * of time. - * - * @return validity - */ - @javax.annotation.Nullable - public Integer getValidity() { - return validity; - } - - public void setValidity(Integer validity) { - this.validity = validity; - } - - public Key createdAt(String createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Date of creation (ISO-8601 format). - * - * @return createdAt - */ - @javax.annotation.Nonnull - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Key key = (Key) o; - return ( - Objects.equals(this.acl, key.acl) && - Objects.equals(this.description, key.description) && - Objects.equals(this.indexes, key.indexes) && - Objects.equals(this.maxHitsPerQuery, key.maxHitsPerQuery) && - Objects.equals(this.maxQueriesPerIPPerHour, key.maxQueriesPerIPPerHour) && - Objects.equals(this.queryParameters, key.queryParameters) && - Objects.equals(this.referers, key.referers) && - Objects.equals(this.validity, key.validity) && - Objects.equals(this.createdAt, key.createdAt) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - acl, - description, - indexes, - maxHitsPerQuery, - maxQueriesPerIPPerHour, - queryParameters, - referers, - validity, - createdAt - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Key {\n"); - sb.append(" acl: ").append(toIndentedString(acl)).append("\n"); - sb - .append(" description: ") - .append(toIndentedString(description)) - .append("\n"); - sb.append(" indexes: ").append(toIndentedString(indexes)).append("\n"); - sb - .append(" maxHitsPerQuery: ") - .append(toIndentedString(maxHitsPerQuery)) - .append("\n"); - sb - .append(" maxQueriesPerIPPerHour: ") - .append(toIndentedString(maxQueriesPerIPPerHour)) - .append("\n"); - sb - .append(" queryParameters: ") - .append(toIndentedString(queryParameters)) - .append("\n"); - sb.append(" referers: ").append(toIndentedString(referers)).append("\n"); - sb.append(" validity: ").append(toIndentedString(validity)).append("\n"); - sb - .append(" createdAt: ") - .append(toIndentedString(createdAt)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/Languages.java b/algoliasearch-core/com/algolia/model/Languages.java deleted file mode 100644 index 584101dfb..000000000 --- a/algoliasearch-core/com/algolia/model/Languages.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** A dictionary language. */ -public class Languages { - - @SerializedName("plurals") - private DictionaryLanguage plurals; - - @SerializedName("stopwords") - private DictionaryLanguage stopwords; - - @SerializedName("compounds") - private DictionaryLanguage compounds; - - public Languages plurals(DictionaryLanguage plurals) { - this.plurals = plurals; - return this; - } - - /** - * Get plurals - * - * @return plurals - */ - @javax.annotation.Nullable - public DictionaryLanguage getPlurals() { - return plurals; - } - - public void setPlurals(DictionaryLanguage plurals) { - this.plurals = plurals; - } - - public Languages stopwords(DictionaryLanguage stopwords) { - this.stopwords = stopwords; - return this; - } - - /** - * Get stopwords - * - * @return stopwords - */ - @javax.annotation.Nullable - public DictionaryLanguage getStopwords() { - return stopwords; - } - - public void setStopwords(DictionaryLanguage stopwords) { - this.stopwords = stopwords; - } - - public Languages compounds(DictionaryLanguage compounds) { - this.compounds = compounds; - return this; - } - - /** - * Get compounds - * - * @return compounds - */ - @javax.annotation.Nullable - public DictionaryLanguage getCompounds() { - return compounds; - } - - public void setCompounds(DictionaryLanguage compounds) { - this.compounds = compounds; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Languages languages = (Languages) o; - return ( - Objects.equals(this.plurals, languages.plurals) && - Objects.equals(this.stopwords, languages.stopwords) && - Objects.equals(this.compounds, languages.compounds) - ); - } - - @Override - public int hashCode() { - return Objects.hash(plurals, stopwords, compounds); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Languages {\n"); - sb.append(" plurals: ").append(toIndentedString(plurals)).append("\n"); - sb - .append(" stopwords: ") - .append(toIndentedString(stopwords)) - .append("\n"); - sb - .append(" compounds: ") - .append(toIndentedString(compounds)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/ListApiKeysResponse.java b/algoliasearch-core/com/algolia/model/ListApiKeysResponse.java deleted file mode 100644 index f85539f5e..000000000 --- a/algoliasearch-core/com/algolia/model/ListApiKeysResponse.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** ListApiKeysResponse */ -public class ListApiKeysResponse { - - @SerializedName("keys") - private List keys = new ArrayList<>(); - - public ListApiKeysResponse keys(List keys) { - this.keys = keys; - return this; - } - - public ListApiKeysResponse addKeysItem(Key keysItem) { - this.keys.add(keysItem); - return this; - } - - /** - * List of api keys. - * - * @return keys - */ - @javax.annotation.Nonnull - public List getKeys() { - return keys; - } - - public void setKeys(List keys) { - this.keys = keys; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListApiKeysResponse listApiKeysResponse = (ListApiKeysResponse) o; - return Objects.equals(this.keys, listApiKeysResponse.keys); - } - - @Override - public int hashCode() { - return Objects.hash(keys); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListApiKeysResponse {\n"); - sb.append(" keys: ").append(toIndentedString(keys)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/ListClustersResponse.java b/algoliasearch-core/com/algolia/model/ListClustersResponse.java deleted file mode 100644 index f9a9bdc59..000000000 --- a/algoliasearch-core/com/algolia/model/ListClustersResponse.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Array of clusters. */ -public class ListClustersResponse { - - @SerializedName("topUsers") - private List topUsers = new ArrayList<>(); - - public ListClustersResponse topUsers(List topUsers) { - this.topUsers = topUsers; - return this; - } - - public ListClustersResponse addTopUsersItem(String topUsersItem) { - this.topUsers.add(topUsersItem); - return this; - } - - /** - * Mapping of cluster names to top users. - * - * @return topUsers - */ - @javax.annotation.Nonnull - public List getTopUsers() { - return topUsers; - } - - public void setTopUsers(List topUsers) { - this.topUsers = topUsers; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListClustersResponse listClustersResponse = (ListClustersResponse) o; - return Objects.equals(this.topUsers, listClustersResponse.topUsers); - } - - @Override - public int hashCode() { - return Objects.hash(topUsers); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListClustersResponse {\n"); - sb.append(" topUsers: ").append(toIndentedString(topUsers)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/ListIndicesResponse.java b/algoliasearch-core/com/algolia/model/ListIndicesResponse.java deleted file mode 100644 index 0f4edc590..000000000 --- a/algoliasearch-core/com/algolia/model/ListIndicesResponse.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** ListIndicesResponse */ -public class ListIndicesResponse { - - @SerializedName("items") - private List items = null; - - @SerializedName("nbPages") - private Integer nbPages; - - public ListIndicesResponse items(List items) { - this.items = items; - return this; - } - - public ListIndicesResponse addItemsItem(Indice itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * List of the fetched indices. - * - * @return items - */ - @javax.annotation.Nullable - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public ListIndicesResponse nbPages(Integer nbPages) { - this.nbPages = nbPages; - return this; - } - - /** - * Number of pages. - * - * @return nbPages - */ - @javax.annotation.Nullable - public Integer getNbPages() { - return nbPages; - } - - public void setNbPages(Integer nbPages) { - this.nbPages = nbPages; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListIndicesResponse listIndicesResponse = (ListIndicesResponse) o; - return ( - Objects.equals(this.items, listIndicesResponse.items) && - Objects.equals(this.nbPages, listIndicesResponse.nbPages) - ); - } - - @Override - public int hashCode() { - return Objects.hash(items, nbPages); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListIndicesResponse {\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" nbPages: ").append(toIndentedString(nbPages)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/ListUserIdsResponse.java b/algoliasearch-core/com/algolia/model/ListUserIdsResponse.java deleted file mode 100644 index 8da966a1f..000000000 --- a/algoliasearch-core/com/algolia/model/ListUserIdsResponse.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** UserIDs data. */ -public class ListUserIdsResponse { - - @SerializedName("userIDs") - private List userIDs = new ArrayList<>(); - - public ListUserIdsResponse userIDs(List userIDs) { - this.userIDs = userIDs; - return this; - } - - public ListUserIdsResponse addUserIDsItem(UserId userIDsItem) { - this.userIDs.add(userIDsItem); - return this; - } - - /** - * List of userIDs. - * - * @return userIDs - */ - @javax.annotation.Nonnull - public List getUserIDs() { - return userIDs; - } - - public void setUserIDs(List userIDs) { - this.userIDs = userIDs; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListUserIdsResponse listUserIdsResponse = (ListUserIdsResponse) o; - return Objects.equals(this.userIDs, listUserIdsResponse.userIDs); - } - - @Override - public int hashCode() { - return Objects.hash(userIDs); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListUserIdsResponse {\n"); - sb.append(" userIDs: ").append(toIndentedString(userIDs)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/MultipleBatchOperation.java b/algoliasearch-core/com/algolia/model/MultipleBatchOperation.java deleted file mode 100644 index a5c54777e..000000000 --- a/algoliasearch-core/com/algolia/model/MultipleBatchOperation.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** MultipleBatchOperation */ -public class MultipleBatchOperation { - - @SerializedName("action") - private Action action; - - @SerializedName("body") - private Object body; - - @SerializedName("indexName") - private String indexName; - - public MultipleBatchOperation action(Action action) { - this.action = action; - return this; - } - - /** - * Get action - * - * @return action - */ - @javax.annotation.Nullable - public Action getAction() { - return action; - } - - public void setAction(Action action) { - this.action = action; - } - - public MultipleBatchOperation body(Object body) { - this.body = body; - return this; - } - - /** - * arguments to the operation (depends on the type of the operation). - * - * @return body - */ - @javax.annotation.Nullable - public Object getBody() { - return body; - } - - public void setBody(Object body) { - this.body = body; - } - - public MultipleBatchOperation indexName(String indexName) { - this.indexName = indexName; - return this; - } - - /** - * Index to target for this operation. - * - * @return indexName - */ - @javax.annotation.Nullable - public String getIndexName() { - return indexName; - } - - public void setIndexName(String indexName) { - this.indexName = indexName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MultipleBatchOperation multipleBatchOperation = (MultipleBatchOperation) o; - return ( - Objects.equals(this.action, multipleBatchOperation.action) && - Objects.equals(this.body, multipleBatchOperation.body) && - Objects.equals(this.indexName, multipleBatchOperation.indexName) - ); - } - - @Override - public int hashCode() { - return Objects.hash(action, body, indexName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MultipleBatchOperation {\n"); - sb.append(" action: ").append(toIndentedString(action)).append("\n"); - sb.append(" body: ").append(toIndentedString(body)).append("\n"); - sb - .append(" indexName: ") - .append(toIndentedString(indexName)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/MultipleBatchResponse.java b/algoliasearch-core/com/algolia/model/MultipleBatchResponse.java deleted file mode 100644 index ce068efd4..000000000 --- a/algoliasearch-core/com/algolia/model/MultipleBatchResponse.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** MultipleBatchResponse */ -public class MultipleBatchResponse { - - @SerializedName("taskID") - private Object taskID; - - @SerializedName("objectIDs") - private List objectIDs = null; - - public MultipleBatchResponse taskID(Object taskID) { - this.taskID = taskID; - return this; - } - - /** - * List of tasksIDs per index. - * - * @return taskID - */ - @javax.annotation.Nullable - public Object getTaskID() { - return taskID; - } - - public void setTaskID(Object taskID) { - this.taskID = taskID; - } - - public MultipleBatchResponse objectIDs(List objectIDs) { - this.objectIDs = objectIDs; - return this; - } - - public MultipleBatchResponse addObjectIDsItem(String objectIDsItem) { - if (this.objectIDs == null) { - this.objectIDs = new ArrayList<>(); - } - this.objectIDs.add(objectIDsItem); - return this; - } - - /** - * List of objectID. - * - * @return objectIDs - */ - @javax.annotation.Nullable - public List getObjectIDs() { - return objectIDs; - } - - public void setObjectIDs(List objectIDs) { - this.objectIDs = objectIDs; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MultipleBatchResponse multipleBatchResponse = (MultipleBatchResponse) o; - return ( - Objects.equals(this.taskID, multipleBatchResponse.taskID) && - Objects.equals(this.objectIDs, multipleBatchResponse.objectIDs) - ); - } - - @Override - public int hashCode() { - return Objects.hash(taskID, objectIDs); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MultipleBatchResponse {\n"); - sb.append(" taskID: ").append(toIndentedString(taskID)).append("\n"); - sb - .append(" objectIDs: ") - .append(toIndentedString(objectIDs)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/MultipleGetObjectsParams.java b/algoliasearch-core/com/algolia/model/MultipleGetObjectsParams.java deleted file mode 100644 index 329bb9f11..000000000 --- a/algoliasearch-core/com/algolia/model/MultipleGetObjectsParams.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** getObjects operation on an index. */ -public class MultipleGetObjectsParams { - - @SerializedName("attributesToRetrieve") - private List attributesToRetrieve = null; - - @SerializedName("objectID") - private String objectID; - - @SerializedName("indexName") - private String indexName; - - public MultipleGetObjectsParams attributesToRetrieve( - List attributesToRetrieve - ) { - this.attributesToRetrieve = attributesToRetrieve; - return this; - } - - public MultipleGetObjectsParams addAttributesToRetrieveItem( - String attributesToRetrieveItem - ) { - if (this.attributesToRetrieve == null) { - this.attributesToRetrieve = new ArrayList<>(); - } - this.attributesToRetrieve.add(attributesToRetrieveItem); - return this; - } - - /** - * List of attributes to retrieve. By default, all retrievable attributes are returned. - * - * @return attributesToRetrieve - */ - @javax.annotation.Nullable - public List getAttributesToRetrieve() { - return attributesToRetrieve; - } - - public void setAttributesToRetrieve(List attributesToRetrieve) { - this.attributesToRetrieve = attributesToRetrieve; - } - - public MultipleGetObjectsParams objectID(String objectID) { - this.objectID = objectID; - return this; - } - - /** - * ID of the object within that index. - * - * @return objectID - */ - @javax.annotation.Nonnull - public String getObjectID() { - return objectID; - } - - public void setObjectID(String objectID) { - this.objectID = objectID; - } - - public MultipleGetObjectsParams indexName(String indexName) { - this.indexName = indexName; - return this; - } - - /** - * name of the index containing the object. - * - * @return indexName - */ - @javax.annotation.Nonnull - public String getIndexName() { - return indexName; - } - - public void setIndexName(String indexName) { - this.indexName = indexName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MultipleGetObjectsParams multipleGetObjectsParams = (MultipleGetObjectsParams) o; - return ( - Objects.equals( - this.attributesToRetrieve, - multipleGetObjectsParams.attributesToRetrieve - ) && - Objects.equals(this.objectID, multipleGetObjectsParams.objectID) && - Objects.equals(this.indexName, multipleGetObjectsParams.indexName) - ); - } - - @Override - public int hashCode() { - return Objects.hash(attributesToRetrieve, objectID, indexName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MultipleGetObjectsParams {\n"); - sb - .append(" attributesToRetrieve: ") - .append(toIndentedString(attributesToRetrieve)) - .append("\n"); - sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n"); - sb - .append(" indexName: ") - .append(toIndentedString(indexName)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/MultipleQueries.java b/algoliasearch-core/com/algolia/model/MultipleQueries.java deleted file mode 100644 index a0c2fe6b9..000000000 --- a/algoliasearch-core/com/algolia/model/MultipleQueries.java +++ /dev/null @@ -1,167 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** MultipleQueries */ -public class MultipleQueries { - - @SerializedName("indexName") - private String indexName; - - @SerializedName("query") - private String query = ""; - - @SerializedName("type") - private MultipleQueriesType type = MultipleQueriesType.DEFAULT; - - @SerializedName("facet") - private String facet; - - @SerializedName("params") - private String params; - - public MultipleQueries indexName(String indexName) { - this.indexName = indexName; - return this; - } - - /** - * The Algolia index name. - * - * @return indexName - */ - @javax.annotation.Nonnull - public String getIndexName() { - return indexName; - } - - public void setIndexName(String indexName) { - this.indexName = indexName; - } - - public MultipleQueries query(String query) { - this.query = query; - return this; - } - - /** - * The text to search in the index. - * - * @return query - */ - @javax.annotation.Nullable - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public MultipleQueries type(MultipleQueriesType type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nullable - public MultipleQueriesType getType() { - return type; - } - - public void setType(MultipleQueriesType type) { - this.type = type; - } - - public MultipleQueries facet(String facet) { - this.facet = facet; - return this; - } - - /** - * The `facet` name. - * - * @return facet - */ - @javax.annotation.Nullable - public String getFacet() { - return facet; - } - - public void setFacet(String facet) { - this.facet = facet; - } - - public MultipleQueries params(String params) { - this.params = params; - return this; - } - - /** - * A query string of search parameters. - * - * @return params - */ - @javax.annotation.Nullable - public String getParams() { - return params; - } - - public void setParams(String params) { - this.params = params; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MultipleQueries multipleQueries = (MultipleQueries) o; - return ( - Objects.equals(this.indexName, multipleQueries.indexName) && - Objects.equals(this.query, multipleQueries.query) && - Objects.equals(this.type, multipleQueries.type) && - Objects.equals(this.facet, multipleQueries.facet) && - Objects.equals(this.params, multipleQueries.params) - ); - } - - @Override - public int hashCode() { - return Objects.hash(indexName, query, type, facet, params); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MultipleQueries {\n"); - sb - .append(" indexName: ") - .append(toIndentedString(indexName)) - .append("\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" facet: ").append(toIndentedString(facet)).append("\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/MultipleQueriesParams.java b/algoliasearch-core/com/algolia/model/MultipleQueriesParams.java deleted file mode 100644 index 952256492..000000000 --- a/algoliasearch-core/com/algolia/model/MultipleQueriesParams.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** MultipleQueriesParams */ -public class MultipleQueriesParams { - - @SerializedName("requests") - private List requests = new ArrayList<>(); - - @SerializedName("strategy") - private MultipleQueriesStrategy strategy; - - public MultipleQueriesParams requests(List requests) { - this.requests = requests; - return this; - } - - public MultipleQueriesParams addRequestsItem(MultipleQueries requestsItem) { - this.requests.add(requestsItem); - return this; - } - - /** - * Get requests - * - * @return requests - */ - @javax.annotation.Nonnull - public List getRequests() { - return requests; - } - - public void setRequests(List requests) { - this.requests = requests; - } - - public MultipleQueriesParams strategy(MultipleQueriesStrategy strategy) { - this.strategy = strategy; - return this; - } - - /** - * Get strategy - * - * @return strategy - */ - @javax.annotation.Nullable - public MultipleQueriesStrategy getStrategy() { - return strategy; - } - - public void setStrategy(MultipleQueriesStrategy strategy) { - this.strategy = strategy; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MultipleQueriesParams multipleQueriesParams = (MultipleQueriesParams) o; - return ( - Objects.equals(this.requests, multipleQueriesParams.requests) && - Objects.equals(this.strategy, multipleQueriesParams.strategy) - ); - } - - @Override - public int hashCode() { - return Objects.hash(requests, strategy); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MultipleQueriesParams {\n"); - sb.append(" requests: ").append(toIndentedString(requests)).append("\n"); - sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/MultipleQueriesResponse.java b/algoliasearch-core/com/algolia/model/MultipleQueriesResponse.java deleted file mode 100644 index 7b10d4ac6..000000000 --- a/algoliasearch-core/com/algolia/model/MultipleQueriesResponse.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** MultipleQueriesResponse */ -public class MultipleQueriesResponse { - - @SerializedName("results") - private List results = null; - - public MultipleQueriesResponse results(List results) { - this.results = results; - return this; - } - - public MultipleQueriesResponse addResultsItem(SearchResponse resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * Get results - * - * @return results - */ - @javax.annotation.Nullable - public List getResults() { - return results; - } - - public void setResults(List results) { - this.results = results; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MultipleQueriesResponse multipleQueriesResponse = (MultipleQueriesResponse) o; - return Objects.equals(this.results, multipleQueriesResponse.results); - } - - @Override - public int hashCode() { - return Objects.hash(results); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MultipleQueriesResponse {\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/MultipleQueriesStrategy.java b/algoliasearch-core/com/algolia/model/MultipleQueriesStrategy.java deleted file mode 100644 index 0fda9238b..000000000 --- a/algoliasearch-core/com/algolia/model/MultipleQueriesStrategy.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -/** Gets or Sets multipleQueriesStrategy */ -@JsonAdapter(MultipleQueriesStrategy.Adapter.class) -public enum MultipleQueriesStrategy { - NONE("none"), - - STOPIFENOUGHMATCHES("stopIfEnoughMatches"); - - private String value; - - MultipleQueriesStrategy(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static MultipleQueriesStrategy fromValue(String value) { - for (MultipleQueriesStrategy b : MultipleQueriesStrategy.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final MultipleQueriesStrategy enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public MultipleQueriesStrategy read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return MultipleQueriesStrategy.fromValue(value); - } - } -} diff --git a/algoliasearch-core/com/algolia/model/MultipleQueriesType.java b/algoliasearch-core/com/algolia/model/MultipleQueriesType.java deleted file mode 100644 index 266c455b7..000000000 --- a/algoliasearch-core/com/algolia/model/MultipleQueriesType.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -/** Perform a search query with `default`, will search for facet values if `facet` is given. */ -@JsonAdapter(MultipleQueriesType.Adapter.class) -public enum MultipleQueriesType { - DEFAULT("default"), - - FACET("facet"); - - private String value; - - MultipleQueriesType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static MultipleQueriesType fromValue(String value) { - for (MultipleQueriesType b : MultipleQueriesType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final MultipleQueriesType enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public MultipleQueriesType read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return MultipleQueriesType.fromValue(value); - } - } -} diff --git a/algoliasearch-core/com/algolia/model/OneOfintegerstring.java b/algoliasearch-core/com/algolia/model/OneOfintegerstring.java deleted file mode 100644 index 00156b314..000000000 --- a/algoliasearch-core/com/algolia/model/OneOfintegerstring.java +++ /dev/null @@ -1,3 +0,0 @@ -package com.algolia.model; - -public class OneOfintegerstring {} diff --git a/algoliasearch-core/com/algolia/model/OneOfstringbuiltInOperation.java b/algoliasearch-core/com/algolia/model/OneOfstringbuiltInOperation.java deleted file mode 100644 index 8ac01fc73..000000000 --- a/algoliasearch-core/com/algolia/model/OneOfstringbuiltInOperation.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; - -public class OneOfstringbuiltInOperation { - - @SerializedName("_operation") - private String _operation; - - @SerializedName("value") - private String value; - - public void set_operation(String op) { - _operation = op; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/algoliasearch-core/com/algolia/model/OperationIndexParams.java b/algoliasearch-core/com/algolia/model/OperationIndexParams.java deleted file mode 100644 index a048fc5fc..000000000 --- a/algoliasearch-core/com/algolia/model/OperationIndexParams.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** OperationIndexParams */ -public class OperationIndexParams { - - @SerializedName("operation") - private OperationType operation; - - @SerializedName("destination") - private String destination; - - @SerializedName("scope") - private List scope = null; - - public OperationIndexParams operation(OperationType operation) { - this.operation = operation; - return this; - } - - /** - * Get operation - * - * @return operation - */ - @javax.annotation.Nonnull - public OperationType getOperation() { - return operation; - } - - public void setOperation(OperationType operation) { - this.operation = operation; - } - - public OperationIndexParams destination(String destination) { - this.destination = destination; - return this; - } - - /** - * The Algolia index name. - * - * @return destination - */ - @javax.annotation.Nonnull - public String getDestination() { - return destination; - } - - public void setDestination(String destination) { - this.destination = destination; - } - - public OperationIndexParams scope(List scope) { - this.scope = scope; - return this; - } - - public OperationIndexParams addScopeItem(ScopeType scopeItem) { - if (this.scope == null) { - this.scope = new ArrayList<>(); - } - this.scope.add(scopeItem); - return this; - } - - /** - * Scope of the data to copy. When absent, a full copy is performed. When present, only the - * selected scopes are copied. - * - * @return scope - */ - @javax.annotation.Nullable - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OperationIndexParams operationIndexParams = (OperationIndexParams) o; - return ( - Objects.equals(this.operation, operationIndexParams.operation) && - Objects.equals(this.destination, operationIndexParams.destination) && - Objects.equals(this.scope, operationIndexParams.scope) - ); - } - - @Override - public int hashCode() { - return Objects.hash(operation, destination, scope); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OperationIndexParams {\n"); - sb - .append(" operation: ") - .append(toIndentedString(operation)) - .append("\n"); - sb - .append(" destination: ") - .append(toIndentedString(destination)) - .append("\n"); - sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/OperationType.java b/algoliasearch-core/com/algolia/model/OperationType.java deleted file mode 100644 index 05336d71f..000000000 --- a/algoliasearch-core/com/algolia/model/OperationType.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -/** Type of operation to perform (move or copy). */ -@JsonAdapter(OperationType.Adapter.class) -public enum OperationType { - MOVE("move"), - - COPY("copy"); - - private String value; - - OperationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static OperationType fromValue(String value) { - for (OperationType b : OperationType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final OperationType enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public OperationType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return OperationType.fromValue(value); - } - } -} diff --git a/algoliasearch-core/com/algolia/model/Params.java b/algoliasearch-core/com/algolia/model/Params.java deleted file mode 100644 index 9ff52121f..000000000 --- a/algoliasearch-core/com/algolia/model/Params.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Additional search parameters. Any valid search parameter is allowed. */ -public class Params { - - @SerializedName("query") - private String query; - - @SerializedName("automaticFacetFilters") - private List automaticFacetFilters = null; - - @SerializedName("automaticOptionalFacetFilters") - private List automaticOptionalFacetFilters = null; - - public Params query(String query) { - this.query = query; - return this; - } - - /** - * Query string. - * - * @return query - */ - @javax.annotation.Nullable - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public Params automaticFacetFilters( - List automaticFacetFilters - ) { - this.automaticFacetFilters = automaticFacetFilters; - return this; - } - - public Params addAutomaticFacetFiltersItem( - AutomaticFacetFilter automaticFacetFiltersItem - ) { - if (this.automaticFacetFilters == null) { - this.automaticFacetFilters = new ArrayList<>(); - } - this.automaticFacetFilters.add(automaticFacetFiltersItem); - return this; - } - - /** - * Names of facets to which automatic filtering must be applied; they must match the facet name of - * a facet value placeholder in the query pattern. - * - * @return automaticFacetFilters - */ - @javax.annotation.Nullable - public List getAutomaticFacetFilters() { - return automaticFacetFilters; - } - - public void setAutomaticFacetFilters( - List automaticFacetFilters - ) { - this.automaticFacetFilters = automaticFacetFilters; - } - - public Params automaticOptionalFacetFilters( - List automaticOptionalFacetFilters - ) { - this.automaticOptionalFacetFilters = automaticOptionalFacetFilters; - return this; - } - - public Params addAutomaticOptionalFacetFiltersItem( - AutomaticFacetFilter automaticOptionalFacetFiltersItem - ) { - if (this.automaticOptionalFacetFilters == null) { - this.automaticOptionalFacetFilters = new ArrayList<>(); - } - this.automaticOptionalFacetFilters.add(automaticOptionalFacetFiltersItem); - return this; - } - - /** - * Same syntax as automaticFacetFilters, but the engine treats the filters as optional. - * - * @return automaticOptionalFacetFilters - */ - @javax.annotation.Nullable - public List getAutomaticOptionalFacetFilters() { - return automaticOptionalFacetFilters; - } - - public void setAutomaticOptionalFacetFilters( - List automaticOptionalFacetFilters - ) { - this.automaticOptionalFacetFilters = automaticOptionalFacetFilters; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Params params = (Params) o; - return ( - Objects.equals(this.query, params.query) && - Objects.equals( - this.automaticFacetFilters, - params.automaticFacetFilters - ) && - Objects.equals( - this.automaticOptionalFacetFilters, - params.automaticOptionalFacetFilters - ) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - query, - automaticFacetFilters, - automaticOptionalFacetFilters - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Params {\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb - .append(" automaticFacetFilters: ") - .append(toIndentedString(automaticFacetFilters)) - .append("\n"); - sb - .append(" automaticOptionalFacetFilters: ") - .append(toIndentedString(automaticOptionalFacetFilters)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/Promote.java b/algoliasearch-core/com/algolia/model/Promote.java deleted file mode 100644 index 2ce9a5913..000000000 --- a/algoliasearch-core/com/algolia/model/Promote.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Object to promote as hits. */ -public class Promote { - - @SerializedName("objectID") - private String objectID; - - @SerializedName("objectIDs") - private List objectIDs = null; - - @SerializedName("position") - private Integer position; - - public Promote objectID(String objectID) { - this.objectID = objectID; - return this; - } - - /** - * Unique identifier of the object to promote. - * - * @return objectID - */ - @javax.annotation.Nullable - public String getObjectID() { - return objectID; - } - - public void setObjectID(String objectID) { - this.objectID = objectID; - } - - public Promote objectIDs(List objectIDs) { - this.objectIDs = objectIDs; - return this; - } - - public Promote addObjectIDsItem(String objectIDsItem) { - if (this.objectIDs == null) { - this.objectIDs = new ArrayList<>(); - } - this.objectIDs.add(objectIDsItem); - return this; - } - - /** - * Array of unique identifiers of the objects to promote. - * - * @return objectIDs - */ - @javax.annotation.Nullable - public List getObjectIDs() { - return objectIDs; - } - - public void setObjectIDs(List objectIDs) { - this.objectIDs = objectIDs; - } - - public Promote position(Integer position) { - this.position = position; - return this; - } - - /** - * The position to promote the objects to (zero-based). If you pass objectIDs, the objects are - * placed at this position as a group. For example, if you pass four objectIDs to position 0, the - * objects take the first four positions. - * - * @return position - */ - @javax.annotation.Nonnull - public Integer getPosition() { - return position; - } - - public void setPosition(Integer position) { - this.position = position; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Promote promote = (Promote) o; - return ( - Objects.equals(this.objectID, promote.objectID) && - Objects.equals(this.objectIDs, promote.objectIDs) && - Objects.equals(this.position, promote.position) - ); - } - - @Override - public int hashCode() { - return Objects.hash(objectID, objectIDs, position); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Promote {\n"); - sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n"); - sb - .append(" objectIDs: ") - .append(toIndentedString(objectIDs)) - .append("\n"); - sb.append(" position: ").append(toIndentedString(position)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/RankingInfo.java b/algoliasearch-core/com/algolia/model/RankingInfo.java deleted file mode 100644 index c6c236cdf..000000000 --- a/algoliasearch-core/com/algolia/model/RankingInfo.java +++ /dev/null @@ -1,360 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** RankingInfo */ -public class RankingInfo { - - @SerializedName("filters") - private Integer filters; - - @SerializedName("firstMatchedWord") - private Integer firstMatchedWord; - - @SerializedName("geoDistance") - private Integer geoDistance; - - @SerializedName("geoPrecision") - private Integer geoPrecision; - - @SerializedName("matchedGeoLocation") - private Map matchedGeoLocation = null; - - @SerializedName("nbExactWords") - private Integer nbExactWords; - - @SerializedName("nbTypos") - private Integer nbTypos; - - @SerializedName("promoted") - private Boolean promoted; - - @SerializedName("proximityDistance") - private Integer proximityDistance; - - @SerializedName("userScore") - private Integer userScore; - - @SerializedName("word") - private Integer word; - - public RankingInfo filters(Integer filters) { - this.filters = filters; - return this; - } - - /** - * This field is reserved for advanced usage. - * - * @return filters - */ - @javax.annotation.Nullable - public Integer getFilters() { - return filters; - } - - public void setFilters(Integer filters) { - this.filters = filters; - } - - public RankingInfo firstMatchedWord(Integer firstMatchedWord) { - this.firstMatchedWord = firstMatchedWord; - return this; - } - - /** - * Position of the most important matched attribute in the attributes to index list. - * - * @return firstMatchedWord - */ - @javax.annotation.Nullable - public Integer getFirstMatchedWord() { - return firstMatchedWord; - } - - public void setFirstMatchedWord(Integer firstMatchedWord) { - this.firstMatchedWord = firstMatchedWord; - } - - public RankingInfo geoDistance(Integer geoDistance) { - this.geoDistance = geoDistance; - return this; - } - - /** - * Distance between the geo location in the search query and the best matching geo location in the - * record, divided by the geo precision (in meters). - * - * @return geoDistance - */ - @javax.annotation.Nullable - public Integer getGeoDistance() { - return geoDistance; - } - - public void setGeoDistance(Integer geoDistance) { - this.geoDistance = geoDistance; - } - - public RankingInfo geoPrecision(Integer geoPrecision) { - this.geoPrecision = geoPrecision; - return this; - } - - /** - * Precision used when computing the geo distance, in meters. - * - * @return geoPrecision - */ - @javax.annotation.Nullable - public Integer getGeoPrecision() { - return geoPrecision; - } - - public void setGeoPrecision(Integer geoPrecision) { - this.geoPrecision = geoPrecision; - } - - public RankingInfo matchedGeoLocation( - Map matchedGeoLocation - ) { - this.matchedGeoLocation = matchedGeoLocation; - return this; - } - - public RankingInfo putMatchedGeoLocationItem( - String key, - RankingInfoMatchedGeoLocation matchedGeoLocationItem - ) { - if (this.matchedGeoLocation == null) { - this.matchedGeoLocation = new HashMap<>(); - } - this.matchedGeoLocation.put(key, matchedGeoLocationItem); - return this; - } - - /** - * Get matchedGeoLocation - * - * @return matchedGeoLocation - */ - @javax.annotation.Nullable - public Map getMatchedGeoLocation() { - return matchedGeoLocation; - } - - public void setMatchedGeoLocation( - Map matchedGeoLocation - ) { - this.matchedGeoLocation = matchedGeoLocation; - } - - public RankingInfo nbExactWords(Integer nbExactWords) { - this.nbExactWords = nbExactWords; - return this; - } - - /** - * Number of exactly matched words. - * - * @return nbExactWords - */ - @javax.annotation.Nullable - public Integer getNbExactWords() { - return nbExactWords; - } - - public void setNbExactWords(Integer nbExactWords) { - this.nbExactWords = nbExactWords; - } - - public RankingInfo nbTypos(Integer nbTypos) { - this.nbTypos = nbTypos; - return this; - } - - /** - * Number of typos encountered when matching the record. - * - * @return nbTypos - */ - @javax.annotation.Nullable - public Integer getNbTypos() { - return nbTypos; - } - - public void setNbTypos(Integer nbTypos) { - this.nbTypos = nbTypos; - } - - public RankingInfo promoted(Boolean promoted) { - this.promoted = promoted; - return this; - } - - /** - * Present and set to true if a Rule promoted the hit. - * - * @return promoted - */ - @javax.annotation.Nullable - public Boolean getPromoted() { - return promoted; - } - - public void setPromoted(Boolean promoted) { - this.promoted = promoted; - } - - public RankingInfo proximityDistance(Integer proximityDistance) { - this.proximityDistance = proximityDistance; - return this; - } - - /** - * When the query contains more than one word, the sum of the distances between matched words (in - * meters). - * - * @return proximityDistance - */ - @javax.annotation.Nullable - public Integer getProximityDistance() { - return proximityDistance; - } - - public void setProximityDistance(Integer proximityDistance) { - this.proximityDistance = proximityDistance; - } - - public RankingInfo userScore(Integer userScore) { - this.userScore = userScore; - return this; - } - - /** - * Custom ranking for the object, expressed as a single integer value. - * - * @return userScore - */ - @javax.annotation.Nullable - public Integer getUserScore() { - return userScore; - } - - public void setUserScore(Integer userScore) { - this.userScore = userScore; - } - - public RankingInfo word(Integer word) { - this.word = word; - return this; - } - - /** - * Number of matched words, including prefixes and typos. - * - * @return word - */ - @javax.annotation.Nullable - public Integer getWord() { - return word; - } - - public void setWord(Integer word) { - this.word = word; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RankingInfo rankingInfo = (RankingInfo) o; - return ( - Objects.equals(this.filters, rankingInfo.filters) && - Objects.equals(this.firstMatchedWord, rankingInfo.firstMatchedWord) && - Objects.equals(this.geoDistance, rankingInfo.geoDistance) && - Objects.equals(this.geoPrecision, rankingInfo.geoPrecision) && - Objects.equals(this.matchedGeoLocation, rankingInfo.matchedGeoLocation) && - Objects.equals(this.nbExactWords, rankingInfo.nbExactWords) && - Objects.equals(this.nbTypos, rankingInfo.nbTypos) && - Objects.equals(this.promoted, rankingInfo.promoted) && - Objects.equals(this.proximityDistance, rankingInfo.proximityDistance) && - Objects.equals(this.userScore, rankingInfo.userScore) && - Objects.equals(this.word, rankingInfo.word) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - filters, - firstMatchedWord, - geoDistance, - geoPrecision, - matchedGeoLocation, - nbExactWords, - nbTypos, - promoted, - proximityDistance, - userScore, - word - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RankingInfo {\n"); - sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - sb - .append(" firstMatchedWord: ") - .append(toIndentedString(firstMatchedWord)) - .append("\n"); - sb - .append(" geoDistance: ") - .append(toIndentedString(geoDistance)) - .append("\n"); - sb - .append(" geoPrecision: ") - .append(toIndentedString(geoPrecision)) - .append("\n"); - sb - .append(" matchedGeoLocation: ") - .append(toIndentedString(matchedGeoLocation)) - .append("\n"); - sb - .append(" nbExactWords: ") - .append(toIndentedString(nbExactWords)) - .append("\n"); - sb.append(" nbTypos: ").append(toIndentedString(nbTypos)).append("\n"); - sb.append(" promoted: ").append(toIndentedString(promoted)).append("\n"); - sb - .append(" proximityDistance: ") - .append(toIndentedString(proximityDistance)) - .append("\n"); - sb - .append(" userScore: ") - .append(toIndentedString(userScore)) - .append("\n"); - sb.append(" word: ").append(toIndentedString(word)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/RankingInfoMatchedGeoLocation.java b/algoliasearch-core/com/algolia/model/RankingInfoMatchedGeoLocation.java deleted file mode 100644 index 6ea7de27a..000000000 --- a/algoliasearch-core/com/algolia/model/RankingInfoMatchedGeoLocation.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** RankingInfoMatchedGeoLocation */ -public class RankingInfoMatchedGeoLocation { - - @SerializedName("lat") - private Double lat; - - @SerializedName("lng") - private Double lng; - - @SerializedName("distance") - private Integer distance; - - public RankingInfoMatchedGeoLocation lat(Double lat) { - this.lat = lat; - return this; - } - - /** - * Latitude of the matched location. - * - * @return lat - */ - @javax.annotation.Nullable - public Double getLat() { - return lat; - } - - public void setLat(Double lat) { - this.lat = lat; - } - - public RankingInfoMatchedGeoLocation lng(Double lng) { - this.lng = lng; - return this; - } - - /** - * Longitude of the matched location. - * - * @return lng - */ - @javax.annotation.Nullable - public Double getLng() { - return lng; - } - - public void setLng(Double lng) { - this.lng = lng; - } - - public RankingInfoMatchedGeoLocation distance(Integer distance) { - this.distance = distance; - return this; - } - - /** - * Distance between the matched location and the search location (in meters). - * - * @return distance - */ - @javax.annotation.Nullable - public Integer getDistance() { - return distance; - } - - public void setDistance(Integer distance) { - this.distance = distance; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RankingInfoMatchedGeoLocation rankingInfoMatchedGeoLocation = (RankingInfoMatchedGeoLocation) o; - return ( - Objects.equals(this.lat, rankingInfoMatchedGeoLocation.lat) && - Objects.equals(this.lng, rankingInfoMatchedGeoLocation.lng) && - Objects.equals(this.distance, rankingInfoMatchedGeoLocation.distance) - ); - } - - @Override - public int hashCode() { - return Objects.hash(lat, lng, distance); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RankingInfoMatchedGeoLocation {\n"); - sb.append(" lat: ").append(toIndentedString(lat)).append("\n"); - sb.append(" lng: ").append(toIndentedString(lng)).append("\n"); - sb.append(" distance: ").append(toIndentedString(distance)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/RemoveUserIdResponse.java b/algoliasearch-core/com/algolia/model/RemoveUserIdResponse.java deleted file mode 100644 index 149e60ba4..000000000 --- a/algoliasearch-core/com/algolia/model/RemoveUserIdResponse.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** RemoveUserIdResponse */ -public class RemoveUserIdResponse { - - @SerializedName("deletedAt") - private String deletedAt; - - public RemoveUserIdResponse deletedAt(String deletedAt) { - this.deletedAt = deletedAt; - return this; - } - - /** - * Date of deletion (ISO-8601 format). - * - * @return deletedAt - */ - @javax.annotation.Nonnull - public String getDeletedAt() { - return deletedAt; - } - - public void setDeletedAt(String deletedAt) { - this.deletedAt = deletedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RemoveUserIdResponse removeUserIdResponse = (RemoveUserIdResponse) o; - return Objects.equals(this.deletedAt, removeUserIdResponse.deletedAt); - } - - @Override - public int hashCode() { - return Objects.hash(deletedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RemoveUserIdResponse {\n"); - sb - .append(" deletedAt: ") - .append(toIndentedString(deletedAt)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/ReplaceSourceResponse.java b/algoliasearch-core/com/algolia/model/ReplaceSourceResponse.java deleted file mode 100644 index 8d119c34e..000000000 --- a/algoliasearch-core/com/algolia/model/ReplaceSourceResponse.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** ReplaceSourceResponse */ -public class ReplaceSourceResponse { - - @SerializedName("updatedAt") - private String updatedAt; - - public ReplaceSourceResponse updatedAt(String updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Date of last update (ISO-8601 format). - * - * @return updatedAt - */ - @javax.annotation.Nonnull - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReplaceSourceResponse replaceSourceResponse = (ReplaceSourceResponse) o; - return Objects.equals(this.updatedAt, replaceSourceResponse.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash(updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReplaceSourceResponse {\n"); - sb - .append(" updatedAt: ") - .append(toIndentedString(updatedAt)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/RequiredSearchParams.java b/algoliasearch-core/com/algolia/model/RequiredSearchParams.java deleted file mode 100644 index dd933cb73..000000000 --- a/algoliasearch-core/com/algolia/model/RequiredSearchParams.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** RequiredSearchParams */ -public class RequiredSearchParams { - - @SerializedName("query") - private String query = ""; - - public RequiredSearchParams query(String query) { - this.query = query; - return this; - } - - /** - * The text to search in the index. - * - * @return query - */ - @javax.annotation.Nonnull - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RequiredSearchParams requiredSearchParams = (RequiredSearchParams) o; - return Objects.equals(this.query, requiredSearchParams.query); - } - - @Override - public int hashCode() { - return Objects.hash(query); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RequiredSearchParams {\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/Rule.java b/algoliasearch-core/com/algolia/model/Rule.java deleted file mode 100644 index 318057b81..000000000 --- a/algoliasearch-core/com/algolia/model/Rule.java +++ /dev/null @@ -1,226 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Rule object. */ -public class Rule { - - @SerializedName("objectID") - private String objectID; - - @SerializedName("conditions") - private List conditions = null; - - @SerializedName("consequence") - private Consequence consequence; - - @SerializedName("description") - private String description; - - @SerializedName("enabled") - private Boolean enabled = true; - - @SerializedName("validity") - private List validity = null; - - public Rule objectID(String objectID) { - this.objectID = objectID; - return this; - } - - /** - * Unique identifier of the object. - * - * @return objectID - */ - @javax.annotation.Nonnull - public String getObjectID() { - return objectID; - } - - public void setObjectID(String objectID) { - this.objectID = objectID; - } - - public Rule conditions(List conditions) { - this.conditions = conditions; - return this; - } - - public Rule addConditionsItem(Condition conditionsItem) { - if (this.conditions == null) { - this.conditions = new ArrayList<>(); - } - this.conditions.add(conditionsItem); - return this; - } - - /** - * A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per - * Rule. - * - * @return conditions - */ - @javax.annotation.Nullable - public List getConditions() { - return conditions; - } - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - public Rule consequence(Consequence consequence) { - this.consequence = consequence; - return this; - } - - /** - * Get consequence - * - * @return consequence - */ - @javax.annotation.Nonnull - public Consequence getConsequence() { - return consequence; - } - - public void setConsequence(Consequence consequence) { - this.consequence = consequence; - } - - public Rule description(String description) { - this.description = description; - return this; - } - - /** - * This field is intended for Rule management purposes, in particular to ease searching for Rules - * and presenting them to human readers. It's not interpreted by the API. - * - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Rule enabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Whether the Rule is enabled. Disabled Rules remain in the index, but aren't applied at query - * time. - * - * @return enabled - */ - @javax.annotation.Nullable - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Rule validity(List validity) { - this.validity = validity; - return this; - } - - public Rule addValidityItem(TimeRange validityItem) { - if (this.validity == null) { - this.validity = new ArrayList<>(); - } - this.validity.add(validityItem); - return this; - } - - /** - * By default, Rules are permanently valid. When validity periods are specified, the Rule applies - * only during those periods; it's ignored the rest of the time. The list must not be empty. - * - * @return validity - */ - @javax.annotation.Nullable - public List getValidity() { - return validity; - } - - public void setValidity(List validity) { - this.validity = validity; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Rule rule = (Rule) o; - return ( - Objects.equals(this.objectID, rule.objectID) && - Objects.equals(this.conditions, rule.conditions) && - Objects.equals(this.consequence, rule.consequence) && - Objects.equals(this.description, rule.description) && - Objects.equals(this.enabled, rule.enabled) && - Objects.equals(this.validity, rule.validity) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - objectID, - conditions, - consequence, - description, - enabled, - validity - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Rule {\n"); - sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n"); - sb - .append(" conditions: ") - .append(toIndentedString(conditions)) - .append("\n"); - sb - .append(" consequence: ") - .append(toIndentedString(consequence)) - .append("\n"); - sb - .append(" description: ") - .append(toIndentedString(description)) - .append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" validity: ").append(toIndentedString(validity)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SaveObjectResponse.java b/algoliasearch-core/com/algolia/model/SaveObjectResponse.java deleted file mode 100644 index 815d42c27..000000000 --- a/algoliasearch-core/com/algolia/model/SaveObjectResponse.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** SaveObjectResponse */ -public class SaveObjectResponse { - - @SerializedName("createdAt") - private String createdAt; - - @SerializedName("taskID") - private Integer taskID; - - @SerializedName("objectID") - private String objectID; - - public SaveObjectResponse createdAt(String createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Get createdAt - * - * @return createdAt - */ - @javax.annotation.Nullable - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public SaveObjectResponse taskID(Integer taskID) { - this.taskID = taskID; - return this; - } - - /** - * taskID of the task to wait for. - * - * @return taskID - */ - @javax.annotation.Nullable - public Integer getTaskID() { - return taskID; - } - - public void setTaskID(Integer taskID) { - this.taskID = taskID; - } - - public SaveObjectResponse objectID(String objectID) { - this.objectID = objectID; - return this; - } - - /** - * Unique identifier of the object. - * - * @return objectID - */ - @javax.annotation.Nullable - public String getObjectID() { - return objectID; - } - - public void setObjectID(String objectID) { - this.objectID = objectID; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SaveObjectResponse saveObjectResponse = (SaveObjectResponse) o; - return ( - Objects.equals(this.createdAt, saveObjectResponse.createdAt) && - Objects.equals(this.taskID, saveObjectResponse.taskID) && - Objects.equals(this.objectID, saveObjectResponse.objectID) - ); - } - - @Override - public int hashCode() { - return Objects.hash(createdAt, taskID, objectID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SaveObjectResponse {\n"); - sb - .append(" createdAt: ") - .append(toIndentedString(createdAt)) - .append("\n"); - sb.append(" taskID: ").append(toIndentedString(taskID)).append("\n"); - sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SaveSynonymResponse.java b/algoliasearch-core/com/algolia/model/SaveSynonymResponse.java deleted file mode 100644 index 00dcf1376..000000000 --- a/algoliasearch-core/com/algolia/model/SaveSynonymResponse.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** SaveSynonymResponse */ -public class SaveSynonymResponse { - - @SerializedName("taskID") - private Integer taskID; - - @SerializedName("updatedAt") - private String updatedAt; - - @SerializedName("id") - private String id; - - public SaveSynonymResponse taskID(Integer taskID) { - this.taskID = taskID; - return this; - } - - /** - * taskID of the task to wait for. - * - * @return taskID - */ - @javax.annotation.Nonnull - public Integer getTaskID() { - return taskID; - } - - public void setTaskID(Integer taskID) { - this.taskID = taskID; - } - - public SaveSynonymResponse updatedAt(String updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Date of last update (ISO-8601 format). - * - * @return updatedAt - */ - @javax.annotation.Nonnull - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public SaveSynonymResponse id(String id) { - this.id = id; - return this; - } - - /** - * objectID of the inserted object. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SaveSynonymResponse saveSynonymResponse = (SaveSynonymResponse) o; - return ( - Objects.equals(this.taskID, saveSynonymResponse.taskID) && - Objects.equals(this.updatedAt, saveSynonymResponse.updatedAt) && - Objects.equals(this.id, saveSynonymResponse.id) - ); - } - - @Override - public int hashCode() { - return Objects.hash(taskID, updatedAt, id); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SaveSynonymResponse {\n"); - sb.append(" taskID: ").append(toIndentedString(taskID)).append("\n"); - sb - .append(" updatedAt: ") - .append(toIndentedString(updatedAt)) - .append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/ScopeType.java b/algoliasearch-core/com/algolia/model/ScopeType.java deleted file mode 100644 index cd9de1f61..000000000 --- a/algoliasearch-core/com/algolia/model/ScopeType.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -/** Gets or Sets scopeType */ -@JsonAdapter(ScopeType.Adapter.class) -public enum ScopeType { - SETTINGS("settings"), - - SYNONYMS("synonyms"), - - RULES("rules"); - - private String value; - - ScopeType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ScopeType fromValue(String value) { - for (ScopeType b : ScopeType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write(final JsonWriter jsonWriter, final ScopeType enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ScopeType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ScopeType.fromValue(value); - } - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchDictionaryEntriesParams.java b/algoliasearch-core/com/algolia/model/SearchDictionaryEntriesParams.java deleted file mode 100644 index 29fc496bf..000000000 --- a/algoliasearch-core/com/algolia/model/SearchDictionaryEntriesParams.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** The `searchDictionaryEntries` parameters. */ -public class SearchDictionaryEntriesParams { - - @SerializedName("query") - private String query = ""; - - @SerializedName("page") - private Integer page = 0; - - @SerializedName("hitsPerPage") - private Integer hitsPerPage = 20; - - @SerializedName("language") - private String language; - - public SearchDictionaryEntriesParams query(String query) { - this.query = query; - return this; - } - - /** - * The text to search in the index. - * - * @return query - */ - @javax.annotation.Nonnull - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public SearchDictionaryEntriesParams page(Integer page) { - this.page = page; - return this; - } - - /** - * Specify the page to retrieve. - * - * @return page - */ - @javax.annotation.Nullable - public Integer getPage() { - return page; - } - - public void setPage(Integer page) { - this.page = page; - } - - public SearchDictionaryEntriesParams hitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - return this; - } - - /** - * Set the number of hits per page. - * - * @return hitsPerPage - */ - @javax.annotation.Nullable - public Integer getHitsPerPage() { - return hitsPerPage; - } - - public void setHitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - } - - public SearchDictionaryEntriesParams language(String language) { - this.language = language; - return this; - } - - /** - * Language ISO code supported by the dictionary (e.g., \"en\" for English). - * - * @return language - */ - @javax.annotation.Nullable - public String getLanguage() { - return language; - } - - public void setLanguage(String language) { - this.language = language; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchDictionaryEntriesParams searchDictionaryEntriesParams = (SearchDictionaryEntriesParams) o; - return ( - Objects.equals(this.query, searchDictionaryEntriesParams.query) && - Objects.equals(this.page, searchDictionaryEntriesParams.page) && - Objects.equals( - this.hitsPerPage, - searchDictionaryEntriesParams.hitsPerPage - ) && - Objects.equals(this.language, searchDictionaryEntriesParams.language) - ); - } - - @Override - public int hashCode() { - return Objects.hash(query, page, hitsPerPage, language); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchDictionaryEntriesParams {\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb - .append(" hitsPerPage: ") - .append(toIndentedString(hitsPerPage)) - .append("\n"); - sb.append(" language: ").append(toIndentedString(language)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchForFacetValuesRequest.java b/algoliasearch-core/com/algolia/model/SearchForFacetValuesRequest.java deleted file mode 100644 index 61a4b4bc1..000000000 --- a/algoliasearch-core/com/algolia/model/SearchForFacetValuesRequest.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** SearchForFacetValuesRequest */ -public class SearchForFacetValuesRequest { - - @SerializedName("params") - private String params = ""; - - @SerializedName("facetQuery") - private String facetQuery = ""; - - @SerializedName("maxFacetHits") - private Integer maxFacetHits = 10; - - public SearchForFacetValuesRequest params(String params) { - this.params = params; - return this; - } - - /** - * Search parameters as URL-encoded query string. - * - * @return params - */ - @javax.annotation.Nullable - public String getParams() { - return params; - } - - public void setParams(String params) { - this.params = params; - } - - public SearchForFacetValuesRequest facetQuery(String facetQuery) { - this.facetQuery = facetQuery; - return this; - } - - /** - * Text to search inside the facet's values. - * - * @return facetQuery - */ - @javax.annotation.Nullable - public String getFacetQuery() { - return facetQuery; - } - - public void setFacetQuery(String facetQuery) { - this.facetQuery = facetQuery; - } - - public SearchForFacetValuesRequest maxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * Maximum number of facet hits to return during a search for facet values. For performance - * reasons, the maximum allowed number of returned values is 100. maximum: 100 - * - * @return maxFacetHits - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - - public void setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchForFacetValuesRequest searchForFacetValuesRequest = (SearchForFacetValuesRequest) o; - return ( - Objects.equals(this.params, searchForFacetValuesRequest.params) && - Objects.equals(this.facetQuery, searchForFacetValuesRequest.facetQuery) && - Objects.equals( - this.maxFacetHits, - searchForFacetValuesRequest.maxFacetHits - ) - ); - } - - @Override - public int hashCode() { - return Objects.hash(params, facetQuery, maxFacetHits); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchForFacetValuesRequest {\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb - .append(" facetQuery: ") - .append(toIndentedString(facetQuery)) - .append("\n"); - sb - .append(" maxFacetHits: ") - .append(toIndentedString(maxFacetHits)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchForFacetValuesResponse.java b/algoliasearch-core/com/algolia/model/SearchForFacetValuesResponse.java deleted file mode 100644 index fb9e84ce6..000000000 --- a/algoliasearch-core/com/algolia/model/SearchForFacetValuesResponse.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** SearchForFacetValuesResponse */ -public class SearchForFacetValuesResponse { - - @SerializedName("facetHits") - private List facetHits = new ArrayList<>(); - - public SearchForFacetValuesResponse facetHits( - List facetHits - ) { - this.facetHits = facetHits; - return this; - } - - public SearchForFacetValuesResponse addFacetHitsItem( - SearchForFacetValuesResponseFacetHits facetHitsItem - ) { - this.facetHits.add(facetHitsItem); - return this; - } - - /** - * Get facetHits - * - * @return facetHits - */ - @javax.annotation.Nonnull - public List getFacetHits() { - return facetHits; - } - - public void setFacetHits( - List facetHits - ) { - this.facetHits = facetHits; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchForFacetValuesResponse searchForFacetValuesResponse = (SearchForFacetValuesResponse) o; - return Objects.equals( - this.facetHits, - searchForFacetValuesResponse.facetHits - ); - } - - @Override - public int hashCode() { - return Objects.hash(facetHits); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchForFacetValuesResponse {\n"); - sb - .append(" facetHits: ") - .append(toIndentedString(facetHits)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchForFacetValuesResponseFacetHits.java b/algoliasearch-core/com/algolia/model/SearchForFacetValuesResponseFacetHits.java deleted file mode 100644 index 10b39b4fb..000000000 --- a/algoliasearch-core/com/algolia/model/SearchForFacetValuesResponseFacetHits.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** SearchForFacetValuesResponseFacetHits */ -public class SearchForFacetValuesResponseFacetHits { - - @SerializedName("value") - private String value; - - @SerializedName("highlighted") - private String highlighted; - - @SerializedName("count") - private Integer count; - - public SearchForFacetValuesResponseFacetHits value(String value) { - this.value = value; - return this; - } - - /** - * Raw value of the facet. - * - * @return value - */ - @javax.annotation.Nonnull - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public SearchForFacetValuesResponseFacetHits highlighted(String highlighted) { - this.highlighted = highlighted; - return this; - } - - /** - * Markup text with occurrences highlighted. - * - * @return highlighted - */ - @javax.annotation.Nonnull - public String getHighlighted() { - return highlighted; - } - - public void setHighlighted(String highlighted) { - this.highlighted = highlighted; - } - - public SearchForFacetValuesResponseFacetHits count(Integer count) { - this.count = count; - return this; - } - - /** - * How many objects contain this facet value. This takes into account the extra search parameters - * specified in the query. Like for a regular search query, the counts may not be exhaustive. - * - * @return count - */ - @javax.annotation.Nonnull - public Integer getCount() { - return count; - } - - public void setCount(Integer count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchForFacetValuesResponseFacetHits searchForFacetValuesResponseFacetHits = (SearchForFacetValuesResponseFacetHits) o; - return ( - Objects.equals(this.value, searchForFacetValuesResponseFacetHits.value) && - Objects.equals( - this.highlighted, - searchForFacetValuesResponseFacetHits.highlighted - ) && - Objects.equals(this.count, searchForFacetValuesResponseFacetHits.count) - ); - } - - @Override - public int hashCode() { - return Objects.hash(value, highlighted, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchForFacetValuesResponseFacetHits {\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb - .append(" highlighted: ") - .append(toIndentedString(highlighted)) - .append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchHits.java b/algoliasearch-core/com/algolia/model/SearchHits.java deleted file mode 100644 index 54993308f..000000000 --- a/algoliasearch-core/com/algolia/model/SearchHits.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** SearchHits */ -public class SearchHits { - - @SerializedName("hits") - private List hits = null; - - public SearchHits hits(List hits) { - this.hits = hits; - return this; - } - - public SearchHits addHitsItem(Hit hitsItem) { - if (this.hits == null) { - this.hits = new ArrayList<>(); - } - this.hits.add(hitsItem); - return this; - } - - /** - * Get hits - * - * @return hits - */ - @javax.annotation.Nullable - public List getHits() { - return hits; - } - - public void setHits(List hits) { - this.hits = hits; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchHits searchHits = (SearchHits) o; - return Objects.equals(this.hits, searchHits.hits); - } - - @Override - public int hashCode() { - return Objects.hash(hits); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchHits {\n"); - sb.append(" hits: ").append(toIndentedString(hits)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchParams.java b/algoliasearch-core/com/algolia/model/SearchParams.java deleted file mode 100644 index 8e6606dd8..000000000 --- a/algoliasearch-core/com/algolia/model/SearchParams.java +++ /dev/null @@ -1,2913 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** SearchParams */ -public class SearchParams { - - @SerializedName("params") - private String params = ""; - - @SerializedName("similarQuery") - private String similarQuery = ""; - - @SerializedName("filters") - private String filters = ""; - - @SerializedName("facetFilters") - private List facetFilters = null; - - @SerializedName("optionalFilters") - private List optionalFilters = null; - - @SerializedName("numericFilters") - private List numericFilters = null; - - @SerializedName("tagFilters") - private List tagFilters = null; - - @SerializedName("sumOrFiltersScores") - private Boolean sumOrFiltersScores = false; - - @SerializedName("facets") - private List facets = null; - - @SerializedName("maxValuesPerFacet") - private Integer maxValuesPerFacet = 100; - - @SerializedName("facetingAfterDistinct") - private Boolean facetingAfterDistinct = false; - - @SerializedName("sortFacetValuesBy") - private String sortFacetValuesBy = "count"; - - @SerializedName("page") - private Integer page = 0; - - @SerializedName("offset") - private Integer offset; - - @SerializedName("length") - private Integer length; - - @SerializedName("aroundLatLng") - private String aroundLatLng = ""; - - @SerializedName("aroundLatLngViaIP") - private Boolean aroundLatLngViaIP = false; - - @SerializedName("aroundRadius") - private OneOfintegerstring aroundRadius; - - @SerializedName("aroundPrecision") - private Integer aroundPrecision = 10; - - @SerializedName("minimumAroundRadius") - private Integer minimumAroundRadius; - - @SerializedName("insideBoundingBox") - private List insideBoundingBox = null; - - @SerializedName("insidePolygon") - private List insidePolygon = null; - - @SerializedName("naturalLanguages") - private List naturalLanguages = null; - - @SerializedName("ruleContexts") - private List ruleContexts = null; - - @SerializedName("personalizationImpact") - private Integer personalizationImpact = 100; - - @SerializedName("userToken") - private String userToken; - - @SerializedName("getRankingInfo") - private Boolean getRankingInfo = false; - - @SerializedName("clickAnalytics") - private Boolean clickAnalytics = false; - - @SerializedName("analytics") - private Boolean analytics = true; - - @SerializedName("analyticsTags") - private List analyticsTags = null; - - @SerializedName("percentileComputation") - private Boolean percentileComputation = true; - - @SerializedName("enableABTest") - private Boolean enableABTest = true; - - @SerializedName("enableReRanking") - private Boolean enableReRanking = true; - - @SerializedName("query") - private String query = ""; - - @SerializedName("searchableAttributes") - private List searchableAttributes = null; - - @SerializedName("attributesForFaceting") - private List attributesForFaceting = null; - - @SerializedName("unretrievableAttributes") - private List unretrievableAttributes = null; - - @SerializedName("attributesToRetrieve") - private List attributesToRetrieve = null; - - @SerializedName("restrictSearchableAttributes") - private List restrictSearchableAttributes = null; - - @SerializedName("ranking") - private List ranking = null; - - @SerializedName("customRanking") - private List customRanking = null; - - @SerializedName("relevancyStrictness") - private Integer relevancyStrictness = 100; - - @SerializedName("attributesToHighlight") - private List attributesToHighlight = null; - - @SerializedName("attributesToSnippet") - private List attributesToSnippet = null; - - @SerializedName("highlightPreTag") - private String highlightPreTag = ""; - - @SerializedName("highlightPostTag") - private String highlightPostTag = ""; - - @SerializedName("snippetEllipsisText") - private String snippetEllipsisText = "…"; - - @SerializedName("restrictHighlightAndSnippetArrays") - private Boolean restrictHighlightAndSnippetArrays = false; - - @SerializedName("hitsPerPage") - private Integer hitsPerPage = 20; - - @SerializedName("minWordSizefor1Typo") - private Integer minWordSizefor1Typo = 4; - - @SerializedName("minWordSizefor2Typos") - private Integer minWordSizefor2Typos = 8; - - /** Controls whether typo tolerance is enabled and how it is applied. */ - @JsonAdapter(TypoToleranceEnum.Adapter.class) - public enum TypoToleranceEnum { - TRUE("true"), - - FALSE("false"), - - MIN("min"), - - STRICT("strict"); - - private String value; - - TypoToleranceEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypoToleranceEnum fromValue(String value) { - for (TypoToleranceEnum b : TypoToleranceEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final TypoToleranceEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypoToleranceEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return TypoToleranceEnum.fromValue(value); - } - } - } - - @SerializedName("typoTolerance") - private TypoToleranceEnum typoTolerance = TypoToleranceEnum.TRUE; - - @SerializedName("allowTyposOnNumericTokens") - private Boolean allowTyposOnNumericTokens = true; - - @SerializedName("disableTypoToleranceOnAttributes") - private List disableTypoToleranceOnAttributes = null; - - @SerializedName("separatorsToIndex") - private String separatorsToIndex = ""; - - @SerializedName("ignorePlurals") - private String ignorePlurals = "false"; - - @SerializedName("removeStopWords") - private String removeStopWords = "false"; - - @SerializedName("keepDiacriticsOnCharacters") - private String keepDiacriticsOnCharacters = ""; - - @SerializedName("queryLanguages") - private List queryLanguages = null; - - @SerializedName("decompoundQuery") - private Boolean decompoundQuery = true; - - @SerializedName("enableRules") - private Boolean enableRules = true; - - @SerializedName("enablePersonalization") - private Boolean enablePersonalization = false; - - /** Controls if and how query words are interpreted as prefixes. */ - @JsonAdapter(QueryTypeEnum.Adapter.class) - public enum QueryTypeEnum { - PREFIXLAST("prefixLast"), - - PREFIXALL("prefixAll"), - - PREFIXNONE("prefixNone"); - - private String value; - - QueryTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static QueryTypeEnum fromValue(String value) { - for (QueryTypeEnum b : QueryTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final QueryTypeEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public QueryTypeEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return QueryTypeEnum.fromValue(value); - } - } - } - - @SerializedName("queryType") - private QueryTypeEnum queryType = QueryTypeEnum.PREFIXLAST; - - /** Selects a strategy to remove words from the query when it doesn't match any hits. */ - @JsonAdapter(RemoveWordsIfNoResultsEnum.Adapter.class) - public enum RemoveWordsIfNoResultsEnum { - NONE("none"), - - LASTWORDS("lastWords"), - - FIRSTWORDS("firstWords"), - - ALLOPTIONAL("allOptional"); - - private String value; - - RemoveWordsIfNoResultsEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static RemoveWordsIfNoResultsEnum fromValue(String value) { - for (RemoveWordsIfNoResultsEnum b : RemoveWordsIfNoResultsEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final RemoveWordsIfNoResultsEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public RemoveWordsIfNoResultsEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return RemoveWordsIfNoResultsEnum.fromValue(value); - } - } - } - - @SerializedName("removeWordsIfNoResults") - private RemoveWordsIfNoResultsEnum removeWordsIfNoResults = - RemoveWordsIfNoResultsEnum.NONE; - - @SerializedName("advancedSyntax") - private Boolean advancedSyntax = false; - - @SerializedName("optionalWords") - private List optionalWords = null; - - @SerializedName("disableExactOnAttributes") - private List disableExactOnAttributes = null; - - /** Controls how the exact ranking criterion is computed when the query contains only one word. */ - @JsonAdapter(ExactOnSingleWordQueryEnum.Adapter.class) - public enum ExactOnSingleWordQueryEnum { - ATTRIBUTE("attribute"), - - NONE("none"), - - WORD("word"); - - private String value; - - ExactOnSingleWordQueryEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ExactOnSingleWordQueryEnum fromValue(String value) { - for (ExactOnSingleWordQueryEnum b : ExactOnSingleWordQueryEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final ExactOnSingleWordQueryEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ExactOnSingleWordQueryEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return ExactOnSingleWordQueryEnum.fromValue(value); - } - } - } - - @SerializedName("exactOnSingleWordQuery") - private ExactOnSingleWordQueryEnum exactOnSingleWordQuery = - ExactOnSingleWordQueryEnum.ATTRIBUTE; - - /** Gets or Sets alternativesAsExact */ - @JsonAdapter(AlternativesAsExactEnum.Adapter.class) - public enum AlternativesAsExactEnum { - IGNOREPLURALS("ignorePlurals"), - - SINGLEWORDSYNONYM("singleWordSynonym"), - - MULTIWORDSSYNONYM("multiWordsSynonym"); - - private String value; - - AlternativesAsExactEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AlternativesAsExactEnum fromValue(String value) { - for (AlternativesAsExactEnum b : AlternativesAsExactEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final AlternativesAsExactEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AlternativesAsExactEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return AlternativesAsExactEnum.fromValue(value); - } - } - } - - @SerializedName("alternativesAsExact") - private List alternativesAsExact = null; - - /** Gets or Sets advancedSyntaxFeatures */ - @JsonAdapter(AdvancedSyntaxFeaturesEnum.Adapter.class) - public enum AdvancedSyntaxFeaturesEnum { - EXACTPHRASE("exactPhrase"), - - EXCLUDEWORDS("excludeWords"); - - private String value; - - AdvancedSyntaxFeaturesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AdvancedSyntaxFeaturesEnum fromValue(String value) { - for (AdvancedSyntaxFeaturesEnum b : AdvancedSyntaxFeaturesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final AdvancedSyntaxFeaturesEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AdvancedSyntaxFeaturesEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return AdvancedSyntaxFeaturesEnum.fromValue(value); - } - } - } - - @SerializedName("advancedSyntaxFeatures") - private List advancedSyntaxFeatures = null; - - @SerializedName("distinct") - private Integer distinct = 0; - - @SerializedName("synonyms") - private Boolean synonyms = true; - - @SerializedName("replaceSynonymsInHighlight") - private Boolean replaceSynonymsInHighlight = false; - - @SerializedName("minProximity") - private Integer minProximity = 1; - - @SerializedName("responseFields") - private List responseFields = null; - - @SerializedName("maxFacetHits") - private Integer maxFacetHits = 10; - - @SerializedName("attributeCriteriaComputedByMinProximity") - private Boolean attributeCriteriaComputedByMinProximity = false; - - @SerializedName("renderingContent") - private Object renderingContent = new Object(); - - public SearchParams params(String params) { - this.params = params; - return this; - } - - /** - * Search parameters as URL-encoded query string. - * - * @return params - */ - @javax.annotation.Nullable - public String getParams() { - return params; - } - - public void setParams(String params) { - this.params = params; - } - - public SearchParams similarQuery(String similarQuery) { - this.similarQuery = similarQuery; - return this; - } - - /** - * Overrides the query parameter and performs a more generic search that can be used to find - * \"similar\" results. - * - * @return similarQuery - */ - @javax.annotation.Nullable - public String getSimilarQuery() { - return similarQuery; - } - - public void setSimilarQuery(String similarQuery) { - this.similarQuery = similarQuery; - } - - public SearchParams filters(String filters) { - this.filters = filters; - return this; - } - - /** - * Filter the query with numeric, facet and/or tag filters. - * - * @return filters - */ - @javax.annotation.Nullable - public String getFilters() { - return filters; - } - - public void setFilters(String filters) { - this.filters = filters; - } - - public SearchParams facetFilters(List facetFilters) { - this.facetFilters = facetFilters; - return this; - } - - public SearchParams addFacetFiltersItem(String facetFiltersItem) { - if (this.facetFilters == null) { - this.facetFilters = new ArrayList<>(); - } - this.facetFilters.add(facetFiltersItem); - return this; - } - - /** - * Filter hits by facet value. - * - * @return facetFilters - */ - @javax.annotation.Nullable - public List getFacetFilters() { - return facetFilters; - } - - public void setFacetFilters(List facetFilters) { - this.facetFilters = facetFilters; - } - - public SearchParams optionalFilters(List optionalFilters) { - this.optionalFilters = optionalFilters; - return this; - } - - public SearchParams addOptionalFiltersItem(String optionalFiltersItem) { - if (this.optionalFilters == null) { - this.optionalFilters = new ArrayList<>(); - } - this.optionalFilters.add(optionalFiltersItem); - return this; - } - - /** - * Create filters for ranking purposes, where records that match the filter are ranked higher, or - * lower in the case of a negative optional filter. - * - * @return optionalFilters - */ - @javax.annotation.Nullable - public List getOptionalFilters() { - return optionalFilters; - } - - public void setOptionalFilters(List optionalFilters) { - this.optionalFilters = optionalFilters; - } - - public SearchParams numericFilters(List numericFilters) { - this.numericFilters = numericFilters; - return this; - } - - public SearchParams addNumericFiltersItem(String numericFiltersItem) { - if (this.numericFilters == null) { - this.numericFilters = new ArrayList<>(); - } - this.numericFilters.add(numericFiltersItem); - return this; - } - - /** - * Filter on numeric attributes. - * - * @return numericFilters - */ - @javax.annotation.Nullable - public List getNumericFilters() { - return numericFilters; - } - - public void setNumericFilters(List numericFilters) { - this.numericFilters = numericFilters; - } - - public SearchParams tagFilters(List tagFilters) { - this.tagFilters = tagFilters; - return this; - } - - public SearchParams addTagFiltersItem(String tagFiltersItem) { - if (this.tagFilters == null) { - this.tagFilters = new ArrayList<>(); - } - this.tagFilters.add(tagFiltersItem); - return this; - } - - /** - * Filter hits by tags. - * - * @return tagFilters - */ - @javax.annotation.Nullable - public List getTagFilters() { - return tagFilters; - } - - public void setTagFilters(List tagFilters) { - this.tagFilters = tagFilters; - } - - public SearchParams sumOrFiltersScores(Boolean sumOrFiltersScores) { - this.sumOrFiltersScores = sumOrFiltersScores; - return this; - } - - /** - * Determines how to calculate the total score for filtering. - * - * @return sumOrFiltersScores - */ - @javax.annotation.Nullable - public Boolean getSumOrFiltersScores() { - return sumOrFiltersScores; - } - - public void setSumOrFiltersScores(Boolean sumOrFiltersScores) { - this.sumOrFiltersScores = sumOrFiltersScores; - } - - public SearchParams facets(List facets) { - this.facets = facets; - return this; - } - - public SearchParams addFacetsItem(String facetsItem) { - if (this.facets == null) { - this.facets = new ArrayList<>(); - } - this.facets.add(facetsItem); - return this; - } - - /** - * Retrieve facets and their facet values. - * - * @return facets - */ - @javax.annotation.Nullable - public List getFacets() { - return facets; - } - - public void setFacets(List facets) { - this.facets = facets; - } - - public SearchParams maxValuesPerFacet(Integer maxValuesPerFacet) { - this.maxValuesPerFacet = maxValuesPerFacet; - return this; - } - - /** - * Maximum number of facet values to return for each facet during a regular search. - * - * @return maxValuesPerFacet - */ - @javax.annotation.Nullable - public Integer getMaxValuesPerFacet() { - return maxValuesPerFacet; - } - - public void setMaxValuesPerFacet(Integer maxValuesPerFacet) { - this.maxValuesPerFacet = maxValuesPerFacet; - } - - public SearchParams facetingAfterDistinct(Boolean facetingAfterDistinct) { - this.facetingAfterDistinct = facetingAfterDistinct; - return this; - } - - /** - * Force faceting to be applied after de-duplication (via the Distinct setting). - * - * @return facetingAfterDistinct - */ - @javax.annotation.Nullable - public Boolean getFacetingAfterDistinct() { - return facetingAfterDistinct; - } - - public void setFacetingAfterDistinct(Boolean facetingAfterDistinct) { - this.facetingAfterDistinct = facetingAfterDistinct; - } - - public SearchParams sortFacetValuesBy(String sortFacetValuesBy) { - this.sortFacetValuesBy = sortFacetValuesBy; - return this; - } - - /** - * Controls how facet values are fetched. - * - * @return sortFacetValuesBy - */ - @javax.annotation.Nullable - public String getSortFacetValuesBy() { - return sortFacetValuesBy; - } - - public void setSortFacetValuesBy(String sortFacetValuesBy) { - this.sortFacetValuesBy = sortFacetValuesBy; - } - - public SearchParams page(Integer page) { - this.page = page; - return this; - } - - /** - * Specify the page to retrieve. - * - * @return page - */ - @javax.annotation.Nullable - public Integer getPage() { - return page; - } - - public void setPage(Integer page) { - this.page = page; - } - - public SearchParams offset(Integer offset) { - this.offset = offset; - return this; - } - - /** - * Specify the offset of the first hit to return. - * - * @return offset - */ - @javax.annotation.Nullable - public Integer getOffset() { - return offset; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public SearchParams length(Integer length) { - this.length = length; - return this; - } - - /** - * Set the number of hits to retrieve (used only with offset). minimum: 1 maximum: 1000 - * - * @return length - */ - @javax.annotation.Nullable - public Integer getLength() { - return length; - } - - public void setLength(Integer length) { - this.length = length; - } - - public SearchParams aroundLatLng(String aroundLatLng) { - this.aroundLatLng = aroundLatLng; - return this; - } - - /** - * Search for entries around a central geolocation, enabling a geo search within a circular area. - * - * @return aroundLatLng - */ - @javax.annotation.Nullable - public String getAroundLatLng() { - return aroundLatLng; - } - - public void setAroundLatLng(String aroundLatLng) { - this.aroundLatLng = aroundLatLng; - } - - public SearchParams aroundLatLngViaIP(Boolean aroundLatLngViaIP) { - this.aroundLatLngViaIP = aroundLatLngViaIP; - return this; - } - - /** - * Search for entries around a given location automatically computed from the requester's IP - * address. - * - * @return aroundLatLngViaIP - */ - @javax.annotation.Nullable - public Boolean getAroundLatLngViaIP() { - return aroundLatLngViaIP; - } - - public void setAroundLatLngViaIP(Boolean aroundLatLngViaIP) { - this.aroundLatLngViaIP = aroundLatLngViaIP; - } - - public SearchParams aroundRadius(OneOfintegerstring aroundRadius) { - this.aroundRadius = aroundRadius; - return this; - } - - /** - * Define the maximum radius for a geo search (in meters). - * - * @return aroundRadius - */ - @javax.annotation.Nullable - public OneOfintegerstring getAroundRadius() { - return aroundRadius; - } - - public void setAroundRadius(OneOfintegerstring aroundRadius) { - this.aroundRadius = aroundRadius; - } - - public SearchParams aroundPrecision(Integer aroundPrecision) { - this.aroundPrecision = aroundPrecision; - return this; - } - - /** - * Precision of geo search (in meters), to add grouping by geo location to the ranking formula. - * - * @return aroundPrecision - */ - @javax.annotation.Nullable - public Integer getAroundPrecision() { - return aroundPrecision; - } - - public void setAroundPrecision(Integer aroundPrecision) { - this.aroundPrecision = aroundPrecision; - } - - public SearchParams minimumAroundRadius(Integer minimumAroundRadius) { - this.minimumAroundRadius = minimumAroundRadius; - return this; - } - - /** - * Minimum radius (in meters) used for a geo search when aroundRadius is not set. minimum: 1 - * - * @return minimumAroundRadius - */ - @javax.annotation.Nullable - public Integer getMinimumAroundRadius() { - return minimumAroundRadius; - } - - public void setMinimumAroundRadius(Integer minimumAroundRadius) { - this.minimumAroundRadius = minimumAroundRadius; - } - - public SearchParams insideBoundingBox(List insideBoundingBox) { - this.insideBoundingBox = insideBoundingBox; - return this; - } - - public SearchParams addInsideBoundingBoxItem( - BigDecimal insideBoundingBoxItem - ) { - if (this.insideBoundingBox == null) { - this.insideBoundingBox = new ArrayList<>(); - } - this.insideBoundingBox.add(insideBoundingBoxItem); - return this; - } - - /** - * Search inside a rectangular area (in geo coordinates). - * - * @return insideBoundingBox - */ - @javax.annotation.Nullable - public List getInsideBoundingBox() { - return insideBoundingBox; - } - - public void setInsideBoundingBox(List insideBoundingBox) { - this.insideBoundingBox = insideBoundingBox; - } - - public SearchParams insidePolygon(List insidePolygon) { - this.insidePolygon = insidePolygon; - return this; - } - - public SearchParams addInsidePolygonItem(BigDecimal insidePolygonItem) { - if (this.insidePolygon == null) { - this.insidePolygon = new ArrayList<>(); - } - this.insidePolygon.add(insidePolygonItem); - return this; - } - - /** - * Search inside a polygon (in geo coordinates). - * - * @return insidePolygon - */ - @javax.annotation.Nullable - public List getInsidePolygon() { - return insidePolygon; - } - - public void setInsidePolygon(List insidePolygon) { - this.insidePolygon = insidePolygon; - } - - public SearchParams naturalLanguages(List naturalLanguages) { - this.naturalLanguages = naturalLanguages; - return this; - } - - public SearchParams addNaturalLanguagesItem(String naturalLanguagesItem) { - if (this.naturalLanguages == null) { - this.naturalLanguages = new ArrayList<>(); - } - this.naturalLanguages.add(naturalLanguagesItem); - return this; - } - - /** - * This parameter changes the default values of certain parameters and settings that work best for - * a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, - * analyticsTags and ruleContexts. These parameters and settings work well together when the query - * is formatted in natural language instead of keywords, for example when your user performs a - * voice search. - * - * @return naturalLanguages - */ - @javax.annotation.Nullable - public List getNaturalLanguages() { - return naturalLanguages; - } - - public void setNaturalLanguages(List naturalLanguages) { - this.naturalLanguages = naturalLanguages; - } - - public SearchParams ruleContexts(List ruleContexts) { - this.ruleContexts = ruleContexts; - return this; - } - - public SearchParams addRuleContextsItem(String ruleContextsItem) { - if (this.ruleContexts == null) { - this.ruleContexts = new ArrayList<>(); - } - this.ruleContexts.add(ruleContextsItem); - return this; - } - - /** - * Enables contextual rules. - * - * @return ruleContexts - */ - @javax.annotation.Nullable - public List getRuleContexts() { - return ruleContexts; - } - - public void setRuleContexts(List ruleContexts) { - this.ruleContexts = ruleContexts; - } - - public SearchParams personalizationImpact(Integer personalizationImpact) { - this.personalizationImpact = personalizationImpact; - return this; - } - - /** - * Define the impact of the Personalization feature. - * - * @return personalizationImpact - */ - @javax.annotation.Nullable - public Integer getPersonalizationImpact() { - return personalizationImpact; - } - - public void setPersonalizationImpact(Integer personalizationImpact) { - this.personalizationImpact = personalizationImpact; - } - - public SearchParams userToken(String userToken) { - this.userToken = userToken; - return this; - } - - /** - * Associates a certain user token with the current search. - * - * @return userToken - */ - @javax.annotation.Nullable - public String getUserToken() { - return userToken; - } - - public void setUserToken(String userToken) { - this.userToken = userToken; - } - - public SearchParams getRankingInfo(Boolean getRankingInfo) { - this.getRankingInfo = getRankingInfo; - return this; - } - - /** - * Retrieve detailed ranking information. - * - * @return getRankingInfo - */ - @javax.annotation.Nullable - public Boolean getGetRankingInfo() { - return getRankingInfo; - } - - public void setGetRankingInfo(Boolean getRankingInfo) { - this.getRankingInfo = getRankingInfo; - } - - public SearchParams clickAnalytics(Boolean clickAnalytics) { - this.clickAnalytics = clickAnalytics; - return this; - } - - /** - * Enable the Click Analytics feature. - * - * @return clickAnalytics - */ - @javax.annotation.Nullable - public Boolean getClickAnalytics() { - return clickAnalytics; - } - - public void setClickAnalytics(Boolean clickAnalytics) { - this.clickAnalytics = clickAnalytics; - } - - public SearchParams analytics(Boolean analytics) { - this.analytics = analytics; - return this; - } - - /** - * Whether the current query will be taken into account in the Analytics. - * - * @return analytics - */ - @javax.annotation.Nullable - public Boolean getAnalytics() { - return analytics; - } - - public void setAnalytics(Boolean analytics) { - this.analytics = analytics; - } - - public SearchParams analyticsTags(List analyticsTags) { - this.analyticsTags = analyticsTags; - return this; - } - - public SearchParams addAnalyticsTagsItem(String analyticsTagsItem) { - if (this.analyticsTags == null) { - this.analyticsTags = new ArrayList<>(); - } - this.analyticsTags.add(analyticsTagsItem); - return this; - } - - /** - * List of tags to apply to the query for analytics purposes. - * - * @return analyticsTags - */ - @javax.annotation.Nullable - public List getAnalyticsTags() { - return analyticsTags; - } - - public void setAnalyticsTags(List analyticsTags) { - this.analyticsTags = analyticsTags; - } - - public SearchParams percentileComputation(Boolean percentileComputation) { - this.percentileComputation = percentileComputation; - return this; - } - - /** - * Whether to include or exclude a query from the processing-time percentile computation. - * - * @return percentileComputation - */ - @javax.annotation.Nullable - public Boolean getPercentileComputation() { - return percentileComputation; - } - - public void setPercentileComputation(Boolean percentileComputation) { - this.percentileComputation = percentileComputation; - } - - public SearchParams enableABTest(Boolean enableABTest) { - this.enableABTest = enableABTest; - return this; - } - - /** - * Whether this search should participate in running AB tests. - * - * @return enableABTest - */ - @javax.annotation.Nullable - public Boolean getEnableABTest() { - return enableABTest; - } - - public void setEnableABTest(Boolean enableABTest) { - this.enableABTest = enableABTest; - } - - public SearchParams enableReRanking(Boolean enableReRanking) { - this.enableReRanking = enableReRanking; - return this; - } - - /** - * Whether this search should use AI Re-Ranking. - * - * @return enableReRanking - */ - @javax.annotation.Nullable - public Boolean getEnableReRanking() { - return enableReRanking; - } - - public void setEnableReRanking(Boolean enableReRanking) { - this.enableReRanking = enableReRanking; - } - - public SearchParams query(String query) { - this.query = query; - return this; - } - - /** - * The text to search in the index. - * - * @return query - */ - @javax.annotation.Nonnull - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public SearchParams searchableAttributes(List searchableAttributes) { - this.searchableAttributes = searchableAttributes; - return this; - } - - public SearchParams addSearchableAttributesItem( - String searchableAttributesItem - ) { - if (this.searchableAttributes == null) { - this.searchableAttributes = new ArrayList<>(); - } - this.searchableAttributes.add(searchableAttributesItem); - return this; - } - - /** - * The complete list of attributes used for searching. - * - * @return searchableAttributes - */ - @javax.annotation.Nullable - public List getSearchableAttributes() { - return searchableAttributes; - } - - public void setSearchableAttributes(List searchableAttributes) { - this.searchableAttributes = searchableAttributes; - } - - public SearchParams attributesForFaceting( - List attributesForFaceting - ) { - this.attributesForFaceting = attributesForFaceting; - return this; - } - - public SearchParams addAttributesForFacetingItem( - String attributesForFacetingItem - ) { - if (this.attributesForFaceting == null) { - this.attributesForFaceting = new ArrayList<>(); - } - this.attributesForFaceting.add(attributesForFacetingItem); - return this; - } - - /** - * The complete list of attributes that will be used for faceting. - * - * @return attributesForFaceting - */ - @javax.annotation.Nullable - public List getAttributesForFaceting() { - return attributesForFaceting; - } - - public void setAttributesForFaceting(List attributesForFaceting) { - this.attributesForFaceting = attributesForFaceting; - } - - public SearchParams unretrievableAttributes( - List unretrievableAttributes - ) { - this.unretrievableAttributes = unretrievableAttributes; - return this; - } - - public SearchParams addUnretrievableAttributesItem( - String unretrievableAttributesItem - ) { - if (this.unretrievableAttributes == null) { - this.unretrievableAttributes = new ArrayList<>(); - } - this.unretrievableAttributes.add(unretrievableAttributesItem); - return this; - } - - /** - * List of attributes that can't be retrieved at query time. - * - * @return unretrievableAttributes - */ - @javax.annotation.Nullable - public List getUnretrievableAttributes() { - return unretrievableAttributes; - } - - public void setUnretrievableAttributes(List unretrievableAttributes) { - this.unretrievableAttributes = unretrievableAttributes; - } - - public SearchParams attributesToRetrieve(List attributesToRetrieve) { - this.attributesToRetrieve = attributesToRetrieve; - return this; - } - - public SearchParams addAttributesToRetrieveItem( - String attributesToRetrieveItem - ) { - if (this.attributesToRetrieve == null) { - this.attributesToRetrieve = new ArrayList<>(); - } - this.attributesToRetrieve.add(attributesToRetrieveItem); - return this; - } - - /** - * This parameter controls which attributes to retrieve and which not to retrieve. - * - * @return attributesToRetrieve - */ - @javax.annotation.Nullable - public List getAttributesToRetrieve() { - return attributesToRetrieve; - } - - public void setAttributesToRetrieve(List attributesToRetrieve) { - this.attributesToRetrieve = attributesToRetrieve; - } - - public SearchParams restrictSearchableAttributes( - List restrictSearchableAttributes - ) { - this.restrictSearchableAttributes = restrictSearchableAttributes; - return this; - } - - public SearchParams addRestrictSearchableAttributesItem( - String restrictSearchableAttributesItem - ) { - if (this.restrictSearchableAttributes == null) { - this.restrictSearchableAttributes = new ArrayList<>(); - } - this.restrictSearchableAttributes.add(restrictSearchableAttributesItem); - return this; - } - - /** - * Restricts a given query to look in only a subset of your searchable attributes. - * - * @return restrictSearchableAttributes - */ - @javax.annotation.Nullable - public List getRestrictSearchableAttributes() { - return restrictSearchableAttributes; - } - - public void setRestrictSearchableAttributes( - List restrictSearchableAttributes - ) { - this.restrictSearchableAttributes = restrictSearchableAttributes; - } - - public SearchParams ranking(List ranking) { - this.ranking = ranking; - return this; - } - - public SearchParams addRankingItem(String rankingItem) { - if (this.ranking == null) { - this.ranking = new ArrayList<>(); - } - this.ranking.add(rankingItem); - return this; - } - - /** - * Controls how Algolia should sort your results. - * - * @return ranking - */ - @javax.annotation.Nullable - public List getRanking() { - return ranking; - } - - public void setRanking(List ranking) { - this.ranking = ranking; - } - - public SearchParams customRanking(List customRanking) { - this.customRanking = customRanking; - return this; - } - - public SearchParams addCustomRankingItem(String customRankingItem) { - if (this.customRanking == null) { - this.customRanking = new ArrayList<>(); - } - this.customRanking.add(customRankingItem); - return this; - } - - /** - * Specifies the custom ranking criterion. - * - * @return customRanking - */ - @javax.annotation.Nullable - public List getCustomRanking() { - return customRanking; - } - - public void setCustomRanking(List customRanking) { - this.customRanking = customRanking; - } - - public SearchParams relevancyStrictness(Integer relevancyStrictness) { - this.relevancyStrictness = relevancyStrictness; - return this; - } - - /** - * Controls the relevancy threshold below which less relevant results aren't included in the - * results. - * - * @return relevancyStrictness - */ - @javax.annotation.Nullable - public Integer getRelevancyStrictness() { - return relevancyStrictness; - } - - public void setRelevancyStrictness(Integer relevancyStrictness) { - this.relevancyStrictness = relevancyStrictness; - } - - public SearchParams attributesToHighlight( - List attributesToHighlight - ) { - this.attributesToHighlight = attributesToHighlight; - return this; - } - - public SearchParams addAttributesToHighlightItem( - String attributesToHighlightItem - ) { - if (this.attributesToHighlight == null) { - this.attributesToHighlight = new ArrayList<>(); - } - this.attributesToHighlight.add(attributesToHighlightItem); - return this; - } - - /** - * List of attributes to highlight. - * - * @return attributesToHighlight - */ - @javax.annotation.Nullable - public List getAttributesToHighlight() { - return attributesToHighlight; - } - - public void setAttributesToHighlight(List attributesToHighlight) { - this.attributesToHighlight = attributesToHighlight; - } - - public SearchParams attributesToSnippet(List attributesToSnippet) { - this.attributesToSnippet = attributesToSnippet; - return this; - } - - public SearchParams addAttributesToSnippetItem( - String attributesToSnippetItem - ) { - if (this.attributesToSnippet == null) { - this.attributesToSnippet = new ArrayList<>(); - } - this.attributesToSnippet.add(attributesToSnippetItem); - return this; - } - - /** - * List of attributes to snippet, with an optional maximum number of words to snippet. - * - * @return attributesToSnippet - */ - @javax.annotation.Nullable - public List getAttributesToSnippet() { - return attributesToSnippet; - } - - public void setAttributesToSnippet(List attributesToSnippet) { - this.attributesToSnippet = attributesToSnippet; - } - - public SearchParams highlightPreTag(String highlightPreTag) { - this.highlightPreTag = highlightPreTag; - return this; - } - - /** - * The HTML string to insert before the highlighted parts in all highlight and snippet results. - * - * @return highlightPreTag - */ - @javax.annotation.Nullable - public String getHighlightPreTag() { - return highlightPreTag; - } - - public void setHighlightPreTag(String highlightPreTag) { - this.highlightPreTag = highlightPreTag; - } - - public SearchParams highlightPostTag(String highlightPostTag) { - this.highlightPostTag = highlightPostTag; - return this; - } - - /** - * The HTML string to insert after the highlighted parts in all highlight and snippet results. - * - * @return highlightPostTag - */ - @javax.annotation.Nullable - public String getHighlightPostTag() { - return highlightPostTag; - } - - public void setHighlightPostTag(String highlightPostTag) { - this.highlightPostTag = highlightPostTag; - } - - public SearchParams snippetEllipsisText(String snippetEllipsisText) { - this.snippetEllipsisText = snippetEllipsisText; - return this; - } - - /** - * String used as an ellipsis indicator when a snippet is truncated. - * - * @return snippetEllipsisText - */ - @javax.annotation.Nullable - public String getSnippetEllipsisText() { - return snippetEllipsisText; - } - - public void setSnippetEllipsisText(String snippetEllipsisText) { - this.snippetEllipsisText = snippetEllipsisText; - } - - public SearchParams restrictHighlightAndSnippetArrays( - Boolean restrictHighlightAndSnippetArrays - ) { - this.restrictHighlightAndSnippetArrays = restrictHighlightAndSnippetArrays; - return this; - } - - /** - * Restrict highlighting and snippeting to items that matched the query. - * - * @return restrictHighlightAndSnippetArrays - */ - @javax.annotation.Nullable - public Boolean getRestrictHighlightAndSnippetArrays() { - return restrictHighlightAndSnippetArrays; - } - - public void setRestrictHighlightAndSnippetArrays( - Boolean restrictHighlightAndSnippetArrays - ) { - this.restrictHighlightAndSnippetArrays = restrictHighlightAndSnippetArrays; - } - - public SearchParams hitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - return this; - } - - /** - * Set the number of hits per page. - * - * @return hitsPerPage - */ - @javax.annotation.Nullable - public Integer getHitsPerPage() { - return hitsPerPage; - } - - public void setHitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - } - - public SearchParams minWordSizefor1Typo(Integer minWordSizefor1Typo) { - this.minWordSizefor1Typo = minWordSizefor1Typo; - return this; - } - - /** - * Minimum number of characters a word in the query string must contain to accept matches with 1 - * typo. - * - * @return minWordSizefor1Typo - */ - @javax.annotation.Nullable - public Integer getMinWordSizefor1Typo() { - return minWordSizefor1Typo; - } - - public void setMinWordSizefor1Typo(Integer minWordSizefor1Typo) { - this.minWordSizefor1Typo = minWordSizefor1Typo; - } - - public SearchParams minWordSizefor2Typos(Integer minWordSizefor2Typos) { - this.minWordSizefor2Typos = minWordSizefor2Typos; - return this; - } - - /** - * Minimum number of characters a word in the query string must contain to accept matches with 2 - * typos. - * - * @return minWordSizefor2Typos - */ - @javax.annotation.Nullable - public Integer getMinWordSizefor2Typos() { - return minWordSizefor2Typos; - } - - public void setMinWordSizefor2Typos(Integer minWordSizefor2Typos) { - this.minWordSizefor2Typos = minWordSizefor2Typos; - } - - public SearchParams typoTolerance(TypoToleranceEnum typoTolerance) { - this.typoTolerance = typoTolerance; - return this; - } - - /** - * Controls whether typo tolerance is enabled and how it is applied. - * - * @return typoTolerance - */ - @javax.annotation.Nullable - public TypoToleranceEnum getTypoTolerance() { - return typoTolerance; - } - - public void setTypoTolerance(TypoToleranceEnum typoTolerance) { - this.typoTolerance = typoTolerance; - } - - public SearchParams allowTyposOnNumericTokens( - Boolean allowTyposOnNumericTokens - ) { - this.allowTyposOnNumericTokens = allowTyposOnNumericTokens; - return this; - } - - /** - * Whether to allow typos on numbers (\"numeric tokens\") in the query string. - * - * @return allowTyposOnNumericTokens - */ - @javax.annotation.Nullable - public Boolean getAllowTyposOnNumericTokens() { - return allowTyposOnNumericTokens; - } - - public void setAllowTyposOnNumericTokens(Boolean allowTyposOnNumericTokens) { - this.allowTyposOnNumericTokens = allowTyposOnNumericTokens; - } - - public SearchParams disableTypoToleranceOnAttributes( - List disableTypoToleranceOnAttributes - ) { - this.disableTypoToleranceOnAttributes = disableTypoToleranceOnAttributes; - return this; - } - - public SearchParams addDisableTypoToleranceOnAttributesItem( - String disableTypoToleranceOnAttributesItem - ) { - if (this.disableTypoToleranceOnAttributes == null) { - this.disableTypoToleranceOnAttributes = new ArrayList<>(); - } - this.disableTypoToleranceOnAttributes.add( - disableTypoToleranceOnAttributesItem - ); - return this; - } - - /** - * List of attributes on which you want to disable typo tolerance. - * - * @return disableTypoToleranceOnAttributes - */ - @javax.annotation.Nullable - public List getDisableTypoToleranceOnAttributes() { - return disableTypoToleranceOnAttributes; - } - - public void setDisableTypoToleranceOnAttributes( - List disableTypoToleranceOnAttributes - ) { - this.disableTypoToleranceOnAttributes = disableTypoToleranceOnAttributes; - } - - public SearchParams separatorsToIndex(String separatorsToIndex) { - this.separatorsToIndex = separatorsToIndex; - return this; - } - - /** - * Control which separators are indexed. - * - * @return separatorsToIndex - */ - @javax.annotation.Nullable - public String getSeparatorsToIndex() { - return separatorsToIndex; - } - - public void setSeparatorsToIndex(String separatorsToIndex) { - this.separatorsToIndex = separatorsToIndex; - } - - public SearchParams ignorePlurals(String ignorePlurals) { - this.ignorePlurals = ignorePlurals; - return this; - } - - /** - * Treats singular, plurals, and other forms of declensions as matching terms. - * - * @return ignorePlurals - */ - @javax.annotation.Nullable - public String getIgnorePlurals() { - return ignorePlurals; - } - - public void setIgnorePlurals(String ignorePlurals) { - this.ignorePlurals = ignorePlurals; - } - - public SearchParams removeStopWords(String removeStopWords) { - this.removeStopWords = removeStopWords; - return this; - } - - /** - * Removes stop (common) words from the query before executing it. - * - * @return removeStopWords - */ - @javax.annotation.Nullable - public String getRemoveStopWords() { - return removeStopWords; - } - - public void setRemoveStopWords(String removeStopWords) { - this.removeStopWords = removeStopWords; - } - - public SearchParams keepDiacriticsOnCharacters( - String keepDiacriticsOnCharacters - ) { - this.keepDiacriticsOnCharacters = keepDiacriticsOnCharacters; - return this; - } - - /** - * List of characters that the engine shouldn't automatically normalize. - * - * @return keepDiacriticsOnCharacters - */ - @javax.annotation.Nullable - public String getKeepDiacriticsOnCharacters() { - return keepDiacriticsOnCharacters; - } - - public void setKeepDiacriticsOnCharacters(String keepDiacriticsOnCharacters) { - this.keepDiacriticsOnCharacters = keepDiacriticsOnCharacters; - } - - public SearchParams queryLanguages(List queryLanguages) { - this.queryLanguages = queryLanguages; - return this; - } - - public SearchParams addQueryLanguagesItem(String queryLanguagesItem) { - if (this.queryLanguages == null) { - this.queryLanguages = new ArrayList<>(); - } - this.queryLanguages.add(queryLanguagesItem); - return this; - } - - /** - * Sets the languages to be used by language-specific settings and functionalities such as - * ignorePlurals, removeStopWords, and CJK word-detection. - * - * @return queryLanguages - */ - @javax.annotation.Nullable - public List getQueryLanguages() { - return queryLanguages; - } - - public void setQueryLanguages(List queryLanguages) { - this.queryLanguages = queryLanguages; - } - - public SearchParams decompoundQuery(Boolean decompoundQuery) { - this.decompoundQuery = decompoundQuery; - return this; - } - - /** - * Splits compound words into their composing atoms in the query. - * - * @return decompoundQuery - */ - @javax.annotation.Nullable - public Boolean getDecompoundQuery() { - return decompoundQuery; - } - - public void setDecompoundQuery(Boolean decompoundQuery) { - this.decompoundQuery = decompoundQuery; - } - - public SearchParams enableRules(Boolean enableRules) { - this.enableRules = enableRules; - return this; - } - - /** - * Whether Rules should be globally enabled. - * - * @return enableRules - */ - @javax.annotation.Nullable - public Boolean getEnableRules() { - return enableRules; - } - - public void setEnableRules(Boolean enableRules) { - this.enableRules = enableRules; - } - - public SearchParams enablePersonalization(Boolean enablePersonalization) { - this.enablePersonalization = enablePersonalization; - return this; - } - - /** - * Enable the Personalization feature. - * - * @return enablePersonalization - */ - @javax.annotation.Nullable - public Boolean getEnablePersonalization() { - return enablePersonalization; - } - - public void setEnablePersonalization(Boolean enablePersonalization) { - this.enablePersonalization = enablePersonalization; - } - - public SearchParams queryType(QueryTypeEnum queryType) { - this.queryType = queryType; - return this; - } - - /** - * Controls if and how query words are interpreted as prefixes. - * - * @return queryType - */ - @javax.annotation.Nullable - public QueryTypeEnum getQueryType() { - return queryType; - } - - public void setQueryType(QueryTypeEnum queryType) { - this.queryType = queryType; - } - - public SearchParams removeWordsIfNoResults( - RemoveWordsIfNoResultsEnum removeWordsIfNoResults - ) { - this.removeWordsIfNoResults = removeWordsIfNoResults; - return this; - } - - /** - * Selects a strategy to remove words from the query when it doesn't match any hits. - * - * @return removeWordsIfNoResults - */ - @javax.annotation.Nullable - public RemoveWordsIfNoResultsEnum getRemoveWordsIfNoResults() { - return removeWordsIfNoResults; - } - - public void setRemoveWordsIfNoResults( - RemoveWordsIfNoResultsEnum removeWordsIfNoResults - ) { - this.removeWordsIfNoResults = removeWordsIfNoResults; - } - - public SearchParams advancedSyntax(Boolean advancedSyntax) { - this.advancedSyntax = advancedSyntax; - return this; - } - - /** - * Enables the advanced query syntax. - * - * @return advancedSyntax - */ - @javax.annotation.Nullable - public Boolean getAdvancedSyntax() { - return advancedSyntax; - } - - public void setAdvancedSyntax(Boolean advancedSyntax) { - this.advancedSyntax = advancedSyntax; - } - - public SearchParams optionalWords(List optionalWords) { - this.optionalWords = optionalWords; - return this; - } - - public SearchParams addOptionalWordsItem(String optionalWordsItem) { - if (this.optionalWords == null) { - this.optionalWords = new ArrayList<>(); - } - this.optionalWords.add(optionalWordsItem); - return this; - } - - /** - * A list of words that should be considered as optional when found in the query. - * - * @return optionalWords - */ - @javax.annotation.Nullable - public List getOptionalWords() { - return optionalWords; - } - - public void setOptionalWords(List optionalWords) { - this.optionalWords = optionalWords; - } - - public SearchParams disableExactOnAttributes( - List disableExactOnAttributes - ) { - this.disableExactOnAttributes = disableExactOnAttributes; - return this; - } - - public SearchParams addDisableExactOnAttributesItem( - String disableExactOnAttributesItem - ) { - if (this.disableExactOnAttributes == null) { - this.disableExactOnAttributes = new ArrayList<>(); - } - this.disableExactOnAttributes.add(disableExactOnAttributesItem); - return this; - } - - /** - * List of attributes on which you want to disable the exact ranking criterion. - * - * @return disableExactOnAttributes - */ - @javax.annotation.Nullable - public List getDisableExactOnAttributes() { - return disableExactOnAttributes; - } - - public void setDisableExactOnAttributes( - List disableExactOnAttributes - ) { - this.disableExactOnAttributes = disableExactOnAttributes; - } - - public SearchParams exactOnSingleWordQuery( - ExactOnSingleWordQueryEnum exactOnSingleWordQuery - ) { - this.exactOnSingleWordQuery = exactOnSingleWordQuery; - return this; - } - - /** - * Controls how the exact ranking criterion is computed when the query contains only one word. - * - * @return exactOnSingleWordQuery - */ - @javax.annotation.Nullable - public ExactOnSingleWordQueryEnum getExactOnSingleWordQuery() { - return exactOnSingleWordQuery; - } - - public void setExactOnSingleWordQuery( - ExactOnSingleWordQueryEnum exactOnSingleWordQuery - ) { - this.exactOnSingleWordQuery = exactOnSingleWordQuery; - } - - public SearchParams alternativesAsExact( - List alternativesAsExact - ) { - this.alternativesAsExact = alternativesAsExact; - return this; - } - - public SearchParams addAlternativesAsExactItem( - AlternativesAsExactEnum alternativesAsExactItem - ) { - if (this.alternativesAsExact == null) { - this.alternativesAsExact = new ArrayList<>(); - } - this.alternativesAsExact.add(alternativesAsExactItem); - return this; - } - - /** - * List of alternatives that should be considered an exact match by the exact ranking criterion. - * - * @return alternativesAsExact - */ - @javax.annotation.Nullable - public List getAlternativesAsExact() { - return alternativesAsExact; - } - - public void setAlternativesAsExact( - List alternativesAsExact - ) { - this.alternativesAsExact = alternativesAsExact; - } - - public SearchParams advancedSyntaxFeatures( - List advancedSyntaxFeatures - ) { - this.advancedSyntaxFeatures = advancedSyntaxFeatures; - return this; - } - - public SearchParams addAdvancedSyntaxFeaturesItem( - AdvancedSyntaxFeaturesEnum advancedSyntaxFeaturesItem - ) { - if (this.advancedSyntaxFeatures == null) { - this.advancedSyntaxFeatures = new ArrayList<>(); - } - this.advancedSyntaxFeatures.add(advancedSyntaxFeaturesItem); - return this; - } - - /** - * Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is - * enabled. - * - * @return advancedSyntaxFeatures - */ - @javax.annotation.Nullable - public List getAdvancedSyntaxFeatures() { - return advancedSyntaxFeatures; - } - - public void setAdvancedSyntaxFeatures( - List advancedSyntaxFeatures - ) { - this.advancedSyntaxFeatures = advancedSyntaxFeatures; - } - - public SearchParams distinct(Integer distinct) { - this.distinct = distinct; - return this; - } - - /** - * Enables de-duplication or grouping of results. minimum: 0 maximum: 4 - * - * @return distinct - */ - @javax.annotation.Nullable - public Integer getDistinct() { - return distinct; - } - - public void setDistinct(Integer distinct) { - this.distinct = distinct; - } - - public SearchParams synonyms(Boolean synonyms) { - this.synonyms = synonyms; - return this; - } - - /** - * Whether to take into account an index's synonyms for a particular search. - * - * @return synonyms - */ - @javax.annotation.Nullable - public Boolean getSynonyms() { - return synonyms; - } - - public void setSynonyms(Boolean synonyms) { - this.synonyms = synonyms; - } - - public SearchParams replaceSynonymsInHighlight( - Boolean replaceSynonymsInHighlight - ) { - this.replaceSynonymsInHighlight = replaceSynonymsInHighlight; - return this; - } - - /** - * Whether to highlight and snippet the original word that matches the synonym or the synonym - * itself. - * - * @return replaceSynonymsInHighlight - */ - @javax.annotation.Nullable - public Boolean getReplaceSynonymsInHighlight() { - return replaceSynonymsInHighlight; - } - - public void setReplaceSynonymsInHighlight( - Boolean replaceSynonymsInHighlight - ) { - this.replaceSynonymsInHighlight = replaceSynonymsInHighlight; - } - - public SearchParams minProximity(Integer minProximity) { - this.minProximity = minProximity; - return this; - } - - /** - * Precision of the proximity ranking criterion. minimum: 1 maximum: 7 - * - * @return minProximity - */ - @javax.annotation.Nullable - public Integer getMinProximity() { - return minProximity; - } - - public void setMinProximity(Integer minProximity) { - this.minProximity = minProximity; - } - - public SearchParams responseFields(List responseFields) { - this.responseFields = responseFields; - return this; - } - - public SearchParams addResponseFieldsItem(String responseFieldsItem) { - if (this.responseFields == null) { - this.responseFields = new ArrayList<>(); - } - this.responseFields.add(responseFieldsItem); - return this; - } - - /** - * Choose which fields to return in the API response. This parameters applies to search and browse - * queries. - * - * @return responseFields - */ - @javax.annotation.Nullable - public List getResponseFields() { - return responseFields; - } - - public void setResponseFields(List responseFields) { - this.responseFields = responseFields; - } - - public SearchParams maxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * Maximum number of facet hits to return during a search for facet values. For performance - * reasons, the maximum allowed number of returned values is 100. maximum: 100 - * - * @return maxFacetHits - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - - public void setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - } - - public SearchParams attributeCriteriaComputedByMinProximity( - Boolean attributeCriteriaComputedByMinProximity - ) { - this.attributeCriteriaComputedByMinProximity = - attributeCriteriaComputedByMinProximity; - return this; - } - - /** - * When attribute is ranked above proximity in your ranking formula, proximity is used to select - * which searchable attribute is matched in the attribute ranking stage. - * - * @return attributeCriteriaComputedByMinProximity - */ - @javax.annotation.Nullable - public Boolean getAttributeCriteriaComputedByMinProximity() { - return attributeCriteriaComputedByMinProximity; - } - - public void setAttributeCriteriaComputedByMinProximity( - Boolean attributeCriteriaComputedByMinProximity - ) { - this.attributeCriteriaComputedByMinProximity = - attributeCriteriaComputedByMinProximity; - } - - public SearchParams renderingContent(Object renderingContent) { - this.renderingContent = renderingContent; - return this; - } - - /** - * Content defining how the search interface should be rendered. Can be set via the settings for a - * default value and can be overridden via rules. - * - * @return renderingContent - */ - @javax.annotation.Nullable - public Object getRenderingContent() { - return renderingContent; - } - - public void setRenderingContent(Object renderingContent) { - this.renderingContent = renderingContent; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchParams searchParams = (SearchParams) o; - return ( - Objects.equals(this.params, searchParams.params) && - Objects.equals(this.similarQuery, searchParams.similarQuery) && - Objects.equals(this.filters, searchParams.filters) && - Objects.equals(this.facetFilters, searchParams.facetFilters) && - Objects.equals(this.optionalFilters, searchParams.optionalFilters) && - Objects.equals(this.numericFilters, searchParams.numericFilters) && - Objects.equals(this.tagFilters, searchParams.tagFilters) && - Objects.equals( - this.sumOrFiltersScores, - searchParams.sumOrFiltersScores - ) && - Objects.equals(this.facets, searchParams.facets) && - Objects.equals(this.maxValuesPerFacet, searchParams.maxValuesPerFacet) && - Objects.equals( - this.facetingAfterDistinct, - searchParams.facetingAfterDistinct - ) && - Objects.equals(this.sortFacetValuesBy, searchParams.sortFacetValuesBy) && - Objects.equals(this.page, searchParams.page) && - Objects.equals(this.offset, searchParams.offset) && - Objects.equals(this.length, searchParams.length) && - Objects.equals(this.aroundLatLng, searchParams.aroundLatLng) && - Objects.equals(this.aroundLatLngViaIP, searchParams.aroundLatLngViaIP) && - Objects.equals(this.aroundRadius, searchParams.aroundRadius) && - Objects.equals(this.aroundPrecision, searchParams.aroundPrecision) && - Objects.equals( - this.minimumAroundRadius, - searchParams.minimumAroundRadius - ) && - Objects.equals(this.insideBoundingBox, searchParams.insideBoundingBox) && - Objects.equals(this.insidePolygon, searchParams.insidePolygon) && - Objects.equals(this.naturalLanguages, searchParams.naturalLanguages) && - Objects.equals(this.ruleContexts, searchParams.ruleContexts) && - Objects.equals( - this.personalizationImpact, - searchParams.personalizationImpact - ) && - Objects.equals(this.userToken, searchParams.userToken) && - Objects.equals(this.getRankingInfo, searchParams.getRankingInfo) && - Objects.equals(this.clickAnalytics, searchParams.clickAnalytics) && - Objects.equals(this.analytics, searchParams.analytics) && - Objects.equals(this.analyticsTags, searchParams.analyticsTags) && - Objects.equals( - this.percentileComputation, - searchParams.percentileComputation - ) && - Objects.equals(this.enableABTest, searchParams.enableABTest) && - Objects.equals(this.enableReRanking, searchParams.enableReRanking) && - Objects.equals(this.query, searchParams.query) && - Objects.equals( - this.searchableAttributes, - searchParams.searchableAttributes - ) && - Objects.equals( - this.attributesForFaceting, - searchParams.attributesForFaceting - ) && - Objects.equals( - this.unretrievableAttributes, - searchParams.unretrievableAttributes - ) && - Objects.equals( - this.attributesToRetrieve, - searchParams.attributesToRetrieve - ) && - Objects.equals( - this.restrictSearchableAttributes, - searchParams.restrictSearchableAttributes - ) && - Objects.equals(this.ranking, searchParams.ranking) && - Objects.equals(this.customRanking, searchParams.customRanking) && - Objects.equals( - this.relevancyStrictness, - searchParams.relevancyStrictness - ) && - Objects.equals( - this.attributesToHighlight, - searchParams.attributesToHighlight - ) && - Objects.equals( - this.attributesToSnippet, - searchParams.attributesToSnippet - ) && - Objects.equals(this.highlightPreTag, searchParams.highlightPreTag) && - Objects.equals(this.highlightPostTag, searchParams.highlightPostTag) && - Objects.equals( - this.snippetEllipsisText, - searchParams.snippetEllipsisText - ) && - Objects.equals( - this.restrictHighlightAndSnippetArrays, - searchParams.restrictHighlightAndSnippetArrays - ) && - Objects.equals(this.hitsPerPage, searchParams.hitsPerPage) && - Objects.equals( - this.minWordSizefor1Typo, - searchParams.minWordSizefor1Typo - ) && - Objects.equals( - this.minWordSizefor2Typos, - searchParams.minWordSizefor2Typos - ) && - Objects.equals(this.typoTolerance, searchParams.typoTolerance) && - Objects.equals( - this.allowTyposOnNumericTokens, - searchParams.allowTyposOnNumericTokens - ) && - Objects.equals( - this.disableTypoToleranceOnAttributes, - searchParams.disableTypoToleranceOnAttributes - ) && - Objects.equals(this.separatorsToIndex, searchParams.separatorsToIndex) && - Objects.equals(this.ignorePlurals, searchParams.ignorePlurals) && - Objects.equals(this.removeStopWords, searchParams.removeStopWords) && - Objects.equals( - this.keepDiacriticsOnCharacters, - searchParams.keepDiacriticsOnCharacters - ) && - Objects.equals(this.queryLanguages, searchParams.queryLanguages) && - Objects.equals(this.decompoundQuery, searchParams.decompoundQuery) && - Objects.equals(this.enableRules, searchParams.enableRules) && - Objects.equals( - this.enablePersonalization, - searchParams.enablePersonalization - ) && - Objects.equals(this.queryType, searchParams.queryType) && - Objects.equals( - this.removeWordsIfNoResults, - searchParams.removeWordsIfNoResults - ) && - Objects.equals(this.advancedSyntax, searchParams.advancedSyntax) && - Objects.equals(this.optionalWords, searchParams.optionalWords) && - Objects.equals( - this.disableExactOnAttributes, - searchParams.disableExactOnAttributes - ) && - Objects.equals( - this.exactOnSingleWordQuery, - searchParams.exactOnSingleWordQuery - ) && - Objects.equals( - this.alternativesAsExact, - searchParams.alternativesAsExact - ) && - Objects.equals( - this.advancedSyntaxFeatures, - searchParams.advancedSyntaxFeatures - ) && - Objects.equals(this.distinct, searchParams.distinct) && - Objects.equals(this.synonyms, searchParams.synonyms) && - Objects.equals( - this.replaceSynonymsInHighlight, - searchParams.replaceSynonymsInHighlight - ) && - Objects.equals(this.minProximity, searchParams.minProximity) && - Objects.equals(this.responseFields, searchParams.responseFields) && - Objects.equals(this.maxFacetHits, searchParams.maxFacetHits) && - Objects.equals( - this.attributeCriteriaComputedByMinProximity, - searchParams.attributeCriteriaComputedByMinProximity - ) && - Objects.equals(this.renderingContent, searchParams.renderingContent) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - params, - similarQuery, - filters, - facetFilters, - optionalFilters, - numericFilters, - tagFilters, - sumOrFiltersScores, - facets, - maxValuesPerFacet, - facetingAfterDistinct, - sortFacetValuesBy, - page, - offset, - length, - aroundLatLng, - aroundLatLngViaIP, - aroundRadius, - aroundPrecision, - minimumAroundRadius, - insideBoundingBox, - insidePolygon, - naturalLanguages, - ruleContexts, - personalizationImpact, - userToken, - getRankingInfo, - clickAnalytics, - analytics, - analyticsTags, - percentileComputation, - enableABTest, - enableReRanking, - query, - searchableAttributes, - attributesForFaceting, - unretrievableAttributes, - attributesToRetrieve, - restrictSearchableAttributes, - ranking, - customRanking, - relevancyStrictness, - attributesToHighlight, - attributesToSnippet, - highlightPreTag, - highlightPostTag, - snippetEllipsisText, - restrictHighlightAndSnippetArrays, - hitsPerPage, - minWordSizefor1Typo, - minWordSizefor2Typos, - typoTolerance, - allowTyposOnNumericTokens, - disableTypoToleranceOnAttributes, - separatorsToIndex, - ignorePlurals, - removeStopWords, - keepDiacriticsOnCharacters, - queryLanguages, - decompoundQuery, - enableRules, - enablePersonalization, - queryType, - removeWordsIfNoResults, - advancedSyntax, - optionalWords, - disableExactOnAttributes, - exactOnSingleWordQuery, - alternativesAsExact, - advancedSyntaxFeatures, - distinct, - synonyms, - replaceSynonymsInHighlight, - minProximity, - responseFields, - maxFacetHits, - attributeCriteriaComputedByMinProximity, - renderingContent - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchParams {\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb - .append(" similarQuery: ") - .append(toIndentedString(similarQuery)) - .append("\n"); - sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - sb - .append(" facetFilters: ") - .append(toIndentedString(facetFilters)) - .append("\n"); - sb - .append(" optionalFilters: ") - .append(toIndentedString(optionalFilters)) - .append("\n"); - sb - .append(" numericFilters: ") - .append(toIndentedString(numericFilters)) - .append("\n"); - sb - .append(" tagFilters: ") - .append(toIndentedString(tagFilters)) - .append("\n"); - sb - .append(" sumOrFiltersScores: ") - .append(toIndentedString(sumOrFiltersScores)) - .append("\n"); - sb.append(" facets: ").append(toIndentedString(facets)).append("\n"); - sb - .append(" maxValuesPerFacet: ") - .append(toIndentedString(maxValuesPerFacet)) - .append("\n"); - sb - .append(" facetingAfterDistinct: ") - .append(toIndentedString(facetingAfterDistinct)) - .append("\n"); - sb - .append(" sortFacetValuesBy: ") - .append(toIndentedString(sortFacetValuesBy)) - .append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); - sb.append(" length: ").append(toIndentedString(length)).append("\n"); - sb - .append(" aroundLatLng: ") - .append(toIndentedString(aroundLatLng)) - .append("\n"); - sb - .append(" aroundLatLngViaIP: ") - .append(toIndentedString(aroundLatLngViaIP)) - .append("\n"); - sb - .append(" aroundRadius: ") - .append(toIndentedString(aroundRadius)) - .append("\n"); - sb - .append(" aroundPrecision: ") - .append(toIndentedString(aroundPrecision)) - .append("\n"); - sb - .append(" minimumAroundRadius: ") - .append(toIndentedString(minimumAroundRadius)) - .append("\n"); - sb - .append(" insideBoundingBox: ") - .append(toIndentedString(insideBoundingBox)) - .append("\n"); - sb - .append(" insidePolygon: ") - .append(toIndentedString(insidePolygon)) - .append("\n"); - sb - .append(" naturalLanguages: ") - .append(toIndentedString(naturalLanguages)) - .append("\n"); - sb - .append(" ruleContexts: ") - .append(toIndentedString(ruleContexts)) - .append("\n"); - sb - .append(" personalizationImpact: ") - .append(toIndentedString(personalizationImpact)) - .append("\n"); - sb - .append(" userToken: ") - .append(toIndentedString(userToken)) - .append("\n"); - sb - .append(" getRankingInfo: ") - .append(toIndentedString(getRankingInfo)) - .append("\n"); - sb - .append(" clickAnalytics: ") - .append(toIndentedString(clickAnalytics)) - .append("\n"); - sb - .append(" analytics: ") - .append(toIndentedString(analytics)) - .append("\n"); - sb - .append(" analyticsTags: ") - .append(toIndentedString(analyticsTags)) - .append("\n"); - sb - .append(" percentileComputation: ") - .append(toIndentedString(percentileComputation)) - .append("\n"); - sb - .append(" enableABTest: ") - .append(toIndentedString(enableABTest)) - .append("\n"); - sb - .append(" enableReRanking: ") - .append(toIndentedString(enableReRanking)) - .append("\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb - .append(" searchableAttributes: ") - .append(toIndentedString(searchableAttributes)) - .append("\n"); - sb - .append(" attributesForFaceting: ") - .append(toIndentedString(attributesForFaceting)) - .append("\n"); - sb - .append(" unretrievableAttributes: ") - .append(toIndentedString(unretrievableAttributes)) - .append("\n"); - sb - .append(" attributesToRetrieve: ") - .append(toIndentedString(attributesToRetrieve)) - .append("\n"); - sb - .append(" restrictSearchableAttributes: ") - .append(toIndentedString(restrictSearchableAttributes)) - .append("\n"); - sb.append(" ranking: ").append(toIndentedString(ranking)).append("\n"); - sb - .append(" customRanking: ") - .append(toIndentedString(customRanking)) - .append("\n"); - sb - .append(" relevancyStrictness: ") - .append(toIndentedString(relevancyStrictness)) - .append("\n"); - sb - .append(" attributesToHighlight: ") - .append(toIndentedString(attributesToHighlight)) - .append("\n"); - sb - .append(" attributesToSnippet: ") - .append(toIndentedString(attributesToSnippet)) - .append("\n"); - sb - .append(" highlightPreTag: ") - .append(toIndentedString(highlightPreTag)) - .append("\n"); - sb - .append(" highlightPostTag: ") - .append(toIndentedString(highlightPostTag)) - .append("\n"); - sb - .append(" snippetEllipsisText: ") - .append(toIndentedString(snippetEllipsisText)) - .append("\n"); - sb - .append(" restrictHighlightAndSnippetArrays: ") - .append(toIndentedString(restrictHighlightAndSnippetArrays)) - .append("\n"); - sb - .append(" hitsPerPage: ") - .append(toIndentedString(hitsPerPage)) - .append("\n"); - sb - .append(" minWordSizefor1Typo: ") - .append(toIndentedString(minWordSizefor1Typo)) - .append("\n"); - sb - .append(" minWordSizefor2Typos: ") - .append(toIndentedString(minWordSizefor2Typos)) - .append("\n"); - sb - .append(" typoTolerance: ") - .append(toIndentedString(typoTolerance)) - .append("\n"); - sb - .append(" allowTyposOnNumericTokens: ") - .append(toIndentedString(allowTyposOnNumericTokens)) - .append("\n"); - sb - .append(" disableTypoToleranceOnAttributes: ") - .append(toIndentedString(disableTypoToleranceOnAttributes)) - .append("\n"); - sb - .append(" separatorsToIndex: ") - .append(toIndentedString(separatorsToIndex)) - .append("\n"); - sb - .append(" ignorePlurals: ") - .append(toIndentedString(ignorePlurals)) - .append("\n"); - sb - .append(" removeStopWords: ") - .append(toIndentedString(removeStopWords)) - .append("\n"); - sb - .append(" keepDiacriticsOnCharacters: ") - .append(toIndentedString(keepDiacriticsOnCharacters)) - .append("\n"); - sb - .append(" queryLanguages: ") - .append(toIndentedString(queryLanguages)) - .append("\n"); - sb - .append(" decompoundQuery: ") - .append(toIndentedString(decompoundQuery)) - .append("\n"); - sb - .append(" enableRules: ") - .append(toIndentedString(enableRules)) - .append("\n"); - sb - .append(" enablePersonalization: ") - .append(toIndentedString(enablePersonalization)) - .append("\n"); - sb - .append(" queryType: ") - .append(toIndentedString(queryType)) - .append("\n"); - sb - .append(" removeWordsIfNoResults: ") - .append(toIndentedString(removeWordsIfNoResults)) - .append("\n"); - sb - .append(" advancedSyntax: ") - .append(toIndentedString(advancedSyntax)) - .append("\n"); - sb - .append(" optionalWords: ") - .append(toIndentedString(optionalWords)) - .append("\n"); - sb - .append(" disableExactOnAttributes: ") - .append(toIndentedString(disableExactOnAttributes)) - .append("\n"); - sb - .append(" exactOnSingleWordQuery: ") - .append(toIndentedString(exactOnSingleWordQuery)) - .append("\n"); - sb - .append(" alternativesAsExact: ") - .append(toIndentedString(alternativesAsExact)) - .append("\n"); - sb - .append(" advancedSyntaxFeatures: ") - .append(toIndentedString(advancedSyntaxFeatures)) - .append("\n"); - sb.append(" distinct: ").append(toIndentedString(distinct)).append("\n"); - sb.append(" synonyms: ").append(toIndentedString(synonyms)).append("\n"); - sb - .append(" replaceSynonymsInHighlight: ") - .append(toIndentedString(replaceSynonymsInHighlight)) - .append("\n"); - sb - .append(" minProximity: ") - .append(toIndentedString(minProximity)) - .append("\n"); - sb - .append(" responseFields: ") - .append(toIndentedString(responseFields)) - .append("\n"); - sb - .append(" maxFacetHits: ") - .append(toIndentedString(maxFacetHits)) - .append("\n"); - sb - .append(" attributeCriteriaComputedByMinProximity: ") - .append(toIndentedString(attributeCriteriaComputedByMinProximity)) - .append("\n"); - sb - .append(" renderingContent: ") - .append(toIndentedString(renderingContent)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchParamsObject.java b/algoliasearch-core/com/algolia/model/SearchParamsObject.java deleted file mode 100644 index cd5ed538b..000000000 --- a/algoliasearch-core/com/algolia/model/SearchParamsObject.java +++ /dev/null @@ -1,2945 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** SearchParamsObject */ -public class SearchParamsObject { - - @SerializedName("similarQuery") - private String similarQuery = ""; - - @SerializedName("filters") - private String filters = ""; - - @SerializedName("facetFilters") - private List facetFilters = null; - - @SerializedName("optionalFilters") - private List optionalFilters = null; - - @SerializedName("numericFilters") - private List numericFilters = null; - - @SerializedName("tagFilters") - private List tagFilters = null; - - @SerializedName("sumOrFiltersScores") - private Boolean sumOrFiltersScores = false; - - @SerializedName("facets") - private List facets = null; - - @SerializedName("maxValuesPerFacet") - private Integer maxValuesPerFacet = 100; - - @SerializedName("facetingAfterDistinct") - private Boolean facetingAfterDistinct = false; - - @SerializedName("sortFacetValuesBy") - private String sortFacetValuesBy = "count"; - - @SerializedName("page") - private Integer page = 0; - - @SerializedName("offset") - private Integer offset; - - @SerializedName("length") - private Integer length; - - @SerializedName("aroundLatLng") - private String aroundLatLng = ""; - - @SerializedName("aroundLatLngViaIP") - private Boolean aroundLatLngViaIP = false; - - @SerializedName("aroundRadius") - private OneOfintegerstring aroundRadius; - - @SerializedName("aroundPrecision") - private Integer aroundPrecision = 10; - - @SerializedName("minimumAroundRadius") - private Integer minimumAroundRadius; - - @SerializedName("insideBoundingBox") - private List insideBoundingBox = null; - - @SerializedName("insidePolygon") - private List insidePolygon = null; - - @SerializedName("naturalLanguages") - private List naturalLanguages = null; - - @SerializedName("ruleContexts") - private List ruleContexts = null; - - @SerializedName("personalizationImpact") - private Integer personalizationImpact = 100; - - @SerializedName("userToken") - private String userToken; - - @SerializedName("getRankingInfo") - private Boolean getRankingInfo = false; - - @SerializedName("clickAnalytics") - private Boolean clickAnalytics = false; - - @SerializedName("analytics") - private Boolean analytics = true; - - @SerializedName("analyticsTags") - private List analyticsTags = null; - - @SerializedName("percentileComputation") - private Boolean percentileComputation = true; - - @SerializedName("enableABTest") - private Boolean enableABTest = true; - - @SerializedName("enableReRanking") - private Boolean enableReRanking = true; - - @SerializedName("query") - private String query = ""; - - @SerializedName("searchableAttributes") - private List searchableAttributes = null; - - @SerializedName("attributesForFaceting") - private List attributesForFaceting = null; - - @SerializedName("unretrievableAttributes") - private List unretrievableAttributes = null; - - @SerializedName("attributesToRetrieve") - private List attributesToRetrieve = null; - - @SerializedName("restrictSearchableAttributes") - private List restrictSearchableAttributes = null; - - @SerializedName("ranking") - private List ranking = null; - - @SerializedName("customRanking") - private List customRanking = null; - - @SerializedName("relevancyStrictness") - private Integer relevancyStrictness = 100; - - @SerializedName("attributesToHighlight") - private List attributesToHighlight = null; - - @SerializedName("attributesToSnippet") - private List attributesToSnippet = null; - - @SerializedName("highlightPreTag") - private String highlightPreTag = ""; - - @SerializedName("highlightPostTag") - private String highlightPostTag = ""; - - @SerializedName("snippetEllipsisText") - private String snippetEllipsisText = "…"; - - @SerializedName("restrictHighlightAndSnippetArrays") - private Boolean restrictHighlightAndSnippetArrays = false; - - @SerializedName("hitsPerPage") - private Integer hitsPerPage = 20; - - @SerializedName("minWordSizefor1Typo") - private Integer minWordSizefor1Typo = 4; - - @SerializedName("minWordSizefor2Typos") - private Integer minWordSizefor2Typos = 8; - - /** Controls whether typo tolerance is enabled and how it is applied. */ - @JsonAdapter(TypoToleranceEnum.Adapter.class) - public enum TypoToleranceEnum { - TRUE("true"), - - FALSE("false"), - - MIN("min"), - - STRICT("strict"); - - private String value; - - TypoToleranceEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypoToleranceEnum fromValue(String value) { - for (TypoToleranceEnum b : TypoToleranceEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final TypoToleranceEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypoToleranceEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return TypoToleranceEnum.fromValue(value); - } - } - } - - @SerializedName("typoTolerance") - private TypoToleranceEnum typoTolerance = TypoToleranceEnum.TRUE; - - @SerializedName("allowTyposOnNumericTokens") - private Boolean allowTyposOnNumericTokens = true; - - @SerializedName("disableTypoToleranceOnAttributes") - private List disableTypoToleranceOnAttributes = null; - - @SerializedName("separatorsToIndex") - private String separatorsToIndex = ""; - - @SerializedName("ignorePlurals") - private String ignorePlurals = "false"; - - @SerializedName("removeStopWords") - private String removeStopWords = "false"; - - @SerializedName("keepDiacriticsOnCharacters") - private String keepDiacriticsOnCharacters = ""; - - @SerializedName("queryLanguages") - private List queryLanguages = null; - - @SerializedName("decompoundQuery") - private Boolean decompoundQuery = true; - - @SerializedName("enableRules") - private Boolean enableRules = true; - - @SerializedName("enablePersonalization") - private Boolean enablePersonalization = false; - - /** Controls if and how query words are interpreted as prefixes. */ - @JsonAdapter(QueryTypeEnum.Adapter.class) - public enum QueryTypeEnum { - PREFIXLAST("prefixLast"), - - PREFIXALL("prefixAll"), - - PREFIXNONE("prefixNone"); - - private String value; - - QueryTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static QueryTypeEnum fromValue(String value) { - for (QueryTypeEnum b : QueryTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final QueryTypeEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public QueryTypeEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return QueryTypeEnum.fromValue(value); - } - } - } - - @SerializedName("queryType") - private QueryTypeEnum queryType = QueryTypeEnum.PREFIXLAST; - - /** Selects a strategy to remove words from the query when it doesn't match any hits. */ - @JsonAdapter(RemoveWordsIfNoResultsEnum.Adapter.class) - public enum RemoveWordsIfNoResultsEnum { - NONE("none"), - - LASTWORDS("lastWords"), - - FIRSTWORDS("firstWords"), - - ALLOPTIONAL("allOptional"); - - private String value; - - RemoveWordsIfNoResultsEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static RemoveWordsIfNoResultsEnum fromValue(String value) { - for (RemoveWordsIfNoResultsEnum b : RemoveWordsIfNoResultsEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final RemoveWordsIfNoResultsEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public RemoveWordsIfNoResultsEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return RemoveWordsIfNoResultsEnum.fromValue(value); - } - } - } - - @SerializedName("removeWordsIfNoResults") - private RemoveWordsIfNoResultsEnum removeWordsIfNoResults = - RemoveWordsIfNoResultsEnum.NONE; - - @SerializedName("advancedSyntax") - private Boolean advancedSyntax = false; - - @SerializedName("optionalWords") - private List optionalWords = null; - - @SerializedName("disableExactOnAttributes") - private List disableExactOnAttributes = null; - - /** Controls how the exact ranking criterion is computed when the query contains only one word. */ - @JsonAdapter(ExactOnSingleWordQueryEnum.Adapter.class) - public enum ExactOnSingleWordQueryEnum { - ATTRIBUTE("attribute"), - - NONE("none"), - - WORD("word"); - - private String value; - - ExactOnSingleWordQueryEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ExactOnSingleWordQueryEnum fromValue(String value) { - for (ExactOnSingleWordQueryEnum b : ExactOnSingleWordQueryEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final ExactOnSingleWordQueryEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ExactOnSingleWordQueryEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return ExactOnSingleWordQueryEnum.fromValue(value); - } - } - } - - @SerializedName("exactOnSingleWordQuery") - private ExactOnSingleWordQueryEnum exactOnSingleWordQuery = - ExactOnSingleWordQueryEnum.ATTRIBUTE; - - /** Gets or Sets alternativesAsExact */ - @JsonAdapter(AlternativesAsExactEnum.Adapter.class) - public enum AlternativesAsExactEnum { - IGNOREPLURALS("ignorePlurals"), - - SINGLEWORDSYNONYM("singleWordSynonym"), - - MULTIWORDSSYNONYM("multiWordsSynonym"); - - private String value; - - AlternativesAsExactEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AlternativesAsExactEnum fromValue(String value) { - for (AlternativesAsExactEnum b : AlternativesAsExactEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final AlternativesAsExactEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AlternativesAsExactEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return AlternativesAsExactEnum.fromValue(value); - } - } - } - - @SerializedName("alternativesAsExact") - private List alternativesAsExact = null; - - /** Gets or Sets advancedSyntaxFeatures */ - @JsonAdapter(AdvancedSyntaxFeaturesEnum.Adapter.class) - public enum AdvancedSyntaxFeaturesEnum { - EXACTPHRASE("exactPhrase"), - - EXCLUDEWORDS("excludeWords"); - - private String value; - - AdvancedSyntaxFeaturesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AdvancedSyntaxFeaturesEnum fromValue(String value) { - for (AdvancedSyntaxFeaturesEnum b : AdvancedSyntaxFeaturesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter - extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final AdvancedSyntaxFeaturesEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AdvancedSyntaxFeaturesEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return AdvancedSyntaxFeaturesEnum.fromValue(value); - } - } - } - - @SerializedName("advancedSyntaxFeatures") - private List advancedSyntaxFeatures = null; - - @SerializedName("distinct") - private Integer distinct = 0; - - @SerializedName("synonyms") - private Boolean synonyms = true; - - @SerializedName("replaceSynonymsInHighlight") - private Boolean replaceSynonymsInHighlight = false; - - @SerializedName("minProximity") - private Integer minProximity = 1; - - @SerializedName("responseFields") - private List responseFields = null; - - @SerializedName("maxFacetHits") - private Integer maxFacetHits = 10; - - @SerializedName("attributeCriteriaComputedByMinProximity") - private Boolean attributeCriteriaComputedByMinProximity = false; - - @SerializedName("renderingContent") - private Object renderingContent = new Object(); - - public SearchParamsObject similarQuery(String similarQuery) { - this.similarQuery = similarQuery; - return this; - } - - /** - * Overrides the query parameter and performs a more generic search that can be used to find - * \"similar\" results. - * - * @return similarQuery - */ - @javax.annotation.Nullable - public String getSimilarQuery() { - return similarQuery; - } - - public void setSimilarQuery(String similarQuery) { - this.similarQuery = similarQuery; - } - - public SearchParamsObject filters(String filters) { - this.filters = filters; - return this; - } - - /** - * Filter the query with numeric, facet and/or tag filters. - * - * @return filters - */ - @javax.annotation.Nullable - public String getFilters() { - return filters; - } - - public void setFilters(String filters) { - this.filters = filters; - } - - public SearchParamsObject facetFilters(List facetFilters) { - this.facetFilters = facetFilters; - return this; - } - - public SearchParamsObject addFacetFiltersItem(String facetFiltersItem) { - if (this.facetFilters == null) { - this.facetFilters = new ArrayList<>(); - } - this.facetFilters.add(facetFiltersItem); - return this; - } - - /** - * Filter hits by facet value. - * - * @return facetFilters - */ - @javax.annotation.Nullable - public List getFacetFilters() { - return facetFilters; - } - - public void setFacetFilters(List facetFilters) { - this.facetFilters = facetFilters; - } - - public SearchParamsObject optionalFilters(List optionalFilters) { - this.optionalFilters = optionalFilters; - return this; - } - - public SearchParamsObject addOptionalFiltersItem(String optionalFiltersItem) { - if (this.optionalFilters == null) { - this.optionalFilters = new ArrayList<>(); - } - this.optionalFilters.add(optionalFiltersItem); - return this; - } - - /** - * Create filters for ranking purposes, where records that match the filter are ranked higher, or - * lower in the case of a negative optional filter. - * - * @return optionalFilters - */ - @javax.annotation.Nullable - public List getOptionalFilters() { - return optionalFilters; - } - - public void setOptionalFilters(List optionalFilters) { - this.optionalFilters = optionalFilters; - } - - public SearchParamsObject numericFilters(List numericFilters) { - this.numericFilters = numericFilters; - return this; - } - - public SearchParamsObject addNumericFiltersItem(String numericFiltersItem) { - if (this.numericFilters == null) { - this.numericFilters = new ArrayList<>(); - } - this.numericFilters.add(numericFiltersItem); - return this; - } - - /** - * Filter on numeric attributes. - * - * @return numericFilters - */ - @javax.annotation.Nullable - public List getNumericFilters() { - return numericFilters; - } - - public void setNumericFilters(List numericFilters) { - this.numericFilters = numericFilters; - } - - public SearchParamsObject tagFilters(List tagFilters) { - this.tagFilters = tagFilters; - return this; - } - - public SearchParamsObject addTagFiltersItem(String tagFiltersItem) { - if (this.tagFilters == null) { - this.tagFilters = new ArrayList<>(); - } - this.tagFilters.add(tagFiltersItem); - return this; - } - - /** - * Filter hits by tags. - * - * @return tagFilters - */ - @javax.annotation.Nullable - public List getTagFilters() { - return tagFilters; - } - - public void setTagFilters(List tagFilters) { - this.tagFilters = tagFilters; - } - - public SearchParamsObject sumOrFiltersScores(Boolean sumOrFiltersScores) { - this.sumOrFiltersScores = sumOrFiltersScores; - return this; - } - - /** - * Determines how to calculate the total score for filtering. - * - * @return sumOrFiltersScores - */ - @javax.annotation.Nullable - public Boolean getSumOrFiltersScores() { - return sumOrFiltersScores; - } - - public void setSumOrFiltersScores(Boolean sumOrFiltersScores) { - this.sumOrFiltersScores = sumOrFiltersScores; - } - - public SearchParamsObject facets(List facets) { - this.facets = facets; - return this; - } - - public SearchParamsObject addFacetsItem(String facetsItem) { - if (this.facets == null) { - this.facets = new ArrayList<>(); - } - this.facets.add(facetsItem); - return this; - } - - /** - * Retrieve facets and their facet values. - * - * @return facets - */ - @javax.annotation.Nullable - public List getFacets() { - return facets; - } - - public void setFacets(List facets) { - this.facets = facets; - } - - public SearchParamsObject maxValuesPerFacet(Integer maxValuesPerFacet) { - this.maxValuesPerFacet = maxValuesPerFacet; - return this; - } - - /** - * Maximum number of facet values to return for each facet during a regular search. - * - * @return maxValuesPerFacet - */ - @javax.annotation.Nullable - public Integer getMaxValuesPerFacet() { - return maxValuesPerFacet; - } - - public void setMaxValuesPerFacet(Integer maxValuesPerFacet) { - this.maxValuesPerFacet = maxValuesPerFacet; - } - - public SearchParamsObject facetingAfterDistinct( - Boolean facetingAfterDistinct - ) { - this.facetingAfterDistinct = facetingAfterDistinct; - return this; - } - - /** - * Force faceting to be applied after de-duplication (via the Distinct setting). - * - * @return facetingAfterDistinct - */ - @javax.annotation.Nullable - public Boolean getFacetingAfterDistinct() { - return facetingAfterDistinct; - } - - public void setFacetingAfterDistinct(Boolean facetingAfterDistinct) { - this.facetingAfterDistinct = facetingAfterDistinct; - } - - public SearchParamsObject sortFacetValuesBy(String sortFacetValuesBy) { - this.sortFacetValuesBy = sortFacetValuesBy; - return this; - } - - /** - * Controls how facet values are fetched. - * - * @return sortFacetValuesBy - */ - @javax.annotation.Nullable - public String getSortFacetValuesBy() { - return sortFacetValuesBy; - } - - public void setSortFacetValuesBy(String sortFacetValuesBy) { - this.sortFacetValuesBy = sortFacetValuesBy; - } - - public SearchParamsObject page(Integer page) { - this.page = page; - return this; - } - - /** - * Specify the page to retrieve. - * - * @return page - */ - @javax.annotation.Nullable - public Integer getPage() { - return page; - } - - public void setPage(Integer page) { - this.page = page; - } - - public SearchParamsObject offset(Integer offset) { - this.offset = offset; - return this; - } - - /** - * Specify the offset of the first hit to return. - * - * @return offset - */ - @javax.annotation.Nullable - public Integer getOffset() { - return offset; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public SearchParamsObject length(Integer length) { - this.length = length; - return this; - } - - /** - * Set the number of hits to retrieve (used only with offset). minimum: 1 maximum: 1000 - * - * @return length - */ - @javax.annotation.Nullable - public Integer getLength() { - return length; - } - - public void setLength(Integer length) { - this.length = length; - } - - public SearchParamsObject aroundLatLng(String aroundLatLng) { - this.aroundLatLng = aroundLatLng; - return this; - } - - /** - * Search for entries around a central geolocation, enabling a geo search within a circular area. - * - * @return aroundLatLng - */ - @javax.annotation.Nullable - public String getAroundLatLng() { - return aroundLatLng; - } - - public void setAroundLatLng(String aroundLatLng) { - this.aroundLatLng = aroundLatLng; - } - - public SearchParamsObject aroundLatLngViaIP(Boolean aroundLatLngViaIP) { - this.aroundLatLngViaIP = aroundLatLngViaIP; - return this; - } - - /** - * Search for entries around a given location automatically computed from the requester's IP - * address. - * - * @return aroundLatLngViaIP - */ - @javax.annotation.Nullable - public Boolean getAroundLatLngViaIP() { - return aroundLatLngViaIP; - } - - public void setAroundLatLngViaIP(Boolean aroundLatLngViaIP) { - this.aroundLatLngViaIP = aroundLatLngViaIP; - } - - public SearchParamsObject aroundRadius(OneOfintegerstring aroundRadius) { - this.aroundRadius = aroundRadius; - return this; - } - - /** - * Define the maximum radius for a geo search (in meters). - * - * @return aroundRadius - */ - @javax.annotation.Nullable - public OneOfintegerstring getAroundRadius() { - return aroundRadius; - } - - public void setAroundRadius(OneOfintegerstring aroundRadius) { - this.aroundRadius = aroundRadius; - } - - public SearchParamsObject aroundPrecision(Integer aroundPrecision) { - this.aroundPrecision = aroundPrecision; - return this; - } - - /** - * Precision of geo search (in meters), to add grouping by geo location to the ranking formula. - * - * @return aroundPrecision - */ - @javax.annotation.Nullable - public Integer getAroundPrecision() { - return aroundPrecision; - } - - public void setAroundPrecision(Integer aroundPrecision) { - this.aroundPrecision = aroundPrecision; - } - - public SearchParamsObject minimumAroundRadius(Integer minimumAroundRadius) { - this.minimumAroundRadius = minimumAroundRadius; - return this; - } - - /** - * Minimum radius (in meters) used for a geo search when aroundRadius is not set. minimum: 1 - * - * @return minimumAroundRadius - */ - @javax.annotation.Nullable - public Integer getMinimumAroundRadius() { - return minimumAroundRadius; - } - - public void setMinimumAroundRadius(Integer minimumAroundRadius) { - this.minimumAroundRadius = minimumAroundRadius; - } - - public SearchParamsObject insideBoundingBox( - List insideBoundingBox - ) { - this.insideBoundingBox = insideBoundingBox; - return this; - } - - public SearchParamsObject addInsideBoundingBoxItem( - BigDecimal insideBoundingBoxItem - ) { - if (this.insideBoundingBox == null) { - this.insideBoundingBox = new ArrayList<>(); - } - this.insideBoundingBox.add(insideBoundingBoxItem); - return this; - } - - /** - * Search inside a rectangular area (in geo coordinates). - * - * @return insideBoundingBox - */ - @javax.annotation.Nullable - public List getInsideBoundingBox() { - return insideBoundingBox; - } - - public void setInsideBoundingBox(List insideBoundingBox) { - this.insideBoundingBox = insideBoundingBox; - } - - public SearchParamsObject insidePolygon(List insidePolygon) { - this.insidePolygon = insidePolygon; - return this; - } - - public SearchParamsObject addInsidePolygonItem(BigDecimal insidePolygonItem) { - if (this.insidePolygon == null) { - this.insidePolygon = new ArrayList<>(); - } - this.insidePolygon.add(insidePolygonItem); - return this; - } - - /** - * Search inside a polygon (in geo coordinates). - * - * @return insidePolygon - */ - @javax.annotation.Nullable - public List getInsidePolygon() { - return insidePolygon; - } - - public void setInsidePolygon(List insidePolygon) { - this.insidePolygon = insidePolygon; - } - - public SearchParamsObject naturalLanguages(List naturalLanguages) { - this.naturalLanguages = naturalLanguages; - return this; - } - - public SearchParamsObject addNaturalLanguagesItem( - String naturalLanguagesItem - ) { - if (this.naturalLanguages == null) { - this.naturalLanguages = new ArrayList<>(); - } - this.naturalLanguages.add(naturalLanguagesItem); - return this; - } - - /** - * This parameter changes the default values of certain parameters and settings that work best for - * a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, - * analyticsTags and ruleContexts. These parameters and settings work well together when the query - * is formatted in natural language instead of keywords, for example when your user performs a - * voice search. - * - * @return naturalLanguages - */ - @javax.annotation.Nullable - public List getNaturalLanguages() { - return naturalLanguages; - } - - public void setNaturalLanguages(List naturalLanguages) { - this.naturalLanguages = naturalLanguages; - } - - public SearchParamsObject ruleContexts(List ruleContexts) { - this.ruleContexts = ruleContexts; - return this; - } - - public SearchParamsObject addRuleContextsItem(String ruleContextsItem) { - if (this.ruleContexts == null) { - this.ruleContexts = new ArrayList<>(); - } - this.ruleContexts.add(ruleContextsItem); - return this; - } - - /** - * Enables contextual rules. - * - * @return ruleContexts - */ - @javax.annotation.Nullable - public List getRuleContexts() { - return ruleContexts; - } - - public void setRuleContexts(List ruleContexts) { - this.ruleContexts = ruleContexts; - } - - public SearchParamsObject personalizationImpact( - Integer personalizationImpact - ) { - this.personalizationImpact = personalizationImpact; - return this; - } - - /** - * Define the impact of the Personalization feature. - * - * @return personalizationImpact - */ - @javax.annotation.Nullable - public Integer getPersonalizationImpact() { - return personalizationImpact; - } - - public void setPersonalizationImpact(Integer personalizationImpact) { - this.personalizationImpact = personalizationImpact; - } - - public SearchParamsObject userToken(String userToken) { - this.userToken = userToken; - return this; - } - - /** - * Associates a certain user token with the current search. - * - * @return userToken - */ - @javax.annotation.Nullable - public String getUserToken() { - return userToken; - } - - public void setUserToken(String userToken) { - this.userToken = userToken; - } - - public SearchParamsObject getRankingInfo(Boolean getRankingInfo) { - this.getRankingInfo = getRankingInfo; - return this; - } - - /** - * Retrieve detailed ranking information. - * - * @return getRankingInfo - */ - @javax.annotation.Nullable - public Boolean getGetRankingInfo() { - return getRankingInfo; - } - - public void setGetRankingInfo(Boolean getRankingInfo) { - this.getRankingInfo = getRankingInfo; - } - - public SearchParamsObject clickAnalytics(Boolean clickAnalytics) { - this.clickAnalytics = clickAnalytics; - return this; - } - - /** - * Enable the Click Analytics feature. - * - * @return clickAnalytics - */ - @javax.annotation.Nullable - public Boolean getClickAnalytics() { - return clickAnalytics; - } - - public void setClickAnalytics(Boolean clickAnalytics) { - this.clickAnalytics = clickAnalytics; - } - - public SearchParamsObject analytics(Boolean analytics) { - this.analytics = analytics; - return this; - } - - /** - * Whether the current query will be taken into account in the Analytics. - * - * @return analytics - */ - @javax.annotation.Nullable - public Boolean getAnalytics() { - return analytics; - } - - public void setAnalytics(Boolean analytics) { - this.analytics = analytics; - } - - public SearchParamsObject analyticsTags(List analyticsTags) { - this.analyticsTags = analyticsTags; - return this; - } - - public SearchParamsObject addAnalyticsTagsItem(String analyticsTagsItem) { - if (this.analyticsTags == null) { - this.analyticsTags = new ArrayList<>(); - } - this.analyticsTags.add(analyticsTagsItem); - return this; - } - - /** - * List of tags to apply to the query for analytics purposes. - * - * @return analyticsTags - */ - @javax.annotation.Nullable - public List getAnalyticsTags() { - return analyticsTags; - } - - public void setAnalyticsTags(List analyticsTags) { - this.analyticsTags = analyticsTags; - } - - public SearchParamsObject percentileComputation( - Boolean percentileComputation - ) { - this.percentileComputation = percentileComputation; - return this; - } - - /** - * Whether to include or exclude a query from the processing-time percentile computation. - * - * @return percentileComputation - */ - @javax.annotation.Nullable - public Boolean getPercentileComputation() { - return percentileComputation; - } - - public void setPercentileComputation(Boolean percentileComputation) { - this.percentileComputation = percentileComputation; - } - - public SearchParamsObject enableABTest(Boolean enableABTest) { - this.enableABTest = enableABTest; - return this; - } - - /** - * Whether this search should participate in running AB tests. - * - * @return enableABTest - */ - @javax.annotation.Nullable - public Boolean getEnableABTest() { - return enableABTest; - } - - public void setEnableABTest(Boolean enableABTest) { - this.enableABTest = enableABTest; - } - - public SearchParamsObject enableReRanking(Boolean enableReRanking) { - this.enableReRanking = enableReRanking; - return this; - } - - /** - * Whether this search should use AI Re-Ranking. - * - * @return enableReRanking - */ - @javax.annotation.Nullable - public Boolean getEnableReRanking() { - return enableReRanking; - } - - public void setEnableReRanking(Boolean enableReRanking) { - this.enableReRanking = enableReRanking; - } - - public SearchParamsObject query(String query) { - this.query = query; - return this; - } - - /** - * The text to search in the index. - * - * @return query - */ - @javax.annotation.Nonnull - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public SearchParamsObject searchableAttributes( - List searchableAttributes - ) { - this.searchableAttributes = searchableAttributes; - return this; - } - - public SearchParamsObject addSearchableAttributesItem( - String searchableAttributesItem - ) { - if (this.searchableAttributes == null) { - this.searchableAttributes = new ArrayList<>(); - } - this.searchableAttributes.add(searchableAttributesItem); - return this; - } - - /** - * The complete list of attributes used for searching. - * - * @return searchableAttributes - */ - @javax.annotation.Nullable - public List getSearchableAttributes() { - return searchableAttributes; - } - - public void setSearchableAttributes(List searchableAttributes) { - this.searchableAttributes = searchableAttributes; - } - - public SearchParamsObject attributesForFaceting( - List attributesForFaceting - ) { - this.attributesForFaceting = attributesForFaceting; - return this; - } - - public SearchParamsObject addAttributesForFacetingItem( - String attributesForFacetingItem - ) { - if (this.attributesForFaceting == null) { - this.attributesForFaceting = new ArrayList<>(); - } - this.attributesForFaceting.add(attributesForFacetingItem); - return this; - } - - /** - * The complete list of attributes that will be used for faceting. - * - * @return attributesForFaceting - */ - @javax.annotation.Nullable - public List getAttributesForFaceting() { - return attributesForFaceting; - } - - public void setAttributesForFaceting(List attributesForFaceting) { - this.attributesForFaceting = attributesForFaceting; - } - - public SearchParamsObject unretrievableAttributes( - List unretrievableAttributes - ) { - this.unretrievableAttributes = unretrievableAttributes; - return this; - } - - public SearchParamsObject addUnretrievableAttributesItem( - String unretrievableAttributesItem - ) { - if (this.unretrievableAttributes == null) { - this.unretrievableAttributes = new ArrayList<>(); - } - this.unretrievableAttributes.add(unretrievableAttributesItem); - return this; - } - - /** - * List of attributes that can't be retrieved at query time. - * - * @return unretrievableAttributes - */ - @javax.annotation.Nullable - public List getUnretrievableAttributes() { - return unretrievableAttributes; - } - - public void setUnretrievableAttributes(List unretrievableAttributes) { - this.unretrievableAttributes = unretrievableAttributes; - } - - public SearchParamsObject attributesToRetrieve( - List attributesToRetrieve - ) { - this.attributesToRetrieve = attributesToRetrieve; - return this; - } - - public SearchParamsObject addAttributesToRetrieveItem( - String attributesToRetrieveItem - ) { - if (this.attributesToRetrieve == null) { - this.attributesToRetrieve = new ArrayList<>(); - } - this.attributesToRetrieve.add(attributesToRetrieveItem); - return this; - } - - /** - * This parameter controls which attributes to retrieve and which not to retrieve. - * - * @return attributesToRetrieve - */ - @javax.annotation.Nullable - public List getAttributesToRetrieve() { - return attributesToRetrieve; - } - - public void setAttributesToRetrieve(List attributesToRetrieve) { - this.attributesToRetrieve = attributesToRetrieve; - } - - public SearchParamsObject restrictSearchableAttributes( - List restrictSearchableAttributes - ) { - this.restrictSearchableAttributes = restrictSearchableAttributes; - return this; - } - - public SearchParamsObject addRestrictSearchableAttributesItem( - String restrictSearchableAttributesItem - ) { - if (this.restrictSearchableAttributes == null) { - this.restrictSearchableAttributes = new ArrayList<>(); - } - this.restrictSearchableAttributes.add(restrictSearchableAttributesItem); - return this; - } - - /** - * Restricts a given query to look in only a subset of your searchable attributes. - * - * @return restrictSearchableAttributes - */ - @javax.annotation.Nullable - public List getRestrictSearchableAttributes() { - return restrictSearchableAttributes; - } - - public void setRestrictSearchableAttributes( - List restrictSearchableAttributes - ) { - this.restrictSearchableAttributes = restrictSearchableAttributes; - } - - public SearchParamsObject ranking(List ranking) { - this.ranking = ranking; - return this; - } - - public SearchParamsObject addRankingItem(String rankingItem) { - if (this.ranking == null) { - this.ranking = new ArrayList<>(); - } - this.ranking.add(rankingItem); - return this; - } - - /** - * Controls how Algolia should sort your results. - * - * @return ranking - */ - @javax.annotation.Nullable - public List getRanking() { - return ranking; - } - - public void setRanking(List ranking) { - this.ranking = ranking; - } - - public SearchParamsObject customRanking(List customRanking) { - this.customRanking = customRanking; - return this; - } - - public SearchParamsObject addCustomRankingItem(String customRankingItem) { - if (this.customRanking == null) { - this.customRanking = new ArrayList<>(); - } - this.customRanking.add(customRankingItem); - return this; - } - - /** - * Specifies the custom ranking criterion. - * - * @return customRanking - */ - @javax.annotation.Nullable - public List getCustomRanking() { - return customRanking; - } - - public void setCustomRanking(List customRanking) { - this.customRanking = customRanking; - } - - public SearchParamsObject relevancyStrictness(Integer relevancyStrictness) { - this.relevancyStrictness = relevancyStrictness; - return this; - } - - /** - * Controls the relevancy threshold below which less relevant results aren't included in the - * results. - * - * @return relevancyStrictness - */ - @javax.annotation.Nullable - public Integer getRelevancyStrictness() { - return relevancyStrictness; - } - - public void setRelevancyStrictness(Integer relevancyStrictness) { - this.relevancyStrictness = relevancyStrictness; - } - - public SearchParamsObject attributesToHighlight( - List attributesToHighlight - ) { - this.attributesToHighlight = attributesToHighlight; - return this; - } - - public SearchParamsObject addAttributesToHighlightItem( - String attributesToHighlightItem - ) { - if (this.attributesToHighlight == null) { - this.attributesToHighlight = new ArrayList<>(); - } - this.attributesToHighlight.add(attributesToHighlightItem); - return this; - } - - /** - * List of attributes to highlight. - * - * @return attributesToHighlight - */ - @javax.annotation.Nullable - public List getAttributesToHighlight() { - return attributesToHighlight; - } - - public void setAttributesToHighlight(List attributesToHighlight) { - this.attributesToHighlight = attributesToHighlight; - } - - public SearchParamsObject attributesToSnippet( - List attributesToSnippet - ) { - this.attributesToSnippet = attributesToSnippet; - return this; - } - - public SearchParamsObject addAttributesToSnippetItem( - String attributesToSnippetItem - ) { - if (this.attributesToSnippet == null) { - this.attributesToSnippet = new ArrayList<>(); - } - this.attributesToSnippet.add(attributesToSnippetItem); - return this; - } - - /** - * List of attributes to snippet, with an optional maximum number of words to snippet. - * - * @return attributesToSnippet - */ - @javax.annotation.Nullable - public List getAttributesToSnippet() { - return attributesToSnippet; - } - - public void setAttributesToSnippet(List attributesToSnippet) { - this.attributesToSnippet = attributesToSnippet; - } - - public SearchParamsObject highlightPreTag(String highlightPreTag) { - this.highlightPreTag = highlightPreTag; - return this; - } - - /** - * The HTML string to insert before the highlighted parts in all highlight and snippet results. - * - * @return highlightPreTag - */ - @javax.annotation.Nullable - public String getHighlightPreTag() { - return highlightPreTag; - } - - public void setHighlightPreTag(String highlightPreTag) { - this.highlightPreTag = highlightPreTag; - } - - public SearchParamsObject highlightPostTag(String highlightPostTag) { - this.highlightPostTag = highlightPostTag; - return this; - } - - /** - * The HTML string to insert after the highlighted parts in all highlight and snippet results. - * - * @return highlightPostTag - */ - @javax.annotation.Nullable - public String getHighlightPostTag() { - return highlightPostTag; - } - - public void setHighlightPostTag(String highlightPostTag) { - this.highlightPostTag = highlightPostTag; - } - - public SearchParamsObject snippetEllipsisText(String snippetEllipsisText) { - this.snippetEllipsisText = snippetEllipsisText; - return this; - } - - /** - * String used as an ellipsis indicator when a snippet is truncated. - * - * @return snippetEllipsisText - */ - @javax.annotation.Nullable - public String getSnippetEllipsisText() { - return snippetEllipsisText; - } - - public void setSnippetEllipsisText(String snippetEllipsisText) { - this.snippetEllipsisText = snippetEllipsisText; - } - - public SearchParamsObject restrictHighlightAndSnippetArrays( - Boolean restrictHighlightAndSnippetArrays - ) { - this.restrictHighlightAndSnippetArrays = restrictHighlightAndSnippetArrays; - return this; - } - - /** - * Restrict highlighting and snippeting to items that matched the query. - * - * @return restrictHighlightAndSnippetArrays - */ - @javax.annotation.Nullable - public Boolean getRestrictHighlightAndSnippetArrays() { - return restrictHighlightAndSnippetArrays; - } - - public void setRestrictHighlightAndSnippetArrays( - Boolean restrictHighlightAndSnippetArrays - ) { - this.restrictHighlightAndSnippetArrays = restrictHighlightAndSnippetArrays; - } - - public SearchParamsObject hitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - return this; - } - - /** - * Set the number of hits per page. - * - * @return hitsPerPage - */ - @javax.annotation.Nullable - public Integer getHitsPerPage() { - return hitsPerPage; - } - - public void setHitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - } - - public SearchParamsObject minWordSizefor1Typo(Integer minWordSizefor1Typo) { - this.minWordSizefor1Typo = minWordSizefor1Typo; - return this; - } - - /** - * Minimum number of characters a word in the query string must contain to accept matches with 1 - * typo. - * - * @return minWordSizefor1Typo - */ - @javax.annotation.Nullable - public Integer getMinWordSizefor1Typo() { - return minWordSizefor1Typo; - } - - public void setMinWordSizefor1Typo(Integer minWordSizefor1Typo) { - this.minWordSizefor1Typo = minWordSizefor1Typo; - } - - public SearchParamsObject minWordSizefor2Typos(Integer minWordSizefor2Typos) { - this.minWordSizefor2Typos = minWordSizefor2Typos; - return this; - } - - /** - * Minimum number of characters a word in the query string must contain to accept matches with 2 - * typos. - * - * @return minWordSizefor2Typos - */ - @javax.annotation.Nullable - public Integer getMinWordSizefor2Typos() { - return minWordSizefor2Typos; - } - - public void setMinWordSizefor2Typos(Integer minWordSizefor2Typos) { - this.minWordSizefor2Typos = minWordSizefor2Typos; - } - - public SearchParamsObject typoTolerance(TypoToleranceEnum typoTolerance) { - this.typoTolerance = typoTolerance; - return this; - } - - /** - * Controls whether typo tolerance is enabled and how it is applied. - * - * @return typoTolerance - */ - @javax.annotation.Nullable - public TypoToleranceEnum getTypoTolerance() { - return typoTolerance; - } - - public void setTypoTolerance(TypoToleranceEnum typoTolerance) { - this.typoTolerance = typoTolerance; - } - - public SearchParamsObject allowTyposOnNumericTokens( - Boolean allowTyposOnNumericTokens - ) { - this.allowTyposOnNumericTokens = allowTyposOnNumericTokens; - return this; - } - - /** - * Whether to allow typos on numbers (\"numeric tokens\") in the query string. - * - * @return allowTyposOnNumericTokens - */ - @javax.annotation.Nullable - public Boolean getAllowTyposOnNumericTokens() { - return allowTyposOnNumericTokens; - } - - public void setAllowTyposOnNumericTokens(Boolean allowTyposOnNumericTokens) { - this.allowTyposOnNumericTokens = allowTyposOnNumericTokens; - } - - public SearchParamsObject disableTypoToleranceOnAttributes( - List disableTypoToleranceOnAttributes - ) { - this.disableTypoToleranceOnAttributes = disableTypoToleranceOnAttributes; - return this; - } - - public SearchParamsObject addDisableTypoToleranceOnAttributesItem( - String disableTypoToleranceOnAttributesItem - ) { - if (this.disableTypoToleranceOnAttributes == null) { - this.disableTypoToleranceOnAttributes = new ArrayList<>(); - } - this.disableTypoToleranceOnAttributes.add( - disableTypoToleranceOnAttributesItem - ); - return this; - } - - /** - * List of attributes on which you want to disable typo tolerance. - * - * @return disableTypoToleranceOnAttributes - */ - @javax.annotation.Nullable - public List getDisableTypoToleranceOnAttributes() { - return disableTypoToleranceOnAttributes; - } - - public void setDisableTypoToleranceOnAttributes( - List disableTypoToleranceOnAttributes - ) { - this.disableTypoToleranceOnAttributes = disableTypoToleranceOnAttributes; - } - - public SearchParamsObject separatorsToIndex(String separatorsToIndex) { - this.separatorsToIndex = separatorsToIndex; - return this; - } - - /** - * Control which separators are indexed. - * - * @return separatorsToIndex - */ - @javax.annotation.Nullable - public String getSeparatorsToIndex() { - return separatorsToIndex; - } - - public void setSeparatorsToIndex(String separatorsToIndex) { - this.separatorsToIndex = separatorsToIndex; - } - - public SearchParamsObject ignorePlurals(String ignorePlurals) { - this.ignorePlurals = ignorePlurals; - return this; - } - - /** - * Treats singular, plurals, and other forms of declensions as matching terms. - * - * @return ignorePlurals - */ - @javax.annotation.Nullable - public String getIgnorePlurals() { - return ignorePlurals; - } - - public void setIgnorePlurals(String ignorePlurals) { - this.ignorePlurals = ignorePlurals; - } - - public SearchParamsObject removeStopWords(String removeStopWords) { - this.removeStopWords = removeStopWords; - return this; - } - - /** - * Removes stop (common) words from the query before executing it. - * - * @return removeStopWords - */ - @javax.annotation.Nullable - public String getRemoveStopWords() { - return removeStopWords; - } - - public void setRemoveStopWords(String removeStopWords) { - this.removeStopWords = removeStopWords; - } - - public SearchParamsObject keepDiacriticsOnCharacters( - String keepDiacriticsOnCharacters - ) { - this.keepDiacriticsOnCharacters = keepDiacriticsOnCharacters; - return this; - } - - /** - * List of characters that the engine shouldn't automatically normalize. - * - * @return keepDiacriticsOnCharacters - */ - @javax.annotation.Nullable - public String getKeepDiacriticsOnCharacters() { - return keepDiacriticsOnCharacters; - } - - public void setKeepDiacriticsOnCharacters(String keepDiacriticsOnCharacters) { - this.keepDiacriticsOnCharacters = keepDiacriticsOnCharacters; - } - - public SearchParamsObject queryLanguages(List queryLanguages) { - this.queryLanguages = queryLanguages; - return this; - } - - public SearchParamsObject addQueryLanguagesItem(String queryLanguagesItem) { - if (this.queryLanguages == null) { - this.queryLanguages = new ArrayList<>(); - } - this.queryLanguages.add(queryLanguagesItem); - return this; - } - - /** - * Sets the languages to be used by language-specific settings and functionalities such as - * ignorePlurals, removeStopWords, and CJK word-detection. - * - * @return queryLanguages - */ - @javax.annotation.Nullable - public List getQueryLanguages() { - return queryLanguages; - } - - public void setQueryLanguages(List queryLanguages) { - this.queryLanguages = queryLanguages; - } - - public SearchParamsObject decompoundQuery(Boolean decompoundQuery) { - this.decompoundQuery = decompoundQuery; - return this; - } - - /** - * Splits compound words into their composing atoms in the query. - * - * @return decompoundQuery - */ - @javax.annotation.Nullable - public Boolean getDecompoundQuery() { - return decompoundQuery; - } - - public void setDecompoundQuery(Boolean decompoundQuery) { - this.decompoundQuery = decompoundQuery; - } - - public SearchParamsObject enableRules(Boolean enableRules) { - this.enableRules = enableRules; - return this; - } - - /** - * Whether Rules should be globally enabled. - * - * @return enableRules - */ - @javax.annotation.Nullable - public Boolean getEnableRules() { - return enableRules; - } - - public void setEnableRules(Boolean enableRules) { - this.enableRules = enableRules; - } - - public SearchParamsObject enablePersonalization( - Boolean enablePersonalization - ) { - this.enablePersonalization = enablePersonalization; - return this; - } - - /** - * Enable the Personalization feature. - * - * @return enablePersonalization - */ - @javax.annotation.Nullable - public Boolean getEnablePersonalization() { - return enablePersonalization; - } - - public void setEnablePersonalization(Boolean enablePersonalization) { - this.enablePersonalization = enablePersonalization; - } - - public SearchParamsObject queryType(QueryTypeEnum queryType) { - this.queryType = queryType; - return this; - } - - /** - * Controls if and how query words are interpreted as prefixes. - * - * @return queryType - */ - @javax.annotation.Nullable - public QueryTypeEnum getQueryType() { - return queryType; - } - - public void setQueryType(QueryTypeEnum queryType) { - this.queryType = queryType; - } - - public SearchParamsObject removeWordsIfNoResults( - RemoveWordsIfNoResultsEnum removeWordsIfNoResults - ) { - this.removeWordsIfNoResults = removeWordsIfNoResults; - return this; - } - - /** - * Selects a strategy to remove words from the query when it doesn't match any hits. - * - * @return removeWordsIfNoResults - */ - @javax.annotation.Nullable - public RemoveWordsIfNoResultsEnum getRemoveWordsIfNoResults() { - return removeWordsIfNoResults; - } - - public void setRemoveWordsIfNoResults( - RemoveWordsIfNoResultsEnum removeWordsIfNoResults - ) { - this.removeWordsIfNoResults = removeWordsIfNoResults; - } - - public SearchParamsObject advancedSyntax(Boolean advancedSyntax) { - this.advancedSyntax = advancedSyntax; - return this; - } - - /** - * Enables the advanced query syntax. - * - * @return advancedSyntax - */ - @javax.annotation.Nullable - public Boolean getAdvancedSyntax() { - return advancedSyntax; - } - - public void setAdvancedSyntax(Boolean advancedSyntax) { - this.advancedSyntax = advancedSyntax; - } - - public SearchParamsObject optionalWords(List optionalWords) { - this.optionalWords = optionalWords; - return this; - } - - public SearchParamsObject addOptionalWordsItem(String optionalWordsItem) { - if (this.optionalWords == null) { - this.optionalWords = new ArrayList<>(); - } - this.optionalWords.add(optionalWordsItem); - return this; - } - - /** - * A list of words that should be considered as optional when found in the query. - * - * @return optionalWords - */ - @javax.annotation.Nullable - public List getOptionalWords() { - return optionalWords; - } - - public void setOptionalWords(List optionalWords) { - this.optionalWords = optionalWords; - } - - public SearchParamsObject disableExactOnAttributes( - List disableExactOnAttributes - ) { - this.disableExactOnAttributes = disableExactOnAttributes; - return this; - } - - public SearchParamsObject addDisableExactOnAttributesItem( - String disableExactOnAttributesItem - ) { - if (this.disableExactOnAttributes == null) { - this.disableExactOnAttributes = new ArrayList<>(); - } - this.disableExactOnAttributes.add(disableExactOnAttributesItem); - return this; - } - - /** - * List of attributes on which you want to disable the exact ranking criterion. - * - * @return disableExactOnAttributes - */ - @javax.annotation.Nullable - public List getDisableExactOnAttributes() { - return disableExactOnAttributes; - } - - public void setDisableExactOnAttributes( - List disableExactOnAttributes - ) { - this.disableExactOnAttributes = disableExactOnAttributes; - } - - public SearchParamsObject exactOnSingleWordQuery( - ExactOnSingleWordQueryEnum exactOnSingleWordQuery - ) { - this.exactOnSingleWordQuery = exactOnSingleWordQuery; - return this; - } - - /** - * Controls how the exact ranking criterion is computed when the query contains only one word. - * - * @return exactOnSingleWordQuery - */ - @javax.annotation.Nullable - public ExactOnSingleWordQueryEnum getExactOnSingleWordQuery() { - return exactOnSingleWordQuery; - } - - public void setExactOnSingleWordQuery( - ExactOnSingleWordQueryEnum exactOnSingleWordQuery - ) { - this.exactOnSingleWordQuery = exactOnSingleWordQuery; - } - - public SearchParamsObject alternativesAsExact( - List alternativesAsExact - ) { - this.alternativesAsExact = alternativesAsExact; - return this; - } - - public SearchParamsObject addAlternativesAsExactItem( - AlternativesAsExactEnum alternativesAsExactItem - ) { - if (this.alternativesAsExact == null) { - this.alternativesAsExact = new ArrayList<>(); - } - this.alternativesAsExact.add(alternativesAsExactItem); - return this; - } - - /** - * List of alternatives that should be considered an exact match by the exact ranking criterion. - * - * @return alternativesAsExact - */ - @javax.annotation.Nullable - public List getAlternativesAsExact() { - return alternativesAsExact; - } - - public void setAlternativesAsExact( - List alternativesAsExact - ) { - this.alternativesAsExact = alternativesAsExact; - } - - public SearchParamsObject advancedSyntaxFeatures( - List advancedSyntaxFeatures - ) { - this.advancedSyntaxFeatures = advancedSyntaxFeatures; - return this; - } - - public SearchParamsObject addAdvancedSyntaxFeaturesItem( - AdvancedSyntaxFeaturesEnum advancedSyntaxFeaturesItem - ) { - if (this.advancedSyntaxFeatures == null) { - this.advancedSyntaxFeatures = new ArrayList<>(); - } - this.advancedSyntaxFeatures.add(advancedSyntaxFeaturesItem); - return this; - } - - /** - * Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is - * enabled. - * - * @return advancedSyntaxFeatures - */ - @javax.annotation.Nullable - public List getAdvancedSyntaxFeatures() { - return advancedSyntaxFeatures; - } - - public void setAdvancedSyntaxFeatures( - List advancedSyntaxFeatures - ) { - this.advancedSyntaxFeatures = advancedSyntaxFeatures; - } - - public SearchParamsObject distinct(Integer distinct) { - this.distinct = distinct; - return this; - } - - /** - * Enables de-duplication or grouping of results. minimum: 0 maximum: 4 - * - * @return distinct - */ - @javax.annotation.Nullable - public Integer getDistinct() { - return distinct; - } - - public void setDistinct(Integer distinct) { - this.distinct = distinct; - } - - public SearchParamsObject synonyms(Boolean synonyms) { - this.synonyms = synonyms; - return this; - } - - /** - * Whether to take into account an index's synonyms for a particular search. - * - * @return synonyms - */ - @javax.annotation.Nullable - public Boolean getSynonyms() { - return synonyms; - } - - public void setSynonyms(Boolean synonyms) { - this.synonyms = synonyms; - } - - public SearchParamsObject replaceSynonymsInHighlight( - Boolean replaceSynonymsInHighlight - ) { - this.replaceSynonymsInHighlight = replaceSynonymsInHighlight; - return this; - } - - /** - * Whether to highlight and snippet the original word that matches the synonym or the synonym - * itself. - * - * @return replaceSynonymsInHighlight - */ - @javax.annotation.Nullable - public Boolean getReplaceSynonymsInHighlight() { - return replaceSynonymsInHighlight; - } - - public void setReplaceSynonymsInHighlight( - Boolean replaceSynonymsInHighlight - ) { - this.replaceSynonymsInHighlight = replaceSynonymsInHighlight; - } - - public SearchParamsObject minProximity(Integer minProximity) { - this.minProximity = minProximity; - return this; - } - - /** - * Precision of the proximity ranking criterion. minimum: 1 maximum: 7 - * - * @return minProximity - */ - @javax.annotation.Nullable - public Integer getMinProximity() { - return minProximity; - } - - public void setMinProximity(Integer minProximity) { - this.minProximity = minProximity; - } - - public SearchParamsObject responseFields(List responseFields) { - this.responseFields = responseFields; - return this; - } - - public SearchParamsObject addResponseFieldsItem(String responseFieldsItem) { - if (this.responseFields == null) { - this.responseFields = new ArrayList<>(); - } - this.responseFields.add(responseFieldsItem); - return this; - } - - /** - * Choose which fields to return in the API response. This parameters applies to search and browse - * queries. - * - * @return responseFields - */ - @javax.annotation.Nullable - public List getResponseFields() { - return responseFields; - } - - public void setResponseFields(List responseFields) { - this.responseFields = responseFields; - } - - public SearchParamsObject maxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * Maximum number of facet hits to return during a search for facet values. For performance - * reasons, the maximum allowed number of returned values is 100. maximum: 100 - * - * @return maxFacetHits - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - - public void setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - } - - public SearchParamsObject attributeCriteriaComputedByMinProximity( - Boolean attributeCriteriaComputedByMinProximity - ) { - this.attributeCriteriaComputedByMinProximity = - attributeCriteriaComputedByMinProximity; - return this; - } - - /** - * When attribute is ranked above proximity in your ranking formula, proximity is used to select - * which searchable attribute is matched in the attribute ranking stage. - * - * @return attributeCriteriaComputedByMinProximity - */ - @javax.annotation.Nullable - public Boolean getAttributeCriteriaComputedByMinProximity() { - return attributeCriteriaComputedByMinProximity; - } - - public void setAttributeCriteriaComputedByMinProximity( - Boolean attributeCriteriaComputedByMinProximity - ) { - this.attributeCriteriaComputedByMinProximity = - attributeCriteriaComputedByMinProximity; - } - - public SearchParamsObject renderingContent(Object renderingContent) { - this.renderingContent = renderingContent; - return this; - } - - /** - * Content defining how the search interface should be rendered. Can be set via the settings for a - * default value and can be overridden via rules. - * - * @return renderingContent - */ - @javax.annotation.Nullable - public Object getRenderingContent() { - return renderingContent; - } - - public void setRenderingContent(Object renderingContent) { - this.renderingContent = renderingContent; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchParamsObject searchParamsObject = (SearchParamsObject) o; - return ( - Objects.equals(this.similarQuery, searchParamsObject.similarQuery) && - Objects.equals(this.filters, searchParamsObject.filters) && - Objects.equals(this.facetFilters, searchParamsObject.facetFilters) && - Objects.equals( - this.optionalFilters, - searchParamsObject.optionalFilters - ) && - Objects.equals(this.numericFilters, searchParamsObject.numericFilters) && - Objects.equals(this.tagFilters, searchParamsObject.tagFilters) && - Objects.equals( - this.sumOrFiltersScores, - searchParamsObject.sumOrFiltersScores - ) && - Objects.equals(this.facets, searchParamsObject.facets) && - Objects.equals( - this.maxValuesPerFacet, - searchParamsObject.maxValuesPerFacet - ) && - Objects.equals( - this.facetingAfterDistinct, - searchParamsObject.facetingAfterDistinct - ) && - Objects.equals( - this.sortFacetValuesBy, - searchParamsObject.sortFacetValuesBy - ) && - Objects.equals(this.page, searchParamsObject.page) && - Objects.equals(this.offset, searchParamsObject.offset) && - Objects.equals(this.length, searchParamsObject.length) && - Objects.equals(this.aroundLatLng, searchParamsObject.aroundLatLng) && - Objects.equals( - this.aroundLatLngViaIP, - searchParamsObject.aroundLatLngViaIP - ) && - Objects.equals(this.aroundRadius, searchParamsObject.aroundRadius) && - Objects.equals( - this.aroundPrecision, - searchParamsObject.aroundPrecision - ) && - Objects.equals( - this.minimumAroundRadius, - searchParamsObject.minimumAroundRadius - ) && - Objects.equals( - this.insideBoundingBox, - searchParamsObject.insideBoundingBox - ) && - Objects.equals(this.insidePolygon, searchParamsObject.insidePolygon) && - Objects.equals( - this.naturalLanguages, - searchParamsObject.naturalLanguages - ) && - Objects.equals(this.ruleContexts, searchParamsObject.ruleContexts) && - Objects.equals( - this.personalizationImpact, - searchParamsObject.personalizationImpact - ) && - Objects.equals(this.userToken, searchParamsObject.userToken) && - Objects.equals(this.getRankingInfo, searchParamsObject.getRankingInfo) && - Objects.equals(this.clickAnalytics, searchParamsObject.clickAnalytics) && - Objects.equals(this.analytics, searchParamsObject.analytics) && - Objects.equals(this.analyticsTags, searchParamsObject.analyticsTags) && - Objects.equals( - this.percentileComputation, - searchParamsObject.percentileComputation - ) && - Objects.equals(this.enableABTest, searchParamsObject.enableABTest) && - Objects.equals( - this.enableReRanking, - searchParamsObject.enableReRanking - ) && - Objects.equals(this.query, searchParamsObject.query) && - Objects.equals( - this.searchableAttributes, - searchParamsObject.searchableAttributes - ) && - Objects.equals( - this.attributesForFaceting, - searchParamsObject.attributesForFaceting - ) && - Objects.equals( - this.unretrievableAttributes, - searchParamsObject.unretrievableAttributes - ) && - Objects.equals( - this.attributesToRetrieve, - searchParamsObject.attributesToRetrieve - ) && - Objects.equals( - this.restrictSearchableAttributes, - searchParamsObject.restrictSearchableAttributes - ) && - Objects.equals(this.ranking, searchParamsObject.ranking) && - Objects.equals(this.customRanking, searchParamsObject.customRanking) && - Objects.equals( - this.relevancyStrictness, - searchParamsObject.relevancyStrictness - ) && - Objects.equals( - this.attributesToHighlight, - searchParamsObject.attributesToHighlight - ) && - Objects.equals( - this.attributesToSnippet, - searchParamsObject.attributesToSnippet - ) && - Objects.equals( - this.highlightPreTag, - searchParamsObject.highlightPreTag - ) && - Objects.equals( - this.highlightPostTag, - searchParamsObject.highlightPostTag - ) && - Objects.equals( - this.snippetEllipsisText, - searchParamsObject.snippetEllipsisText - ) && - Objects.equals( - this.restrictHighlightAndSnippetArrays, - searchParamsObject.restrictHighlightAndSnippetArrays - ) && - Objects.equals(this.hitsPerPage, searchParamsObject.hitsPerPage) && - Objects.equals( - this.minWordSizefor1Typo, - searchParamsObject.minWordSizefor1Typo - ) && - Objects.equals( - this.minWordSizefor2Typos, - searchParamsObject.minWordSizefor2Typos - ) && - Objects.equals(this.typoTolerance, searchParamsObject.typoTolerance) && - Objects.equals( - this.allowTyposOnNumericTokens, - searchParamsObject.allowTyposOnNumericTokens - ) && - Objects.equals( - this.disableTypoToleranceOnAttributes, - searchParamsObject.disableTypoToleranceOnAttributes - ) && - Objects.equals( - this.separatorsToIndex, - searchParamsObject.separatorsToIndex - ) && - Objects.equals(this.ignorePlurals, searchParamsObject.ignorePlurals) && - Objects.equals( - this.removeStopWords, - searchParamsObject.removeStopWords - ) && - Objects.equals( - this.keepDiacriticsOnCharacters, - searchParamsObject.keepDiacriticsOnCharacters - ) && - Objects.equals(this.queryLanguages, searchParamsObject.queryLanguages) && - Objects.equals( - this.decompoundQuery, - searchParamsObject.decompoundQuery - ) && - Objects.equals(this.enableRules, searchParamsObject.enableRules) && - Objects.equals( - this.enablePersonalization, - searchParamsObject.enablePersonalization - ) && - Objects.equals(this.queryType, searchParamsObject.queryType) && - Objects.equals( - this.removeWordsIfNoResults, - searchParamsObject.removeWordsIfNoResults - ) && - Objects.equals(this.advancedSyntax, searchParamsObject.advancedSyntax) && - Objects.equals(this.optionalWords, searchParamsObject.optionalWords) && - Objects.equals( - this.disableExactOnAttributes, - searchParamsObject.disableExactOnAttributes - ) && - Objects.equals( - this.exactOnSingleWordQuery, - searchParamsObject.exactOnSingleWordQuery - ) && - Objects.equals( - this.alternativesAsExact, - searchParamsObject.alternativesAsExact - ) && - Objects.equals( - this.advancedSyntaxFeatures, - searchParamsObject.advancedSyntaxFeatures - ) && - Objects.equals(this.distinct, searchParamsObject.distinct) && - Objects.equals(this.synonyms, searchParamsObject.synonyms) && - Objects.equals( - this.replaceSynonymsInHighlight, - searchParamsObject.replaceSynonymsInHighlight - ) && - Objects.equals(this.minProximity, searchParamsObject.minProximity) && - Objects.equals(this.responseFields, searchParamsObject.responseFields) && - Objects.equals(this.maxFacetHits, searchParamsObject.maxFacetHits) && - Objects.equals( - this.attributeCriteriaComputedByMinProximity, - searchParamsObject.attributeCriteriaComputedByMinProximity - ) && - Objects.equals(this.renderingContent, searchParamsObject.renderingContent) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - similarQuery, - filters, - facetFilters, - optionalFilters, - numericFilters, - tagFilters, - sumOrFiltersScores, - facets, - maxValuesPerFacet, - facetingAfterDistinct, - sortFacetValuesBy, - page, - offset, - length, - aroundLatLng, - aroundLatLngViaIP, - aroundRadius, - aroundPrecision, - minimumAroundRadius, - insideBoundingBox, - insidePolygon, - naturalLanguages, - ruleContexts, - personalizationImpact, - userToken, - getRankingInfo, - clickAnalytics, - analytics, - analyticsTags, - percentileComputation, - enableABTest, - enableReRanking, - query, - searchableAttributes, - attributesForFaceting, - unretrievableAttributes, - attributesToRetrieve, - restrictSearchableAttributes, - ranking, - customRanking, - relevancyStrictness, - attributesToHighlight, - attributesToSnippet, - highlightPreTag, - highlightPostTag, - snippetEllipsisText, - restrictHighlightAndSnippetArrays, - hitsPerPage, - minWordSizefor1Typo, - minWordSizefor2Typos, - typoTolerance, - allowTyposOnNumericTokens, - disableTypoToleranceOnAttributes, - separatorsToIndex, - ignorePlurals, - removeStopWords, - keepDiacriticsOnCharacters, - queryLanguages, - decompoundQuery, - enableRules, - enablePersonalization, - queryType, - removeWordsIfNoResults, - advancedSyntax, - optionalWords, - disableExactOnAttributes, - exactOnSingleWordQuery, - alternativesAsExact, - advancedSyntaxFeatures, - distinct, - synonyms, - replaceSynonymsInHighlight, - minProximity, - responseFields, - maxFacetHits, - attributeCriteriaComputedByMinProximity, - renderingContent - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchParamsObject {\n"); - sb - .append(" similarQuery: ") - .append(toIndentedString(similarQuery)) - .append("\n"); - sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - sb - .append(" facetFilters: ") - .append(toIndentedString(facetFilters)) - .append("\n"); - sb - .append(" optionalFilters: ") - .append(toIndentedString(optionalFilters)) - .append("\n"); - sb - .append(" numericFilters: ") - .append(toIndentedString(numericFilters)) - .append("\n"); - sb - .append(" tagFilters: ") - .append(toIndentedString(tagFilters)) - .append("\n"); - sb - .append(" sumOrFiltersScores: ") - .append(toIndentedString(sumOrFiltersScores)) - .append("\n"); - sb.append(" facets: ").append(toIndentedString(facets)).append("\n"); - sb - .append(" maxValuesPerFacet: ") - .append(toIndentedString(maxValuesPerFacet)) - .append("\n"); - sb - .append(" facetingAfterDistinct: ") - .append(toIndentedString(facetingAfterDistinct)) - .append("\n"); - sb - .append(" sortFacetValuesBy: ") - .append(toIndentedString(sortFacetValuesBy)) - .append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); - sb.append(" length: ").append(toIndentedString(length)).append("\n"); - sb - .append(" aroundLatLng: ") - .append(toIndentedString(aroundLatLng)) - .append("\n"); - sb - .append(" aroundLatLngViaIP: ") - .append(toIndentedString(aroundLatLngViaIP)) - .append("\n"); - sb - .append(" aroundRadius: ") - .append(toIndentedString(aroundRadius)) - .append("\n"); - sb - .append(" aroundPrecision: ") - .append(toIndentedString(aroundPrecision)) - .append("\n"); - sb - .append(" minimumAroundRadius: ") - .append(toIndentedString(minimumAroundRadius)) - .append("\n"); - sb - .append(" insideBoundingBox: ") - .append(toIndentedString(insideBoundingBox)) - .append("\n"); - sb - .append(" insidePolygon: ") - .append(toIndentedString(insidePolygon)) - .append("\n"); - sb - .append(" naturalLanguages: ") - .append(toIndentedString(naturalLanguages)) - .append("\n"); - sb - .append(" ruleContexts: ") - .append(toIndentedString(ruleContexts)) - .append("\n"); - sb - .append(" personalizationImpact: ") - .append(toIndentedString(personalizationImpact)) - .append("\n"); - sb - .append(" userToken: ") - .append(toIndentedString(userToken)) - .append("\n"); - sb - .append(" getRankingInfo: ") - .append(toIndentedString(getRankingInfo)) - .append("\n"); - sb - .append(" clickAnalytics: ") - .append(toIndentedString(clickAnalytics)) - .append("\n"); - sb - .append(" analytics: ") - .append(toIndentedString(analytics)) - .append("\n"); - sb - .append(" analyticsTags: ") - .append(toIndentedString(analyticsTags)) - .append("\n"); - sb - .append(" percentileComputation: ") - .append(toIndentedString(percentileComputation)) - .append("\n"); - sb - .append(" enableABTest: ") - .append(toIndentedString(enableABTest)) - .append("\n"); - sb - .append(" enableReRanking: ") - .append(toIndentedString(enableReRanking)) - .append("\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb - .append(" searchableAttributes: ") - .append(toIndentedString(searchableAttributes)) - .append("\n"); - sb - .append(" attributesForFaceting: ") - .append(toIndentedString(attributesForFaceting)) - .append("\n"); - sb - .append(" unretrievableAttributes: ") - .append(toIndentedString(unretrievableAttributes)) - .append("\n"); - sb - .append(" attributesToRetrieve: ") - .append(toIndentedString(attributesToRetrieve)) - .append("\n"); - sb - .append(" restrictSearchableAttributes: ") - .append(toIndentedString(restrictSearchableAttributes)) - .append("\n"); - sb.append(" ranking: ").append(toIndentedString(ranking)).append("\n"); - sb - .append(" customRanking: ") - .append(toIndentedString(customRanking)) - .append("\n"); - sb - .append(" relevancyStrictness: ") - .append(toIndentedString(relevancyStrictness)) - .append("\n"); - sb - .append(" attributesToHighlight: ") - .append(toIndentedString(attributesToHighlight)) - .append("\n"); - sb - .append(" attributesToSnippet: ") - .append(toIndentedString(attributesToSnippet)) - .append("\n"); - sb - .append(" highlightPreTag: ") - .append(toIndentedString(highlightPreTag)) - .append("\n"); - sb - .append(" highlightPostTag: ") - .append(toIndentedString(highlightPostTag)) - .append("\n"); - sb - .append(" snippetEllipsisText: ") - .append(toIndentedString(snippetEllipsisText)) - .append("\n"); - sb - .append(" restrictHighlightAndSnippetArrays: ") - .append(toIndentedString(restrictHighlightAndSnippetArrays)) - .append("\n"); - sb - .append(" hitsPerPage: ") - .append(toIndentedString(hitsPerPage)) - .append("\n"); - sb - .append(" minWordSizefor1Typo: ") - .append(toIndentedString(minWordSizefor1Typo)) - .append("\n"); - sb - .append(" minWordSizefor2Typos: ") - .append(toIndentedString(minWordSizefor2Typos)) - .append("\n"); - sb - .append(" typoTolerance: ") - .append(toIndentedString(typoTolerance)) - .append("\n"); - sb - .append(" allowTyposOnNumericTokens: ") - .append(toIndentedString(allowTyposOnNumericTokens)) - .append("\n"); - sb - .append(" disableTypoToleranceOnAttributes: ") - .append(toIndentedString(disableTypoToleranceOnAttributes)) - .append("\n"); - sb - .append(" separatorsToIndex: ") - .append(toIndentedString(separatorsToIndex)) - .append("\n"); - sb - .append(" ignorePlurals: ") - .append(toIndentedString(ignorePlurals)) - .append("\n"); - sb - .append(" removeStopWords: ") - .append(toIndentedString(removeStopWords)) - .append("\n"); - sb - .append(" keepDiacriticsOnCharacters: ") - .append(toIndentedString(keepDiacriticsOnCharacters)) - .append("\n"); - sb - .append(" queryLanguages: ") - .append(toIndentedString(queryLanguages)) - .append("\n"); - sb - .append(" decompoundQuery: ") - .append(toIndentedString(decompoundQuery)) - .append("\n"); - sb - .append(" enableRules: ") - .append(toIndentedString(enableRules)) - .append("\n"); - sb - .append(" enablePersonalization: ") - .append(toIndentedString(enablePersonalization)) - .append("\n"); - sb - .append(" queryType: ") - .append(toIndentedString(queryType)) - .append("\n"); - sb - .append(" removeWordsIfNoResults: ") - .append(toIndentedString(removeWordsIfNoResults)) - .append("\n"); - sb - .append(" advancedSyntax: ") - .append(toIndentedString(advancedSyntax)) - .append("\n"); - sb - .append(" optionalWords: ") - .append(toIndentedString(optionalWords)) - .append("\n"); - sb - .append(" disableExactOnAttributes: ") - .append(toIndentedString(disableExactOnAttributes)) - .append("\n"); - sb - .append(" exactOnSingleWordQuery: ") - .append(toIndentedString(exactOnSingleWordQuery)) - .append("\n"); - sb - .append(" alternativesAsExact: ") - .append(toIndentedString(alternativesAsExact)) - .append("\n"); - sb - .append(" advancedSyntaxFeatures: ") - .append(toIndentedString(advancedSyntaxFeatures)) - .append("\n"); - sb.append(" distinct: ").append(toIndentedString(distinct)).append("\n"); - sb.append(" synonyms: ").append(toIndentedString(synonyms)).append("\n"); - sb - .append(" replaceSynonymsInHighlight: ") - .append(toIndentedString(replaceSynonymsInHighlight)) - .append("\n"); - sb - .append(" minProximity: ") - .append(toIndentedString(minProximity)) - .append("\n"); - sb - .append(" responseFields: ") - .append(toIndentedString(responseFields)) - .append("\n"); - sb - .append(" maxFacetHits: ") - .append(toIndentedString(maxFacetHits)) - .append("\n"); - sb - .append(" attributeCriteriaComputedByMinProximity: ") - .append(toIndentedString(attributeCriteriaComputedByMinProximity)) - .append("\n"); - sb - .append(" renderingContent: ") - .append(toIndentedString(renderingContent)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchParamsString.java b/algoliasearch-core/com/algolia/model/SearchParamsString.java deleted file mode 100644 index 4f34f775f..000000000 --- a/algoliasearch-core/com/algolia/model/SearchParamsString.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** SearchParamsString */ -public class SearchParamsString { - - @SerializedName("params") - private String params = ""; - - public SearchParamsString params(String params) { - this.params = params; - return this; - } - - /** - * Search parameters as URL-encoded query string. - * - * @return params - */ - @javax.annotation.Nullable - public String getParams() { - return params; - } - - public void setParams(String params) { - this.params = params; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchParamsString searchParamsString = (SearchParamsString) o; - return Objects.equals(this.params, searchParamsString.params); - } - - @Override - public int hashCode() { - return Objects.hash(params); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchParamsString {\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchResponse.java b/algoliasearch-core/com/algolia/model/SearchResponse.java deleted file mode 100644 index d4df3467a..000000000 --- a/algoliasearch-core/com/algolia/model/SearchResponse.java +++ /dev/null @@ -1,759 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** SearchResponse */ -public class SearchResponse { - - @SerializedName("abTestID") - private Integer abTestID; - - @SerializedName("abTestVariantID") - private Integer abTestVariantID; - - @SerializedName("aroundLatLng") - private String aroundLatLng; - - @SerializedName("automaticRadius") - private String automaticRadius; - - @SerializedName("exhaustiveFacetsCount") - private Boolean exhaustiveFacetsCount; - - @SerializedName("exhaustiveNbHits") - private Boolean exhaustiveNbHits; - - @SerializedName("exhaustiveTypo") - private Boolean exhaustiveTypo; - - @SerializedName("facets") - private Map> facets = null; - - @SerializedName("facets_stats") - private Map facetsStats = null; - - @SerializedName("hitsPerPage") - private Integer hitsPerPage = 20; - - @SerializedName("index") - private String index; - - @SerializedName("indexUsed") - private String indexUsed; - - @SerializedName("message") - private String message; - - @SerializedName("nbHits") - private Integer nbHits; - - @SerializedName("nbPages") - private Integer nbPages; - - @SerializedName("nbSortedHits") - private Integer nbSortedHits; - - @SerializedName("page") - private Integer page = 0; - - @SerializedName("params") - private String params; - - @SerializedName("parsedQuery") - private String parsedQuery; - - @SerializedName("processingTimeMS") - private Integer processingTimeMS; - - @SerializedName("query") - private String query = ""; - - @SerializedName("queryAfterRemoval") - private String queryAfterRemoval; - - @SerializedName("serverUsed") - private String serverUsed; - - @SerializedName("userData") - private Object userData = new Object(); - - @SerializedName("hits") - private List hits = new ArrayList<>(); - - public SearchResponse abTestID(Integer abTestID) { - this.abTestID = abTestID; - return this; - } - - /** - * If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test - * ID. - * - * @return abTestID - */ - @javax.annotation.Nullable - public Integer getAbTestID() { - return abTestID; - } - - public void setAbTestID(Integer abTestID) { - this.abTestID = abTestID; - } - - public SearchResponse abTestVariantID(Integer abTestVariantID) { - this.abTestVariantID = abTestVariantID; - return this; - } - - /** - * If a search encounters an index that is being A/B tested, abTestVariantID reports the variant - * ID of the index used. - * - * @return abTestVariantID - */ - @javax.annotation.Nullable - public Integer getAbTestVariantID() { - return abTestVariantID; - } - - public void setAbTestVariantID(Integer abTestVariantID) { - this.abTestVariantID = abTestVariantID; - } - - public SearchResponse aroundLatLng(String aroundLatLng) { - this.aroundLatLng = aroundLatLng; - return this; - } - - /** - * The computed geo location. - * - * @return aroundLatLng - */ - @javax.annotation.Nullable - public String getAroundLatLng() { - return aroundLatLng; - } - - public void setAroundLatLng(String aroundLatLng) { - this.aroundLatLng = aroundLatLng; - } - - public SearchResponse automaticRadius(String automaticRadius) { - this.automaticRadius = automaticRadius; - return this; - } - - /** - * The automatically computed radius. For legacy reasons, this parameter is a string and not an - * integer. - * - * @return automaticRadius - */ - @javax.annotation.Nullable - public String getAutomaticRadius() { - return automaticRadius; - } - - public void setAutomaticRadius(String automaticRadius) { - this.automaticRadius = automaticRadius; - } - - public SearchResponse exhaustiveFacetsCount(Boolean exhaustiveFacetsCount) { - this.exhaustiveFacetsCount = exhaustiveFacetsCount; - return this; - } - - /** - * Whether the facet count is exhaustive or approximate. - * - * @return exhaustiveFacetsCount - */ - @javax.annotation.Nullable - public Boolean getExhaustiveFacetsCount() { - return exhaustiveFacetsCount; - } - - public void setExhaustiveFacetsCount(Boolean exhaustiveFacetsCount) { - this.exhaustiveFacetsCount = exhaustiveFacetsCount; - } - - public SearchResponse exhaustiveNbHits(Boolean exhaustiveNbHits) { - this.exhaustiveNbHits = exhaustiveNbHits; - return this; - } - - /** - * Indicate if the nbHits count was exhaustive or approximate - * - * @return exhaustiveNbHits - */ - @javax.annotation.Nonnull - public Boolean getExhaustiveNbHits() { - return exhaustiveNbHits; - } - - public void setExhaustiveNbHits(Boolean exhaustiveNbHits) { - this.exhaustiveNbHits = exhaustiveNbHits; - } - - public SearchResponse exhaustiveTypo(Boolean exhaustiveTypo) { - this.exhaustiveTypo = exhaustiveTypo; - return this; - } - - /** - * Indicate if the typo-tolerence search was exhaustive or approximate (only included when - * typo-tolerance is enabled) - * - * @return exhaustiveTypo - */ - @javax.annotation.Nonnull - public Boolean getExhaustiveTypo() { - return exhaustiveTypo; - } - - public void setExhaustiveTypo(Boolean exhaustiveTypo) { - this.exhaustiveTypo = exhaustiveTypo; - } - - public SearchResponse facets(Map> facets) { - this.facets = facets; - return this; - } - - public SearchResponse putFacetsItem( - String key, - Map facetsItem - ) { - if (this.facets == null) { - this.facets = new HashMap<>(); - } - this.facets.put(key, facetsItem); - return this; - } - - /** - * A mapping of each facet name to the corresponding facet counts. - * - * @return facets - */ - @javax.annotation.Nullable - public Map> getFacets() { - return facets; - } - - public void setFacets(Map> facets) { - this.facets = facets; - } - - public SearchResponse facetsStats( - Map facetsStats - ) { - this.facetsStats = facetsStats; - return this; - } - - public SearchResponse putFacetsStatsItem( - String key, - BaseSearchResponseFacetsStats facetsStatsItem - ) { - if (this.facetsStats == null) { - this.facetsStats = new HashMap<>(); - } - this.facetsStats.put(key, facetsStatsItem); - return this; - } - - /** - * Statistics for numerical facets. - * - * @return facetsStats - */ - @javax.annotation.Nullable - public Map getFacetsStats() { - return facetsStats; - } - - public void setFacetsStats( - Map facetsStats - ) { - this.facetsStats = facetsStats; - } - - public SearchResponse hitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - return this; - } - - /** - * Set the number of hits per page. - * - * @return hitsPerPage - */ - @javax.annotation.Nonnull - public Integer getHitsPerPage() { - return hitsPerPage; - } - - public void setHitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - } - - public SearchResponse index(String index) { - this.index = index; - return this; - } - - /** - * Index name used for the query. - * - * @return index - */ - @javax.annotation.Nullable - public String getIndex() { - return index; - } - - public void setIndex(String index) { - this.index = index; - } - - public SearchResponse indexUsed(String indexUsed) { - this.indexUsed = indexUsed; - return this; - } - - /** - * Index name used for the query. In the case of an A/B test, the targeted index isn't always the - * index used by the query. - * - * @return indexUsed - */ - @javax.annotation.Nullable - public String getIndexUsed() { - return indexUsed; - } - - public void setIndexUsed(String indexUsed) { - this.indexUsed = indexUsed; - } - - public SearchResponse message(String message) { - this.message = message; - return this; - } - - /** - * Used to return warnings about the query. - * - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public SearchResponse nbHits(Integer nbHits) { - this.nbHits = nbHits; - return this; - } - - /** - * Number of hits that the search query matched. - * - * @return nbHits - */ - @javax.annotation.Nonnull - public Integer getNbHits() { - return nbHits; - } - - public void setNbHits(Integer nbHits) { - this.nbHits = nbHits; - } - - public SearchResponse nbPages(Integer nbPages) { - this.nbPages = nbPages; - return this; - } - - /** - * Number of pages available for the current query - * - * @return nbPages - */ - @javax.annotation.Nonnull - public Integer getNbPages() { - return nbPages; - } - - public void setNbPages(Integer nbPages) { - this.nbPages = nbPages; - } - - public SearchResponse nbSortedHits(Integer nbSortedHits) { - this.nbSortedHits = nbSortedHits; - return this; - } - - /** - * The number of hits selected and sorted by the relevant sort algorithm - * - * @return nbSortedHits - */ - @javax.annotation.Nullable - public Integer getNbSortedHits() { - return nbSortedHits; - } - - public void setNbSortedHits(Integer nbSortedHits) { - this.nbSortedHits = nbSortedHits; - } - - public SearchResponse page(Integer page) { - this.page = page; - return this; - } - - /** - * Specify the page to retrieve. - * - * @return page - */ - @javax.annotation.Nonnull - public Integer getPage() { - return page; - } - - public void setPage(Integer page) { - this.page = page; - } - - public SearchResponse params(String params) { - this.params = params; - return this; - } - - /** - * A url-encoded string of all search parameters. - * - * @return params - */ - @javax.annotation.Nonnull - public String getParams() { - return params; - } - - public void setParams(String params) { - this.params = params; - } - - public SearchResponse parsedQuery(String parsedQuery) { - this.parsedQuery = parsedQuery; - return this; - } - - /** - * The query string that will be searched, after normalization. - * - * @return parsedQuery - */ - @javax.annotation.Nullable - public String getParsedQuery() { - return parsedQuery; - } - - public void setParsedQuery(String parsedQuery) { - this.parsedQuery = parsedQuery; - } - - public SearchResponse processingTimeMS(Integer processingTimeMS) { - this.processingTimeMS = processingTimeMS; - return this; - } - - /** - * Time the server took to process the request, in milliseconds. - * - * @return processingTimeMS - */ - @javax.annotation.Nonnull - public Integer getProcessingTimeMS() { - return processingTimeMS; - } - - public void setProcessingTimeMS(Integer processingTimeMS) { - this.processingTimeMS = processingTimeMS; - } - - public SearchResponse query(String query) { - this.query = query; - return this; - } - - /** - * The text to search in the index. - * - * @return query - */ - @javax.annotation.Nonnull - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public SearchResponse queryAfterRemoval(String queryAfterRemoval) { - this.queryAfterRemoval = queryAfterRemoval; - return this; - } - - /** - * A markup text indicating which parts of the original query have been removed in order to - * retrieve a non-empty result set. - * - * @return queryAfterRemoval - */ - @javax.annotation.Nullable - public String getQueryAfterRemoval() { - return queryAfterRemoval; - } - - public void setQueryAfterRemoval(String queryAfterRemoval) { - this.queryAfterRemoval = queryAfterRemoval; - } - - public SearchResponse serverUsed(String serverUsed) { - this.serverUsed = serverUsed; - return this; - } - - /** - * Actual host name of the server that processed the request. - * - * @return serverUsed - */ - @javax.annotation.Nullable - public String getServerUsed() { - return serverUsed; - } - - public void setServerUsed(String serverUsed) { - this.serverUsed = serverUsed; - } - - public SearchResponse userData(Object userData) { - this.userData = userData; - return this; - } - - /** - * Lets you store custom data in your indices. - * - * @return userData - */ - @javax.annotation.Nullable - public Object getUserData() { - return userData; - } - - public void setUserData(Object userData) { - this.userData = userData; - } - - public SearchResponse hits(List hits) { - this.hits = hits; - return this; - } - - public SearchResponse addHitsItem(Hit hitsItem) { - this.hits.add(hitsItem); - return this; - } - - /** - * Get hits - * - * @return hits - */ - @javax.annotation.Nonnull - public List getHits() { - return hits; - } - - public void setHits(List hits) { - this.hits = hits; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchResponse searchResponse = (SearchResponse) o; - return ( - Objects.equals(this.abTestID, searchResponse.abTestID) && - Objects.equals(this.abTestVariantID, searchResponse.abTestVariantID) && - Objects.equals(this.aroundLatLng, searchResponse.aroundLatLng) && - Objects.equals(this.automaticRadius, searchResponse.automaticRadius) && - Objects.equals( - this.exhaustiveFacetsCount, - searchResponse.exhaustiveFacetsCount - ) && - Objects.equals(this.exhaustiveNbHits, searchResponse.exhaustiveNbHits) && - Objects.equals(this.exhaustiveTypo, searchResponse.exhaustiveTypo) && - Objects.equals(this.facets, searchResponse.facets) && - Objects.equals(this.facetsStats, searchResponse.facetsStats) && - Objects.equals(this.hitsPerPage, searchResponse.hitsPerPage) && - Objects.equals(this.index, searchResponse.index) && - Objects.equals(this.indexUsed, searchResponse.indexUsed) && - Objects.equals(this.message, searchResponse.message) && - Objects.equals(this.nbHits, searchResponse.nbHits) && - Objects.equals(this.nbPages, searchResponse.nbPages) && - Objects.equals(this.nbSortedHits, searchResponse.nbSortedHits) && - Objects.equals(this.page, searchResponse.page) && - Objects.equals(this.params, searchResponse.params) && - Objects.equals(this.parsedQuery, searchResponse.parsedQuery) && - Objects.equals(this.processingTimeMS, searchResponse.processingTimeMS) && - Objects.equals(this.query, searchResponse.query) && - Objects.equals( - this.queryAfterRemoval, - searchResponse.queryAfterRemoval - ) && - Objects.equals(this.serverUsed, searchResponse.serverUsed) && - Objects.equals(this.userData, searchResponse.userData) && - Objects.equals(this.hits, searchResponse.hits) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - abTestID, - abTestVariantID, - aroundLatLng, - automaticRadius, - exhaustiveFacetsCount, - exhaustiveNbHits, - exhaustiveTypo, - facets, - facetsStats, - hitsPerPage, - index, - indexUsed, - message, - nbHits, - nbPages, - nbSortedHits, - page, - params, - parsedQuery, - processingTimeMS, - query, - queryAfterRemoval, - serverUsed, - userData, - hits - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchResponse {\n"); - sb.append(" abTestID: ").append(toIndentedString(abTestID)).append("\n"); - sb - .append(" abTestVariantID: ") - .append(toIndentedString(abTestVariantID)) - .append("\n"); - sb - .append(" aroundLatLng: ") - .append(toIndentedString(aroundLatLng)) - .append("\n"); - sb - .append(" automaticRadius: ") - .append(toIndentedString(automaticRadius)) - .append("\n"); - sb - .append(" exhaustiveFacetsCount: ") - .append(toIndentedString(exhaustiveFacetsCount)) - .append("\n"); - sb - .append(" exhaustiveNbHits: ") - .append(toIndentedString(exhaustiveNbHits)) - .append("\n"); - sb - .append(" exhaustiveTypo: ") - .append(toIndentedString(exhaustiveTypo)) - .append("\n"); - sb.append(" facets: ").append(toIndentedString(facets)).append("\n"); - sb - .append(" facetsStats: ") - .append(toIndentedString(facetsStats)) - .append("\n"); - sb - .append(" hitsPerPage: ") - .append(toIndentedString(hitsPerPage)) - .append("\n"); - sb.append(" index: ").append(toIndentedString(index)).append("\n"); - sb - .append(" indexUsed: ") - .append(toIndentedString(indexUsed)) - .append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" nbHits: ").append(toIndentedString(nbHits)).append("\n"); - sb.append(" nbPages: ").append(toIndentedString(nbPages)).append("\n"); - sb - .append(" nbSortedHits: ") - .append(toIndentedString(nbSortedHits)) - .append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb - .append(" parsedQuery: ") - .append(toIndentedString(parsedQuery)) - .append("\n"); - sb - .append(" processingTimeMS: ") - .append(toIndentedString(processingTimeMS)) - .append("\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb - .append(" queryAfterRemoval: ") - .append(toIndentedString(queryAfterRemoval)) - .append("\n"); - sb - .append(" serverUsed: ") - .append(toIndentedString(serverUsed)) - .append("\n"); - sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); - sb.append(" hits: ").append(toIndentedString(hits)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchRulesParams.java b/algoliasearch-core/com/algolia/model/SearchRulesParams.java deleted file mode 100644 index 0d30a3cea..000000000 --- a/algoliasearch-core/com/algolia/model/SearchRulesParams.java +++ /dev/null @@ -1,240 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Parameters for the search. */ -public class SearchRulesParams { - - @SerializedName("query") - private String query = ""; - - @SerializedName("anchoring") - private Anchoring anchoring; - - @SerializedName("context") - private String context; - - @SerializedName("page") - private Integer page = 0; - - @SerializedName("hitsPerPage") - private Integer hitsPerPage = 20; - - @SerializedName("enabled") - private Boolean enabled; - - @SerializedName("requestOptions") - private List requestOptions = null; - - public SearchRulesParams query(String query) { - this.query = query; - return this; - } - - /** - * Full text query. - * - * @return query - */ - @javax.annotation.Nullable - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public SearchRulesParams anchoring(Anchoring anchoring) { - this.anchoring = anchoring; - return this; - } - - /** - * Get anchoring - * - * @return anchoring - */ - @javax.annotation.Nullable - public Anchoring getAnchoring() { - return anchoring; - } - - public void setAnchoring(Anchoring anchoring) { - this.anchoring = anchoring; - } - - public SearchRulesParams context(String context) { - this.context = context; - return this; - } - - /** - * Restricts matches to contextual rules with a specific context (exact match). - * - * @return context - */ - @javax.annotation.Nullable - public String getContext() { - return context; - } - - public void setContext(String context) { - this.context = context; - } - - public SearchRulesParams page(Integer page) { - this.page = page; - return this; - } - - /** - * Requested page (zero-based). - * - * @return page - */ - @javax.annotation.Nullable - public Integer getPage() { - return page; - } - - public void setPage(Integer page) { - this.page = page; - } - - public SearchRulesParams hitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - return this; - } - - /** - * Maximum number of hits in a page. Minimum is 1, maximum is 1000. - * - * @return hitsPerPage - */ - @javax.annotation.Nullable - public Integer getHitsPerPage() { - return hitsPerPage; - } - - public void setHitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - } - - public SearchRulesParams enabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * When specified, restricts matches to rules with a specific enabled status. When absent - * (default), all rules are retrieved, regardless of their enabled status. - * - * @return enabled - */ - @javax.annotation.Nullable - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public SearchRulesParams requestOptions(List requestOptions) { - this.requestOptions = requestOptions; - return this; - } - - public SearchRulesParams addRequestOptionsItem(Object requestOptionsItem) { - if (this.requestOptions == null) { - this.requestOptions = new ArrayList<>(); - } - this.requestOptions.add(requestOptionsItem); - return this; - } - - /** - * A mapping of requestOptions to send along with the request. - * - * @return requestOptions - */ - @javax.annotation.Nullable - public List getRequestOptions() { - return requestOptions; - } - - public void setRequestOptions(List requestOptions) { - this.requestOptions = requestOptions; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchRulesParams searchRulesParams = (SearchRulesParams) o; - return ( - Objects.equals(this.query, searchRulesParams.query) && - Objects.equals(this.anchoring, searchRulesParams.anchoring) && - Objects.equals(this.context, searchRulesParams.context) && - Objects.equals(this.page, searchRulesParams.page) && - Objects.equals(this.hitsPerPage, searchRulesParams.hitsPerPage) && - Objects.equals(this.enabled, searchRulesParams.enabled) && - Objects.equals(this.requestOptions, searchRulesParams.requestOptions) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - query, - anchoring, - context, - page, - hitsPerPage, - enabled, - requestOptions - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchRulesParams {\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb - .append(" anchoring: ") - .append(toIndentedString(anchoring)) - .append("\n"); - sb.append(" context: ").append(toIndentedString(context)).append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb - .append(" hitsPerPage: ") - .append(toIndentedString(hitsPerPage)) - .append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb - .append(" requestOptions: ") - .append(toIndentedString(requestOptions)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchRulesResponse.java b/algoliasearch-core/com/algolia/model/SearchRulesResponse.java deleted file mode 100644 index 0d9e1f9cf..000000000 --- a/algoliasearch-core/com/algolia/model/SearchRulesResponse.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** SearchRulesResponse */ -public class SearchRulesResponse { - - @SerializedName("hits") - private List hits = new ArrayList<>(); - - @SerializedName("nbHits") - private Integer nbHits; - - @SerializedName("page") - private Integer page; - - @SerializedName("nbPages") - private Integer nbPages; - - public SearchRulesResponse hits(List hits) { - this.hits = hits; - return this; - } - - public SearchRulesResponse addHitsItem(Rule hitsItem) { - this.hits.add(hitsItem); - return this; - } - - /** - * Fetched rules. - * - * @return hits - */ - @javax.annotation.Nonnull - public List getHits() { - return hits; - } - - public void setHits(List hits) { - this.hits = hits; - } - - public SearchRulesResponse nbHits(Integer nbHits) { - this.nbHits = nbHits; - return this; - } - - /** - * Number of fetched rules. - * - * @return nbHits - */ - @javax.annotation.Nonnull - public Integer getNbHits() { - return nbHits; - } - - public void setNbHits(Integer nbHits) { - this.nbHits = nbHits; - } - - public SearchRulesResponse page(Integer page) { - this.page = page; - return this; - } - - /** - * Current page. - * - * @return page - */ - @javax.annotation.Nonnull - public Integer getPage() { - return page; - } - - public void setPage(Integer page) { - this.page = page; - } - - public SearchRulesResponse nbPages(Integer nbPages) { - this.nbPages = nbPages; - return this; - } - - /** - * Number of pages. - * - * @return nbPages - */ - @javax.annotation.Nonnull - public Integer getNbPages() { - return nbPages; - } - - public void setNbPages(Integer nbPages) { - this.nbPages = nbPages; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchRulesResponse searchRulesResponse = (SearchRulesResponse) o; - return ( - Objects.equals(this.hits, searchRulesResponse.hits) && - Objects.equals(this.nbHits, searchRulesResponse.nbHits) && - Objects.equals(this.page, searchRulesResponse.page) && - Objects.equals(this.nbPages, searchRulesResponse.nbPages) - ); - } - - @Override - public int hashCode() { - return Objects.hash(hits, nbHits, page, nbPages); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchRulesResponse {\n"); - sb.append(" hits: ").append(toIndentedString(hits)).append("\n"); - sb.append(" nbHits: ").append(toIndentedString(nbHits)).append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb.append(" nbPages: ").append(toIndentedString(nbPages)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchSynonymsResponse.java b/algoliasearch-core/com/algolia/model/SearchSynonymsResponse.java deleted file mode 100644 index 49e1f94bf..000000000 --- a/algoliasearch-core/com/algolia/model/SearchSynonymsResponse.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Objects; - -/** SearchSynonymsResponse */ -public class SearchSynonymsResponse extends HashMap { - - @SerializedName("hits") - private List hits = new ArrayList<>(); - - @SerializedName("nbHits") - private Integer nbHits; - - public SearchSynonymsResponse hits(List hits) { - this.hits = hits; - return this; - } - - public SearchSynonymsResponse addHitsItem(SynonymHit hitsItem) { - this.hits.add(hitsItem); - return this; - } - - /** - * Array of synonym objects. - * - * @return hits - */ - @javax.annotation.Nonnull - public List getHits() { - return hits; - } - - public void setHits(List hits) { - this.hits = hits; - } - - public SearchSynonymsResponse nbHits(Integer nbHits) { - this.nbHits = nbHits; - return this; - } - - /** - * Number of hits that the search query matched. - * - * @return nbHits - */ - @javax.annotation.Nonnull - public Integer getNbHits() { - return nbHits; - } - - public void setNbHits(Integer nbHits) { - this.nbHits = nbHits; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchSynonymsResponse searchSynonymsResponse = (SearchSynonymsResponse) o; - return ( - Objects.equals(this.hits, searchSynonymsResponse.hits) && - Objects.equals(this.nbHits, searchSynonymsResponse.nbHits) && - super.equals(o) - ); - } - - @Override - public int hashCode() { - return Objects.hash(hits, nbHits, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchSynonymsResponse {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" hits: ").append(toIndentedString(hits)).append("\n"); - sb.append(" nbHits: ").append(toIndentedString(nbHits)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchUserIdsParams.java b/algoliasearch-core/com/algolia/model/SearchUserIdsParams.java deleted file mode 100644 index b86938a2d..000000000 --- a/algoliasearch-core/com/algolia/model/SearchUserIdsParams.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** OK */ -public class SearchUserIdsParams { - - @SerializedName("query") - private String query; - - @SerializedName("clusterName") - private String clusterName; - - @SerializedName("page") - private Integer page = 0; - - @SerializedName("hitsPerPage") - private Integer hitsPerPage = 20; - - public SearchUserIdsParams query(String query) { - this.query = query; - return this; - } - - /** - * Query to search. The search is a prefix search with typoTolerance. Use empty query to retrieve - * all users. - * - * @return query - */ - @javax.annotation.Nonnull - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public SearchUserIdsParams clusterName(String clusterName) { - this.clusterName = clusterName; - return this; - } - - /** - * Name of the cluster. - * - * @return clusterName - */ - @javax.annotation.Nullable - public String getClusterName() { - return clusterName; - } - - public void setClusterName(String clusterName) { - this.clusterName = clusterName; - } - - public SearchUserIdsParams page(Integer page) { - this.page = page; - return this; - } - - /** - * Specify the page to retrieve. - * - * @return page - */ - @javax.annotation.Nullable - public Integer getPage() { - return page; - } - - public void setPage(Integer page) { - this.page = page; - } - - public SearchUserIdsParams hitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - return this; - } - - /** - * Set the number of hits per page. - * - * @return hitsPerPage - */ - @javax.annotation.Nullable - public Integer getHitsPerPage() { - return hitsPerPage; - } - - public void setHitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchUserIdsParams searchUserIdsParams = (SearchUserIdsParams) o; - return ( - Objects.equals(this.query, searchUserIdsParams.query) && - Objects.equals(this.clusterName, searchUserIdsParams.clusterName) && - Objects.equals(this.page, searchUserIdsParams.page) && - Objects.equals(this.hitsPerPage, searchUserIdsParams.hitsPerPage) - ); - } - - @Override - public int hashCode() { - return Objects.hash(query, clusterName, page, hitsPerPage); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchUserIdsParams {\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb - .append(" clusterName: ") - .append(toIndentedString(clusterName)) - .append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb - .append(" hitsPerPage: ") - .append(toIndentedString(hitsPerPage)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchUserIdsResponse.java b/algoliasearch-core/com/algolia/model/SearchUserIdsResponse.java deleted file mode 100644 index fa4aba4b7..000000000 --- a/algoliasearch-core/com/algolia/model/SearchUserIdsResponse.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** userIDs data. */ -public class SearchUserIdsResponse { - - @SerializedName("hits") - private List hits = new ArrayList<>(); - - @SerializedName("nbHits") - private Integer nbHits; - - @SerializedName("page") - private Integer page = 0; - - @SerializedName("hitsPerPage") - private Integer hitsPerPage = 20; - - @SerializedName("updatedAt") - private String updatedAt; - - public SearchUserIdsResponse hits(List hits) { - this.hits = hits; - return this; - } - - public SearchUserIdsResponse addHitsItem(SearchUserIdsResponseHits hitsItem) { - this.hits.add(hitsItem); - return this; - } - - /** - * List of user object matching the query. - * - * @return hits - */ - @javax.annotation.Nonnull - public List getHits() { - return hits; - } - - public void setHits(List hits) { - this.hits = hits; - } - - public SearchUserIdsResponse nbHits(Integer nbHits) { - this.nbHits = nbHits; - return this; - } - - /** - * Number of hits that the search query matched. - * - * @return nbHits - */ - @javax.annotation.Nonnull - public Integer getNbHits() { - return nbHits; - } - - public void setNbHits(Integer nbHits) { - this.nbHits = nbHits; - } - - public SearchUserIdsResponse page(Integer page) { - this.page = page; - return this; - } - - /** - * Specify the page to retrieve. - * - * @return page - */ - @javax.annotation.Nonnull - public Integer getPage() { - return page; - } - - public void setPage(Integer page) { - this.page = page; - } - - public SearchUserIdsResponse hitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - return this; - } - - /** - * Maximum number of hits in a page. Minimum is 1, maximum is 1000. - * - * @return hitsPerPage - */ - @javax.annotation.Nonnull - public Integer getHitsPerPage() { - return hitsPerPage; - } - - public void setHitsPerPage(Integer hitsPerPage) { - this.hitsPerPage = hitsPerPage; - } - - public SearchUserIdsResponse updatedAt(String updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Date of last update (ISO-8601 format). - * - * @return updatedAt - */ - @javax.annotation.Nonnull - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchUserIdsResponse searchUserIdsResponse = (SearchUserIdsResponse) o; - return ( - Objects.equals(this.hits, searchUserIdsResponse.hits) && - Objects.equals(this.nbHits, searchUserIdsResponse.nbHits) && - Objects.equals(this.page, searchUserIdsResponse.page) && - Objects.equals(this.hitsPerPage, searchUserIdsResponse.hitsPerPage) && - Objects.equals(this.updatedAt, searchUserIdsResponse.updatedAt) - ); - } - - @Override - public int hashCode() { - return Objects.hash(hits, nbHits, page, hitsPerPage, updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchUserIdsResponse {\n"); - sb.append(" hits: ").append(toIndentedString(hits)).append("\n"); - sb.append(" nbHits: ").append(toIndentedString(nbHits)).append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb - .append(" hitsPerPage: ") - .append(toIndentedString(hitsPerPage)) - .append("\n"); - sb - .append(" updatedAt: ") - .append(toIndentedString(updatedAt)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchUserIdsResponseHighlightResult.java b/algoliasearch-core/com/algolia/model/SearchUserIdsResponseHighlightResult.java deleted file mode 100644 index 0b030d087..000000000 --- a/algoliasearch-core/com/algolia/model/SearchUserIdsResponseHighlightResult.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** SearchUserIdsResponseHighlightResult */ -public class SearchUserIdsResponseHighlightResult { - - @SerializedName("userID") - private HighlightResult userID; - - @SerializedName("clusterName") - private HighlightResult clusterName; - - public SearchUserIdsResponseHighlightResult userID(HighlightResult userID) { - this.userID = userID; - return this; - } - - /** - * Get userID - * - * @return userID - */ - @javax.annotation.Nonnull - public HighlightResult getUserID() { - return userID; - } - - public void setUserID(HighlightResult userID) { - this.userID = userID; - } - - public SearchUserIdsResponseHighlightResult clusterName( - HighlightResult clusterName - ) { - this.clusterName = clusterName; - return this; - } - - /** - * Get clusterName - * - * @return clusterName - */ - @javax.annotation.Nonnull - public HighlightResult getClusterName() { - return clusterName; - } - - public void setClusterName(HighlightResult clusterName) { - this.clusterName = clusterName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchUserIdsResponseHighlightResult searchUserIdsResponseHighlightResult = (SearchUserIdsResponseHighlightResult) o; - return ( - Objects.equals( - this.userID, - searchUserIdsResponseHighlightResult.userID - ) && - Objects.equals( - this.clusterName, - searchUserIdsResponseHighlightResult.clusterName - ) - ); - } - - @Override - public int hashCode() { - return Objects.hash(userID, clusterName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchUserIdsResponseHighlightResult {\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb - .append(" clusterName: ") - .append(toIndentedString(clusterName)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SearchUserIdsResponseHits.java b/algoliasearch-core/com/algolia/model/SearchUserIdsResponseHits.java deleted file mode 100644 index 9a948b39f..000000000 --- a/algoliasearch-core/com/algolia/model/SearchUserIdsResponseHits.java +++ /dev/null @@ -1,211 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** SearchUserIdsResponseHits */ -public class SearchUserIdsResponseHits { - - @SerializedName("userID") - private String userID; - - @SerializedName("clusterName") - private String clusterName; - - @SerializedName("nbRecords") - private Integer nbRecords; - - @SerializedName("dataSize") - private Integer dataSize; - - @SerializedName("objectID") - private String objectID; - - @SerializedName("_highlightResult") - private SearchUserIdsResponseHighlightResult highlightResult; - - public SearchUserIdsResponseHits userID(String userID) { - this.userID = userID; - return this; - } - - /** - * userID of the user. - * - * @return userID - */ - @javax.annotation.Nonnull - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - public SearchUserIdsResponseHits clusterName(String clusterName) { - this.clusterName = clusterName; - return this; - } - - /** - * Name of the cluster. - * - * @return clusterName - */ - @javax.annotation.Nonnull - public String getClusterName() { - return clusterName; - } - - public void setClusterName(String clusterName) { - this.clusterName = clusterName; - } - - public SearchUserIdsResponseHits nbRecords(Integer nbRecords) { - this.nbRecords = nbRecords; - return this; - } - - /** - * Number of records in the cluster. - * - * @return nbRecords - */ - @javax.annotation.Nonnull - public Integer getNbRecords() { - return nbRecords; - } - - public void setNbRecords(Integer nbRecords) { - this.nbRecords = nbRecords; - } - - public SearchUserIdsResponseHits dataSize(Integer dataSize) { - this.dataSize = dataSize; - return this; - } - - /** - * Data size taken by all the users assigned to the cluster. - * - * @return dataSize - */ - @javax.annotation.Nonnull - public Integer getDataSize() { - return dataSize; - } - - public void setDataSize(Integer dataSize) { - this.dataSize = dataSize; - } - - public SearchUserIdsResponseHits objectID(String objectID) { - this.objectID = objectID; - return this; - } - - /** - * userID of the requested user. Same as userID. - * - * @return objectID - */ - @javax.annotation.Nonnull - public String getObjectID() { - return objectID; - } - - public void setObjectID(String objectID) { - this.objectID = objectID; - } - - public SearchUserIdsResponseHits highlightResult( - SearchUserIdsResponseHighlightResult highlightResult - ) { - this.highlightResult = highlightResult; - return this; - } - - /** - * Get highlightResult - * - * @return highlightResult - */ - @javax.annotation.Nonnull - public SearchUserIdsResponseHighlightResult getHighlightResult() { - return highlightResult; - } - - public void setHighlightResult( - SearchUserIdsResponseHighlightResult highlightResult - ) { - this.highlightResult = highlightResult; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchUserIdsResponseHits searchUserIdsResponseHits = (SearchUserIdsResponseHits) o; - return ( - Objects.equals(this.userID, searchUserIdsResponseHits.userID) && - Objects.equals(this.clusterName, searchUserIdsResponseHits.clusterName) && - Objects.equals(this.nbRecords, searchUserIdsResponseHits.nbRecords) && - Objects.equals(this.dataSize, searchUserIdsResponseHits.dataSize) && - Objects.equals(this.objectID, searchUserIdsResponseHits.objectID) && - Objects.equals( - this.highlightResult, - searchUserIdsResponseHits.highlightResult - ) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - userID, - clusterName, - nbRecords, - dataSize, - objectID, - highlightResult - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchUserIdsResponseHits {\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb - .append(" clusterName: ") - .append(toIndentedString(clusterName)) - .append("\n"); - sb - .append(" nbRecords: ") - .append(toIndentedString(nbRecords)) - .append("\n"); - sb.append(" dataSize: ").append(toIndentedString(dataSize)).append("\n"); - sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n"); - sb - .append(" highlightResult: ") - .append(toIndentedString(highlightResult)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SnippetResult.java b/algoliasearch-core/com/algolia/model/SnippetResult.java deleted file mode 100644 index 25386fac2..000000000 --- a/algoliasearch-core/com/algolia/model/SnippetResult.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Objects; - -/** SnippetResult */ -public class SnippetResult { - - @SerializedName("value") - private String value; - - /** Indicates how well the attribute matched the search query. */ - @JsonAdapter(MatchLevelEnum.Adapter.class) - public enum MatchLevelEnum { - NONE("none"), - - PARTIAL("partial"), - - FULL("full"); - - private String value; - - MatchLevelEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static MatchLevelEnum fromValue(String value) { - for (MatchLevelEnum b : MatchLevelEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final MatchLevelEnum enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public MatchLevelEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return MatchLevelEnum.fromValue(value); - } - } - } - - @SerializedName("matchLevel") - private MatchLevelEnum matchLevel; - - public SnippetResult value(String value) { - this.value = value; - return this; - } - - /** - * Markup text with occurrences highlighted. - * - * @return value - */ - @javax.annotation.Nullable - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public SnippetResult matchLevel(MatchLevelEnum matchLevel) { - this.matchLevel = matchLevel; - return this; - } - - /** - * Indicates how well the attribute matched the search query. - * - * @return matchLevel - */ - @javax.annotation.Nullable - public MatchLevelEnum getMatchLevel() { - return matchLevel; - } - - public void setMatchLevel(MatchLevelEnum matchLevel) { - this.matchLevel = matchLevel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SnippetResult snippetResult = (SnippetResult) o; - return ( - Objects.equals(this.value, snippetResult.value) && - Objects.equals(this.matchLevel, snippetResult.matchLevel) - ); - } - - @Override - public int hashCode() { - return Objects.hash(value, matchLevel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SnippetResult {\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb - .append(" matchLevel: ") - .append(toIndentedString(matchLevel)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/Source.java b/algoliasearch-core/com/algolia/model/Source.java deleted file mode 100644 index 3640457e8..000000000 --- a/algoliasearch-core/com/algolia/model/Source.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** The source. */ -public class Source { - - @SerializedName("source") - private String source; - - @SerializedName("description") - private String description; - - public Source source(String source) { - this.source = source; - return this; - } - - /** - * The IP range of the source. - * - * @return source - */ - @javax.annotation.Nonnull - public String getSource() { - return source; - } - - public void setSource(String source) { - this.source = source; - } - - public Source description(String description) { - this.description = description; - return this; - } - - /** - * The description of the source. - * - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Source source = (Source) o; - return ( - Objects.equals(this.source, source.source) && - Objects.equals(this.description, source.description) - ); - } - - @Override - public int hashCode() { - return Objects.hash(source, description); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Source {\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); - sb - .append(" description: ") - .append(toIndentedString(description)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/StandardEntries.java b/algoliasearch-core/com/algolia/model/StandardEntries.java deleted file mode 100644 index 40de457f3..000000000 --- a/algoliasearch-core/com/algolia/model/StandardEntries.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** - * Map of language ISO code supported by the dictionary (e.g., \"en\" for English) to a boolean - * value. - */ -public class StandardEntries { - - @SerializedName("plurals") - private Map plurals = null; - - @SerializedName("stopwords") - private Map stopwords = null; - - @SerializedName("compounds") - private Map compounds = null; - - public StandardEntries plurals(Map plurals) { - this.plurals = plurals; - return this; - } - - public StandardEntries putPluralsItem(String key, Boolean pluralsItem) { - if (this.plurals == null) { - this.plurals = new HashMap<>(); - } - this.plurals.put(key, pluralsItem); - return this; - } - - /** - * Language ISO code. - * - * @return plurals - */ - @javax.annotation.Nullable - public Map getPlurals() { - return plurals; - } - - public void setPlurals(Map plurals) { - this.plurals = plurals; - } - - public StandardEntries stopwords(Map stopwords) { - this.stopwords = stopwords; - return this; - } - - public StandardEntries putStopwordsItem(String key, Boolean stopwordsItem) { - if (this.stopwords == null) { - this.stopwords = new HashMap<>(); - } - this.stopwords.put(key, stopwordsItem); - return this; - } - - /** - * Language ISO code. - * - * @return stopwords - */ - @javax.annotation.Nullable - public Map getStopwords() { - return stopwords; - } - - public void setStopwords(Map stopwords) { - this.stopwords = stopwords; - } - - public StandardEntries compounds(Map compounds) { - this.compounds = compounds; - return this; - } - - public StandardEntries putCompoundsItem(String key, Boolean compoundsItem) { - if (this.compounds == null) { - this.compounds = new HashMap<>(); - } - this.compounds.put(key, compoundsItem); - return this; - } - - /** - * Language ISO code. - * - * @return compounds - */ - @javax.annotation.Nullable - public Map getCompounds() { - return compounds; - } - - public void setCompounds(Map compounds) { - this.compounds = compounds; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StandardEntries standardEntries = (StandardEntries) o; - return ( - Objects.equals(this.plurals, standardEntries.plurals) && - Objects.equals(this.stopwords, standardEntries.stopwords) && - Objects.equals(this.compounds, standardEntries.compounds) - ); - } - - @Override - public int hashCode() { - return Objects.hash(plurals, stopwords, compounds); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StandardEntries {\n"); - sb.append(" plurals: ").append(toIndentedString(plurals)).append("\n"); - sb - .append(" stopwords: ") - .append(toIndentedString(stopwords)) - .append("\n"); - sb - .append(" compounds: ") - .append(toIndentedString(compounds)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SynonymHit.java b/algoliasearch-core/com/algolia/model/SynonymHit.java deleted file mode 100644 index ffa9eaeeb..000000000 --- a/algoliasearch-core/com/algolia/model/SynonymHit.java +++ /dev/null @@ -1,308 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Synonym object. */ -public class SynonymHit { - - @SerializedName("objectID") - private String objectID; - - @SerializedName("type") - private SynonymType type; - - @SerializedName("synonyms") - private List synonyms = null; - - @SerializedName("input") - private String input; - - @SerializedName("word") - private String word; - - @SerializedName("corrections") - private List corrections = null; - - @SerializedName("placeholder") - private String placeholder; - - @SerializedName("replacements") - private List replacements = null; - - @SerializedName("_highlightResult") - private SynonymHitHighlightResult highlightResult; - - public SynonymHit objectID(String objectID) { - this.objectID = objectID; - return this; - } - - /** - * Unique identifier of the synonym object to be created or updated. - * - * @return objectID - */ - @javax.annotation.Nonnull - public String getObjectID() { - return objectID; - } - - public void setObjectID(String objectID) { - this.objectID = objectID; - } - - public SynonymHit type(SynonymType type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public SynonymType getType() { - return type; - } - - public void setType(SynonymType type) { - this.type = type; - } - - public SynonymHit synonyms(List synonyms) { - this.synonyms = synonyms; - return this; - } - - public SynonymHit addSynonymsItem(String synonymsItem) { - if (this.synonyms == null) { - this.synonyms = new ArrayList<>(); - } - this.synonyms.add(synonymsItem); - return this; - } - - /** - * Words or phrases to be considered equivalent. - * - * @return synonyms - */ - @javax.annotation.Nullable - public List getSynonyms() { - return synonyms; - } - - public void setSynonyms(List synonyms) { - this.synonyms = synonyms; - } - - public SynonymHit input(String input) { - this.input = input; - return this; - } - - /** - * Word or phrase to appear in query strings (for onewaysynonym). - * - * @return input - */ - @javax.annotation.Nullable - public String getInput() { - return input; - } - - public void setInput(String input) { - this.input = input; - } - - public SynonymHit word(String word) { - this.word = word; - return this; - } - - /** - * Word or phrase to appear in query strings (for altcorrection1 and altcorrection2). - * - * @return word - */ - @javax.annotation.Nullable - public String getWord() { - return word; - } - - public void setWord(String word) { - this.word = word; - } - - public SynonymHit corrections(List corrections) { - this.corrections = corrections; - return this; - } - - public SynonymHit addCorrectionsItem(String correctionsItem) { - if (this.corrections == null) { - this.corrections = new ArrayList<>(); - } - this.corrections.add(correctionsItem); - return this; - } - - /** - * Words to be matched in records. - * - * @return corrections - */ - @javax.annotation.Nullable - public List getCorrections() { - return corrections; - } - - public void setCorrections(List corrections) { - this.corrections = corrections; - } - - public SynonymHit placeholder(String placeholder) { - this.placeholder = placeholder; - return this; - } - - /** - * Token to be put inside records. - * - * @return placeholder - */ - @javax.annotation.Nullable - public String getPlaceholder() { - return placeholder; - } - - public void setPlaceholder(String placeholder) { - this.placeholder = placeholder; - } - - public SynonymHit replacements(List replacements) { - this.replacements = replacements; - return this; - } - - public SynonymHit addReplacementsItem(String replacementsItem) { - if (this.replacements == null) { - this.replacements = new ArrayList<>(); - } - this.replacements.add(replacementsItem); - return this; - } - - /** - * List of query words that will match the token. - * - * @return replacements - */ - @javax.annotation.Nullable - public List getReplacements() { - return replacements; - } - - public void setReplacements(List replacements) { - this.replacements = replacements; - } - - public SynonymHit highlightResult(SynonymHitHighlightResult highlightResult) { - this.highlightResult = highlightResult; - return this; - } - - /** - * Get highlightResult - * - * @return highlightResult - */ - @javax.annotation.Nullable - public SynonymHitHighlightResult getHighlightResult() { - return highlightResult; - } - - public void setHighlightResult(SynonymHitHighlightResult highlightResult) { - this.highlightResult = highlightResult; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SynonymHit synonymHit = (SynonymHit) o; - return ( - Objects.equals(this.objectID, synonymHit.objectID) && - Objects.equals(this.type, synonymHit.type) && - Objects.equals(this.synonyms, synonymHit.synonyms) && - Objects.equals(this.input, synonymHit.input) && - Objects.equals(this.word, synonymHit.word) && - Objects.equals(this.corrections, synonymHit.corrections) && - Objects.equals(this.placeholder, synonymHit.placeholder) && - Objects.equals(this.replacements, synonymHit.replacements) && - Objects.equals(this.highlightResult, synonymHit.highlightResult) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - objectID, - type, - synonyms, - input, - word, - corrections, - placeholder, - replacements, - highlightResult - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SynonymHit {\n"); - sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" synonyms: ").append(toIndentedString(synonyms)).append("\n"); - sb.append(" input: ").append(toIndentedString(input)).append("\n"); - sb.append(" word: ").append(toIndentedString(word)).append("\n"); - sb - .append(" corrections: ") - .append(toIndentedString(corrections)) - .append("\n"); - sb - .append(" placeholder: ") - .append(toIndentedString(placeholder)) - .append("\n"); - sb - .append(" replacements: ") - .append(toIndentedString(replacements)) - .append("\n"); - sb - .append(" highlightResult: ") - .append(toIndentedString(highlightResult)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SynonymHitHighlightResult.java b/algoliasearch-core/com/algolia/model/SynonymHitHighlightResult.java deleted file mode 100644 index 83b1986a8..000000000 --- a/algoliasearch-core/com/algolia/model/SynonymHitHighlightResult.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Highlighted results */ -public class SynonymHitHighlightResult { - - @SerializedName("type") - private HighlightResult type; - - @SerializedName("synonyms") - private List synonyms = null; - - public SynonymHitHighlightResult type(HighlightResult type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nullable - public HighlightResult getType() { - return type; - } - - public void setType(HighlightResult type) { - this.type = type; - } - - public SynonymHitHighlightResult synonyms(List synonyms) { - this.synonyms = synonyms; - return this; - } - - public SynonymHitHighlightResult addSynonymsItem( - HighlightResult synonymsItem - ) { - if (this.synonyms == null) { - this.synonyms = new ArrayList<>(); - } - this.synonyms.add(synonymsItem); - return this; - } - - /** - * Get synonyms - * - * @return synonyms - */ - @javax.annotation.Nullable - public List getSynonyms() { - return synonyms; - } - - public void setSynonyms(List synonyms) { - this.synonyms = synonyms; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SynonymHitHighlightResult synonymHitHighlightResult = (SynonymHitHighlightResult) o; - return ( - Objects.equals(this.type, synonymHitHighlightResult.type) && - Objects.equals(this.synonyms, synonymHitHighlightResult.synonyms) - ); - } - - @Override - public int hashCode() { - return Objects.hash(type, synonyms); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SynonymHitHighlightResult {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" synonyms: ").append(toIndentedString(synonyms)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/SynonymType.java b/algoliasearch-core/com/algolia/model/SynonymType.java deleted file mode 100644 index cd57b50d7..000000000 --- a/algoliasearch-core/com/algolia/model/SynonymType.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.algolia.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -/** Type of the synonym object. */ -@JsonAdapter(SynonymType.Adapter.class) -public enum SynonymType { - SYNONYM("synonym"), - - ONEWAYSYNONYM("onewaysynonym"), - - ALTCORRECTION1("altcorrection1"), - - ALTCORRECTION2("altcorrection2"), - - PLACEHOLDER("placeholder"); - - private String value; - - SynonymType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SynonymType fromValue(String value) { - for (SynonymType b : SynonymType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter jsonWriter, - final SynonymType enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SynonymType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SynonymType.fromValue(value); - } - } -} diff --git a/algoliasearch-core/com/algolia/model/TimeRange.java b/algoliasearch-core/com/algolia/model/TimeRange.java deleted file mode 100644 index 446c5f6c7..000000000 --- a/algoliasearch-core/com/algolia/model/TimeRange.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** TimeRange */ -public class TimeRange { - - @SerializedName("from") - private Integer from; - - @SerializedName("until") - private Integer until; - - public TimeRange from(Integer from) { - this.from = from; - return this; - } - - /** - * Lower bound of the time range (Unix timestamp). - * - * @return from - */ - @javax.annotation.Nonnull - public Integer getFrom() { - return from; - } - - public void setFrom(Integer from) { - this.from = from; - } - - public TimeRange until(Integer until) { - this.until = until; - return this; - } - - /** - * Upper bound of the time range (Unix timestamp). - * - * @return until - */ - @javax.annotation.Nonnull - public Integer getUntil() { - return until; - } - - public void setUntil(Integer until) { - this.until = until; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TimeRange timeRange = (TimeRange) o; - return ( - Objects.equals(this.from, timeRange.from) && - Objects.equals(this.until, timeRange.until) - ); - } - - @Override - public int hashCode() { - return Objects.hash(from, until); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TimeRange {\n"); - sb.append(" from: ").append(toIndentedString(from)).append("\n"); - sb.append(" until: ").append(toIndentedString(until)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/UpdateApiKeyResponse.java b/algoliasearch-core/com/algolia/model/UpdateApiKeyResponse.java deleted file mode 100644 index 6dd34ac8e..000000000 --- a/algoliasearch-core/com/algolia/model/UpdateApiKeyResponse.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** UpdateApiKeyResponse */ -public class UpdateApiKeyResponse { - - @SerializedName("key") - private String key; - - @SerializedName("updatedAt") - private String updatedAt; - - public UpdateApiKeyResponse key(String key) { - this.key = key; - return this; - } - - /** - * Key string. - * - * @return key - */ - @javax.annotation.Nonnull - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public UpdateApiKeyResponse updatedAt(String updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Date of last update (ISO-8601 format). - * - * @return updatedAt - */ - @javax.annotation.Nonnull - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateApiKeyResponse updateApiKeyResponse = (UpdateApiKeyResponse) o; - return ( - Objects.equals(this.key, updateApiKeyResponse.key) && - Objects.equals(this.updatedAt, updateApiKeyResponse.updatedAt) - ); - } - - @Override - public int hashCode() { - return Objects.hash(key, updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateApiKeyResponse {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb - .append(" updatedAt: ") - .append(toIndentedString(updatedAt)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/UpdatedAtResponse.java b/algoliasearch-core/com/algolia/model/UpdatedAtResponse.java deleted file mode 100644 index acea12958..000000000 --- a/algoliasearch-core/com/algolia/model/UpdatedAtResponse.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** The response with a taskID and an updatedAt timestamp. */ -public class UpdatedAtResponse { - - @SerializedName("taskID") - private Integer taskID; - - @SerializedName("updatedAt") - private String updatedAt; - - public UpdatedAtResponse taskID(Integer taskID) { - this.taskID = taskID; - return this; - } - - /** - * taskID of the task to wait for. - * - * @return taskID - */ - @javax.annotation.Nonnull - public Integer getTaskID() { - return taskID; - } - - public void setTaskID(Integer taskID) { - this.taskID = taskID; - } - - public UpdatedAtResponse updatedAt(String updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Date of last update (ISO-8601 format). - * - * @return updatedAt - */ - @javax.annotation.Nonnull - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdatedAtResponse updatedAtResponse = (UpdatedAtResponse) o; - return ( - Objects.equals(this.taskID, updatedAtResponse.taskID) && - Objects.equals(this.updatedAt, updatedAtResponse.updatedAt) - ); - } - - @Override - public int hashCode() { - return Objects.hash(taskID, updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdatedAtResponse {\n"); - sb.append(" taskID: ").append(toIndentedString(taskID)).append("\n"); - sb - .append(" updatedAt: ") - .append(toIndentedString(updatedAt)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/UpdatedAtWithObjectIdResponse.java b/algoliasearch-core/com/algolia/model/UpdatedAtWithObjectIdResponse.java deleted file mode 100644 index c3dcc8358..000000000 --- a/algoliasearch-core/com/algolia/model/UpdatedAtWithObjectIdResponse.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** The response with a taskID, an objectID and an updatedAt timestamp. */ -public class UpdatedAtWithObjectIdResponse { - - @SerializedName("taskID") - private Integer taskID; - - @SerializedName("updatedAt") - private String updatedAt; - - @SerializedName("objectID") - private String objectID; - - public UpdatedAtWithObjectIdResponse taskID(Integer taskID) { - this.taskID = taskID; - return this; - } - - /** - * taskID of the task to wait for. - * - * @return taskID - */ - @javax.annotation.Nullable - public Integer getTaskID() { - return taskID; - } - - public void setTaskID(Integer taskID) { - this.taskID = taskID; - } - - public UpdatedAtWithObjectIdResponse updatedAt(String updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Date of last update (ISO-8601 format). - * - * @return updatedAt - */ - @javax.annotation.Nullable - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public UpdatedAtWithObjectIdResponse objectID(String objectID) { - this.objectID = objectID; - return this; - } - - /** - * Unique identifier of the object. - * - * @return objectID - */ - @javax.annotation.Nullable - public String getObjectID() { - return objectID; - } - - public void setObjectID(String objectID) { - this.objectID = objectID; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdatedAtWithObjectIdResponse updatedAtWithObjectIdResponse = (UpdatedAtWithObjectIdResponse) o; - return ( - Objects.equals(this.taskID, updatedAtWithObjectIdResponse.taskID) && - Objects.equals(this.updatedAt, updatedAtWithObjectIdResponse.updatedAt) && - Objects.equals(this.objectID, updatedAtWithObjectIdResponse.objectID) - ); - } - - @Override - public int hashCode() { - return Objects.hash(taskID, updatedAt, objectID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdatedAtWithObjectIdResponse {\n"); - sb.append(" taskID: ").append(toIndentedString(taskID)).append("\n"); - sb - .append(" updatedAt: ") - .append(toIndentedString(updatedAt)) - .append("\n"); - sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/UpdatedRuleResponse.java b/algoliasearch-core/com/algolia/model/UpdatedRuleResponse.java deleted file mode 100644 index b0e87465e..000000000 --- a/algoliasearch-core/com/algolia/model/UpdatedRuleResponse.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** UpdatedRuleResponse */ -public class UpdatedRuleResponse { - - @SerializedName("objectID") - private String objectID; - - @SerializedName("updatedAt") - private String updatedAt; - - @SerializedName("taskID") - private Integer taskID; - - public UpdatedRuleResponse objectID(String objectID) { - this.objectID = objectID; - return this; - } - - /** - * Unique identifier of the object. - * - * @return objectID - */ - @javax.annotation.Nonnull - public String getObjectID() { - return objectID; - } - - public void setObjectID(String objectID) { - this.objectID = objectID; - } - - public UpdatedRuleResponse updatedAt(String updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Date of last update (ISO-8601 format). - * - * @return updatedAt - */ - @javax.annotation.Nonnull - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public UpdatedRuleResponse taskID(Integer taskID) { - this.taskID = taskID; - return this; - } - - /** - * taskID of the task to wait for. - * - * @return taskID - */ - @javax.annotation.Nonnull - public Integer getTaskID() { - return taskID; - } - - public void setTaskID(Integer taskID) { - this.taskID = taskID; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdatedRuleResponse updatedRuleResponse = (UpdatedRuleResponse) o; - return ( - Objects.equals(this.objectID, updatedRuleResponse.objectID) && - Objects.equals(this.updatedAt, updatedRuleResponse.updatedAt) && - Objects.equals(this.taskID, updatedRuleResponse.taskID) - ); - } - - @Override - public int hashCode() { - return Objects.hash(objectID, updatedAt, taskID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdatedRuleResponse {\n"); - sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n"); - sb - .append(" updatedAt: ") - .append(toIndentedString(updatedAt)) - .append("\n"); - sb.append(" taskID: ").append(toIndentedString(taskID)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-core/com/algolia/model/UserId.java b/algoliasearch-core/com/algolia/model/UserId.java deleted file mode 100644 index d5a9994b9..000000000 --- a/algoliasearch-core/com/algolia/model/UserId.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.algolia.model; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** A userID. */ -public class UserId { - - @SerializedName("userID") - private String userID; - - @SerializedName("clusterName") - private String clusterName; - - @SerializedName("nbRecords") - private Integer nbRecords; - - @SerializedName("dataSize") - private Integer dataSize; - - public UserId userID(String userID) { - this.userID = userID; - return this; - } - - /** - * userID of the user. - * - * @return userID - */ - @javax.annotation.Nonnull - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - public UserId clusterName(String clusterName) { - this.clusterName = clusterName; - return this; - } - - /** - * Cluster on which the user is assigned. - * - * @return clusterName - */ - @javax.annotation.Nonnull - public String getClusterName() { - return clusterName; - } - - public void setClusterName(String clusterName) { - this.clusterName = clusterName; - } - - public UserId nbRecords(Integer nbRecords) { - this.nbRecords = nbRecords; - return this; - } - - /** - * Number of records belonging to the user. - * - * @return nbRecords - */ - @javax.annotation.Nonnull - public Integer getNbRecords() { - return nbRecords; - } - - public void setNbRecords(Integer nbRecords) { - this.nbRecords = nbRecords; - } - - public UserId dataSize(Integer dataSize) { - this.dataSize = dataSize; - return this; - } - - /** - * Data size used by the user. - * - * @return dataSize - */ - @javax.annotation.Nonnull - public Integer getDataSize() { - return dataSize; - } - - public void setDataSize(Integer dataSize) { - this.dataSize = dataSize; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserId userId = (UserId) o; - return ( - Objects.equals(this.userID, userId.userID) && - Objects.equals(this.clusterName, userId.clusterName) && - Objects.equals(this.nbRecords, userId.nbRecords) && - Objects.equals(this.dataSize, userId.dataSize) - ); - } - - @Override - public int hashCode() { - return Objects.hash(userID, clusterName, nbRecords, dataSize); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserId {\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb - .append(" clusterName: ") - .append(toIndentedString(clusterName)) - .append("\n"); - sb - .append(" nbRecords: ") - .append(toIndentedString(nbRecords)) - .append("\n"); - sb.append(" dataSize: ").append(toIndentedString(dataSize)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Acl.java b/algoliasearch-core/com/algolia/model/search/Acl.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Acl.java rename to algoliasearch-core/com/algolia/model/search/Acl.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Action.java b/algoliasearch-core/com/algolia/model/search/Action.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Action.java rename to algoliasearch-core/com/algolia/model/search/Action.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AddApiKeyResponse.java b/algoliasearch-core/com/algolia/model/search/AddApiKeyResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AddApiKeyResponse.java rename to algoliasearch-core/com/algolia/model/search/AddApiKeyResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Anchoring.java b/algoliasearch-core/com/algolia/model/search/Anchoring.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Anchoring.java rename to algoliasearch-core/com/algolia/model/search/Anchoring.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ApiKey.java b/algoliasearch-core/com/algolia/model/search/ApiKey.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ApiKey.java rename to algoliasearch-core/com/algolia/model/search/ApiKey.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AroundRadius.java b/algoliasearch-core/com/algolia/model/search/AroundRadius.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AroundRadius.java rename to algoliasearch-core/com/algolia/model/search/AroundRadius.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AroundRadiusOneOf.java b/algoliasearch-core/com/algolia/model/search/AroundRadiusOneOf.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AroundRadiusOneOf.java rename to algoliasearch-core/com/algolia/model/search/AroundRadiusOneOf.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AssignUserIdParams.java b/algoliasearch-core/com/algolia/model/search/AssignUserIdParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AssignUserIdParams.java rename to algoliasearch-core/com/algolia/model/search/AssignUserIdParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AttributeOrBuiltInOperation.java b/algoliasearch-core/com/algolia/model/search/AttributeOrBuiltInOperation.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AttributeOrBuiltInOperation.java rename to algoliasearch-core/com/algolia/model/search/AttributeOrBuiltInOperation.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AutomaticFacetFilter.java b/algoliasearch-core/com/algolia/model/search/AutomaticFacetFilter.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AutomaticFacetFilter.java rename to algoliasearch-core/com/algolia/model/search/AutomaticFacetFilter.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseBrowseResponse.java b/algoliasearch-core/com/algolia/model/search/BaseBrowseResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseBrowseResponse.java rename to algoliasearch-core/com/algolia/model/search/BaseBrowseResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseIndexSettings.java b/algoliasearch-core/com/algolia/model/search/BaseIndexSettings.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseIndexSettings.java rename to algoliasearch-core/com/algolia/model/search/BaseIndexSettings.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchParams.java b/algoliasearch-core/com/algolia/model/search/BaseSearchParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchParams.java rename to algoliasearch-core/com/algolia/model/search/BaseSearchParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchResponse.java b/algoliasearch-core/com/algolia/model/search/BaseSearchResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchResponse.java rename to algoliasearch-core/com/algolia/model/search/BaseSearchResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchResponseFacetsStats.java b/algoliasearch-core/com/algolia/model/search/BaseSearchResponseFacetsStats.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchResponseFacetsStats.java rename to algoliasearch-core/com/algolia/model/search/BaseSearchResponseFacetsStats.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchAssignUserIdsParams.java b/algoliasearch-core/com/algolia/model/search/BatchAssignUserIdsParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchAssignUserIdsParams.java rename to algoliasearch-core/com/algolia/model/search/BatchAssignUserIdsParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchDictionaryEntriesParams.java b/algoliasearch-core/com/algolia/model/search/BatchDictionaryEntriesParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchDictionaryEntriesParams.java rename to algoliasearch-core/com/algolia/model/search/BatchDictionaryEntriesParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchDictionaryEntriesRequest.java b/algoliasearch-core/com/algolia/model/search/BatchDictionaryEntriesRequest.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchDictionaryEntriesRequest.java rename to algoliasearch-core/com/algolia/model/search/BatchDictionaryEntriesRequest.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchOperation.java b/algoliasearch-core/com/algolia/model/search/BatchOperation.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchOperation.java rename to algoliasearch-core/com/algolia/model/search/BatchOperation.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchParams.java b/algoliasearch-core/com/algolia/model/search/BatchParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchParams.java rename to algoliasearch-core/com/algolia/model/search/BatchParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchResponse.java b/algoliasearch-core/com/algolia/model/search/BatchResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchResponse.java rename to algoliasearch-core/com/algolia/model/search/BatchResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchWriteParams.java b/algoliasearch-core/com/algolia/model/search/BatchWriteParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchWriteParams.java rename to algoliasearch-core/com/algolia/model/search/BatchWriteParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BrowseRequest.java b/algoliasearch-core/com/algolia/model/search/BrowseRequest.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BrowseRequest.java rename to algoliasearch-core/com/algolia/model/search/BrowseRequest.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BrowseResponse.java b/algoliasearch-core/com/algolia/model/search/BrowseResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BrowseResponse.java rename to algoliasearch-core/com/algolia/model/search/BrowseResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BuiltInOperation.java b/algoliasearch-core/com/algolia/model/search/BuiltInOperation.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BuiltInOperation.java rename to algoliasearch-core/com/algolia/model/search/BuiltInOperation.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BuiltInOperationType.java b/algoliasearch-core/com/algolia/model/search/BuiltInOperationType.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BuiltInOperationType.java rename to algoliasearch-core/com/algolia/model/search/BuiltInOperationType.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Condition.java b/algoliasearch-core/com/algolia/model/search/Condition.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Condition.java rename to algoliasearch-core/com/algolia/model/search/Condition.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Consequence.java b/algoliasearch-core/com/algolia/model/search/Consequence.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Consequence.java rename to algoliasearch-core/com/algolia/model/search/Consequence.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ConsequenceHide.java b/algoliasearch-core/com/algolia/model/search/ConsequenceHide.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ConsequenceHide.java rename to algoliasearch-core/com/algolia/model/search/ConsequenceHide.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ConsequenceParams.java b/algoliasearch-core/com/algolia/model/search/ConsequenceParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ConsequenceParams.java rename to algoliasearch-core/com/algolia/model/search/ConsequenceParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/CreatedAtObject.java b/algoliasearch-core/com/algolia/model/search/CreatedAtObject.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/CreatedAtObject.java rename to algoliasearch-core/com/algolia/model/search/CreatedAtObject.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/CreatedAtResponse.java b/algoliasearch-core/com/algolia/model/search/CreatedAtResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/CreatedAtResponse.java rename to algoliasearch-core/com/algolia/model/search/CreatedAtResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeleteApiKeyResponse.java b/algoliasearch-core/com/algolia/model/search/DeleteApiKeyResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeleteApiKeyResponse.java rename to algoliasearch-core/com/algolia/model/search/DeleteApiKeyResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeleteSourceResponse.java b/algoliasearch-core/com/algolia/model/search/DeleteSourceResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeleteSourceResponse.java rename to algoliasearch-core/com/algolia/model/search/DeleteSourceResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeletedAtResponse.java b/algoliasearch-core/com/algolia/model/search/DeletedAtResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeletedAtResponse.java rename to algoliasearch-core/com/algolia/model/search/DeletedAtResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryAction.java b/algoliasearch-core/com/algolia/model/search/DictionaryAction.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryAction.java rename to algoliasearch-core/com/algolia/model/search/DictionaryAction.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryEntry.java b/algoliasearch-core/com/algolia/model/search/DictionaryEntry.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryEntry.java rename to algoliasearch-core/com/algolia/model/search/DictionaryEntry.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryEntryState.java b/algoliasearch-core/com/algolia/model/search/DictionaryEntryState.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryEntryState.java rename to algoliasearch-core/com/algolia/model/search/DictionaryEntryState.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryLanguage.java b/algoliasearch-core/com/algolia/model/search/DictionaryLanguage.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryLanguage.java rename to algoliasearch-core/com/algolia/model/search/DictionaryLanguage.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionarySettingsParams.java b/algoliasearch-core/com/algolia/model/search/DictionarySettingsParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionarySettingsParams.java rename to algoliasearch-core/com/algolia/model/search/DictionarySettingsParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryType.java b/algoliasearch-core/com/algolia/model/search/DictionaryType.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryType.java rename to algoliasearch-core/com/algolia/model/search/DictionaryType.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ErrorBase.java b/algoliasearch-core/com/algolia/model/search/ErrorBase.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ErrorBase.java rename to algoliasearch-core/com/algolia/model/search/ErrorBase.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetDictionarySettingsResponse.java b/algoliasearch-core/com/algolia/model/search/GetDictionarySettingsResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetDictionarySettingsResponse.java rename to algoliasearch-core/com/algolia/model/search/GetDictionarySettingsResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponse.java b/algoliasearch-core/com/algolia/model/search/GetLogsResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponse.java rename to algoliasearch-core/com/algolia/model/search/GetLogsResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponseInnerQueries.java b/algoliasearch-core/com/algolia/model/search/GetLogsResponseInnerQueries.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponseInnerQueries.java rename to algoliasearch-core/com/algolia/model/search/GetLogsResponseInnerQueries.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponseLogs.java b/algoliasearch-core/com/algolia/model/search/GetLogsResponseLogs.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponseLogs.java rename to algoliasearch-core/com/algolia/model/search/GetLogsResponseLogs.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetObjectsParams.java b/algoliasearch-core/com/algolia/model/search/GetObjectsParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetObjectsParams.java rename to algoliasearch-core/com/algolia/model/search/GetObjectsParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetObjectsResponse.java b/algoliasearch-core/com/algolia/model/search/GetObjectsResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetObjectsResponse.java rename to algoliasearch-core/com/algolia/model/search/GetObjectsResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetTaskResponse.java b/algoliasearch-core/com/algolia/model/search/GetTaskResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetTaskResponse.java rename to algoliasearch-core/com/algolia/model/search/GetTaskResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetTopUserIdsResponse.java b/algoliasearch-core/com/algolia/model/search/GetTopUserIdsResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetTopUserIdsResponse.java rename to algoliasearch-core/com/algolia/model/search/GetTopUserIdsResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/HighlightResult.java b/algoliasearch-core/com/algolia/model/search/HighlightResult.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/HighlightResult.java rename to algoliasearch-core/com/algolia/model/search/HighlightResult.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Hit.java b/algoliasearch-core/com/algolia/model/search/Hit.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Hit.java rename to algoliasearch-core/com/algolia/model/search/Hit.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/IndexSettings.java b/algoliasearch-core/com/algolia/model/search/IndexSettings.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/IndexSettings.java rename to algoliasearch-core/com/algolia/model/search/IndexSettings.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/IndexSettingsAsSearchParams.java b/algoliasearch-core/com/algolia/model/search/IndexSettingsAsSearchParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/IndexSettingsAsSearchParams.java rename to algoliasearch-core/com/algolia/model/search/IndexSettingsAsSearchParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Indice.java b/algoliasearch-core/com/algolia/model/search/Indice.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Indice.java rename to algoliasearch-core/com/algolia/model/search/Indice.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Key.java b/algoliasearch-core/com/algolia/model/search/Key.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Key.java rename to algoliasearch-core/com/algolia/model/search/Key.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Languages.java b/algoliasearch-core/com/algolia/model/search/Languages.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Languages.java rename to algoliasearch-core/com/algolia/model/search/Languages.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListApiKeysResponse.java b/algoliasearch-core/com/algolia/model/search/ListApiKeysResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListApiKeysResponse.java rename to algoliasearch-core/com/algolia/model/search/ListApiKeysResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListClustersResponse.java b/algoliasearch-core/com/algolia/model/search/ListClustersResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListClustersResponse.java rename to algoliasearch-core/com/algolia/model/search/ListClustersResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListIndicesResponse.java b/algoliasearch-core/com/algolia/model/search/ListIndicesResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListIndicesResponse.java rename to algoliasearch-core/com/algolia/model/search/ListIndicesResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListUserIdsResponse.java b/algoliasearch-core/com/algolia/model/search/ListUserIdsResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListUserIdsResponse.java rename to algoliasearch-core/com/algolia/model/search/ListUserIdsResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/LogType.java b/algoliasearch-core/com/algolia/model/search/LogType.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/LogType.java rename to algoliasearch-core/com/algolia/model/search/LogType.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleBatchOperation.java b/algoliasearch-core/com/algolia/model/search/MultipleBatchOperation.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleBatchOperation.java rename to algoliasearch-core/com/algolia/model/search/MultipleBatchOperation.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleBatchResponse.java b/algoliasearch-core/com/algolia/model/search/MultipleBatchResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleBatchResponse.java rename to algoliasearch-core/com/algolia/model/search/MultipleBatchResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleGetObjectsParams.java b/algoliasearch-core/com/algolia/model/search/MultipleGetObjectsParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleGetObjectsParams.java rename to algoliasearch-core/com/algolia/model/search/MultipleGetObjectsParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueries.java b/algoliasearch-core/com/algolia/model/search/MultipleQueries.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueries.java rename to algoliasearch-core/com/algolia/model/search/MultipleQueries.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesParams.java b/algoliasearch-core/com/algolia/model/search/MultipleQueriesParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesParams.java rename to algoliasearch-core/com/algolia/model/search/MultipleQueriesParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesResponse.java b/algoliasearch-core/com/algolia/model/search/MultipleQueriesResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesResponse.java rename to algoliasearch-core/com/algolia/model/search/MultipleQueriesResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesStrategy.java b/algoliasearch-core/com/algolia/model/search/MultipleQueriesStrategy.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesStrategy.java rename to algoliasearch-core/com/algolia/model/search/MultipleQueriesStrategy.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesType.java b/algoliasearch-core/com/algolia/model/search/MultipleQueriesType.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesType.java rename to algoliasearch-core/com/algolia/model/search/MultipleQueriesType.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/OperationIndexParams.java b/algoliasearch-core/com/algolia/model/search/OperationIndexParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/OperationIndexParams.java rename to algoliasearch-core/com/algolia/model/search/OperationIndexParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/OperationType.java b/algoliasearch-core/com/algolia/model/search/OperationType.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/OperationType.java rename to algoliasearch-core/com/algolia/model/search/OperationType.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Params.java b/algoliasearch-core/com/algolia/model/search/Params.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Params.java rename to algoliasearch-core/com/algolia/model/search/Params.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Promote.java b/algoliasearch-core/com/algolia/model/search/Promote.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Promote.java rename to algoliasearch-core/com/algolia/model/search/Promote.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RankingInfo.java b/algoliasearch-core/com/algolia/model/search/RankingInfo.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RankingInfo.java rename to algoliasearch-core/com/algolia/model/search/RankingInfo.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RankingInfoMatchedGeoLocation.java b/algoliasearch-core/com/algolia/model/search/RankingInfoMatchedGeoLocation.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RankingInfoMatchedGeoLocation.java rename to algoliasearch-core/com/algolia/model/search/RankingInfoMatchedGeoLocation.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RemoveUserIdResponse.java b/algoliasearch-core/com/algolia/model/search/RemoveUserIdResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RemoveUserIdResponse.java rename to algoliasearch-core/com/algolia/model/search/RemoveUserIdResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ReplaceSourceResponse.java b/algoliasearch-core/com/algolia/model/search/ReplaceSourceResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ReplaceSourceResponse.java rename to algoliasearch-core/com/algolia/model/search/ReplaceSourceResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RequiredSearchParams.java b/algoliasearch-core/com/algolia/model/search/RequiredSearchParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RequiredSearchParams.java rename to algoliasearch-core/com/algolia/model/search/RequiredSearchParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Rule.java b/algoliasearch-core/com/algolia/model/search/Rule.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Rule.java rename to algoliasearch-core/com/algolia/model/search/Rule.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SaveObjectResponse.java b/algoliasearch-core/com/algolia/model/search/SaveObjectResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SaveObjectResponse.java rename to algoliasearch-core/com/algolia/model/search/SaveObjectResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SaveSynonymResponse.java b/algoliasearch-core/com/algolia/model/search/SaveSynonymResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SaveSynonymResponse.java rename to algoliasearch-core/com/algolia/model/search/SaveSynonymResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ScopeType.java b/algoliasearch-core/com/algolia/model/search/ScopeType.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ScopeType.java rename to algoliasearch-core/com/algolia/model/search/ScopeType.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchDictionaryEntriesParams.java b/algoliasearch-core/com/algolia/model/search/SearchDictionaryEntriesParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchDictionaryEntriesParams.java rename to algoliasearch-core/com/algolia/model/search/SearchDictionaryEntriesParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesRequest.java b/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesRequest.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesRequest.java rename to algoliasearch-core/com/algolia/model/search/SearchForFacetValuesRequest.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesResponse.java b/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesResponse.java rename to algoliasearch-core/com/algolia/model/search/SearchForFacetValuesResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesResponseFacetHits.java b/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesResponseFacetHits.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesResponseFacetHits.java rename to algoliasearch-core/com/algolia/model/search/SearchForFacetValuesResponseFacetHits.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchHits.java b/algoliasearch-core/com/algolia/model/search/SearchHits.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchHits.java rename to algoliasearch-core/com/algolia/model/search/SearchHits.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParams.java b/algoliasearch-core/com/algolia/model/search/SearchParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParams.java rename to algoliasearch-core/com/algolia/model/search/SearchParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParamsObject.java b/algoliasearch-core/com/algolia/model/search/SearchParamsObject.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParamsObject.java rename to algoliasearch-core/com/algolia/model/search/SearchParamsObject.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParamsString.java b/algoliasearch-core/com/algolia/model/search/SearchParamsString.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParamsString.java rename to algoliasearch-core/com/algolia/model/search/SearchParamsString.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchResponse.java b/algoliasearch-core/com/algolia/model/search/SearchResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchResponse.java rename to algoliasearch-core/com/algolia/model/search/SearchResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchRulesParams.java b/algoliasearch-core/com/algolia/model/search/SearchRulesParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchRulesParams.java rename to algoliasearch-core/com/algolia/model/search/SearchRulesParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchRulesResponse.java b/algoliasearch-core/com/algolia/model/search/SearchRulesResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchRulesResponse.java rename to algoliasearch-core/com/algolia/model/search/SearchRulesResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchSynonymsResponse.java b/algoliasearch-core/com/algolia/model/search/SearchSynonymsResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchSynonymsResponse.java rename to algoliasearch-core/com/algolia/model/search/SearchSynonymsResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsParams.java b/algoliasearch-core/com/algolia/model/search/SearchUserIdsParams.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsParams.java rename to algoliasearch-core/com/algolia/model/search/SearchUserIdsParams.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponse.java b/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponse.java rename to algoliasearch-core/com/algolia/model/search/SearchUserIdsResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponseHighlightResult.java b/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponseHighlightResult.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponseHighlightResult.java rename to algoliasearch-core/com/algolia/model/search/SearchUserIdsResponseHighlightResult.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponseHits.java b/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponseHits.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponseHits.java rename to algoliasearch-core/com/algolia/model/search/SearchUserIdsResponseHits.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SnippetResult.java b/algoliasearch-core/com/algolia/model/search/SnippetResult.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SnippetResult.java rename to algoliasearch-core/com/algolia/model/search/SnippetResult.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Source.java b/algoliasearch-core/com/algolia/model/search/Source.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Source.java rename to algoliasearch-core/com/algolia/model/search/Source.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/StandardEntries.java b/algoliasearch-core/com/algolia/model/search/StandardEntries.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/StandardEntries.java rename to algoliasearch-core/com/algolia/model/search/StandardEntries.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymHit.java b/algoliasearch-core/com/algolia/model/search/SynonymHit.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymHit.java rename to algoliasearch-core/com/algolia/model/search/SynonymHit.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymHitHighlightResult.java b/algoliasearch-core/com/algolia/model/search/SynonymHitHighlightResult.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymHitHighlightResult.java rename to algoliasearch-core/com/algolia/model/search/SynonymHitHighlightResult.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymType.java b/algoliasearch-core/com/algolia/model/search/SynonymType.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymType.java rename to algoliasearch-core/com/algolia/model/search/SynonymType.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/TimeRange.java b/algoliasearch-core/com/algolia/model/search/TimeRange.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/TimeRange.java rename to algoliasearch-core/com/algolia/model/search/TimeRange.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdateApiKeyResponse.java b/algoliasearch-core/com/algolia/model/search/UpdateApiKeyResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdateApiKeyResponse.java rename to algoliasearch-core/com/algolia/model/search/UpdateApiKeyResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedAtResponse.java b/algoliasearch-core/com/algolia/model/search/UpdatedAtResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedAtResponse.java rename to algoliasearch-core/com/algolia/model/search/UpdatedAtResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedAtWithObjectIdResponse.java b/algoliasearch-core/com/algolia/model/search/UpdatedAtWithObjectIdResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedAtWithObjectIdResponse.java rename to algoliasearch-core/com/algolia/model/search/UpdatedAtWithObjectIdResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedRuleResponse.java b/algoliasearch-core/com/algolia/model/search/UpdatedRuleResponse.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedRuleResponse.java rename to algoliasearch-core/com/algolia/model/search/UpdatedRuleResponse.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UserId.java b/algoliasearch-core/com/algolia/model/search/UserId.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UserId.java rename to algoliasearch-core/com/algolia/model/search/UserId.java diff --git a/algoliasearch-core/com/algolia/search/SearchApi.java b/algoliasearch-core/com/algolia/search/SearchApi.java index 2a978f28d..0059add9a 100644 --- a/algoliasearch-core/com/algolia/search/SearchApi.java +++ b/algoliasearch-core/com/algolia/search/SearchApi.java @@ -2,41 +2,95 @@ import com.algolia.ApiCallback; import com.algolia.ApiClient; -import com.algolia.ApiException; import com.algolia.ApiResponse; import com.algolia.Pair; -import com.algolia.model.*; +import com.algolia.exceptions.*; +import com.algolia.model.search.*; import com.algolia.utils.*; import com.algolia.utils.echo.*; +import com.algolia.utils.retry.CallType; +import com.algolia.utils.retry.StatefulHost; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; +import java.util.Collections; +import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Random; +import java.util.stream.Collectors; +import java.util.stream.Stream; import okhttp3.Call; public class SearchApi extends ApiClient { public SearchApi(String appId, String apiKey) { - super(appId, apiKey, new HttpRequester()); + super(appId, apiKey, new HttpRequester(getDefaultHosts(appId))); } public SearchApi(String appId, String apiKey, Requester requester) { super(appId, apiKey, requester); } + private static List getDefaultHosts(String appId) { + List hosts = new ArrayList(); + hosts.add( + new StatefulHost( + appId + "-dsn.algolia.net", + "https", + EnumSet.of(CallType.READ) + ) + ); + hosts.add( + new StatefulHost( + appId + ".algolia.net", + "https", + EnumSet.of(CallType.WRITE) + ) + ); + + List commonHosts = new ArrayList(); + hosts.add( + new StatefulHost( + appId + "-1.algolianet.net", + "https", + EnumSet.of(CallType.READ, CallType.WRITE) + ) + ); + hosts.add( + new StatefulHost( + appId + "-2.algolianet.net", + "https", + EnumSet.of(CallType.READ, CallType.WRITE) + ) + ); + hosts.add( + new StatefulHost( + appId + "-3.algolianet.net", + "https", + EnumSet.of(CallType.READ, CallType.WRITE) + ) + ); + + Collections.shuffle(commonHosts, new Random()); + + return Stream + .concat(hosts.stream(), commonHosts.stream()) + .collect(Collectors.toList()); + } + /** * Build call for addApiKey * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call addApiKeyCall( ApiKey apiKey, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = apiKey; // create path and map variables @@ -61,10 +115,10 @@ private Call addApiKeyCall( private Call addApiKeyValidateBeforeCall( ApiKey apiKey, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'apiKey' is set if (apiKey == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'apiKey' when calling addApiKey(Async)" ); } @@ -77,13 +131,14 @@ private Call addApiKeyValidateBeforeCall( * * @param apiKey (required) * @return AddApiKeyResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public AddApiKeyResponse addApiKey(ApiKey apiKey) throws ApiException { + public AddApiKeyResponse addApiKey(ApiKey apiKey) + throws AlgoliaRuntimeException { Call req = addApiKeyValidateBeforeCall(apiKey, null); if (req instanceof CallEcho) { - return new EchoResponse.AddApiKey(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.AddApiKey(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -97,12 +152,13 @@ public AddApiKeyResponse addApiKey(ApiKey apiKey) throws ApiException { * @param apiKey (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call addApiKeyAsync( ApiKey apiKey, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = addApiKeyValidateBeforeCall(apiKey, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -114,26 +170,23 @@ public Call addApiKeyAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call addOrUpdateObjectCall( String indexName, String objectID, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = body; // create path and map variables String requestPath = "/1/indexes/{indexName}/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -156,24 +209,24 @@ private Call addOrUpdateObjectValidateBeforeCall( String objectID, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling addOrUpdateObject(Async)" ); } // verify the required parameter 'objectID' is set if (objectID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'objectID' when calling addOrUpdateObject(Async)" ); } // verify the required parameter 'body' is set if (body == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'body' when calling addOrUpdateObject(Async)" ); } @@ -189,14 +242,14 @@ private Call addOrUpdateObjectValidateBeforeCall( * @param objectID Unique identifier of an object. (required) * @param body The Algolia object. (required) * @return UpdatedAtWithObjectIdResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public UpdatedAtWithObjectIdResponse addOrUpdateObject( String indexName, String objectID, Object body - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = addOrUpdateObjectValidateBeforeCall( indexName, objectID, @@ -204,7 +257,9 @@ public UpdatedAtWithObjectIdResponse addOrUpdateObject( null ); if (req instanceof CallEcho) { - return new EchoResponse.AddOrUpdateObject(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.AddOrUpdateObject( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {} @@ -223,14 +278,15 @@ public UpdatedAtWithObjectIdResponse addOrUpdateObject( * @param body The Algolia object. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call addOrUpdateObjectAsync( String indexName, String objectID, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = addOrUpdateObjectValidateBeforeCall( indexName, objectID, @@ -248,12 +304,12 @@ public Call addOrUpdateObjectAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call appendSourceCall( Source source, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = source; // create path and map variables @@ -278,10 +334,10 @@ private Call appendSourceCall( private Call appendSourceValidateBeforeCall( Source source, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'source' is set if (source == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'source' when calling appendSource(Async)" ); } @@ -294,13 +350,16 @@ private Call appendSourceValidateBeforeCall( * * @param source The source to add. (required) * @return CreatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public CreatedAtResponse appendSource(Source source) throws ApiException { + public CreatedAtResponse appendSource(Source source) + throws AlgoliaRuntimeException { Call req = appendSourceValidateBeforeCall(source, null); if (req instanceof CallEcho) { - return new EchoResponse.AppendSource(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.AppendSource( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -314,12 +373,13 @@ public CreatedAtResponse appendSource(Source source) throws ApiException { * @param source The source to add. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call appendSourceAsync( Source source, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = appendSourceValidateBeforeCall(source, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -331,13 +391,13 @@ public Call appendSourceAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call assignUserIdCall( String xAlgoliaUserID, AssignUserIdParams assignUserIdParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = assignUserIdParams; // create path and map variables @@ -369,17 +429,17 @@ private Call assignUserIdValidateBeforeCall( String xAlgoliaUserID, AssignUserIdParams assignUserIdParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'xAlgoliaUserID' is set if (xAlgoliaUserID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'xAlgoliaUserID' when calling assignUserId(Async)" ); } // verify the required parameter 'assignUserIdParams' is set if (assignUserIdParams == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'assignUserIdParams' when calling assignUserId(Async)" ); } @@ -396,20 +456,22 @@ private Call assignUserIdValidateBeforeCall( * @param xAlgoliaUserID userID to assign. (required) * @param assignUserIdParams (required) * @return CreatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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 - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = assignUserIdValidateBeforeCall( xAlgoliaUserID, assignUserIdParams, null ); if (req instanceof CallEcho) { - return new EchoResponse.AssignUserId(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.AssignUserId( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -427,13 +489,14 @@ public CreatedAtResponse assignUserId( * @param assignUserIdParams (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call assignUserIdAsync( String xAlgoliaUserID, AssignUserIdParams assignUserIdParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = assignUserIdValidateBeforeCall( xAlgoliaUserID, assignUserIdParams, @@ -449,19 +512,19 @@ public Call assignUserIdAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call batchCall( String indexName, BatchWriteParams batchWriteParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = batchWriteParams; // create path and map variables String requestPath = "/1/indexes/{indexName}/batch".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -485,17 +548,17 @@ private Call batchValidateBeforeCall( String indexName, BatchWriteParams batchWriteParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling batch(Async)" ); } // verify the required parameter 'batchWriteParams' is set if (batchWriteParams == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'batchWriteParams' when calling batch(Async)" ); } @@ -509,16 +572,16 @@ private Call batchValidateBeforeCall( * @param indexName The index in which to perform the request. (required) * @param batchWriteParams (required) * @return BatchResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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 - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = batchValidateBeforeCall(indexName, batchWriteParams, null); if (req instanceof CallEcho) { - return new EchoResponse.Batch(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.Batch(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -533,13 +596,14 @@ public BatchResponse batch( * @param batchWriteParams (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call batchAsync( String indexName, BatchWriteParams batchWriteParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = batchValidateBeforeCall(indexName, batchWriteParams, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -551,13 +615,13 @@ public Call batchAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call batchAssignUserIdsCall( String xAlgoliaUserID, BatchAssignUserIdsParams batchAssignUserIdsParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = batchAssignUserIdsParams; // create path and map variables @@ -589,17 +653,17 @@ private Call batchAssignUserIdsValidateBeforeCall( String xAlgoliaUserID, BatchAssignUserIdsParams batchAssignUserIdsParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'xAlgoliaUserID' is set if (xAlgoliaUserID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'xAlgoliaUserID' when calling batchAssignUserIds(Async)" ); } // verify the required parameter 'batchAssignUserIdsParams' is set if (batchAssignUserIdsParams == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'batchAssignUserIdsParams' when calling" + " batchAssignUserIds(Async)" ); @@ -620,20 +684,22 @@ private Call batchAssignUserIdsValidateBeforeCall( * @param xAlgoliaUserID userID to assign. (required) * @param batchAssignUserIdsParams (required) * @return CreatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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 - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = batchAssignUserIdsValidateBeforeCall( xAlgoliaUserID, batchAssignUserIdsParams, null ); if (req instanceof CallEcho) { - return new EchoResponse.BatchAssignUserIds(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.BatchAssignUserIds( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -650,13 +716,14 @@ public CreatedAtResponse batchAssignUserIds( * @param batchAssignUserIdsParams (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call batchAssignUserIdsAsync( String xAlgoliaUserID, BatchAssignUserIdsParams batchAssignUserIdsParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = batchAssignUserIdsValidateBeforeCall( xAlgoliaUserID, batchAssignUserIdsParams, @@ -672,19 +739,19 @@ public Call batchAssignUserIdsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call batchDictionaryEntriesCall( - String dictionaryName, + DictionaryType dictionaryName, BatchDictionaryEntriesParams batchDictionaryEntriesParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = batchDictionaryEntriesParams; // create path and map variables String requestPath = "/1/dictionaries/{dictionaryName}/batch".replaceAll( - "\\{" + "dictionaryName" + "\\}", + "\\{dictionaryName\\}", this.escapeString(dictionaryName.toString()) ); @@ -705,13 +772,13 @@ private Call batchDictionaryEntriesCall( } private Call batchDictionaryEntriesValidateBeforeCall( - String dictionaryName, + DictionaryType dictionaryName, BatchDictionaryEntriesParams batchDictionaryEntriesParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'dictionaryName' is set if (dictionaryName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'dictionaryName' when calling" + " batchDictionaryEntries(Async)" ); @@ -719,7 +786,7 @@ private Call batchDictionaryEntriesValidateBeforeCall( // verify the required parameter 'batchDictionaryEntriesParams' is set if (batchDictionaryEntriesParams == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'batchDictionaryEntriesParams' when calling" + " batchDictionaryEntries(Async)" ); @@ -738,20 +805,20 @@ private Call batchDictionaryEntriesValidateBeforeCall( * @param dictionaryName The dictionary to search in. (required) * @param batchDictionaryEntriesParams (required) * @return UpdatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public UpdatedAtResponse batchDictionaryEntries( - String dictionaryName, + DictionaryType dictionaryName, BatchDictionaryEntriesParams batchDictionaryEntriesParams - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = batchDictionaryEntriesValidateBeforeCall( dictionaryName, batchDictionaryEntriesParams, null ); if (req instanceof CallEcho) { - return new EchoResponse.BatchDictionaryEntries( + return new EchoResponse.SearchEcho.BatchDictionaryEntries( ((CallEcho) req).request() ); } @@ -768,13 +835,14 @@ public UpdatedAtResponse batchDictionaryEntries( * @param batchDictionaryEntriesParams (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call batchDictionaryEntriesAsync( - String dictionaryName, + DictionaryType dictionaryName, BatchDictionaryEntriesParams batchDictionaryEntriesParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = batchDictionaryEntriesValidateBeforeCall( dictionaryName, batchDictionaryEntriesParams, @@ -790,7 +858,7 @@ public Call batchDictionaryEntriesAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call batchRulesCall( String indexName, @@ -798,13 +866,13 @@ private Call batchRulesCall( Boolean forwardToReplicas, Boolean clearExistingRules, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = rule; // create path and map variables String requestPath = "/1/indexes/{indexName}/rules/batch".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -842,17 +910,17 @@ private Call batchRulesValidateBeforeCall( Boolean forwardToReplicas, Boolean clearExistingRules, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling batchRules(Async)" ); } // verify the required parameter 'rule' is set if (rule == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'rule' when calling batchRules(Async)" ); } @@ -876,15 +944,15 @@ private Call batchRulesValidateBeforeCall( * @param clearExistingRules When true, existing Rules are cleared before adding this batch. When * false, existing Rules are kept. (optional) * @return UpdatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public UpdatedAtResponse batchRules( String indexName, List rule, Boolean forwardToReplicas, Boolean clearExistingRules - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = batchRulesValidateBeforeCall( indexName, rule, @@ -893,7 +961,7 @@ public UpdatedAtResponse batchRules( null ); if (req instanceof CallEcho) { - return new EchoResponse.BatchRules(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.BatchRules(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -902,7 +970,7 @@ public UpdatedAtResponse batchRules( } public UpdatedAtResponse batchRules(String indexName, List rule) - throws ApiException { + throws AlgoliaRuntimeException { return this.batchRules(indexName, rule, null, null); } @@ -917,7 +985,8 @@ public UpdatedAtResponse batchRules(String indexName, List rule) * false, existing Rules are kept. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call batchRulesAsync( String indexName, @@ -925,7 +994,7 @@ public Call batchRulesAsync( Boolean forwardToReplicas, Boolean clearExistingRules, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = batchRulesValidateBeforeCall( indexName, rule, @@ -943,19 +1012,19 @@ public Call batchRulesAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call browseCall( String indexName, BrowseRequest browseRequest, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = browseRequest; // create path and map variables String requestPath = "/1/indexes/{indexName}/browse".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -979,10 +1048,10 @@ private Call browseValidateBeforeCall( String indexName, BrowseRequest browseRequest, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling browse(Async)" ); } @@ -1001,14 +1070,14 @@ private Call browseValidateBeforeCall( * @param indexName The index in which to perform the request. (required) * @param browseRequest (optional) * @return BrowseResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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) - throws ApiException { + throws AlgoliaRuntimeException { Call req = browseValidateBeforeCall(indexName, browseRequest, null); if (req instanceof CallEcho) { - return new EchoResponse.Browse(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.Browse(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -1016,7 +1085,8 @@ public BrowseResponse browse(String indexName, BrowseRequest browseRequest) return res.getData(); } - public BrowseResponse browse(String indexName) throws ApiException { + public BrowseResponse browse(String indexName) + throws AlgoliaRuntimeException { return this.browse(indexName, null); } @@ -1033,13 +1103,14 @@ public BrowseResponse browse(String indexName) throws ApiException { * @param browseRequest (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call browseAsync( String indexName, BrowseRequest browseRequest, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = browseValidateBeforeCall(indexName, browseRequest, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -1051,19 +1122,19 @@ public Call browseAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call clearAllSynonymsCall( String indexName, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/indexes/{indexName}/synonyms/clear".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -1093,10 +1164,10 @@ private Call clearAllSynonymsValidateBeforeCall( String indexName, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling clearAllSynonyms(Async)" ); } @@ -1111,20 +1182,22 @@ private Call clearAllSynonymsValidateBeforeCall( * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) * @return UpdatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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 - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = clearAllSynonymsValidateBeforeCall( indexName, forwardToReplicas, null ); if (req instanceof CallEcho) { - return new EchoResponse.ClearAllSynonyms(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.ClearAllSynonyms( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -1133,7 +1206,7 @@ public UpdatedAtResponse clearAllSynonyms( } public UpdatedAtResponse clearAllSynonyms(String indexName) - throws ApiException { + throws AlgoliaRuntimeException { return this.clearAllSynonyms(indexName, null); } @@ -1145,13 +1218,14 @@ public UpdatedAtResponse clearAllSynonyms(String indexName) * indexName. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call clearAllSynonymsAsync( String indexName, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = clearAllSynonymsValidateBeforeCall( indexName, forwardToReplicas, @@ -1167,18 +1241,18 @@ public Call clearAllSynonymsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call clearObjectsCall( String indexName, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/indexes/{indexName}/clear".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -1201,10 +1275,10 @@ private Call clearObjectsCall( private Call clearObjectsValidateBeforeCall( String indexName, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling clearObjects(Async)" ); } @@ -1217,13 +1291,16 @@ private Call clearObjectsValidateBeforeCall( * * @param indexName The index in which to perform the request. (required) * @return UpdatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public UpdatedAtResponse clearObjects(String indexName) throws ApiException { + public UpdatedAtResponse clearObjects(String indexName) + throws AlgoliaRuntimeException { Call req = clearObjectsValidateBeforeCall(indexName, null); if (req instanceof CallEcho) { - return new EchoResponse.ClearObjects(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.ClearObjects( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -1238,12 +1315,13 @@ public UpdatedAtResponse clearObjects(String indexName) throws ApiException { * @param indexName The index in which to perform the request. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call clearObjectsAsync( String indexName, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = clearObjectsValidateBeforeCall(indexName, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -1255,19 +1333,19 @@ public Call clearObjectsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call clearRulesCall( String indexName, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/indexes/{indexName}/rules/clear".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -1297,10 +1375,10 @@ private Call clearRulesValidateBeforeCall( String indexName, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling clearRules(Async)" ); } @@ -1315,16 +1393,16 @@ private Call clearRulesValidateBeforeCall( * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) * @return UpdatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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 - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = clearRulesValidateBeforeCall(indexName, forwardToReplicas, null); if (req instanceof CallEcho) { - return new EchoResponse.ClearRules(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.ClearRules(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -1332,7 +1410,8 @@ public UpdatedAtResponse clearRules( return res.getData(); } - public UpdatedAtResponse clearRules(String indexName) throws ApiException { + public UpdatedAtResponse clearRules(String indexName) + throws AlgoliaRuntimeException { return this.clearRules(indexName, null); } @@ -1344,13 +1423,14 @@ public UpdatedAtResponse clearRules(String indexName) throws ApiException { * indexName. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call clearRulesAsync( String indexName, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = clearRulesValidateBeforeCall( indexName, forwardToReplicas, @@ -1366,22 +1446,18 @@ public Call clearRulesAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call delCall( String path, String parameters, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = body; // create path and map variables - String requestPath = - "/1{path}".replaceAll( - "\\{" + "path" + "\\}", - this.escapeString(path.toString()) - ); + String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -1408,10 +1484,10 @@ private Call delValidateBeforeCall( String parameters, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'path' is set if (path == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'path' when calling del(Async)" ); } @@ -1428,14 +1504,14 @@ private Call delValidateBeforeCall( * query made with this API key. (optional) * @param body The parameters to send with the custom request. (optional) * @return Object - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public Object del(String path, String parameters, Object body) - throws ApiException { + throws AlgoliaRuntimeException { Call req = delValidateBeforeCall(path, parameters, body, null); if (req instanceof CallEcho) { - return new EchoResponse.Del(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.Del(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -1443,7 +1519,7 @@ public Object del(String path, String parameters, Object body) return res.getData(); } - public Object del(String path) throws ApiException { + public Object del(String path) throws AlgoliaRuntimeException { return this.del(path, null, null); } @@ -1457,14 +1533,15 @@ public Object del(String path) throws ApiException { * @param body The parameters to send with the custom request. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call delAsync( String path, String parameters, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = delValidateBeforeCall(path, parameters, body, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -1476,18 +1553,18 @@ public Call delAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call deleteApiKeyCall( String key, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/keys/{key}".replaceAll( - "\\{" + "key" + "\\}", + "\\{key\\}", this.escapeString(key.toString()) ); @@ -1510,10 +1587,10 @@ private Call deleteApiKeyCall( private Call deleteApiKeyValidateBeforeCall( String key, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'key' is set if (key == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'key' when calling deleteApiKey(Async)" ); } @@ -1526,13 +1603,16 @@ private Call deleteApiKeyValidateBeforeCall( * * @param key API Key string. (required) * @return DeleteApiKeyResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public DeleteApiKeyResponse deleteApiKey(String key) throws ApiException { + public DeleteApiKeyResponse deleteApiKey(String key) + throws AlgoliaRuntimeException { Call req = deleteApiKeyValidateBeforeCall(key, null); if (req instanceof CallEcho) { - return new EchoResponse.DeleteApiKey(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.DeleteApiKey( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -1546,12 +1626,13 @@ public DeleteApiKeyResponse deleteApiKey(String key) throws ApiException { * @param key API Key string. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call deleteApiKeyAsync( String key, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = deleteApiKeyValidateBeforeCall(key, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -1563,19 +1644,19 @@ public Call deleteApiKeyAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call deleteByCall( String indexName, SearchParams searchParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = searchParams; // create path and map variables String requestPath = "/1/indexes/{indexName}/deleteByQuery".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -1599,17 +1680,17 @@ private Call deleteByValidateBeforeCall( String indexName, SearchParams searchParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling deleteBy(Async)" ); } // verify the required parameter 'searchParams' is set if (searchParams == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'searchParams' when calling deleteBy(Async)" ); } @@ -1625,16 +1706,16 @@ private Call deleteByValidateBeforeCall( * @param indexName The index in which to perform the request. (required) * @param searchParams (required) * @return DeletedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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 - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = deleteByValidateBeforeCall(indexName, searchParams, null); if (req instanceof CallEcho) { - return new EchoResponse.DeleteBy(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.DeleteBy(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -1651,13 +1732,14 @@ public DeletedAtResponse deleteBy( * @param searchParams (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call deleteByAsync( String indexName, SearchParams searchParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = deleteByValidateBeforeCall(indexName, searchParams, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -1669,18 +1751,18 @@ public Call deleteByAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call deleteIndexCall( String indexName, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/indexes/{indexName}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -1703,10 +1785,10 @@ private Call deleteIndexCall( private Call deleteIndexValidateBeforeCall( String indexName, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling deleteIndex(Async)" ); } @@ -1719,13 +1801,16 @@ private Call deleteIndexValidateBeforeCall( * * @param indexName The index in which to perform the request. (required) * @return DeletedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public DeletedAtResponse deleteIndex(String indexName) throws ApiException { + public DeletedAtResponse deleteIndex(String indexName) + throws AlgoliaRuntimeException { Call req = deleteIndexValidateBeforeCall(indexName, null); if (req instanceof CallEcho) { - return new EchoResponse.DeleteIndex(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.DeleteIndex( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -1739,12 +1824,13 @@ public DeletedAtResponse deleteIndex(String indexName) throws ApiException { * @param indexName The index in which to perform the request. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call deleteIndexAsync( String indexName, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = deleteIndexValidateBeforeCall(indexName, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -1756,25 +1842,22 @@ public Call deleteIndexAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call deleteObjectCall( String indexName, String objectID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/indexes/{indexName}/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -1796,17 +1879,17 @@ private Call deleteObjectValidateBeforeCall( String indexName, String objectID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling deleteObject(Async)" ); } // verify the required parameter 'objectID' is set if (objectID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'objectID' when calling deleteObject(Async)" ); } @@ -1820,14 +1903,16 @@ private Call deleteObjectValidateBeforeCall( * @param indexName The index in which to perform the request. (required) * @param objectID Unique identifier of an object. (required) * @return DeletedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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) - throws ApiException { + throws AlgoliaRuntimeException { Call req = deleteObjectValidateBeforeCall(indexName, objectID, null); if (req instanceof CallEcho) { - return new EchoResponse.DeleteObject(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.DeleteObject( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -1842,13 +1927,14 @@ public DeletedAtResponse deleteObject(String indexName, String objectID) * @param objectID Unique identifier of an object. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call deleteObjectAsync( String indexName, String objectID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = deleteObjectValidateBeforeCall(indexName, objectID, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -1860,26 +1946,23 @@ public Call deleteObjectAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call deleteRuleCall( String indexName, String objectID, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/indexes/{indexName}/rules/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -1908,17 +1991,17 @@ private Call deleteRuleValidateBeforeCall( String objectID, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling deleteRule(Async)" ); } // verify the required parameter 'objectID' is set if (objectID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'objectID' when calling deleteRule(Async)" ); } @@ -1934,14 +2017,14 @@ private Call deleteRuleValidateBeforeCall( * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) * @return UpdatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public UpdatedAtResponse deleteRule( String indexName, String objectID, Boolean forwardToReplicas - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = deleteRuleValidateBeforeCall( indexName, objectID, @@ -1949,7 +2032,7 @@ public UpdatedAtResponse deleteRule( null ); if (req instanceof CallEcho) { - return new EchoResponse.DeleteRule(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.DeleteRule(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -1958,7 +2041,7 @@ public UpdatedAtResponse deleteRule( } public UpdatedAtResponse deleteRule(String indexName, String objectID) - throws ApiException { + throws AlgoliaRuntimeException { return this.deleteRule(indexName, objectID, null); } @@ -1971,14 +2054,15 @@ public UpdatedAtResponse deleteRule(String indexName, String objectID) * indexName. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call deleteRuleAsync( String indexName, String objectID, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = deleteRuleValidateBeforeCall( indexName, objectID, @@ -1995,18 +2079,18 @@ public Call deleteRuleAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call deleteSourceCall( String source, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/security/sources/{source}".replaceAll( - "\\{" + "source" + "\\}", + "\\{source\\}", this.escapeString(source.toString()) ); @@ -2029,10 +2113,10 @@ private Call deleteSourceCall( private Call deleteSourceValidateBeforeCall( String source, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'source' is set if (source == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'source' when calling deleteSource(Async)" ); } @@ -2045,13 +2129,16 @@ private Call deleteSourceValidateBeforeCall( * * @param source The IP range of the source. (required) * @return DeleteSourceResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public DeleteSourceResponse deleteSource(String source) throws ApiException { + public DeleteSourceResponse deleteSource(String source) + throws AlgoliaRuntimeException { Call req = deleteSourceValidateBeforeCall(source, null); if (req instanceof CallEcho) { - return new EchoResponse.DeleteSource(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.DeleteSource( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -2065,12 +2152,13 @@ public DeleteSourceResponse deleteSource(String source) throws ApiException { * @param source The IP range of the source. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call deleteSourceAsync( String source, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = deleteSourceValidateBeforeCall(source, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -2082,26 +2170,23 @@ public Call deleteSourceAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call deleteSynonymCall( String indexName, String objectID, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/indexes/{indexName}/synonyms/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -2130,17 +2215,17 @@ private Call deleteSynonymValidateBeforeCall( String objectID, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling deleteSynonym(Async)" ); } // verify the required parameter 'objectID' is set if (objectID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'objectID' when calling deleteSynonym(Async)" ); } @@ -2156,14 +2241,14 @@ private Call deleteSynonymValidateBeforeCall( * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) * @return DeletedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public DeletedAtResponse deleteSynonym( String indexName, String objectID, Boolean forwardToReplicas - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = deleteSynonymValidateBeforeCall( indexName, objectID, @@ -2171,7 +2256,9 @@ public DeletedAtResponse deleteSynonym( null ); if (req instanceof CallEcho) { - return new EchoResponse.DeleteSynonym(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.DeleteSynonym( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -2180,7 +2267,7 @@ public DeletedAtResponse deleteSynonym( } public DeletedAtResponse deleteSynonym(String indexName, String objectID) - throws ApiException { + throws AlgoliaRuntimeException { return this.deleteSynonym(indexName, objectID, null); } @@ -2193,14 +2280,15 @@ public DeletedAtResponse deleteSynonym(String indexName, String objectID) * indexName. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call deleteSynonymAsync( String indexName, String objectID, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = deleteSynonymValidateBeforeCall( indexName, objectID, @@ -2217,21 +2305,17 @@ public Call deleteSynonymAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call getCall( String path, String parameters, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables - String requestPath = - "/1{path}".replaceAll( - "\\{" + "path" + "\\}", - this.escapeString(path.toString()) - ); + String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -2257,10 +2341,10 @@ private Call getValidateBeforeCall( String path, String parameters, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'path' is set if (path == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'path' when calling get(Async)" ); } @@ -2276,13 +2360,14 @@ private Call getValidateBeforeCall( * @param parameters URL-encoded query string. Force some query parameters to be applied for each * query made with this API key. (optional) * @return Object - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public Object get(String path, String parameters) throws ApiException { + public Object get(String path, String parameters) + throws AlgoliaRuntimeException { Call req = getValidateBeforeCall(path, parameters, null); if (req instanceof CallEcho) { - return new EchoResponse.Get(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.Get(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -2290,7 +2375,7 @@ public Object get(String path, String parameters) throws ApiException { return res.getData(); } - public Object get(String path) throws ApiException { + public Object get(String path) throws AlgoliaRuntimeException { return this.get(path, null); } @@ -2303,13 +2388,14 @@ public Object get(String path) throws ApiException { * query made with this API key. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call getAsync( String path, String parameters, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = getValidateBeforeCall(path, parameters, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -2321,16 +2407,16 @@ public Call getAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call getApiKeyCall(String key, final ApiCallback _callback) - throws ApiException { + throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/keys/{key}".replaceAll( - "\\{" + "key" + "\\}", + "\\{key\\}", this.escapeString(key.toString()) ); @@ -2353,10 +2439,10 @@ private Call getApiKeyCall(String key, final ApiCallback _callback) private Call getApiKeyValidateBeforeCall( String key, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'key' is set if (key == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'key' when calling getApiKey(Async)" ); } @@ -2369,13 +2455,13 @@ private Call getApiKeyValidateBeforeCall( * * @param key API Key string. (required) * @return Key - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public Key getApiKey(String key) throws ApiException { + public Key getApiKey(String key) throws AlgoliaRuntimeException { Call req = getApiKeyValidateBeforeCall(key, null); if (req instanceof CallEcho) { - return new EchoResponse.GetApiKey(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.GetApiKey(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -2389,10 +2475,11 @@ public Key getApiKey(String key) throws ApiException { * @param key API Key string. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call getApiKeyAsync(String key, final ApiCallback _callback) - throws ApiException { + throws AlgoliaRuntimeException { Call call = getApiKeyValidateBeforeCall(key, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -2404,11 +2491,11 @@ public Call getApiKeyAsync(String key, final ApiCallback _callback) * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call getDictionaryLanguagesCall( final ApiCallback> _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -2432,7 +2519,7 @@ private Call getDictionaryLanguagesCall( private Call getDictionaryLanguagesValidateBeforeCall( final ApiCallback> _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { return getDictionaryLanguagesCall(_callback); } @@ -2440,13 +2527,14 @@ private Call getDictionaryLanguagesValidateBeforeCall( * List dictionaries supported per language. * * @return Map<String, Languages> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public Map getDictionaryLanguages() throws ApiException { + public Map getDictionaryLanguages() + throws AlgoliaRuntimeException { Call req = getDictionaryLanguagesValidateBeforeCall(null); if (req instanceof CallEcho) { - return new EchoResponse.GetDictionaryLanguages( + return new EchoResponse.SearchEcho.GetDictionaryLanguages( ((CallEcho) req).request() ); } @@ -2461,11 +2549,12 @@ public Map getDictionaryLanguages() throws ApiException { * * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call getDictionaryLanguagesAsync( final ApiCallback> _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = getDictionaryLanguagesValidateBeforeCall(_callback); Type returnType = new TypeToken>() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -2477,11 +2566,11 @@ public Call getDictionaryLanguagesAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call getDictionarySettingsCall( final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -2505,7 +2594,7 @@ private Call getDictionarySettingsCall( private Call getDictionarySettingsValidateBeforeCall( final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { return getDictionarySettingsCall(_callback); } @@ -2513,14 +2602,16 @@ private Call getDictionarySettingsValidateBeforeCall( * Retrieve dictionaries settings. * * @return GetDictionarySettingsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public GetDictionarySettingsResponse getDictionarySettings() - throws ApiException { + throws AlgoliaRuntimeException { Call req = getDictionarySettingsValidateBeforeCall(null); if (req instanceof CallEcho) { - return new EchoResponse.GetDictionarySettings(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.GetDictionarySettings( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {} @@ -2535,11 +2626,12 @@ public GetDictionarySettingsResponse getDictionarySettings() * * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call getDictionarySettingsAsync( final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = getDictionarySettingsValidateBeforeCall(_callback); Type returnType = new TypeToken() {} .getType(); @@ -2552,15 +2644,15 @@ public Call getDictionarySettingsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call getLogsCall( Integer offset, Integer length, String indexName, - String type, + LogType type, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -2602,9 +2694,9 @@ private Call getLogsValidateBeforeCall( Integer offset, Integer length, String indexName, - String type, + LogType type, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { return getLogsCall(offset, length, indexName, type, _callback); } @@ -2616,22 +2708,22 @@ private Call getLogsValidateBeforeCall( * @param length Maximum number of entries to retrieve. The maximum allowed value is 1000. * (optional, default to 10) * @param indexName Index for which log entries should be retrieved. When omitted, log entries are - * retrieved across all indices. (optional, default to null) + * retrieved across all indices. (optional) * @param type Type of log entries to retrieve. When omitted, all log entries are retrieved. * (optional, default to all) * @return GetLogsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public GetLogsResponse getLogs( Integer offset, Integer length, String indexName, - String type - ) throws ApiException { + LogType type + ) throws AlgoliaRuntimeException { Call req = getLogsValidateBeforeCall(offset, length, indexName, type, null); if (req instanceof CallEcho) { - return new EchoResponse.GetLogs(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.GetLogs(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -2639,8 +2731,8 @@ public GetLogsResponse getLogs( return res.getData(); } - public GetLogsResponse getLogs() throws ApiException { - return this.getLogs(0, 10, "null", "all"); + public GetLogsResponse getLogs() throws AlgoliaRuntimeException { + return this.getLogs(0, 10, null, LogType.ALL); } /** @@ -2651,20 +2743,21 @@ public GetLogsResponse getLogs() throws ApiException { * @param length Maximum number of entries to retrieve. The maximum allowed value is 1000. * (optional, default to 10) * @param indexName Index for which log entries should be retrieved. When omitted, log entries are - * retrieved across all indices. (optional, default to null) + * 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 _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call getLogsAsync( Integer offset, Integer length, String indexName, - String type, + LogType type, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = getLogsValidateBeforeCall( offset, length, @@ -2682,26 +2775,23 @@ public Call getLogsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call getObjectCall( String indexName, String objectID, List attributesToRetrieve, final ApiCallback> _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/indexes/{indexName}/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -2730,17 +2820,17 @@ private Call getObjectValidateBeforeCall( String objectID, List attributesToRetrieve, final ApiCallback> _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling getObject(Async)" ); } // verify the required parameter 'objectID' is set if (objectID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'objectID' when calling getObject(Async)" ); } @@ -2756,14 +2846,14 @@ private Call getObjectValidateBeforeCall( * @param attributesToRetrieve List of attributes to retrieve. If not specified, all retrievable * attributes are returned. (optional) * @return Map<String, String> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public Map getObject( String indexName, String objectID, List attributesToRetrieve - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = getObjectValidateBeforeCall( indexName, objectID, @@ -2771,7 +2861,7 @@ public Map getObject( null ); if (req instanceof CallEcho) { - return new EchoResponse.GetObject(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.GetObject(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken>() {}.getType(); @@ -2780,8 +2870,8 @@ public Map getObject( } public Map getObject(String indexName, String objectID) - throws ApiException { - return this.getObject(indexName, objectID, null); + throws AlgoliaRuntimeException { + return this.getObject(indexName, objectID, new ArrayList<>()); } /** @@ -2793,14 +2883,15 @@ public Map getObject(String indexName, String objectID) * attributes are returned. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call getObjectAsync( String indexName, String objectID, List attributesToRetrieve, final ApiCallback> _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = getObjectValidateBeforeCall( indexName, objectID, @@ -2817,12 +2908,12 @@ public Call getObjectAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call getObjectsCall( GetObjectsParams getObjectsParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = getObjectsParams; // create path and map variables @@ -2847,10 +2938,10 @@ private Call getObjectsCall( private Call getObjectsValidateBeforeCall( GetObjectsParams getObjectsParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'getObjectsParams' is set if (getObjectsParams == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'getObjectsParams' when calling getObjects(Async)" ); } @@ -2863,14 +2954,14 @@ private Call getObjectsValidateBeforeCall( * * @param getObjectsParams (required) * @return GetObjectsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public GetObjectsResponse getObjects(GetObjectsParams getObjectsParams) - throws ApiException { + throws AlgoliaRuntimeException { Call req = getObjectsValidateBeforeCall(getObjectsParams, null); if (req instanceof CallEcho) { - return new EchoResponse.GetObjects(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.GetObjects(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -2885,12 +2976,13 @@ public GetObjectsResponse getObjects(GetObjectsParams getObjectsParams) * @param getObjectsParams (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call getObjectsAsync( GetObjectsParams getObjectsParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = getObjectsValidateBeforeCall(getObjectsParams, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -2902,25 +2994,22 @@ public Call getObjectsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call getRuleCall( String indexName, String objectID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/indexes/{indexName}/rules/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -2942,17 +3031,17 @@ private Call getRuleValidateBeforeCall( String indexName, String objectID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling getRule(Async)" ); } // verify the required parameter 'objectID' is set if (objectID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'objectID' when calling getRule(Async)" ); } @@ -2966,13 +3055,14 @@ private Call getRuleValidateBeforeCall( * @param indexName The index in which to perform the request. (required) * @param objectID Unique identifier of an object. (required) * @return Rule - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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) throws ApiException { + public Rule getRule(String indexName, String objectID) + throws AlgoliaRuntimeException { Call req = getRuleValidateBeforeCall(indexName, objectID, null); if (req instanceof CallEcho) { - return new EchoResponse.GetRule(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.GetRule(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -2987,13 +3077,14 @@ public Rule getRule(String indexName, String objectID) throws ApiException { * @param objectID Unique identifier of an object. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call getRuleAsync( String indexName, String objectID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = getRuleValidateBeforeCall(indexName, objectID, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -3005,18 +3096,18 @@ public Call getRuleAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call getSettingsCall( String indexName, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/indexes/{indexName}/settings".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -3039,10 +3130,10 @@ private Call getSettingsCall( private Call getSettingsValidateBeforeCall( String indexName, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling getSettings(Async)" ); } @@ -3055,13 +3146,16 @@ private Call getSettingsValidateBeforeCall( * * @param indexName The index in which to perform the request. (required) * @return IndexSettings - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public IndexSettings getSettings(String indexName) throws ApiException { + public IndexSettings getSettings(String indexName) + throws AlgoliaRuntimeException { Call req = getSettingsValidateBeforeCall(indexName, null); if (req instanceof CallEcho) { - return new EchoResponse.GetSettings(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.GetSettings( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -3075,12 +3169,13 @@ public IndexSettings getSettings(String indexName) throws ApiException { * @param indexName The index in which to perform the request. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call getSettingsAsync( String indexName, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = getSettingsValidateBeforeCall(indexName, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -3092,10 +3187,10 @@ public Call getSettingsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call getSourcesCall(final ApiCallback> _callback) - throws ApiException { + throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -3119,7 +3214,7 @@ private Call getSourcesCall(final ApiCallback> _callback) private Call getSourcesValidateBeforeCall( final ApiCallback> _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { return getSourcesCall(_callback); } @@ -3127,13 +3222,13 @@ private Call getSourcesValidateBeforeCall( * List all allowed sources. * * @return List<Source> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public List getSources() throws ApiException { + public List getSources() throws AlgoliaRuntimeException { Call req = getSourcesValidateBeforeCall(null); if (req instanceof CallEcho) { - return new EchoResponse.GetSources(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.GetSources(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken>() {}.getType(); @@ -3146,10 +3241,11 @@ public List getSources() throws ApiException { * * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call getSourcesAsync(final ApiCallback> _callback) - throws ApiException { + throws AlgoliaRuntimeException { Call call = getSourcesValidateBeforeCall(_callback); Type returnType = new TypeToken>() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -3161,25 +3257,22 @@ public Call getSourcesAsync(final ApiCallback> _callback) * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call getSynonymCall( String indexName, String objectID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/indexes/{indexName}/synonyms/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -3201,17 +3294,17 @@ private Call getSynonymValidateBeforeCall( String indexName, String objectID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling getSynonym(Async)" ); } // verify the required parameter 'objectID' is set if (objectID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'objectID' when calling getSynonym(Async)" ); } @@ -3225,14 +3318,14 @@ private Call getSynonymValidateBeforeCall( * @param indexName The index in which to perform the request. (required) * @param objectID Unique identifier of an object. (required) * @return SynonymHit - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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) - throws ApiException { + throws AlgoliaRuntimeException { Call req = getSynonymValidateBeforeCall(indexName, objectID, null); if (req instanceof CallEcho) { - return new EchoResponse.GetSynonym(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.GetSynonym(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -3247,13 +3340,14 @@ public SynonymHit getSynonym(String indexName, String objectID) * @param objectID Unique identifier of an object. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call getSynonymAsync( String indexName, String objectID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = getSynonymValidateBeforeCall(indexName, objectID, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -3265,25 +3359,22 @@ public Call getSynonymAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call getTaskCall( String indexName, Integer taskID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/indexes/{indexName}/task/{taskID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "taskID" + "\\}", - this.escapeString(taskID.toString()) - ); + .replaceAll("\\{taskID\\}", this.escapeString(taskID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -3305,17 +3396,17 @@ private Call getTaskValidateBeforeCall( String indexName, Integer taskID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling getTask(Async)" ); } // verify the required parameter 'taskID' is set if (taskID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'taskID' when calling getTask(Async)" ); } @@ -3327,16 +3418,16 @@ private Call getTaskValidateBeforeCall( * 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 taskID Unique identifier of an task. Numeric value (up to 64bits). (required) * @return GetTaskResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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) - throws ApiException { + throws AlgoliaRuntimeException { Call req = getTaskValidateBeforeCall(indexName, taskID, null); if (req instanceof CallEcho) { - return new EchoResponse.GetTask(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.GetTask(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -3348,16 +3439,17 @@ public GetTaskResponse getTask(String indexName, Integer taskID) * (asynchronously) 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 taskID Unique identifier of an task. Numeric value (up to 64bits). (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call getTaskAsync( String indexName, Integer taskID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = getTaskValidateBeforeCall(indexName, taskID, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -3369,11 +3461,11 @@ public Call getTaskAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call getTopUserIdsCall( final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -3397,7 +3489,7 @@ private Call getTopUserIdsCall( private Call getTopUserIdsValidateBeforeCall( final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { return getTopUserIdsCall(_callback); } @@ -3408,13 +3500,15 @@ private Call getTopUserIdsValidateBeforeCall( * following array of userIDs and clusters. * * @return GetTopUserIdsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public GetTopUserIdsResponse getTopUserIds() throws ApiException { + public GetTopUserIdsResponse getTopUserIds() throws AlgoliaRuntimeException { Call req = getTopUserIdsValidateBeforeCall(null); if (req instanceof CallEcho) { - return new EchoResponse.GetTopUserIds(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.GetTopUserIds( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -3430,11 +3524,12 @@ public GetTopUserIdsResponse getTopUserIds() throws ApiException { * * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call getTopUserIdsAsync( final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = getTopUserIdsValidateBeforeCall(_callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -3446,18 +3541,18 @@ public Call getTopUserIdsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call getUserIdCall( String userID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/clusters/mapping/{userID}".replaceAll( - "\\{" + "userID" + "\\}", + "\\{userID\\}", this.escapeString(userID.toString()) ); @@ -3480,10 +3575,10 @@ private Call getUserIdCall( private Call getUserIdValidateBeforeCall( String userID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'userID' is set if (userID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'userID' when calling getUserId(Async)" ); } @@ -3499,13 +3594,13 @@ private Call getUserIdValidateBeforeCall( * * @param userID userID to assign. (required) * @return UserId - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public UserId getUserId(String userID) throws ApiException { + public UserId getUserId(String userID) throws AlgoliaRuntimeException { Call req = getUserIdValidateBeforeCall(userID, null); if (req instanceof CallEcho) { - return new EchoResponse.GetUserId(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.GetUserId(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -3522,12 +3617,13 @@ public UserId getUserId(String userID) throws ApiException { * @param userID userID to assign. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call getUserIdAsync( String userID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = getUserIdValidateBeforeCall(userID, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -3539,12 +3635,12 @@ public Call getUserIdAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call hasPendingMappingsCall( Boolean getClusters, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -3573,7 +3669,7 @@ private Call hasPendingMappingsCall( private Call hasPendingMappingsValidateBeforeCall( Boolean getClusters, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { return hasPendingMappingsCall(getClusters, _callback); } @@ -3586,14 +3682,16 @@ private Call hasPendingMappingsValidateBeforeCall( * * @param getClusters Whether to get clusters or not. (optional) * @return CreatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public CreatedAtResponse hasPendingMappings(Boolean getClusters) - throws ApiException { + throws AlgoliaRuntimeException { Call req = hasPendingMappingsValidateBeforeCall(getClusters, null); if (req instanceof CallEcho) { - return new EchoResponse.HasPendingMappings(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.HasPendingMappings( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -3601,7 +3699,7 @@ public CreatedAtResponse hasPendingMappings(Boolean getClusters) return res.getData(); } - public CreatedAtResponse hasPendingMappings() throws ApiException { + public CreatedAtResponse hasPendingMappings() throws AlgoliaRuntimeException { return this.hasPendingMappings(null); } @@ -3615,12 +3713,13 @@ public CreatedAtResponse hasPendingMappings() throws ApiException { * @param getClusters Whether to get clusters or not. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call hasPendingMappingsAsync( Boolean getClusters, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = hasPendingMappingsValidateBeforeCall(getClusters, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -3632,11 +3731,11 @@ public Call hasPendingMappingsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call listApiKeysCall( final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -3660,7 +3759,7 @@ private Call listApiKeysCall( private Call listApiKeysValidateBeforeCall( final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { return listApiKeysCall(_callback); } @@ -3668,13 +3767,15 @@ private Call listApiKeysValidateBeforeCall( * List API keys, along with their associated rights. * * @return ListApiKeysResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public ListApiKeysResponse listApiKeys() throws ApiException { + public ListApiKeysResponse listApiKeys() throws AlgoliaRuntimeException { Call req = listApiKeysValidateBeforeCall(null); if (req instanceof CallEcho) { - return new EchoResponse.ListApiKeys(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.ListApiKeys( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -3687,11 +3788,12 @@ public ListApiKeysResponse listApiKeys() throws ApiException { * * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call listApiKeysAsync( final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = listApiKeysValidateBeforeCall(_callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -3703,11 +3805,11 @@ public Call listApiKeysAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call listClustersCall( final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -3731,7 +3833,7 @@ private Call listClustersCall( private Call listClustersValidateBeforeCall( final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { return listClustersCall(_callback); } @@ -3740,13 +3842,15 @@ private Call listClustersValidateBeforeCall( * response is 200 OK and contains the following clusters. * * @return ListClustersResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public ListClustersResponse listClusters() throws ApiException { + public ListClustersResponse listClusters() throws AlgoliaRuntimeException { Call req = listClustersValidateBeforeCall(null); if (req instanceof CallEcho) { - return new EchoResponse.ListClusters(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.ListClusters( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -3760,11 +3864,12 @@ public ListClustersResponse listClusters() throws ApiException { * * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call listClustersAsync( final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = listClustersValidateBeforeCall(_callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -3776,12 +3881,12 @@ public Call listClustersAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call listIndicesCall( Integer page, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -3810,7 +3915,7 @@ private Call listIndicesCall( private Call listIndicesValidateBeforeCall( Integer page, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { return listIndicesCall(page, _callback); } @@ -3821,13 +3926,16 @@ private Call listIndicesValidateBeforeCall( * page size is implicitly set to 100. When null, will retrieve all indices (no pagination). * (optional) * @return ListIndicesResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public ListIndicesResponse listIndices(Integer page) throws ApiException { + public ListIndicesResponse listIndices(Integer page) + throws AlgoliaRuntimeException { Call req = listIndicesValidateBeforeCall(page, null); if (req instanceof CallEcho) { - return new EchoResponse.ListIndices(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.ListIndices( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -3835,7 +3943,7 @@ public ListIndicesResponse listIndices(Integer page) throws ApiException { return res.getData(); } - public ListIndicesResponse listIndices() throws ApiException { + public ListIndicesResponse listIndices() throws AlgoliaRuntimeException { return this.listIndices(null); } @@ -3847,12 +3955,13 @@ public ListIndicesResponse listIndices() throws ApiException { * (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call listIndicesAsync( Integer page, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = listIndicesValidateBeforeCall(page, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -3864,13 +3973,13 @@ public Call listIndicesAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call listUserIdsCall( Integer page, Integer hitsPerPage, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables @@ -3904,7 +4013,7 @@ private Call listUserIdsValidateBeforeCall( Integer page, Integer hitsPerPage, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { return listUserIdsCall(page, hitsPerPage, _callback); } @@ -3919,14 +4028,16 @@ private Call listUserIdsValidateBeforeCall( * (optional) * @param hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) * @return ListUserIdsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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) - throws ApiException { + throws AlgoliaRuntimeException { Call req = listUserIdsValidateBeforeCall(page, hitsPerPage, null); if (req instanceof CallEcho) { - return new EchoResponse.ListUserIds(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.ListUserIds( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -3934,7 +4045,7 @@ public ListUserIdsResponse listUserIds(Integer page, Integer hitsPerPage) return res.getData(); } - public ListUserIdsResponse listUserIds() throws ApiException { + public ListUserIdsResponse listUserIds() throws AlgoliaRuntimeException { return this.listUserIds(null, 100); } @@ -3950,13 +4061,14 @@ public ListUserIdsResponse listUserIds() throws ApiException { * @param hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call listUserIdsAsync( Integer page, Integer hitsPerPage, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = listUserIdsValidateBeforeCall(page, hitsPerPage, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -3968,12 +4080,12 @@ public Call listUserIdsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call multipleBatchCall( BatchParams batchParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = batchParams; // create path and map variables @@ -3998,10 +4110,10 @@ private Call multipleBatchCall( private Call multipleBatchValidateBeforeCall( BatchParams batchParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'batchParams' is set if (batchParams == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'batchParams' when calling multipleBatch(Async)" ); } @@ -4015,14 +4127,16 @@ private Call multipleBatchValidateBeforeCall( * * @param batchParams (required) * @return MultipleBatchResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public MultipleBatchResponse multipleBatch(BatchParams batchParams) - throws ApiException { + throws AlgoliaRuntimeException { Call req = multipleBatchValidateBeforeCall(batchParams, null); if (req instanceof CallEcho) { - return new EchoResponse.MultipleBatch(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.MultipleBatch( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -4037,12 +4151,13 @@ public MultipleBatchResponse multipleBatch(BatchParams batchParams) * @param batchParams (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call multipleBatchAsync( BatchParams batchParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = multipleBatchValidateBeforeCall(batchParams, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -4054,12 +4169,12 @@ public Call multipleBatchAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call multipleQueriesCall( MultipleQueriesParams multipleQueriesParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = multipleQueriesParams; // create path and map variables @@ -4084,10 +4199,10 @@ private Call multipleQueriesCall( private Call multipleQueriesValidateBeforeCall( MultipleQueriesParams multipleQueriesParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'multipleQueriesParams' is set if (multipleQueriesParams == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'multipleQueriesParams' when calling" + " multipleQueries(Async)" ); @@ -4101,15 +4216,17 @@ private Call multipleQueriesValidateBeforeCall( * * @param multipleQueriesParams (required) * @return MultipleQueriesResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public MultipleQueriesResponse multipleQueries( MultipleQueriesParams multipleQueriesParams - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = multipleQueriesValidateBeforeCall(multipleQueriesParams, null); if (req instanceof CallEcho) { - return new EchoResponse.MultipleQueries(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.MultipleQueries( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -4123,12 +4240,13 @@ public MultipleQueriesResponse multipleQueries( * @param multipleQueriesParams (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call multipleQueriesAsync( MultipleQueriesParams multipleQueriesParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = multipleQueriesValidateBeforeCall( multipleQueriesParams, _callback @@ -4143,19 +4261,19 @@ public Call multipleQueriesAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call operationIndexCall( String indexName, OperationIndexParams operationIndexParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = operationIndexParams; // create path and map variables String requestPath = "/1/indexes/{indexName}/operation".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -4179,17 +4297,17 @@ private Call operationIndexValidateBeforeCall( String indexName, OperationIndexParams operationIndexParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling operationIndex(Async)" ); } // verify the required parameter 'operationIndexParams' is set if (operationIndexParams == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'operationIndexParams' when calling" + " operationIndex(Async)" ); @@ -4204,20 +4322,22 @@ private Call operationIndexValidateBeforeCall( * @param indexName The index in which to perform the request. (required) * @param operationIndexParams (required) * @return UpdatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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 - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = operationIndexValidateBeforeCall( indexName, operationIndexParams, null ); if (req instanceof CallEcho) { - return new EchoResponse.OperationIndex(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.OperationIndex( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -4232,13 +4352,14 @@ public UpdatedAtResponse operationIndex( * @param operationIndexParams (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call operationIndexAsync( String indexName, OperationIndexParams operationIndexParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = operationIndexValidateBeforeCall( indexName, operationIndexParams, @@ -4254,27 +4375,24 @@ public Call operationIndexAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call partialUpdateObjectCall( String indexName, String objectID, - List> oneOfstringbuiltInOperation, + List> attributeOrBuiltInOperation, Boolean createIfNotExists, final ApiCallback _callback - ) throws ApiException { - Object bodyObj = oneOfstringbuiltInOperation; + ) throws AlgoliaRuntimeException { + Object bodyObj = attributeOrBuiltInOperation; // create path and map variables String requestPath = "/1/indexes/{indexName}/{objectID}/partial".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -4301,28 +4419,28 @@ private Call partialUpdateObjectCall( private Call partialUpdateObjectValidateBeforeCall( String indexName, String objectID, - List> oneOfstringbuiltInOperation, + List> attributeOrBuiltInOperation, Boolean createIfNotExists, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling partialUpdateObject(Async)" ); } // verify the required parameter 'objectID' is set if (objectID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'objectID' when calling partialUpdateObject(Async)" ); } - // verify the required parameter 'oneOfstringbuiltInOperation' is set - if (oneOfstringbuiltInOperation == null) { - throw new ApiException( - "Missing the required parameter 'oneOfstringbuiltInOperation' when calling" + + // verify the required parameter 'attributeOrBuiltInOperation' is set + if (attributeOrBuiltInOperation == null) { + throw new AlgoliaRuntimeException( + "Missing the required parameter 'attributeOrBuiltInOperation' when calling" + " partialUpdateObject(Async)" ); } @@ -4330,7 +4448,7 @@ private Call partialUpdateObjectValidateBeforeCall( return partialUpdateObjectCall( indexName, objectID, - oneOfstringbuiltInOperation, + attributeOrBuiltInOperation, createIfNotExists, _callback ); @@ -4344,28 +4462,30 @@ private Call partialUpdateObjectValidateBeforeCall( * * @param indexName The index in which to perform the request. (required) * @param objectID Unique identifier of an object. (required) - * @param oneOfstringbuiltInOperation List of attributes to update. (required) + * @param attributeOrBuiltInOperation List of attributes to update. (required) * @param createIfNotExists Creates the record if it does not exist yet. (optional, default to * true) * @return UpdatedAtWithObjectIdResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public UpdatedAtWithObjectIdResponse partialUpdateObject( String indexName, String objectID, - List> oneOfstringbuiltInOperation, + List> attributeOrBuiltInOperation, Boolean createIfNotExists - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = partialUpdateObjectValidateBeforeCall( indexName, objectID, - oneOfstringbuiltInOperation, + attributeOrBuiltInOperation, createIfNotExists, null ); if (req instanceof CallEcho) { - return new EchoResponse.PartialUpdateObject(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.PartialUpdateObject( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {} @@ -4378,12 +4498,12 @@ public UpdatedAtWithObjectIdResponse partialUpdateObject( public UpdatedAtWithObjectIdResponse partialUpdateObject( String indexName, String objectID, - List> oneOfstringbuiltInOperation - ) throws ApiException { + List> attributeOrBuiltInOperation + ) throws AlgoliaRuntimeException { return this.partialUpdateObject( indexName, objectID, - oneOfstringbuiltInOperation, + attributeOrBuiltInOperation, true ); } @@ -4396,24 +4516,25 @@ public UpdatedAtWithObjectIdResponse partialUpdateObject( * * @param indexName The index in which to perform the request. (required) * @param objectID Unique identifier of an object. (required) - * @param oneOfstringbuiltInOperation List of attributes to update. (required) + * @param attributeOrBuiltInOperation List of attributes to update. (required) * @param createIfNotExists Creates the record if it does not exist yet. (optional, default to * true) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call partialUpdateObjectAsync( String indexName, String objectID, - List> oneOfstringbuiltInOperation, + List> attributeOrBuiltInOperation, Boolean createIfNotExists, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = partialUpdateObjectValidateBeforeCall( indexName, objectID, - oneOfstringbuiltInOperation, + attributeOrBuiltInOperation, createIfNotExists, _callback ); @@ -4428,22 +4549,18 @@ public Call partialUpdateObjectAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call postCall( String path, String parameters, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = body; // create path and map variables - String requestPath = - "/1{path}".replaceAll( - "\\{" + "path" + "\\}", - this.escapeString(path.toString()) - ); + String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -4470,10 +4587,10 @@ private Call postValidateBeforeCall( String parameters, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'path' is set if (path == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'path' when calling post(Async)" ); } @@ -4490,14 +4607,14 @@ private Call postValidateBeforeCall( * query made with this API key. (optional) * @param body The parameters to send with the custom request. (optional) * @return Object - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public Object post(String path, String parameters, Object body) - throws ApiException { + throws AlgoliaRuntimeException { Call req = postValidateBeforeCall(path, parameters, body, null); if (req instanceof CallEcho) { - return new EchoResponse.Post(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.Post(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -4505,7 +4622,7 @@ public Object post(String path, String parameters, Object body) return res.getData(); } - public Object post(String path) throws ApiException { + public Object post(String path) throws AlgoliaRuntimeException { return this.post(path, null, null); } @@ -4519,14 +4636,15 @@ public Object post(String path) throws ApiException { * @param body The parameters to send with the custom request. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call postAsync( String path, String parameters, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = postValidateBeforeCall(path, parameters, body, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -4538,22 +4656,18 @@ public Call postAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call putCall( String path, String parameters, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = body; // create path and map variables - String requestPath = - "/1{path}".replaceAll( - "\\{" + "path" + "\\}", - this.escapeString(path.toString()) - ); + String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -4580,10 +4694,10 @@ private Call putValidateBeforeCall( String parameters, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'path' is set if (path == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'path' when calling put(Async)" ); } @@ -4600,14 +4714,14 @@ private Call putValidateBeforeCall( * query made with this API key. (optional) * @param body The parameters to send with the custom request. (optional) * @return Object - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public Object put(String path, String parameters, Object body) - throws ApiException { + throws AlgoliaRuntimeException { Call req = putValidateBeforeCall(path, parameters, body, null); if (req instanceof CallEcho) { - return new EchoResponse.Put(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.Put(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -4615,7 +4729,7 @@ public Object put(String path, String parameters, Object body) return res.getData(); } - public Object put(String path) throws ApiException { + public Object put(String path) throws AlgoliaRuntimeException { return this.put(path, null, null); } @@ -4629,14 +4743,15 @@ public Object put(String path) throws ApiException { * @param body The parameters to send with the custom request. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call putAsync( String path, String parameters, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = putValidateBeforeCall(path, parameters, body, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -4648,18 +4763,18 @@ public Call putAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call removeUserIdCall( String userID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/clusters/mapping/{userID}".replaceAll( - "\\{" + "userID" + "\\}", + "\\{userID\\}", this.escapeString(userID.toString()) ); @@ -4682,10 +4797,10 @@ private Call removeUserIdCall( private Call removeUserIdValidateBeforeCall( String userID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'userID' is set if (userID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'userID' when calling removeUserId(Async)" ); } @@ -4699,13 +4814,16 @@ private Call removeUserIdValidateBeforeCall( * * @param userID userID to assign. (required) * @return RemoveUserIdResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public RemoveUserIdResponse removeUserId(String userID) throws ApiException { + public RemoveUserIdResponse removeUserId(String userID) + throws AlgoliaRuntimeException { Call req = removeUserIdValidateBeforeCall(userID, null); if (req instanceof CallEcho) { - return new EchoResponse.RemoveUserId(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.RemoveUserId( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -4720,12 +4838,13 @@ public RemoveUserIdResponse removeUserId(String userID) throws ApiException { * @param userID userID to assign. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call removeUserIdAsync( String userID, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = removeUserIdValidateBeforeCall(userID, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -4737,12 +4856,12 @@ public Call removeUserIdAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call replaceSourcesCall( List source, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = source; // create path and map variables @@ -4767,10 +4886,10 @@ private Call replaceSourcesCall( private Call replaceSourcesValidateBeforeCall( List source, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'source' is set if (source == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'source' when calling replaceSources(Async)" ); } @@ -4783,14 +4902,16 @@ private Call replaceSourcesValidateBeforeCall( * * @param source The sources to allow. (required) * @return ReplaceSourceResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public ReplaceSourceResponse replaceSources(List source) - throws ApiException { + throws AlgoliaRuntimeException { Call req = replaceSourcesValidateBeforeCall(source, null); if (req instanceof CallEcho) { - return new EchoResponse.ReplaceSources(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.ReplaceSources( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -4804,12 +4925,13 @@ public ReplaceSourceResponse replaceSources(List source) * @param source The sources to allow. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call replaceSourcesAsync( List source, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = replaceSourcesValidateBeforeCall(source, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -4821,18 +4943,18 @@ public Call replaceSourcesAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call restoreApiKeyCall( String key, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/keys/{key}/restore".replaceAll( - "\\{" + "key" + "\\}", + "\\{key\\}", this.escapeString(key.toString()) ); @@ -4855,10 +4977,10 @@ private Call restoreApiKeyCall( private Call restoreApiKeyValidateBeforeCall( String key, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'key' is set if (key == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'key' when calling restoreApiKey(Async)" ); } @@ -4871,13 +4993,16 @@ private Call restoreApiKeyValidateBeforeCall( * * @param key API Key string. (required) * @return AddApiKeyResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ - public AddApiKeyResponse restoreApiKey(String key) throws ApiException { + public AddApiKeyResponse restoreApiKey(String key) + throws AlgoliaRuntimeException { Call req = restoreApiKeyValidateBeforeCall(key, null); if (req instanceof CallEcho) { - return new EchoResponse.RestoreApiKey(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.RestoreApiKey( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -4891,12 +5016,13 @@ public AddApiKeyResponse restoreApiKey(String key) throws ApiException { * @param key API Key string. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call restoreApiKeyAsync( String key, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = restoreApiKeyValidateBeforeCall(key, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -4908,19 +5034,19 @@ public Call restoreApiKeyAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call saveObjectCall( String indexName, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = body; // create path and map variables String requestPath = "/1/indexes/{indexName}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -4944,17 +5070,17 @@ private Call saveObjectValidateBeforeCall( String indexName, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling saveObject(Async)" ); } // verify the required parameter 'body' is set if (body == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'body' when calling saveObject(Async)" ); } @@ -4968,14 +5094,14 @@ private Call saveObjectValidateBeforeCall( * @param indexName The index in which to perform the request. (required) * @param body The Algolia record. (required) * @return SaveObjectResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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) - throws ApiException { + throws AlgoliaRuntimeException { Call req = saveObjectValidateBeforeCall(indexName, body, null); if (req instanceof CallEcho) { - return new EchoResponse.SaveObject(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.SaveObject(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -4990,13 +5116,14 @@ public SaveObjectResponse saveObject(String indexName, Object body) * @param body The Algolia record. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call saveObjectAsync( String indexName, Object body, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = saveObjectValidateBeforeCall(indexName, body, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -5008,7 +5135,7 @@ public Call saveObjectAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call saveRuleCall( String indexName, @@ -5016,19 +5143,16 @@ private Call saveRuleCall( Rule rule, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = rule; // create path and map variables String requestPath = "/1/indexes/{indexName}/rules/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -5058,24 +5182,24 @@ private Call saveRuleValidateBeforeCall( Rule rule, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling saveRule(Async)" ); } // verify the required parameter 'objectID' is set if (objectID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'objectID' when calling saveRule(Async)" ); } // verify the required parameter 'rule' is set if (rule == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'rule' when calling saveRule(Async)" ); } @@ -5098,15 +5222,15 @@ private Call saveRuleValidateBeforeCall( * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) * @return UpdatedRuleResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public UpdatedRuleResponse saveRule( String indexName, String objectID, Rule rule, Boolean forwardToReplicas - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = saveRuleValidateBeforeCall( indexName, objectID, @@ -5115,7 +5239,7 @@ public UpdatedRuleResponse saveRule( null ); if (req instanceof CallEcho) { - return new EchoResponse.SaveRule(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.SaveRule(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -5127,7 +5251,7 @@ public UpdatedRuleResponse saveRule( String indexName, String objectID, Rule rule - ) throws ApiException { + ) throws AlgoliaRuntimeException { return this.saveRule(indexName, objectID, rule, null); } @@ -5141,7 +5265,8 @@ public UpdatedRuleResponse saveRule( * indexName. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call saveRuleAsync( String indexName, @@ -5149,7 +5274,7 @@ public Call saveRuleAsync( Rule rule, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = saveRuleValidateBeforeCall( indexName, objectID, @@ -5167,7 +5292,7 @@ public Call saveRuleAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call saveSynonymCall( String indexName, @@ -5175,19 +5300,16 @@ private Call saveSynonymCall( SynonymHit synonymHit, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = synonymHit; // create path and map variables String requestPath = "/1/indexes/{indexName}/synonyms/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -5217,24 +5339,24 @@ private Call saveSynonymValidateBeforeCall( SynonymHit synonymHit, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling saveSynonym(Async)" ); } // verify the required parameter 'objectID' is set if (objectID == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'objectID' when calling saveSynonym(Async)" ); } // verify the required parameter 'synonymHit' is set if (synonymHit == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'synonymHit' when calling saveSynonym(Async)" ); } @@ -5257,15 +5379,15 @@ private Call saveSynonymValidateBeforeCall( * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) * @return SaveSynonymResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public SaveSynonymResponse saveSynonym( String indexName, String objectID, SynonymHit synonymHit, Boolean forwardToReplicas - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = saveSynonymValidateBeforeCall( indexName, objectID, @@ -5274,7 +5396,9 @@ public SaveSynonymResponse saveSynonym( null ); if (req instanceof CallEcho) { - return new EchoResponse.SaveSynonym(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.SaveSynonym( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -5286,7 +5410,7 @@ public SaveSynonymResponse saveSynonym( String indexName, String objectID, SynonymHit synonymHit - ) throws ApiException { + ) throws AlgoliaRuntimeException { return this.saveSynonym(indexName, objectID, synonymHit, null); } @@ -5301,7 +5425,8 @@ public SaveSynonymResponse saveSynonym( * indexName. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call saveSynonymAsync( String indexName, @@ -5309,7 +5434,7 @@ public Call saveSynonymAsync( SynonymHit synonymHit, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = saveSynonymValidateBeforeCall( indexName, objectID, @@ -5327,7 +5452,7 @@ public Call saveSynonymAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call saveSynonymsCall( String indexName, @@ -5335,13 +5460,13 @@ private Call saveSynonymsCall( Boolean forwardToReplicas, Boolean replaceExistingSynonyms, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = synonymHit; // create path and map variables String requestPath = "/1/indexes/{indexName}/synonyms/batch".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -5379,17 +5504,17 @@ private Call saveSynonymsValidateBeforeCall( Boolean forwardToReplicas, Boolean replaceExistingSynonyms, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling saveSynonyms(Async)" ); } // verify the required parameter 'synonymHit' is set if (synonymHit == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'synonymHit' when calling saveSynonyms(Async)" ); } @@ -5414,15 +5539,15 @@ private Call saveSynonymsValidateBeforeCall( * @param replaceExistingSynonyms Replace all synonyms of the index with the ones sent with this * request. (optional) * @return UpdatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public UpdatedAtResponse saveSynonyms( String indexName, List synonymHit, Boolean forwardToReplicas, Boolean replaceExistingSynonyms - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = saveSynonymsValidateBeforeCall( indexName, synonymHit, @@ -5431,7 +5556,9 @@ public UpdatedAtResponse saveSynonyms( null ); if (req instanceof CallEcho) { - return new EchoResponse.SaveSynonyms(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.SaveSynonyms( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -5442,7 +5569,7 @@ public UpdatedAtResponse saveSynonyms( public UpdatedAtResponse saveSynonyms( String indexName, List synonymHit - ) throws ApiException { + ) throws AlgoliaRuntimeException { return this.saveSynonyms(indexName, synonymHit, null, null); } @@ -5458,7 +5585,8 @@ public UpdatedAtResponse saveSynonyms( * request. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call saveSynonymsAsync( String indexName, @@ -5466,7 +5594,7 @@ public Call saveSynonymsAsync( Boolean forwardToReplicas, Boolean replaceExistingSynonyms, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = saveSynonymsValidateBeforeCall( indexName, synonymHit, @@ -5484,19 +5612,19 @@ public Call saveSynonymsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call searchCall( String indexName, SearchParams searchParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = searchParams; // create path and map variables String requestPath = "/1/indexes/{indexName}/query".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -5520,17 +5648,17 @@ private Call searchValidateBeforeCall( String indexName, SearchParams searchParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling search(Async)" ); } // verify the required parameter 'searchParams' is set if (searchParams == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'searchParams' when calling search(Async)" ); } @@ -5544,14 +5672,14 @@ private Call searchValidateBeforeCall( * @param indexName The index in which to perform the request. (required) * @param searchParams (required) * @return SearchResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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) - throws ApiException { + throws AlgoliaRuntimeException { Call req = searchValidateBeforeCall(indexName, searchParams, null); if (req instanceof CallEcho) { - return new EchoResponse.Search(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.Search(((CallEcho) req).request()); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -5566,13 +5694,14 @@ public SearchResponse search(String indexName, SearchParams searchParams) * @param searchParams (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call searchAsync( String indexName, SearchParams searchParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = searchValidateBeforeCall(indexName, searchParams, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -5584,19 +5713,19 @@ public Call searchAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call searchDictionaryEntriesCall( - String dictionaryName, + DictionaryType dictionaryName, SearchDictionaryEntriesParams searchDictionaryEntriesParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = searchDictionaryEntriesParams; // create path and map variables String requestPath = "/1/dictionaries/{dictionaryName}/search".replaceAll( - "\\{" + "dictionaryName" + "\\}", + "\\{dictionaryName\\}", this.escapeString(dictionaryName.toString()) ); @@ -5617,13 +5746,13 @@ private Call searchDictionaryEntriesCall( } private Call searchDictionaryEntriesValidateBeforeCall( - String dictionaryName, + DictionaryType dictionaryName, SearchDictionaryEntriesParams searchDictionaryEntriesParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'dictionaryName' is set if (dictionaryName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'dictionaryName' when calling" + " searchDictionaryEntries(Async)" ); @@ -5631,7 +5760,7 @@ private Call searchDictionaryEntriesValidateBeforeCall( // verify the required parameter 'searchDictionaryEntriesParams' is set if (searchDictionaryEntriesParams == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'searchDictionaryEntriesParams' when calling" + " searchDictionaryEntries(Async)" ); @@ -5650,20 +5779,20 @@ private Call searchDictionaryEntriesValidateBeforeCall( * @param dictionaryName The dictionary to search in. (required) * @param searchDictionaryEntriesParams (required) * @return UpdatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public UpdatedAtResponse searchDictionaryEntries( - String dictionaryName, + DictionaryType dictionaryName, SearchDictionaryEntriesParams searchDictionaryEntriesParams - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = searchDictionaryEntriesValidateBeforeCall( dictionaryName, searchDictionaryEntriesParams, null ); if (req instanceof CallEcho) { - return new EchoResponse.SearchDictionaryEntries( + return new EchoResponse.SearchEcho.SearchDictionaryEntries( ((CallEcho) req).request() ); } @@ -5680,13 +5809,14 @@ public UpdatedAtResponse searchDictionaryEntries( * @param searchDictionaryEntriesParams (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call searchDictionaryEntriesAsync( - String dictionaryName, + DictionaryType dictionaryName, SearchDictionaryEntriesParams searchDictionaryEntriesParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = searchDictionaryEntriesValidateBeforeCall( dictionaryName, searchDictionaryEntriesParams, @@ -5702,26 +5832,23 @@ public Call searchDictionaryEntriesAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call searchForFacetValuesCall( String indexName, String facetName, SearchForFacetValuesRequest searchForFacetValuesRequest, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = searchForFacetValuesRequest; // create path and map variables String requestPath = "/1/indexes/{indexName}/facets/{facetName}/query".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "facetName" + "\\}", - this.escapeString(facetName.toString()) - ); + .replaceAll("\\{facetName\\}", this.escapeString(facetName.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -5744,17 +5871,17 @@ private Call searchForFacetValuesValidateBeforeCall( String facetName, SearchForFacetValuesRequest searchForFacetValuesRequest, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling searchForFacetValues(Async)" ); } // verify the required parameter 'facetName' is set if (facetName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'facetName' when calling searchForFacetValues(Async)" ); } @@ -5775,14 +5902,14 @@ private Call searchForFacetValuesValidateBeforeCall( * @param facetName The facet name. (required) * @param searchForFacetValuesRequest (optional) * @return SearchForFacetValuesResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public SearchForFacetValuesResponse searchForFacetValues( String indexName, String facetName, SearchForFacetValuesRequest searchForFacetValuesRequest - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = searchForFacetValuesValidateBeforeCall( indexName, facetName, @@ -5790,7 +5917,9 @@ public SearchForFacetValuesResponse searchForFacetValues( null ); if (req instanceof CallEcho) { - return new EchoResponse.SearchForFacetValues(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.SearchForFacetValues( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {} @@ -5803,7 +5932,7 @@ public SearchForFacetValuesResponse searchForFacetValues( public SearchForFacetValuesResponse searchForFacetValues( String indexName, String facetName - ) throws ApiException { + ) throws AlgoliaRuntimeException { return this.searchForFacetValues(indexName, facetName, null); } @@ -5816,14 +5945,15 @@ public SearchForFacetValuesResponse searchForFacetValues( * @param searchForFacetValuesRequest (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call searchForFacetValuesAsync( String indexName, String facetName, SearchForFacetValuesRequest searchForFacetValuesRequest, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = searchForFacetValuesValidateBeforeCall( indexName, facetName, @@ -5841,19 +5971,19 @@ public Call searchForFacetValuesAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call searchRulesCall( String indexName, SearchRulesParams searchRulesParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = searchRulesParams; // create path and map variables String requestPath = "/1/indexes/{indexName}/rules/search".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -5877,17 +6007,17 @@ private Call searchRulesValidateBeforeCall( String indexName, SearchRulesParams searchRulesParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling searchRules(Async)" ); } // verify the required parameter 'searchRulesParams' is set if (searchRulesParams == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'searchRulesParams' when calling searchRules(Async)" ); } @@ -5901,20 +6031,22 @@ private Call searchRulesValidateBeforeCall( * @param indexName The index in which to perform the request. (required) * @param searchRulesParams (required) * @return SearchRulesResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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 - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = searchRulesValidateBeforeCall( indexName, searchRulesParams, null ); if (req instanceof CallEcho) { - return new EchoResponse.SearchRules(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.SearchRules( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -5929,13 +6061,14 @@ public SearchRulesResponse searchRules( * @param searchRulesParams (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call searchRulesAsync( String indexName, SearchRulesParams searchRulesParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = searchRulesValidateBeforeCall( indexName, searchRulesParams, @@ -5951,7 +6084,7 @@ public Call searchRulesAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call searchSynonymsCall( String indexName, @@ -5960,13 +6093,13 @@ private Call searchSynonymsCall( Integer page, Integer hitsPerPage, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = null; // create path and map variables String requestPath = "/1/indexes/{indexName}/synonyms/search".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -6009,10 +6142,10 @@ private Call searchSynonymsValidateBeforeCall( Integer page, Integer hitsPerPage, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling searchSynonyms(Async)" ); } @@ -6038,8 +6171,8 @@ private Call searchSynonymsValidateBeforeCall( * (optional, default to 0) * @param hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) * @return SearchSynonymsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public SearchSynonymsResponse searchSynonyms( String indexName, @@ -6047,7 +6180,7 @@ public SearchSynonymsResponse searchSynonyms( SynonymType type, Integer page, Integer hitsPerPage - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = searchSynonymsValidateBeforeCall( indexName, query, @@ -6057,7 +6190,9 @@ public SearchSynonymsResponse searchSynonyms( null ); if (req instanceof CallEcho) { - return new EchoResponse.SearchSynonyms(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.SearchSynonyms( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -6066,7 +6201,7 @@ public SearchSynonymsResponse searchSynonyms( } public SearchSynonymsResponse searchSynonyms(String indexName) - throws ApiException { + throws AlgoliaRuntimeException { return this.searchSynonyms(indexName, "", null, 0, 100); } @@ -6082,7 +6217,8 @@ public SearchSynonymsResponse searchSynonyms(String indexName) * @param hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call searchSynonymsAsync( String indexName, @@ -6091,7 +6227,7 @@ public Call searchSynonymsAsync( Integer page, Integer hitsPerPage, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = searchSynonymsValidateBeforeCall( indexName, query, @@ -6110,12 +6246,12 @@ public Call searchSynonymsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call searchUserIdsCall( SearchUserIdsParams searchUserIdsParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = searchUserIdsParams; // create path and map variables @@ -6140,10 +6276,10 @@ private Call searchUserIdsCall( private Call searchUserIdsValidateBeforeCall( SearchUserIdsParams searchUserIdsParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'searchUserIdsParams' is set if (searchUserIdsParams == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'searchUserIdsParams' when calling searchUserIds(Async)" ); } @@ -6162,15 +6298,17 @@ private Call searchUserIdsValidateBeforeCall( * * @param searchUserIdsParams (required) * @return SearchUserIdsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public SearchUserIdsResponse searchUserIds( SearchUserIdsParams searchUserIdsParams - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = searchUserIdsValidateBeforeCall(searchUserIdsParams, null); if (req instanceof CallEcho) { - return new EchoResponse.SearchUserIds(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.SearchUserIds( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -6190,12 +6328,13 @@ public SearchUserIdsResponse searchUserIds( * @param searchUserIdsParams (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call searchUserIdsAsync( SearchUserIdsParams searchUserIdsParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = searchUserIdsValidateBeforeCall(searchUserIdsParams, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); @@ -6207,12 +6346,12 @@ public Call searchUserIdsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call setDictionarySettingsCall( DictionarySettingsParams dictionarySettingsParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = dictionarySettingsParams; // create path and map variables @@ -6237,10 +6376,10 @@ private Call setDictionarySettingsCall( private Call setDictionarySettingsValidateBeforeCall( DictionarySettingsParams dictionarySettingsParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'dictionarySettingsParams' is set if (dictionarySettingsParams == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'dictionarySettingsParams' when calling" + " setDictionarySettings(Async)" ); @@ -6254,18 +6393,20 @@ private Call setDictionarySettingsValidateBeforeCall( * * @param dictionarySettingsParams (required) * @return UpdatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public UpdatedAtResponse setDictionarySettings( DictionarySettingsParams dictionarySettingsParams - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = setDictionarySettingsValidateBeforeCall( dictionarySettingsParams, null ); if (req instanceof CallEcho) { - return new EchoResponse.SetDictionarySettings(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.SetDictionarySettings( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -6279,12 +6420,13 @@ public UpdatedAtResponse setDictionarySettings( * @param dictionarySettingsParams (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call setDictionarySettingsAsync( DictionarySettingsParams dictionarySettingsParams, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = setDictionarySettingsValidateBeforeCall( dictionarySettingsParams, _callback @@ -6299,20 +6441,20 @@ public Call setDictionarySettingsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call setSettingsCall( String indexName, IndexSettings indexSettings, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = indexSettings; // create path and map variables String requestPath = "/1/indexes/{indexName}/settings".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -6343,17 +6485,17 @@ private Call setSettingsValidateBeforeCall( IndexSettings indexSettings, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexName' when calling setSettings(Async)" ); } // verify the required parameter 'indexSettings' is set if (indexSettings == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'indexSettings' when calling setSettings(Async)" ); } @@ -6375,14 +6517,14 @@ private Call setSettingsValidateBeforeCall( * @param forwardToReplicas When true, changes are also propagated to replicas of the given * indexName. (optional) * @return UpdatedAtResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot + * deserialize the response body */ public UpdatedAtResponse setSettings( String indexName, IndexSettings indexSettings, Boolean forwardToReplicas - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call req = setSettingsValidateBeforeCall( indexName, indexSettings, @@ -6390,7 +6532,9 @@ public UpdatedAtResponse setSettings( null ); if (req instanceof CallEcho) { - return new EchoResponse.SetSettings(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.SetSettings( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -6401,7 +6545,7 @@ public UpdatedAtResponse setSettings( public UpdatedAtResponse setSettings( String indexName, IndexSettings indexSettings - ) throws ApiException { + ) throws AlgoliaRuntimeException { return this.setSettings(indexName, indexSettings, null); } @@ -6416,14 +6560,15 @@ public UpdatedAtResponse setSettings( * indexName. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call setSettingsAsync( String indexName, IndexSettings indexSettings, Boolean forwardToReplicas, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = setSettingsValidateBeforeCall( indexName, indexSettings, @@ -6440,19 +6585,19 @@ public Call setSettingsAsync( * * @param _callback Callback for upload/download progress * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @throws AlgoliaRuntimeException If fail to serialize the request body object */ private Call updateApiKeyCall( String key, ApiKey apiKey, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Object bodyObj = apiKey; // create path and map variables String requestPath = "/1/keys/{key}".replaceAll( - "\\{" + "key" + "\\}", + "\\{key\\}", this.escapeString(key.toString()) ); @@ -6476,17 +6621,17 @@ private Call updateApiKeyValidateBeforeCall( String key, ApiKey apiKey, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { // verify the required parameter 'key' is set if (key == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'key' when calling updateApiKey(Async)" ); } // verify the required parameter 'apiKey' is set if (apiKey == null) { - throw new ApiException( + throw new AlgoliaRuntimeException( "Missing the required parameter 'apiKey' when calling updateApiKey(Async)" ); } @@ -6500,14 +6645,16 @@ private Call updateApiKeyValidateBeforeCall( * @param key API Key string. (required) * @param apiKey (required) * @return UpdateApiKeyResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + * @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) - throws ApiException { + throws AlgoliaRuntimeException { Call req = updateApiKeyValidateBeforeCall(key, apiKey, null); if (req instanceof CallEcho) { - return new EchoResponse.UpdateApiKey(((CallEcho) req).request()); + return new EchoResponse.SearchEcho.UpdateApiKey( + ((CallEcho) req).request() + ); } Call call = (Call) req; Type returnType = new TypeToken() {}.getType(); @@ -6522,13 +6669,14 @@ public UpdateApiKeyResponse updateApiKey(String key, ApiKey apiKey) * @param apiKey (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request + * body object */ public Call updateApiKeyAsync( String key, ApiKey apiKey, final ApiCallback _callback - ) throws ApiException { + ) throws AlgoliaRuntimeException { Call call = updateApiKeyValidateBeforeCall(key, apiKey, _callback); Type returnType = new TypeToken() {}.getType(); this.executeAsync(call, returnType, _callback); diff --git a/algoliasearch-core/com/algolia/utils/HttpRequester.java b/algoliasearch-core/com/algolia/utils/HttpRequester.java index 1da39b461..07cbae53b 100644 --- a/algoliasearch-core/com/algolia/utils/HttpRequester.java +++ b/algoliasearch-core/com/algolia/utils/HttpRequester.java @@ -1,9 +1,11 @@ package com.algolia.utils; import com.algolia.ApiCallback; -import com.algolia.ApiException; import com.algolia.ProgressResponseBody; +import com.algolia.utils.retry.RetryStrategy; +import com.algolia.utils.retry.StatefulHost; import java.io.IOException; +import java.util.List; import java.util.concurrent.TimeUnit; import okhttp3.Call; import okhttp3.Interceptor; @@ -15,18 +17,23 @@ public class HttpRequester implements Requester { + private RetryStrategy retryStrategy; private OkHttpClient httpClient; private HttpLoggingInterceptor loggingInterceptor; private boolean debugging; - public HttpRequester() { + public HttpRequester(List hosts) { + this.retryStrategy = new RetryStrategy(hosts); + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addInterceptor(retryStrategy.getRetryInterceptor()); builder.addNetworkInterceptor(getProgressInterceptor()); + builder.retryOnConnectionFailure(false); httpClient = builder.build(); } - public Call newCall(Request request) throws ApiException { + public Call newCall(Request request) { return httpClient.newCall(request); } diff --git a/algoliasearch-core/com/algolia/utils/Requester.java b/algoliasearch-core/com/algolia/utils/Requester.java index 9f7f26284..919dd7c8b 100644 --- a/algoliasearch-core/com/algolia/utils/Requester.java +++ b/algoliasearch-core/com/algolia/utils/Requester.java @@ -1,11 +1,10 @@ package com.algolia.utils; -import com.algolia.ApiException; import okhttp3.Call; import okhttp3.Request; public interface Requester { - public Call newCall(Request request) throws ApiException; + public Call newCall(Request request); /** * Enable/disable debugging for this API client. diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/Utils.java b/algoliasearch-core/com/algolia/utils/Utils.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/Utils.java rename to algoliasearch-core/com/algolia/utils/Utils.java diff --git a/algoliasearch-core/com/algolia/utils/echo/EchoRequester.java b/algoliasearch-core/com/algolia/utils/echo/EchoRequester.java index 7719400fc..8e49cf5b1 100644 --- a/algoliasearch-core/com/algolia/utils/echo/EchoRequester.java +++ b/algoliasearch-core/com/algolia/utils/echo/EchoRequester.java @@ -1,34 +1,46 @@ package com.algolia.utils.echo; -import com.algolia.ApiException; import com.algolia.utils.Requester; import okhttp3.Request; public class EchoRequester implements Requester { - public CallEcho newCall(Request request) throws ApiException { + private int connectionTimeout, readTimeout, writeTimeout; + + public EchoRequester() { + this.connectionTimeout = 100; + this.readTimeout = 100; + this.writeTimeout = 100; + } + + public CallEcho newCall(Request request) { return new CallEcho(request); } // NO-OP for now - public void setDebugging(boolean debugging) {} public int getConnectTimeout() { - return 100; + return this.connectionTimeout; } - public void setConnectTimeout(int connectionTimeout) {} + public void setConnectTimeout(int connectionTimeout) { + this.connectionTimeout = connectionTimeout; + } public int getReadTimeout() { - return 100; + return this.readTimeout; } - public void setReadTimeout(int readTimeout) {} + public void setReadTimeout(int readTimeout) { + this.readTimeout = readTimeout; + } public int getWriteTimeout() { - return 100; + return this.writeTimeout; } - public void setWriteTimeout(int writeTimeout) {} + public void setWriteTimeout(int writeTimeout) { + this.writeTimeout = writeTimeout; + } } diff --git a/algoliasearch-core/com/algolia/utils/echo/EchoResponse.java b/algoliasearch-core/com/algolia/utils/echo/EchoResponse.java index efade3ee5..be4971a77 100644 --- a/algoliasearch-core/com/algolia/utils/echo/EchoResponse.java +++ b/algoliasearch-core/com/algolia/utils/echo/EchoResponse.java @@ -1,7 +1,7 @@ package com.algolia.utils.echo; import com.algolia.Pair; -import com.algolia.model.*; +import com.algolia.model.search.*; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -34,1638 +34,1641 @@ private static List buildQueryParams(Request req) { return params; } - public static class AddApiKey - extends AddApiKeyResponse - implements EchoResponseInterface { + public static class SearchEcho { - private Request request; + public static class AddApiKey + extends AddApiKeyResponse + implements EchoResponseInterface { - public AddApiKey(Request request) { - this.request = request; - } + private Request request; - public String getPath() { - return request.url().encodedPath(); - } + public AddApiKey(Request request) { + this.request = request; + } - public String getMethod() { - return request.method(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getMethod() { + return request.method(); + } + + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class AddOrUpdateObject - extends UpdatedAtWithObjectIdResponse - implements EchoResponseInterface { + public static class AddOrUpdateObject + extends UpdatedAtWithObjectIdResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public AddOrUpdateObject(Request request) { - this.request = request; - } + public AddOrUpdateObject(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class AppendSource - extends CreatedAtResponse - implements EchoResponseInterface { + public static class AppendSource + extends CreatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public AppendSource(Request request) { - this.request = request; - } + public AppendSource(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class AssignUserId - extends CreatedAtResponse - implements EchoResponseInterface { + public static class AssignUserId + extends CreatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public AssignUserId(Request request) { - this.request = request; - } + public AssignUserId(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class Batch - extends BatchResponse - implements EchoResponseInterface { + public static class Batch + extends BatchResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public Batch(Request request) { - this.request = request; - } + public Batch(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class BatchAssignUserIds - extends CreatedAtResponse - implements EchoResponseInterface { + public static class BatchAssignUserIds + extends CreatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public BatchAssignUserIds(Request request) { - this.request = request; - } + public BatchAssignUserIds(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class BatchDictionaryEntries - extends UpdatedAtResponse - implements EchoResponseInterface { + public static class BatchDictionaryEntries + extends UpdatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public BatchDictionaryEntries(Request request) { - this.request = request; - } + public BatchDictionaryEntries(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class BatchRules - extends UpdatedAtResponse - implements EchoResponseInterface { + public static class BatchRules + extends UpdatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public BatchRules(Request request) { - this.request = request; - } + public BatchRules(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class Browse - extends BrowseResponse - implements EchoResponseInterface { + public static class Browse + extends BrowseResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public Browse(Request request) { - this.request = request; - } + public Browse(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class ClearAllSynonyms - extends UpdatedAtResponse - implements EchoResponseInterface { + public static class ClearAllSynonyms + extends UpdatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public ClearAllSynonyms(Request request) { - this.request = request; - } + public ClearAllSynonyms(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class ClearObjects - extends UpdatedAtResponse - implements EchoResponseInterface { + public static class ClearObjects + extends UpdatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public ClearObjects(Request request) { - this.request = request; - } + public ClearObjects(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class ClearRules - extends UpdatedAtResponse - implements EchoResponseInterface { + public static class ClearRules + extends UpdatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public ClearRules(Request request) { - this.request = request; - } + public ClearRules(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class Del extends Object implements EchoResponseInterface { + public static class Del extends Object implements EchoResponseInterface { - private Request request; + private Request request; - public Del(Request request) { - this.request = request; - } + public Del(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class DeleteApiKey - extends DeleteApiKeyResponse - implements EchoResponseInterface { + public static class DeleteApiKey + extends DeleteApiKeyResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public DeleteApiKey(Request request) { - this.request = request; - } + public DeleteApiKey(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class DeleteBy - extends DeletedAtResponse - implements EchoResponseInterface { + public static class DeleteBy + extends DeletedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public DeleteBy(Request request) { - this.request = request; - } + public DeleteBy(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class DeleteIndex - extends DeletedAtResponse - implements EchoResponseInterface { + public static class DeleteIndex + extends DeletedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public DeleteIndex(Request request) { - this.request = request; - } + public DeleteIndex(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class DeleteObject - extends DeletedAtResponse - implements EchoResponseInterface { + public static class DeleteObject + extends DeletedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public DeleteObject(Request request) { - this.request = request; - } + public DeleteObject(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class DeleteRule - extends UpdatedAtResponse - implements EchoResponseInterface { + public static class DeleteRule + extends UpdatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public DeleteRule(Request request) { - this.request = request; - } + public DeleteRule(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class DeleteSource - extends DeleteSourceResponse - implements EchoResponseInterface { + public static class DeleteSource + extends DeleteSourceResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public DeleteSource(Request request) { - this.request = request; - } + public DeleteSource(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class DeleteSynonym - extends DeletedAtResponse - implements EchoResponseInterface { + public static class DeleteSynonym + extends DeletedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public DeleteSynonym(Request request) { - this.request = request; - } + public DeleteSynonym(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class Get extends Object implements EchoResponseInterface { + public static class Get extends Object implements EchoResponseInterface { - private Request request; + private Request request; - public Get(Request request) { - this.request = request; - } + public Get(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class GetApiKey extends Key implements EchoResponseInterface { + public static class GetApiKey extends Key implements EchoResponseInterface { - private Request request; + private Request request; - public GetApiKey(Request request) { - this.request = request; - } + public GetApiKey(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class GetDictionaryLanguages - extends HashMap - implements EchoResponseInterface { + public static class GetDictionaryLanguages + extends HashMap + implements EchoResponseInterface { - private Request request; + private Request request; - public GetDictionaryLanguages(Request request) { - this.request = request; - } + public GetDictionaryLanguages(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class GetDictionarySettings - extends GetDictionarySettingsResponse - implements EchoResponseInterface { + public static class GetDictionarySettings + extends GetDictionarySettingsResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public GetDictionarySettings(Request request) { - this.request = request; - } + public GetDictionarySettings(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class GetLogs - extends GetLogsResponse - implements EchoResponseInterface { + public static class GetLogs + extends GetLogsResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public GetLogs(Request request) { - this.request = request; - } + public GetLogs(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class GetObject - extends HashMap - implements EchoResponseInterface { + public static class GetObject + extends HashMap + implements EchoResponseInterface { - private Request request; + private Request request; - public GetObject(Request request) { - this.request = request; - } + public GetObject(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class GetObjects - extends GetObjectsResponse - implements EchoResponseInterface { + public static class GetObjects + extends GetObjectsResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public GetObjects(Request request) { - this.request = request; - } + public GetObjects(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class GetRule extends Rule implements EchoResponseInterface { + public static class GetRule extends Rule implements EchoResponseInterface { - private Request request; + private Request request; - public GetRule(Request request) { - this.request = request; - } + public GetRule(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class GetSettings - extends IndexSettings - implements EchoResponseInterface { + public static class GetSettings + extends IndexSettings + implements EchoResponseInterface { - private Request request; + private Request request; - public GetSettings(Request request) { - this.request = request; - } + public GetSettings(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class GetSources - extends ArrayList - implements EchoResponseInterface { + public static class GetSources + extends ArrayList + implements EchoResponseInterface { - private Request request; + private Request request; - public GetSources(Request request) { - this.request = request; - } + public GetSources(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class GetSynonym - extends SynonymHit - implements EchoResponseInterface { + public static class GetSynonym + extends SynonymHit + implements EchoResponseInterface { - private Request request; + private Request request; - public GetSynonym(Request request) { - this.request = request; - } + public GetSynonym(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class GetTask - extends GetTaskResponse - implements EchoResponseInterface { + public static class GetTask + extends GetTaskResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public GetTask(Request request) { - this.request = request; - } + public GetTask(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class GetTopUserIds - extends GetTopUserIdsResponse - implements EchoResponseInterface { + public static class GetTopUserIds + extends GetTopUserIdsResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public GetTopUserIds(Request request) { - this.request = request; - } + public GetTopUserIds(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class GetUserId - extends UserId - implements EchoResponseInterface { + public static class GetUserId + extends UserId + implements EchoResponseInterface { - private Request request; + private Request request; - public GetUserId(Request request) { - this.request = request; - } + public GetUserId(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class HasPendingMappings - extends CreatedAtResponse - implements EchoResponseInterface { + public static class HasPendingMappings + extends CreatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public HasPendingMappings(Request request) { - this.request = request; - } + public HasPendingMappings(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class ListApiKeys - extends ListApiKeysResponse - implements EchoResponseInterface { + public static class ListApiKeys + extends ListApiKeysResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public ListApiKeys(Request request) { - this.request = request; - } + public ListApiKeys(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class ListClusters - extends ListClustersResponse - implements EchoResponseInterface { + public static class ListClusters + extends ListClustersResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public ListClusters(Request request) { - this.request = request; - } + public ListClusters(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class ListIndices - extends ListIndicesResponse - implements EchoResponseInterface { + public static class ListIndices + extends ListIndicesResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public ListIndices(Request request) { - this.request = request; - } + public ListIndices(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class ListUserIds - extends ListUserIdsResponse - implements EchoResponseInterface { + public static class ListUserIds + extends ListUserIdsResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public ListUserIds(Request request) { - this.request = request; - } + public ListUserIds(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class MultipleBatch - extends MultipleBatchResponse - implements EchoResponseInterface { + public static class MultipleBatch + extends MultipleBatchResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public MultipleBatch(Request request) { - this.request = request; - } + public MultipleBatch(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class MultipleQueries - extends MultipleQueriesResponse - implements EchoResponseInterface { + public static class MultipleQueries + extends MultipleQueriesResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public MultipleQueries(Request request) { - this.request = request; - } + public MultipleQueries(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class OperationIndex - extends UpdatedAtResponse - implements EchoResponseInterface { + public static class OperationIndex + extends UpdatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public OperationIndex(Request request) { - this.request = request; - } + public OperationIndex(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class PartialUpdateObject - extends UpdatedAtWithObjectIdResponse - implements EchoResponseInterface { + public static class PartialUpdateObject + extends UpdatedAtWithObjectIdResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public PartialUpdateObject(Request request) { - this.request = request; - } + public PartialUpdateObject(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class Post extends Object implements EchoResponseInterface { + public static class Post extends Object implements EchoResponseInterface { - private Request request; + private Request request; - public Post(Request request) { - this.request = request; - } + public Post(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class Put extends Object implements EchoResponseInterface { + public static class Put extends Object implements EchoResponseInterface { - private Request request; + private Request request; - public Put(Request request) { - this.request = request; - } + public Put(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class RemoveUserId - extends RemoveUserIdResponse - implements EchoResponseInterface { + public static class RemoveUserId + extends RemoveUserIdResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public RemoveUserId(Request request) { - this.request = request; - } + public RemoveUserId(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class ReplaceSources - extends ReplaceSourceResponse - implements EchoResponseInterface { + public static class ReplaceSources + extends ReplaceSourceResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public ReplaceSources(Request request) { - this.request = request; - } + public ReplaceSources(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class RestoreApiKey - extends AddApiKeyResponse - implements EchoResponseInterface { + public static class RestoreApiKey + extends AddApiKeyResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public RestoreApiKey(Request request) { - this.request = request; - } + public RestoreApiKey(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class SaveObject - extends SaveObjectResponse - implements EchoResponseInterface { + public static class SaveObject + extends SaveObjectResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public SaveObject(Request request) { - this.request = request; - } + public SaveObject(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class SaveRule - extends UpdatedRuleResponse - implements EchoResponseInterface { + public static class SaveRule + extends UpdatedRuleResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public SaveRule(Request request) { - this.request = request; - } + public SaveRule(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class SaveSynonym - extends SaveSynonymResponse - implements EchoResponseInterface { + public static class SaveSynonym + extends SaveSynonymResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public SaveSynonym(Request request) { - this.request = request; - } + public SaveSynonym(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class SaveSynonyms - extends UpdatedAtResponse - implements EchoResponseInterface { + public static class SaveSynonyms + extends UpdatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public SaveSynonyms(Request request) { - this.request = request; - } + public SaveSynonyms(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class Search - extends SearchResponse - implements EchoResponseInterface { + public static class Search + extends SearchResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public Search(Request request) { - this.request = request; - } + public Search(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class SearchDictionaryEntries - extends UpdatedAtResponse - implements EchoResponseInterface { + public static class SearchDictionaryEntries + extends UpdatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public SearchDictionaryEntries(Request request) { - this.request = request; - } + public SearchDictionaryEntries(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class SearchForFacetValues - extends SearchForFacetValuesResponse - implements EchoResponseInterface { + public static class SearchForFacetValues + extends SearchForFacetValuesResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public SearchForFacetValues(Request request) { - this.request = request; - } + public SearchForFacetValues(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class SearchRules - extends SearchRulesResponse - implements EchoResponseInterface { + public static class SearchRules + extends SearchRulesResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public SearchRules(Request request) { - this.request = request; - } + public SearchRules(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class SearchSynonyms - extends SearchSynonymsResponse - implements EchoResponseInterface { + public static class SearchSynonyms + extends SearchSynonymsResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public SearchSynonyms(Request request) { - this.request = request; - } + public SearchSynonyms(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class SearchUserIds - extends SearchUserIdsResponse - implements EchoResponseInterface { + public static class SearchUserIds + extends SearchUserIdsResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public SearchUserIds(Request request) { - this.request = request; - } + public SearchUserIds(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class SetDictionarySettings - extends UpdatedAtResponse - implements EchoResponseInterface { + public static class SetDictionarySettings + extends UpdatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public SetDictionarySettings(Request request) { - this.request = request; - } + public SetDictionarySettings(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class SetSettings - extends UpdatedAtResponse - implements EchoResponseInterface { + public static class SetSettings + extends UpdatedAtResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public SetSettings(Request request) { - this.request = request; - } + public SetSettings(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } - } - public static class UpdateApiKey - extends UpdateApiKeyResponse - implements EchoResponseInterface { + public static class UpdateApiKey + extends UpdateApiKeyResponse + implements EchoResponseInterface { - private Request request; + private Request request; - public UpdateApiKey(Request request) { - this.request = request; - } + public UpdateApiKey(Request request) { + this.request = request; + } - public String getPath() { - return request.url().encodedPath(); - } + public String getPath() { + return request.url().encodedPath(); + } - public String getMethod() { - return request.method(); - } + public String getMethod() { + return request.method(); + } - public String getBody() { - return parseRequestBody(request); - } + public String getBody() { + return parseRequestBody(request); + } - public List getQueryParams() { - return buildQueryParams(request); + public List getQueryParams() { + return buildQueryParams(request); + } } } } diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/retry/CallType.java b/algoliasearch-core/com/algolia/utils/retry/CallType.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/retry/CallType.java rename to algoliasearch-core/com/algolia/utils/retry/CallType.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/retry/RetryOutcome.java b/algoliasearch-core/com/algolia/utils/retry/RetryOutcome.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/retry/RetryOutcome.java rename to algoliasearch-core/com/algolia/utils/retry/RetryOutcome.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/retry/RetryStrategy.java b/algoliasearch-core/com/algolia/utils/retry/RetryStrategy.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/retry/RetryStrategy.java rename to algoliasearch-core/com/algolia/utils/retry/RetryStrategy.java diff --git a/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/retry/StatefulHost.java b/algoliasearch-core/com/algolia/utils/retry/StatefulHost.java similarity index 100% rename from algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/retry/StatefulHost.java rename to algoliasearch-core/com/algolia/utils/retry/StatefulHost.java