diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index 39a012ef40..814976c52e 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -17,6 +17,10 @@ runs: shell: bash run: echo "CACHE_VERSION=$(< .github/.cache_version)" >> $GITHUB_ENV + - name: Edit .gitignore to include clients + shell: bash + run: ./scripts/ci/gitignore-for-ci.sh + # JavaScript setup - name: Get yarn cache directory path shell: bash diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 151af1480a..d1d750b56e 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -14,6 +14,10 @@ runs: shell: bash run: echo "CACHE_VERSION=$(< .github/.cache_version)" >> $GITHUB_ENV + - name: Edit .gitignore to include clients + shell: bash + run: ./scripts/ci/gitignore-for-ci.sh + - name: Install Java if: inputs.type != 'minimal' uses: actions/setup-java@v2 diff --git a/.gitignore b/.gitignore index 662cf6f91d..d7e1a8708f 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,30 @@ dist tests/output/*/.openapi-generator-ignore generators/bin + +# Ignore all the generated code (/!\ DO NOT ADD ANYTHING AFTER THIS) +# Ignore the roots and go down the tree by negating hand written files +clients/ +!clients/README.md +!clients/**/.openapi-generator-ignore + + +# Java +!clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/exceptions +!clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils +clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponse.java + +# Javascript +!clients/algoliasearch-client-javascript/*.* +!clients/algoliasearch-client-javascript/.github +!clients/algoliasearch-client-javascript/.yarn +!clients/algoliasearch-client-javascript/scripts +!clients/algoliasearch-client-javascript/packages/algoliasearch +!clients/algoliasearch-client-javascript/packages/requester-* +!clients/algoliasearch-client-javascript/packages/client-common + +# PHP +!clients/algoliasearch-client-php/lib +clients/algoliasearch-client-php/lib/*.php +clients/algoliasearch-client-php/lib/Api/ +clients/algoliasearch-client-php/lib/Configuration/Configuration.php diff --git a/clients/algoliasearch-client-java-2/.gitignore b/clients/algoliasearch-client-java-2/.gitignore deleted file mode 100644 index 7cf2ea329d..0000000000 --- a/clients/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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiCallback.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiCallback.java deleted file mode 100644 index 1c1d61bcff..0000000000 --- a/clients/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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java deleted file mode 100644 index 2a89b58b9b..0000000000 --- a/clients/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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiResponse.java deleted file mode 100644 index 3826fd0754..0000000000 --- a/clients/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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/JSON.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/JSON.java deleted file mode 100644 index dc22036834..0000000000 --- a/clients/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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/Pair.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/Pair.java deleted file mode 100644 index 1e5bf539ea..0000000000 --- a/clients/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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ProgressRequestBody.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ProgressRequestBody.java deleted file mode 100644 index 42c926955c..0000000000 --- a/clients/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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ProgressResponseBody.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ProgressResponseBody.java deleted file mode 100644 index d5f13aa6e5..0000000000 --- a/clients/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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Acl.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Acl.java deleted file mode 100644 index 72da04d5af..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Acl.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.algolia.model.search; - -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 acl */ -@JsonAdapter(Acl.Adapter.class) -public enum Acl { - 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; - - Acl(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static Acl fromValue(String value) { - for (Acl b : Acl.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 Acl enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public Acl read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return Acl.fromValue(value); - } - } -} diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Action.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Action.java deleted file mode 100644 index da4800fcc0..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Action.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AddApiKeyResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AddApiKeyResponse.java deleted file mode 100644 index d36d2d2217..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AddApiKeyResponse.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Anchoring.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Anchoring.java deleted file mode 100644 index a9bb880aef..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Anchoring.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ApiKey.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ApiKey.java deleted file mode 100644 index 4a460828f4..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ApiKey.java +++ /dev/null @@ -1,287 +0,0 @@ -package com.algolia.model.search; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Api Key object. */ -public class ApiKey { - - @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(Acl 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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AroundRadius.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AroundRadius.java deleted file mode 100644 index 4da7acaaf5..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AroundRadius.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.algolia.model.search; - -import com.algolia.JSON; -import com.algolia.utils.CompoundType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -@JsonAdapter(AroundRadius.Adapter.class) -public abstract class AroundRadius implements CompoundType { - - public static AroundRadius ofAroundRadiusOneOf(AroundRadiusOneOf inside) { - return new AroundRadiusAroundRadiusOneOf(inside); - } - - public static AroundRadius ofInteger(Integer inside) { - return new AroundRadiusInteger(inside); - } - - public abstract Object getInsideValue(); - - public static class Adapter extends TypeAdapter { - - @Override - public void write(final JsonWriter out, final AroundRadius oneOf) - throws IOException { - TypeAdapter runtimeTypeAdapter = (TypeAdapter) JSON - .getGson() - .getAdapter(TypeToken.get(oneOf.getInsideValue().getClass())); - runtimeTypeAdapter.write(out, oneOf.getInsideValue()); - } - - @Override - public AroundRadius read(final JsonReader jsonReader) throws IOException { - return null; - } - } -} - -@JsonAdapter(AroundRadius.Adapter.class) -class AroundRadiusAroundRadiusOneOf extends AroundRadius { - - private final AroundRadiusOneOf insideValue; - - AroundRadiusAroundRadiusOneOf(AroundRadiusOneOf insideValue) { - this.insideValue = insideValue; - } - - @Override - public AroundRadiusOneOf getInsideValue() { - return insideValue; - } -} - -@JsonAdapter(AroundRadius.Adapter.class) -class AroundRadiusInteger extends AroundRadius { - - private final Integer insideValue; - - AroundRadiusInteger(Integer insideValue) { - this.insideValue = insideValue; - } - - @Override - public Integer getInsideValue() { - return insideValue; - } -} diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AroundRadiusOneOf.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AroundRadiusOneOf.java deleted file mode 100644 index caab5fafb0..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AroundRadiusOneOf.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.algolia.model.search; - -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 aroundRadius_oneOf */ -@JsonAdapter(AroundRadiusOneOf.Adapter.class) -public enum AroundRadiusOneOf { - ALL("all"); - - private String value; - - AroundRadiusOneOf(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AroundRadiusOneOf fromValue(String value) { - for (AroundRadiusOneOf b : AroundRadiusOneOf.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 AroundRadiusOneOf enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AroundRadiusOneOf read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return AroundRadiusOneOf.fromValue(value); - } - } -} diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AssignUserIdParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AssignUserIdParams.java deleted file mode 100644 index 182336d7bf..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AssignUserIdParams.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AttributeOrBuiltInOperation.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AttributeOrBuiltInOperation.java deleted file mode 100644 index eace6e1ace..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AttributeOrBuiltInOperation.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.algolia.model.search; - -import com.algolia.JSON; -import com.algolia.utils.CompoundType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -@JsonAdapter(AttributeOrBuiltInOperation.Adapter.class) -public abstract class AttributeOrBuiltInOperation implements CompoundType { - - public static AttributeOrBuiltInOperation ofBuiltInOperation( - BuiltInOperation inside - ) { - return new AttributeOrBuiltInOperationBuiltInOperation(inside); - } - - public static AttributeOrBuiltInOperation ofString(String inside) { - return new AttributeOrBuiltInOperationString(inside); - } - - public abstract Object getInsideValue(); - - public static class Adapter extends TypeAdapter { - - @Override - public void write( - final JsonWriter out, - final AttributeOrBuiltInOperation oneOf - ) throws IOException { - TypeAdapter runtimeTypeAdapter = (TypeAdapter) JSON - .getGson() - .getAdapter(TypeToken.get(oneOf.getInsideValue().getClass())); - runtimeTypeAdapter.write(out, oneOf.getInsideValue()); - } - - @Override - public AttributeOrBuiltInOperation read(final JsonReader jsonReader) - throws IOException { - return null; - } - } -} - -@JsonAdapter(AttributeOrBuiltInOperation.Adapter.class) -class AttributeOrBuiltInOperationBuiltInOperation - extends AttributeOrBuiltInOperation { - - private final BuiltInOperation insideValue; - - AttributeOrBuiltInOperationBuiltInOperation(BuiltInOperation insideValue) { - this.insideValue = insideValue; - } - - @Override - public BuiltInOperation getInsideValue() { - return insideValue; - } -} - -@JsonAdapter(AttributeOrBuiltInOperation.Adapter.class) -class AttributeOrBuiltInOperationString extends AttributeOrBuiltInOperation { - - private final String insideValue; - - AttributeOrBuiltInOperationString(String insideValue) { - this.insideValue = insideValue; - } - - @Override - public String getInsideValue() { - return insideValue; - } -} diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AutomaticFacetFilter.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AutomaticFacetFilter.java deleted file mode 100644 index d27ec0edd3..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/AutomaticFacetFilter.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseBrowseResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseBrowseResponse.java deleted file mode 100644 index ecdb9c24af..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseBrowseResponse.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseIndexSettings.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseIndexSettings.java deleted file mode 100644 index ad165f12a8..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseIndexSettings.java +++ /dev/null @@ -1,494 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchParams.java deleted file mode 100644 index 4c254e5948..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchParams.java +++ /dev/null @@ -1,1050 +0,0 @@ -package com.algolia.model.search; - -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 AroundRadius 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(AroundRadius aroundRadius) { - this.aroundRadius = aroundRadius; - return this; - } - - /** - * Get aroundRadius - * - * @return aroundRadius - */ - @javax.annotation.Nullable - public AroundRadius getAroundRadius() { - return aroundRadius; - } - - public void setAroundRadius(AroundRadius 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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchResponse.java deleted file mode 100644 index c720c009d8..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchResponse.java +++ /dev/null @@ -1,741 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchResponseFacetsStats.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchResponseFacetsStats.java deleted file mode 100644 index 610cfc0507..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BaseSearchResponseFacetsStats.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchAssignUserIdsParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchAssignUserIdsParams.java deleted file mode 100644 index 2943280c9f..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchAssignUserIdsParams.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchDictionaryEntriesParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchDictionaryEntriesParams.java deleted file mode 100644 index 7ae9e55e18..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchDictionaryEntriesParams.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchDictionaryEntriesRequest.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchDictionaryEntriesRequest.java deleted file mode 100644 index 42018176a6..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchDictionaryEntriesRequest.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchOperation.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchOperation.java deleted file mode 100644 index e9cbbe1b16..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchOperation.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchParams.java deleted file mode 100644 index fc9cec877a..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchParams.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchResponse.java deleted file mode 100644 index d7bec1cb98..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchResponse.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchWriteParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchWriteParams.java deleted file mode 100644 index d513c21860..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BatchWriteParams.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BrowseRequest.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BrowseRequest.java deleted file mode 100644 index af3ec60a4a..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BrowseRequest.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BrowseResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BrowseResponse.java deleted file mode 100644 index 222718665f..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BrowseResponse.java +++ /dev/null @@ -1,785 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BuiltInOperation.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BuiltInOperation.java deleted file mode 100644 index b81e35f8c0..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BuiltInOperation.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.algolia.model.search; - -import com.google.gson.annotations.SerializedName; -import java.util.Objects; - -/** - * To update an attribute without pushing the entire record, you can use these built-in operations. - */ -public class BuiltInOperation { - - @SerializedName("_operation") - private BuiltInOperationType operation; - - @SerializedName("value") - private String value; - - public BuiltInOperation operation(BuiltInOperationType operation) { - this.operation = operation; - return this; - } - - /** - * Get operation - * - * @return operation - */ - @javax.annotation.Nonnull - public BuiltInOperationType getOperation() { - return operation; - } - - public void setOperation(BuiltInOperationType 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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BuiltInOperationType.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BuiltInOperationType.java deleted file mode 100644 index 3e4cf35099..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/BuiltInOperationType.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.algolia.model.search; - -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 operation to apply on the attribute. */ -@JsonAdapter(BuiltInOperationType.Adapter.class) -public enum BuiltInOperationType { - INCREMENT("Increment"), - - DECREMENT("Decrement"), - - ADD("Add"), - - REMOVE("Remove"), - - ADDUNIQUE("AddUnique"), - - INCREMENTFROM("IncrementFrom"), - - INCREMENTSET("IncrementSet"); - - private String value; - - BuiltInOperationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static BuiltInOperationType fromValue(String value) { - for (BuiltInOperationType b : BuiltInOperationType.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 BuiltInOperationType enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public BuiltInOperationType read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return BuiltInOperationType.fromValue(value); - } - } -} diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Condition.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Condition.java deleted file mode 100644 index 126a641508..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Condition.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Consequence.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Consequence.java deleted file mode 100644 index ff276df1cf..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Consequence.java +++ /dev/null @@ -1,189 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ConsequenceHide.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ConsequenceHide.java deleted file mode 100644 index 9a84c36268..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ConsequenceHide.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ConsequenceParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ConsequenceParams.java deleted file mode 100644 index fd40be3b14..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ConsequenceParams.java +++ /dev/null @@ -1,3018 +0,0 @@ -package com.algolia.model.search; - -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 AroundRadius 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(AroundRadius aroundRadius) { - this.aroundRadius = aroundRadius; - return this; - } - - /** - * Get aroundRadius - * - * @return aroundRadius - */ - @javax.annotation.Nullable - public AroundRadius getAroundRadius() { - return aroundRadius; - } - - public void setAroundRadius(AroundRadius 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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/CreatedAtObject.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/CreatedAtObject.java deleted file mode 100644 index d25d205fc1..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/CreatedAtObject.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/CreatedAtResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/CreatedAtResponse.java deleted file mode 100644 index b11faa775e..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/CreatedAtResponse.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeleteApiKeyResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeleteApiKeyResponse.java deleted file mode 100644 index 58ceadffd4..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeleteApiKeyResponse.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeleteSourceResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeleteSourceResponse.java deleted file mode 100644 index c41117d65b..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeleteSourceResponse.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeletedAtResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeletedAtResponse.java deleted file mode 100644 index 43032c5c4f..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DeletedAtResponse.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryAction.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryAction.java deleted file mode 100644 index 2b7625364d..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryAction.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryEntry.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryEntry.java deleted file mode 100644 index f5abe556dc..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryEntry.java +++ /dev/null @@ -1,220 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryEntryState.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryEntryState.java deleted file mode 100644 index 97d34d295a..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryEntryState.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryLanguage.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryLanguage.java deleted file mode 100644 index 913822b4af..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryLanguage.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionarySettingsParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionarySettingsParams.java deleted file mode 100644 index f825ad4dbc..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionarySettingsParams.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryType.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryType.java deleted file mode 100644 index 08d9ce4d48..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/DictionaryType.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.algolia.model.search; - -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 dictionaryType */ -@JsonAdapter(DictionaryType.Adapter.class) -public enum DictionaryType { - PLURALS("plurals"), - - STOPWORDS("stopwords"), - - COMPOUNDS("compounds"); - - private String value; - - DictionaryType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static DictionaryType fromValue(String value) { - for (DictionaryType b : DictionaryType.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 DictionaryType enumeration - ) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public DictionaryType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return DictionaryType.fromValue(value); - } - } -} diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ErrorBase.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ErrorBase.java deleted file mode 100644 index feb45d7650..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ErrorBase.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetDictionarySettingsResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetDictionarySettingsResponse.java deleted file mode 100644 index 13f35b112a..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetDictionarySettingsResponse.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponse.java deleted file mode 100644 index b12282a108..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponse.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponseInnerQueries.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponseInnerQueries.java deleted file mode 100644 index 98bfa42f4e..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponseInnerQueries.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponseLogs.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponseLogs.java deleted file mode 100644 index 3fd1605864..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetLogsResponseLogs.java +++ /dev/null @@ -1,464 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetObjectsParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetObjectsParams.java deleted file mode 100644 index 9f88642115..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetObjectsParams.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetObjectsResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetObjectsResponse.java deleted file mode 100644 index ae06326d62..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetObjectsResponse.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetTaskResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetTaskResponse.java deleted file mode 100644 index 8ceffd1c68..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetTaskResponse.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetTopUserIdsResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetTopUserIdsResponse.java deleted file mode 100644 index 9d01ede70c..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/GetTopUserIdsResponse.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/HighlightResult.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/HighlightResult.java deleted file mode 100644 index 2e2e7da29f..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/HighlightResult.java +++ /dev/null @@ -1,216 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Hit.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Hit.java deleted file mode 100644 index 2cbd620539..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Hit.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/IndexSettings.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/IndexSettings.java deleted file mode 100644 index 371607be76..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/IndexSettings.java +++ /dev/null @@ -1,2320 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/IndexSettingsAsSearchParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/IndexSettingsAsSearchParams.java deleted file mode 100644 index 7ba2433793..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/IndexSettingsAsSearchParams.java +++ /dev/null @@ -1,1960 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Indice.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Indice.java deleted file mode 100644 index e2b6dc3ac6..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Indice.java +++ /dev/null @@ -1,347 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Key.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Key.java deleted file mode 100644 index 508663e5be..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Key.java +++ /dev/null @@ -1,312 +0,0 @@ -package com.algolia.model.search; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Key */ -public class Key { - - @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(Acl 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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Languages.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Languages.java deleted file mode 100644 index 5a1438475e..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Languages.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListApiKeysResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListApiKeysResponse.java deleted file mode 100644 index b1f9eb0187..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListApiKeysResponse.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListClustersResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListClustersResponse.java deleted file mode 100644 index 43c055d1c0..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListClustersResponse.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListIndicesResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListIndicesResponse.java deleted file mode 100644 index e7cfa1ec21..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListIndicesResponse.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListUserIdsResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListUserIdsResponse.java deleted file mode 100644 index 1be32195a6..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ListUserIdsResponse.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/LogType.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/LogType.java deleted file mode 100644 index 96fe00f6c6..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/LogType.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.algolia.model.search; - -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 logType */ -@JsonAdapter(LogType.Adapter.class) -public enum LogType { - ALL("all"), - - QUERY("query"), - - BUILD("build"), - - ERROR("error"); - - private String value; - - LogType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LogType fromValue(String value) { - for (LogType b : LogType.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 LogType enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LogType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LogType.fromValue(value); - } - } -} diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleBatchOperation.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleBatchOperation.java deleted file mode 100644 index 997a616d5c..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleBatchOperation.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleBatchResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleBatchResponse.java deleted file mode 100644 index d2a2e05c94..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleBatchResponse.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleGetObjectsParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleGetObjectsParams.java deleted file mode 100644 index ad5e1fac79..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleGetObjectsParams.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueries.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueries.java deleted file mode 100644 index feadb8e9f2..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueries.java +++ /dev/null @@ -1,167 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesParams.java deleted file mode 100644 index 9cc7e3bfc5..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesParams.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesResponse.java deleted file mode 100644 index 624095671a..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesResponse.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesStrategy.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesStrategy.java deleted file mode 100644 index aa07f9e984..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesStrategy.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesType.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesType.java deleted file mode 100644 index 8f499686c5..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/MultipleQueriesType.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/OperationIndexParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/OperationIndexParams.java deleted file mode 100644 index 0fae16ad74..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/OperationIndexParams.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/OperationType.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/OperationType.java deleted file mode 100644 index b1845ebca0..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/OperationType.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Params.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Params.java deleted file mode 100644 index 404cbfc225..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Params.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Promote.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Promote.java deleted file mode 100644 index cb2a107534..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Promote.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RankingInfo.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RankingInfo.java deleted file mode 100644 index efbfb24790..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RankingInfo.java +++ /dev/null @@ -1,360 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RankingInfoMatchedGeoLocation.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RankingInfoMatchedGeoLocation.java deleted file mode 100644 index 0820899781..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RankingInfoMatchedGeoLocation.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RemoveUserIdResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RemoveUserIdResponse.java deleted file mode 100644 index 6e150ab5ef..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RemoveUserIdResponse.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ReplaceSourceResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ReplaceSourceResponse.java deleted file mode 100644 index d8858970bf..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ReplaceSourceResponse.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RequiredSearchParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RequiredSearchParams.java deleted file mode 100644 index 0da9be0c8f..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/RequiredSearchParams.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Rule.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Rule.java deleted file mode 100644 index acb75dfa16..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Rule.java +++ /dev/null @@ -1,226 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SaveObjectResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SaveObjectResponse.java deleted file mode 100644 index 20d0206a30..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SaveObjectResponse.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SaveSynonymResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SaveSynonymResponse.java deleted file mode 100644 index 9b9a1645d5..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SaveSynonymResponse.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ScopeType.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ScopeType.java deleted file mode 100644 index fa70a58861..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/ScopeType.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchDictionaryEntriesParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchDictionaryEntriesParams.java deleted file mode 100644 index 3aee13fa8a..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchDictionaryEntriesParams.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesRequest.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesRequest.java deleted file mode 100644 index 42d4bcf4e8..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesRequest.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesResponse.java deleted file mode 100644 index eb8ea7ebef..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesResponse.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesResponseFacetHits.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesResponseFacetHits.java deleted file mode 100644 index f7f095a939..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchForFacetValuesResponseFacetHits.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchHits.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchHits.java deleted file mode 100644 index 0718b4d5be..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchHits.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParams.java deleted file mode 100644 index e58a7f0fdd..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParams.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.algolia.model.search; - -import com.algolia.JSON; -import com.algolia.utils.CompoundType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -@JsonAdapter(SearchParams.Adapter.class) -public abstract class SearchParams implements CompoundType { - - public static SearchParams ofSearchParamsObject(SearchParamsObject inside) { - return new SearchParamsSearchParamsObject(inside); - } - - public static SearchParams ofSearchParamsString(SearchParamsString inside) { - return new SearchParamsSearchParamsString(inside); - } - - public abstract Object getInsideValue(); - - public static class Adapter extends TypeAdapter { - - @Override - public void write(final JsonWriter out, final SearchParams oneOf) - throws IOException { - TypeAdapter runtimeTypeAdapter = (TypeAdapter) JSON - .getGson() - .getAdapter(TypeToken.get(oneOf.getInsideValue().getClass())); - runtimeTypeAdapter.write(out, oneOf.getInsideValue()); - } - - @Override - public SearchParams read(final JsonReader jsonReader) throws IOException { - return null; - } - } -} - -@JsonAdapter(SearchParams.Adapter.class) -class SearchParamsSearchParamsObject extends SearchParams { - - private final SearchParamsObject insideValue; - - SearchParamsSearchParamsObject(SearchParamsObject insideValue) { - this.insideValue = insideValue; - } - - @Override - public SearchParamsObject getInsideValue() { - return insideValue; - } -} - -@JsonAdapter(SearchParams.Adapter.class) -class SearchParamsSearchParamsString extends SearchParams { - - private final SearchParamsString insideValue; - - SearchParamsSearchParamsString(SearchParamsString insideValue) { - this.insideValue = insideValue; - } - - @Override - public SearchParamsString getInsideValue() { - return insideValue; - } -} diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParamsObject.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParamsObject.java deleted file mode 100644 index 1e47d48f10..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParamsObject.java +++ /dev/null @@ -1,2945 +0,0 @@ -package com.algolia.model.search; - -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 AroundRadius 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(AroundRadius aroundRadius) { - this.aroundRadius = aroundRadius; - return this; - } - - /** - * Get aroundRadius - * - * @return aroundRadius - */ - @javax.annotation.Nullable - public AroundRadius getAroundRadius() { - return aroundRadius; - } - - public void setAroundRadius(AroundRadius 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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParamsString.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParamsString.java deleted file mode 100644 index 0419f69d76..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchParamsString.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchResponse.java deleted file mode 100644 index a9d1a10625..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchResponse.java +++ /dev/null @@ -1,759 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchRulesParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchRulesParams.java deleted file mode 100644 index d877c74ae4..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchRulesParams.java +++ /dev/null @@ -1,240 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchRulesResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchRulesResponse.java deleted file mode 100644 index 466a313ea9..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchRulesResponse.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchSynonymsResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchSynonymsResponse.java deleted file mode 100644 index 08a6159a4d..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchSynonymsResponse.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsParams.java deleted file mode 100644 index d3930a0504..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsParams.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponse.java deleted file mode 100644 index bb7ad5029b..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponse.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponseHighlightResult.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponseHighlightResult.java deleted file mode 100644 index 0730872cfc..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponseHighlightResult.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponseHits.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponseHits.java deleted file mode 100644 index a0c34f5265..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SearchUserIdsResponseHits.java +++ /dev/null @@ -1,211 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SnippetResult.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SnippetResult.java deleted file mode 100644 index 5dae6f069e..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SnippetResult.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Source.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Source.java deleted file mode 100644 index 4418ca33a8..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/Source.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/StandardEntries.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/StandardEntries.java deleted file mode 100644 index a153c1ed3f..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/StandardEntries.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymHit.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymHit.java deleted file mode 100644 index d26258da31..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymHit.java +++ /dev/null @@ -1,308 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymHitHighlightResult.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymHitHighlightResult.java deleted file mode 100644 index 3d0a8c9746..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymHitHighlightResult.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymType.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymType.java deleted file mode 100644 index a3a9ba6f87..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/SynonymType.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/TimeRange.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/TimeRange.java deleted file mode 100644 index 1ca35a2a3a..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/TimeRange.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdateApiKeyResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdateApiKeyResponse.java deleted file mode 100644 index 7eaa1af920..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdateApiKeyResponse.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedAtResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedAtResponse.java deleted file mode 100644 index a0ea0262d5..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedAtResponse.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedAtWithObjectIdResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedAtWithObjectIdResponse.java deleted file mode 100644 index 539fb76dcf..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedAtWithObjectIdResponse.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedRuleResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedRuleResponse.java deleted file mode 100644 index 117cbd6f78..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UpdatedRuleResponse.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UserId.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UserId.java deleted file mode 100644 index dbf67b1229..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/search/UserId.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.algolia.model.search; - -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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java deleted file mode 100644 index fb2c3272a7..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java +++ /dev/null @@ -1,6705 +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, - Map parameters, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = body; - - // create path and map variables - String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (parameters != null) { - for (Map.Entry parameter : parameters.entrySet()) { - queryParams.addAll( - this.parameterToPair( - parameter.getKey(), - parameter.getValue().toString() - ) - ); - } - } - - 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, - Map 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 Query parameters to be applied to the current query. (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, Map 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, new HashMap<>(), 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 Query parameters to be applied to the current query. (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, - Map 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, - Map parameters, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = null; - - // create path and map variables - String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (parameters != null) { - for (Map.Entry parameter : parameters.entrySet()) { - queryParams.addAll( - this.parameterToPair( - parameter.getKey(), - parameter.getValue().toString() - ) - ); - } - } - - 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, - Map 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 Query parameters to be applied to the current query. (optional) - * @return Object - * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot - * deserialize the response body - */ - public Object get(String path, Map 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, new HashMap<>()); - } - - /** - * (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 Query parameters to be applied to the current query. (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, - Map 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, - Map parameters, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = body; - - // create path and map variables - String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (parameters != null) { - for (Map.Entry parameter : parameters.entrySet()) { - queryParams.addAll( - this.parameterToPair( - parameter.getKey(), - parameter.getValue().toString() - ) - ); - } - } - - 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, - Map 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 Query parameters to be applied to the current query. (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, Map 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, new HashMap<>(), 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 Query parameters to be applied to the current query. (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, - Map 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, - Map parameters, - Object body, - final ApiCallback _callback - ) throws AlgoliaRuntimeException { - Object bodyObj = body; - - // create path and map variables - String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); - - List queryParams = new ArrayList(); - Map headers = new HashMap(); - - if (parameters != null) { - for (Map.Entry parameter : parameters.entrySet()) { - queryParams.addAll( - this.parameterToPair( - parameter.getKey(), - parameter.getValue().toString() - ) - ); - } - } - - 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, - Map 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 Query parameters to be applied to the current query. (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, Map 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, new HashMap<>(), 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 Query parameters to be applied to the current query. (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, - Map 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/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/utils/echo/EchoResponse.java deleted file mode 100644 index be4971a774..0000000000 --- a/clients/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/clients/algoliasearch-client-java-2/build.gradle b/clients/algoliasearch-client-java-2/build.gradle deleted file mode 100644 index 6649f26175..0000000000 --- a/clients/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/clients/algoliasearch-client-java-2/settings.gradle b/clients/algoliasearch-client-java-2/settings.gradle deleted file mode 100644 index 8fb6ea50f7..0000000000 --- a/clients/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/clients/algoliasearch-client-javascript/packages/client-abtesting/.openapi-generator-ignore b/clients/algoliasearch-client-javascript/packages/client-abtesting/.openapi-generator-ignore deleted file mode 100644 index a6fb9df9d1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/.openapi-generator-ignore +++ /dev/null @@ -1,8 +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. - -git_push.sh -.gitignore diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/builds/browser.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/builds/browser.ts deleted file mode 100644 index 69931b4968..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/builds/browser.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createFallbackableCache, - createBrowserLocalStorageCache, -} from '@experimental-api-clients-automation/client-common'; -import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr'; - -import { createAbtestingApi, apiClientVersion } from '../src/abtestingApi'; -import type { AbtestingApi, Region } from '../src/abtestingApi'; - -export * from '../src/abtestingApi'; - -export function abtestingApi( - appId: string, - apiKey: string, - region?: Region, - options?: InitClientOptions -): AbtestingApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - return createAbtestingApi({ - appId, - apiKey, - region, - timeouts: { - connect: 1, - read: 2, - write: 30, - }, - requester: options?.requester ?? createXhrRequester(), - userAgents: [{ segment: 'Browser' }], - authMode: 'WithinQueryParameters', - responsesCache: options?.responsesCache ?? createMemoryCache(), - requestsCache: - options?.requestsCache ?? createMemoryCache({ serializable: false }), - hostsCache: - options?.hostsCache ?? - createFallbackableCache({ - caches: [ - createBrowserLocalStorageCache({ - key: `${apiClientVersion}-${appId}`, - }), - createMemoryCache(), - ], - }), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/builds/node.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/builds/node.ts deleted file mode 100644 index 5fd7a725c3..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/builds/node.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createNullCache, -} from '@experimental-api-clients-automation/client-common'; -import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http'; - -import { createAbtestingApi } from '../src/abtestingApi'; -import type { AbtestingApi, Region } from '../src/abtestingApi'; - -export * from '../src/abtestingApi'; - -export function abtestingApi( - appId: string, - apiKey: string, - region?: Region, - options?: InitClientOptions -): AbtestingApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - return createAbtestingApi({ - appId, - apiKey, - region, - timeouts: { - connect: 2, - read: 5, - write: 30, - }, - requester: options?.requester ?? createHttpRequester(), - userAgents: [{ segment: 'Node.js', version: process.versions.node }], - responsesCache: options?.responsesCache ?? createNullCache(), - requestsCache: options?.requestsCache ?? createNullCache(), - hostsCache: options?.hostsCache ?? createMemoryCache(), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/index.d.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/index.d.ts deleted file mode 100644 index 8b0a7c887a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-unresolved -export * from './dist/builds/node'; diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/index.js b/clients/algoliasearch-client-javascript/packages/client-abtesting/index.js deleted file mode 100644 index c6b9604592..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-commonjs,import/extensions -module.exports = require('./dist/client-abtesting.cjs.node.js'); diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/aBTest.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/aBTest.ts deleted file mode 100644 index 3d076739f6..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/aBTest.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { Variant } from './variant'; - -export type ABTest = { - /** - * The A/B test ID. - */ - abTestID: number; - /** - * A/B test significance based on click data. Should be > 0.95 to be considered significant (no matter which variant is winning). - */ - clickSignificance: number; - /** - * A/B test significance based on conversion data. Should be > 0.95 to be considered significant (no matter which variant is winning). - */ - conversionSignificance: number; - /** - * End date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ. - */ - endAt: string; - /** - * End date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ. - */ - createdAt: string; - /** - * A/B test name. - */ - name: string; - /** - * Status of the A/B test. - */ - status: string; - /** - * List of A/B test variant. - */ - variants: Variant[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/aBTestResponse.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/aBTestResponse.ts deleted file mode 100644 index bf211fd44d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/aBTestResponse.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type ABTestResponse = { - /** - * The index performing the A/B test. - */ - index: string; - /** - * The A/B test ID. - */ - abTestID: number; - /** - * TaskID of the task to wait for. - */ - taskID: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/abTestsVariant.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/abTestsVariant.ts deleted file mode 100644 index 5100fec263..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/abTestsVariant.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type AbTestsVariant = { - /** - * The index performing the A/B test. - */ - index: string; - /** - * The traffic perfecentage for the A/B test. - */ - trafficPercentage: number; - /** - * The A/B test description. - */ - description?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/abTestsVariantSearchParams.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/abTestsVariantSearchParams.ts deleted file mode 100644 index b9cede265e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/abTestsVariantSearchParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { AbTestsVariant } from './abTestsVariant'; -import type { CustomSearchParams } from './customSearchParams'; - -export type AbTestsVariantSearchParams = AbTestsVariant & CustomSearchParams; diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/addABTestsRequest.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/addABTestsRequest.ts deleted file mode 100644 index 7f06f24a37..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/addABTestsRequest.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { AddABTestsVariant } from './addABTestsVariant'; - -export type AddABTestsRequest = { - /** - * A/B test name. - */ - name: string; - /** - * List of 2 variants for the A/B test. - */ - variant: AddABTestsVariant[]; - /** - * End date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ. - */ - endAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/addABTestsVariant.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/addABTestsVariant.ts deleted file mode 100644 index 70e611f007..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/addABTestsVariant.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { AbTestsVariant } from './abTestsVariant'; -import type { AbTestsVariantSearchParams } from './abTestsVariantSearchParams'; - -export type AddABTestsVariant = AbTestsVariant | AbTestsVariantSearchParams; diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/customSearchParams.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/customSearchParams.ts deleted file mode 100644 index 44f24075b6..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/customSearchParams.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type CustomSearchParams = { - customSearchParameters: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/errorBase.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/errorBase.ts deleted file mode 100644 index a533aa7a15..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/errorBase.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Error. - */ -export type ErrorBase = { - message?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/listABTestsResponse.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/listABTestsResponse.ts deleted file mode 100644 index 44f25e3b5f..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/listABTestsResponse.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { ABTest } from './aBTest'; - -export type ListABTestsResponse = { - /** - * List of A/B tests. - */ - abtests: ABTest[]; - /** - * Number of A/B tests found for the app. - */ - count: number; - /** - * Number of A/B tests retrievable. - */ - total: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/models.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/models.ts deleted file mode 100644 index 8dbeb28b0b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/models.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from './aBTest'; -export * from './aBTestResponse'; -export * from './abTestsVariant'; -export * from './abTestsVariantSearchParams'; -export * from './addABTestsRequest'; -export * from './addABTestsVariant'; -export * from './customSearchParams'; -export * from './errorBase'; -export * from './listABTestsResponse'; -export * from './variant'; diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/variant.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/variant.ts deleted file mode 100644 index 3328858f2b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/variant.ts +++ /dev/null @@ -1,50 +0,0 @@ -export type Variant = { - /** - * Average click position for the variant. - */ - averageClickPosition: number; - /** - * Distinct click count for the variant. - */ - clickCount: number; - /** - * Click through rate for the variant. - */ - clickThroughRate: number; - /** - * Distinct conversion count for the variant. - */ - conversionCount: number; - /** - * Conversion rate for the variant. - */ - conversionRate: number; - /** - * The A/B test description. - */ - description: string; - /** - * The index performing the A/B test. - */ - index: string; - /** - * The number of occurrences. - */ - noResultCount: number; - /** - * The number of search during the A/B test. - */ - searchCount: number; - /** - * The number of tracked search click. - */ - trackedSearchCount: number; - /** - * The traffic perfecentage for the A/B test. - */ - trafficPercentage: number; - /** - * The number of user during the A/B test. - */ - userCount: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/package.json b/clients/algoliasearch-client-javascript/packages/client-abtesting/package.json deleted file mode 100644 index cb03b3b1b0..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@experimental-api-clients-automation/client-abtesting", - "version": "0.0.5", - "description": "JavaScript client for @experimental-api-clients-automation/client-abtesting", - "repository": "algolia/algoliasearch-client-javascript", - "author": "Algolia", - "license": "MIT", - "main": "index.js", - "module": "dist/client-abtesting.esm.node.js", - "types": "index.d.ts", - "jsdelivr": "dist/client-abtesting.umd.browser.js", - "unpkg": "dist/client-abtesting.umd.browser.js", - "browser": "dist/client-abtesting.cjs.browser.js", - "scripts": { - "clean": "rm -rf ./dist" - }, - "files": [ - "dist", - "model", - "index.js", - "index.d.ts" - ], - "engines": { - "node": ">= 14.0.0" - }, - "dependencies": { - "@experimental-api-clients-automation/client-common": "0.0.5", - "@experimental-api-clients-automation/requester-browser-xhr": "0.0.5", - "@experimental-api-clients-automation/requester-node-http": "0.0.5" - }, - "devDependencies": { - "@types/node": "16.11.26", - "typescript": "4.6.3" - } -} diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/src/abtestingApi.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/src/abtestingApi.ts deleted file mode 100644 index 6a6d15b4ff..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/src/abtestingApi.ts +++ /dev/null @@ -1,509 +0,0 @@ -import { - createAuth, - createTransporter, - getUserAgent, -} from '@experimental-api-clients-automation/client-common'; -import type { - CreateClientOptions, - Headers, - Host, - Request, - RequestOptions, - QueryParameters, -} from '@experimental-api-clients-automation/client-common'; - -import type { ABTest } from '../model/aBTest'; -import type { ABTestResponse } from '../model/aBTestResponse'; -import type { AddABTestsRequest } from '../model/addABTestsRequest'; -import type { ListABTestsResponse } from '../model/listABTestsResponse'; - -export * from '../model/models'; -export const apiClientVersion = '0.0.5'; - -export type Region = 'de' | 'us'; - -function getDefaultHosts(region?: Region): Host[] { - const regionHost = region ? `.${region}.` : '.'; - - return [ - { - url: `analytics${regionHost}algolia.com`, - accept: 'readWrite', - protocol: 'https', - }, - ]; -} - -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -export function createAbtestingApi( - options: CreateClientOptions & { region?: Region } -) { - const auth = createAuth(options.appId, options.apiKey, options.authMode); - const transporter = createTransporter({ - hosts: options?.hosts ?? getDefaultHosts(options.region), - hostsCache: options.hostsCache, - requestsCache: options.requestsCache, - responsesCache: options.responsesCache, - baseHeaders: { - 'content-type': 'application/x-www-form-urlencoded', - ...auth.headers(), - }, - baseQueryParameters: auth.queryParameters(), - userAgent: getUserAgent({ - userAgents: options.userAgents, - client: 'Abtesting', - version: apiClientVersion, - }), - timeouts: options.timeouts, - requester: options.requester, - }); - - function addUserAgent(segment: string, version?: string): void { - transporter.userAgent.add({ segment, version }); - } - - return { - addUserAgent, - /** - * Creates a new A/B test with provided configuration. You can set an A/B test on two different indices with different settings, or on the same index with different search parameters by providing a customSearchParameters setting on one of the variants. - * - * @summary Creates a new A/B test with provided configuration. - * @param addABTestsRequest - The addABTestsRequest object. - */ - addABTests( - addABTestsRequest: AddABTestsRequest, - requestOptions?: RequestOptions - ): Promise { - if (!addABTestsRequest) { - throw new Error( - 'Parameter `addABTestsRequest` is required when calling `addABTests`.' - ); - } - - if (!addABTestsRequest.name) { - throw new Error( - 'Parameter `addABTestsRequest.name` is required when calling `addABTests`.' - ); - } - if (!addABTestsRequest.variant) { - throw new Error( - 'Parameter `addABTestsRequest.variant` is required when calling `addABTests`.' - ); - } - if (!addABTestsRequest.endAt) { - throw new Error( - 'Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.' - ); - } - - const requestPath = '/2/abtests'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: addABTestsRequest, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param del - The del object. - * @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param del.parameters - Query parameters to be applied to the current query. - * @param del.body - The parameters to send with the custom request. - */ - del( - { path, parameters, body }: DelProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `del`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Deletes the A/B Test and removes all associated metadata & metrics. - * - * @summary Deletes the A/B Test. - * @param deleteABTest - The deleteABTest object. - * @param deleteABTest.id - The A/B test ID. - */ - deleteABTest( - { id }: DeleteABTestProps, - requestOptions?: RequestOptions - ): Promise { - if (!id) { - throw new Error( - 'Parameter `id` is required when calling `deleteABTest`.' - ); - } - - const requestPath = '/2/abtests/{id}'.replace( - '{id}', - encodeURIComponent(id) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param get - The get object. - * @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param get.parameters - Query parameters to be applied to the current query. - */ - get( - { path, parameters }: GetProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `get`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns metadata and metrics for A/B test id. Behaves in the same way as GET /2/abtests however the endpoint will return 403. - * - * @summary Returns metadata and metrics for A/B test id. - * @param getABTest - The getABTest object. - * @param getABTest.id - The A/B test ID. - */ - getABTest( - { id }: GetABTestProps, - requestOptions?: RequestOptions - ): Promise { - if (!id) { - throw new Error('Parameter `id` is required when calling `getABTest`.'); - } - - const requestPath = '/2/abtests/{id}'.replace( - '{id}', - encodeURIComponent(id) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Fetch all existing A/B tests for App that are available for the current API Key. Returns an array of metadata and metrics. When no data has been processed, the metrics will be returned as null. - * - * @summary Fetch all existing A/B tests for App that are available for the current API Key. - * @param listABTests - The listABTests object. - * @param listABTests.offset - Position of the starting record. Used for paging. 0 is the first record. - * @param listABTests.limit - Number of records to return. Limit is the size of the page. - */ - listABTests( - { offset, limit }: ListABTestsProps, - requestOptions?: RequestOptions - ): Promise { - const requestPath = '/2/abtests'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (offset !== undefined) { - queryParameters.offset = offset.toString(); - } - - if (limit !== undefined) { - queryParameters.limit = limit.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param post - The post object. - * @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param post.parameters - Query parameters to be applied to the current query. - * @param post.body - The parameters to send with the custom request. - */ - post( - { path, parameters, body }: PostProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `post`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param put - The put object. - * @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param put.parameters - Query parameters to be applied to the current query. - * @param put.body - The parameters to send with the custom request. - */ - put( - { path, parameters, body }: PutProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `put`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Marks the A/B test as stopped. At this point, the test is over and cannot be restarted. As a result, your application is back to normal: index A will perform as usual, receiving 100% of all search requests. Associated metadata and metrics are still stored. - * - * @summary Marks the A/B test as stopped. - * @param stopABTest - The stopABTest object. - * @param stopABTest.id - The A/B test ID. - */ - stopABTest( - { id }: StopABTestProps, - requestOptions?: RequestOptions - ): Promise { - if (!id) { - throw new Error( - 'Parameter `id` is required when calling `stopABTest`.' - ); - } - - const requestPath = '/2/abtests/{id}/stop'.replace( - '{id}', - encodeURIComponent(id) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - }; -} - -export type AbtestingApi = ReturnType; - -export type DelProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type DeleteABTestProps = { - /** - * The A/B test ID. - */ - id: number; -}; - -export type GetProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; -}; - -export type GetABTestProps = { - /** - * The A/B test ID. - */ - id: number; -}; - -export type ListABTestsProps = { - /** - * Position of the starting record. Used for paging. 0 is the first record. - */ - offset?: number; - /** - * Number of records to return. Limit is the size of the page. - */ - limit?: number; -}; - -export type PostProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type PutProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type StopABTestProps = { - /** - * The A/B test ID. - */ - id: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/tsconfig.json b/clients/algoliasearch-client-javascript/packages/client-abtesting/tsconfig.json deleted file mode 100644 index 89b2007fbb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "dist", - }, - "include": ["src", "model", "builds/node.ts", "builds/browser.ts"], - "exclude": ["dist", "node_modules"] -} diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/.openapi-generator-ignore b/clients/algoliasearch-client-javascript/packages/client-analytics/.openapi-generator-ignore deleted file mode 100644 index a6fb9df9d1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/.openapi-generator-ignore +++ /dev/null @@ -1,8 +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. - -git_push.sh -.gitignore diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/builds/browser.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/builds/browser.ts deleted file mode 100644 index cf5e81e09d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/builds/browser.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createFallbackableCache, - createBrowserLocalStorageCache, -} from '@experimental-api-clients-automation/client-common'; -import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr'; - -import { createAnalyticsApi, apiClientVersion } from '../src/analyticsApi'; -import type { AnalyticsApi, Region } from '../src/analyticsApi'; - -export * from '../src/analyticsApi'; - -export function analyticsApi( - appId: string, - apiKey: string, - region?: Region, - options?: InitClientOptions -): AnalyticsApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - return createAnalyticsApi({ - appId, - apiKey, - region, - timeouts: { - connect: 1, - read: 2, - write: 30, - }, - requester: options?.requester ?? createXhrRequester(), - userAgents: [{ segment: 'Browser' }], - authMode: 'WithinQueryParameters', - responsesCache: options?.responsesCache ?? createMemoryCache(), - requestsCache: - options?.requestsCache ?? createMemoryCache({ serializable: false }), - hostsCache: - options?.hostsCache ?? - createFallbackableCache({ - caches: [ - createBrowserLocalStorageCache({ - key: `${apiClientVersion}-${appId}`, - }), - createMemoryCache(), - ], - }), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/builds/node.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/builds/node.ts deleted file mode 100644 index 1f922cd3ff..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/builds/node.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createNullCache, -} from '@experimental-api-clients-automation/client-common'; -import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http'; - -import { createAnalyticsApi } from '../src/analyticsApi'; -import type { AnalyticsApi, Region } from '../src/analyticsApi'; - -export * from '../src/analyticsApi'; - -export function analyticsApi( - appId: string, - apiKey: string, - region?: Region, - options?: InitClientOptions -): AnalyticsApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - return createAnalyticsApi({ - appId, - apiKey, - region, - timeouts: { - connect: 2, - read: 5, - write: 30, - }, - requester: options?.requester ?? createHttpRequester(), - userAgents: [{ segment: 'Node.js', version: process.versions.node }], - responsesCache: options?.responsesCache ?? createNullCache(), - requestsCache: options?.requestsCache ?? createNullCache(), - hostsCache: options?.hostsCache ?? createMemoryCache(), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/index.d.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/index.d.ts deleted file mode 100644 index 8b0a7c887a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-unresolved -export * from './dist/builds/node'; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/index.js b/clients/algoliasearch-client-javascript/packages/client-analytics/index.js deleted file mode 100644 index 72eddf17b0..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-commonjs,import/extensions -module.exports = require('./dist/client-analytics.cjs.node.js'); diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/errorBase.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/errorBase.ts deleted file mode 100644 index a533aa7a15..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/errorBase.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Error. - */ -export type ErrorBase = { - message?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getAverageClickPositionResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getAverageClickPositionResponse.ts deleted file mode 100644 index 594148b405..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getAverageClickPositionResponse.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { GetAverageClickPositionResponseDates } from './getAverageClickPositionResponseDates'; - -export type GetAverageClickPositionResponse = { - /** - * The average of all the click count event. - */ - average: number; - /** - * The number of click event. - */ - clickCount: number; - /** - * A list of average click position with their date. - */ - dates: GetAverageClickPositionResponseDates[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getAverageClickPositionResponseDates.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getAverageClickPositionResponseDates.ts deleted file mode 100644 index 297387383b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getAverageClickPositionResponseDates.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type GetAverageClickPositionResponseDates = { - /** - * The average of all the click count event. - */ - average: number; - /** - * The number of click event. - */ - clickCount: number; - /** - * Date of the event. - */ - date: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getClickPositionsResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getClickPositionsResponse.ts deleted file mode 100644 index 85ea2e7177..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getClickPositionsResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { GetClickPositionsResponsePositions } from './getClickPositionsResponsePositions'; - -export type GetClickPositionsResponse = { - /** - * A list of the click positions with their click count. - */ - positions: GetClickPositionsResponsePositions[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getClickPositionsResponsePositions.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getClickPositionsResponsePositions.ts deleted file mode 100644 index f1fb8bbecd..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getClickPositionsResponsePositions.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type GetClickPositionsResponsePositions = { - /** - * Range of positions with the following pattern: Positions from 1 to 10 included are displayed in separated groups. Positions from 11 to 20 included are grouped together. Positions from 21 and up are grouped together. - */ - position: number[]; - /** - * The number of click event. - */ - clickCount: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getClickThroughRateResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getClickThroughRateResponse.ts deleted file mode 100644 index e22dcf9e92..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getClickThroughRateResponse.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { GetClickThroughRateResponseDates } from './getClickThroughRateResponseDates'; - -export type GetClickThroughRateResponse = { - /** - * The click-through rate. - */ - rate: number; - /** - * The number of click event. - */ - clickCount: number; - /** - * The number of tracked search click. - */ - trackedSearchCount: number; - /** - * A list of click-through rate events with their date. - */ - dates: GetClickThroughRateResponseDates[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getClickThroughRateResponseDates.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getClickThroughRateResponseDates.ts deleted file mode 100644 index 4b512e006a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getClickThroughRateResponseDates.ts +++ /dev/null @@ -1,18 +0,0 @@ -export type GetClickThroughRateResponseDates = { - /** - * The click-through rate. - */ - rate: number; - /** - * The number of click event. - */ - clickCount: number; - /** - * The number of tracked search click. - */ - trackedSearchCount: number; - /** - * Date of the event. - */ - date: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getConversationRateResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getConversationRateResponse.ts deleted file mode 100644 index 04ecd51de5..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getConversationRateResponse.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { GetConversationRateResponseDates } from './getConversationRateResponseDates'; - -export type GetConversationRateResponse = { - /** - * The click-through rate. - */ - rate: number; - /** - * The number of tracked search click. - */ - trackedSearchCount: number; - /** - * The number of converted clicks. - */ - conversionCount: number; - /** - * A list of conversion events with their date. - */ - dates: GetConversationRateResponseDates[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getConversationRateResponseDates.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getConversationRateResponseDates.ts deleted file mode 100644 index bee3367b80..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getConversationRateResponseDates.ts +++ /dev/null @@ -1,18 +0,0 @@ -export type GetConversationRateResponseDates = { - /** - * The click-through rate. - */ - rate: number; - /** - * The number of tracked search click. - */ - trackedSearchCount: number; - /** - * The number of converted clicks. - */ - conversionCount: number; - /** - * Date of the event. - */ - date: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getNoClickRateResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getNoClickRateResponse.ts deleted file mode 100644 index e45f85d2f0..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getNoClickRateResponse.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { GetNoClickRateResponseDates } from './getNoClickRateResponseDates'; - -export type GetNoClickRateResponse = { - /** - * The click-through rate. - */ - rate: number; - /** - * The number of click event. - */ - count: number; - /** - * The number of click event. - */ - noClickCount: number; - /** - * A list of searches without clicks with their date, rate and counts. - */ - dates: GetNoClickRateResponseDates[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getNoClickRateResponseDates.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getNoClickRateResponseDates.ts deleted file mode 100644 index 72692149c5..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getNoClickRateResponseDates.ts +++ /dev/null @@ -1,18 +0,0 @@ -export type GetNoClickRateResponseDates = { - /** - * The click-through rate. - */ - rate: number; - /** - * The number of click event. - */ - count: number; - /** - * The number of click event. - */ - noClickCount: number; - /** - * Date of the event. - */ - date: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getNoResultsRateResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getNoResultsRateResponse.ts deleted file mode 100644 index bebc3527e7..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getNoResultsRateResponse.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { GetNoResultsRateResponseDates } from './getNoResultsRateResponseDates'; - -export type GetNoResultsRateResponse = { - /** - * The click-through rate. - */ - rate: number; - /** - * The number of occurrences. - */ - count: number; - /** - * The number of occurrences. - */ - noResultCount: number; - /** - * A list of searches without results with their date, rate and counts. - */ - dates: GetNoResultsRateResponseDates[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getNoResultsRateResponseDates.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getNoResultsRateResponseDates.ts deleted file mode 100644 index 01856b0b0a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getNoResultsRateResponseDates.ts +++ /dev/null @@ -1,18 +0,0 @@ -export type GetNoResultsRateResponseDates = { - /** - * Date of the event. - */ - date: string; - /** - * The number of occurrences. - */ - noResultCount: number; - /** - * The number of occurrences. - */ - count: number; - /** - * The click-through rate. - */ - rate: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesCountResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesCountResponse.ts deleted file mode 100644 index 4b67c49096..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesCountResponse.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { GetSearchesCountResponseDates } from './getSearchesCountResponseDates'; - -export type GetSearchesCountResponse = { - /** - * The number of occurrences. - */ - count: number; - /** - * A list of search events with their date and count. - */ - dates: GetSearchesCountResponseDates[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesCountResponseDates.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesCountResponseDates.ts deleted file mode 100644 index 096b1f055e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesCountResponseDates.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type GetSearchesCountResponseDates = { - /** - * Date of the event. - */ - date: string; - /** - * The number of occurrences. - */ - count: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesNoClicksResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesNoClicksResponse.ts deleted file mode 100644 index d4ab03d68d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesNoClicksResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { GetSearchesNoClicksResponseSearches } from './getSearchesNoClicksResponseSearches'; - -export type GetSearchesNoClicksResponse = { - /** - * A list of searches with no clicks and their count. - */ - searches: GetSearchesNoClicksResponseSearches[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesNoClicksResponseSearches.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesNoClicksResponseSearches.ts deleted file mode 100644 index 5fd59ec278..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesNoClicksResponseSearches.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type GetSearchesNoClicksResponseSearches = { - /** - * The search query. - */ - search: string; - /** - * The number of occurrences. - */ - count: number; - /** - * The number of occurrences. - */ - withFilterCount: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesNoResultsResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesNoResultsResponse.ts deleted file mode 100644 index c44df94b77..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesNoResultsResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { GetSearchesNoResultsResponseSearches } from './getSearchesNoResultsResponseSearches'; - -export type GetSearchesNoResultsResponse = { - /** - * A list of searches with no results and their count. - */ - searches: GetSearchesNoResultsResponseSearches[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesNoResultsResponseSearches.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesNoResultsResponseSearches.ts deleted file mode 100644 index 592730c073..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getSearchesNoResultsResponseSearches.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type GetSearchesNoResultsResponseSearches = { - /** - * The search query. - */ - search: string; - /** - * The number of occurrences. - */ - count: number; - /** - * Number of hits that the search query matched. - */ - nbHits: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getStatusResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getStatusResponse.ts deleted file mode 100644 index 379fff0845..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getStatusResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type GetStatusResponse = { - /** - * Date of last update (ISO-8601 format). - */ - updatedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopCountriesResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopCountriesResponse.ts deleted file mode 100644 index 6093557d10..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopCountriesResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { GetTopCountriesResponseCountries } from './getTopCountriesResponseCountries'; - -export type GetTopCountriesResponse = { - /** - * A list of countries with their count. - */ - countries: GetTopCountriesResponseCountries[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopCountriesResponseCountries.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopCountriesResponseCountries.ts deleted file mode 100644 index a5c121a487..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopCountriesResponseCountries.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type GetTopCountriesResponseCountries = { - /** - * The country. - */ - country: string; - /** - * The number of occurrences. - */ - count: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFilterAttribute.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFilterAttribute.ts deleted file mode 100644 index 85fe43b917..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFilterAttribute.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type GetTopFilterAttribute = { - /** - * The attribute. - */ - attribute: string; - /** - * The number of occurrences. - */ - count: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFilterAttributesResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFilterAttributesResponse.ts deleted file mode 100644 index d54653be74..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFilterAttributesResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { GetTopFilterAttribute } from './getTopFilterAttribute'; - -export type GetTopFilterAttributesResponse = { - /** - * A list of attributes with their count. - */ - attributes: GetTopFilterAttribute[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFilterForAttribute.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFilterForAttribute.ts deleted file mode 100644 index 501a4298a1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFilterForAttribute.ts +++ /dev/null @@ -1,18 +0,0 @@ -export type GetTopFilterForAttribute = { - /** - * The attribute. - */ - attribute: string; - /** - * The operator. - */ - operator: string; - /** - * The value of the attribute. - */ - value: string; - /** - * The number of occurrences. - */ - count: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFilterForAttributeResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFilterForAttributeResponse.ts deleted file mode 100644 index 982de7c3ce..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFilterForAttributeResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { GetTopFilterForAttribute } from './getTopFilterForAttribute'; - -export type GetTopFilterForAttributeResponse = { - /** - * A list of filters for the given attributes. - */ - values: GetTopFilterForAttribute[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFiltersNoResultsResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFiltersNoResultsResponse.ts deleted file mode 100644 index 60d85c2abf..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFiltersNoResultsResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { GetTopFiltersNoResultsValues } from './getTopFiltersNoResultsValues'; - -export type GetTopFiltersNoResultsResponse = { - /** - * A list of filters without results. - */ - values: GetTopFiltersNoResultsValues[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFiltersNoResultsValue.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFiltersNoResultsValue.ts deleted file mode 100644 index fb40a51d7b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFiltersNoResultsValue.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type GetTopFiltersNoResultsValue = { - /** - * The attribute. - */ - attribute: string; - /** - * The operator. - */ - operator: string; - /** - * The value of the attribute. - */ - value: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFiltersNoResultsValues.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFiltersNoResultsValues.ts deleted file mode 100644 index fb8c39d7a9..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopFiltersNoResultsValues.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { GetTopFiltersNoResultsValue } from './getTopFiltersNoResultsValue'; - -export type GetTopFiltersNoResultsValues = { - /** - * The number of occurrences. - */ - count: number; - /** - * A list of filters without results. - */ - values: GetTopFiltersNoResultsValue[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopHitsResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopHitsResponse.ts deleted file mode 100644 index a3ea005704..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopHitsResponse.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { TopHitsResponse } from './topHitsResponse'; -import type { TopHitsResponseWithAnalytics } from './topHitsResponseWithAnalytics'; - -export type GetTopHitsResponse = TopHitsResponse | TopHitsResponseWithAnalytics; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopSearchesResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopSearchesResponse.ts deleted file mode 100644 index f82c1126eb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getTopSearchesResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { TopSearchesResponse } from './topSearchesResponse'; -import type { TopSearchesResponseWithAnalytics } from './topSearchesResponseWithAnalytics'; - -export type GetTopSearchesResponse = - | TopSearchesResponse - | TopSearchesResponseWithAnalytics; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getUsersCountResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/getUsersCountResponse.ts deleted file mode 100644 index 437bba9b00..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/getUsersCountResponse.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { GetSearchesCountResponseDates } from './getSearchesCountResponseDates'; - -export type GetUsersCountResponse = { - /** - * The number of occurrences. - */ - count: number; - /** - * A list of users count with their date. - */ - dates: GetSearchesCountResponseDates[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/models.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/models.ts deleted file mode 100644 index 05ae406eb2..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/models.ts +++ /dev/null @@ -1,39 +0,0 @@ -export * from './errorBase'; -export * from './getAverageClickPositionResponse'; -export * from './getAverageClickPositionResponseDates'; -export * from './getClickPositionsResponse'; -export * from './getClickPositionsResponsePositions'; -export * from './getClickThroughRateResponse'; -export * from './getClickThroughRateResponseDates'; -export * from './getConversationRateResponse'; -export * from './getConversationRateResponseDates'; -export * from './getNoClickRateResponse'; -export * from './getNoClickRateResponseDates'; -export * from './getNoResultsRateResponse'; -export * from './getNoResultsRateResponseDates'; -export * from './getSearchesCountResponse'; -export * from './getSearchesCountResponseDates'; -export * from './getSearchesNoClicksResponse'; -export * from './getSearchesNoClicksResponseSearches'; -export * from './getSearchesNoResultsResponse'; -export * from './getSearchesNoResultsResponseSearches'; -export * from './getStatusResponse'; -export * from './getTopCountriesResponse'; -export * from './getTopCountriesResponseCountries'; -export * from './getTopFilterAttribute'; -export * from './getTopFilterAttributesResponse'; -export * from './getTopFilterForAttribute'; -export * from './getTopFilterForAttributeResponse'; -export * from './getTopFiltersNoResultsResponse'; -export * from './getTopFiltersNoResultsValue'; -export * from './getTopFiltersNoResultsValues'; -export * from './getTopHitsResponse'; -export * from './getTopSearchesResponse'; -export * from './getUsersCountResponse'; -export * from './topHitsResponse'; -export * from './topHitsResponseHits'; -export * from './topHitsResponseWithAnalytics'; -export * from './topHitsResponseWithAnalyticsHits'; -export * from './topSearchesResponse'; -export * from './topSearchesResponseWithAnalytics'; -export * from './topSearchesResponseWithAnalyticsSearches'; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/topHitsResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/topHitsResponse.ts deleted file mode 100644 index 4b724b0012..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/topHitsResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { TopHitsResponseHits } from './topHitsResponseHits'; - -export type TopHitsResponse = { - /** - * A list of top hits with their count. - */ - hits: TopHitsResponseHits[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/topHitsResponseHits.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/topHitsResponseHits.ts deleted file mode 100644 index 148da97c02..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/topHitsResponseHits.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type TopHitsResponseHits = { - /** - * The hit. - */ - hit: string; - /** - * The number of occurrences. - */ - count: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/topHitsResponseWithAnalytics.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/topHitsResponseWithAnalytics.ts deleted file mode 100644 index fb2b5d3db9..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/topHitsResponseWithAnalytics.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { TopHitsResponseWithAnalyticsHits } from './topHitsResponseWithAnalyticsHits'; - -export type TopHitsResponseWithAnalytics = { - /** - * A list of top hits with their count and analytics. - */ - hits: TopHitsResponseWithAnalyticsHits[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/topHitsResponseWithAnalyticsHits.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/topHitsResponseWithAnalyticsHits.ts deleted file mode 100644 index ce8afdbb2a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/topHitsResponseWithAnalyticsHits.ts +++ /dev/null @@ -1,30 +0,0 @@ -export type TopHitsResponseWithAnalyticsHits = { - /** - * The hit. - */ - hit: string; - /** - * The number of occurrences. - */ - count: number; - /** - * The click-through rate. - */ - clickThroughRate: number; - /** - * The conversion rate. - */ - conversionRate: number; - /** - * The number of tracked search click. - */ - trackedSearchCount: number; - /** - * The number of click event. - */ - clickCount: number; - /** - * The number of converted clicks. - */ - conversionCount: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/topSearchesResponse.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/topSearchesResponse.ts deleted file mode 100644 index 2dabac55c6..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/topSearchesResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { GetSearchesNoResultsResponseSearches } from './getSearchesNoResultsResponseSearches'; - -export type TopSearchesResponse = { - /** - * A list of top searches with their count. - */ - searches: GetSearchesNoResultsResponseSearches[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/topSearchesResponseWithAnalytics.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/topSearchesResponseWithAnalytics.ts deleted file mode 100644 index 1a58b7a9d8..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/topSearchesResponseWithAnalytics.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { TopSearchesResponseWithAnalyticsSearches } from './topSearchesResponseWithAnalyticsSearches'; - -export type TopSearchesResponseWithAnalytics = { - /** - * A list of top searches with their count and analytics. - */ - searches: TopSearchesResponseWithAnalyticsSearches[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/model/topSearchesResponseWithAnalyticsSearches.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/model/topSearchesResponseWithAnalyticsSearches.ts deleted file mode 100644 index af52de5a07..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/model/topSearchesResponseWithAnalyticsSearches.ts +++ /dev/null @@ -1,38 +0,0 @@ -export type TopSearchesResponseWithAnalyticsSearches = { - /** - * The search query. - */ - search: string; - /** - * The number of occurrences. - */ - count: number; - /** - * The click-through rate. - */ - clickThroughRate: number; - /** - * The average position of all the click count event. - */ - averageClickPosition: number; - /** - * The conversion rate. - */ - conversionRate: number; - /** - * The number of tracked search click. - */ - trackedSearchCount: number; - /** - * The number of click event. - */ - clickCount: number; - /** - * The number of converted clicks. - */ - conversionCount: number; - /** - * Number of hits that the search query matched. - */ - nbHits: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/package.json b/clients/algoliasearch-client-javascript/packages/client-analytics/package.json deleted file mode 100644 index 260ea9dbc9..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@experimental-api-clients-automation/client-analytics", - "version": "0.0.5", - "description": "JavaScript client for @experimental-api-clients-automation/client-analytics", - "repository": "algolia/algoliasearch-client-javascript", - "author": "Algolia", - "license": "MIT", - "main": "index.js", - "module": "dist/client-analytics.esm.node.js", - "types": "index.d.ts", - "jsdelivr": "dist/client-analytics.umd.browser.js", - "unpkg": "dist/client-analytics.umd.browser.js", - "browser": "dist/client-analytics.cjs.browser.js", - "scripts": { - "clean": "rm -rf ./dist" - }, - "files": [ - "dist", - "model", - "index.js", - "index.d.ts" - ], - "engines": { - "node": ">= 14.0.0" - }, - "dependencies": { - "@experimental-api-clients-automation/client-common": "0.0.5", - "@experimental-api-clients-automation/requester-browser-xhr": "0.0.5", - "@experimental-api-clients-automation/requester-node-http": "0.0.5" - }, - "devDependencies": { - "@types/node": "16.11.26", - "typescript": "4.6.3" - } -} diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/src/analyticsApi.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/src/analyticsApi.ts deleted file mode 100644 index 231ab72a9d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/src/analyticsApi.ts +++ /dev/null @@ -1,1807 +0,0 @@ -import { - createAuth, - createTransporter, - getUserAgent, -} from '@experimental-api-clients-automation/client-common'; -import type { - CreateClientOptions, - Headers, - Host, - Request, - RequestOptions, - QueryParameters, -} from '@experimental-api-clients-automation/client-common'; - -import type { GetAverageClickPositionResponse } from '../model/getAverageClickPositionResponse'; -import type { GetClickPositionsResponse } from '../model/getClickPositionsResponse'; -import type { GetClickThroughRateResponse } from '../model/getClickThroughRateResponse'; -import type { GetConversationRateResponse } from '../model/getConversationRateResponse'; -import type { GetNoClickRateResponse } from '../model/getNoClickRateResponse'; -import type { GetNoResultsRateResponse } from '../model/getNoResultsRateResponse'; -import type { GetSearchesCountResponse } from '../model/getSearchesCountResponse'; -import type { GetSearchesNoClicksResponse } from '../model/getSearchesNoClicksResponse'; -import type { GetSearchesNoResultsResponse } from '../model/getSearchesNoResultsResponse'; -import type { GetStatusResponse } from '../model/getStatusResponse'; -import type { GetTopCountriesResponse } from '../model/getTopCountriesResponse'; -import type { GetTopFilterAttributesResponse } from '../model/getTopFilterAttributesResponse'; -import type { GetTopFilterForAttributeResponse } from '../model/getTopFilterForAttributeResponse'; -import type { GetTopFiltersNoResultsResponse } from '../model/getTopFiltersNoResultsResponse'; -import type { GetTopHitsResponse } from '../model/getTopHitsResponse'; -import type { GetTopSearchesResponse } from '../model/getTopSearchesResponse'; -import type { GetUsersCountResponse } from '../model/getUsersCountResponse'; - -export * from '../model/models'; -export const apiClientVersion = '0.0.5'; - -export type Region = 'de' | 'us'; - -function getDefaultHosts(region?: Region): Host[] { - const regionHost = region ? `.${region}.` : '.'; - - return [ - { - url: `analytics${regionHost}algolia.com`, - accept: 'readWrite', - protocol: 'https', - }, - ]; -} - -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -export function createAnalyticsApi( - options: CreateClientOptions & { region?: Region } -) { - const auth = createAuth(options.appId, options.apiKey, options.authMode); - const transporter = createTransporter({ - hosts: options?.hosts ?? getDefaultHosts(options.region), - hostsCache: options.hostsCache, - requestsCache: options.requestsCache, - responsesCache: options.responsesCache, - baseHeaders: { - 'content-type': 'application/x-www-form-urlencoded', - ...auth.headers(), - }, - baseQueryParameters: auth.queryParameters(), - userAgent: getUserAgent({ - userAgents: options.userAgents, - client: 'Analytics', - version: apiClientVersion, - }), - timeouts: options.timeouts, - requester: options.requester, - }); - - function addUserAgent(segment: string, version?: string): void { - transporter.userAgent.add({ segment, version }); - } - - return { - addUserAgent, - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param del - The del object. - * @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param del.parameters - Query parameters to be applied to the current query. - * @param del.body - The parameters to send with the custom request. - */ - del( - { path, parameters, body }: DelProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `del`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param get - The get object. - * @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param get.parameters - Query parameters to be applied to the current query. - */ - get( - { path, parameters }: GetProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `get`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns the average click position. The endpoint returns a value for the complete given time range, as well as a value per day. - * - * @summary Returns the average click position. - * @param getAverageClickPosition - The getAverageClickPosition object. - * @param getAverageClickPosition.index - The index name to target. - * @param getAverageClickPosition.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getAverageClickPosition.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getAverageClickPosition.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getAverageClickPosition( - { index, startDate, endDate, tags }: GetAverageClickPositionProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getAverageClickPosition`.' - ); - } - - const requestPath = '/2/clicks/averageClickPosition'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns the distribution of clicks per range of positions. - * - * @summary Returns the distribution of clicks per range of positions. - * @param getClickPositions - The getClickPositions object. - * @param getClickPositions.index - The index name to target. - * @param getClickPositions.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getClickPositions.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getClickPositions.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getClickPositions( - { index, startDate, endDate, tags }: GetClickPositionsProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getClickPositions`.' - ); - } - - const requestPath = '/2/clicks/positions'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns a click-through rate (CTR). The endpoint returns a value for the complete given time range, as well as a value per day. It also returns the count of clicks and searches used to compute the rates. - * - * @summary Returns a click-through rate (CTR). - * @param getClickThroughRate - The getClickThroughRate object. - * @param getClickThroughRate.index - The index name to target. - * @param getClickThroughRate.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getClickThroughRate.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getClickThroughRate.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getClickThroughRate( - { index, startDate, endDate, tags }: GetClickThroughRateProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getClickThroughRate`.' - ); - } - - const requestPath = '/2/clicks/clickThroughRate'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns a conversion rate (CR). The endpoint returns a value for the complete given time range, as well as a value per day. It also returns the count of conversion and searches used to compute the rates. - * - * @summary Returns a conversion rate (CR). - * @param getConversationRate - The getConversationRate object. - * @param getConversationRate.index - The index name to target. - * @param getConversationRate.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getConversationRate.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getConversationRate.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getConversationRate( - { index, startDate, endDate, tags }: GetConversationRateProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getConversationRate`.' - ); - } - - const requestPath = '/2/conversions/conversionRate'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns the rate at which searches didn\'t lead to any clicks. The endpoint returns a value for the complete given time range, as well as a value per day. It also returns the count of searches and searches without clicks. - * - * @summary Returns the rate at which searches didn\'t lead to any clicks. - * @param getNoClickRate - The getNoClickRate object. - * @param getNoClickRate.index - The index name to target. - * @param getNoClickRate.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getNoClickRate.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getNoClickRate.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getNoClickRate( - { index, startDate, endDate, tags }: GetNoClickRateProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getNoClickRate`.' - ); - } - - const requestPath = '/2/searches/noClickRate'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns the rate at which searches didn\'t return any results. The endpoint returns a value for the complete given time range, as well as a value per day. It also returns the count of searches and searches without results used to compute the rates. - * - * @summary Returns the rate at which searches didn\'t return any results. - * @param getNoResultsRate - The getNoResultsRate object. - * @param getNoResultsRate.index - The index name to target. - * @param getNoResultsRate.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getNoResultsRate.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getNoResultsRate.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getNoResultsRate( - { index, startDate, endDate, tags }: GetNoResultsRateProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getNoResultsRate`.' - ); - } - - const requestPath = '/2/searches/noResultRate'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns the number of searches across the given time range. The endpoint returns a value for the complete given time range, as well as a value per day. - * - * @summary Returns the number of searches across the given time range. - * @param getSearchesCount - The getSearchesCount object. - * @param getSearchesCount.index - The index name to target. - * @param getSearchesCount.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getSearchesCount.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getSearchesCount.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getSearchesCount( - { index, startDate, endDate, tags }: GetSearchesCountProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getSearchesCount`.' - ); - } - - const requestPath = '/2/searches/count'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns top searches that didn\'t lead to any clicks. Limited to the 1000 most frequent ones. For each search, also returns the average number of found hits. - * - * @summary Returns top searches that didn\'t lead to any clicks. - * @param getSearchesNoClicks - The getSearchesNoClicks object. - * @param getSearchesNoClicks.index - The index name to target. - * @param getSearchesNoClicks.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getSearchesNoClicks.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getSearchesNoClicks.limit - Number of records to return. Limit is the size of the page. - * @param getSearchesNoClicks.offset - Position of the starting record. Used for paging. 0 is the first record. - * @param getSearchesNoClicks.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getSearchesNoClicks( - { - index, - startDate, - endDate, - limit, - offset, - tags, - }: GetSearchesNoClicksProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getSearchesNoClicks`.' - ); - } - - const requestPath = '/2/searches/noClicks'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (limit !== undefined) { - queryParameters.limit = limit.toString(); - } - - if (offset !== undefined) { - queryParameters.offset = offset.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns top searches that didn\'t return any results. Limited to the 1000 most frequent ones. - * - * @summary Returns top searches that didn\'t return any results. - * @param getSearchesNoResults - The getSearchesNoResults object. - * @param getSearchesNoResults.index - The index name to target. - * @param getSearchesNoResults.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getSearchesNoResults.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getSearchesNoResults.limit - Number of records to return. Limit is the size of the page. - * @param getSearchesNoResults.offset - Position of the starting record. Used for paging. 0 is the first record. - * @param getSearchesNoResults.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getSearchesNoResults( - { - index, - startDate, - endDate, - limit, - offset, - tags, - }: GetSearchesNoResultsProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getSearchesNoResults`.' - ); - } - - const requestPath = '/2/searches/noResults'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (limit !== undefined) { - queryParameters.limit = limit.toString(); - } - - if (offset !== undefined) { - queryParameters.offset = offset.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns the latest update time of the analytics API for a given index. If the index has been recently created and/or no search has been performed yet the updated time will be null. - * - * @summary Get latest update time of the analytics API. - * @param getStatus - The getStatus object. - * @param getStatus.index - The index name to target. - */ - getStatus( - { index }: GetStatusProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getStatus`.' - ); - } - - const requestPath = '/2/status'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns top countries. Limited to the 1000 most frequent ones. - * - * @summary Returns top countries. - * @param getTopCountries - The getTopCountries object. - * @param getTopCountries.index - The index name to target. - * @param getTopCountries.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getTopCountries.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getTopCountries.limit - Number of records to return. Limit is the size of the page. - * @param getTopCountries.offset - Position of the starting record. Used for paging. 0 is the first record. - * @param getTopCountries.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getTopCountries( - { index, startDate, endDate, limit, offset, tags }: GetTopCountriesProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getTopCountries`.' - ); - } - - const requestPath = '/2/countries'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (limit !== undefined) { - queryParameters.limit = limit.toString(); - } - - if (offset !== undefined) { - queryParameters.offset = offset.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns top filter attributes. Limited to the 1000 most used filters. - * - * @summary Returns top filter attributes. - * @param getTopFilterAttributes - The getTopFilterAttributes object. - * @param getTopFilterAttributes.index - The index name to target. - * @param getTopFilterAttributes.search - The query term to search for. Must match the exact user input. - * @param getTopFilterAttributes.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getTopFilterAttributes.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getTopFilterAttributes.limit - Number of records to return. Limit is the size of the page. - * @param getTopFilterAttributes.offset - Position of the starting record. Used for paging. 0 is the first record. - * @param getTopFilterAttributes.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getTopFilterAttributes( - { - index, - search, - startDate, - endDate, - limit, - offset, - tags, - }: GetTopFilterAttributesProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getTopFilterAttributes`.' - ); - } - - const requestPath = '/2/filters'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (search !== undefined) { - queryParameters.search = search.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (limit !== undefined) { - queryParameters.limit = limit.toString(); - } - - if (offset !== undefined) { - queryParameters.offset = offset.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns top filters for the given attribute. Limited to the 1000 most used filters. - * - * @summary Returns top filters for the given attribute. - * @param getTopFilterForAttribute - The getTopFilterForAttribute object. - * @param getTopFilterForAttribute.attribute - The exact name of the attribute. - * @param getTopFilterForAttribute.index - The index name to target. - * @param getTopFilterForAttribute.search - The query term to search for. Must match the exact user input. - * @param getTopFilterForAttribute.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getTopFilterForAttribute.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getTopFilterForAttribute.limit - Number of records to return. Limit is the size of the page. - * @param getTopFilterForAttribute.offset - Position of the starting record. Used for paging. 0 is the first record. - * @param getTopFilterForAttribute.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getTopFilterForAttribute( - { - attribute, - index, - search, - startDate, - endDate, - limit, - offset, - tags, - }: GetTopFilterForAttributeProps, - requestOptions?: RequestOptions - ): Promise { - if (!attribute) { - throw new Error( - 'Parameter `attribute` is required when calling `getTopFilterForAttribute`.' - ); - } - - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getTopFilterForAttribute`.' - ); - } - - const requestPath = '/2/filters/{attribute}'.replace( - '{attribute}', - encodeURIComponent(attribute) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (search !== undefined) { - queryParameters.search = search.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (limit !== undefined) { - queryParameters.limit = limit.toString(); - } - - if (offset !== undefined) { - queryParameters.offset = offset.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns top filters with no results. Limited to the 1000 most used filters. - * - * @summary Returns top filters with no results. - * @param getTopFiltersNoResults - The getTopFiltersNoResults object. - * @param getTopFiltersNoResults.index - The index name to target. - * @param getTopFiltersNoResults.search - The query term to search for. Must match the exact user input. - * @param getTopFiltersNoResults.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getTopFiltersNoResults.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getTopFiltersNoResults.limit - Number of records to return. Limit is the size of the page. - * @param getTopFiltersNoResults.offset - Position of the starting record. Used for paging. 0 is the first record. - * @param getTopFiltersNoResults.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getTopFiltersNoResults( - { - index, - search, - startDate, - endDate, - limit, - offset, - tags, - }: GetTopFiltersNoResultsProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getTopFiltersNoResults`.' - ); - } - - const requestPath = '/2/filters/noResults'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (search !== undefined) { - queryParameters.search = search.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (limit !== undefined) { - queryParameters.limit = limit.toString(); - } - - if (offset !== undefined) { - queryParameters.offset = offset.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns top hits. Limited to the 1000 most frequent ones. - * - * @summary Returns top hits. - * @param getTopHits - The getTopHits object. - * @param getTopHits.index - The index name to target. - * @param getTopHits.search - The query term to search for. Must match the exact user input. - * @param getTopHits.clickAnalytics - Whether to include the click-through and conversion rates for a search. - * @param getTopHits.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getTopHits.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getTopHits.limit - Number of records to return. Limit is the size of the page. - * @param getTopHits.offset - Position of the starting record. Used for paging. 0 is the first record. - * @param getTopHits.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getTopHits( - { - index, - search, - clickAnalytics, - startDate, - endDate, - limit, - offset, - tags, - }: GetTopHitsProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getTopHits`.' - ); - } - - const requestPath = '/2/hits'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (search !== undefined) { - queryParameters.search = search.toString(); - } - - if (clickAnalytics !== undefined) { - queryParameters.clickAnalytics = clickAnalytics.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (limit !== undefined) { - queryParameters.limit = limit.toString(); - } - - if (offset !== undefined) { - queryParameters.offset = offset.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns top searches. Limited to the 1000 most frequent ones. For each search, also returns the average number of hits returned. - * - * @summary Returns top searches. - * @param getTopSearches - The getTopSearches object. - * @param getTopSearches.index - The index name to target. - * @param getTopSearches.clickAnalytics - Whether to include the click-through and conversion rates for a search. - * @param getTopSearches.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getTopSearches.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getTopSearches.orderBy - Reorder the results. - * @param getTopSearches.direction - The sorting of the result. - * @param getTopSearches.limit - Number of records to return. Limit is the size of the page. - * @param getTopSearches.offset - Position of the starting record. Used for paging. 0 is the first record. - * @param getTopSearches.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getTopSearches( - { - index, - clickAnalytics, - startDate, - endDate, - orderBy, - direction, - limit, - offset, - tags, - }: GetTopSearchesProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getTopSearches`.' - ); - } - - const requestPath = '/2/searches'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (clickAnalytics !== undefined) { - queryParameters.clickAnalytics = clickAnalytics.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (orderBy !== undefined) { - queryParameters.orderBy = orderBy.toString(); - } - - if (direction !== undefined) { - queryParameters.direction = direction.toString(); - } - - if (limit !== undefined) { - queryParameters.limit = limit.toString(); - } - - if (offset !== undefined) { - queryParameters.offset = offset.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns the distinct count of users across the given time range. The endpoint returns a value for the complete given time range, as well as a value per day. - * - * @summary Returns the distinct count of users across the given time range. - * @param getUsersCount - The getUsersCount object. - * @param getUsersCount.index - The index name to target. - * @param getUsersCount.startDate - The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getUsersCount.endDate - The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - * @param getUsersCount.tags - Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - getUsersCount( - { index, startDate, endDate, tags }: GetUsersCountProps, - requestOptions?: RequestOptions - ): Promise { - if (!index) { - throw new Error( - 'Parameter `index` is required when calling `getUsersCount`.' - ); - } - - const requestPath = '/2/users/count'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (index !== undefined) { - queryParameters.index = index.toString(); - } - - if (startDate !== undefined) { - queryParameters.startDate = startDate.toString(); - } - - if (endDate !== undefined) { - queryParameters.endDate = endDate.toString(); - } - - if (tags !== undefined) { - queryParameters.tags = tags.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param post - The post object. - * @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param post.parameters - Query parameters to be applied to the current query. - * @param post.body - The parameters to send with the custom request. - */ - post( - { path, parameters, body }: PostProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `post`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param put - The put object. - * @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param put.parameters - Query parameters to be applied to the current query. - * @param put.body - The parameters to send with the custom request. - */ - put( - { path, parameters, body }: PutProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `put`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - }; -} - -export type AnalyticsApi = ReturnType; - -export type DelProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type GetProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; -}; - -export type GetAverageClickPositionProps = { - /** - * The index name to target. - */ - index: string; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetClickPositionsProps = { - /** - * The index name to target. - */ - index: string; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetClickThroughRateProps = { - /** - * The index name to target. - */ - index: string; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetConversationRateProps = { - /** - * The index name to target. - */ - index: string; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetNoClickRateProps = { - /** - * The index name to target. - */ - index: string; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetNoResultsRateProps = { - /** - * The index name to target. - */ - index: string; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetSearchesCountProps = { - /** - * The index name to target. - */ - index: string; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetSearchesNoClicksProps = { - /** - * The index name to target. - */ - index: string; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Number of records to return. Limit is the size of the page. - */ - limit?: number; - /** - * Position of the starting record. Used for paging. 0 is the first record. - */ - offset?: number; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetSearchesNoResultsProps = { - /** - * The index name to target. - */ - index: string; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Number of records to return. Limit is the size of the page. - */ - limit?: number; - /** - * Position of the starting record. Used for paging. 0 is the first record. - */ - offset?: number; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetStatusProps = { - /** - * The index name to target. - */ - index: string; -}; - -export type GetTopCountriesProps = { - /** - * The index name to target. - */ - index: string; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Number of records to return. Limit is the size of the page. - */ - limit?: number; - /** - * Position of the starting record. Used for paging. 0 is the first record. - */ - offset?: number; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetTopFilterAttributesProps = { - /** - * The index name to target. - */ - index: string; - /** - * The query term to search for. Must match the exact user input. - */ - search?: string; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Number of records to return. Limit is the size of the page. - */ - limit?: number; - /** - * Position of the starting record. Used for paging. 0 is the first record. - */ - offset?: number; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetTopFilterForAttributeProps = { - /** - * The exact name of the attribute. - */ - attribute: string; - /** - * The index name to target. - */ - index: string; - /** - * The query term to search for. Must match the exact user input. - */ - search?: string; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Number of records to return. Limit is the size of the page. - */ - limit?: number; - /** - * Position of the starting record. Used for paging. 0 is the first record. - */ - offset?: number; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetTopFiltersNoResultsProps = { - /** - * The index name to target. - */ - index: string; - /** - * The query term to search for. Must match the exact user input. - */ - search?: string; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Number of records to return. Limit is the size of the page. - */ - limit?: number; - /** - * Position of the starting record. Used for paging. 0 is the first record. - */ - offset?: number; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetTopHitsProps = { - /** - * The index name to target. - */ - index: string; - /** - * The query term to search for. Must match the exact user input. - */ - search?: string; - /** - * Whether to include the click-through and conversion rates for a search. - */ - clickAnalytics?: boolean; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Number of records to return. Limit is the size of the page. - */ - limit?: number; - /** - * Position of the starting record. Used for paging. 0 is the first record. - */ - offset?: number; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetTopSearchesProps = { - /** - * The index name to target. - */ - index: string; - /** - * Whether to include the click-through and conversion rates for a search. - */ - clickAnalytics?: boolean; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Reorder the results. - */ - orderBy?: - | 'averageClickPosition' - | 'clickThroughRate' - | 'conversionRate' - | 'searchCount'; - /** - * The sorting of the result. - */ - direction?: 'asc' | 'desc'; - /** - * Number of records to return. Limit is the size of the page. - */ - limit?: number; - /** - * Position of the starting record. Used for paging. 0 is the first record. - */ - offset?: number; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type GetUsersCountProps = { - /** - * The index name to target. - */ - index: string; - /** - * The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - startDate?: string; - /** - * The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. - */ - endDate?: string; - /** - * Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. - */ - tags?: string; -}; - -export type PostProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type PutProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/tsconfig.json b/clients/algoliasearch-client-javascript/packages/client-analytics/tsconfig.json deleted file mode 100644 index 89b2007fbb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "dist", - }, - "include": ["src", "model", "builds/node.ts", "builds/browser.ts"], - "exclude": ["dist", "node_modules"] -} diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/.openapi-generator-ignore b/clients/algoliasearch-client-javascript/packages/client-insights/.openapi-generator-ignore deleted file mode 100644 index a6fb9df9d1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-insights/.openapi-generator-ignore +++ /dev/null @@ -1,8 +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. - -git_push.sh -.gitignore diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/builds/browser.ts b/clients/algoliasearch-client-javascript/packages/client-insights/builds/browser.ts deleted file mode 100644 index 00257fce8b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-insights/builds/browser.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createFallbackableCache, - createBrowserLocalStorageCache, -} from '@experimental-api-clients-automation/client-common'; -import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr'; - -import { createInsightsApi, apiClientVersion } from '../src/insightsApi'; -import type { InsightsApi, Region } from '../src/insightsApi'; - -export * from '../src/insightsApi'; - -export function insightsApi( - appId: string, - apiKey: string, - region?: Region, - options?: InitClientOptions -): InsightsApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - return createInsightsApi({ - appId, - apiKey, - region, - timeouts: { - connect: 1, - read: 2, - write: 30, - }, - requester: options?.requester ?? createXhrRequester(), - userAgents: [{ segment: 'Browser' }], - authMode: 'WithinQueryParameters', - responsesCache: options?.responsesCache ?? createMemoryCache(), - requestsCache: - options?.requestsCache ?? createMemoryCache({ serializable: false }), - hostsCache: - options?.hostsCache ?? - createFallbackableCache({ - caches: [ - createBrowserLocalStorageCache({ - key: `${apiClientVersion}-${appId}`, - }), - createMemoryCache(), - ], - }), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/builds/node.ts b/clients/algoliasearch-client-javascript/packages/client-insights/builds/node.ts deleted file mode 100644 index c68540b5d6..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-insights/builds/node.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createNullCache, -} from '@experimental-api-clients-automation/client-common'; -import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http'; - -import { createInsightsApi } from '../src/insightsApi'; -import type { InsightsApi, Region } from '../src/insightsApi'; - -export * from '../src/insightsApi'; - -export function insightsApi( - appId: string, - apiKey: string, - region?: Region, - options?: InitClientOptions -): InsightsApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - return createInsightsApi({ - appId, - apiKey, - region, - timeouts: { - connect: 2, - read: 5, - write: 30, - }, - requester: options?.requester ?? createHttpRequester(), - userAgents: [{ segment: 'Node.js', version: process.versions.node }], - responsesCache: options?.responsesCache ?? createNullCache(), - requestsCache: options?.requestsCache ?? createNullCache(), - hostsCache: options?.hostsCache ?? createMemoryCache(), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/index.d.ts b/clients/algoliasearch-client-javascript/packages/client-insights/index.d.ts deleted file mode 100644 index 8b0a7c887a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-insights/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-unresolved -export * from './dist/builds/node'; diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/index.js b/clients/algoliasearch-client-javascript/packages/client-insights/index.js deleted file mode 100644 index 948691cc65..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-insights/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-commonjs,import/extensions -module.exports = require('./dist/client-insights.cjs.node.js'); diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/model/errorBase.ts b/clients/algoliasearch-client-javascript/packages/client-insights/model/errorBase.ts deleted file mode 100644 index a533aa7a15..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-insights/model/errorBase.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Error. - */ -export type ErrorBase = { - message?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/model/insightEvent.ts b/clients/algoliasearch-client-javascript/packages/client-insights/model/insightEvent.ts deleted file mode 100644 index 9260226fba..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-insights/model/insightEvent.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Insights event. - */ -export type InsightEvent = { - /** - * An eventType can be a click, a conversion, or a view. - */ - eventType: InsightEventEventType; - /** - * A user-defined string used to categorize events. - */ - eventName: string; - /** - * Name of the targeted index. - */ - index: string; - /** - * A user identifier. Depending if the user is logged-in or not, several strategies can be used from a sessionId to a technical identifier. - */ - userToken: string; - /** - * Time of the event expressed in milliseconds since the Unix epoch. - */ - timestamp?: number; - /** - * Algolia queryID. This is required when an event is tied to a search. - */ - queryID?: string; - /** - * An array of index objectID. Limited to 20 objects. An event can’t have both objectIDs and filters at the same time. - */ - objectIDs?: string[]; - /** - * An array of filters. Limited to 10 filters. An event can’t have both objectIDs and filters at the same time. - */ - filters?: string[]; - /** - * Position of the click in the list of Algolia search results. This field is required if a queryID is provided. One position must be provided for each objectID. - */ - positions?: number[]; -}; - -export type InsightEventEventType = 'click' | 'conversion' | 'view'; diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/model/insightEvents.ts b/clients/algoliasearch-client-javascript/packages/client-insights/model/insightEvents.ts deleted file mode 100644 index 69728810b2..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-insights/model/insightEvents.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { InsightEvent } from './insightEvent'; - -/** - * Object containing the events sent. - */ -export type InsightEvents = { - /** - * Array of events sent. - */ - events: InsightEvent[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/model/models.ts b/clients/algoliasearch-client-javascript/packages/client-insights/model/models.ts deleted file mode 100644 index 8f1cea9c8c..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-insights/model/models.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './errorBase'; -export * from './insightEvent'; -export * from './insightEvents'; -export * from './pushEventsResponse'; diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/model/pushEventsResponse.ts b/clients/algoliasearch-client-javascript/packages/client-insights/model/pushEventsResponse.ts deleted file mode 100644 index ed9b5dd044..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-insights/model/pushEventsResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type PushEventsResponse = { - /** - * A message confirming the event push. - */ - message: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/package.json b/clients/algoliasearch-client-javascript/packages/client-insights/package.json deleted file mode 100644 index 55dd6d120f..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-insights/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@experimental-api-clients-automation/client-insights", - "version": "0.0.5", - "description": "JavaScript client for @experimental-api-clients-automation/client-insights", - "repository": "algolia/algoliasearch-client-javascript", - "author": "Algolia", - "license": "MIT", - "main": "index.js", - "module": "dist/client-insights.esm.node.js", - "types": "index.d.ts", - "jsdelivr": "dist/client-insights.umd.browser.js", - "unpkg": "dist/client-insights.umd.browser.js", - "browser": "dist/client-insights.cjs.browser.js", - "scripts": { - "clean": "rm -rf ./dist" - }, - "files": [ - "dist", - "model", - "index.js", - "index.d.ts" - ], - "engines": { - "node": ">= 14.0.0" - }, - "dependencies": { - "@experimental-api-clients-automation/client-common": "0.0.5", - "@experimental-api-clients-automation/requester-browser-xhr": "0.0.5", - "@experimental-api-clients-automation/requester-node-http": "0.0.5" - }, - "devDependencies": { - "@types/node": "16.11.26", - "typescript": "4.6.3" - } -} diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/src/insightsApi.ts b/clients/algoliasearch-client-javascript/packages/client-insights/src/insightsApi.ts deleted file mode 100644 index 775b52d74a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-insights/src/insightsApi.ts +++ /dev/null @@ -1,311 +0,0 @@ -import { - createAuth, - createTransporter, - getUserAgent, -} from '@experimental-api-clients-automation/client-common'; -import type { - CreateClientOptions, - Headers, - Host, - Request, - RequestOptions, - QueryParameters, -} from '@experimental-api-clients-automation/client-common'; - -import type { InsightEvents } from '../model/insightEvents'; -import type { PushEventsResponse } from '../model/pushEventsResponse'; - -export * from '../model/models'; -export const apiClientVersion = '0.0.5'; - -export type Region = 'de' | 'us'; - -function getDefaultHosts(region?: Region): Host[] { - const regionHost = region ? `.${region}.` : '.'; - - return [ - { - url: `insights${regionHost}algolia.io`, - accept: 'readWrite', - protocol: 'https', - }, - ]; -} - -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -export function createInsightsApi( - options: CreateClientOptions & { region?: Region } -) { - const auth = createAuth(options.appId, options.apiKey, options.authMode); - const transporter = createTransporter({ - hosts: options?.hosts ?? getDefaultHosts(options.region), - hostsCache: options.hostsCache, - requestsCache: options.requestsCache, - responsesCache: options.responsesCache, - baseHeaders: { - 'content-type': 'application/x-www-form-urlencoded', - ...auth.headers(), - }, - baseQueryParameters: auth.queryParameters(), - userAgent: getUserAgent({ - userAgents: options.userAgents, - client: 'Insights', - version: apiClientVersion, - }), - timeouts: options.timeouts, - requester: options.requester, - }); - - function addUserAgent(segment: string, version?: string): void { - transporter.userAgent.add({ segment, version }); - } - - return { - addUserAgent, - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param del - The del object. - * @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param del.parameters - Query parameters to be applied to the current query. - * @param del.body - The parameters to send with the custom request. - */ - del( - { path, parameters, body }: DelProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `del`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param get - The get object. - * @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param get.parameters - Query parameters to be applied to the current query. - */ - get( - { path, parameters }: GetProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `get`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param post - The post object. - * @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param post.parameters - Query parameters to be applied to the current query. - * @param post.body - The parameters to send with the custom request. - */ - post( - { path, parameters, body }: PostProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `post`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This command pushes an array of events. - * - * @summary Pushes an array of events. - * @param insightEvents - The insightEvents object. - */ - pushEvents( - insightEvents: InsightEvents, - requestOptions?: RequestOptions - ): Promise { - if (!insightEvents) { - throw new Error( - 'Parameter `insightEvents` is required when calling `pushEvents`.' - ); - } - - if (!insightEvents.events) { - throw new Error( - 'Parameter `insightEvents.events` is required when calling `pushEvents`.' - ); - } - - const requestPath = '/1/events'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: insightEvents, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param put - The put object. - * @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param put.parameters - Query parameters to be applied to the current query. - * @param put.body - The parameters to send with the custom request. - */ - put( - { path, parameters, body }: PutProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `put`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - }; -} - -export type InsightsApi = ReturnType; - -export type DelProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type GetProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; -}; - -export type PostProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type PutProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/tsconfig.json b/clients/algoliasearch-client-javascript/packages/client-insights/tsconfig.json deleted file mode 100644 index 89b2007fbb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-insights/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "dist", - }, - "include": ["src", "model", "builds/node.ts", "builds/browser.ts"], - "exclude": ["dist", "node_modules"] -} diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/.openapi-generator-ignore b/clients/algoliasearch-client-javascript/packages/client-personalization/.openapi-generator-ignore deleted file mode 100644 index a6fb9df9d1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/.openapi-generator-ignore +++ /dev/null @@ -1,8 +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. - -git_push.sh -.gitignore diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/builds/browser.ts b/clients/algoliasearch-client-javascript/packages/client-personalization/builds/browser.ts deleted file mode 100644 index 1b3313ba4a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/builds/browser.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createFallbackableCache, - createBrowserLocalStorageCache, -} from '@experimental-api-clients-automation/client-common'; -import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr'; - -import { - createPersonalizationApi, - apiClientVersion, -} from '../src/personalizationApi'; -import type { PersonalizationApi, Region } from '../src/personalizationApi'; - -export * from '../src/personalizationApi'; - -export function personalizationApi( - appId: string, - apiKey: string, - region: Region, - options?: InitClientOptions -): PersonalizationApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - if (!region) { - throw new Error('`region` is missing.'); - } - - return createPersonalizationApi({ - appId, - apiKey, - region, - timeouts: { - connect: 1, - read: 2, - write: 30, - }, - requester: options?.requester ?? createXhrRequester(), - userAgents: [{ segment: 'Browser' }], - authMode: 'WithinQueryParameters', - responsesCache: options?.responsesCache ?? createMemoryCache(), - requestsCache: - options?.requestsCache ?? createMemoryCache({ serializable: false }), - hostsCache: - options?.hostsCache ?? - createFallbackableCache({ - caches: [ - createBrowserLocalStorageCache({ - key: `${apiClientVersion}-${appId}`, - }), - createMemoryCache(), - ], - }), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/builds/node.ts b/clients/algoliasearch-client-javascript/packages/client-personalization/builds/node.ts deleted file mode 100644 index 15f62a133f..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/builds/node.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createNullCache, -} from '@experimental-api-clients-automation/client-common'; -import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http'; - -import { createPersonalizationApi } from '../src/personalizationApi'; -import type { PersonalizationApi, Region } from '../src/personalizationApi'; - -export * from '../src/personalizationApi'; - -export function personalizationApi( - appId: string, - apiKey: string, - region: Region, - options?: InitClientOptions -): PersonalizationApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - if (!region) { - throw new Error('`region` is missing.'); - } - - return createPersonalizationApi({ - appId, - apiKey, - region, - timeouts: { - connect: 2, - read: 5, - write: 30, - }, - requester: options?.requester ?? createHttpRequester(), - userAgents: [{ segment: 'Node.js', version: process.versions.node }], - responsesCache: options?.responsesCache ?? createNullCache(), - requestsCache: options?.requestsCache ?? createNullCache(), - hostsCache: options?.hostsCache ?? createMemoryCache(), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/index.d.ts b/clients/algoliasearch-client-javascript/packages/client-personalization/index.d.ts deleted file mode 100644 index 8b0a7c887a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-unresolved -export * from './dist/builds/node'; diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/index.js b/clients/algoliasearch-client-javascript/packages/client-personalization/index.js deleted file mode 100644 index cca98d437f..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-commonjs,import/extensions -module.exports = require('./dist/client-personalization.cjs.node.js'); diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/model/deleteUserProfileResponse.ts b/clients/algoliasearch-client-javascript/packages/client-personalization/model/deleteUserProfileResponse.ts deleted file mode 100644 index 49717f3f25..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/model/deleteUserProfileResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type DeleteUserProfileResponse = { - /** - * UserToken representing the user for which to fetch the Personalization profile. - */ - userToken: string; - /** - * A date until which the data can safely be considered as deleted for the given user. Any data received after the deletedUntil date will start building a new user profile. - */ - deletedUntil: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/model/errorBase.ts b/clients/algoliasearch-client-javascript/packages/client-personalization/model/errorBase.ts deleted file mode 100644 index a533aa7a15..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/model/errorBase.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Error. - */ -export type ErrorBase = { - message?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/model/eventScoring.ts b/clients/algoliasearch-client-javascript/packages/client-personalization/model/eventScoring.ts deleted file mode 100644 index 277ce92eb9..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/model/eventScoring.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type EventScoring = { - /** - * The score for the event. - */ - score: number; - /** - * The name of the event. - */ - eventName: string; - /** - * The type of the event. - */ - eventType: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/model/facetScoring.ts b/clients/algoliasearch-client-javascript/packages/client-personalization/model/facetScoring.ts deleted file mode 100644 index ae2c9d1b5e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/model/facetScoring.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type FacetScoring = { - /** - * The score for the event. - */ - score: number; - /** - * The name of the facet. - */ - facetName: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/model/getUserTokenResponse.ts b/clients/algoliasearch-client-javascript/packages/client-personalization/model/getUserTokenResponse.ts deleted file mode 100644 index 0ab1c96114..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/model/getUserTokenResponse.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type GetUserTokenResponse = { - /** - * UserToken representing the user for which to fetch the Personalization profile. - */ - userToken: string; - /** - * Date of last event update. (ISO-8601 format). - */ - lastEventAt: string; - /** - * The userToken scores. - */ - scores: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/model/models.ts b/clients/algoliasearch-client-javascript/packages/client-personalization/model/models.ts deleted file mode 100644 index 834a84cd28..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/model/models.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './deleteUserProfileResponse'; -export * from './errorBase'; -export * from './eventScoring'; -export * from './facetScoring'; -export * from './getUserTokenResponse'; -export * from './personalizationStrategyParams'; -export * from './setPersonalizationStrategyResponse'; diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/model/personalizationStrategyParams.ts b/clients/algoliasearch-client-javascript/packages/client-personalization/model/personalizationStrategyParams.ts deleted file mode 100644 index 0bcbab7e6e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/model/personalizationStrategyParams.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { EventScoring } from './eventScoring'; -import type { FacetScoring } from './facetScoring'; - -export type PersonalizationStrategyParams = { - /** - * Scores associated with the events. - */ - eventScoring: EventScoring[]; - /** - * Scores associated with the facets. - */ - facetScoring: FacetScoring[]; - /** - * The impact that personalization has on search results: a number between 0 (personalization disabled) and 100 (personalization fully enabled). - */ - personalizationImpact: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/model/setPersonalizationStrategyResponse.ts b/clients/algoliasearch-client-javascript/packages/client-personalization/model/setPersonalizationStrategyResponse.ts deleted file mode 100644 index 4eaa97be65..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/model/setPersonalizationStrategyResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type SetPersonalizationStrategyResponse = { - /** - * A message confirming the strategy update. - */ - message: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/package.json b/clients/algoliasearch-client-javascript/packages/client-personalization/package.json deleted file mode 100644 index 26c6cb266c..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@experimental-api-clients-automation/client-personalization", - "version": "0.0.5", - "description": "JavaScript client for @experimental-api-clients-automation/client-personalization", - "repository": "algolia/algoliasearch-client-javascript", - "author": "Algolia", - "license": "MIT", - "main": "index.js", - "module": "dist/client-personalization.esm.node.js", - "types": "index.d.ts", - "jsdelivr": "dist/client-personalization.umd.browser.js", - "unpkg": "dist/client-personalization.umd.browser.js", - "browser": "dist/client-personalization.cjs.browser.js", - "scripts": { - "clean": "rm -rf ./dist" - }, - "files": [ - "dist", - "model", - "index.js", - "index.d.ts" - ], - "engines": { - "node": ">= 14.0.0" - }, - "dependencies": { - "@experimental-api-clients-automation/client-common": "0.0.5", - "@experimental-api-clients-automation/requester-browser-xhr": "0.0.5", - "@experimental-api-clients-automation/requester-node-http": "0.0.5" - }, - "devDependencies": { - "@types/node": "16.11.26", - "typescript": "4.6.3" - } -} diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/src/personalizationApi.ts b/clients/algoliasearch-client-javascript/packages/client-personalization/src/personalizationApi.ts deleted file mode 100644 index 2cabf74731..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/src/personalizationApi.ts +++ /dev/null @@ -1,440 +0,0 @@ -import { - createAuth, - createTransporter, - getUserAgent, -} from '@experimental-api-clients-automation/client-common'; -import type { - CreateClientOptions, - Headers, - Host, - Request, - RequestOptions, - QueryParameters, -} from '@experimental-api-clients-automation/client-common'; - -import type { DeleteUserProfileResponse } from '../model/deleteUserProfileResponse'; -import type { GetUserTokenResponse } from '../model/getUserTokenResponse'; -import type { PersonalizationStrategyParams } from '../model/personalizationStrategyParams'; -import type { SetPersonalizationStrategyResponse } from '../model/setPersonalizationStrategyResponse'; - -export * from '../model/models'; -export const apiClientVersion = '0.0.5'; - -export type Region = 'eu' | 'us'; - -function getDefaultHosts(region: Region): Host[] { - return [ - { - url: `personalization.${region}.algolia.com`, - accept: 'readWrite', - protocol: 'https', - }, - ]; -} - -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -export function createPersonalizationApi( - options: CreateClientOptions & { region: Region } -) { - const auth = createAuth(options.appId, options.apiKey, options.authMode); - const transporter = createTransporter({ - hosts: options?.hosts ?? getDefaultHosts(options.region), - hostsCache: options.hostsCache, - requestsCache: options.requestsCache, - responsesCache: options.responsesCache, - baseHeaders: { - 'content-type': 'application/x-www-form-urlencoded', - ...auth.headers(), - }, - baseQueryParameters: auth.queryParameters(), - userAgent: getUserAgent({ - userAgents: options.userAgents, - client: 'Personalization', - version: apiClientVersion, - }), - timeouts: options.timeouts, - requester: options.requester, - }); - - function addUserAgent(segment: string, version?: string): void { - transporter.userAgent.add({ segment, version }); - } - - return { - addUserAgent, - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param del - The del object. - * @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param del.parameters - Query parameters to be applied to the current query. - * @param del.body - The parameters to send with the custom request. - */ - del( - { path, parameters, body }: DelProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `del`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns, as part of the response, a date until which the data can safely be considered as deleted for the given user. This means that if you send events for the given user before this date, they will be ignored. Any data received after the deletedUntil date will start building a new user profile. It might take a couple hours before for the deletion request to be fully processed. - * - * @summary Delete the user profile and all its associated data. - * @param deleteUserProfile - The deleteUserProfile object. - * @param deleteUserProfile.userToken - UserToken representing the user for which to fetch the Personalization profile. - */ - deleteUserProfile( - { userToken }: DeleteUserProfileProps, - requestOptions?: RequestOptions - ): Promise { - if (!userToken) { - throw new Error( - 'Parameter `userToken` is required when calling `deleteUserProfile`.' - ); - } - - const requestPath = '/1/profiles/{userToken}'.replace( - '{userToken}', - encodeURIComponent(userToken) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param get - The get object. - * @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param get.parameters - Query parameters to be applied to the current query. - */ - get( - { path, parameters }: GetProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `get`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * The strategy contains information on the events and facets that impact user profiles and personalized search results. - * - * @summary Get the current personalization strategy. - */ - getPersonalizationStrategy( - requestOptions?: RequestOptions - ): Promise { - const requestPath = '/1/strategies/personalization'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * The profile is structured by facet name used in the strategy. Each facet value is mapped to its score. Each score represents the user affinity for a specific facet value given the userToken past events and the Personalization strategy defined. Scores are bounded to 20. The last processed event timestamp is provided using the ISO 8601 format for debugging purposes. - * - * @summary Get the user profile built from Personalization strategy. - * @param getUserTokenProfile - The getUserTokenProfile object. - * @param getUserTokenProfile.userToken - UserToken representing the user for which to fetch the Personalization profile. - */ - getUserTokenProfile( - { userToken }: GetUserTokenProfileProps, - requestOptions?: RequestOptions - ): Promise { - if (!userToken) { - throw new Error( - 'Parameter `userToken` is required when calling `getUserTokenProfile`.' - ); - } - - const requestPath = '/1/profiles/personalization/{userToken}'.replace( - '{userToken}', - encodeURIComponent(userToken) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param post - The post object. - * @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param post.parameters - Query parameters to be applied to the current query. - * @param post.body - The parameters to send with the custom request. - */ - post( - { path, parameters, body }: PostProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `post`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param put - The put object. - * @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param put.parameters - Query parameters to be applied to the current query. - * @param put.body - The parameters to send with the custom request. - */ - put( - { path, parameters, body }: PutProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `put`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * A strategy defines the events and facets that impact user profiles and personalized search results. - * - * @summary Set a new personalization strategy. - * @param personalizationStrategyParams - The personalizationStrategyParams object. - */ - setPersonalizationStrategy( - personalizationStrategyParams: PersonalizationStrategyParams, - requestOptions?: RequestOptions - ): Promise { - if (!personalizationStrategyParams) { - throw new Error( - 'Parameter `personalizationStrategyParams` is required when calling `setPersonalizationStrategy`.' - ); - } - - if (!personalizationStrategyParams.eventScoring) { - throw new Error( - 'Parameter `personalizationStrategyParams.eventScoring` is required when calling `setPersonalizationStrategy`.' - ); - } - if (!personalizationStrategyParams.facetScoring) { - throw new Error( - 'Parameter `personalizationStrategyParams.facetScoring` is required when calling `setPersonalizationStrategy`.' - ); - } - if (!personalizationStrategyParams.personalizationImpact) { - throw new Error( - 'Parameter `personalizationStrategyParams.personalizationImpact` is required when calling `setPersonalizationStrategy`.' - ); - } - - const requestPath = '/1/strategies/personalization'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: personalizationStrategyParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - }; -} - -export type PersonalizationApi = ReturnType; - -export type DelProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type DeleteUserProfileProps = { - /** - * UserToken representing the user for which to fetch the Personalization profile. - */ - userToken: string; -}; - -export type GetProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; -}; - -export type GetUserTokenProfileProps = { - /** - * UserToken representing the user for which to fetch the Personalization profile. - */ - userToken: string; -}; - -export type PostProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type PutProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/tsconfig.json b/clients/algoliasearch-client-javascript/packages/client-personalization/tsconfig.json deleted file mode 100644 index 89b2007fbb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "dist", - }, - "include": ["src", "model", "builds/node.ts", "builds/browser.ts"], - "exclude": ["dist", "node_modules"] -} diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/.openapi-generator-ignore b/clients/algoliasearch-client-javascript/packages/client-predict/.openapi-generator-ignore deleted file mode 100644 index a6fb9df9d1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/.openapi-generator-ignore +++ /dev/null @@ -1,8 +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. - -git_push.sh -.gitignore diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/builds/browser.ts b/clients/algoliasearch-client-javascript/packages/client-predict/builds/browser.ts deleted file mode 100644 index 1f0d80bc1a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/builds/browser.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createFallbackableCache, - createBrowserLocalStorageCache, -} from '@experimental-api-clients-automation/client-common'; -import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr'; - -import { createPredictApi, apiClientVersion } from '../src/predictApi'; -import type { PredictApi } from '../src/predictApi'; - -export * from '../src/predictApi'; - -export function predictApi( - appId: string, - apiKey: string, - options?: InitClientOptions -): PredictApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - return createPredictApi({ - appId, - apiKey, - timeouts: { - connect: 1, - read: 2, - write: 30, - }, - requester: options?.requester ?? createXhrRequester(), - userAgents: [{ segment: 'Browser' }], - authMode: 'WithinQueryParameters', - responsesCache: options?.responsesCache ?? createMemoryCache(), - requestsCache: - options?.requestsCache ?? createMemoryCache({ serializable: false }), - hostsCache: - options?.hostsCache ?? - createFallbackableCache({ - caches: [ - createBrowserLocalStorageCache({ - key: `${apiClientVersion}-${appId}`, - }), - createMemoryCache(), - ], - }), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/builds/node.ts b/clients/algoliasearch-client-javascript/packages/client-predict/builds/node.ts deleted file mode 100644 index c1d7d8ae7e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/builds/node.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createNullCache, -} from '@experimental-api-clients-automation/client-common'; -import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http'; - -import { createPredictApi } from '../src/predictApi'; -import type { PredictApi } from '../src/predictApi'; - -export * from '../src/predictApi'; - -export function predictApi( - appId: string, - apiKey: string, - options?: InitClientOptions -): PredictApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - return createPredictApi({ - appId, - apiKey, - timeouts: { - connect: 2, - read: 5, - write: 30, - }, - requester: options?.requester ?? createHttpRequester(), - userAgents: [{ segment: 'Node.js', version: process.versions.node }], - responsesCache: options?.responsesCache ?? createNullCache(), - requestsCache: options?.requestsCache ?? createNullCache(), - hostsCache: options?.hostsCache ?? createMemoryCache(), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/index.d.ts b/clients/algoliasearch-client-javascript/packages/client-predict/index.d.ts deleted file mode 100644 index 8b0a7c887a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-unresolved -export * from './dist/builds/node'; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/index.js b/clients/algoliasearch-client-javascript/packages/client-predict/index.js deleted file mode 100644 index d4ebe8f164..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-commonjs,import/extensions -module.exports = require('./dist/client-predict.cjs.node.js'); diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/model/affinities.ts b/clients/algoliasearch-client-javascript/packages/client-predict/model/affinities.ts deleted file mode 100644 index e8187169b1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/model/affinities.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type Affinities = { - name?: string; - value?: string; - probability?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/model/errorBase.ts b/clients/algoliasearch-client-javascript/packages/client-predict/model/errorBase.ts deleted file mode 100644 index a533aa7a15..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/model/errorBase.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Error. - */ -export type ErrorBase = { - message?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/model/fetchUserProfileResponse.ts b/clients/algoliasearch-client-javascript/packages/client-predict/model/fetchUserProfileResponse.ts deleted file mode 100644 index 58ebd054ad..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/model/fetchUserProfileResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Predictions } from './predictions'; -import type { Properties } from './properties'; -import type { Segments } from './segments'; - -export type FetchUserProfileResponse = { - user: string; - predictions?: Predictions; - properties?: Properties; - segments?: Segments; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/model/funnelStage.ts b/clients/algoliasearch-client-javascript/packages/client-predict/model/funnelStage.ts deleted file mode 100644 index 2fe71efd34..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/model/funnelStage.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type FunnelStage = { - name?: string; - probability?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/model/models.ts b/clients/algoliasearch-client-javascript/packages/client-predict/model/models.ts deleted file mode 100644 index 02641866ea..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/model/models.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './affinities'; -export * from './errorBase'; -export * from './fetchUserProfileResponse'; -export * from './funnelStage'; -export * from './params'; -export * from './predictions'; -export * from './predictionsAffinities'; -export * from './predictionsFunnelStage'; -export * from './predictionsOrderValue'; -export * from './properties'; -export * from './segments'; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/model/params.ts b/clients/algoliasearch-client-javascript/packages/client-predict/model/params.ts deleted file mode 100644 index ebcae4a6f8..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/model/params.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Object with models and types to retrieve. - */ -export type Params = { - /** - * List with model types for which to retrieve predictions. - */ - modelsToRetrieve?: ParamsModelsToRetrieve[]; - /** - * List with types to be retrieved. - */ - typesToRetrieve?: ParamsTypesToRetrieve[]; -}; - -export type ParamsModelsToRetrieve = - | 'affinities' - | 'funnel_stage' - | 'order_value'; - -export type ParamsTypesToRetrieve = 'properties' | 'segments'; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/model/predictions.ts b/clients/algoliasearch-client-javascript/packages/client-predict/model/predictions.ts deleted file mode 100644 index 632247b07d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/model/predictions.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { PredictionsAffinities } from './predictionsAffinities'; -import type { PredictionsFunnelStage } from './predictionsFunnelStage'; -import type { PredictionsOrderValue } from './predictionsOrderValue'; - -export type Predictions = { - funnel_stage?: PredictionsFunnelStage; - order_value?: PredictionsOrderValue; - affinities?: PredictionsAffinities; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/model/predictionsAffinities.ts b/clients/algoliasearch-client-javascript/packages/client-predict/model/predictionsAffinities.ts deleted file mode 100644 index 2f9c9060be..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/model/predictionsAffinities.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Affinities } from './affinities'; - -/** - * Prediction for the **affinities** model. - */ -export type PredictionsAffinities = { - value?: Affinities[]; - lastUpdatedAt?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/model/predictionsFunnelStage.ts b/clients/algoliasearch-client-javascript/packages/client-predict/model/predictionsFunnelStage.ts deleted file mode 100644 index 9a653c5399..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/model/predictionsFunnelStage.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { FunnelStage } from './funnelStage'; - -/** - * Prediction for the **funnel_stage** model. - */ -export type PredictionsFunnelStage = { - value?: FunnelStage[]; - lastUpdatedAt?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/model/predictionsOrderValue.ts b/clients/algoliasearch-client-javascript/packages/client-predict/model/predictionsOrderValue.ts deleted file mode 100644 index 2180dacb5f..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/model/predictionsOrderValue.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Prediction for the **order_value** model. - */ -export type PredictionsOrderValue = { - value?: number; - lastUpdatedAt?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/model/properties.ts b/clients/algoliasearch-client-javascript/packages/client-predict/model/properties.ts deleted file mode 100644 index e8c8dbe7eb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/model/properties.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Properties for the user profile. - */ -export type Properties = { - /** - * Raw user properties (key-value pairs). - */ - raw?: Record; - /** - * Computed user properties (key-value pairs). - */ - computed?: Record; - /** - * Custom user properties (key-value pairs). - */ - custom?: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/model/segments.ts b/clients/algoliasearch-client-javascript/packages/client-predict/model/segments.ts deleted file mode 100644 index a05df5cf46..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/model/segments.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Segments that the user belongs to. - */ -export type Segments = { - /** - * List of computed segments IDs. - */ - computed?: string[]; - /** - * List of custom segments IDs. - */ - custom?: string[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/package.json b/clients/algoliasearch-client-javascript/packages/client-predict/package.json deleted file mode 100644 index 07ea03f764..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@experimental-api-clients-automation/client-predict", - "version": "0.0.5", - "description": "JavaScript client for @experimental-api-clients-automation/client-predict", - "repository": "algolia/algoliasearch-client-javascript", - "author": "Algolia", - "license": "MIT", - "main": "index.js", - "module": "dist/client-predict.esm.node.js", - "types": "index.d.ts", - "jsdelivr": "dist/client-predict.umd.browser.js", - "unpkg": "dist/client-predict.umd.browser.js", - "browser": "dist/client-predict.cjs.browser.js", - "scripts": { - "clean": "rm -rf ./dist" - }, - "files": [ - "dist", - "model", - "index.js", - "index.d.ts" - ], - "engines": { - "node": ">= 14.0.0" - }, - "dependencies": { - "@experimental-api-clients-automation/client-common": "0.0.5", - "@experimental-api-clients-automation/requester-browser-xhr": "0.0.5", - "@experimental-api-clients-automation/requester-node-http": "0.0.5" - }, - "devDependencies": { - "@types/node": "16.11.26", - "typescript": "4.6.3" - } -} diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/src/predictApi.ts b/clients/algoliasearch-client-javascript/packages/client-predict/src/predictApi.ts deleted file mode 100644 index bd2f25a0a4..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/src/predictApi.ts +++ /dev/null @@ -1,318 +0,0 @@ -import { - createAuth, - createTransporter, - getUserAgent, -} from '@experimental-api-clients-automation/client-common'; -import type { - CreateClientOptions, - Headers, - Host, - Request, - RequestOptions, - QueryParameters, -} from '@experimental-api-clients-automation/client-common'; - -import type { FetchUserProfileResponse } from '../model/fetchUserProfileResponse'; -import type { Params } from '../model/params'; - -export * from '../model/models'; -export const apiClientVersion = '0.0.5'; - -function getDefaultHosts(): Host[] { - return [ - { - url: 'predict-api-oslcbws3zq-ew.a.run.app', - accept: 'readWrite', - protocol: 'https', - }, - ]; -} - -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -export function createPredictApi(options: CreateClientOptions) { - const auth = createAuth(options.appId, options.apiKey, options.authMode); - const transporter = createTransporter({ - hosts: options?.hosts ?? getDefaultHosts(), - hostsCache: options.hostsCache, - requestsCache: options.requestsCache, - responsesCache: options.responsesCache, - baseHeaders: { - 'content-type': 'application/x-www-form-urlencoded', - ...auth.headers(), - }, - baseQueryParameters: auth.queryParameters(), - userAgent: getUserAgent({ - userAgents: options.userAgents, - client: 'Predict', - version: apiClientVersion, - }), - timeouts: options.timeouts, - requester: options.requester, - }); - - function addUserAgent(segment: string, version?: string): void { - transporter.userAgent.add({ segment, version }); - } - - return { - addUserAgent, - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param del - The del object. - * @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param del.parameters - Query parameters to be applied to the current query. - * @param del.body - The parameters to send with the custom request. - */ - del( - { path, parameters, body }: DelProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `del`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Get predictions, properties (raw, computed or custom) and segments (computed or custom) for a user profile. - * - * @summary Get user profile. - * @param fetchUserProfile - The fetchUserProfile object. - * @param fetchUserProfile.userID - User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). - * @param fetchUserProfile.params - The params object. - */ - fetchUserProfile( - { userID, params }: FetchUserProfileProps, - requestOptions?: RequestOptions - ): Promise { - if (!userID) { - throw new Error( - 'Parameter `userID` is required when calling `fetchUserProfile`.' - ); - } - - if (!params) { - throw new Error( - 'Parameter `params` is required when calling `fetchUserProfile`.' - ); - } - - const requestPath = '/1/users/{userID}/fetch'.replace( - '{userID}', - encodeURIComponent(userID) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: params, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param get - The get object. - * @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param get.parameters - Query parameters to be applied to the current query. - */ - get( - { path, parameters }: GetProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `get`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param post - The post object. - * @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param post.parameters - Query parameters to be applied to the current query. - * @param post.body - The parameters to send with the custom request. - */ - post( - { path, parameters, body }: PostProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `post`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param put - The put object. - * @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param put.parameters - Query parameters to be applied to the current query. - * @param put.body - The parameters to send with the custom request. - */ - put( - { path, parameters, body }: PutProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `put`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - }; -} - -export type PredictApi = ReturnType; - -export type DelProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type FetchUserProfileProps = { - /** - * User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). - */ - userID: string; - params: Params; -}; - -export type GetProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; -}; - -export type PostProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type PutProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/tsconfig.json b/clients/algoliasearch-client-javascript/packages/client-predict/tsconfig.json deleted file mode 100644 index 89b2007fbb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-predict/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "dist", - }, - "include": ["src", "model", "builds/node.ts", "builds/browser.ts"], - "exclude": ["dist", "node_modules"] -} diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/.openapi-generator-ignore b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/.openapi-generator-ignore deleted file mode 100644 index a6fb9df9d1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/.openapi-generator-ignore +++ /dev/null @@ -1,8 +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. - -git_push.sh -.gitignore diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/builds/browser.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/builds/browser.ts deleted file mode 100644 index 3026198954..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/builds/browser.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createFallbackableCache, - createBrowserLocalStorageCache, -} from '@experimental-api-clients-automation/client-common'; -import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr'; - -import { - createQuerySuggestionsApi, - apiClientVersion, -} from '../src/querySuggestionsApi'; -import type { QuerySuggestionsApi, Region } from '../src/querySuggestionsApi'; - -export * from '../src/querySuggestionsApi'; - -export function querySuggestionsApi( - appId: string, - apiKey: string, - region: Region, - options?: InitClientOptions -): QuerySuggestionsApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - if (!region) { - throw new Error('`region` is missing.'); - } - - return createQuerySuggestionsApi({ - appId, - apiKey, - region, - timeouts: { - connect: 1, - read: 2, - write: 30, - }, - requester: options?.requester ?? createXhrRequester(), - userAgents: [{ segment: 'Browser' }], - authMode: 'WithinQueryParameters', - responsesCache: options?.responsesCache ?? createMemoryCache(), - requestsCache: - options?.requestsCache ?? createMemoryCache({ serializable: false }), - hostsCache: - options?.hostsCache ?? - createFallbackableCache({ - caches: [ - createBrowserLocalStorageCache({ - key: `${apiClientVersion}-${appId}`, - }), - createMemoryCache(), - ], - }), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/builds/node.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/builds/node.ts deleted file mode 100644 index 1f2c18879a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/builds/node.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createNullCache, -} from '@experimental-api-clients-automation/client-common'; -import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http'; - -import { createQuerySuggestionsApi } from '../src/querySuggestionsApi'; -import type { QuerySuggestionsApi, Region } from '../src/querySuggestionsApi'; - -export * from '../src/querySuggestionsApi'; - -export function querySuggestionsApi( - appId: string, - apiKey: string, - region: Region, - options?: InitClientOptions -): QuerySuggestionsApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - if (!region) { - throw new Error('`region` is missing.'); - } - - return createQuerySuggestionsApi({ - appId, - apiKey, - region, - timeouts: { - connect: 2, - read: 5, - write: 30, - }, - requester: options?.requester ?? createHttpRequester(), - userAgents: [{ segment: 'Node.js', version: process.versions.node }], - responsesCache: options?.responsesCache ?? createNullCache(), - requestsCache: options?.requestsCache ?? createNullCache(), - hostsCache: options?.hostsCache ?? createMemoryCache(), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/index.d.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/index.d.ts deleted file mode 100644 index 8b0a7c887a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-unresolved -export * from './dist/builds/node'; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/index.js b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/index.js deleted file mode 100644 index 4b29b9aafd..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-commonjs,import/extensions -module.exports = require('./dist/client-query-suggestions.cjs.node.js'); diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/errorBase.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/errorBase.ts deleted file mode 100644 index a533aa7a15..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/errorBase.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Error. - */ -export type ErrorBase = { - message?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/indexName.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/indexName.ts deleted file mode 100644 index 37c585d5b4..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/indexName.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type IndexName = { - /** - * Index name to target. - */ - indexName: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/logFile.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/logFile.ts deleted file mode 100644 index 1dac57b5d2..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/logFile.ts +++ /dev/null @@ -1,20 +0,0 @@ -export type LogFile = { - /** - * Date and time of creation of the record. - */ - timestamp: string; - /** - * Type of the record, can be one of three values (INFO, SKIP or ERROR). - */ - level: LogFileLevel; - /** - * Detailed description of what happened. - */ - message: string; - /** - * Indicates the hierarchy of the records. For example, a record with contextLevel=1 belongs to a preceding record with contextLevel=0. - */ - contextLevel: number; -}; - -export type LogFileLevel = 'ERROR' | 'INFO' | 'SKIP'; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/models.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/models.ts deleted file mode 100644 index ee3ef78cff..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/models.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './errorBase'; -export * from './indexName'; -export * from './logFile'; -export * from './querySuggestionsIndex'; -export * from './querySuggestionsIndexParam'; -export * from './querySuggestionsIndexWithIndexParam'; -export * from './sourceIndex'; -export * from './sourceIndexExternal'; -export * from './sourceIndiceWithReplicas'; -export * from './status'; -export * from './sucessResponse'; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/querySuggestionsIndex.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/querySuggestionsIndex.ts deleted file mode 100644 index 74ce2d5475..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/querySuggestionsIndex.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { SourceIndiceWithReplicas } from './sourceIndiceWithReplicas'; - -export type QuerySuggestionsIndex = { - /** - * Index name to target. - */ - indexName: string; - /** - * List of source indices used to generate a Query Suggestions index. - */ - sourceIndices: SourceIndiceWithReplicas[]; - /** - * De-duplicate singular and plural suggestions. For example, let\'s say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain. - */ - languages: string[]; - /** - * List of words and patterns to exclude from the Query Suggestions index. - */ - exclude: string[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/querySuggestionsIndexParam.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/querySuggestionsIndexParam.ts deleted file mode 100644 index dfb47b2070..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/querySuggestionsIndexParam.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { SourceIndex } from './sourceIndex'; - -export type QuerySuggestionsIndexParam = { - /** - * List of source indices used to generate a Query Suggestions index. - */ - sourceIndices: SourceIndex[]; - /** - * De-duplicate singular and plural suggestions. For example, let\'s say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain. - */ - languages?: string[]; - /** - * List of words and patterns to exclude from the Query Suggestions index. - */ - exclude?: string[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/querySuggestionsIndexWithIndexParam.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/querySuggestionsIndexWithIndexParam.ts deleted file mode 100644 index cd9ba12854..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/querySuggestionsIndexWithIndexParam.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { IndexName } from './indexName'; -import type { QuerySuggestionsIndexParam } from './querySuggestionsIndexParam'; - -export type QuerySuggestionsIndexWithIndexParam = IndexName & - QuerySuggestionsIndexParam; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndex.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndex.ts deleted file mode 100644 index 7a2450b90c..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndex.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { SourceIndexExternal } from './sourceIndexExternal'; - -export type SourceIndex = { - /** - * Source index name. - */ - indexName: string; - /** - * List of analytics tags to filter the popular searches per tag. - */ - analyticsTags?: string[]; - /** - * List of facets to define as categories for the query suggestions. - */ - facets?: Array>; - /** - * Minimum number of hits (e.g., matching records in the source index) to generate a suggestions. - */ - minHits?: number; - /** - * Minimum number of required letters for a suggestion to remain. - */ - minLetters?: number; - /** - * List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC). - */ - generate?: string[][]; - /** - * List of external indices to use to generate custom Query Suggestions. - */ - external?: SourceIndexExternal[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndexExternal.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndexExternal.ts deleted file mode 100644 index d334668c52..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndexExternal.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type SourceIndexExternal = { - /** - * The suggestion you would like to add. - */ - query: string; - /** - * The measure of the suggestion relative popularity. - */ - count: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndiceWithReplicas.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndiceWithReplicas.ts deleted file mode 100644 index 0c3601e84a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndiceWithReplicas.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { SourceIndexExternal } from './sourceIndexExternal'; - -/** - * Source indice with replicas used to generate a Query Suggestions index. - */ -export type SourceIndiceWithReplicas = { - /** - * True if the Query Suggestions index is a replicas. - */ - replicas: boolean; - /** - * Source index name. - */ - indexName: string; - /** - * List of analytics tags to filter the popular searches per tag. - */ - analyticsTags: string[]; - /** - * List of facets to define as categories for the query suggestions. - */ - facets: Array>; - /** - * Minimum number of hits (e.g., matching records in the source index) to generate a suggestions. - */ - minHits: number; - /** - * Minimum number of required letters for a suggestion to remain. - */ - minLetters: number; - /** - * List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC). - */ - generate: string[][]; - /** - * List of external indices to use to generate custom Query Suggestions. - */ - external: SourceIndexExternal[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/status.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/status.ts deleted file mode 100644 index 1e2048b9d0..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/status.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type Status = { - /** - * The targeted index name. - */ - indexName: string; - /** - * True if the Query Suggestions index is running. - */ - isRunning: boolean; - /** - * Date and time of the last build. - */ - lastBuiltAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sucessResponse.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sucessResponse.ts deleted file mode 100644 index 841e28fdb3..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sucessResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type SucessResponse = { - /** - * The status code. - */ - status: number; - /** - * Message of the response. - */ - message: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/package.json b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/package.json deleted file mode 100644 index bee4368f7a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@experimental-api-clients-automation/client-query-suggestions", - "version": "0.0.5", - "description": "JavaScript client for @experimental-api-clients-automation/client-query-suggestions", - "repository": "algolia/algoliasearch-client-javascript", - "author": "Algolia", - "license": "MIT", - "main": "index.js", - "module": "dist/client-query-suggestions.esm.node.js", - "types": "index.d.ts", - "jsdelivr": "dist/client-query-suggestions.umd.browser.js", - "unpkg": "dist/client-query-suggestions.umd.browser.js", - "browser": "dist/client-query-suggestions.cjs.browser.js", - "scripts": { - "clean": "rm -rf ./dist" - }, - "files": [ - "dist", - "model", - "index.js", - "index.d.ts" - ], - "engines": { - "node": ">= 14.0.0" - }, - "dependencies": { - "@experimental-api-clients-automation/client-common": "0.0.5", - "@experimental-api-clients-automation/requester-browser-xhr": "0.0.5", - "@experimental-api-clients-automation/requester-node-http": "0.0.5" - }, - "devDependencies": { - "@types/node": "16.11.26", - "typescript": "4.6.3" - } -} diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsApi.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsApi.ts deleted file mode 100644 index 4de6a6e909..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsApi.ts +++ /dev/null @@ -1,579 +0,0 @@ -import { - createAuth, - createTransporter, - getUserAgent, -} from '@experimental-api-clients-automation/client-common'; -import type { - CreateClientOptions, - Headers, - Host, - Request, - RequestOptions, - QueryParameters, -} from '@experimental-api-clients-automation/client-common'; - -import type { LogFile } from '../model/logFile'; -import type { QuerySuggestionsIndex } from '../model/querySuggestionsIndex'; -import type { QuerySuggestionsIndexParam } from '../model/querySuggestionsIndexParam'; -import type { QuerySuggestionsIndexWithIndexParam } from '../model/querySuggestionsIndexWithIndexParam'; -import type { Status } from '../model/status'; -import type { SucessResponse } from '../model/sucessResponse'; - -export * from '../model/models'; -export const apiClientVersion = '0.0.5'; - -export type Region = 'eu' | 'us'; - -function getDefaultHosts(region: Region): Host[] { - return [ - { - url: `query-suggestions.${region}.algolia.com`, - accept: 'readWrite', - protocol: 'https', - }, - ]; -} - -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -export function createQuerySuggestionsApi( - options: CreateClientOptions & { region: Region } -) { - const auth = createAuth(options.appId, options.apiKey, options.authMode); - const transporter = createTransporter({ - hosts: options?.hosts ?? getDefaultHosts(options.region), - hostsCache: options.hostsCache, - requestsCache: options.requestsCache, - responsesCache: options.responsesCache, - baseHeaders: { - 'content-type': 'application/x-www-form-urlencoded', - ...auth.headers(), - }, - baseQueryParameters: auth.queryParameters(), - userAgent: getUserAgent({ - userAgents: options.userAgents, - client: 'QuerySuggestions', - version: apiClientVersion, - }), - timeouts: options.timeouts, - requester: options.requester, - }); - - function addUserAgent(segment: string, version?: string): void { - transporter.userAgent.add({ segment, version }); - } - - return { - addUserAgent, - /** - * Create a configuration of a Query Suggestions index. There\'s a limit of 100 configurations per application. - * - * @summary Create a configuration of a Query Suggestions index. - * @param querySuggestionsIndexWithIndexParam - The querySuggestionsIndexWithIndexParam object. - */ - createConfig( - querySuggestionsIndexWithIndexParam: QuerySuggestionsIndexWithIndexParam, - requestOptions?: RequestOptions - ): Promise { - if (!querySuggestionsIndexWithIndexParam) { - throw new Error( - 'Parameter `querySuggestionsIndexWithIndexParam` is required when calling `createConfig`.' - ); - } - - const requestPath = '/1/configs'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: querySuggestionsIndexWithIndexParam, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param del - The del object. - * @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param del.parameters - Query parameters to be applied to the current query. - * @param del.body - The parameters to send with the custom request. - */ - del( - { path, parameters, body }: DelProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `del`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Delete a configuration of a Query Suggestion\'s index. By deleting a configuraton, you stop all updates to the underlying query suggestion index. Note that when doing this, the underlying index does not change - existing suggestions remain untouched. - * - * @summary Delete a configuration of a Query Suggestion\'s index. - * @param deleteConfig - The deleteConfig object. - * @param deleteConfig.indexName - The index in which to perform the request. - */ - deleteConfig( - { indexName }: DeleteConfigProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `deleteConfig`.' - ); - } - - const requestPath = '/1/configs/{indexName}'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param get - The get object. - * @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param get.parameters - Query parameters to be applied to the current query. - */ - get( - { path, parameters }: GetProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `get`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Get all the configurations of Query Suggestions. For each index, you get a block of JSON with a list of its configuration settings. - * - * @summary Get all the configurations of Query Suggestions. - */ - getAllConfigs( - requestOptions?: RequestOptions - ): Promise { - const requestPath = '/1/configs'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Get the configuration of a single Query Suggestions index. - * - * @summary Get the configuration of a single Query Suggestions index. - * @param getConfig - The getConfig object. - * @param getConfig.indexName - The index in which to perform the request. - */ - getConfig( - { indexName }: GetConfigProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `getConfig`.' - ); - } - - const requestPath = '/1/configs/{indexName}'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Get the status of a Query Suggestion\'s index. The status includes whether the Query Suggestions index is currently in the process of being built, and the last build time. - * - * @summary Get the status of a Query Suggestion\'s index. - * @param getConfigStatus - The getConfigStatus object. - * @param getConfigStatus.indexName - The index in which to perform the request. - */ - getConfigStatus( - { indexName }: GetConfigStatusProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `getConfigStatus`.' - ); - } - - const requestPath = '/1/configs/{indexName}/status'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Get the log file of the last build of a single Query Suggestion index. - * - * @summary Get the log file of the last build of a single Query Suggestion index. - * @param getLogFile - The getLogFile object. - * @param getLogFile.indexName - The index in which to perform the request. - */ - getLogFile( - { indexName }: GetLogFileProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `getLogFile`.' - ); - } - - const requestPath = '/1/logs/{indexName}'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param post - The post object. - * @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param post.parameters - Query parameters to be applied to the current query. - * @param post.body - The parameters to send with the custom request. - */ - post( - { path, parameters, body }: PostProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `post`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param put - The put object. - * @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param put.parameters - Query parameters to be applied to the current query. - * @param put.body - The parameters to send with the custom request. - */ - put( - { path, parameters, body }: PutProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `put`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Update the configuration of a Query Suggestions index. - * - * @summary Update the configuration of a Query Suggestions index. - * @param updateConfig - The updateConfig object. - * @param updateConfig.indexName - The index in which to perform the request. - * @param updateConfig.querySuggestionsIndexParam - The querySuggestionsIndexParam object. - */ - updateConfig( - { indexName, querySuggestionsIndexParam }: UpdateConfigProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `updateConfig`.' - ); - } - - if (!querySuggestionsIndexParam) { - throw new Error( - 'Parameter `querySuggestionsIndexParam` is required when calling `updateConfig`.' - ); - } - - if (!querySuggestionsIndexParam.sourceIndices) { - throw new Error( - 'Parameter `querySuggestionsIndexParam.sourceIndices` is required when calling `updateConfig`.' - ); - } - - const requestPath = '/1/configs/{indexName}'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - data: querySuggestionsIndexParam, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - }; -} - -export type QuerySuggestionsApi = ReturnType; - -export type DelProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type DeleteConfigProps = { - /** - * The index in which to perform the request. - */ - indexName: string; -}; - -export type GetProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; -}; - -export type GetConfigProps = { - /** - * The index in which to perform the request. - */ - indexName: string; -}; - -export type GetConfigStatusProps = { - /** - * The index in which to perform the request. - */ - indexName: string; -}; - -export type GetLogFileProps = { - /** - * The index in which to perform the request. - */ - indexName: string; -}; - -export type PostProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type PutProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type UpdateConfigProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - querySuggestionsIndexParam: QuerySuggestionsIndexParam; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/tsconfig.json b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/tsconfig.json deleted file mode 100644 index 89b2007fbb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "dist", - }, - "include": ["src", "model", "builds/node.ts", "builds/browser.ts"], - "exclude": ["dist", "node_modules"] -} diff --git a/clients/algoliasearch-client-javascript/packages/client-search/.openapi-generator-ignore b/clients/algoliasearch-client-javascript/packages/client-search/.openapi-generator-ignore deleted file mode 100644 index a6fb9df9d1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/.openapi-generator-ignore +++ /dev/null @@ -1,8 +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. - -git_push.sh -.gitignore diff --git a/clients/algoliasearch-client-javascript/packages/client-search/builds/browser.ts b/clients/algoliasearch-client-javascript/packages/client-search/builds/browser.ts deleted file mode 100644 index 142f48d8e0..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/builds/browser.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createFallbackableCache, - createBrowserLocalStorageCache, -} from '@experimental-api-clients-automation/client-common'; -import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr'; - -import { createSearchApi, apiClientVersion } from '../src/searchApi'; -import type { SearchApi } from '../src/searchApi'; - -export * from '../src/searchApi'; - -export function searchApi( - appId: string, - apiKey: string, - options?: InitClientOptions -): SearchApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - return createSearchApi({ - appId, - apiKey, - timeouts: { - connect: 1, - read: 2, - write: 30, - }, - requester: options?.requester ?? createXhrRequester(), - userAgents: [{ segment: 'Browser' }], - authMode: 'WithinQueryParameters', - responsesCache: options?.responsesCache ?? createMemoryCache(), - requestsCache: - options?.requestsCache ?? createMemoryCache({ serializable: false }), - hostsCache: - options?.hostsCache ?? - createFallbackableCache({ - caches: [ - createBrowserLocalStorageCache({ - key: `${apiClientVersion}-${appId}`, - }), - createMemoryCache(), - ], - }), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-search/builds/node.ts b/clients/algoliasearch-client-javascript/packages/client-search/builds/node.ts deleted file mode 100644 index 2f1d3eaa7c..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/builds/node.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createNullCache, -} from '@experimental-api-clients-automation/client-common'; -import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http'; - -import { createSearchApi } from '../src/searchApi'; -import type { SearchApi } from '../src/searchApi'; - -export * from '../src/searchApi'; - -export function searchApi( - appId: string, - apiKey: string, - options?: InitClientOptions -): SearchApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - return createSearchApi({ - appId, - apiKey, - timeouts: { - connect: 2, - read: 5, - write: 30, - }, - requester: options?.requester ?? createHttpRequester(), - userAgents: [{ segment: 'Node.js', version: process.versions.node }], - responsesCache: options?.responsesCache ?? createNullCache(), - requestsCache: options?.requestsCache ?? createNullCache(), - hostsCache: options?.hostsCache ?? createMemoryCache(), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-search/index.d.ts b/clients/algoliasearch-client-javascript/packages/client-search/index.d.ts deleted file mode 100644 index 8b0a7c887a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-unresolved -export * from './dist/builds/node'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/index.js b/clients/algoliasearch-client-javascript/packages/client-search/index.js deleted file mode 100644 index bd9ffc6c0a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-commonjs,import/extensions -module.exports = require('./dist/client-search.cjs.node.js'); diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/acl.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/acl.ts deleted file mode 100644 index f1cf7fd90d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/acl.ts +++ /dev/null @@ -1,15 +0,0 @@ -export type Acl = - | 'addObject' - | 'analytics' - | 'browse' - | 'deleteIndex' - | 'deleteObject' - | 'editSettings' - | 'listIndexes' - | 'logs' - | 'personalization' - | 'recommendation' - | 'search' - | 'seeUnretrievableAttributes' - | 'settings' - | 'usage'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/action.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/action.ts deleted file mode 100644 index 7f1a4fb16b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/action.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Type of operation. - */ - -export type Action = - | 'addObject' - | 'clear' - | 'delete' - | 'deleteObject' - | 'partialUpdateObject' - | 'partialUpdateObjectNoCreate' - | 'updateObject'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/addApiKeyResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/addApiKeyResponse.ts deleted file mode 100644 index 10dfae24e7..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/addApiKeyResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type AddApiKeyResponse = { - /** - * Key string. - */ - key: string; - /** - * Date of creation (ISO-8601 format). - */ - createdAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/anchoring.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/anchoring.ts deleted file mode 100644 index 80d51f78be..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/anchoring.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Whether the pattern parameter must match the beginning or the end of the query string, or both, or none. - */ - -export type Anchoring = 'contains' | 'endsWith' | 'is' | 'startsWith'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/apiKey.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/apiKey.ts deleted file mode 100644 index 5ad4a42d1d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/apiKey.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { Acl } from './acl'; - -/** - * Api Key object. - */ -export type ApiKey = { - /** - * Set of permissions associated with the key. - */ - acl: Acl[]; - /** - * A comment used to identify a key more easily in the dashboard. It is not interpreted by the API. - */ - description?: string; - /** - * Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed. - */ - indexes?: string[]; - /** - * Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. - */ - maxHitsPerQuery?: number; - /** - * Maximum number of API calls per hour allowed from a given IP address or a user token. - */ - maxQueriesPerIPPerHour?: number; - /** - * URL-encoded query string. Force some query parameters to be applied for each query made with this API key. - */ - queryParameters?: string; - /** - * Restrict this new API key to specific referers. If empty or blank, defaults to all referers. - */ - referers?: string[]; - /** - * Validity limit for this key in seconds. The key will automatically be removed after this period of time. - */ - validity?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/aroundRadius.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/aroundRadius.ts deleted file mode 100644 index 929d3c0fba..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/aroundRadius.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AroundRadiusOneOf } from './aroundRadiusOneOf'; - -export type AroundRadius = AroundRadiusOneOf | number; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/aroundRadiusOneOf.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/aroundRadiusOneOf.ts deleted file mode 100644 index b737491ab2..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/aroundRadiusOneOf.ts +++ /dev/null @@ -1 +0,0 @@ -export type AroundRadiusOneOf = 'all'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/assignUserIdParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/assignUserIdParams.ts deleted file mode 100644 index 638f8f37d3..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/assignUserIdParams.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Assign userID parameters. - */ -export type AssignUserIdParams = { - /** - * Name of the cluster. - */ - cluster: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/attributeOrBuiltInOperation.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/attributeOrBuiltInOperation.ts deleted file mode 100644 index 77a50a18bd..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/attributeOrBuiltInOperation.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { BuiltInOperation } from './builtInOperation'; - -export type AttributeOrBuiltInOperation = BuiltInOperation | string; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/automaticFacetFilter.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/automaticFacetFilter.ts deleted file mode 100644 index ae2749c171..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/automaticFacetFilter.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Automatic facet Filter. - */ -export type AutomaticFacetFilter = { - /** - * Attribute to filter on. This must match a facet placeholder in the Rule\'s pattern. - */ - facet: string; - /** - * Score for the filter. Typically used for optional or disjunctive filters. - */ - score?: number; - /** - * Whether the filter is disjunctive (true) or conjunctive (false). - */ - disjunctive?: boolean; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/baseBrowseResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/baseBrowseResponse.ts deleted file mode 100644 index 206e1dc700..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/baseBrowseResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type BaseBrowseResponse = { - /** - * Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. - */ - cursor: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/baseIndexSettings.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/baseIndexSettings.ts deleted file mode 100644 index 36e8463b2f..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/baseIndexSettings.ts +++ /dev/null @@ -1,50 +0,0 @@ -export type BaseIndexSettings = { - /** - * Creates replicas, exact copies of an index. - */ - replicas?: string[]; - /** - * Set the maximum number of hits accessible via pagination. - */ - paginationLimitedTo?: number; - /** - * A list of words for which you want to turn off typo tolerance. - */ - disableTypoToleranceOnWords?: string[]; - /** - * Specify on which attributes to apply transliteration. - */ - attributesToTransliterate?: string[]; - /** - * List of attributes on which to do a decomposition of camel case words. - */ - camelCaseAttributes?: string[]; - /** - * Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding. - */ - decompoundedAttributes?: Record; - /** - * Sets the languages at the index level for language-specific processing such as tokenization and normalization. - */ - indexLanguages?: string[]; - /** - * Whether promoted results should match the filters of the current search, except for geographic filters. - */ - filterPromotes?: boolean; - /** - * List of attributes on which you want to disable prefix matching. - */ - disablePrefixOnAttributes?: string[]; - /** - * Enables compression of large integer arrays. - */ - allowCompressionOfIntegerArray?: boolean; - /** - * List of numeric attributes that can be used as numerical filters. - */ - numericAttributesForFiltering?: string[]; - /** - * Lets you store custom data in your indices. - */ - userData?: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchParams.ts deleted file mode 100644 index 77631535de..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchParams.ts +++ /dev/null @@ -1,129 +0,0 @@ -import type { AroundRadius } from './aroundRadius'; - -export type BaseSearchParams = { - /** - * Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. - */ - similarQuery?: string; - /** - * Filter the query with numeric, facet and/or tag filters. - */ - filters?: string; - /** - * Filter hits by facet value. - */ - facetFilters?: string[]; - /** - * Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. - */ - optionalFilters?: string[]; - /** - * Filter on numeric attributes. - */ - numericFilters?: string[]; - /** - * Filter hits by tags. - */ - tagFilters?: string[]; - /** - * Determines how to calculate the total score for filtering. - */ - sumOrFiltersScores?: boolean; - /** - * Retrieve facets and their facet values. - */ - facets?: string[]; - /** - * Maximum number of facet values to return for each facet during a regular search. - */ - maxValuesPerFacet?: number; - /** - * Force faceting to be applied after de-duplication (via the Distinct setting). - */ - facetingAfterDistinct?: boolean; - /** - * Controls how facet values are fetched. - */ - sortFacetValuesBy?: string; - /** - * Specify the page to retrieve. - */ - page?: number; - /** - * Specify the offset of the first hit to return. - */ - offset?: number; - /** - * Set the number of hits to retrieve (used only with offset). - */ - length?: number; - /** - * Search for entries around a central geolocation, enabling a geo search within a circular area. - */ - aroundLatLng?: string; - /** - * Search for entries around a given location automatically computed from the requester\'s IP address. - */ - aroundLatLngViaIP?: boolean; - aroundRadius?: AroundRadius; - /** - * Precision of geo search (in meters), to add grouping by geo location to the ranking formula. - */ - aroundPrecision?: number; - /** - * Minimum radius (in meters) used for a geo search when aroundRadius is not set. - */ - minimumAroundRadius?: number; - /** - * Search inside a rectangular area (in geo coordinates). - */ - insideBoundingBox?: number[]; - /** - * Search inside a polygon (in geo coordinates). - */ - insidePolygon?: number[]; - /** - * 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. - */ - naturalLanguages?: string[]; - /** - * Enables contextual rules. - */ - ruleContexts?: string[]; - /** - * Define the impact of the Personalization feature. - */ - personalizationImpact?: number; - /** - * Associates a certain user token with the current search. - */ - userToken?: string; - /** - * Retrieve detailed ranking information. - */ - getRankingInfo?: boolean; - /** - * Enable the Click Analytics feature. - */ - clickAnalytics?: boolean; - /** - * Whether the current query will be taken into account in the Analytics. - */ - analytics?: boolean; - /** - * List of tags to apply to the query for analytics purposes. - */ - analyticsTags?: string[]; - /** - * Whether to include or exclude a query from the processing-time percentile computation. - */ - percentileComputation?: boolean; - /** - * Whether this search should participate in running AB tests. - */ - enableABTest?: boolean; - /** - * Whether this search should use AI Re-Ranking. - */ - enableReRanking?: boolean; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchResponse.ts deleted file mode 100644 index 358556c692..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchResponse.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type { BaseSearchResponseFacetsStats } from './baseSearchResponseFacetsStats'; - -export type BaseSearchResponse = { - /** - * If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID. - */ - abTestID?: number; - /** - * If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used. - */ - abTestVariantID?: number; - /** - * The computed geo location. - */ - aroundLatLng?: string; - /** - * The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. - */ - automaticRadius?: string; - /** - * Whether the facet count is exhaustive or approximate. - */ - exhaustiveFacetsCount?: boolean; - /** - * Indicate if the nbHits count was exhaustive or approximate. - */ - exhaustiveNbHits: boolean; - /** - * Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled). - */ - exhaustiveTypo: boolean; - /** - * A mapping of each facet name to the corresponding facet counts. - */ - facets?: { [key: string]: { [key: string]: string } }; - /** - * Statistics for numerical facets. - */ - facets_stats?: { [key: string]: BaseSearchResponseFacetsStats }; - /** - * Set the number of hits per page. - */ - hitsPerPage: number; - /** - * Index name used for the query. - */ - index?: string; - /** - * 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. - */ - indexUsed?: string; - /** - * Used to return warnings about the query. - */ - message?: string; - /** - * Number of hits that the search query matched. - */ - nbHits: number; - /** - * Number of pages available for the current query. - */ - nbPages: number; - /** - * The number of hits selected and sorted by the relevant sort algorithm. - */ - nbSortedHits?: number; - /** - * Specify the page to retrieve. - */ - page: number; - /** - * A url-encoded string of all search parameters. - */ - params: string; - /** - * The query string that will be searched, after normalization. - */ - parsedQuery?: string; - /** - * Time the server took to process the request, in milliseconds. - */ - processingTimeMS: number; - /** - * The text to search in the index. - */ - query: string; - /** - * A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. - */ - queryAfterRemoval?: string; - /** - * Actual host name of the server that processed the request. - */ - serverUsed?: string; - /** - * Lets you store custom data in your indices. - */ - userData?: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchResponseFacetsStats.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchResponseFacetsStats.ts deleted file mode 100644 index 4c4ceb7bc7..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchResponseFacetsStats.ts +++ /dev/null @@ -1,18 +0,0 @@ -export type BaseSearchResponseFacetsStats = { - /** - * The minimum value in the result set. - */ - min?: number; - /** - * The maximum value in the result set. - */ - max?: number; - /** - * The average facet value in the result set. - */ - avg?: number; - /** - * The sum of all values in the result set. - */ - sum?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/batchAssignUserIdsParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/batchAssignUserIdsParams.ts deleted file mode 100644 index 96a6c0756a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/batchAssignUserIdsParams.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Assign userID parameters. - */ -export type BatchAssignUserIdsParams = { - /** - * Name of the cluster. - */ - cluster: string; - /** - * UserIDs to assign. Note you cannot move users with this method. - */ - users: string[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/batchDictionaryEntriesParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/batchDictionaryEntriesParams.ts deleted file mode 100644 index 03a9a91be6..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/batchDictionaryEntriesParams.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { BatchDictionaryEntriesRequest } from './batchDictionaryEntriesRequest'; - -/** - * The `batchDictionaryEntries` parameters. - */ -export type BatchDictionaryEntriesParams = { - /** - * When `true`, start the batch by removing all the custom entries from the dictionary. - */ - clearExistingDictionaryEntries?: boolean; - /** - * List of operations to batch. Each operation is described by an `action` and a `body`. - */ - requests: BatchDictionaryEntriesRequest[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/batchDictionaryEntriesRequest.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/batchDictionaryEntriesRequest.ts deleted file mode 100644 index 49ec3569cd..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/batchDictionaryEntriesRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { DictionaryAction } from './dictionaryAction'; -import type { DictionaryEntry } from './dictionaryEntry'; - -export type BatchDictionaryEntriesRequest = { - action: DictionaryAction; - body: DictionaryEntry; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/batchOperation.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/batchOperation.ts deleted file mode 100644 index ae3679e0fe..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/batchOperation.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Action } from './action'; - -export type BatchOperation = { - action?: Action; - /** - * Arguments to the operation (depends on the type of the operation). - */ - body?: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/batchParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/batchParams.ts deleted file mode 100644 index e58a54c5d5..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/batchParams.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { MultipleBatchOperation } from './multipleBatchOperation'; - -/** - * The `multipleBatch` parameters. - */ -export type BatchParams = { - requests?: MultipleBatchOperation[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/batchResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/batchResponse.ts deleted file mode 100644 index 28521ba212..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/batchResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type BatchResponse = { - /** - * TaskID of the task to wait for. - */ - taskID?: number; - /** - * List of objectID. - */ - objectIDs?: string[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/batchWriteParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/batchWriteParams.ts deleted file mode 100644 index 33035eb2f2..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/batchWriteParams.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { BatchOperation } from './batchOperation'; - -/** - * The `batch` parameters. - */ -export type BatchWriteParams = { - requests?: BatchOperation[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/browseRequest.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/browseRequest.ts deleted file mode 100644 index 8296b9eaff..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/browseRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type BrowseRequest = { - /** - * Search parameters as URL-encoded query string. - */ - params?: string; - /** - * Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. - */ - cursor?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/browseResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/browseResponse.ts deleted file mode 100644 index 16cf063b37..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/browseResponse.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { BaseBrowseResponse } from './baseBrowseResponse'; -import type { BaseSearchResponse } from './baseSearchResponse'; -import type { SearchHits } from './searchHits'; - -export type BrowseResponse = BaseBrowseResponse & - BaseSearchResponse & - SearchHits; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/builtInOperation.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/builtInOperation.ts deleted file mode 100644 index a65f72e536..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/builtInOperation.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { BuiltInOperationType } from './builtInOperationType'; - -/** - * To update an attribute without pushing the entire record, you can use these built-in operations. - */ -export type BuiltInOperation = { - _operation: BuiltInOperationType; - /** - * The right-hand side argument to the operation, for example, increment or decrement step, value to add or remove. - */ - value: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/builtInOperationType.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/builtInOperationType.ts deleted file mode 100644 index 19fa4de4db..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/builtInOperationType.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * The operation to apply on the attribute. - */ - -export type BuiltInOperationType = - | 'Add' - | 'AddUnique' - | 'Decrement' - | 'Increment' - | 'IncrementFrom' - | 'IncrementSet' - | 'Remove'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/condition.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/condition.ts deleted file mode 100644 index 41db9a3cc1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/condition.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Anchoring } from './anchoring'; - -export type Condition = { - /** - * Query pattern syntax. - */ - pattern?: string; - anchoring?: Anchoring; - /** - * Whether the pattern matches on plurals, synonyms, and typos. - */ - alternatives?: boolean; - /** - * Rule context format: [A-Za-z0-9_-]+). - */ - context?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/consequence.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/consequence.ts deleted file mode 100644 index d738256a8e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/consequence.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { ConsequenceHide } from './consequenceHide'; -import type { ConsequenceParams } from './consequenceParams'; -import type { Promote } from './promote'; - -/** - * Consequence of the Rule. - */ -export type Consequence = { - params?: ConsequenceParams; - /** - * Objects to promote as hits. - */ - promote?: Promote[]; - /** - * 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. - */ - filterPromotes?: boolean; - /** - * Objects to hide from hits. Each object must contain an objectID field. By default, you can hide up to 50 items per rule. - */ - hide?: ConsequenceHide[]; - /** - * 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. - */ - userData?: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/consequenceHide.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/consequenceHide.ts deleted file mode 100644 index 28f87c9c0c..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/consequenceHide.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Unique identifier of the object to hide. - */ -export type ConsequenceHide = { - /** - * Unique identifier of the object. - */ - objectID: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/consequenceParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/consequenceParams.ts deleted file mode 100644 index af531bb25a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/consequenceParams.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { BaseSearchParams } from './baseSearchParams'; -import type { IndexSettingsAsSearchParams } from './indexSettingsAsSearchParams'; -import type { Params } from './params'; - -export type ConsequenceParams = BaseSearchParams & - IndexSettingsAsSearchParams & - Params; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/createdAtObject.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/createdAtObject.ts deleted file mode 100644 index 186db3e688..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/createdAtObject.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type CreatedAtObject = { - /** - * Date of creation (ISO-8601 format). - */ - createdAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/createdAtResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/createdAtResponse.ts deleted file mode 100644 index 5338cfa832..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/createdAtResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * The response with a createdAt timestamp. - */ -export type CreatedAtResponse = { - /** - * Date of creation (ISO-8601 format). - */ - createdAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/deleteApiKeyResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/deleteApiKeyResponse.ts deleted file mode 100644 index 37e9753738..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/deleteApiKeyResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type DeleteApiKeyResponse = { - /** - * Date of deletion (ISO-8601 format). - */ - deletedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/deleteSourceResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/deleteSourceResponse.ts deleted file mode 100644 index 0777b09e59..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/deleteSourceResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type DeleteSourceResponse = { - /** - * Date of deletion (ISO-8601 format). - */ - deletedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/deletedAtResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/deletedAtResponse.ts deleted file mode 100644 index 865074e606..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/deletedAtResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The response with a taskID and a deletedAt timestamp. - */ -export type DeletedAtResponse = { - /** - * TaskID of the task to wait for. - */ - taskID: number; - /** - * Date of deletion (ISO-8601 format). - */ - deletedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryAction.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryAction.ts deleted file mode 100644 index cd9ad65e77..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryAction.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Actions to perform. - */ - -export type DictionaryAction = 'addEntry' | 'deleteEntry'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryEntry.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryEntry.ts deleted file mode 100644 index 4fd672ddbe..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryEntry.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { DictionaryEntryState } from './dictionaryEntryState'; - -/** - * A dictionary entry. - */ -export type DictionaryEntry = { - /** - * Unique identifier of the object. - */ - objectID: string; - /** - * Language ISO code supported by the dictionary (e.g., \"en\" for English). - */ - language: string; - /** - * The word of the dictionary entry. - */ - word?: string; - /** - * The words of the dictionary entry. - */ - words?: string[]; - /** - * A decomposition of the word of the dictionary entry. - */ - decomposition?: string[]; - state?: DictionaryEntryState; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryEntryState.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryEntryState.ts deleted file mode 100644 index 676ad575c2..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryEntryState.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * The state of the dictionary entry. - */ - -export type DictionaryEntryState = 'disabled' | 'enabled'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryLanguage.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryLanguage.ts deleted file mode 100644 index 1f1ba5ea7e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryLanguage.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Custom entries for a dictionary. - */ -export type DictionaryLanguage = { - /** - * When nbCustomEntries is set to 0, the user didn\'t customize the dictionary. The dictionary is still supported with standard, Algolia-provided entries. - */ - nbCustomEntires?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/dictionarySettingsParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/dictionarySettingsParams.ts deleted file mode 100644 index e1a831126e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/dictionarySettingsParams.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { StandardEntries } from './standardEntries'; - -/** - * Disable the builtin Algolia entries for a type of dictionary per language. - */ -export type DictionarySettingsParams = { - disableStandardEntries: StandardEntries; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryType.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryType.ts deleted file mode 100644 index 04ec8ba25c..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryType.ts +++ /dev/null @@ -1 +0,0 @@ -export type DictionaryType = 'compounds' | 'plurals' | 'stopwords'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/errorBase.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/errorBase.ts deleted file mode 100644 index a533aa7a15..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/errorBase.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Error. - */ -export type ErrorBase = { - message?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/getDictionarySettingsResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/getDictionarySettingsResponse.ts deleted file mode 100644 index 98419546a7..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/getDictionarySettingsResponse.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { StandardEntries } from './standardEntries'; - -export type GetDictionarySettingsResponse = { - disableStandardEntries: StandardEntries; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/getLogsResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/getLogsResponse.ts deleted file mode 100644 index 40a3d8adf9..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/getLogsResponse.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { GetLogsResponseLogs } from './getLogsResponseLogs'; - -export type GetLogsResponse = { - logs: GetLogsResponseLogs[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/getLogsResponseInnerQueries.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/getLogsResponseInnerQueries.ts deleted file mode 100644 index 6afe67dc1d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/getLogsResponseInnerQueries.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type GetLogsResponseInnerQueries = { - /** - * Index targeted by the query. - */ - index_name?: string; - /** - * User identifier. - */ - user_token?: string; - /** - * QueryID for the given query. - */ - query_id?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/getLogsResponseLogs.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/getLogsResponseLogs.ts deleted file mode 100644 index 67ec3593a7..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/getLogsResponseLogs.ts +++ /dev/null @@ -1,64 +0,0 @@ -import type { GetLogsResponseInnerQueries } from './getLogsResponseInnerQueries'; - -export type GetLogsResponseLogs = { - /** - * Timestamp in ISO-8601 format. - */ - timestamp: string; - /** - * HTTP method of the perfomed request. - */ - method: string; - /** - * HTTP response code. - */ - answer_code: string; - /** - * Request body. Truncated after 1000 characters. - */ - query_body: string; - /** - * Answer body. Truncated after 1000 characters. - */ - answer: string; - /** - * Request URL. - */ - url: string; - /** - * IP of the client which perfomed the request. - */ - ip: string; - /** - * Request Headers (API Key is obfuscated). - */ - query_headers: string; - /** - * SHA1 signature of the log entry. - */ - sha1: string; - /** - * Number of API calls. - */ - nb_api_calls: string; - /** - * Processing time for the query. It doesn\'t include network time. - */ - processing_time_ms: string; - /** - * Index targeted by the query. - */ - index?: string; - /** - * Query parameters sent with the request. - */ - query_params?: string; - /** - * Number of hits returned for the query. - */ - query_nb_hits?: string; - /** - * Array of all performed queries for the given request. - */ - inner_queries?: GetLogsResponseInnerQueries[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/getObjectsParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/getObjectsParams.ts deleted file mode 100644 index 439032130c..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/getObjectsParams.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { MultipleGetObjectsParams } from './multipleGetObjectsParams'; - -/** - * The `getObjects` parameters. - */ -export type GetObjectsParams = { - requests?: MultipleGetObjectsParams[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/getObjectsResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/getObjectsResponse.ts deleted file mode 100644 index 1c33d6608c..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/getObjectsResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type GetObjectsResponse = { - /** - * List of results fetched. - */ - results?: Array>; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/getTaskResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/getTaskResponse.ts deleted file mode 100644 index a08aabf7a1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/getTaskResponse.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type GetTaskResponse = { - status: GetTaskResponseStatus; -}; - -export type GetTaskResponseStatus = 'notPublished' | 'published'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/getTopUserIdsResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/getTopUserIdsResponse.ts deleted file mode 100644 index 58171c3bca..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/getTopUserIdsResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { UserId } from './userId'; - -/** - * Array of userIDs and clusters. - */ -export type GetTopUserIdsResponse = { - /** - * Mapping of cluster names to top users. - */ - topUsers: Array<{ [key: string]: UserId[] }>; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/highlightResult.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/highlightResult.ts deleted file mode 100644 index a878792c6d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/highlightResult.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Highlighted attributes. - */ -export type HighlightResult = { - /** - * Markup text with occurrences highlighted. - */ - value?: string; - /** - * Indicates how well the attribute matched the search query. - */ - matchLevel?: HighlightResultMatchLevel; - /** - * List of words from the query that matched the object. - */ - matchedWords?: string[]; - /** - * Whether the entire attribute value is highlighted. - */ - fullyHighlighted?: boolean; -}; - -export type HighlightResultMatchLevel = 'full' | 'none' | 'partial'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/hit.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/hit.ts deleted file mode 100644 index 54c8913308..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/hit.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { HighlightResult } from './highlightResult'; -import type { RankingInfo } from './rankingInfo'; -import type { SnippetResult } from './snippetResult'; - -/** - * A single hit. - */ -export type Hit = { - /** - * Unique identifier of the object. - */ - objectID: string; - _highlightResult?: HighlightResult; - _snippetResult?: SnippetResult; - _rankingInfo?: RankingInfo; - _distinctSeqID?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/indexSettings.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/indexSettings.ts deleted file mode 100644 index 056199bbd2..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/indexSettings.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { BaseIndexSettings } from './baseIndexSettings'; -import type { IndexSettingsAsSearchParams } from './indexSettingsAsSearchParams'; - -export type IndexSettings = BaseIndexSettings & IndexSettingsAsSearchParams; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/indexSettingsAsSearchParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/indexSettingsAsSearchParams.ts deleted file mode 100644 index 00a227aa03..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/indexSettingsAsSearchParams.ts +++ /dev/null @@ -1,209 +0,0 @@ -export type IndexSettingsAsSearchParams = { - /** - * The complete list of attributes used for searching. - */ - searchableAttributes?: string[]; - /** - * The complete list of attributes that will be used for faceting. - */ - attributesForFaceting?: string[]; - /** - * List of attributes that can\'t be retrieved at query time. - */ - unretrievableAttributes?: string[]; - /** - * This parameter controls which attributes to retrieve and which not to retrieve. - */ - attributesToRetrieve?: string[]; - /** - * Restricts a given query to look in only a subset of your searchable attributes. - */ - restrictSearchableAttributes?: string[]; - /** - * Controls how Algolia should sort your results. - */ - ranking?: string[]; - /** - * Specifies the custom ranking criterion. - */ - customRanking?: string[]; - /** - * Controls the relevancy threshold below which less relevant results aren\'t included in the results. - */ - relevancyStrictness?: number; - /** - * List of attributes to highlight. - */ - attributesToHighlight?: string[]; - /** - * List of attributes to snippet, with an optional maximum number of words to snippet. - */ - attributesToSnippet?: string[]; - /** - * The HTML string to insert before the highlighted parts in all highlight and snippet results. - */ - highlightPreTag?: string; - /** - * The HTML string to insert after the highlighted parts in all highlight and snippet results. - */ - highlightPostTag?: string; - /** - * String used as an ellipsis indicator when a snippet is truncated. - */ - snippetEllipsisText?: string; - /** - * Restrict highlighting and snippeting to items that matched the query. - */ - restrictHighlightAndSnippetArrays?: boolean; - /** - * Set the number of hits per page. - */ - hitsPerPage?: number; - /** - * Minimum number of characters a word in the query string must contain to accept matches with 1 typo. - */ - minWordSizefor1Typo?: number; - /** - * Minimum number of characters a word in the query string must contain to accept matches with 2 typos. - */ - minWordSizefor2Typos?: number; - /** - * Controls whether typo tolerance is enabled and how it is applied. - */ - typoTolerance?: IndexSettingsAsSearchParamsTypoTolerance; - /** - * Whether to allow typos on numbers (\"numeric tokens\") in the query string. - */ - allowTyposOnNumericTokens?: boolean; - /** - * List of attributes on which you want to disable typo tolerance. - */ - disableTypoToleranceOnAttributes?: string[]; - /** - * Control which separators are indexed. - */ - separatorsToIndex?: string; - /** - * Treats singular, plurals, and other forms of declensions as matching terms. - */ - ignorePlurals?: string; - /** - * Removes stop (common) words from the query before executing it. - */ - removeStopWords?: string; - /** - * List of characters that the engine shouldn\'t automatically normalize. - */ - keepDiacriticsOnCharacters?: string; - /** - * Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. - */ - queryLanguages?: string[]; - /** - * Splits compound words into their composing atoms in the query. - */ - decompoundQuery?: boolean; - /** - * Whether Rules should be globally enabled. - */ - enableRules?: boolean; - /** - * Enable the Personalization feature. - */ - enablePersonalization?: boolean; - /** - * Controls if and how query words are interpreted as prefixes. - */ - queryType?: IndexSettingsAsSearchParamsQueryType; - /** - * Selects a strategy to remove words from the query when it doesn\'t match any hits. - */ - removeWordsIfNoResults?: IndexSettingsAsSearchParamsRemoveWordsIfNoResults; - /** - * Enables the advanced query syntax. - */ - advancedSyntax?: boolean; - /** - * A list of words that should be considered as optional when found in the query. - */ - optionalWords?: string[]; - /** - * List of attributes on which you want to disable the exact ranking criterion. - */ - disableExactOnAttributes?: string[]; - /** - * Controls how the exact ranking criterion is computed when the query contains only one word. - */ - exactOnSingleWordQuery?: IndexSettingsAsSearchParamsExactOnSingleWordQuery; - /** - * List of alternatives that should be considered an exact match by the exact ranking criterion. - */ - alternativesAsExact?: IndexSettingsAsSearchParamsAlternativesAsExact[]; - /** - * Allows you to specify which advanced syntax features are active when ‘advancedSyntax\' is enabled. - */ - advancedSyntaxFeatures?: IndexSettingsAsSearchParamsAdvancedSyntaxFeatures[]; - /** - * Enables de-duplication or grouping of results. - */ - distinct?: number; - /** - * Whether to take into account an index\'s synonyms for a particular search. - */ - synonyms?: boolean; - /** - * Whether to highlight and snippet the original word that matches the synonym or the synonym itself. - */ - replaceSynonymsInHighlight?: boolean; - /** - * Precision of the proximity ranking criterion. - */ - minProximity?: number; - /** - * Choose which fields to return in the API response. This parameters applies to search and browse queries. - */ - responseFields?: string[]; - /** - * 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. - */ - maxFacetHits?: number; - /** - * 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. - */ - attributeCriteriaComputedByMinProximity?: boolean; - /** - * 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. - */ - renderingContent?: Record; -}; - -export type IndexSettingsAsSearchParamsTypoTolerance = - | 'false' - | 'min' - | 'strict' - | 'true'; - -export type IndexSettingsAsSearchParamsQueryType = - | 'prefixAll' - | 'prefixLast' - | 'prefixNone'; - -export type IndexSettingsAsSearchParamsRemoveWordsIfNoResults = - | 'allOptional' - | 'firstWords' - | 'lastWords' - | 'none'; - -export type IndexSettingsAsSearchParamsExactOnSingleWordQuery = - | 'attribute' - | 'none' - | 'word'; - -export type IndexSettingsAsSearchParamsAlternativesAsExact = - | 'ignorePlurals' - | 'multiWordsSynonym' - | 'singleWordSynonym'; - -export type IndexSettingsAsSearchParamsAdvancedSyntaxFeatures = - | 'exactPhrase' - | 'excludeWords'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/indice.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/indice.ts deleted file mode 100644 index b5c963c297..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/indice.ts +++ /dev/null @@ -1,46 +0,0 @@ -export type Indice = { - /** - * Index name. - */ - name: string; - /** - * Index creation date. An empty string means that the index has no records. - */ - createdAt: string; - /** - * Date of last update (ISO-8601 format). - */ - updatedAt: string; - /** - * Number of records contained in the index. - */ - entries: number; - /** - * Number of bytes of the index in minified format. - */ - dataSize: number; - /** - * Number of bytes of the index binary file. - */ - fileSize: number; - /** - * Last build time. - */ - lastBuildTimeS: number; - /** - * Number of pending indexing operations. This value is deprecated and should not be used. - */ - numberOfPendingTask?: number; - /** - * A boolean which says whether the index has pending tasks. This value is deprecated and should not be used. - */ - pendingTask: boolean; - /** - * Only present if the index is a replica. Contains the name of the related primary index. - */ - primary?: string; - /** - * Only present if the index is a primary index with replicas. Contains the names of all linked replicas. - */ - replicas?: string[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/key.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/key.ts deleted file mode 100644 index d85de7bdd2..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/key.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ApiKey } from './apiKey'; -import type { CreatedAtObject } from './createdAtObject'; - -export type Key = ApiKey & CreatedAtObject; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/languages.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/languages.ts deleted file mode 100644 index 618cea65a3..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/languages.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { DictionaryLanguage } from './dictionaryLanguage'; - -/** - * A dictionary language. - */ -export type Languages = { - plurals: DictionaryLanguage | null; - stopwords: DictionaryLanguage | null; - compounds: DictionaryLanguage | null; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/listApiKeysResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/listApiKeysResponse.ts deleted file mode 100644 index 4a3b978db4..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/listApiKeysResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Key } from './key'; - -export type ListApiKeysResponse = { - /** - * List of api keys. - */ - keys: Key[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/listClustersResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/listClustersResponse.ts deleted file mode 100644 index 245e8b9d00..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/listClustersResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Array of clusters. - */ -export type ListClustersResponse = { - /** - * Mapping of cluster names to top users. - */ - topUsers: string[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/listIndicesResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/listIndicesResponse.ts deleted file mode 100644 index c89d4922ff..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/listIndicesResponse.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Indice } from './indice'; - -export type ListIndicesResponse = { - /** - * List of the fetched indices. - */ - items?: Indice[]; - /** - * Number of pages. - */ - nbPages?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/listUserIdsResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/listUserIdsResponse.ts deleted file mode 100644 index c0d9d9c1a9..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/listUserIdsResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { UserId } from './userId'; - -/** - * UserIDs data. - */ -export type ListUserIdsResponse = { - /** - * List of userIDs. - */ - userIDs: UserId[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/logType.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/logType.ts deleted file mode 100644 index e2520137ce..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/logType.ts +++ /dev/null @@ -1 +0,0 @@ -export type LogType = 'all' | 'build' | 'error' | 'query'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/models.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/models.ts deleted file mode 100644 index ee87355266..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/models.ts +++ /dev/null @@ -1,111 +0,0 @@ -export * from './acl'; -export * from './action'; -export * from './addApiKeyResponse'; -export * from './anchoring'; -export * from './apiKey'; -export * from './aroundRadius'; -export * from './aroundRadiusOneOf'; -export * from './assignUserIdParams'; -export * from './attributeOrBuiltInOperation'; -export * from './automaticFacetFilter'; -export * from './baseBrowseResponse'; -export * from './baseIndexSettings'; -export * from './baseSearchParams'; -export * from './baseSearchResponse'; -export * from './baseSearchResponseFacetsStats'; -export * from './batchAssignUserIdsParams'; -export * from './batchDictionaryEntriesParams'; -export * from './batchDictionaryEntriesRequest'; -export * from './batchOperation'; -export * from './batchParams'; -export * from './batchResponse'; -export * from './batchWriteParams'; -export * from './browseRequest'; -export * from './browseResponse'; -export * from './builtInOperation'; -export * from './builtInOperationType'; -export * from './condition'; -export * from './consequence'; -export * from './consequenceHide'; -export * from './consequenceParams'; -export * from './createdAtObject'; -export * from './createdAtResponse'; -export * from './deleteApiKeyResponse'; -export * from './deleteSourceResponse'; -export * from './deletedAtResponse'; -export * from './dictionaryAction'; -export * from './dictionaryEntry'; -export * from './dictionaryEntryState'; -export * from './dictionaryLanguage'; -export * from './dictionarySettingsParams'; -export * from './dictionaryType'; -export * from './errorBase'; -export * from './getDictionarySettingsResponse'; -export * from './getLogsResponse'; -export * from './getLogsResponseInnerQueries'; -export * from './getLogsResponseLogs'; -export * from './getObjectsParams'; -export * from './getObjectsResponse'; -export * from './getTaskResponse'; -export * from './getTopUserIdsResponse'; -export * from './highlightResult'; -export * from './hit'; -export * from './indexSettings'; -export * from './indexSettingsAsSearchParams'; -export * from './indice'; -export * from './key'; -export * from './languages'; -export * from './listApiKeysResponse'; -export * from './listClustersResponse'; -export * from './listIndicesResponse'; -export * from './listUserIdsResponse'; -export * from './logType'; -export * from './multipleBatchOperation'; -export * from './multipleBatchResponse'; -export * from './multipleGetObjectsParams'; -export * from './multipleQueries'; -export * from './multipleQueriesParams'; -export * from './multipleQueriesResponse'; -export * from './multipleQueriesStrategy'; -export * from './multipleQueriesType'; -export * from './operationIndexParams'; -export * from './operationType'; -export * from './params'; -export * from './promote'; -export * from './rankingInfo'; -export * from './rankingInfoMatchedGeoLocation'; -export * from './removeUserIdResponse'; -export * from './replaceSourceResponse'; -export * from './requiredSearchParams'; -export * from './rule'; -export * from './saveObjectResponse'; -export * from './saveSynonymResponse'; -export * from './scopeType'; -export * from './searchDictionaryEntriesParams'; -export * from './searchForFacetValuesRequest'; -export * from './searchForFacetValuesResponse'; -export * from './searchForFacetValuesResponseFacetHits'; -export * from './searchHits'; -export * from './searchParams'; -export * from './searchParamsObject'; -export * from './searchParamsString'; -export * from './searchResponse'; -export * from './searchRulesParams'; -export * from './searchRulesResponse'; -export * from './searchSynonymsResponse'; -export * from './searchUserIdsParams'; -export * from './searchUserIdsResponse'; -export * from './searchUserIdsResponseHighlightResult'; -export * from './searchUserIdsResponseHits'; -export * from './snippetResult'; -export * from './source'; -export * from './standardEntries'; -export * from './synonymHit'; -export * from './synonymHitHighlightResult'; -export * from './synonymType'; -export * from './timeRange'; -export * from './updateApiKeyResponse'; -export * from './updatedAtResponse'; -export * from './updatedAtWithObjectIdResponse'; -export * from './updatedRuleResponse'; -export * from './userId'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleBatchOperation.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/multipleBatchOperation.ts deleted file mode 100644 index 59437910af..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleBatchOperation.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Action } from './action'; - -export type MultipleBatchOperation = { - action?: Action; - /** - * Arguments to the operation (depends on the type of the operation). - */ - body?: Record; - /** - * Index to target for this operation. - */ - indexName?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleBatchResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/multipleBatchResponse.ts deleted file mode 100644 index 09863f02bd..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleBatchResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type MultipleBatchResponse = { - /** - * List of tasksIDs per index. - */ - taskID?: Record; - /** - * List of objectID. - */ - objectIDs?: string[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleGetObjectsParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/multipleGetObjectsParams.ts deleted file mode 100644 index 0779eac6d1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleGetObjectsParams.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * GetObjects operation on an index. - */ -export type MultipleGetObjectsParams = { - /** - * List of attributes to retrieve. By default, all retrievable attributes are returned. - */ - attributesToRetrieve?: string[]; - /** - * ID of the object within that index. - */ - objectID: string; - /** - * Name of the index containing the object. - */ - indexName: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueries.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueries.ts deleted file mode 100644 index 1096b0c8fa..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueries.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { MultipleQueriesType } from './multipleQueriesType'; - -export type MultipleQueries = { - /** - * The Algolia index name. - */ - indexName: string; - /** - * The text to search in the index. - */ - query?: string; - type?: MultipleQueriesType; - /** - * The `facet` name. - */ - facet?: string; - /** - * A query string of search parameters. - */ - params?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueriesParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueriesParams.ts deleted file mode 100644 index eef22ed29f..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueriesParams.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { MultipleQueries } from './multipleQueries'; -import type { MultipleQueriesStrategy } from './multipleQueriesStrategy'; - -export type MultipleQueriesParams = { - requests: MultipleQueries[]; - strategy?: MultipleQueriesStrategy; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueriesResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueriesResponse.ts deleted file mode 100644 index 7d96feba7b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueriesResponse.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { SearchResponse } from './searchResponse'; - -export type MultipleQueriesResponse = { - results?: SearchResponse[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueriesStrategy.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueriesStrategy.ts deleted file mode 100644 index 5090359e8e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueriesStrategy.ts +++ /dev/null @@ -1 +0,0 @@ -export type MultipleQueriesStrategy = 'none' | 'stopIfEnoughMatches'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueriesType.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueriesType.ts deleted file mode 100644 index cd27b91929..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/multipleQueriesType.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Perform a search query with `default`, will search for facet values if `facet` is given. - */ - -export type MultipleQueriesType = 'default' | 'facet'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/operationIndexParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/operationIndexParams.ts deleted file mode 100644 index 90da3e1e22..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/operationIndexParams.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { OperationType } from './operationType'; -import type { ScopeType } from './scopeType'; - -export type OperationIndexParams = { - operation: OperationType; - /** - * The Algolia index name. - */ - destination: string; - /** - * Scope of the data to copy. When absent, a full copy is performed. When present, only the selected scopes are copied. - */ - scope?: ScopeType[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/operationType.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/operationType.ts deleted file mode 100644 index 9d7bab7040..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/operationType.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Type of operation to perform (move or copy). - */ - -export type OperationType = 'copy' | 'move'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/params.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/params.ts deleted file mode 100644 index 59c91f2bc1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/params.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { AutomaticFacetFilter } from './automaticFacetFilter'; - -/** - * Additional search parameters. Any valid search parameter is allowed. - */ -export type Params = { - /** - * Query string. - */ - query?: string; - /** - * 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. - */ - automaticFacetFilters?: AutomaticFacetFilter[]; - /** - * Same syntax as automaticFacetFilters, but the engine treats the filters as optional. - */ - automaticOptionalFacetFilters?: AutomaticFacetFilter[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/promote.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/promote.ts deleted file mode 100644 index 915ad295da..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/promote.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Object to promote as hits. - */ -export type Promote = { - /** - * Unique identifier of the object to promote. - */ - objectID?: string; - /** - * Array of unique identifiers of the objects to promote. - */ - objectIDs?: string[]; - /** - * 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. - */ - position: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/rankingInfo.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/rankingInfo.ts deleted file mode 100644 index c14a767726..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/rankingInfo.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { RankingInfoMatchedGeoLocation } from './rankingInfoMatchedGeoLocation'; - -export type RankingInfo = { - /** - * This field is reserved for advanced usage. - */ - filters?: number; - /** - * Position of the most important matched attribute in the attributes to index list. - */ - firstMatchedWord?: number; - /** - * 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). - */ - geoDistance?: number; - /** - * Precision used when computing the geo distance, in meters. - */ - geoPrecision?: number; - matchedGeoLocation?: { [key: string]: RankingInfoMatchedGeoLocation }; - /** - * Number of exactly matched words. - */ - nbExactWords?: number; - /** - * Number of typos encountered when matching the record. - */ - nbTypos?: number; - /** - * Present and set to true if a Rule promoted the hit. - */ - promoted?: boolean; - /** - * When the query contains more than one word, the sum of the distances between matched words (in meters). - */ - proximityDistance?: number; - /** - * Custom ranking for the object, expressed as a single integer value. - */ - userScore?: number; - /** - * Number of matched words, including prefixes and typos. - */ - word?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/rankingInfoMatchedGeoLocation.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/rankingInfoMatchedGeoLocation.ts deleted file mode 100644 index bc9ce84718..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/rankingInfoMatchedGeoLocation.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type RankingInfoMatchedGeoLocation = { - /** - * Latitude of the matched location. - */ - lat?: number; - /** - * Longitude of the matched location. - */ - lng?: number; - /** - * Distance between the matched location and the search location (in meters). - */ - distance?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/removeUserIdResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/removeUserIdResponse.ts deleted file mode 100644 index 8326ce561d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/removeUserIdResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type RemoveUserIdResponse = { - /** - * Date of deletion (ISO-8601 format). - */ - deletedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/replaceSourceResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/replaceSourceResponse.ts deleted file mode 100644 index 6800a2a53f..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/replaceSourceResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type ReplaceSourceResponse = { - /** - * Date of last update (ISO-8601 format). - */ - updatedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/requiredSearchParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/requiredSearchParams.ts deleted file mode 100644 index 411ca99b94..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/requiredSearchParams.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type RequiredSearchParams = { - /** - * The text to search in the index. - */ - query: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/rule.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/rule.ts deleted file mode 100644 index e65265a403..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/rule.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { Condition } from './condition'; -import type { Consequence } from './consequence'; -import type { TimeRange } from './timeRange'; - -/** - * Rule object. - */ -export type Rule = { - /** - * Unique identifier of the object. - */ - objectID: string; - /** - * A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule. - */ - conditions?: Condition[]; - consequence: Consequence; - /** - * 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. - */ - description?: string; - /** - * Whether the Rule is enabled. Disabled Rules remain in the index, but aren\'t applied at query time. - */ - enabled?: boolean; - /** - * 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. - */ - validity?: TimeRange[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/saveObjectResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/saveObjectResponse.ts deleted file mode 100644 index 03a99554e4..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/saveObjectResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -export type SaveObjectResponse = { - createdAt?: string; - /** - * TaskID of the task to wait for. - */ - taskID?: number; - /** - * Unique identifier of the object. - */ - objectID?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/saveSynonymResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/saveSynonymResponse.ts deleted file mode 100644 index 5c83340b46..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/saveSynonymResponse.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type SaveSynonymResponse = { - /** - * TaskID of the task to wait for. - */ - taskID: number; - /** - * Date of last update (ISO-8601 format). - */ - updatedAt: string; - /** - * ObjectID of the inserted object. - */ - id: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/scopeType.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/scopeType.ts deleted file mode 100644 index ea19044f2d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/scopeType.ts +++ /dev/null @@ -1 +0,0 @@ -export type ScopeType = 'rules' | 'settings' | 'synonyms'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchDictionaryEntriesParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchDictionaryEntriesParams.ts deleted file mode 100644 index 4f9b7a158f..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchDictionaryEntriesParams.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * The `searchDictionaryEntries` parameters. - */ -export type SearchDictionaryEntriesParams = { - /** - * The text to search in the index. - */ - query: string; - /** - * Specify the page to retrieve. - */ - page?: number; - /** - * Set the number of hits per page. - */ - hitsPerPage?: number; - /** - * Language ISO code supported by the dictionary (e.g., \"en\" for English). - */ - language?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchForFacetValuesRequest.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchForFacetValuesRequest.ts deleted file mode 100644 index f7147f3d3e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchForFacetValuesRequest.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type SearchForFacetValuesRequest = { - /** - * Search parameters as URL-encoded query string. - */ - params?: string; - /** - * Text to search inside the facet\'s values. - */ - facetQuery?: string; - /** - * 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. - */ - maxFacetHits?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchForFacetValuesResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchForFacetValuesResponse.ts deleted file mode 100644 index 971b0f6b56..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchForFacetValuesResponse.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { SearchForFacetValuesResponseFacetHits } from './searchForFacetValuesResponseFacetHits'; - -export type SearchForFacetValuesResponse = { - facetHits: SearchForFacetValuesResponseFacetHits[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchForFacetValuesResponseFacetHits.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchForFacetValuesResponseFacetHits.ts deleted file mode 100644 index 08b3ae166a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchForFacetValuesResponseFacetHits.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type SearchForFacetValuesResponseFacetHits = { - /** - * Raw value of the facet. - */ - value: string; - /** - * Markup text with occurrences highlighted. - */ - highlighted: string; - /** - * 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. - */ - count: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchHits.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchHits.ts deleted file mode 100644 index ca99c320ef..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchHits.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Hit } from './hit'; - -export type SearchHits = { - hits?: Hit[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchParams.ts deleted file mode 100644 index b1675283bb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { SearchParamsObject } from './searchParamsObject'; -import type { SearchParamsString } from './searchParamsString'; - -export type SearchParams = SearchParamsObject | SearchParamsString; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchParamsObject.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchParamsObject.ts deleted file mode 100644 index ad8f80c073..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchParamsObject.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { BaseSearchParams } from './baseSearchParams'; -import type { IndexSettingsAsSearchParams } from './indexSettingsAsSearchParams'; -import type { RequiredSearchParams } from './requiredSearchParams'; - -export type SearchParamsObject = BaseSearchParams & - IndexSettingsAsSearchParams & - RequiredSearchParams; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchParamsString.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchParamsString.ts deleted file mode 100644 index 3aff58347d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchParamsString.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type SearchParamsString = { - /** - * Search parameters as URL-encoded query string. - */ - params?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchResponse.ts deleted file mode 100644 index 369e1d297c..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchResponse.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { BaseSearchResponse } from './baseSearchResponse'; -import type { SearchHits } from './searchHits'; - -export type SearchResponse = BaseSearchResponse & SearchHits; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchRulesParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchRulesParams.ts deleted file mode 100644 index afa60a07d7..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchRulesParams.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { Anchoring } from './anchoring'; - -/** - * Parameters for the search. - */ -export type SearchRulesParams = { - /** - * Full text query. - */ - query?: string; - anchoring?: Anchoring; - /** - * Restricts matches to contextual rules with a specific context (exact match). - */ - context?: string; - /** - * Requested page (zero-based). - */ - page?: number; - /** - * Maximum number of hits in a page. Minimum is 1, maximum is 1000. - */ - hitsPerPage?: number; - /** - * When specified, restricts matches to rules with a specific enabled status. When absent (default), all rules are retrieved, regardless of their enabled status. - */ - enabled?: boolean; - /** - * A mapping of requestOptions to send along with the request. - */ - requestOptions?: Array>; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchRulesResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchRulesResponse.ts deleted file mode 100644 index ce4f100e43..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchRulesResponse.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Rule } from './rule'; - -export type SearchRulesResponse = { - /** - * Fetched rules. - */ - hits: Rule[]; - /** - * Number of fetched rules. - */ - nbHits: number; - /** - * Current page. - */ - page: number; - /** - * Number of pages. - */ - nbPages: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchSynonymsResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchSynonymsResponse.ts deleted file mode 100644 index b50c74feac..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchSynonymsResponse.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { SynonymHit } from './synonymHit'; - -export type SearchSynonymsResponse = { - /** - * Array of synonym objects. - */ - hits: SynonymHit[]; - /** - * Number of hits that the search query matched. - */ - nbHits: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchUserIdsParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchUserIdsParams.ts deleted file mode 100644 index 6611c71619..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchUserIdsParams.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * OK. - */ -export type SearchUserIdsParams = { - /** - * Query to search. The search is a prefix search with typoTolerance. Use empty query to retrieve all users. - */ - query: string; - /** - * Name of the cluster. - */ - clusterName?: string; - /** - * Specify the page to retrieve. - */ - page?: number; - /** - * Set the number of hits per page. - */ - hitsPerPage?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchUserIdsResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchUserIdsResponse.ts deleted file mode 100644 index 6434c679b6..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchUserIdsResponse.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { SearchUserIdsResponseHits } from './searchUserIdsResponseHits'; - -/** - * UserIDs data. - */ -export type SearchUserIdsResponse = { - /** - * List of user object matching the query. - */ - hits: SearchUserIdsResponseHits[]; - /** - * Number of hits that the search query matched. - */ - nbHits: number; - /** - * Specify the page to retrieve. - */ - page: number; - /** - * Maximum number of hits in a page. Minimum is 1, maximum is 1000. - */ - hitsPerPage: number; - /** - * Date of last update (ISO-8601 format). - */ - updatedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchUserIdsResponseHighlightResult.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchUserIdsResponseHighlightResult.ts deleted file mode 100644 index 6f575186df..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchUserIdsResponseHighlightResult.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { HighlightResult } from './highlightResult'; - -export type SearchUserIdsResponseHighlightResult = { - userID: HighlightResult; - clusterName: HighlightResult; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/searchUserIdsResponseHits.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/searchUserIdsResponseHits.ts deleted file mode 100644 index cc24f82cf0..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/searchUserIdsResponseHits.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { SearchUserIdsResponseHighlightResult } from './searchUserIdsResponseHighlightResult'; - -export type SearchUserIdsResponseHits = { - /** - * UserID of the user. - */ - userID: string; - /** - * Name of the cluster. - */ - clusterName: string; - /** - * Number of records in the cluster. - */ - nbRecords: number; - /** - * Data size taken by all the users assigned to the cluster. - */ - dataSize: number; - /** - * UserID of the requested user. Same as userID. - */ - objectID: string; - _highlightResult: SearchUserIdsResponseHighlightResult; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/snippetResult.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/snippetResult.ts deleted file mode 100644 index 0f8d17bc3d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/snippetResult.ts +++ /dev/null @@ -1,12 +0,0 @@ -export type SnippetResult = { - /** - * Markup text with occurrences highlighted. - */ - value?: string; - /** - * Indicates how well the attribute matched the search query. - */ - matchLevel?: SnippetResultMatchLevel; -}; - -export type SnippetResultMatchLevel = 'full' | 'none' | 'partial'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/source.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/source.ts deleted file mode 100644 index 79813c184a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/source.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The source. - */ -export type Source = { - /** - * The IP range of the source. - */ - source: string; - /** - * The description of the source. - */ - description?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/standardEntries.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/standardEntries.ts deleted file mode 100644 index f7b9e505bf..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/standardEntries.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Map of language ISO code supported by the dictionary (e.g., \"en\" for English) to a boolean value. - */ -export type StandardEntries = { - /** - * Language ISO code. - */ - plurals?: { [key: string]: boolean } | null; - /** - * Language ISO code. - */ - stopwords?: { [key: string]: boolean } | null; - /** - * Language ISO code. - */ - compounds?: { [key: string]: boolean } | null; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/synonymHit.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/synonymHit.ts deleted file mode 100644 index 2bbe5dbe11..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/synonymHit.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { SynonymHitHighlightResult } from './synonymHitHighlightResult'; -import type { SynonymType } from './synonymType'; - -/** - * Synonym object. - */ -export type SynonymHit = { - /** - * Unique identifier of the synonym object to be created or updated. - */ - objectID: string; - type: SynonymType; - /** - * Words or phrases to be considered equivalent. - */ - synonyms?: string[]; - /** - * Word or phrase to appear in query strings (for onewaysynonym). - */ - input?: string; - /** - * Word or phrase to appear in query strings (for altcorrection1 and altcorrection2). - */ - word?: string; - /** - * Words to be matched in records. - */ - corrections?: string[]; - /** - * Token to be put inside records. - */ - placeholder?: string; - /** - * List of query words that will match the token. - */ - replacements?: string[]; - _highlightResult?: SynonymHitHighlightResult; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/synonymHitHighlightResult.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/synonymHitHighlightResult.ts deleted file mode 100644 index 6d47548143..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/synonymHitHighlightResult.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { HighlightResult } from './highlightResult'; - -/** - * Highlighted results. - */ -export type SynonymHitHighlightResult = { - type?: HighlightResult; - synonyms?: HighlightResult[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/synonymType.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/synonymType.ts deleted file mode 100644 index f7a6b44452..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/synonymType.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Type of the synonym object. - */ - -export type SynonymType = - | 'altcorrection1' - | 'altcorrection2' - | 'onewaysynonym' - | 'placeholder' - | 'synonym'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/timeRange.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/timeRange.ts deleted file mode 100644 index 2c0a2444fd..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/timeRange.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type TimeRange = { - /** - * Lower bound of the time range (Unix timestamp). - */ - from: number; - /** - * Upper bound of the time range (Unix timestamp). - */ - until: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/updateApiKeyResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/updateApiKeyResponse.ts deleted file mode 100644 index 5bf38cb912..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/updateApiKeyResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type UpdateApiKeyResponse = { - /** - * Key string. - */ - key: string; - /** - * Date of last update (ISO-8601 format). - */ - updatedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/updatedAtResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/updatedAtResponse.ts deleted file mode 100644 index 90755a3379..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/updatedAtResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The response with a taskID and an updatedAt timestamp. - */ -export type UpdatedAtResponse = { - /** - * TaskID of the task to wait for. - */ - taskID: number; - /** - * Date of last update (ISO-8601 format). - */ - updatedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/updatedAtWithObjectIdResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/updatedAtWithObjectIdResponse.ts deleted file mode 100644 index 5ace1ab507..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/updatedAtWithObjectIdResponse.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * The response with a taskID, an objectID and an updatedAt timestamp. - */ -export type UpdatedAtWithObjectIdResponse = { - /** - * TaskID of the task to wait for. - */ - taskID?: number; - /** - * Date of last update (ISO-8601 format). - */ - updatedAt?: string; - /** - * Unique identifier of the object. - */ - objectID?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/updatedRuleResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/updatedRuleResponse.ts deleted file mode 100644 index b47eae6e23..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/updatedRuleResponse.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type UpdatedRuleResponse = { - /** - * Unique identifier of the object. - */ - objectID: string; - /** - * Date of last update (ISO-8601 format). - */ - updatedAt: string; - /** - * TaskID of the task to wait for. - */ - taskID: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/userId.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/userId.ts deleted file mode 100644 index a79a52f2bd..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/userId.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * A userID. - */ -export type UserId = { - /** - * UserID of the user. - */ - userID: string; - /** - * Cluster on which the user is assigned. - */ - clusterName: string; - /** - * Number of records belonging to the user. - */ - nbRecords: number; - /** - * Data size used by the user. - */ - dataSize: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/package.json b/clients/algoliasearch-client-javascript/packages/client-search/package.json deleted file mode 100644 index 2d709c2f3b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@experimental-api-clients-automation/client-search", - "version": "0.0.5", - "description": "JavaScript client for @experimental-api-clients-automation/client-search", - "repository": "algolia/algoliasearch-client-javascript", - "author": "Algolia", - "license": "MIT", - "main": "index.js", - "module": "dist/client-search.esm.node.js", - "types": "index.d.ts", - "jsdelivr": "dist/client-search.umd.browser.js", - "unpkg": "dist/client-search.umd.browser.js", - "browser": "dist/client-search.cjs.browser.js", - "scripts": { - "clean": "rm -rf ./dist" - }, - "files": [ - "dist", - "model", - "index.js", - "index.d.ts" - ], - "engines": { - "node": ">= 14.0.0" - }, - "dependencies": { - "@experimental-api-clients-automation/client-common": "0.0.5", - "@experimental-api-clients-automation/requester-browser-xhr": "0.0.5", - "@experimental-api-clients-automation/requester-node-http": "0.0.5" - }, - "devDependencies": { - "@types/node": "16.11.26", - "typescript": "4.6.3" - } -} diff --git a/clients/algoliasearch-client-javascript/packages/client-search/src/searchApi.ts b/clients/algoliasearch-client-javascript/packages/client-search/src/searchApi.ts deleted file mode 100644 index e5d4f59e4b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/src/searchApi.ts +++ /dev/null @@ -1,3360 +0,0 @@ -import { - createAuth, - createTransporter, - getUserAgent, - shuffle, -} from '@experimental-api-clients-automation/client-common'; -import type { - CreateClientOptions, - Headers, - Host, - Request, - RequestOptions, - QueryParameters, -} from '@experimental-api-clients-automation/client-common'; - -import type { AddApiKeyResponse } from '../model/addApiKeyResponse'; -import type { ApiKey } from '../model/apiKey'; -import type { AssignUserIdParams } from '../model/assignUserIdParams'; -import type { AttributeOrBuiltInOperation } from '../model/attributeOrBuiltInOperation'; -import type { BatchAssignUserIdsParams } from '../model/batchAssignUserIdsParams'; -import type { BatchDictionaryEntriesParams } from '../model/batchDictionaryEntriesParams'; -import type { BatchParams } from '../model/batchParams'; -import type { BatchResponse } from '../model/batchResponse'; -import type { BatchWriteParams } from '../model/batchWriteParams'; -import type { BrowseRequest } from '../model/browseRequest'; -import type { BrowseResponse } from '../model/browseResponse'; -import type { CreatedAtResponse } from '../model/createdAtResponse'; -import type { DeleteApiKeyResponse } from '../model/deleteApiKeyResponse'; -import type { DeleteSourceResponse } from '../model/deleteSourceResponse'; -import type { DeletedAtResponse } from '../model/deletedAtResponse'; -import type { DictionarySettingsParams } from '../model/dictionarySettingsParams'; -import type { DictionaryType } from '../model/dictionaryType'; -import type { GetDictionarySettingsResponse } from '../model/getDictionarySettingsResponse'; -import type { GetLogsResponse } from '../model/getLogsResponse'; -import type { GetObjectsParams } from '../model/getObjectsParams'; -import type { GetObjectsResponse } from '../model/getObjectsResponse'; -import type { GetTaskResponse } from '../model/getTaskResponse'; -import type { GetTopUserIdsResponse } from '../model/getTopUserIdsResponse'; -import type { IndexSettings } from '../model/indexSettings'; -import type { Key } from '../model/key'; -import type { Languages } from '../model/languages'; -import type { ListApiKeysResponse } from '../model/listApiKeysResponse'; -import type { ListClustersResponse } from '../model/listClustersResponse'; -import type { ListIndicesResponse } from '../model/listIndicesResponse'; -import type { ListUserIdsResponse } from '../model/listUserIdsResponse'; -import type { LogType } from '../model/logType'; -import type { MultipleBatchResponse } from '../model/multipleBatchResponse'; -import type { MultipleQueriesParams } from '../model/multipleQueriesParams'; -import type { MultipleQueriesResponse } from '../model/multipleQueriesResponse'; -import type { OperationIndexParams } from '../model/operationIndexParams'; -import type { RemoveUserIdResponse } from '../model/removeUserIdResponse'; -import type { ReplaceSourceResponse } from '../model/replaceSourceResponse'; -import type { Rule } from '../model/rule'; -import type { SaveObjectResponse } from '../model/saveObjectResponse'; -import type { SaveSynonymResponse } from '../model/saveSynonymResponse'; -import type { SearchDictionaryEntriesParams } from '../model/searchDictionaryEntriesParams'; -import type { SearchForFacetValuesRequest } from '../model/searchForFacetValuesRequest'; -import type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse'; -import type { SearchParams } from '../model/searchParams'; -import type { SearchResponse } from '../model/searchResponse'; -import type { SearchRulesParams } from '../model/searchRulesParams'; -import type { SearchRulesResponse } from '../model/searchRulesResponse'; -import type { SearchSynonymsResponse } from '../model/searchSynonymsResponse'; -import type { SearchUserIdsParams } from '../model/searchUserIdsParams'; -import type { SearchUserIdsResponse } from '../model/searchUserIdsResponse'; -import type { Source } from '../model/source'; -import type { SynonymHit } from '../model/synonymHit'; -import type { SynonymType } from '../model/synonymType'; -import type { UpdateApiKeyResponse } from '../model/updateApiKeyResponse'; -import type { UpdatedAtResponse } from '../model/updatedAtResponse'; -import type { UpdatedAtWithObjectIdResponse } from '../model/updatedAtWithObjectIdResponse'; -import type { UpdatedRuleResponse } from '../model/updatedRuleResponse'; -import type { UserId } from '../model/userId'; - -export * from '../model/models'; -export const apiClientVersion = '0.0.5'; - -function getDefaultHosts(appId: string): Host[] { - return ( - [ - { - url: `${appId}-dsn.algolia.net`, - accept: 'read', - protocol: 'https', - }, - { - url: `${appId}.algolia.net`, - accept: 'write', - protocol: 'https', - }, - ] as Host[] - ).concat( - shuffle([ - { - url: `${appId}-1.algolianet.com`, - accept: 'readWrite', - protocol: 'https', - }, - { - url: `${appId}-2.algolianet.com`, - accept: 'readWrite', - protocol: 'https', - }, - { - url: `${appId}-3.algolianet.com`, - accept: 'readWrite', - protocol: 'https', - }, - ]) - ); -} - -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -export function createSearchApi(options: CreateClientOptions) { - const auth = createAuth(options.appId, options.apiKey, options.authMode); - const transporter = createTransporter({ - hosts: options?.hosts ?? getDefaultHosts(options.appId), - hostsCache: options.hostsCache, - requestsCache: options.requestsCache, - responsesCache: options.responsesCache, - baseHeaders: { - 'content-type': 'application/x-www-form-urlencoded', - ...auth.headers(), - }, - baseQueryParameters: auth.queryParameters(), - userAgent: getUserAgent({ - userAgents: options.userAgents, - client: 'Search', - version: apiClientVersion, - }), - timeouts: options.timeouts, - requester: options.requester, - }); - - function addUserAgent(segment: string, version?: string): void { - transporter.userAgent.add({ segment, version }); - } - - return { - addUserAgent, - /** - * Add a new API Key with specific permissions/restrictions. - * - * @summary Create a new API key. - * @param apiKey - The apiKey object. - */ - addApiKey( - apiKey: ApiKey, - requestOptions?: RequestOptions - ): Promise { - if (!apiKey) { - throw new Error( - 'Parameter `apiKey` is required when calling `addApiKey`.' - ); - } - - if (!apiKey.acl) { - throw new Error( - 'Parameter `apiKey.acl` is required when calling `addApiKey`.' - ); - } - - const requestPath = '/1/keys'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: apiKey, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * 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. - * - * @summary Add or replace an object with a given object ID. - * @param addOrUpdateObject - The addOrUpdateObject object. - * @param addOrUpdateObject.indexName - The index in which to perform the request. - * @param addOrUpdateObject.objectID - Unique identifier of an object. - * @param addOrUpdateObject.body - The Algolia object. - */ - addOrUpdateObject( - { indexName, objectID, body }: AddOrUpdateObjectProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `addOrUpdateObject`.' - ); - } - - if (!objectID) { - throw new Error( - 'Parameter `objectID` is required when calling `addOrUpdateObject`.' - ); - } - - if (!body) { - throw new Error( - 'Parameter `body` is required when calling `addOrUpdateObject`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/{objectID}' - .replace('{indexName}', encodeURIComponent(indexName)) - .replace('{objectID}', encodeURIComponent(objectID)); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Add a single source to the list of allowed sources. - * - * @summary Add a single source. - * @param source - The source to add. - */ - appendSource( - source: Source, - requestOptions?: RequestOptions - ): Promise { - if (!source) { - throw new Error( - 'Parameter `source` is required when calling `appendSource`.' - ); - } - - const requestPath = '/1/security/sources/append'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: source, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * 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. - * - * @summary Assign or Move userID. - * @param assignUserId - The assignUserId object. - * @param assignUserId.xAlgoliaUserID - UserID to assign. - * @param assignUserId.assignUserIdParams - The assignUserIdParams object. - */ - assignUserId( - { xAlgoliaUserID, assignUserIdParams }: AssignUserIdProps, - requestOptions?: RequestOptions - ): Promise { - if (!xAlgoliaUserID) { - throw new Error( - 'Parameter `xAlgoliaUserID` is required when calling `assignUserId`.' - ); - } - - if (!assignUserIdParams) { - throw new Error( - 'Parameter `assignUserIdParams` is required when calling `assignUserId`.' - ); - } - - if (!assignUserIdParams.cluster) { - throw new Error( - 'Parameter `assignUserIdParams.cluster` is required when calling `assignUserId`.' - ); - } - - const requestPath = '/1/clusters/mapping'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (xAlgoliaUserID !== undefined) { - queryParameters['X-Algolia-User-ID'] = xAlgoliaUserID.toString(); - } - - const request: Request = { - method: 'POST', - path: requestPath, - data: assignUserIdParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Performs multiple write operations in a single API call. - * - * @summary Performs multiple write operations in a single API call. - * @param batch - The batch object. - * @param batch.indexName - The index in which to perform the request. - * @param batch.batchWriteParams - The batchWriteParams object. - */ - batch( - { indexName, batchWriteParams }: BatchProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `batch`.' - ); - } - - if (!batchWriteParams) { - throw new Error( - 'Parameter `batchWriteParams` is required when calling `batch`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/batch'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: batchWriteParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * 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. - * - * @summary Batch assign userIDs. - * @param batchAssignUserIds - The batchAssignUserIds object. - * @param batchAssignUserIds.xAlgoliaUserID - UserID to assign. - * @param batchAssignUserIds.batchAssignUserIdsParams - The batchAssignUserIdsParams object. - */ - batchAssignUserIds( - { xAlgoliaUserID, batchAssignUserIdsParams }: BatchAssignUserIdsProps, - requestOptions?: RequestOptions - ): Promise { - if (!xAlgoliaUserID) { - throw new Error( - 'Parameter `xAlgoliaUserID` is required when calling `batchAssignUserIds`.' - ); - } - - if (!batchAssignUserIdsParams) { - throw new Error( - 'Parameter `batchAssignUserIdsParams` is required when calling `batchAssignUserIds`.' - ); - } - - if (!batchAssignUserIdsParams.cluster) { - throw new Error( - 'Parameter `batchAssignUserIdsParams.cluster` is required when calling `batchAssignUserIds`.' - ); - } - if (!batchAssignUserIdsParams.users) { - throw new Error( - 'Parameter `batchAssignUserIdsParams.users` is required when calling `batchAssignUserIds`.' - ); - } - - const requestPath = '/1/clusters/mapping/batch'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (xAlgoliaUserID !== undefined) { - queryParameters['X-Algolia-User-ID'] = xAlgoliaUserID.toString(); - } - - const request: Request = { - method: 'POST', - path: requestPath, - data: batchAssignUserIdsParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Send a batch of dictionary entries. - * - * @summary Send a batch of dictionary entries. - * @param batchDictionaryEntries - The batchDictionaryEntries object. - * @param batchDictionaryEntries.dictionaryName - The dictionary to search in. - * @param batchDictionaryEntries.batchDictionaryEntriesParams - The batchDictionaryEntriesParams object. - */ - batchDictionaryEntries( - { - dictionaryName, - batchDictionaryEntriesParams, - }: BatchDictionaryEntriesProps, - requestOptions?: RequestOptions - ): Promise { - if (!dictionaryName) { - throw new Error( - 'Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.' - ); - } - - if (!batchDictionaryEntriesParams) { - throw new Error( - 'Parameter `batchDictionaryEntriesParams` is required when calling `batchDictionaryEntries`.' - ); - } - - if (!batchDictionaryEntriesParams.requests) { - throw new Error( - 'Parameter `batchDictionaryEntriesParams.requests` is required when calling `batchDictionaryEntries`.' - ); - } - - const requestPath = '/1/dictionaries/{dictionaryName}/batch'.replace( - '{dictionaryName}', - encodeURIComponent(dictionaryName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: batchDictionaryEntriesParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Create or update a batch of Rules. - * - * @summary Batch Rules. - * @param batchRules - The batchRules object. - * @param batchRules.indexName - The index in which to perform the request. - * @param batchRules.rule - The rule object. - * @param batchRules.forwardToReplicas - When true, changes are also propagated to replicas of the given indexName. - * @param batchRules.clearExistingRules - When true, existing Rules are cleared before adding this batch. When false, existing Rules are kept. - */ - batchRules( - { - indexName, - rule, - forwardToReplicas, - clearExistingRules, - }: BatchRulesProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `batchRules`.' - ); - } - - if (!rule) { - throw new Error( - 'Parameter `rule` is required when calling `batchRules`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/rules/batch'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (forwardToReplicas !== undefined) { - queryParameters.forwardToReplicas = forwardToReplicas.toString(); - } - - if (clearExistingRules !== undefined) { - queryParameters.clearExistingRules = clearExistingRules.toString(); - } - - const request: Request = { - method: 'POST', - path: requestPath, - data: rule, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * 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. - * - * @summary Retrieve all index content. - * @param browse - The browse object. - * @param browse.indexName - The index in which to perform the request. - * @param browse.browseRequest - The browseRequest object. - */ - browse( - { indexName, browseRequest }: BrowseProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `browse`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/browse'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: browseRequest, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Remove all synonyms from an index. - * - * @summary Clear all synonyms. - * @param clearAllSynonyms - The clearAllSynonyms object. - * @param clearAllSynonyms.indexName - The index in which to perform the request. - * @param clearAllSynonyms.forwardToReplicas - When true, changes are also propagated to replicas of the given indexName. - */ - clearAllSynonyms( - { indexName, forwardToReplicas }: ClearAllSynonymsProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `clearAllSynonyms`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/synonyms/clear'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (forwardToReplicas !== undefined) { - queryParameters.forwardToReplicas = forwardToReplicas.toString(); - } - - const request: Request = { - method: 'POST', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Delete an index\'s content, but leave settings and index-specific API keys untouched. - * - * @summary Clear all objects from an index. - * @param clearObjects - The clearObjects object. - * @param clearObjects.indexName - The index in which to perform the request. - */ - clearObjects( - { indexName }: ClearObjectsProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `clearObjects`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/clear'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Delete all Rules in the index. - * - * @summary Clear Rules. - * @param clearRules - The clearRules object. - * @param clearRules.indexName - The index in which to perform the request. - * @param clearRules.forwardToReplicas - When true, changes are also propagated to replicas of the given indexName. - */ - clearRules( - { indexName, forwardToReplicas }: ClearRulesProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `clearRules`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/rules/clear'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (forwardToReplicas !== undefined) { - queryParameters.forwardToReplicas = forwardToReplicas.toString(); - } - - const request: Request = { - method: 'POST', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param del - The del object. - * @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param del.parameters - Query parameters to be applied to the current query. - * @param del.body - The parameters to send with the custom request. - */ - del( - { path, parameters, body }: DelProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `del`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Delete an existing API Key. - * - * @summary Delete an API key. - * @param deleteApiKey - The deleteApiKey object. - * @param deleteApiKey.key - API Key string. - */ - deleteApiKey( - { key }: DeleteApiKeyProps, - requestOptions?: RequestOptions - ): Promise { - if (!key) { - throw new Error( - 'Parameter `key` is required when calling `deleteApiKey`.' - ); - } - - const requestPath = '/1/keys/{key}'.replace( - '{key}', - encodeURIComponent(key) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * 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. - * - * @summary Delete all records matching the query. - * @param deleteBy - The deleteBy object. - * @param deleteBy.indexName - The index in which to perform the request. - * @param deleteBy.searchParams - The searchParams object. - */ - deleteBy( - { indexName, searchParams }: DeleteByProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `deleteBy`.' - ); - } - - if (!searchParams) { - throw new Error( - 'Parameter `searchParams` is required when calling `deleteBy`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/deleteByQuery'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: searchParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Delete an existing index. - * - * @summary Delete index. - * @param deleteIndex - The deleteIndex object. - * @param deleteIndex.indexName - The index in which to perform the request. - */ - deleteIndex( - { indexName }: DeleteIndexProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `deleteIndex`.' - ); - } - - const requestPath = '/1/indexes/{indexName}'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Delete an existing object. - * - * @summary Delete object. - * @param deleteObject - The deleteObject object. - * @param deleteObject.indexName - The index in which to perform the request. - * @param deleteObject.objectID - Unique identifier of an object. - */ - deleteObject( - { indexName, objectID }: DeleteObjectProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `deleteObject`.' - ); - } - - if (!objectID) { - throw new Error( - 'Parameter `objectID` is required when calling `deleteObject`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/{objectID}' - .replace('{indexName}', encodeURIComponent(indexName)) - .replace('{objectID}', encodeURIComponent(objectID)); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Delete the Rule with the specified objectID. - * - * @summary Delete a rule. - * @param deleteRule - The deleteRule object. - * @param deleteRule.indexName - The index in which to perform the request. - * @param deleteRule.objectID - Unique identifier of an object. - * @param deleteRule.forwardToReplicas - When true, changes are also propagated to replicas of the given indexName. - */ - deleteRule( - { indexName, objectID, forwardToReplicas }: DeleteRuleProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `deleteRule`.' - ); - } - - if (!objectID) { - throw new Error( - 'Parameter `objectID` is required when calling `deleteRule`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/rules/{objectID}' - .replace('{indexName}', encodeURIComponent(indexName)) - .replace('{objectID}', encodeURIComponent(objectID)); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (forwardToReplicas !== undefined) { - queryParameters.forwardToReplicas = forwardToReplicas.toString(); - } - - const request: Request = { - method: 'DELETE', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Remove a single source from the list of allowed sources. - * - * @summary Remove a single source. - * @param deleteSource - The deleteSource object. - * @param deleteSource.source - The IP range of the source. - */ - deleteSource( - { source }: DeleteSourceProps, - requestOptions?: RequestOptions - ): Promise { - if (!source) { - throw new Error( - 'Parameter `source` is required when calling `deleteSource`.' - ); - } - - const requestPath = '/1/security/sources/{source}'.replace( - '{source}', - encodeURIComponent(source) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Delete a single synonyms set, identified by the given objectID. - * - * @summary Delete synonym. - * @param deleteSynonym - The deleteSynonym object. - * @param deleteSynonym.indexName - The index in which to perform the request. - * @param deleteSynonym.objectID - Unique identifier of an object. - * @param deleteSynonym.forwardToReplicas - When true, changes are also propagated to replicas of the given indexName. - */ - deleteSynonym( - { indexName, objectID, forwardToReplicas }: DeleteSynonymProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `deleteSynonym`.' - ); - } - - if (!objectID) { - throw new Error( - 'Parameter `objectID` is required when calling `deleteSynonym`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/synonyms/{objectID}' - .replace('{indexName}', encodeURIComponent(indexName)) - .replace('{objectID}', encodeURIComponent(objectID)); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (forwardToReplicas !== undefined) { - queryParameters.forwardToReplicas = forwardToReplicas.toString(); - } - - const request: Request = { - method: 'DELETE', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param get - The get object. - * @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param get.parameters - Query parameters to be applied to the current query. - */ - get( - { path, parameters }: GetProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `get`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Get the permissions of an API key. - * - * @summary Get an API key. - * @param getApiKey - The getApiKey object. - * @param getApiKey.key - API Key string. - */ - getApiKey( - { key }: GetApiKeyProps, - requestOptions?: RequestOptions - ): Promise { - if (!key) { - throw new Error( - 'Parameter `key` is required when calling `getApiKey`.' - ); - } - - const requestPath = '/1/keys/{key}'.replace( - '{key}', - encodeURIComponent(key) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * List dictionaries supported per language. - * - * @summary List dictionaries supported per language. - */ - getDictionaryLanguages( - requestOptions?: RequestOptions - ): Promise<{ [key: string]: Languages }> { - const requestPath = '/1/dictionaries/*/languages'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Retrieve dictionaries settings. - * - * @summary Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values. - */ - getDictionarySettings( - requestOptions?: RequestOptions - ): Promise { - const requestPath = '/1/dictionaries/*/settings'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Return the lastest log entries. - * - * @summary Return the lastest log entries. - * @param getLogs - The getLogs object. - * @param getLogs.offset - First entry to retrieve (zero-based). Log entries are sorted by decreasing date, therefore 0 designates the most recent log entry. - * @param getLogs.length - Maximum number of entries to retrieve. The maximum allowed value is 1000. - * @param getLogs.indexName - Index for which log entries should be retrieved. When omitted, log entries are retrieved across all indices. - * @param getLogs.type - Type of log entries to retrieve. When omitted, all log entries are retrieved. - */ - getLogs( - { offset, length, indexName, type }: GetLogsProps, - requestOptions?: RequestOptions - ): Promise { - const requestPath = '/1/logs'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (offset !== undefined) { - queryParameters.offset = offset.toString(); - } - - if (length !== undefined) { - queryParameters.length = length.toString(); - } - - if (indexName !== undefined) { - queryParameters.indexName = indexName.toString(); - } - - if (type !== undefined) { - queryParameters.type = type.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Retrieve one object from the index. - * - * @summary Retrieve one object from the index. - * @param getObject - The getObject object. - * @param getObject.indexName - The index in which to perform the request. - * @param getObject.objectID - Unique identifier of an object. - * @param getObject.attributesToRetrieve - List of attributes to retrieve. If not specified, all retrievable attributes are returned. - */ - getObject( - { indexName, objectID, attributesToRetrieve }: GetObjectProps, - requestOptions?: RequestOptions - ): Promise<{ [key: string]: string }> { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `getObject`.' - ); - } - - if (!objectID) { - throw new Error( - 'Parameter `objectID` is required when calling `getObject`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/{objectID}' - .replace('{indexName}', encodeURIComponent(indexName)) - .replace('{objectID}', encodeURIComponent(objectID)); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (attributesToRetrieve !== undefined) { - queryParameters.attributesToRetrieve = attributesToRetrieve.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Retrieve one or more objects, potentially from different indices, in a single API call. - * - * @summary Retrieve one or more objects. - * @param getObjectsParams - The getObjectsParams object. - */ - getObjects( - getObjectsParams: GetObjectsParams, - requestOptions?: RequestOptions - ): Promise { - if (!getObjectsParams) { - throw new Error( - 'Parameter `getObjectsParams` is required when calling `getObjects`.' - ); - } - - const requestPath = '/1/indexes/*/objects'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: getObjectsParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Retrieve the Rule with the specified objectID. - * - * @summary Get a rule. - * @param getRule - The getRule object. - * @param getRule.indexName - The index in which to perform the request. - * @param getRule.objectID - Unique identifier of an object. - */ - getRule( - { indexName, objectID }: GetRuleProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `getRule`.' - ); - } - - if (!objectID) { - throw new Error( - 'Parameter `objectID` is required when calling `getRule`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/rules/{objectID}' - .replace('{indexName}', encodeURIComponent(indexName)) - .replace('{objectID}', encodeURIComponent(objectID)); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Retrieve settings of a given indexName. - * - * @summary Retrieve settings of a given indexName. - * @param getSettings - The getSettings object. - * @param getSettings.indexName - The index in which to perform the request. - */ - getSettings( - { indexName }: GetSettingsProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `getSettings`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/settings'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * List all allowed sources. - * - * @summary List all allowed sources. - */ - getSources(requestOptions?: RequestOptions): Promise { - const requestPath = '/1/security/sources'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Fetch a synonym object identified by its objectID. - * - * @summary Get synonym. - * @param getSynonym - The getSynonym object. - * @param getSynonym.indexName - The index in which to perform the request. - * @param getSynonym.objectID - Unique identifier of an object. - */ - getSynonym( - { indexName, objectID }: GetSynonymProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `getSynonym`.' - ); - } - - if (!objectID) { - throw new Error( - 'Parameter `objectID` is required when calling `getSynonym`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/synonyms/{objectID}' - .replace('{indexName}', encodeURIComponent(indexName)) - .replace('{objectID}', encodeURIComponent(objectID)); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Check the current status of a given task. - * - * @summary Check the current status of a given task. - * @param getTask - The getTask object. - * @param getTask.indexName - The index in which to perform the request. - * @param getTask.taskID - Unique identifier of an task. Numeric value (up to 64bits). - */ - getTask( - { indexName, taskID }: GetTaskProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `getTask`.' - ); - } - - if (!taskID) { - throw new Error( - 'Parameter `taskID` is required when calling `getTask`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/task/{taskID}' - .replace('{indexName}', encodeURIComponent(indexName)) - .replace('{taskID}', encodeURIComponent(taskID)); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * 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. - * - * @summary Get top userID. - */ - getTopUserIds( - requestOptions?: RequestOptions - ): Promise { - const requestPath = '/1/clusters/mapping/top'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * 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. - * - * @summary Get userID. - * @param getUserId - The getUserId object. - * @param getUserId.userID - UserID to assign. - */ - getUserId( - { userID }: GetUserIdProps, - requestOptions?: RequestOptions - ): Promise { - if (!userID) { - throw new Error( - 'Parameter `userID` is required when calling `getUserId`.' - ); - } - - const requestPath = '/1/clusters/mapping/{userID}'.replace( - '{userID}', - encodeURIComponent(userID) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * 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. - * - * @summary Has pending mappings. - * @param hasPendingMappings - The hasPendingMappings object. - * @param hasPendingMappings.getClusters - Whether to get clusters or not. - */ - hasPendingMappings( - { getClusters }: HasPendingMappingsProps, - requestOptions?: RequestOptions - ): Promise { - const requestPath = '/1/clusters/mapping/pending'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (getClusters !== undefined) { - queryParameters.getClusters = getClusters.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * List API keys, along with their associated rights. - * - * @summary Get the full list of API Keys. - */ - listApiKeys(requestOptions?: RequestOptions): Promise { - const requestPath = '/1/keys'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * 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. - * - * @summary List clusters. - */ - listClusters( - requestOptions?: RequestOptions - ): Promise { - const requestPath = '/1/clusters'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * List existing indexes from an application. - * - * @summary List existing indexes. - * @param listIndices - The listIndices object. - * @param listIndices.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). - */ - listIndices( - { page }: ListIndicesProps, - requestOptions?: RequestOptions - ): Promise { - const requestPath = '/1/indexes'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (page !== undefined) { - queryParameters.page = page.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * 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. - * - * @summary List userIDs. - * @param listUserIds - The listUserIds object. - * @param listUserIds.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). - * @param listUserIds.hitsPerPage - Maximum number of objects to retrieve. - */ - listUserIds( - { page, hitsPerPage }: ListUserIdsProps, - requestOptions?: RequestOptions - ): Promise { - const requestPath = '/1/clusters/mapping'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (page !== undefined) { - queryParameters.page = page.toString(); - } - - if (hitsPerPage !== undefined) { - queryParameters.hitsPerPage = hitsPerPage.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Perform multiple write operations, potentially targeting multiple indices, in a single API call. - * - * @summary Perform multiple write operations. - * @param batchParams - The batchParams object. - */ - multipleBatch( - batchParams: BatchParams, - requestOptions?: RequestOptions - ): Promise { - if (!batchParams) { - throw new Error( - 'Parameter `batchParams` is required when calling `multipleBatch`.' - ); - } - - const requestPath = '/1/indexes/*/batch'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: batchParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Get search results for the given requests. - * - * @summary Get search results for the given requests. - * @param multipleQueriesParams - The multipleQueriesParams object. - */ - multipleQueries( - multipleQueriesParams: MultipleQueriesParams, - requestOptions?: RequestOptions - ): Promise { - if (!multipleQueriesParams) { - throw new Error( - 'Parameter `multipleQueriesParams` is required when calling `multipleQueries`.' - ); - } - - if (!multipleQueriesParams.requests) { - throw new Error( - 'Parameter `multipleQueriesParams.requests` is required when calling `multipleQueries`.' - ); - } - - const requestPath = '/1/indexes/*/queries'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: multipleQueriesParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Peforms a copy or a move operation on a index. - * - * @summary Copy/move index. - * @param operationIndex - The operationIndex object. - * @param operationIndex.indexName - The index in which to perform the request. - * @param operationIndex.operationIndexParams - The operationIndexParams object. - */ - operationIndex( - { indexName, operationIndexParams }: OperationIndexProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `operationIndex`.' - ); - } - - if (!operationIndexParams) { - throw new Error( - 'Parameter `operationIndexParams` is required when calling `operationIndex`.' - ); - } - - if (!operationIndexParams.operation) { - throw new Error( - 'Parameter `operationIndexParams.operation` is required when calling `operationIndex`.' - ); - } - if (!operationIndexParams.destination) { - throw new Error( - 'Parameter `operationIndexParams.destination` is required when calling `operationIndex`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/operation'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: operationIndexParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * 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. - * - * @summary Partially update an object. - * @param partialUpdateObject - The partialUpdateObject object. - * @param partialUpdateObject.indexName - The index in which to perform the request. - * @param partialUpdateObject.objectID - Unique identifier of an object. - * @param partialUpdateObject.attributeOrBuiltInOperation - List of attributes to update. - * @param partialUpdateObject.createIfNotExists - Creates the record if it does not exist yet. - */ - partialUpdateObject( - { - indexName, - objectID, - attributeOrBuiltInOperation, - createIfNotExists, - }: PartialUpdateObjectProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `partialUpdateObject`.' - ); - } - - if (!objectID) { - throw new Error( - 'Parameter `objectID` is required when calling `partialUpdateObject`.' - ); - } - - if (!attributeOrBuiltInOperation) { - throw new Error( - 'Parameter `attributeOrBuiltInOperation` is required when calling `partialUpdateObject`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/{objectID}/partial' - .replace('{indexName}', encodeURIComponent(indexName)) - .replace('{objectID}', encodeURIComponent(objectID)); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (createIfNotExists !== undefined) { - queryParameters.createIfNotExists = createIfNotExists.toString(); - } - - const request: Request = { - method: 'POST', - path: requestPath, - data: attributeOrBuiltInOperation, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param post - The post object. - * @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param post.parameters - Query parameters to be applied to the current query. - * @param post.body - The parameters to send with the custom request. - */ - post( - { path, parameters, body }: PostProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `post`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param put - The put object. - * @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param put.parameters - Query parameters to be applied to the current query. - * @param put.body - The parameters to send with the custom request. - */ - put( - { path, parameters, body }: PutProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `put`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * 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. - * - * @summary Remove userID. - * @param removeUserId - The removeUserId object. - * @param removeUserId.userID - UserID to assign. - */ - removeUserId( - { userID }: RemoveUserIdProps, - requestOptions?: RequestOptions - ): Promise { - if (!userID) { - throw new Error( - 'Parameter `userID` is required when calling `removeUserId`.' - ); - } - - const requestPath = '/1/clusters/mapping/{userID}'.replace( - '{userID}', - encodeURIComponent(userID) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Replace all allowed sources. - * - * @summary Replace all allowed sources. - * @param replaceSources - The replaceSources object. - * @param replaceSources.source - The sources to allow. - */ - replaceSources( - { source }: ReplaceSourcesProps, - requestOptions?: RequestOptions - ): Promise { - if (!source) { - throw new Error( - 'Parameter `source` is required when calling `replaceSources`.' - ); - } - - const requestPath = '/1/security/sources'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - data: source, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Restore a deleted API key, along with its associated rights. - * - * @summary Restore an API key. - * @param restoreApiKey - The restoreApiKey object. - * @param restoreApiKey.key - API Key string. - */ - restoreApiKey( - { key }: RestoreApiKeyProps, - requestOptions?: RequestOptions - ): Promise { - if (!key) { - throw new Error( - 'Parameter `key` is required when calling `restoreApiKey`.' - ); - } - - const requestPath = '/1/keys/{key}/restore'.replace( - '{key}', - encodeURIComponent(key) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Add an object to the index, automatically assigning it an object ID. - * - * @summary Add an object to the index. - * @param saveObject - The saveObject object. - * @param saveObject.indexName - The index in which to perform the request. - * @param saveObject.body - The Algolia record. - */ - saveObject( - { indexName, body }: SaveObjectProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `saveObject`.' - ); - } - - if (!body) { - throw new Error( - 'Parameter `body` is required when calling `saveObject`.' - ); - } - - const requestPath = '/1/indexes/{indexName}'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Create or update the Rule with the specified objectID. - * - * @summary Save/Update a rule. - * @param saveRule - The saveRule object. - * @param saveRule.indexName - The index in which to perform the request. - * @param saveRule.objectID - Unique identifier of an object. - * @param saveRule.rule - The rule object. - * @param saveRule.forwardToReplicas - When true, changes are also propagated to replicas of the given indexName. - */ - saveRule( - { indexName, objectID, rule, forwardToReplicas }: SaveRuleProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `saveRule`.' - ); - } - - if (!objectID) { - throw new Error( - 'Parameter `objectID` is required when calling `saveRule`.' - ); - } - - if (!rule) { - throw new Error( - 'Parameter `rule` is required when calling `saveRule`.' - ); - } - - if (!rule.objectID) { - throw new Error( - 'Parameter `rule.objectID` is required when calling `saveRule`.' - ); - } - if (!rule.consequence) { - throw new Error( - 'Parameter `rule.consequence` is required when calling `saveRule`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/rules/{objectID}' - .replace('{indexName}', encodeURIComponent(indexName)) - .replace('{objectID}', encodeURIComponent(objectID)); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (forwardToReplicas !== undefined) { - queryParameters.forwardToReplicas = forwardToReplicas.toString(); - } - - const request: Request = { - method: 'PUT', - path: requestPath, - data: rule, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Create a new synonym object or update the existing synonym object with the given object ID. - * - * @summary Save synonym. - * @param saveSynonym - The saveSynonym object. - * @param saveSynonym.indexName - The index in which to perform the request. - * @param saveSynonym.objectID - Unique identifier of an object. - * @param saveSynonym.synonymHit - The synonymHit object. - * @param saveSynonym.forwardToReplicas - When true, changes are also propagated to replicas of the given indexName. - */ - saveSynonym( - { indexName, objectID, synonymHit, forwardToReplicas }: SaveSynonymProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `saveSynonym`.' - ); - } - - if (!objectID) { - throw new Error( - 'Parameter `objectID` is required when calling `saveSynonym`.' - ); - } - - if (!synonymHit) { - throw new Error( - 'Parameter `synonymHit` is required when calling `saveSynonym`.' - ); - } - - if (!synonymHit.objectID) { - throw new Error( - 'Parameter `synonymHit.objectID` is required when calling `saveSynonym`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/synonyms/{objectID}' - .replace('{indexName}', encodeURIComponent(indexName)) - .replace('{objectID}', encodeURIComponent(objectID)); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (forwardToReplicas !== undefined) { - queryParameters.forwardToReplicas = forwardToReplicas.toString(); - } - - const request: Request = { - method: 'PUT', - path: requestPath, - data: synonymHit, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Create/update multiple synonym objects at once, potentially replacing the entire list of synonyms if replaceExistingSynonyms is true. - * - * @summary Save a batch of synonyms. - * @param saveSynonyms - The saveSynonyms object. - * @param saveSynonyms.indexName - The index in which to perform the request. - * @param saveSynonyms.synonymHit - The synonymHit object. - * @param saveSynonyms.forwardToReplicas - When true, changes are also propagated to replicas of the given indexName. - * @param saveSynonyms.replaceExistingSynonyms - Replace all synonyms of the index with the ones sent with this request. - */ - saveSynonyms( - { - indexName, - synonymHit, - forwardToReplicas, - replaceExistingSynonyms, - }: SaveSynonymsProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `saveSynonyms`.' - ); - } - - if (!synonymHit) { - throw new Error( - 'Parameter `synonymHit` is required when calling `saveSynonyms`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/synonyms/batch'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (forwardToReplicas !== undefined) { - queryParameters.forwardToReplicas = forwardToReplicas.toString(); - } - - if (replaceExistingSynonyms !== undefined) { - queryParameters.replaceExistingSynonyms = - replaceExistingSynonyms.toString(); - } - - const request: Request = { - method: 'POST', - path: requestPath, - data: synonymHit, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Get search results. - * - * @summary Get search results. - * @param search - The search object. - * @param search.indexName - The index in which to perform the request. - * @param search.searchParams - The searchParams object. - */ - search( - { indexName, searchParams }: SearchProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `search`.' - ); - } - - if (!searchParams) { - throw new Error( - 'Parameter `searchParams` is required when calling `search`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/query'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: searchParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Search the dictionary entries. - * - * @summary Search the dictionary entries. - * @param searchDictionaryEntries - The searchDictionaryEntries object. - * @param searchDictionaryEntries.dictionaryName - The dictionary to search in. - * @param searchDictionaryEntries.searchDictionaryEntriesParams - The searchDictionaryEntriesParams object. - */ - searchDictionaryEntries( - { - dictionaryName, - searchDictionaryEntriesParams, - }: SearchDictionaryEntriesProps, - requestOptions?: RequestOptions - ): Promise { - if (!dictionaryName) { - throw new Error( - 'Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.' - ); - } - - if (!searchDictionaryEntriesParams) { - throw new Error( - 'Parameter `searchDictionaryEntriesParams` is required when calling `searchDictionaryEntries`.' - ); - } - - if (!searchDictionaryEntriesParams.query) { - throw new Error( - 'Parameter `searchDictionaryEntriesParams.query` is required when calling `searchDictionaryEntries`.' - ); - } - - const requestPath = '/1/dictionaries/{dictionaryName}/search'.replace( - '{dictionaryName}', - encodeURIComponent(dictionaryName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: searchDictionaryEntriesParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Search for values of a given facet, optionally restricting the returned values to those contained in objects matching other search criteria. - * - * @summary Search for values of a given facet. - * @param searchForFacetValues - The searchForFacetValues object. - * @param searchForFacetValues.indexName - The index in which to perform the request. - * @param searchForFacetValues.facetName - The facet name. - * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object. - */ - searchForFacetValues( - { - indexName, - facetName, - searchForFacetValuesRequest, - }: SearchForFacetValuesProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `searchForFacetValues`.' - ); - } - - if (!facetName) { - throw new Error( - 'Parameter `facetName` is required when calling `searchForFacetValues`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/facets/{facetName}/query' - .replace('{indexName}', encodeURIComponent(indexName)) - .replace('{facetName}', encodeURIComponent(facetName)); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: searchForFacetValuesRequest, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Search for rules matching various criteria. - * - * @summary Search for rules. - * @param searchRules - The searchRules object. - * @param searchRules.indexName - The index in which to perform the request. - * @param searchRules.searchRulesParams - The searchRulesParams object. - */ - searchRules( - { indexName, searchRulesParams }: SearchRulesProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `searchRules`.' - ); - } - - if (!searchRulesParams) { - throw new Error( - 'Parameter `searchRulesParams` is required when calling `searchRules`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/rules/search'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: searchRulesParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Search or browse all synonyms, optionally filtering them by type. - * - * @summary Get all synonyms that match a query. - * @param searchSynonyms - The searchSynonyms object. - * @param searchSynonyms.indexName - The index in which to perform the request. - * @param searchSynonyms.query - Search for specific synonyms matching this string. - * @param searchSynonyms.type - Only search for specific types of synonyms. - * @param searchSynonyms.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). - * @param searchSynonyms.hitsPerPage - Maximum number of objects to retrieve. - */ - searchSynonyms( - { indexName, query, type, page, hitsPerPage }: SearchSynonymsProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `searchSynonyms`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/synonyms/search'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (query !== undefined) { - queryParameters.query = query.toString(); - } - - if (type !== undefined) { - queryParameters.type = type.toString(); - } - - if (page !== undefined) { - queryParameters.page = page.toString(); - } - - if (hitsPerPage !== undefined) { - queryParameters.hitsPerPage = hitsPerPage.toString(); - } - - const request: Request = { - method: 'POST', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * 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. - * - * @summary Search userID. - * @param searchUserIdsParams - The searchUserIdsParams object. - */ - searchUserIds( - searchUserIdsParams: SearchUserIdsParams, - requestOptions?: RequestOptions - ): Promise { - if (!searchUserIdsParams) { - throw new Error( - 'Parameter `searchUserIdsParams` is required when calling `searchUserIds`.' - ); - } - - if (!searchUserIdsParams.query) { - throw new Error( - 'Parameter `searchUserIdsParams.query` is required when calling `searchUserIds`.' - ); - } - - const requestPath = '/1/clusters/mapping/search'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: searchUserIdsParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Set dictionary settings. - * - * @summary Set dictionary settings. - * @param dictionarySettingsParams - The dictionarySettingsParams object. - */ - setDictionarySettings( - dictionarySettingsParams: DictionarySettingsParams, - requestOptions?: RequestOptions - ): Promise { - if (!dictionarySettingsParams) { - throw new Error( - 'Parameter `dictionarySettingsParams` is required when calling `setDictionarySettings`.' - ); - } - - if (!dictionarySettingsParams.disableStandardEntries) { - throw new Error( - 'Parameter `dictionarySettingsParams.disableStandardEntries` is required when calling `setDictionarySettings`.' - ); - } - - const requestPath = '/1/dictionaries/*/settings'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - data: dictionarySettingsParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * 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. - * - * @summary Update settings of a given indexName. - * @param setSettings - The setSettings object. - * @param setSettings.indexName - The index in which to perform the request. - * @param setSettings.indexSettings - The indexSettings object. - * @param setSettings.forwardToReplicas - When true, changes are also propagated to replicas of the given indexName. - */ - setSettings( - { indexName, indexSettings, forwardToReplicas }: SetSettingsProps, - requestOptions?: RequestOptions - ): Promise { - if (!indexName) { - throw new Error( - 'Parameter `indexName` is required when calling `setSettings`.' - ); - } - - if (!indexSettings) { - throw new Error( - 'Parameter `indexSettings` is required when calling `setSettings`.' - ); - } - - const requestPath = '/1/indexes/{indexName}/settings'.replace( - '{indexName}', - encodeURIComponent(indexName) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (forwardToReplicas !== undefined) { - queryParameters.forwardToReplicas = forwardToReplicas.toString(); - } - - const request: Request = { - method: 'PUT', - path: requestPath, - data: indexSettings, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Replace every permission of an existing API key. - * - * @summary Update an API key. - * @param updateApiKey - The updateApiKey object. - * @param updateApiKey.key - API Key string. - * @param updateApiKey.apiKey - The apiKey object. - */ - updateApiKey( - { key, apiKey }: UpdateApiKeyProps, - requestOptions?: RequestOptions - ): Promise { - if (!key) { - throw new Error( - 'Parameter `key` is required when calling `updateApiKey`.' - ); - } - - if (!apiKey) { - throw new Error( - 'Parameter `apiKey` is required when calling `updateApiKey`.' - ); - } - - if (!apiKey.acl) { - throw new Error( - 'Parameter `apiKey.acl` is required when calling `updateApiKey`.' - ); - } - - const requestPath = '/1/keys/{key}'.replace( - '{key}', - encodeURIComponent(key) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - data: apiKey, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - }; -} - -export type SearchApi = ReturnType; - -export type AddOrUpdateObjectProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * Unique identifier of an object. - */ - objectID: string; - /** - * The Algolia object. - */ - body: Record; -}; - -export type AssignUserIdProps = { - /** - * UserID to assign. - */ - xAlgoliaUserID: string; - assignUserIdParams: AssignUserIdParams; -}; - -export type BatchProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - batchWriteParams: BatchWriteParams; -}; - -export type BatchAssignUserIdsProps = { - /** - * UserID to assign. - */ - xAlgoliaUserID: string; - batchAssignUserIdsParams: BatchAssignUserIdsParams; -}; - -export type BatchDictionaryEntriesProps = { - /** - * The dictionary to search in. - */ - dictionaryName: DictionaryType; - batchDictionaryEntriesParams: BatchDictionaryEntriesParams; -}; - -export type BatchRulesProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - rule: Rule[]; - /** - * When true, changes are also propagated to replicas of the given indexName. - */ - forwardToReplicas?: boolean; - /** - * When true, existing Rules are cleared before adding this batch. When false, existing Rules are kept. - */ - clearExistingRules?: boolean; -}; - -export type BrowseProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - browseRequest?: BrowseRequest; -}; - -export type ClearAllSynonymsProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * When true, changes are also propagated to replicas of the given indexName. - */ - forwardToReplicas?: boolean; -}; - -export type ClearObjectsProps = { - /** - * The index in which to perform the request. - */ - indexName: string; -}; - -export type ClearRulesProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * When true, changes are also propagated to replicas of the given indexName. - */ - forwardToReplicas?: boolean; -}; - -export type DelProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type DeleteApiKeyProps = { - /** - * API Key string. - */ - key: string; -}; - -export type DeleteByProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - searchParams: SearchParams; -}; - -export type DeleteIndexProps = { - /** - * The index in which to perform the request. - */ - indexName: string; -}; - -export type DeleteObjectProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * Unique identifier of an object. - */ - objectID: string; -}; - -export type DeleteRuleProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * Unique identifier of an object. - */ - objectID: string; - /** - * When true, changes are also propagated to replicas of the given indexName. - */ - forwardToReplicas?: boolean; -}; - -export type DeleteSourceProps = { - /** - * The IP range of the source. - */ - source: string; -}; - -export type DeleteSynonymProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * Unique identifier of an object. - */ - objectID: string; - /** - * When true, changes are also propagated to replicas of the given indexName. - */ - forwardToReplicas?: boolean; -}; - -export type GetProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; -}; - -export type GetApiKeyProps = { - /** - * API Key string. - */ - key: string; -}; - -export type GetLogsProps = { - /** - * First entry to retrieve (zero-based). Log entries are sorted by decreasing date, therefore 0 designates the most recent log entry. - */ - offset?: number; - /** - * Maximum number of entries to retrieve. The maximum allowed value is 1000. - */ - length?: number; - /** - * Index for which log entries should be retrieved. When omitted, log entries are retrieved across all indices. - */ - indexName?: string; - /** - * Type of log entries to retrieve. When omitted, all log entries are retrieved. - */ - type?: LogType; -}; - -export type GetObjectProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * Unique identifier of an object. - */ - objectID: string; - /** - * List of attributes to retrieve. If not specified, all retrievable attributes are returned. - */ - attributesToRetrieve?: string[]; -}; - -export type GetRuleProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * Unique identifier of an object. - */ - objectID: string; -}; - -export type GetSettingsProps = { - /** - * The index in which to perform the request. - */ - indexName: string; -}; - -export type GetSynonymProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * Unique identifier of an object. - */ - objectID: string; -}; - -export type GetTaskProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * Unique identifier of an task. Numeric value (up to 64bits). - */ - taskID: number; -}; - -export type GetUserIdProps = { - /** - * UserID to assign. - */ - userID: string; -}; - -export type HasPendingMappingsProps = { - /** - * Whether to get clusters or not. - */ - getClusters?: boolean; -}; - -export type ListIndicesProps = { - /** - * 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). - */ - page?: number; -}; - -export type ListUserIdsProps = { - /** - * 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). - */ - page?: number; - /** - * Maximum number of objects to retrieve. - */ - hitsPerPage?: number; -}; - -export type OperationIndexProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - operationIndexParams: OperationIndexParams; -}; - -export type PartialUpdateObjectProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * Unique identifier of an object. - */ - objectID: string; - /** - * List of attributes to update. - */ - attributeOrBuiltInOperation: Array<{ - [key: string]: AttributeOrBuiltInOperation; - }>; - /** - * Creates the record if it does not exist yet. - */ - createIfNotExists?: boolean; -}; - -export type PostProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type PutProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type RemoveUserIdProps = { - /** - * UserID to assign. - */ - userID: string; -}; - -export type ReplaceSourcesProps = { - /** - * The sources to allow. - */ - source: Source[]; -}; - -export type RestoreApiKeyProps = { - /** - * API Key string. - */ - key: string; -}; - -export type SaveObjectProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * The Algolia record. - */ - body: Record; -}; - -export type SaveRuleProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * Unique identifier of an object. - */ - objectID: string; - rule: Rule; - /** - * When true, changes are also propagated to replicas of the given indexName. - */ - forwardToReplicas?: boolean; -}; - -export type SaveSynonymProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * Unique identifier of an object. - */ - objectID: string; - synonymHit: SynonymHit; - /** - * When true, changes are also propagated to replicas of the given indexName. - */ - forwardToReplicas?: boolean; -}; - -export type SaveSynonymsProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - synonymHit: SynonymHit[]; - /** - * When true, changes are also propagated to replicas of the given indexName. - */ - forwardToReplicas?: boolean; - /** - * Replace all synonyms of the index with the ones sent with this request. - */ - replaceExistingSynonyms?: boolean; -}; - -export type SearchProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - searchParams: SearchParams; -}; - -export type SearchDictionaryEntriesProps = { - /** - * The dictionary to search in. - */ - dictionaryName: DictionaryType; - searchDictionaryEntriesParams: SearchDictionaryEntriesParams; -}; - -export type SearchForFacetValuesProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * The facet name. - */ - facetName: string; - searchForFacetValuesRequest?: SearchForFacetValuesRequest; -}; - -export type SearchRulesProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - searchRulesParams: SearchRulesParams; -}; - -export type SearchSynonymsProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - /** - * Search for specific synonyms matching this string. - */ - query?: string; - /** - * Only search for specific types of synonyms. - */ - type?: SynonymType; - /** - * 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). - */ - page?: number; - /** - * Maximum number of objects to retrieve. - */ - hitsPerPage?: number; -}; - -export type SetSettingsProps = { - /** - * The index in which to perform the request. - */ - indexName: string; - indexSettings: IndexSettings; - /** - * When true, changes are also propagated to replicas of the given indexName. - */ - forwardToReplicas?: boolean; -}; - -export type UpdateApiKeyProps = { - /** - * API Key string. - */ - key: string; - apiKey: ApiKey; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/tsconfig.json b/clients/algoliasearch-client-javascript/packages/client-search/tsconfig.json deleted file mode 100644 index 89b2007fbb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "dist", - }, - "include": ["src", "model", "builds/node.ts", "builds/browser.ts"], - "exclude": ["dist", "node_modules"] -} diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/.openapi-generator-ignore b/clients/algoliasearch-client-javascript/packages/client-sources/.openapi-generator-ignore deleted file mode 100644 index a6fb9df9d1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/.openapi-generator-ignore +++ /dev/null @@ -1,8 +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. - -git_push.sh -.gitignore diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/builds/browser.ts b/clients/algoliasearch-client-javascript/packages/client-sources/builds/browser.ts deleted file mode 100644 index 94405910cc..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/builds/browser.ts +++ /dev/null @@ -1,59 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createFallbackableCache, - createBrowserLocalStorageCache, -} from '@experimental-api-clients-automation/client-common'; -import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr'; - -import { createSourcesApi, apiClientVersion } from '../src/sourcesApi'; -import type { SourcesApi, Region } from '../src/sourcesApi'; - -export * from '../src/sourcesApi'; - -export function sourcesApi( - appId: string, - apiKey: string, - region: Region, - options?: InitClientOptions -): SourcesApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - if (!region) { - throw new Error('`region` is missing.'); - } - - return createSourcesApi({ - appId, - apiKey, - region, - timeouts: { - connect: 1, - read: 2, - write: 30, - }, - requester: options?.requester ?? createXhrRequester(), - userAgents: [{ segment: 'Browser' }], - authMode: 'WithinQueryParameters', - responsesCache: options?.responsesCache ?? createMemoryCache(), - requestsCache: - options?.requestsCache ?? createMemoryCache({ serializable: false }), - hostsCache: - options?.hostsCache ?? - createFallbackableCache({ - caches: [ - createBrowserLocalStorageCache({ - key: `${apiClientVersion}-${appId}`, - }), - createMemoryCache(), - ], - }), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/builds/node.ts b/clients/algoliasearch-client-javascript/packages/client-sources/builds/node.ts deleted file mode 100644 index c74d8a385c..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/builds/node.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createNullCache, -} from '@experimental-api-clients-automation/client-common'; -import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http'; - -import { createSourcesApi } from '../src/sourcesApi'; -import type { SourcesApi, Region } from '../src/sourcesApi'; - -export * from '../src/sourcesApi'; - -export function sourcesApi( - appId: string, - apiKey: string, - region: Region, - options?: InitClientOptions -): SourcesApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - if (!region) { - throw new Error('`region` is missing.'); - } - - return createSourcesApi({ - appId, - apiKey, - region, - timeouts: { - connect: 2, - read: 5, - write: 30, - }, - requester: options?.requester ?? createHttpRequester(), - userAgents: [{ segment: 'Node.js', version: process.versions.node }], - responsesCache: options?.responsesCache ?? createNullCache(), - requestsCache: options?.requestsCache ?? createNullCache(), - hostsCache: options?.hostsCache ?? createMemoryCache(), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/index.d.ts b/clients/algoliasearch-client-javascript/packages/client-sources/index.d.ts deleted file mode 100644 index 8b0a7c887a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-unresolved -export * from './dist/builds/node'; diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/index.js b/clients/algoliasearch-client-javascript/packages/client-sources/index.js deleted file mode 100644 index 220e589629..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-commonjs,import/extensions -module.exports = require('./dist/client-sources.cjs.node.js'); diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/model/errorBase.ts b/clients/algoliasearch-client-javascript/packages/client-sources/model/errorBase.ts deleted file mode 100644 index a533aa7a15..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/model/errorBase.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Error. - */ -export type ErrorBase = { - message?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/model/models.ts b/clients/algoliasearch-client-javascript/packages/client-sources/model/models.ts deleted file mode 100644 index bd1026397a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/model/models.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './errorBase'; -export * from './postIngestUrlResponse'; -export * from './postURLJob'; -export * from './postURLJobAuth'; -export * from './postURLJobInput'; -export * from './postURLJobTarget'; -export * from './task'; diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/model/postIngestUrlResponse.ts b/clients/algoliasearch-client-javascript/packages/client-sources/model/postIngestUrlResponse.ts deleted file mode 100644 index 98a0c3c1ba..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/model/postIngestUrlResponse.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Task } from './task'; - -export type PostIngestUrlResponse = { - task: Task; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/model/postURLJob.ts b/clients/algoliasearch-client-javascript/packages/client-sources/model/postURLJob.ts deleted file mode 100644 index cb99c27493..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/model/postURLJob.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { PostURLJobInput } from './postURLJobInput'; -import type { PostURLJobTarget } from './postURLJobTarget'; - -/** - * Object containing a URL job. - */ -export type PostURLJob = { - /** - * The type of the file to ingest. - */ - type: PostURLJobType; - /** - * The name of the column that hold the unique identifier. - */ - uniqueIDColumn?: string; - input: PostURLJobInput; - target: PostURLJobTarget; -}; - -export type PostURLJobType = 'csv'; diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/model/postURLJobAuth.ts b/clients/algoliasearch-client-javascript/packages/client-sources/model/postURLJobAuth.ts deleted file mode 100644 index b28e166959..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/model/postURLJobAuth.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * The authentication scheme for the URL that will be fetched. - */ -export type PostURLJobAuth = { - /** - * The type of authentication to use. - */ - type: PostURLJobAuthType; - /** - * The login to use for Basic Auth. - */ - login: string; - /** - * The password to use for Basic Auth. - */ - password: string; -}; - -export type PostURLJobAuthType = 'basic'; diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/model/postURLJobInput.ts b/clients/algoliasearch-client-javascript/packages/client-sources/model/postURLJobInput.ts deleted file mode 100644 index 7a51e0dfc5..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/model/postURLJobInput.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { PostURLJobAuth } from './postURLJobAuth'; - -/** - * The input of the job. - */ -export type PostURLJobInput = { - /** - * The URL of the file to ingest. - */ - url: string; - /** - * The HTTP method that will be used to fetch the URL. - */ - method?: PostURLJobInputMethod; - auth?: PostURLJobAuth; -}; - -export type PostURLJobInputMethod = 'GET' | 'POST'; diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/model/postURLJobTarget.ts b/clients/algoliasearch-client-javascript/packages/client-sources/model/postURLJobTarget.ts deleted file mode 100644 index c9a3aae9c9..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/model/postURLJobTarget.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * The target of the job. - */ -export type PostURLJobTarget = { - /** - * The product to target. - */ - type: PostURLJobTargetType; - /** - * The index name of the product. - */ - indexName: string; - /** - * The type of operation to execute. - */ - operation: PostURLJobTargetOperation; -}; - -export type PostURLJobTargetType = 'search'; - -export type PostURLJobTargetOperation = 'replace'; diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/model/task.ts b/clients/algoliasearch-client-javascript/packages/client-sources/model/task.ts deleted file mode 100644 index 8c07b1a8dc..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/model/task.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * A task object. - */ -export type Task = { - /** - * The id of the task. - */ - id: string; - /** - * The type of the task executed. - */ - type: TaskType; -}; - -export type TaskType = 'csv'; diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/package.json b/clients/algoliasearch-client-javascript/packages/client-sources/package.json deleted file mode 100644 index 654f4a8864..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@experimental-api-clients-automation/client-sources", - "version": "0.0.5", - "description": "JavaScript client for @experimental-api-clients-automation/client-sources", - "repository": "algolia/algoliasearch-client-javascript", - "author": "Algolia", - "license": "MIT", - "main": "index.js", - "module": "dist/client-sources.esm.node.js", - "types": "index.d.ts", - "jsdelivr": "dist/client-sources.umd.browser.js", - "unpkg": "dist/client-sources.umd.browser.js", - "browser": "dist/client-sources.cjs.browser.js", - "scripts": { - "clean": "rm -rf ./dist" - }, - "files": [ - "dist", - "model", - "index.js", - "index.d.ts" - ], - "engines": { - "node": ">= 14.0.0" - }, - "dependencies": { - "@experimental-api-clients-automation/client-common": "0.0.5", - "@experimental-api-clients-automation/requester-browser-xhr": "0.0.5", - "@experimental-api-clients-automation/requester-node-http": "0.0.5" - }, - "devDependencies": { - "@types/node": "16.11.26", - "typescript": "4.6.3" - } -} diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/src/sourcesApi.ts b/clients/algoliasearch-client-javascript/packages/client-sources/src/sourcesApi.ts deleted file mode 100644 index 71369094c8..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/src/sourcesApi.ts +++ /dev/null @@ -1,319 +0,0 @@ -import { - createAuth, - createTransporter, - getUserAgent, -} from '@experimental-api-clients-automation/client-common'; -import type { - CreateClientOptions, - Headers, - Host, - Request, - RequestOptions, - QueryParameters, -} from '@experimental-api-clients-automation/client-common'; - -import type { PostIngestUrlResponse } from '../model/postIngestUrlResponse'; -import type { PostURLJob } from '../model/postURLJob'; - -export * from '../model/models'; -export const apiClientVersion = '0.0.5'; - -export type Region = 'de' | 'us'; - -function getDefaultHosts(region: Region): Host[] { - return [ - { - url: `data.${region}.algolia.com`, - accept: 'readWrite', - protocol: 'https', - }, - ]; -} - -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -export function createSourcesApi( - options: CreateClientOptions & { region: Region } -) { - const auth = createAuth(options.appId, options.apiKey, options.authMode); - const transporter = createTransporter({ - hosts: options?.hosts ?? getDefaultHosts(options.region), - hostsCache: options.hostsCache, - requestsCache: options.requestsCache, - responsesCache: options.responsesCache, - baseHeaders: { - 'content-type': 'application/x-www-form-urlencoded', - ...auth.headers(), - }, - baseQueryParameters: auth.queryParameters(), - userAgent: getUserAgent({ - userAgents: options.userAgents, - client: 'Sources', - version: apiClientVersion, - }), - timeouts: options.timeouts, - requester: options.requester, - }); - - function addUserAgent(segment: string, version?: string): void { - transporter.userAgent.add({ segment, version }); - } - - return { - addUserAgent, - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param del - The del object. - * @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param del.parameters - Query parameters to be applied to the current query. - * @param del.body - The parameters to send with the custom request. - */ - del( - { path, parameters, body }: DelProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `del`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param get - The get object. - * @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param get.parameters - Query parameters to be applied to the current query. - */ - get( - { path, parameters }: GetProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `get`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param post - The post object. - * @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param post.parameters - Query parameters to be applied to the current query. - * @param post.body - The parameters to send with the custom request. - */ - post( - { path, parameters, body }: PostProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `post`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Add an ingestion job that will fetch data from an URL. - * - * @summary Create a new ingestion job via URL. - * @param postURLJob - The postURLJob object. - */ - postIngestUrl( - postURLJob: PostURLJob, - requestOptions?: RequestOptions - ): Promise { - if (!postURLJob) { - throw new Error( - 'Parameter `postURLJob` is required when calling `postIngestUrl`.' - ); - } - - if (!postURLJob.type) { - throw new Error( - 'Parameter `postURLJob.type` is required when calling `postIngestUrl`.' - ); - } - if (!postURLJob.input) { - throw new Error( - 'Parameter `postURLJob.input` is required when calling `postIngestUrl`.' - ); - } - if (!postURLJob.target) { - throw new Error( - 'Parameter `postURLJob.target` is required when calling `postIngestUrl`.' - ); - } - - const requestPath = '/1/ingest/url'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: postURLJob, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param put - The put object. - * @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param put.parameters - Query parameters to be applied to the current query. - * @param put.body - The parameters to send with the custom request. - */ - put( - { path, parameters, body }: PutProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `put`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - }; -} - -export type SourcesApi = ReturnType; - -export type DelProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type GetProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; -}; - -export type PostProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type PutProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/tsconfig.json b/clients/algoliasearch-client-javascript/packages/client-sources/tsconfig.json deleted file mode 100644 index 89b2007fbb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-sources/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "dist", - }, - "include": ["src", "model", "builds/node.ts", "builds/browser.ts"], - "exclude": ["dist", "node_modules"] -} diff --git a/clients/algoliasearch-client-javascript/packages/recommend/.openapi-generator-ignore b/clients/algoliasearch-client-javascript/packages/recommend/.openapi-generator-ignore deleted file mode 100644 index a6fb9df9d1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/.openapi-generator-ignore +++ /dev/null @@ -1,8 +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. - -git_push.sh -.gitignore diff --git a/clients/algoliasearch-client-javascript/packages/recommend/builds/browser.ts b/clients/algoliasearch-client-javascript/packages/recommend/builds/browser.ts deleted file mode 100644 index 0c39721dc9..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/builds/browser.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createFallbackableCache, - createBrowserLocalStorageCache, -} from '@experimental-api-clients-automation/client-common'; -import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr'; - -import { createRecommendApi, apiClientVersion } from '../src/recommendApi'; -import type { RecommendApi } from '../src/recommendApi'; - -export * from '../src/recommendApi'; - -export function recommendApi( - appId: string, - apiKey: string, - options?: InitClientOptions -): RecommendApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - return createRecommendApi({ - appId, - apiKey, - timeouts: { - connect: 1, - read: 2, - write: 30, - }, - requester: options?.requester ?? createXhrRequester(), - userAgents: [{ segment: 'Browser' }], - authMode: 'WithinQueryParameters', - responsesCache: options?.responsesCache ?? createMemoryCache(), - requestsCache: - options?.requestsCache ?? createMemoryCache({ serializable: false }), - hostsCache: - options?.hostsCache ?? - createFallbackableCache({ - caches: [ - createBrowserLocalStorageCache({ - key: `${apiClientVersion}-${appId}`, - }), - createMemoryCache(), - ], - }), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/recommend/builds/node.ts b/clients/algoliasearch-client-javascript/packages/recommend/builds/node.ts deleted file mode 100644 index 91d9c28918..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/builds/node.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { InitClientOptions } from '@experimental-api-clients-automation/client-common'; -import { - createMemoryCache, - createNullCache, -} from '@experimental-api-clients-automation/client-common'; -import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http'; - -import { createRecommendApi } from '../src/recommendApi'; -import type { RecommendApi } from '../src/recommendApi'; - -export * from '../src/recommendApi'; - -export function recommendApi( - appId: string, - apiKey: string, - options?: InitClientOptions -): RecommendApi { - if (!appId) { - throw new Error('`appId` is missing.'); - } - - if (!apiKey) { - throw new Error('`apiKey` is missing.'); - } - - return createRecommendApi({ - appId, - apiKey, - timeouts: { - connect: 2, - read: 5, - write: 30, - }, - requester: options?.requester ?? createHttpRequester(), - userAgents: [{ segment: 'Node.js', version: process.versions.node }], - responsesCache: options?.responsesCache ?? createNullCache(), - requestsCache: options?.requestsCache ?? createNullCache(), - hostsCache: options?.hostsCache ?? createMemoryCache(), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/recommend/index.d.ts b/clients/algoliasearch-client-javascript/packages/recommend/index.d.ts deleted file mode 100644 index 8b0a7c887a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-unresolved -export * from './dist/builds/node'; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/index.js b/clients/algoliasearch-client-javascript/packages/recommend/index.js deleted file mode 100644 index 6ea904117a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-commonjs,import/extensions -module.exports = require('./dist/recommend.cjs.node.js'); diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/aroundRadius.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/aroundRadius.ts deleted file mode 100644 index 929d3c0fba..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/aroundRadius.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AroundRadiusOneOf } from './aroundRadiusOneOf'; - -export type AroundRadius = AroundRadiusOneOf | number; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/aroundRadiusOneOf.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/aroundRadiusOneOf.ts deleted file mode 100644 index b737491ab2..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/aroundRadiusOneOf.ts +++ /dev/null @@ -1 +0,0 @@ -export type AroundRadiusOneOf = 'all'; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/baseRecommendRequest.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/baseRecommendRequest.ts deleted file mode 100644 index 6adb5f7db1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/baseRecommendRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { SearchParamsObject } from './searchParamsObject'; - -export type BaseRecommendRequest = { - /** - * The Algolia index name. - */ - indexName: string; - /** - * The threshold to use when filtering recommendations by their score. - */ - threshold: number; - /** - * The max number of recommendations to retrieve. If it\'s set to 0, all the recommendations of the objectID may be returned. - */ - maxRecommendations?: number; - queryParameters?: SearchParamsObject; - fallbackParameters?: SearchParamsObject; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/baseRecommendationRequest.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/baseRecommendationRequest.ts deleted file mode 100644 index 21d6210ec1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/baseRecommendationRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { RecommendationModels } from './recommendationModels'; - -export type BaseRecommendationRequest = { - model: RecommendationModels; - /** - * Unique identifier of the object. - */ - objectID: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/baseSearchParams.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/baseSearchParams.ts deleted file mode 100644 index 77631535de..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/baseSearchParams.ts +++ /dev/null @@ -1,129 +0,0 @@ -import type { AroundRadius } from './aroundRadius'; - -export type BaseSearchParams = { - /** - * Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. - */ - similarQuery?: string; - /** - * Filter the query with numeric, facet and/or tag filters. - */ - filters?: string; - /** - * Filter hits by facet value. - */ - facetFilters?: string[]; - /** - * Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. - */ - optionalFilters?: string[]; - /** - * Filter on numeric attributes. - */ - numericFilters?: string[]; - /** - * Filter hits by tags. - */ - tagFilters?: string[]; - /** - * Determines how to calculate the total score for filtering. - */ - sumOrFiltersScores?: boolean; - /** - * Retrieve facets and their facet values. - */ - facets?: string[]; - /** - * Maximum number of facet values to return for each facet during a regular search. - */ - maxValuesPerFacet?: number; - /** - * Force faceting to be applied after de-duplication (via the Distinct setting). - */ - facetingAfterDistinct?: boolean; - /** - * Controls how facet values are fetched. - */ - sortFacetValuesBy?: string; - /** - * Specify the page to retrieve. - */ - page?: number; - /** - * Specify the offset of the first hit to return. - */ - offset?: number; - /** - * Set the number of hits to retrieve (used only with offset). - */ - length?: number; - /** - * Search for entries around a central geolocation, enabling a geo search within a circular area. - */ - aroundLatLng?: string; - /** - * Search for entries around a given location automatically computed from the requester\'s IP address. - */ - aroundLatLngViaIP?: boolean; - aroundRadius?: AroundRadius; - /** - * Precision of geo search (in meters), to add grouping by geo location to the ranking formula. - */ - aroundPrecision?: number; - /** - * Minimum radius (in meters) used for a geo search when aroundRadius is not set. - */ - minimumAroundRadius?: number; - /** - * Search inside a rectangular area (in geo coordinates). - */ - insideBoundingBox?: number[]; - /** - * Search inside a polygon (in geo coordinates). - */ - insidePolygon?: number[]; - /** - * 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. - */ - naturalLanguages?: string[]; - /** - * Enables contextual rules. - */ - ruleContexts?: string[]; - /** - * Define the impact of the Personalization feature. - */ - personalizationImpact?: number; - /** - * Associates a certain user token with the current search. - */ - userToken?: string; - /** - * Retrieve detailed ranking information. - */ - getRankingInfo?: boolean; - /** - * Enable the Click Analytics feature. - */ - clickAnalytics?: boolean; - /** - * Whether the current query will be taken into account in the Analytics. - */ - analytics?: boolean; - /** - * List of tags to apply to the query for analytics purposes. - */ - analyticsTags?: string[]; - /** - * Whether to include or exclude a query from the processing-time percentile computation. - */ - percentileComputation?: boolean; - /** - * Whether this search should participate in running AB tests. - */ - enableABTest?: boolean; - /** - * Whether this search should use AI Re-Ranking. - */ - enableReRanking?: boolean; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/baseSearchResponse.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/baseSearchResponse.ts deleted file mode 100644 index 358556c692..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/baseSearchResponse.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type { BaseSearchResponseFacetsStats } from './baseSearchResponseFacetsStats'; - -export type BaseSearchResponse = { - /** - * If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID. - */ - abTestID?: number; - /** - * If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used. - */ - abTestVariantID?: number; - /** - * The computed geo location. - */ - aroundLatLng?: string; - /** - * The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. - */ - automaticRadius?: string; - /** - * Whether the facet count is exhaustive or approximate. - */ - exhaustiveFacetsCount?: boolean; - /** - * Indicate if the nbHits count was exhaustive or approximate. - */ - exhaustiveNbHits: boolean; - /** - * Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled). - */ - exhaustiveTypo: boolean; - /** - * A mapping of each facet name to the corresponding facet counts. - */ - facets?: { [key: string]: { [key: string]: string } }; - /** - * Statistics for numerical facets. - */ - facets_stats?: { [key: string]: BaseSearchResponseFacetsStats }; - /** - * Set the number of hits per page. - */ - hitsPerPage: number; - /** - * Index name used for the query. - */ - index?: string; - /** - * 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. - */ - indexUsed?: string; - /** - * Used to return warnings about the query. - */ - message?: string; - /** - * Number of hits that the search query matched. - */ - nbHits: number; - /** - * Number of pages available for the current query. - */ - nbPages: number; - /** - * The number of hits selected and sorted by the relevant sort algorithm. - */ - nbSortedHits?: number; - /** - * Specify the page to retrieve. - */ - page: number; - /** - * A url-encoded string of all search parameters. - */ - params: string; - /** - * The query string that will be searched, after normalization. - */ - parsedQuery?: string; - /** - * Time the server took to process the request, in milliseconds. - */ - processingTimeMS: number; - /** - * The text to search in the index. - */ - query: string; - /** - * A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. - */ - queryAfterRemoval?: string; - /** - * Actual host name of the server that processed the request. - */ - serverUsed?: string; - /** - * Lets you store custom data in your indices. - */ - userData?: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/baseSearchResponseFacetsStats.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/baseSearchResponseFacetsStats.ts deleted file mode 100644 index 4c4ceb7bc7..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/baseSearchResponseFacetsStats.ts +++ /dev/null @@ -1,18 +0,0 @@ -export type BaseSearchResponseFacetsStats = { - /** - * The minimum value in the result set. - */ - min?: number; - /** - * The maximum value in the result set. - */ - max?: number; - /** - * The average facet value in the result set. - */ - avg?: number; - /** - * The sum of all values in the result set. - */ - sum?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/baseTrendingRequest.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/baseTrendingRequest.ts deleted file mode 100644 index e8c5b35982..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/baseTrendingRequest.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { TrendingModels } from './trendingModels'; - -export type BaseTrendingRequest = { - model: TrendingModels; - /** - * The facet name to use for trending models. - */ - facetName?: string; - /** - * The facet value to use for trending models. - */ - facetValue?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/errorBase.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/errorBase.ts deleted file mode 100644 index a533aa7a15..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/errorBase.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Error. - */ -export type ErrorBase = { - message?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/getRecommendationsParams.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/getRecommendationsParams.ts deleted file mode 100644 index 8afe371b46..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/getRecommendationsParams.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { RecommendationsRequest } from './recommendationsRequest'; - -/** - * The `getRecommendations` parameters. - */ -export type GetRecommendationsParams = { - /** - * The `getRecommendations` requests. - */ - requests: RecommendationsRequest[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/getRecommendationsResponse.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/getRecommendationsResponse.ts deleted file mode 100644 index 79de43ccff..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/getRecommendationsResponse.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { RecommendationsResponse } from './recommendationsResponse'; - -export type GetRecommendationsResponse = { - results?: RecommendationsResponse[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/highlightResult.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/highlightResult.ts deleted file mode 100644 index a878792c6d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/highlightResult.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Highlighted attributes. - */ -export type HighlightResult = { - /** - * Markup text with occurrences highlighted. - */ - value?: string; - /** - * Indicates how well the attribute matched the search query. - */ - matchLevel?: HighlightResultMatchLevel; - /** - * List of words from the query that matched the object. - */ - matchedWords?: string[]; - /** - * Whether the entire attribute value is highlighted. - */ - fullyHighlighted?: boolean; -}; - -export type HighlightResultMatchLevel = 'full' | 'none' | 'partial'; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/indexSettingsAsSearchParams.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/indexSettingsAsSearchParams.ts deleted file mode 100644 index 00a227aa03..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/indexSettingsAsSearchParams.ts +++ /dev/null @@ -1,209 +0,0 @@ -export type IndexSettingsAsSearchParams = { - /** - * The complete list of attributes used for searching. - */ - searchableAttributes?: string[]; - /** - * The complete list of attributes that will be used for faceting. - */ - attributesForFaceting?: string[]; - /** - * List of attributes that can\'t be retrieved at query time. - */ - unretrievableAttributes?: string[]; - /** - * This parameter controls which attributes to retrieve and which not to retrieve. - */ - attributesToRetrieve?: string[]; - /** - * Restricts a given query to look in only a subset of your searchable attributes. - */ - restrictSearchableAttributes?: string[]; - /** - * Controls how Algolia should sort your results. - */ - ranking?: string[]; - /** - * Specifies the custom ranking criterion. - */ - customRanking?: string[]; - /** - * Controls the relevancy threshold below which less relevant results aren\'t included in the results. - */ - relevancyStrictness?: number; - /** - * List of attributes to highlight. - */ - attributesToHighlight?: string[]; - /** - * List of attributes to snippet, with an optional maximum number of words to snippet. - */ - attributesToSnippet?: string[]; - /** - * The HTML string to insert before the highlighted parts in all highlight and snippet results. - */ - highlightPreTag?: string; - /** - * The HTML string to insert after the highlighted parts in all highlight and snippet results. - */ - highlightPostTag?: string; - /** - * String used as an ellipsis indicator when a snippet is truncated. - */ - snippetEllipsisText?: string; - /** - * Restrict highlighting and snippeting to items that matched the query. - */ - restrictHighlightAndSnippetArrays?: boolean; - /** - * Set the number of hits per page. - */ - hitsPerPage?: number; - /** - * Minimum number of characters a word in the query string must contain to accept matches with 1 typo. - */ - minWordSizefor1Typo?: number; - /** - * Minimum number of characters a word in the query string must contain to accept matches with 2 typos. - */ - minWordSizefor2Typos?: number; - /** - * Controls whether typo tolerance is enabled and how it is applied. - */ - typoTolerance?: IndexSettingsAsSearchParamsTypoTolerance; - /** - * Whether to allow typos on numbers (\"numeric tokens\") in the query string. - */ - allowTyposOnNumericTokens?: boolean; - /** - * List of attributes on which you want to disable typo tolerance. - */ - disableTypoToleranceOnAttributes?: string[]; - /** - * Control which separators are indexed. - */ - separatorsToIndex?: string; - /** - * Treats singular, plurals, and other forms of declensions as matching terms. - */ - ignorePlurals?: string; - /** - * Removes stop (common) words from the query before executing it. - */ - removeStopWords?: string; - /** - * List of characters that the engine shouldn\'t automatically normalize. - */ - keepDiacriticsOnCharacters?: string; - /** - * Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. - */ - queryLanguages?: string[]; - /** - * Splits compound words into their composing atoms in the query. - */ - decompoundQuery?: boolean; - /** - * Whether Rules should be globally enabled. - */ - enableRules?: boolean; - /** - * Enable the Personalization feature. - */ - enablePersonalization?: boolean; - /** - * Controls if and how query words are interpreted as prefixes. - */ - queryType?: IndexSettingsAsSearchParamsQueryType; - /** - * Selects a strategy to remove words from the query when it doesn\'t match any hits. - */ - removeWordsIfNoResults?: IndexSettingsAsSearchParamsRemoveWordsIfNoResults; - /** - * Enables the advanced query syntax. - */ - advancedSyntax?: boolean; - /** - * A list of words that should be considered as optional when found in the query. - */ - optionalWords?: string[]; - /** - * List of attributes on which you want to disable the exact ranking criterion. - */ - disableExactOnAttributes?: string[]; - /** - * Controls how the exact ranking criterion is computed when the query contains only one word. - */ - exactOnSingleWordQuery?: IndexSettingsAsSearchParamsExactOnSingleWordQuery; - /** - * List of alternatives that should be considered an exact match by the exact ranking criterion. - */ - alternativesAsExact?: IndexSettingsAsSearchParamsAlternativesAsExact[]; - /** - * Allows you to specify which advanced syntax features are active when ‘advancedSyntax\' is enabled. - */ - advancedSyntaxFeatures?: IndexSettingsAsSearchParamsAdvancedSyntaxFeatures[]; - /** - * Enables de-duplication or grouping of results. - */ - distinct?: number; - /** - * Whether to take into account an index\'s synonyms for a particular search. - */ - synonyms?: boolean; - /** - * Whether to highlight and snippet the original word that matches the synonym or the synonym itself. - */ - replaceSynonymsInHighlight?: boolean; - /** - * Precision of the proximity ranking criterion. - */ - minProximity?: number; - /** - * Choose which fields to return in the API response. This parameters applies to search and browse queries. - */ - responseFields?: string[]; - /** - * 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. - */ - maxFacetHits?: number; - /** - * 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. - */ - attributeCriteriaComputedByMinProximity?: boolean; - /** - * 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. - */ - renderingContent?: Record; -}; - -export type IndexSettingsAsSearchParamsTypoTolerance = - | 'false' - | 'min' - | 'strict' - | 'true'; - -export type IndexSettingsAsSearchParamsQueryType = - | 'prefixAll' - | 'prefixLast' - | 'prefixNone'; - -export type IndexSettingsAsSearchParamsRemoveWordsIfNoResults = - | 'allOptional' - | 'firstWords' - | 'lastWords' - | 'none'; - -export type IndexSettingsAsSearchParamsExactOnSingleWordQuery = - | 'attribute' - | 'none' - | 'word'; - -export type IndexSettingsAsSearchParamsAlternativesAsExact = - | 'ignorePlurals' - | 'multiWordsSynonym' - | 'singleWordSynonym'; - -export type IndexSettingsAsSearchParamsAdvancedSyntaxFeatures = - | 'exactPhrase' - | 'excludeWords'; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/models.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/models.ts deleted file mode 100644 index bdae4e6184..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/models.ts +++ /dev/null @@ -1,26 +0,0 @@ -export * from './aroundRadius'; -export * from './aroundRadiusOneOf'; -export * from './baseRecommendRequest'; -export * from './baseRecommendationRequest'; -export * from './baseSearchParams'; -export * from './baseSearchResponse'; -export * from './baseSearchResponseFacetsStats'; -export * from './baseTrendingRequest'; -export * from './errorBase'; -export * from './getRecommendationsParams'; -export * from './getRecommendationsResponse'; -export * from './highlightResult'; -export * from './indexSettingsAsSearchParams'; -export * from './rankingInfo'; -export * from './rankingInfoMatchedGeoLocation'; -export * from './recommendHit'; -export * from './recommendHits'; -export * from './recommendationModels'; -export * from './recommendationRequest'; -export * from './recommendationsRequest'; -export * from './recommendationsResponse'; -export * from './requiredSearchParams'; -export * from './searchParamsObject'; -export * from './snippetResult'; -export * from './trendingModels'; -export * from './trendingRequest'; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/rankingInfo.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/rankingInfo.ts deleted file mode 100644 index c14a767726..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/rankingInfo.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { RankingInfoMatchedGeoLocation } from './rankingInfoMatchedGeoLocation'; - -export type RankingInfo = { - /** - * This field is reserved for advanced usage. - */ - filters?: number; - /** - * Position of the most important matched attribute in the attributes to index list. - */ - firstMatchedWord?: number; - /** - * 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). - */ - geoDistance?: number; - /** - * Precision used when computing the geo distance, in meters. - */ - geoPrecision?: number; - matchedGeoLocation?: { [key: string]: RankingInfoMatchedGeoLocation }; - /** - * Number of exactly matched words. - */ - nbExactWords?: number; - /** - * Number of typos encountered when matching the record. - */ - nbTypos?: number; - /** - * Present and set to true if a Rule promoted the hit. - */ - promoted?: boolean; - /** - * When the query contains more than one word, the sum of the distances between matched words (in meters). - */ - proximityDistance?: number; - /** - * Custom ranking for the object, expressed as a single integer value. - */ - userScore?: number; - /** - * Number of matched words, including prefixes and typos. - */ - word?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/rankingInfoMatchedGeoLocation.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/rankingInfoMatchedGeoLocation.ts deleted file mode 100644 index bc9ce84718..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/rankingInfoMatchedGeoLocation.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type RankingInfoMatchedGeoLocation = { - /** - * Latitude of the matched location. - */ - lat?: number; - /** - * Longitude of the matched location. - */ - lng?: number; - /** - * Distance between the matched location and the search location (in meters). - */ - distance?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendHit.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/recommendHit.ts deleted file mode 100644 index 188522c9c5..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendHit.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { HighlightResult } from './highlightResult'; -import type { RankingInfo } from './rankingInfo'; -import type { SnippetResult } from './snippetResult'; - -/** - * A Recommend hit. - */ -export type RecommendHit = { - /** - * Unique identifier of the object. - */ - objectID: string; - _highlightResult?: HighlightResult; - _snippetResult?: SnippetResult; - _rankingInfo?: RankingInfo; - _distinctSeqID?: number; - /** - * The recommendation score. - */ - _score: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendHits.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/recommendHits.ts deleted file mode 100644 index e584f40fc0..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendHits.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { RecommendHit } from './recommendHit'; - -export type RecommendHits = { - hits?: RecommendHit[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationModels.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationModels.ts deleted file mode 100644 index a0b12bdda5..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationModels.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * The recommendation model to use. - */ - -export type RecommendationModels = 'bought-together' | 'related-products'; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationRequest.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationRequest.ts deleted file mode 100644 index 4b1a52793e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationRequest.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { BaseRecommendRequest } from './baseRecommendRequest'; -import type { BaseRecommendationRequest } from './baseRecommendationRequest'; - -export type RecommendationRequest = BaseRecommendationRequest & - BaseRecommendRequest; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationsRequest.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationsRequest.ts deleted file mode 100644 index cb1d0792e6..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationsRequest.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { RecommendationRequest } from './recommendationRequest'; -import type { TrendingRequest } from './trendingRequest'; - -export type RecommendationsRequest = RecommendationRequest | TrendingRequest; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationsResponse.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationsResponse.ts deleted file mode 100644 index 1c6fc9ee21..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationsResponse.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { BaseSearchResponse } from './baseSearchResponse'; -import type { RecommendHits } from './recommendHits'; - -export type RecommendationsResponse = BaseSearchResponse & RecommendHits; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/requiredSearchParams.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/requiredSearchParams.ts deleted file mode 100644 index 411ca99b94..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/requiredSearchParams.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type RequiredSearchParams = { - /** - * The text to search in the index. - */ - query: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/searchParamsObject.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/searchParamsObject.ts deleted file mode 100644 index ad8f80c073..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/searchParamsObject.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { BaseSearchParams } from './baseSearchParams'; -import type { IndexSettingsAsSearchParams } from './indexSettingsAsSearchParams'; -import type { RequiredSearchParams } from './requiredSearchParams'; - -export type SearchParamsObject = BaseSearchParams & - IndexSettingsAsSearchParams & - RequiredSearchParams; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/snippetResult.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/snippetResult.ts deleted file mode 100644 index 0f8d17bc3d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/snippetResult.ts +++ /dev/null @@ -1,12 +0,0 @@ -export type SnippetResult = { - /** - * Markup text with occurrences highlighted. - */ - value?: string; - /** - * Indicates how well the attribute matched the search query. - */ - matchLevel?: SnippetResultMatchLevel; -}; - -export type SnippetResultMatchLevel = 'full' | 'none' | 'partial'; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/trendingModels.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/trendingModels.ts deleted file mode 100644 index 1a9292d4e6..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/trendingModels.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * The trending model to use. - */ - -export type TrendingModels = 'trending-facets' | 'trending-items'; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/trendingRequest.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/trendingRequest.ts deleted file mode 100644 index 60b8c26cb7..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/trendingRequest.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { BaseRecommendRequest } from './baseRecommendRequest'; -import type { BaseTrendingRequest } from './baseTrendingRequest'; - -export type TrendingRequest = BaseRecommendRequest & BaseTrendingRequest; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/package.json b/clients/algoliasearch-client-javascript/packages/recommend/package.json deleted file mode 100644 index 20a72c04bc..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@experimental-api-clients-automation/recommend", - "version": "0.0.5", - "description": "JavaScript client for @experimental-api-clients-automation/recommend", - "repository": "algolia/algoliasearch-client-javascript", - "author": "Algolia", - "license": "MIT", - "main": "index.js", - "module": "dist/recommend.esm.node.js", - "types": "index.d.ts", - "jsdelivr": "dist/recommend.umd.browser.js", - "unpkg": "dist/recommend.umd.browser.js", - "browser": "dist/recommend.cjs.browser.js", - "scripts": { - "clean": "rm -rf ./dist" - }, - "files": [ - "dist", - "model", - "index.js", - "index.d.ts" - ], - "engines": { - "node": ">= 14.0.0" - }, - "dependencies": { - "@experimental-api-clients-automation/client-common": "0.0.5", - "@experimental-api-clients-automation/requester-browser-xhr": "0.0.5", - "@experimental-api-clients-automation/requester-node-http": "0.0.5" - }, - "devDependencies": { - "@types/node": "16.11.26", - "typescript": "4.6.3" - } -} diff --git a/clients/algoliasearch-client-javascript/packages/recommend/src/recommendApi.ts b/clients/algoliasearch-client-javascript/packages/recommend/src/recommendApi.ts deleted file mode 100644 index eb84c828e6..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/src/recommendApi.ts +++ /dev/null @@ -1,331 +0,0 @@ -import { - createAuth, - createTransporter, - getUserAgent, - shuffle, -} from '@experimental-api-clients-automation/client-common'; -import type { - CreateClientOptions, - Headers, - Host, - Request, - RequestOptions, - QueryParameters, -} from '@experimental-api-clients-automation/client-common'; - -import type { GetRecommendationsParams } from '../model/getRecommendationsParams'; -import type { GetRecommendationsResponse } from '../model/getRecommendationsResponse'; - -export * from '../model/models'; -export const apiClientVersion = '0.0.5'; - -function getDefaultHosts(appId: string): Host[] { - return ( - [ - { - url: `${appId}-dsn.algolia.net`, - accept: 'read', - protocol: 'https', - }, - { - url: `${appId}.algolia.net`, - accept: 'write', - protocol: 'https', - }, - ] as Host[] - ).concat( - shuffle([ - { - url: `${appId}-1.algolianet.com`, - accept: 'readWrite', - protocol: 'https', - }, - { - url: `${appId}-2.algolianet.com`, - accept: 'readWrite', - protocol: 'https', - }, - { - url: `${appId}-3.algolianet.com`, - accept: 'readWrite', - protocol: 'https', - }, - ]) - ); -} - -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -export function createRecommendApi(options: CreateClientOptions) { - const auth = createAuth(options.appId, options.apiKey, options.authMode); - const transporter = createTransporter({ - hosts: options?.hosts ?? getDefaultHosts(options.appId), - hostsCache: options.hostsCache, - requestsCache: options.requestsCache, - responsesCache: options.responsesCache, - baseHeaders: { - 'content-type': 'application/x-www-form-urlencoded', - ...auth.headers(), - }, - baseQueryParameters: auth.queryParameters(), - userAgent: getUserAgent({ - userAgents: options.userAgents, - client: 'Recommend', - version: apiClientVersion, - }), - timeouts: options.timeouts, - requester: options.requester, - }); - - function addUserAgent(segment: string, version?: string): void { - transporter.userAgent.add({ segment, version }); - } - - return { - addUserAgent, - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param del - The del object. - * @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param del.parameters - Query parameters to be applied to the current query. - * @param del.body - The parameters to send with the custom request. - */ - del( - { path, parameters, body }: DelProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `del`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param get - The get object. - * @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param get.parameters - Query parameters to be applied to the current query. - */ - get( - { path, parameters }: GetProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `get`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'GET', - path: requestPath, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * Returns recommendations for a specific model and objectID. - * - * @summary Returns recommendations for a specific model and objectID. - * @param getRecommendationsParams - The getRecommendationsParams object. - */ - getRecommendations( - getRecommendationsParams: GetRecommendationsParams, - requestOptions?: RequestOptions - ): Promise { - if (!getRecommendationsParams) { - throw new Error( - 'Parameter `getRecommendationsParams` is required when calling `getRecommendations`.' - ); - } - - if (!getRecommendationsParams.requests) { - throw new Error( - 'Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.' - ); - } - - const requestPath = '/1/indexes/*/recommendations'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: getRecommendationsParams, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param post - The post object. - * @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param post.parameters - Query parameters to be applied to the current query. - * @param post.body - The parameters to send with the custom request. - */ - post( - { path, parameters, body }: PostProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `post`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'POST', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param put - The put object. - * @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified. - * @param put.parameters - Query parameters to be applied to the current query. - * @param put.body - The parameters to send with the custom request. - */ - put( - { path, parameters, body }: PutProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `put`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters || {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - data: body, - }; - - return transporter.request( - request, - { - queryParameters, - headers, - }, - requestOptions - ); - }, - }; -} - -export type RecommendApi = ReturnType; - -export type DelProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type GetProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; -}; - -export type PostProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; - -export type PutProps = { - /** - * The path of the API endpoint to target, anything after the /1 needs to be specified. - */ - path: string; - /** - * Query parameters to be applied to the current query. - */ - parameters?: Record; - /** - * The parameters to send with the custom request. - */ - body?: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/tsconfig.json b/clients/algoliasearch-client-javascript/packages/recommend/tsconfig.json deleted file mode 100644 index 89b2007fbb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "dist", - }, - "include": ["src", "model", "builds/node.ts", "builds/browser.ts"], - "exclude": ["dist", "node_modules"] -} diff --git a/clients/algoliasearch-client-php/.gitignore b/clients/algoliasearch-client-php/.gitignore deleted file mode 100644 index aa44c17b5e..0000000000 --- a/clients/algoliasearch-client-php/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore - -composer.phar -/vendor/ - -# php-cs-fixer cache -.php_cs.cache - -# PHPUnit cache -.phpunit.result.cache - -.openapi-generator/ -composer.lock diff --git a/clients/algoliasearch-client-php/.php-cs-fixer.php b/clients/algoliasearch-client-php/.php-cs-fixer.php deleted file mode 100644 index 90c95dcf68..0000000000 --- a/clients/algoliasearch-client-php/.php-cs-fixer.php +++ /dev/null @@ -1,63 +0,0 @@ -setUsingCache(true) - ->setRules([ - 'array_syntax' => [ 'syntax' => 'short' ], - 'blank_line_after_namespace' => false, - 'blank_line_after_opening_tag' => true, - 'blank_line_before_statement' => true, - 'braces' => false, - 'cast_spaces' => true, - 'combine_consecutive_unsets' => true, - 'echo_tag_syntax' => true, - 'general_phpdoc_tag_rename' => true, - 'mb_str_functions' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_short_bool_cast' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'normalize_index_brace' => true, - 'not_operator_with_space' => false, - 'object_operator_without_whitespace' => true, - 'ordered_imports' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_inline_tag_normalizer' => true, - 'phpdoc_order' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_tag_type' => true, - 'protected_to_private' => true, - '@PSR2' => true, - 'short_scalar_cast' => true, - 'single_blank_line_at_eof' => false, - 'single_blank_line_before_namespace' => true, - 'single_quote' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'strict_comparison' => true, - 'strict_param' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline' => true, - 'trim_array_spaces' => true, - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude('test') - ->exclude('tests') - ->in(__DIR__) - ); diff --git a/clients/algoliasearch-client-php/composer.json b/clients/algoliasearch-client-php/composer.json deleted file mode 100644 index 2b05cd1e41..0000000000 --- a/clients/algoliasearch-client-php/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "algolia/algoliasearch-client-php", - "description": "API powering the features of Algolia.", - "keywords": [ - "openapitools", - "openapi-generator", - "openapi", - "php", - "sdk", - "rest", - "api" - ], - "homepage": "https://openapi-generator.tech", - "license": "unlicense", - "authors": [ - { - "name": "OpenAPI-Generator contributors", - "homepage": "https://openapi-generator.tech" - } - ], - "require": { - "php": "^7.3 || ^8.0", - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "guzzlehttp/guzzle": "^7.3", - "guzzlehttp/psr7": "^2.0", - "psr/http-message": "^1.0", - "psr/log": "^1.0 || ^2.0 || ^3.0", - "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.5.0", - "phpunit/phpunit": "^9.3" - }, - "autoload": { - "psr-4": { "Algolia\\AlgoliaSearch\\" : "lib/" }, - "files": [ - "lib/Http/Psr7/functions.php" - ] - }, - "autoload-dev": { - "psr-4": { "Algolia\\AlgoliaSearch\\Test\\" : "test/" } - } -} diff --git a/clients/algoliasearch-client-php/lib/Algolia.php b/clients/algoliasearch-client-php/lib/Algolia.php index c9aede0df0..b8a0c01966 100644 --- a/clients/algoliasearch-client-php/lib/Algolia.php +++ b/clients/algoliasearch-client-php/lib/Algolia.php @@ -10,7 +10,7 @@ final class Algolia { - const VERSION = '4.0.0'; + public const VERSION = '4.0.0'; /** * Holds an instance of the simple cache repository (PSR-16). diff --git a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php deleted file mode 100644 index 13217305b2..0000000000 --- a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php +++ /dev/null @@ -1,455 +0,0 @@ -config = $config; - - $this->api = $apiWrapper; - } - - /** - * Instantiate the client with basic credentials and region - * - * @param string $appId Application ID - * @param string $apiKey Algolia API Key - * @param string $region Region - */ - public static function create($appId = null, $apiKey = null, $region = null) - { - $allowedRegions = explode('-', 'us-de'); - $config = AbtestingConfig::create($appId, $apiKey, $region, $allowedRegions); - - return static::createWithConfig($config); - } - - /** - * Instantiate the client with congiguration - * - * @param AbtestingConfig $config Configuration - */ - public static function createWithConfig(AbtestingConfig $config) - { - $config = clone $config; - - if ($hosts = $config->getHosts()) { - // If a list of hosts was passed, we ignore the cache - $clusterHosts = ClusterHosts::create($hosts); - } else { - $clusterHosts = ClusterHosts::create('analytics.'.$config->getRegion().'.algolia.com'); - } - - $apiWrapper = new ApiWrapper( - Algolia::getHttpClient(), - $config, - $clusterHosts - ); - - return new static($apiWrapper, $config); - } - - /** - * @return AbtestingConfig - */ - public function getClientConfig() - { - return $this->config; - } - - /** - * Creates a new A/B test with provided configuration. - * - * @param array $addABTestsRequest addABTestsRequest (required) - * - * @return array - */ - public function addABTests($addABTestsRequest) - { - // verify the required parameter 'addABTestsRequest' is set - if ($addABTestsRequest === null || (is_array($addABTestsRequest) && count($addABTestsRequest) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $addABTestsRequest when calling addABTests' - ); - } - - $resourcePath = '/2/abtests'; - $queryParams = []; - $httpBody = []; - - if (isset($addABTestsRequest)) { - $httpBody = $addABTestsRequest; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function del($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling del' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Deletes the A/B Test. - * - * @param int $id The A/B test ID. (required) - * - * @return array - */ - public function deleteABTest($id) - { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteABTest' - ); - } - - $resourcePath = '/2/abtests/{id}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{id}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * - * @return array - */ - public function get($path, $parameters = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling get' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns metadata and metrics for A/B test id. - * - * @param int $id The A/B test ID. (required) - * - * @return array - */ - public function getABTest($id) - { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getABTest' - ); - } - - $resourcePath = '/2/abtests/{id}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{id}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Fetch all existing A/B tests for App that are available for the current API Key. - * - * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) - * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) - * - * @return array - */ - public function listABTests($offset = 0, $limit = 10) - { - $resourcePath = '/2/abtests'; - $queryParams = []; - $httpBody = []; - - if ($offset !== null) { - if ('form' === 'form' && is_array($offset)) { - foreach ($offset as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['offset'] = $offset; - } - } - - if ($limit !== null) { - if ('form' === 'form' && is_array($limit)) { - foreach ($limit as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['limit'] = $limit; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function post($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling post' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function put($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling put' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - /** - * Marks the A/B test as stopped. - * - * @param int $id The A/B test ID. (required) - * - * @return array - */ - public function stopABTest($id) - { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling stopABTest' - ); - } - - $resourcePath = '/2/abtests/{id}/stop'; - $queryParams = []; - $httpBody = []; - - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{id}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - private function sendRequest($method, $resourcePath, $queryParams, $httpBody) - { - $query = \GuzzleHttp\Psr7\Query::build($queryParams); - - if ($method === 'GET') { - $request = $this->api->read( - $method, - $resourcePath . ($query ? "?{$query}" : '') - ); - } else { - $request = $this->api->write( - $method, - $resourcePath . ($query ? "?{$query}" : ''), - $httpBody - ); - } - - return $request; - } -} diff --git a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php deleted file mode 100644 index 3e02fc3cf6..0000000000 --- a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php +++ /dev/null @@ -1,1776 +0,0 @@ -config = $config; - - $this->api = $apiWrapper; - } - - /** - * Instantiate the client with basic credentials and region - * - * @param string $appId Application ID - * @param string $apiKey Algolia API Key - * @param string $region Region - */ - public static function create($appId = null, $apiKey = null, $region = null) - { - $allowedRegions = explode('-', 'us-de'); - $config = AnalyticsConfig::create($appId, $apiKey, $region, $allowedRegions); - - return static::createWithConfig($config); - } - - /** - * Instantiate the client with congiguration - * - * @param AnalyticsConfig $config Configuration - */ - public static function createWithConfig(AnalyticsConfig $config) - { - $config = clone $config; - - if ($hosts = $config->getHosts()) { - // If a list of hosts was passed, we ignore the cache - $clusterHosts = ClusterHosts::create($hosts); - } else { - $clusterHosts = ClusterHosts::create('analytics.'.$config->getRegion().'.algolia.com'); - } - - $apiWrapper = new ApiWrapper( - Algolia::getHttpClient(), - $config, - $clusterHosts - ); - - return new static($apiWrapper, $config); - } - - /** - * @return AnalyticsConfig - */ - public function getClientConfig() - { - return $this->config; - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function del($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling del' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * - * @return array - */ - public function get($path, $parameters = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling get' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns the average click position. - * - * @param string $index The index name to target. (required) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getAverageClickPosition($index, $startDate = null, $endDate = null, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getAverageClickPosition' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getAverageClickPosition, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getAverageClickPosition, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/clicks/averageClickPosition'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns the distribution of clicks per range of positions. - * - * @param string $index The index name to target. (required) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getClickPositions($index, $startDate = null, $endDate = null, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getClickPositions' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getClickPositions, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getClickPositions, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/clicks/positions'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns a click-through rate (CTR). - * - * @param string $index The index name to target. (required) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getClickThroughRate($index, $startDate = null, $endDate = null, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getClickThroughRate' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getClickThroughRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getClickThroughRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/clicks/clickThroughRate'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns a conversion rate (CR). - * - * @param string $index The index name to target. (required) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getConversationRate($index, $startDate = null, $endDate = null, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getConversationRate' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getConversationRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getConversationRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/conversions/conversionRate'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns the rate at which searches didn't lead to any clicks. - * - * @param string $index The index name to target. (required) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getNoClickRate($index, $startDate = null, $endDate = null, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getNoClickRate' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getNoClickRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getNoClickRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/searches/noClickRate'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns the rate at which searches didn't return any results. - * - * @param string $index The index name to target. (required) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getNoResultsRate($index, $startDate = null, $endDate = null, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getNoResultsRate' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getNoResultsRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getNoResultsRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/searches/noResultRate'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns the number of searches across the given time range. - * - * @param string $index The index name to target. (required) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getSearchesCount($index, $startDate = null, $endDate = null, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getSearchesCount' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getSearchesCount, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getSearchesCount, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/searches/count'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns top searches that didn't lead to any clicks. - * - * @param string $index The index name to target. (required) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) - * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getSearchesNoClicks($index, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getSearchesNoClicks' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getSearchesNoClicks, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getSearchesNoClicks, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/searches/noClicks'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($limit !== null) { - if ('form' === 'form' && is_array($limit)) { - foreach ($limit as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['limit'] = $limit; - } - } - - if ($offset !== null) { - if ('form' === 'form' && is_array($offset)) { - foreach ($offset as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['offset'] = $offset; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns top searches that didn't return any results. - * - * @param string $index The index name to target. (required) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) - * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getSearchesNoResults($index, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getSearchesNoResults' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getSearchesNoResults, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getSearchesNoResults, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/searches/noResults'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($limit !== null) { - if ('form' === 'form' && is_array($limit)) { - foreach ($limit as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['limit'] = $limit; - } - } - - if ($offset !== null) { - if ('form' === 'form' && is_array($offset)) { - foreach ($offset as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['offset'] = $offset; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get latest update time of the analytics API. - * - * @param string $index The index name to target. (required) - * - * @return array - */ - public function getStatus($index) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getStatus' - ); - } - - $resourcePath = '/2/status'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns top countries. - * - * @param string $index The index name to target. (required) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) - * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getTopCountries($index, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getTopCountries' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getTopCountries, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getTopCountries, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/countries'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($limit !== null) { - if ('form' === 'form' && is_array($limit)) { - foreach ($limit as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['limit'] = $limit; - } - } - - if ($offset !== null) { - if ('form' === 'form' && is_array($offset)) { - foreach ($offset as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['offset'] = $offset; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns top filter attributes. - * - * @param string $index The index name to target. (required) - * @param string $search The query term to search for. Must match the exact user input. (optional) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) - * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getTopFilterAttributes($index, $search = null, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getTopFilterAttributes' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getTopFilterAttributes, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getTopFilterAttributes, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/filters'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($search !== null) { - if ('form' === 'form' && is_array($search)) { - foreach ($search as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['search'] = $search; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($limit !== null) { - if ('form' === 'form' && is_array($limit)) { - foreach ($limit as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['limit'] = $limit; - } - } - - if ($offset !== null) { - if ('form' === 'form' && is_array($offset)) { - foreach ($offset as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['offset'] = $offset; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns top filters for the given attribute. - * - * @param string $attribute The exact name of the attribute. (required) - * @param string $index The index name to target. (required) - * @param string $search The query term to search for. Must match the exact user input. (optional) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) - * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getTopFilterForAttribute($attribute, $index, $search = null, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) - { - // verify the required parameter 'attribute' is set - if ($attribute === null || (is_array($attribute) && count($attribute) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $attribute when calling getTopFilterForAttribute' - ); - } - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getTopFilterForAttribute' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getTopFilterForAttribute, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getTopFilterForAttribute, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/filters/{attribute}'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($search !== null) { - if ('form' === 'form' && is_array($search)) { - foreach ($search as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['search'] = $search; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($limit !== null) { - if ('form' === 'form' && is_array($limit)) { - foreach ($limit as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['limit'] = $limit; - } - } - - if ($offset !== null) { - if ('form' === 'form' && is_array($offset)) { - foreach ($offset as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['offset'] = $offset; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - // path params - if ($attribute !== null) { - $resourcePath = str_replace( - '{attribute}', - ObjectSerializer::toPathValue($attribute), - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns top filters with no results. - * - * @param string $index The index name to target. (required) - * @param string $search The query term to search for. Must match the exact user input. (optional) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) - * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getTopFiltersNoResults($index, $search = null, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getTopFiltersNoResults' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getTopFiltersNoResults, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getTopFiltersNoResults, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/filters/noResults'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($search !== null) { - if ('form' === 'form' && is_array($search)) { - foreach ($search as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['search'] = $search; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($limit !== null) { - if ('form' === 'form' && is_array($limit)) { - foreach ($limit as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['limit'] = $limit; - } - } - - if ($offset !== null) { - if ('form' === 'form' && is_array($offset)) { - foreach ($offset as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['offset'] = $offset; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns top hits. - * - * @param string $index The index name to target. (required) - * @param string $search The query term to search for. Must match the exact user input. (optional) - * @param array $clickAnalytics Whether to include the click-through and conversion rates for a search. (optional, default to false) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) - * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getTopHits($index, $search = null, $clickAnalytics = false, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getTopHits' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getTopHits, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getTopHits, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/hits'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($search !== null) { - if ('form' === 'form' && is_array($search)) { - foreach ($search as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['search'] = $search; - } - } - - if ($clickAnalytics !== null) { - if ('form' === 'form' && is_array($clickAnalytics)) { - foreach ($clickAnalytics as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['clickAnalytics'] = $clickAnalytics; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($limit !== null) { - if ('form' === 'form' && is_array($limit)) { - foreach ($limit as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['limit'] = $limit; - } - } - - if ($offset !== null) { - if ('form' === 'form' && is_array($offset)) { - foreach ($offset as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['offset'] = $offset; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns top searches. - * - * @param string $index The index name to target. (required) - * @param array $clickAnalytics Whether to include the click-through and conversion rates for a search. (optional, default to false) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $orderBy Reorder the results. (optional, default to 'searchCount') - * @param string $direction The sorting of the result. (optional, default to 'asc') - * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) - * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getTopSearches($index, $clickAnalytics = false, $startDate = null, $endDate = null, $orderBy = 'searchCount', $direction = 'asc', $limit = 10, $offset = 0, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getTopSearches' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getTopSearches, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getTopSearches, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/searches'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($clickAnalytics !== null) { - if ('form' === 'form' && is_array($clickAnalytics)) { - foreach ($clickAnalytics as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['clickAnalytics'] = $clickAnalytics; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($orderBy !== null) { - if ('form' === 'form' && is_array($orderBy)) { - foreach ($orderBy as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['orderBy'] = $orderBy; - } - } - - if ($direction !== null) { - if ('form' === 'form' && is_array($direction)) { - foreach ($direction as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['direction'] = $direction; - } - } - - if ($limit !== null) { - if ('form' === 'form' && is_array($limit)) { - foreach ($limit as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['limit'] = $limit; - } - } - - if ($offset !== null) { - if ('form' === 'form' && is_array($offset)) { - foreach ($offset as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['offset'] = $offset; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns the distinct count of users across the given time range. - * - * @param string $index The index name to target. (required) - * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) - * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) - * - * @return array - */ - public function getUsersCount($index, $startDate = null, $endDate = null, $tags = null) - { - // verify the required parameter 'index' is set - if ($index === null || (is_array($index) && count($index) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $index when calling getUsersCount' - ); - } - if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { - throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getUsersCount, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { - throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getUsersCount, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); - } - - $resourcePath = '/2/users/count'; - $queryParams = []; - $httpBody = []; - - if ($index !== null) { - if ('form' === 'form' && is_array($index)) { - foreach ($index as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['index'] = $index; - } - } - - if ($startDate !== null) { - if ('form' === 'form' && is_array($startDate)) { - foreach ($startDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['startDate'] = $startDate; - } - } - - if ($endDate !== null) { - if ('form' === 'form' && is_array($endDate)) { - foreach ($endDate as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['endDate'] = $endDate; - } - } - - if ($tags !== null) { - if ('form' === 'form' && is_array($tags)) { - foreach ($tags as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['tags'] = $tags; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function post($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling post' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function put($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling put' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - private function sendRequest($method, $resourcePath, $queryParams, $httpBody) - { - $query = \GuzzleHttp\Psr7\Query::build($queryParams); - - if ($method === 'GET') { - $request = $this->api->read( - $method, - $resourcePath . ($query ? "?{$query}" : '') - ); - } else { - $request = $this->api->write( - $method, - $resourcePath . ($query ? "?{$query}" : ''), - $httpBody - ); - } - - return $request; - } -} diff --git a/clients/algoliasearch-client-php/lib/Api/InsightsApi.php b/clients/algoliasearch-client-php/lib/Api/InsightsApi.php deleted file mode 100644 index fe7180ca3c..0000000000 --- a/clients/algoliasearch-client-php/lib/Api/InsightsApi.php +++ /dev/null @@ -1,321 +0,0 @@ -config = $config; - - $this->api = $apiWrapper; - } - - /** - * Instantiate the client with basic credentials and region - * - * @param string $appId Application ID - * @param string $apiKey Algolia API Key - * @param string $region Region - */ - public static function create($appId = null, $apiKey = null, $region = null) - { - $allowedRegions = explode('-', 'us-de'); - $config = InsightsConfig::create($appId, $apiKey, $region, $allowedRegions); - - return static::createWithConfig($config); - } - - /** - * Instantiate the client with congiguration - * - * @param InsightsConfig $config Configuration - */ - public static function createWithConfig(InsightsConfig $config) - { - $config = clone $config; - - if ($hosts = $config->getHosts()) { - // If a list of hosts was passed, we ignore the cache - $clusterHosts = ClusterHosts::create($hosts); - } else { - $clusterHosts = ClusterHosts::create('insights.'.$config->getRegion().'.algolia.io'); - } - - $apiWrapper = new ApiWrapper( - Algolia::getHttpClient(), - $config, - $clusterHosts - ); - - return new static($apiWrapper, $config); - } - - /** - * @return InsightsConfig - */ - public function getClientConfig() - { - return $this->config; - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function del($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling del' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * - * @return array - */ - public function get($path, $parameters = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling get' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function post($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling post' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Pushes an array of events. - * - * @param array $insightEvents insightEvents (required) - * - * @return array - */ - public function pushEvents($insightEvents) - { - // verify the required parameter 'insightEvents' is set - if ($insightEvents === null || (is_array($insightEvents) && count($insightEvents) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $insightEvents when calling pushEvents' - ); - } - - $resourcePath = '/1/events'; - $queryParams = []; - $httpBody = []; - - if (isset($insightEvents)) { - $httpBody = $insightEvents; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function put($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling put' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - private function sendRequest($method, $resourcePath, $queryParams, $httpBody) - { - $query = \GuzzleHttp\Psr7\Query::build($queryParams); - - if ($method === 'GET') { - $request = $this->api->read( - $method, - $resourcePath . ($query ? "?{$query}" : '') - ); - } else { - $request = $this->api->write( - $method, - $resourcePath . ($query ? "?{$query}" : ''), - $httpBody - ); - } - - return $request; - } -} diff --git a/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php b/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php deleted file mode 100644 index ecf80c0fb4..0000000000 --- a/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php +++ /dev/null @@ -1,401 +0,0 @@ -config = $config; - - $this->api = $apiWrapper; - } - - /** - * Instantiate the client with basic credentials and region - * - * @param string $appId Application ID - * @param string $apiKey Algolia API Key - * @param string $region Region - */ - public static function create($appId = null, $apiKey = null, $region = null) - { - $allowedRegions = explode('-', 'us-eu'); - $config = PersonalizationConfig::create($appId, $apiKey, $region, $allowedRegions); - - return static::createWithConfig($config); - } - - /** - * Instantiate the client with congiguration - * - * @param PersonalizationConfig $config Configuration - */ - public static function createWithConfig(PersonalizationConfig $config) - { - $config = clone $config; - - if ($hosts = $config->getHosts()) { - // If a list of hosts was passed, we ignore the cache - $clusterHosts = ClusterHosts::create($hosts); - } else { - $clusterHosts = ClusterHosts::create('personalization.'.$config->getRegion().'.algolia.com'); - } - - $apiWrapper = new ApiWrapper( - Algolia::getHttpClient(), - $config, - $clusterHosts - ); - - return new static($apiWrapper, $config); - } - - /** - * @return PersonalizationConfig - */ - public function getClientConfig() - { - return $this->config; - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function del($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling del' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Delete the user profile and all its associated data. - * - * @param string $userToken userToken representing the user for which to fetch the Personalization profile. (required) - * - * @return array - */ - public function deleteUserProfile($userToken) - { - // verify the required parameter 'userToken' is set - if ($userToken === null || (is_array($userToken) && count($userToken) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $userToken when calling deleteUserProfile' - ); - } - - $resourcePath = '/1/profiles/{userToken}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($userToken !== null) { - $resourcePath = str_replace( - '{userToken}', - ObjectSerializer::toPathValue($userToken), - $resourcePath - ); - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * - * @return array - */ - public function get($path, $parameters = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling get' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get the current personalization strategy. - * - * - * @return array - */ - public function getPersonalizationStrategy() - { - $resourcePath = '/1/strategies/personalization'; - $queryParams = []; - $httpBody = []; - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get the user profile built from Personalization strategy. - * - * @param string $userToken userToken representing the user for which to fetch the Personalization profile. (required) - * - * @return array - */ - public function getUserTokenProfile($userToken) - { - // verify the required parameter 'userToken' is set - if ($userToken === null || (is_array($userToken) && count($userToken) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $userToken when calling getUserTokenProfile' - ); - } - - $resourcePath = '/1/profiles/personalization/{userToken}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($userToken !== null) { - $resourcePath = str_replace( - '{userToken}', - ObjectSerializer::toPathValue($userToken), - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function post($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling post' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function put($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling put' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - /** - * Set a new personalization strategy. - * - * @param array $personalizationStrategyParams personalizationStrategyParams (required) - * - * @return array - */ - public function setPersonalizationStrategy($personalizationStrategyParams) - { - // verify the required parameter 'personalizationStrategyParams' is set - if ($personalizationStrategyParams === null || (is_array($personalizationStrategyParams) && count($personalizationStrategyParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $personalizationStrategyParams when calling setPersonalizationStrategy' - ); - } - - $resourcePath = '/1/strategies/personalization'; - $queryParams = []; - $httpBody = []; - - if (isset($personalizationStrategyParams)) { - $httpBody = $personalizationStrategyParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - private function sendRequest($method, $resourcePath, $queryParams, $httpBody) - { - $query = \GuzzleHttp\Psr7\Query::build($queryParams); - - if ($method === 'GET') { - $request = $this->api->read( - $method, - $resourcePath . ($query ? "?{$query}" : '') - ); - } else { - $request = $this->api->write( - $method, - $resourcePath . ($query ? "?{$query}" : ''), - $httpBody - ); - } - - return $request; - } -} diff --git a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php deleted file mode 100644 index f03f9d1648..0000000000 --- a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php +++ /dev/null @@ -1,508 +0,0 @@ -config = $config; - - $this->api = $apiWrapper; - } - - /** - * Instantiate the client with basic credentials and region - * - * @param string $appId Application ID - * @param string $apiKey Algolia API Key - * @param string $region Region - */ - public static function create($appId = null, $apiKey = null, $region = null) - { - $allowedRegions = explode('-', 'us-eu'); - $config = QuerySuggestionsConfig::create($appId, $apiKey, $region, $allowedRegions); - - return static::createWithConfig($config); - } - - /** - * Instantiate the client with congiguration - * - * @param QuerySuggestionsConfig $config Configuration - */ - public static function createWithConfig(QuerySuggestionsConfig $config) - { - $config = clone $config; - - if ($hosts = $config->getHosts()) { - // If a list of hosts was passed, we ignore the cache - $clusterHosts = ClusterHosts::create($hosts); - } else { - $clusterHosts = ClusterHosts::create('query-suggestions.'.$config->getRegion().'.algolia.com'); - } - - $apiWrapper = new ApiWrapper( - Algolia::getHttpClient(), - $config, - $clusterHosts - ); - - return new static($apiWrapper, $config); - } - - /** - * @return QuerySuggestionsConfig - */ - public function getClientConfig() - { - return $this->config; - } - - /** - * Create a configuration of a Query Suggestions index. - * - * @param array $querySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam (required) - * - * @return array - */ - public function createConfig($querySuggestionsIndexWithIndexParam) - { - // verify the required parameter 'querySuggestionsIndexWithIndexParam' is set - if ($querySuggestionsIndexWithIndexParam === null || (is_array($querySuggestionsIndexWithIndexParam) && count($querySuggestionsIndexWithIndexParam) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $querySuggestionsIndexWithIndexParam when calling createConfig' - ); - } - - $resourcePath = '/1/configs'; - $queryParams = []; - $httpBody = []; - - if (isset($querySuggestionsIndexWithIndexParam)) { - $httpBody = $querySuggestionsIndexWithIndexParam; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function del($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling del' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Delete a configuration of a Query Suggestion's index. - * - * @param string $indexName The index in which to perform the request. (required) - * - * @return array - */ - public function deleteConfig($indexName) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling deleteConfig' - ); - } - - $resourcePath = '/1/configs/{indexName}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * - * @return array - */ - public function get($path, $parameters = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling get' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get all the configurations of Query Suggestions. - * - * - * @return array - */ - public function getAllConfigs() - { - $resourcePath = '/1/configs'; - $queryParams = []; - $httpBody = []; - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get the configuration of a single Query Suggestions index. - * - * @param string $indexName The index in which to perform the request. (required) - * - * @return array - */ - public function getConfig($indexName) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling getConfig' - ); - } - - $resourcePath = '/1/configs/{indexName}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get the status of a Query Suggestion's index. - * - * @param string $indexName The index in which to perform the request. (required) - * - * @return array - */ - public function getConfigStatus($indexName) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling getConfigStatus' - ); - } - - $resourcePath = '/1/configs/{indexName}/status'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get the log file of the last build of a single Query Suggestion index. - * - * @param string $indexName The index in which to perform the request. (required) - * - * @return array - */ - public function getLogFile($indexName) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling getLogFile' - ); - } - - $resourcePath = '/1/logs/{indexName}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function post($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling post' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function put($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling put' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - /** - * Update the configuration of a Query Suggestions index. - * - * @param string $indexName The index in which to perform the request. (required) - * @param array $querySuggestionsIndexParam querySuggestionsIndexParam (required) - * - * @return array - */ - public function updateConfig($indexName, $querySuggestionsIndexParam) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling updateConfig' - ); - } - // verify the required parameter 'querySuggestionsIndexParam' is set - if ($querySuggestionsIndexParam === null || (is_array($querySuggestionsIndexParam) && count($querySuggestionsIndexParam) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $querySuggestionsIndexParam when calling updateConfig' - ); - } - - $resourcePath = '/1/configs/{indexName}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - if (isset($querySuggestionsIndexParam)) { - $httpBody = $querySuggestionsIndexParam; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - private function sendRequest($method, $resourcePath, $queryParams, $httpBody) - { - $query = \GuzzleHttp\Psr7\Query::build($queryParams); - - if ($method === 'GET') { - $request = $this->api->read( - $method, - $resourcePath . ($query ? "?{$query}" : '') - ); - } else { - $request = $this->api->write( - $method, - $resourcePath . ($query ? "?{$query}" : ''), - $httpBody - ); - } - - return $request; - } -} diff --git a/clients/algoliasearch-client-php/lib/Api/RecommendApi.php b/clients/algoliasearch-client-php/lib/Api/RecommendApi.php deleted file mode 100644 index 36251f7a18..0000000000 --- a/clients/algoliasearch-client-php/lib/Api/RecommendApi.php +++ /dev/null @@ -1,322 +0,0 @@ -config = $config; - - $this->api = $apiWrapper; - } - - /** - * Instantiate the client with basic credentials - * - * @param string $appId Application ID - * @param string $apiKey Algolia API Key - */ - public static function create($appId = null, $apiKey = null) - { - return static::createWithConfig(RecommendConfig::create($appId, $apiKey)); - } - - /** - * Instantiate the client with congiguration - * - * @param RecommendConfig $config Configuration - */ - public static function createWithConfig(RecommendConfig $config) - { - $config = clone $config; - - $cacheKey = sprintf('%s-clusterHosts-%s', __CLASS__, $config->getAppId()); - - if ($hosts = $config->getHosts()) { - // If a list of hosts was passed, we ignore the cache - $clusterHosts = ClusterHosts::create($hosts); - } elseif (false === ($clusterHosts = ClusterHosts::createFromCache($cacheKey))) { - // We'll try to restore the ClusterHost from cache, if we cannot - // we create a new instance and set the cache key - $clusterHosts = ClusterHosts::createFromAppId($config->getAppId()) - ->setCacheKey($cacheKey); - } - - $apiWrapper = new ApiWrapper( - Algolia::getHttpClient(), - $config, - $clusterHosts - ); - - return new static($apiWrapper, $config); - } - - /** - * @return RecommendConfig - */ - public function getClientConfig() - { - return $this->config; - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function del($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling del' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * - * @return array - */ - public function get($path, $parameters = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling get' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Returns recommendations for a specific model and objectID. - * - * @param array $getRecommendationsParams getRecommendationsParams (required) - * - * @return array - */ - public function getRecommendations($getRecommendationsParams) - { - // verify the required parameter 'getRecommendationsParams' is set - if ($getRecommendationsParams === null || (is_array($getRecommendationsParams) && count($getRecommendationsParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $getRecommendationsParams when calling getRecommendations' - ); - } - - $resourcePath = '/1/indexes/*/recommendations'; - $queryParams = []; - $httpBody = []; - - if (isset($getRecommendationsParams)) { - $httpBody = $getRecommendationsParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function post($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling post' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function put($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling put' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - private function sendRequest($method, $resourcePath, $queryParams, $httpBody) - { - $query = \GuzzleHttp\Psr7\Query::build($queryParams); - - if ($method === 'GET') { - $request = $this->api->read( - $method, - $resourcePath . ($query ? "?{$query}" : '') - ); - } else { - $request = $this->api->write( - $method, - $resourcePath . ($query ? "?{$query}" : ''), - $httpBody - ); - } - - return $request; - } -} diff --git a/clients/algoliasearch-client-php/lib/Api/SearchApi.php b/clients/algoliasearch-client-php/lib/Api/SearchApi.php deleted file mode 100644 index 81d7b50796..0000000000 --- a/clients/algoliasearch-client-php/lib/Api/SearchApi.php +++ /dev/null @@ -1,2605 +0,0 @@ -config = $config; - - $this->api = $apiWrapper; - } - - /** - * Instantiate the client with basic credentials - * - * @param string $appId Application ID - * @param string $apiKey Algolia API Key - */ - public static function create($appId = null, $apiKey = null) - { - return static::createWithConfig(SearchConfig::create($appId, $apiKey)); - } - - /** - * Instantiate the client with congiguration - * - * @param SearchConfig $config Configuration - */ - public static function createWithConfig(SearchConfig $config) - { - $config = clone $config; - - $cacheKey = sprintf('%s-clusterHosts-%s', __CLASS__, $config->getAppId()); - - if ($hosts = $config->getHosts()) { - // If a list of hosts was passed, we ignore the cache - $clusterHosts = ClusterHosts::create($hosts); - } elseif (false === ($clusterHosts = ClusterHosts::createFromCache($cacheKey))) { - // We'll try to restore the ClusterHost from cache, if we cannot - // we create a new instance and set the cache key - $clusterHosts = ClusterHosts::createFromAppId($config->getAppId()) - ->setCacheKey($cacheKey); - } - - $apiWrapper = new ApiWrapper( - Algolia::getHttpClient(), - $config, - $clusterHosts - ); - - return new static($apiWrapper, $config); - } - - /** - * @return SearchConfig - */ - public function getClientConfig() - { - return $this->config; - } - - /** - * Create a new API key. - * - * @param array $apiKey apiKey (required) - * - * @return array - */ - public function addApiKey($apiKey) - { - // verify the required parameter 'apiKey' is set - if ($apiKey === null || (is_array($apiKey) && count($apiKey) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $apiKey when calling addApiKey' - ); - } - - $resourcePath = '/1/keys'; - $queryParams = []; - $httpBody = []; - - if (isset($apiKey)) { - $httpBody = $apiKey; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Add or replace an object with a given object ID. - * - * @param string $indexName The index in which to perform the request. (required) - * @param string $objectID Unique identifier of an object. (required) - * @param array $body The Algolia object. (required) - * - * @return array - */ - public function addOrUpdateObject($indexName, $objectID, $body) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling addOrUpdateObject' - ); - } - // verify the required parameter 'objectID' is set - if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $objectID when calling addOrUpdateObject' - ); - } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling addOrUpdateObject' - ); - } - - $resourcePath = '/1/indexes/{indexName}/{objectID}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - // path params - if ($objectID !== null) { - $resourcePath = str_replace( - '{objectID}', - ObjectSerializer::toPathValue($objectID), - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - /** - * Add a single source. - * - * @param array $source The source to add. (required) - * - * @return array - */ - public function appendSource($source) - { - // verify the required parameter 'source' is set - if ($source === null || (is_array($source) && count($source) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $source when calling appendSource' - ); - } - - $resourcePath = '/1/security/sources/append'; - $queryParams = []; - $httpBody = []; - - if (isset($source)) { - $httpBody = $source; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Assign or Move userID - * - * @param string $xAlgoliaUserID userID to assign. (required) - * @param array $assignUserIdParams assignUserIdParams (required) - * - * @return array - */ - public function assignUserId($xAlgoliaUserID, $assignUserIdParams) - { - // verify the required parameter 'xAlgoliaUserID' is set - if ($xAlgoliaUserID === null || (is_array($xAlgoliaUserID) && count($xAlgoliaUserID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $xAlgoliaUserID when calling assignUserId' - ); - } - if (!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $xAlgoliaUserID)) { - throw new \InvalidArgumentException('invalid value for "xAlgoliaUserID" when calling SearchApi.assignUserId, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/.'); - } - - // verify the required parameter 'assignUserIdParams' is set - if ($assignUserIdParams === null || (is_array($assignUserIdParams) && count($assignUserIdParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $assignUserIdParams when calling assignUserId' - ); - } - - $resourcePath = '/1/clusters/mapping'; - $queryParams = []; - $httpBody = []; - - if ($xAlgoliaUserID !== null) { - if ('form' === 'form' && is_array($xAlgoliaUserID)) { - foreach ($xAlgoliaUserID as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['X-Algolia-User-ID'] = $xAlgoliaUserID; - } - } - - if (isset($assignUserIdParams)) { - $httpBody = $assignUserIdParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Performs multiple write operations in a single API call. - * - * @param string $indexName The index in which to perform the request. (required) - * @param array $batchWriteParams batchWriteParams (required) - * - * @return array - */ - public function batch($indexName, $batchWriteParams) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling batch' - ); - } - // verify the required parameter 'batchWriteParams' is set - if ($batchWriteParams === null || (is_array($batchWriteParams) && count($batchWriteParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $batchWriteParams when calling batch' - ); - } - - $resourcePath = '/1/indexes/{indexName}/batch'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - if (isset($batchWriteParams)) { - $httpBody = $batchWriteParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Batch assign userIDs - * - * @param string $xAlgoliaUserID userID to assign. (required) - * @param array $batchAssignUserIdsParams batchAssignUserIdsParams (required) - * - * @return array - */ - public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsParams) - { - // verify the required parameter 'xAlgoliaUserID' is set - if ($xAlgoliaUserID === null || (is_array($xAlgoliaUserID) && count($xAlgoliaUserID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $xAlgoliaUserID when calling batchAssignUserIds' - ); - } - if (!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $xAlgoliaUserID)) { - throw new \InvalidArgumentException('invalid value for "xAlgoliaUserID" when calling SearchApi.batchAssignUserIds, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/.'); - } - - // verify the required parameter 'batchAssignUserIdsParams' is set - if ($batchAssignUserIdsParams === null || (is_array($batchAssignUserIdsParams) && count($batchAssignUserIdsParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $batchAssignUserIdsParams when calling batchAssignUserIds' - ); - } - - $resourcePath = '/1/clusters/mapping/batch'; - $queryParams = []; - $httpBody = []; - - if ($xAlgoliaUserID !== null) { - if ('form' === 'form' && is_array($xAlgoliaUserID)) { - foreach ($xAlgoliaUserID as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['X-Algolia-User-ID'] = $xAlgoliaUserID; - } - } - - if (isset($batchAssignUserIdsParams)) { - $httpBody = $batchAssignUserIdsParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send a batch of dictionary entries. - * - * @param array $dictionaryName The dictionary to search in. (required) - * @param array $batchDictionaryEntriesParams batchDictionaryEntriesParams (required) - * - * @return array - */ - public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntriesParams) - { - // verify the required parameter 'dictionaryName' is set - if ($dictionaryName === null || (is_array($dictionaryName) && count($dictionaryName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $dictionaryName when calling batchDictionaryEntries' - ); - } - // verify the required parameter 'batchDictionaryEntriesParams' is set - if ($batchDictionaryEntriesParams === null || (is_array($batchDictionaryEntriesParams) && count($batchDictionaryEntriesParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $batchDictionaryEntriesParams when calling batchDictionaryEntries' - ); - } - - $resourcePath = '/1/dictionaries/{dictionaryName}/batch'; - $queryParams = []; - $httpBody = []; - - // path params - if ($dictionaryName !== null) { - $resourcePath = str_replace( - '{dictionaryName}', - ObjectSerializer::toPathValue($dictionaryName), - $resourcePath - ); - } - - if (isset($batchDictionaryEntriesParams)) { - $httpBody = $batchDictionaryEntriesParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Batch Rules. - * - * @param string $indexName The index in which to perform the request. (required) - * @param array $rule rule (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) - * @param array $clearExistingRules When true, existing Rules are cleared before adding this batch. When false, existing Rules are kept. (optional) - * - * @return array - */ - public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearExistingRules = null) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling batchRules' - ); - } - // verify the required parameter 'rule' is set - if ($rule === null || (is_array($rule) && count($rule) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $rule when calling batchRules' - ); - } - - $resourcePath = '/1/indexes/{indexName}/rules/batch'; - $queryParams = []; - $httpBody = []; - - if ($forwardToReplicas !== null) { - if ('form' === 'form' && is_array($forwardToReplicas)) { - foreach ($forwardToReplicas as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['forwardToReplicas'] = $forwardToReplicas; - } - } - - if ($clearExistingRules !== null) { - if ('form' === 'form' && is_array($clearExistingRules)) { - foreach ($clearExistingRules as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['clearExistingRules'] = $clearExistingRules; - } - } - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - if (isset($rule)) { - $httpBody = $rule; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Retrieve all index content. - * - * @param string $indexName The index in which to perform the request. (required) - * @param array $browseRequest browseRequest (optional) - * - * @return array - */ - public function browse($indexName, $browseRequest = null) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling browse' - ); - } - - $resourcePath = '/1/indexes/{indexName}/browse'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - if (isset($browseRequest)) { - $httpBody = $browseRequest; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Clear all synonyms. - * - * @param string $indexName The index in which to perform the request. (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) - * - * @return array - */ - public function clearAllSynonyms($indexName, $forwardToReplicas = null) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling clearAllSynonyms' - ); - } - - $resourcePath = '/1/indexes/{indexName}/synonyms/clear'; - $queryParams = []; - $httpBody = []; - - if ($forwardToReplicas !== null) { - if ('form' === 'form' && is_array($forwardToReplicas)) { - foreach ($forwardToReplicas as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['forwardToReplicas'] = $forwardToReplicas; - } - } - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * clear all objects from an index. - * - * @param string $indexName The index in which to perform the request. (required) - * - * @return array - */ - public function clearObjects($indexName) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling clearObjects' - ); - } - - $resourcePath = '/1/indexes/{indexName}/clear'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Clear Rules. - * - * @param string $indexName The index in which to perform the request. (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) - * - * @return array - */ - public function clearRules($indexName, $forwardToReplicas = null) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling clearRules' - ); - } - - $resourcePath = '/1/indexes/{indexName}/rules/clear'; - $queryParams = []; - $httpBody = []; - - if ($forwardToReplicas !== null) { - if ('form' === 'form' && is_array($forwardToReplicas)) { - foreach ($forwardToReplicas as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['forwardToReplicas'] = $forwardToReplicas; - } - } - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function del($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling del' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Delete an API key. - * - * @param string $key API Key string. (required) - * - * @return array - */ - public function deleteApiKey($key) - { - // verify the required parameter 'key' is set - if ($key === null || (is_array($key) && count($key) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $key when calling deleteApiKey' - ); - } - - $resourcePath = '/1/keys/{key}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($key !== null) { - $resourcePath = str_replace( - '{key}', - ObjectSerializer::toPathValue($key), - $resourcePath - ); - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Delete all records matching the query. - * - * @param string $indexName The index in which to perform the request. (required) - * @param array $searchParams searchParams (required) - * - * @return array - */ - public function deleteBy($indexName, $searchParams) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling deleteBy' - ); - } - // verify the required parameter 'searchParams' is set - if ($searchParams === null || (is_array($searchParams) && count($searchParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $searchParams when calling deleteBy' - ); - } - - $resourcePath = '/1/indexes/{indexName}/deleteByQuery'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - if (isset($searchParams)) { - $httpBody = $searchParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Delete index. - * - * @param string $indexName The index in which to perform the request. (required) - * - * @return array - */ - public function deleteIndex($indexName) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling deleteIndex' - ); - } - - $resourcePath = '/1/indexes/{indexName}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Delete object. - * - * @param string $indexName The index in which to perform the request. (required) - * @param string $objectID Unique identifier of an object. (required) - * - * @return array - */ - public function deleteObject($indexName, $objectID) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling deleteObject' - ); - } - // verify the required parameter 'objectID' is set - if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $objectID when calling deleteObject' - ); - } - - $resourcePath = '/1/indexes/{indexName}/{objectID}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - // path params - if ($objectID !== null) { - $resourcePath = str_replace( - '{objectID}', - ObjectSerializer::toPathValue($objectID), - $resourcePath - ); - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Delete a rule. - * - * @param string $indexName The index in which to perform the request. (required) - * @param string $objectID Unique identifier of an object. (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) - * - * @return array - */ - public function deleteRule($indexName, $objectID, $forwardToReplicas = null) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling deleteRule' - ); - } - // verify the required parameter 'objectID' is set - if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $objectID when calling deleteRule' - ); - } - - $resourcePath = '/1/indexes/{indexName}/rules/{objectID}'; - $queryParams = []; - $httpBody = []; - - if ($forwardToReplicas !== null) { - if ('form' === 'form' && is_array($forwardToReplicas)) { - foreach ($forwardToReplicas as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['forwardToReplicas'] = $forwardToReplicas; - } - } - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - // path params - if ($objectID !== null) { - $resourcePath = str_replace( - '{objectID}', - ObjectSerializer::toPathValue($objectID), - $resourcePath - ); - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Remove a single source. - * - * @param string $source The IP range of the source. (required) - * - * @return array - */ - public function deleteSource($source) - { - // verify the required parameter 'source' is set - if ($source === null || (is_array($source) && count($source) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $source when calling deleteSource' - ); - } - - $resourcePath = '/1/security/sources/{source}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($source !== null) { - $resourcePath = str_replace( - '{source}', - ObjectSerializer::toPathValue($source), - $resourcePath - ); - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Delete synonym. - * - * @param string $indexName The index in which to perform the request. (required) - * @param string $objectID Unique identifier of an object. (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) - * - * @return array - */ - public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling deleteSynonym' - ); - } - // verify the required parameter 'objectID' is set - if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $objectID when calling deleteSynonym' - ); - } - - $resourcePath = '/1/indexes/{indexName}/synonyms/{objectID}'; - $queryParams = []; - $httpBody = []; - - if ($forwardToReplicas !== null) { - if ('form' === 'form' && is_array($forwardToReplicas)) { - foreach ($forwardToReplicas as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['forwardToReplicas'] = $forwardToReplicas; - } - } - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - // path params - if ($objectID !== null) { - $resourcePath = str_replace( - '{objectID}', - ObjectSerializer::toPathValue($objectID), - $resourcePath - ); - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * - * @return array - */ - public function get($path, $parameters = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling get' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get an API key. - * - * @param string $key API Key string. (required) - * - * @return array - */ - public function getApiKey($key) - { - // verify the required parameter 'key' is set - if ($key === null || (is_array($key) && count($key) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $key when calling getApiKey' - ); - } - - $resourcePath = '/1/keys/{key}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($key !== null) { - $resourcePath = str_replace( - '{key}', - ObjectSerializer::toPathValue($key), - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * List dictionaries supported per language. - * - * - * @return array - */ - public function getDictionaryLanguages() - { - $resourcePath = '/1/dictionaries/*/languages'; - $queryParams = []; - $httpBody = []; - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values. - * - * - * @return array - */ - public function getDictionarySettings() - { - $resourcePath = '/1/dictionaries/*/settings'; - $queryParams = []; - $httpBody = []; - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Return the lastest log entries. - * - * @param int $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 int $length Maximum number of entries to retrieve. The maximum allowed value is 1000. (optional, default to 10) - * @param string $indexName Index for which log entries should be retrieved. When omitted, log entries are retrieved across all indices. (optional) - * @param array $type Type of log entries to retrieve. When omitted, all log entries are retrieved. (optional) - * - * @return array - */ - public function getLogs($offset = 0, $length = 10, $indexName = null, $type = null) - { - if ($length !== null && $length > 1000) { - throw new \InvalidArgumentException('invalid value for "$length" when calling SearchApi.getLogs, must be smaller than or equal to 1000.'); - } - - $resourcePath = '/1/logs'; - $queryParams = []; - $httpBody = []; - - if ($offset !== null) { - if ('form' === 'form' && is_array($offset)) { - foreach ($offset as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['offset'] = $offset; - } - } - - if ($length !== null) { - if ('form' === 'form' && is_array($length)) { - foreach ($length as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['length'] = $length; - } - } - - if ($indexName !== null) { - if ('form' === 'form' && is_array($indexName)) { - foreach ($indexName as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['indexName'] = $indexName; - } - } - - if ($type !== null) { - if ('form' === 'form' && is_array($type)) { - foreach ($type as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['type'] = $type; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Retrieve one object from the index. - * - * @param string $indexName The index in which to perform the request. (required) - * @param string $objectID Unique identifier of an object. (required) - * @param array $attributesToRetrieve List of attributes to retrieve. If not specified, all retrievable attributes are returned. (optional) - * - * @return array - */ - public function getObject($indexName, $objectID, $attributesToRetrieve = null) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling getObject' - ); - } - // verify the required parameter 'objectID' is set - if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $objectID when calling getObject' - ); - } - - $resourcePath = '/1/indexes/{indexName}/{objectID}'; - $queryParams = []; - $httpBody = []; - - if ($attributesToRetrieve !== null) { - if ('form' === 'form' && is_array($attributesToRetrieve)) { - foreach ($attributesToRetrieve as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['attributesToRetrieve'] = $attributesToRetrieve; - } - } - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - // path params - if ($objectID !== null) { - $resourcePath = str_replace( - '{objectID}', - ObjectSerializer::toPathValue($objectID), - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Retrieve one or more objects. - * - * @param array $getObjectsParams getObjectsParams (required) - * - * @return array - */ - public function getObjects($getObjectsParams) - { - // verify the required parameter 'getObjectsParams' is set - if ($getObjectsParams === null || (is_array($getObjectsParams) && count($getObjectsParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $getObjectsParams when calling getObjects' - ); - } - - $resourcePath = '/1/indexes/*/objects'; - $queryParams = []; - $httpBody = []; - - if (isset($getObjectsParams)) { - $httpBody = $getObjectsParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get a rule. - * - * @param string $indexName The index in which to perform the request. (required) - * @param string $objectID Unique identifier of an object. (required) - * - * @return array - */ - public function getRule($indexName, $objectID) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling getRule' - ); - } - // verify the required parameter 'objectID' is set - if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $objectID when calling getRule' - ); - } - - $resourcePath = '/1/indexes/{indexName}/rules/{objectID}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - // path params - if ($objectID !== null) { - $resourcePath = str_replace( - '{objectID}', - ObjectSerializer::toPathValue($objectID), - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Retrieve settings of a given indexName. - * - * @param string $indexName The index in which to perform the request. (required) - * - * @return array - */ - public function getSettings($indexName) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling getSettings' - ); - } - - $resourcePath = '/1/indexes/{indexName}/settings'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * List all allowed sources. - * - * - * @return array - */ - public function getSources() - { - $resourcePath = '/1/security/sources'; - $queryParams = []; - $httpBody = []; - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get synonym. - * - * @param string $indexName The index in which to perform the request. (required) - * @param string $objectID Unique identifier of an object. (required) - * - * @return array - */ - public function getSynonym($indexName, $objectID) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling getSynonym' - ); - } - // verify the required parameter 'objectID' is set - if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $objectID when calling getSynonym' - ); - } - - $resourcePath = '/1/indexes/{indexName}/synonyms/{objectID}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - // path params - if ($objectID !== null) { - $resourcePath = str_replace( - '{objectID}', - ObjectSerializer::toPathValue($objectID), - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Check the current status of a given task. - * - * @param string $indexName The index in which to perform the request. (required) - * @param int $taskID Unique identifier of an task. Numeric value (up to 64bits). (required) - * - * @return array - */ - public function getTask($indexName, $taskID) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling getTask' - ); - } - // verify the required parameter 'taskID' is set - if ($taskID === null || (is_array($taskID) && count($taskID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $taskID when calling getTask' - ); - } - - $resourcePath = '/1/indexes/{indexName}/task/{taskID}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - // path params - if ($taskID !== null) { - $resourcePath = str_replace( - '{taskID}', - ObjectSerializer::toPathValue($taskID), - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get top userID - * - * - * @return array - */ - public function getTopUserIds() - { - $resourcePath = '/1/clusters/mapping/top'; - $queryParams = []; - $httpBody = []; - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get userID - * - * @param string $userID userID to assign. (required) - * - * @return array - */ - public function getUserId($userID) - { - // verify the required parameter 'userID' is set - if ($userID === null || (is_array($userID) && count($userID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $userID when calling getUserId' - ); - } - if (!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $userID)) { - throw new \InvalidArgumentException('invalid value for "userID" when calling SearchApi.getUserId, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/.'); - } - - $resourcePath = '/1/clusters/mapping/{userID}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($userID !== null) { - $resourcePath = str_replace( - '{userID}', - ObjectSerializer::toPathValue($userID), - $resourcePath - ); - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Has pending mappings - * - * @param array $getClusters Whether to get clusters or not. (optional) - * - * @return array - */ - public function hasPendingMappings($getClusters = null) - { - $resourcePath = '/1/clusters/mapping/pending'; - $queryParams = []; - $httpBody = []; - - if ($getClusters !== null) { - if ('form' === 'form' && is_array($getClusters)) { - foreach ($getClusters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['getClusters'] = $getClusters; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get the full list of API Keys. - * - * - * @return array - */ - public function listApiKeys() - { - $resourcePath = '/1/keys'; - $queryParams = []; - $httpBody = []; - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * List clusters - * - * - * @return array - */ - public function listClusters() - { - $resourcePath = '/1/clusters'; - $queryParams = []; - $httpBody = []; - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * List existing indexes. - * - * @param int $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 array - */ - public function listIndices($page = null) - { - $resourcePath = '/1/indexes'; - $queryParams = []; - $httpBody = []; - - if ($page !== null) { - if ('form' === 'form' && is_array($page)) { - foreach ($page as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page'] = $page; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * List userIDs - * - * @param int $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 int $hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) - * - * @return array - */ - public function listUserIds($page = null, $hitsPerPage = 100) - { - $resourcePath = '/1/clusters/mapping'; - $queryParams = []; - $httpBody = []; - - if ($page !== null) { - if ('form' === 'form' && is_array($page)) { - foreach ($page as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page'] = $page; - } - } - - if ($hitsPerPage !== null) { - if ('form' === 'form' && is_array($hitsPerPage)) { - foreach ($hitsPerPage as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['hitsPerPage'] = $hitsPerPage; - } - } - - return $this->sendRequest('GET', $resourcePath, $queryParams, $httpBody); - } - - /** - * Perform multiple write operations. - * - * @param array $batchParams batchParams (required) - * - * @return array - */ - public function multipleBatch($batchParams) - { - // verify the required parameter 'batchParams' is set - if ($batchParams === null || (is_array($batchParams) && count($batchParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $batchParams when calling multipleBatch' - ); - } - - $resourcePath = '/1/indexes/*/batch'; - $queryParams = []; - $httpBody = []; - - if (isset($batchParams)) { - $httpBody = $batchParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get search results for the given requests. - * - * @param array $multipleQueriesParams multipleQueriesParams (required) - * - * @return array - */ - public function multipleQueries($multipleQueriesParams) - { - // verify the required parameter 'multipleQueriesParams' is set - if ($multipleQueriesParams === null || (is_array($multipleQueriesParams) && count($multipleQueriesParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $multipleQueriesParams when calling multipleQueries' - ); - } - - $resourcePath = '/1/indexes/*/queries'; - $queryParams = []; - $httpBody = []; - - if (isset($multipleQueriesParams)) { - $httpBody = $multipleQueriesParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Copy/move index. - * - * @param string $indexName The index in which to perform the request. (required) - * @param array $operationIndexParams operationIndexParams (required) - * - * @return array - */ - public function operationIndex($indexName, $operationIndexParams) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling operationIndex' - ); - } - // verify the required parameter 'operationIndexParams' is set - if ($operationIndexParams === null || (is_array($operationIndexParams) && count($operationIndexParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $operationIndexParams when calling operationIndex' - ); - } - - $resourcePath = '/1/indexes/{indexName}/operation'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - if (isset($operationIndexParams)) { - $httpBody = $operationIndexParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Partially update an object. - * - * @param string $indexName The index in which to perform the request. (required) - * @param string $objectID Unique identifier of an object. (required) - * @param array $attributeOrBuiltInOperation List of attributes to update. (required) - * @param array $createIfNotExists Creates the record if it does not exist yet. (optional, default to true) - * - * @return array - */ - public function partialUpdateObject($indexName, $objectID, $attributeOrBuiltInOperation, $createIfNotExists = true) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling partialUpdateObject' - ); - } - // verify the required parameter 'objectID' is set - if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $objectID when calling partialUpdateObject' - ); - } - // verify the required parameter 'attributeOrBuiltInOperation' is set - if ($attributeOrBuiltInOperation === null || (is_array($attributeOrBuiltInOperation) && count($attributeOrBuiltInOperation) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $attributeOrBuiltInOperation when calling partialUpdateObject' - ); - } - - $resourcePath = '/1/indexes/{indexName}/{objectID}/partial'; - $queryParams = []; - $httpBody = []; - - if ($createIfNotExists !== null) { - if ('form' === 'form' && is_array($createIfNotExists)) { - foreach ($createIfNotExists as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['createIfNotExists'] = $createIfNotExists; - } - } - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - // path params - if ($objectID !== null) { - $resourcePath = str_replace( - '{objectID}', - ObjectSerializer::toPathValue($objectID), - $resourcePath - ); - } - - if (isset($attributeOrBuiltInOperation)) { - $httpBody = $attributeOrBuiltInOperation; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function post($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling post' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Send requests to the Algolia REST API. - * - * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) - * @param array $parameters Query parameters to be applied to the current query. (optional) - * @param array $body The parameters to send with the custom request. (optional) - * - * @return array - */ - public function put($path, $parameters = null, $body = null) - { - // verify the required parameter 'path' is set - if ($path === null || (is_array($path) && count($path) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $path when calling put' - ); - } - - $resourcePath = '/1{path}'; - $queryParams = []; - $httpBody = []; - - if ($parameters !== null) { - if ('form' === 'form' && is_array($parameters)) { - foreach ($parameters as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams = $parameters; - } - } - - // path params - if ($path !== null) { - $resourcePath = str_replace( - '{path}', - path, - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - /** - * Remove userID - * - * @param string $userID userID to assign. (required) - * - * @return array - */ - public function removeUserId($userID) - { - // verify the required parameter 'userID' is set - if ($userID === null || (is_array($userID) && count($userID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $userID when calling removeUserId' - ); - } - if (!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $userID)) { - throw new \InvalidArgumentException('invalid value for "userID" when calling SearchApi.removeUserId, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/.'); - } - - $resourcePath = '/1/clusters/mapping/{userID}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($userID !== null) { - $resourcePath = str_replace( - '{userID}', - ObjectSerializer::toPathValue($userID), - $resourcePath - ); - } - - return $this->sendRequest('DELETE', $resourcePath, $queryParams, $httpBody); - } - - /** - * Replace all allowed sources. - * - * @param array $source The sources to allow. (required) - * - * @return array - */ - public function replaceSources($source) - { - // verify the required parameter 'source' is set - if ($source === null || (is_array($source) && count($source) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $source when calling replaceSources' - ); - } - - $resourcePath = '/1/security/sources'; - $queryParams = []; - $httpBody = []; - - if (isset($source)) { - $httpBody = $source; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - /** - * Restore an API key. - * - * @param string $key API Key string. (required) - * - * @return array - */ - public function restoreApiKey($key) - { - // verify the required parameter 'key' is set - if ($key === null || (is_array($key) && count($key) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $key when calling restoreApiKey' - ); - } - - $resourcePath = '/1/keys/{key}/restore'; - $queryParams = []; - $httpBody = []; - - // path params - if ($key !== null) { - $resourcePath = str_replace( - '{key}', - ObjectSerializer::toPathValue($key), - $resourcePath - ); - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Add an object to the index. - * - * @param string $indexName The index in which to perform the request. (required) - * @param array $body The Algolia record. (required) - * - * @return array - */ - public function saveObject($indexName, $body) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling saveObject' - ); - } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling saveObject' - ); - } - - $resourcePath = '/1/indexes/{indexName}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - if (isset($body)) { - $httpBody = $body; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Save/Update a rule. - * - * @param string $indexName The index in which to perform the request. (required) - * @param string $objectID Unique identifier of an object. (required) - * @param array $rule rule (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) - * - * @return array - */ - public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling saveRule' - ); - } - // verify the required parameter 'objectID' is set - if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $objectID when calling saveRule' - ); - } - // verify the required parameter 'rule' is set - if ($rule === null || (is_array($rule) && count($rule) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $rule when calling saveRule' - ); - } - - $resourcePath = '/1/indexes/{indexName}/rules/{objectID}'; - $queryParams = []; - $httpBody = []; - - if ($forwardToReplicas !== null) { - if ('form' === 'form' && is_array($forwardToReplicas)) { - foreach ($forwardToReplicas as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['forwardToReplicas'] = $forwardToReplicas; - } - } - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - // path params - if ($objectID !== null) { - $resourcePath = str_replace( - '{objectID}', - ObjectSerializer::toPathValue($objectID), - $resourcePath - ); - } - - if (isset($rule)) { - $httpBody = $rule; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - /** - * Save synonym. - * - * @param string $indexName The index in which to perform the request. (required) - * @param string $objectID Unique identifier of an object. (required) - * @param array $synonymHit synonymHit (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) - * - * @return array - */ - public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplicas = null) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling saveSynonym' - ); - } - // verify the required parameter 'objectID' is set - if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $objectID when calling saveSynonym' - ); - } - // verify the required parameter 'synonymHit' is set - if ($synonymHit === null || (is_array($synonymHit) && count($synonymHit) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $synonymHit when calling saveSynonym' - ); - } - - $resourcePath = '/1/indexes/{indexName}/synonyms/{objectID}'; - $queryParams = []; - $httpBody = []; - - if ($forwardToReplicas !== null) { - if ('form' === 'form' && is_array($forwardToReplicas)) { - foreach ($forwardToReplicas as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['forwardToReplicas'] = $forwardToReplicas; - } - } - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - // path params - if ($objectID !== null) { - $resourcePath = str_replace( - '{objectID}', - ObjectSerializer::toPathValue($objectID), - $resourcePath - ); - } - - if (isset($synonymHit)) { - $httpBody = $synonymHit; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - /** - * Save a batch of synonyms. - * - * @param string $indexName The index in which to perform the request. (required) - * @param array $synonymHit synonymHit (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) - * @param array $replaceExistingSynonyms Replace all synonyms of the index with the ones sent with this request. (optional) - * - * @return array - */ - public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, $replaceExistingSynonyms = null) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling saveSynonyms' - ); - } - // verify the required parameter 'synonymHit' is set - if ($synonymHit === null || (is_array($synonymHit) && count($synonymHit) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $synonymHit when calling saveSynonyms' - ); - } - - $resourcePath = '/1/indexes/{indexName}/synonyms/batch'; - $queryParams = []; - $httpBody = []; - - if ($forwardToReplicas !== null) { - if ('form' === 'form' && is_array($forwardToReplicas)) { - foreach ($forwardToReplicas as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['forwardToReplicas'] = $forwardToReplicas; - } - } - - if ($replaceExistingSynonyms !== null) { - if ('form' === 'form' && is_array($replaceExistingSynonyms)) { - foreach ($replaceExistingSynonyms as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['replaceExistingSynonyms'] = $replaceExistingSynonyms; - } - } - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - if (isset($synonymHit)) { - $httpBody = $synonymHit; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get search results. - * - * @param string $indexName The index in which to perform the request. (required) - * @param array $searchParams searchParams (required) - * - * @return array - */ - public function search($indexName, $searchParams) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling search' - ); - } - // verify the required parameter 'searchParams' is set - if ($searchParams === null || (is_array($searchParams) && count($searchParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $searchParams when calling search' - ); - } - - $resourcePath = '/1/indexes/{indexName}/query'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - if (isset($searchParams)) { - $httpBody = $searchParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Search the dictionary entries. - * - * @param array $dictionaryName The dictionary to search in. (required) - * @param array $searchDictionaryEntriesParams searchDictionaryEntriesParams (required) - * - * @return array - */ - public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntriesParams) - { - // verify the required parameter 'dictionaryName' is set - if ($dictionaryName === null || (is_array($dictionaryName) && count($dictionaryName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $dictionaryName when calling searchDictionaryEntries' - ); - } - // verify the required parameter 'searchDictionaryEntriesParams' is set - if ($searchDictionaryEntriesParams === null || (is_array($searchDictionaryEntriesParams) && count($searchDictionaryEntriesParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $searchDictionaryEntriesParams when calling searchDictionaryEntries' - ); - } - - $resourcePath = '/1/dictionaries/{dictionaryName}/search'; - $queryParams = []; - $httpBody = []; - - // path params - if ($dictionaryName !== null) { - $resourcePath = str_replace( - '{dictionaryName}', - ObjectSerializer::toPathValue($dictionaryName), - $resourcePath - ); - } - - if (isset($searchDictionaryEntriesParams)) { - $httpBody = $searchDictionaryEntriesParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Search for values of a given facet - * - * @param string $indexName The index in which to perform the request. (required) - * @param string $facetName The facet name. (required) - * @param array $searchForFacetValuesRequest searchForFacetValuesRequest (optional) - * - * @return array - */ - public function searchForFacetValues($indexName, $facetName, $searchForFacetValuesRequest = null) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling searchForFacetValues' - ); - } - // verify the required parameter 'facetName' is set - if ($facetName === null || (is_array($facetName) && count($facetName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $facetName when calling searchForFacetValues' - ); - } - - $resourcePath = '/1/indexes/{indexName}/facets/{facetName}/query'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - // path params - if ($facetName !== null) { - $resourcePath = str_replace( - '{facetName}', - ObjectSerializer::toPathValue($facetName), - $resourcePath - ); - } - - if (isset($searchForFacetValuesRequest)) { - $httpBody = $searchForFacetValuesRequest; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Search for rules. - * - * @param string $indexName The index in which to perform the request. (required) - * @param array $searchRulesParams searchRulesParams (required) - * - * @return array - */ - public function searchRules($indexName, $searchRulesParams) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling searchRules' - ); - } - // verify the required parameter 'searchRulesParams' is set - if ($searchRulesParams === null || (is_array($searchRulesParams) && count($searchRulesParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $searchRulesParams when calling searchRules' - ); - } - - $resourcePath = '/1/indexes/{indexName}/rules/search'; - $queryParams = []; - $httpBody = []; - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - if (isset($searchRulesParams)) { - $httpBody = $searchRulesParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Get all synonyms that match a query. - * - * @param string $indexName The index in which to perform the request. (required) - * @param string $query Search for specific synonyms matching this string. (optional, default to '') - * @param array $type Only search for specific types of synonyms. (optional) - * @param int $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 int $hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) - * - * @return array - */ - public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $hitsPerPage = 100) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling searchSynonyms' - ); - } - - $resourcePath = '/1/indexes/{indexName}/synonyms/search'; - $queryParams = []; - $httpBody = []; - - if ($query !== null) { - if ('form' === 'form' && is_array($query)) { - foreach ($query as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['query'] = $query; - } - } - - if ($type !== null) { - if ('form' === 'form' && is_array($type)) { - foreach ($type as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['type'] = $type; - } - } - - if ($page !== null) { - if ('form' === 'form' && is_array($page)) { - foreach ($page as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page'] = $page; - } - } - - if ($hitsPerPage !== null) { - if ('form' === 'form' && is_array($hitsPerPage)) { - foreach ($hitsPerPage as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['hitsPerPage'] = $hitsPerPage; - } - } - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Search userID - * - * @param array $searchUserIdsParams searchUserIdsParams (required) - * - * @return array - */ - public function searchUserIds($searchUserIdsParams) - { - // verify the required parameter 'searchUserIdsParams' is set - if ($searchUserIdsParams === null || (is_array($searchUserIdsParams) && count($searchUserIdsParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $searchUserIdsParams when calling searchUserIds' - ); - } - - $resourcePath = '/1/clusters/mapping/search'; - $queryParams = []; - $httpBody = []; - - if (isset($searchUserIdsParams)) { - $httpBody = $searchUserIdsParams; - } - - return $this->sendRequest('POST', $resourcePath, $queryParams, $httpBody); - } - - /** - * Set dictionary settings. - * - * @param array $dictionarySettingsParams dictionarySettingsParams (required) - * - * @return array - */ - public function setDictionarySettings($dictionarySettingsParams) - { - // verify the required parameter 'dictionarySettingsParams' is set - if ($dictionarySettingsParams === null || (is_array($dictionarySettingsParams) && count($dictionarySettingsParams) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $dictionarySettingsParams when calling setDictionarySettings' - ); - } - - $resourcePath = '/1/dictionaries/*/settings'; - $queryParams = []; - $httpBody = []; - - if (isset($dictionarySettingsParams)) { - $httpBody = $dictionarySettingsParams; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - /** - * Update settings of a given indexName. - * - * @param string $indexName The index in which to perform the request. (required) - * @param array $indexSettings indexSettings (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) - * - * @return array - */ - public function setSettings($indexName, $indexSettings, $forwardToReplicas = null) - { - // verify the required parameter 'indexName' is set - if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexName when calling setSettings' - ); - } - // verify the required parameter 'indexSettings' is set - if ($indexSettings === null || (is_array($indexSettings) && count($indexSettings) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indexSettings when calling setSettings' - ); - } - - $resourcePath = '/1/indexes/{indexName}/settings'; - $queryParams = []; - $httpBody = []; - - if ($forwardToReplicas !== null) { - if ('form' === 'form' && is_array($forwardToReplicas)) { - foreach ($forwardToReplicas as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['forwardToReplicas'] = $forwardToReplicas; - } - } - - // path params - if ($indexName !== null) { - $resourcePath = str_replace( - '{indexName}', - ObjectSerializer::toPathValue($indexName), - $resourcePath - ); - } - - if (isset($indexSettings)) { - $httpBody = $indexSettings; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - /** - * Update an API key. - * - * @param string $key API Key string. (required) - * @param array $apiKey apiKey (required) - * - * @return array - */ - public function updateApiKey($key, $apiKey) - { - // verify the required parameter 'key' is set - if ($key === null || (is_array($key) && count($key) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $key when calling updateApiKey' - ); - } - // verify the required parameter 'apiKey' is set - if ($apiKey === null || (is_array($apiKey) && count($apiKey) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $apiKey when calling updateApiKey' - ); - } - - $resourcePath = '/1/keys/{key}'; - $queryParams = []; - $httpBody = []; - - // path params - if ($key !== null) { - $resourcePath = str_replace( - '{key}', - ObjectSerializer::toPathValue($key), - $resourcePath - ); - } - - if (isset($apiKey)) { - $httpBody = $apiKey; - } - - return $this->sendRequest('PUT', $resourcePath, $queryParams, $httpBody); - } - - private function sendRequest($method, $resourcePath, $queryParams, $httpBody) - { - $query = \GuzzleHttp\Psr7\Query::build($queryParams); - - if ($method === 'GET') { - $request = $this->api->read( - $method, - $resourcePath . ($query ? "?{$query}" : '') - ); - } else { - $request = $this->api->write( - $method, - $resourcePath . ($query ? "?{$query}" : ''), - $httpBody - ); - } - - return $request; - } -} diff --git a/clients/algoliasearch-client-php/lib/ApiException.php b/clients/algoliasearch-client-php/lib/ApiException.php index d484a88eb5..e6e20caa09 100644 --- a/clients/algoliasearch-client-php/lib/ApiException.php +++ b/clients/algoliasearch-client-php/lib/ApiException.php @@ -2,7 +2,7 @@ namespace Algolia\AlgoliaSearch; -use \Exception; +use Exception; /** * ApiException Class Doc Comment @@ -41,7 +41,7 @@ class ApiException extends Exception * @param string[]|null $responseHeaders HTTP response header * @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string */ - public function __construct($message = '', $code = 0, $responseHeaders = [], $responseBody = null) + public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; diff --git a/clients/algoliasearch-client-php/lib/Cache/FileCacheDriver.php b/clients/algoliasearch-client-php/lib/Cache/FileCacheDriver.php index 86bcba64c9..9a83b6a4d2 100644 --- a/clients/algoliasearch-client-php/lib/Cache/FileCacheDriver.php +++ b/clients/algoliasearch-client-php/lib/Cache/FileCacheDriver.php @@ -6,7 +6,7 @@ final class FileCacheDriver implements CacheInterface { - const PREFIX = 'algolia-client-'; + public const PREFIX = 'algolia-client-'; private $directory; diff --git a/clients/algoliasearch-client-php/lib/Configuration/Configuration.php b/clients/algoliasearch-client-php/lib/Configuration/Configuration.php deleted file mode 100644 index 44c1de0eb7..0000000000 --- a/clients/algoliasearch-client-php/lib/Configuration/Configuration.php +++ /dev/null @@ -1,274 +0,0 @@ -setAlgoliaApiKey($config['apiKey']); - $this->setApiKey('X-Algolia-API-Key', $config['apiKey']); - } - - if (isset($config['appId'])) { - $this->setAppId($config['appId']); - $this->setApiKey('X-Algolia-Application-Id', $config['appId']); - } - - $config += $this->getDefaultConfiguration(); - $this->config = $config; - } - - /** - * Sets API key - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * @param string $key API key or token - * - * @return $this - */ - public function setApiKey($apiKeyIdentifier, $key) - { - $this->apiKeys[$apiKeyIdentifier] = $key; - - return $this; - } - - /** - * Gets API key - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * - * @return null|string API key or token - */ - public function getApiKey($apiKeyIdentifier) - { - return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; - } - - /** - * Sets debug flag - * - * @param bool $debug Debug flag - * - * @return $this - */ - public function setDebug($debug) - { - $this->debug = $debug; - - return $this; - } - - /** - * Gets the debug flag - * - * @return bool - */ - public function getDebug() - { - return $this->debug; - } - - /** - * Sets the debug file - * - * @param string $debugFile Debug file - * - * @return $this - */ - public function setDebugFile($debugFile) - { - $this->debugFile = $debugFile; - - return $this; - } - - /** - * Gets the debug file - * - * @return string - */ - public function getDebugFile() - { - return $this->debugFile; - } - - public function getDefaultConfiguration() - { - return [ - 'appId' => '', - 'apiKey' => '', - 'hosts' => null, - 'readTimeout' => $this->defaultReadTimeout, - 'writeTimeout' => $this->defaultWriteTimeout, - 'connectTimeout' => $this->defaultConnectTimeout, - 'defaultHeaders' => [], - ]; - } - - public function getAppId() - { - return $this->config['appId']; - } - - public function setAppId($appId) - { - $this->config['appId'] = $appId; - - return $this; - } - - public function getAlgoliaApiKey() - { - return $this->config['apiKey']; - } - - public function setAlgoliaApiKey($apiKey) - { - $this->config['apiKey'] = $apiKey; - - return $this; - } - - public function getHosts() - { - return $this->config['hosts']; - } - - public function setHosts($hosts) - { - $this->config['hosts'] = $hosts; - - return $this; - } - - public function getReadTimeout() - { - return $this->config['readTimeout']; - } - - public function setReadTimeout($readTimeout) - { - $this->config['readTimeout'] = $readTimeout; - - return $this; - } - - public function getWriteTimeout() - { - return $this->config['writeTimeout']; - } - - public function setWriteTimeout($writeTimeout) - { - $this->config['writeTimeout'] = $writeTimeout; - - return $this; - } - - public function getConnectTimeout() - { - return $this->config['connectTimeout']; - } - - public function setConnectTimeout($connectTimeout) - { - $this->config['connectTimeout'] = $connectTimeout; - - return $this; - } - - public function getDefaultHeaders() - { - return $this->config['defaultHeaders']; - } - - public function setDefaultHeaders(array $defaultHeaders) - { - $this->config['defaultHeaders'] = $defaultHeaders; - - return $this; - } - - /** - * Sets the user agent of the api client - * - * @param string $userAgent the user agent of the api client - * - * @throws \InvalidArgumentException - * - * @return $this - */ - public function setUserAgent($userAgent) - { - if (!is_string($userAgent)) { - throw new \InvalidArgumentException('User-agent must be a string.'); - } - - $this->userAgent = $userAgent; - - return $this; - } - - /** - * Gets the user agent of the api client - * - * @return string user agent - */ - public function getUserAgent() - { - return $this->userAgent; - } -} diff --git a/clients/algoliasearch-client-php/lib/Http/Psr7/Uri.php b/clients/algoliasearch-client-php/lib/Http/Psr7/Uri.php index 9d532477ac..0e576e4def 100644 --- a/clients/algoliasearch-client-php/lib/Http/Psr7/Uri.php +++ b/clients/algoliasearch-client-php/lib/Http/Psr7/Uri.php @@ -23,7 +23,7 @@ class Uri implements UriInterface * we apply this default host when no host is given yet to form a * valid URI. */ - const HTTP_DEFAULT_HOST = 'localhost'; + public const HTTP_DEFAULT_HOST = 'localhost'; private static $defaultPorts = [ 'http' => 80, diff --git a/clients/algoliasearch-client-php/lib/ObjectSerializer.php b/clients/algoliasearch-client-php/lib/ObjectSerializer.php deleted file mode 100644 index e59a9ce0e3..0000000000 --- a/clients/algoliasearch-client-php/lib/ObjectSerializer.php +++ /dev/null @@ -1,355 +0,0 @@ -format('Y-m-d') : $data->format(self::$dateTimeFormat); - } - - if (is_array($data)) { - foreach ($data as $property => $value) { - $data[$property] = self::sanitizeForSerialization($value); - } - - return $data; - } - - if (is_object($data)) { - $values = []; - if ($data instanceof ModelInterface) { - $formats = $data::openAPIFormats(); - foreach ($data::openAPITypes() as $property => $openAPIType) { - $getter = $data::getters()[$property]; - $value = $data->$getter(); - if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { - $callable = [$openAPIType, 'getAllowableEnumValues']; - if (is_callable($callable)) { - /** array $callable */ - $allowedEnumTypes = $callable(); - if (!in_array($value, $allowedEnumTypes, true)) { - $imploded = implode("', '", $allowedEnumTypes); - - throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); - } - } - } - if ($value !== null) { - $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); - } - } - } else { - foreach ($data as $property => $value) { - $values[$property] = self::sanitizeForSerialization($value); - } - } - - return (object) $values; - } - - return (string) $data; - } - - /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param string $filename filename to be sanitized - * - * @return string the sanitized filename - */ - public static function sanitizeFilename($filename) - { - if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { - return $match[1]; - } - - return $filename; - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the path, by url-encoding. - * - * @param string $value a string which will be part of the path - * - * @return string the serialized object - */ - public static function toPathValue($value) - { - return rawurlencode(self::toString($value)); - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the query, by imploding comma-separated if it's an object. - * If it's a string, pass through unchanged. It will be url-encoded - * later. - * - * @param string[]|string|\DateTime $object an object to be serialized to a string - * - * @return string the serialized object - */ - public static function toQueryValue($object) - { - if (is_array($object)) { - return implode(',', $object); - } - - return self::toString($object); - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the header. If it's a string, pass through unchanged - * If it's a datetime object, format it in ISO8601 - * - * @param string $value a string which will be part of the header - * - * @return string the header string - */ - public static function toHeaderValue($value) - { - $callable = [$value, 'toHeaderValue']; - if (is_callable($callable)) { - return $callable(); - } - - return self::toString($value); - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the http body (form parameter). If it's a string, pass through unchanged - * If it's a datetime object, format it in ISO8601 - * - * @param string|\SplFileObject $value the value of the form parameter - * - * @return string the form string - */ - public static function toFormValue($value) - { - if ($value instanceof \SplFileObject) { - return $value->getRealPath(); - } - - return self::toString($value); - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the parameter. If it's a string, pass through unchanged - * If it's a datetime object, format it in ISO8601 - * If it's a boolean, convert it to "true" or "false". - * - * @param string|bool|\DateTime $value the value of the parameter - * - * @return string the header string - */ - public static function toString($value) - { - if ($value instanceof \DateTime) { // datetime in ISO8601 format - return $value->format(self::$dateTimeFormat); - } elseif (is_bool($value)) { - return $value ? 'true' : 'false'; - } - - return $value; - } - - /** - * Serialize an array to a string. - * - * @param array $collection collection to serialize to a string - * @param string $style the format use for serialization (csv, - * ssv, tsv, pipes, multi) - * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array - * - * @return string - */ - public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) - { - if ($allowCollectionFormatMulti && ('multi' === $style)) { - // http_build_query() almost does the job for us. We just - // need to fix the result of multidimensional arrays. - return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); - } - switch ($style) { - case 'pipeDelimited': - case 'pipes': - return implode('|', $collection); - - case 'tsv': - return implode("\t", $collection); - - case 'spaceDelimited': - case 'ssv': - return implode(' ', $collection); - - case 'simple': - case 'csv': - // Deliberate fall through. CSV is default format. - default: - return implode(',', $collection); - } - } - - /** - * Deserialize a JSON string into an object - * - * @param mixed $data object or primitive to be deserialized - * @param string $class class name is passed as a string - * @param string[] $httpHeaders HTTP headers - * @param string $discriminator discriminator if polymorphism is used - * - * @return object|array|null a single or an array of $class instances - */ - public static function deserialize($data, $class, $httpHeaders = null) - { - if (null === $data) { - return null; - } - - if (strcasecmp(mb_substr($class, -2), '[]') === 0) { - $data = is_string($data) ? json_decode($data) : $data; - - if (!is_array($data)) { - throw new \InvalidArgumentException("Invalid array '$class'"); - } - - $subClass = mb_substr($class, 0, -2); - $values = []; - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); - } - - return $values; - } - - if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array - $data = is_string($data) ? json_decode($data) : $data; - settype($data, 'array'); - $inner = mb_substr($class, 4, -1); - $deserialized = []; - if (mb_strrpos($inner, ',') !== false) { - $subClass_array = explode(',', $inner, 2); - $subClass = $subClass_array[1]; - foreach ($data as $key => $value) { - $deserialized[$key] = self::deserialize($value, $subClass, null); - } - } - - return $deserialized; - } - - if ($class === 'object') { - settype($data, 'array'); - - return $data; - } elseif ($class === 'mixed') { - settype($data, gettype($data)); - - return $data; - } - - if ($class === '\DateTime') { - // Some API's return an invalid, empty string as a - // date-time property. DateTime::__construct() will return - // the current time for empty input which is probably not - // what is meant. The invalid empty string is probably to - // be interpreted as a missing field/value. Let's handle - // this graceful. - if (!empty($data)) { - try { - return new \DateTime($data); - } catch (\Exception $exception) { - // Some API's return a date-time with too high nanosecond - // precision for php's DateTime to handle. This conversion - // (string -> unix timestamp -> DateTime) is a workaround - // for the problem. - return (new \DateTime())->setTimestamp(strtotime($data)); - } - } else { - return null; - } - } - - /** @psalm-suppress ParadoxicalCondition */ - if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { - settype($data, $class); - - return $data; - } - - if (method_exists($class, 'getAllowableEnumValues')) { - if (!in_array($data, $class::getAllowableEnumValues(), true)) { - $imploded = implode("', '", $class::getAllowableEnumValues()); - - throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); - } - - return $data; - } - $data = is_string($data) ? json_decode($data) : $data; - // If a discriminator is defined and points to a valid subclass, use it. - $discriminator = $class::DISCRIMINATOR; - if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { - $subclass = '\Algolia\AlgoliaSearch\Model\\' . $data->{$discriminator}; - if (is_subclass_of($subclass, $class)) { - $class = $subclass; - } - } - - /** @var ModelInterface $instance */ - $instance = new $class(); - foreach ($instance::openAPITypes() as $property => $type) { - $propertySetter = $instance::setters()[$property]; - - if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { - continue; - } - - if (isset($data->{$instance::attributeMap()[$property]})) { - $propertyValue = $data->{$instance::attributeMap()[$property]}; - $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); - } - } - - return $instance; - } -} diff --git a/clients/algoliasearch-client-php/lib/RetryStrategy/Host.php b/clients/algoliasearch-client-php/lib/RetryStrategy/Host.php index d7685487ce..464e2ce618 100644 --- a/clients/algoliasearch-client-php/lib/RetryStrategy/Host.php +++ b/clients/algoliasearch-client-php/lib/RetryStrategy/Host.php @@ -15,7 +15,7 @@ final class Host private $lastCheck; - const TTL = 300; // 5 minutes + public const TTL = 300; // 5 minutes public function __construct($url, $priority = 0) { diff --git a/clients/algoliasearch-client-php/phpunit.xml.dist b/clients/algoliasearch-client-php/phpunit.xml.dist deleted file mode 100644 index 5221417220..0000000000 --- a/clients/algoliasearch-client-php/phpunit.xml.dist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - ../../tests/output/php/src/ - - - diff --git a/scripts/ci/gitignore-for-ci.sh b/scripts/ci/gitignore-for-ci.sh new file mode 100755 index 0000000000..9a6aa30e0c --- /dev/null +++ b/scripts/ci/gitignore-for-ci.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +sed -i '/Ignore all the generated code/q' .gitignore > /dev/null